diff --git a/api/org_tangled/accountaddEmail.go b/api/org_tangled/accountaddEmail.go new file mode 100644 index 00000000..9b144ce0 --- /dev/null +++ b/api/org_tangled/accountaddEmail.go @@ -0,0 +1,30 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.account.addEmail + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempAccountAddEmailNSID = "org.tangled.temp.account.addEmail" +) + +// TempAccountAddEmail_Input is the input argument to a org.tangled.temp.account.addEmail call. +type TempAccountAddEmail_Input struct { + // email: Email address to add. + Email string `json:"email" cborgen:"email"` +} + +// TempAccountAddEmail calls the XRPC method "org.tangled.temp.account.addEmail". +func TempAccountAddEmail(ctx context.Context, c util.LexClient, input *TempAccountAddEmail_Input) error { + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.account.addEmail", nil, input, nil); err != nil { + return err + } + + return nil +} diff --git a/api/org_tangled/accountverifyEmail.go b/api/org_tangled/accountverifyEmail.go new file mode 100644 index 00000000..722d4efc --- /dev/null +++ b/api/org_tangled/accountverifyEmail.go @@ -0,0 +1,37 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.account.verifyEmail + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempAccountVerifyEmailNSID = "org.tangled.temp.account.verifyEmail" +) + +// TempAccountVerifyEmail_Input is the input argument to a org.tangled.temp.account.verifyEmail call. +type TempAccountVerifyEmail_Input struct { + // token: Verification token from the emailed link. + Token string `json:"token" cborgen:"token"` +} + +// TempAccountVerifyEmail_Output is the output of a org.tangled.temp.account.verifyEmail call. +type TempAccountVerifyEmail_Output struct { + // email: The address that was verified. + Email string `json:"email" cborgen:"email"` +} + +// TempAccountVerifyEmail calls the XRPC method "org.tangled.temp.account.verifyEmail". +func TempAccountVerifyEmail(ctx context.Context, c util.LexClient, input *TempAccountVerifyEmail_Input) (*TempAccountVerifyEmail_Output, error) { + var out TempAccountVerifyEmail_Output + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.account.verifyEmail", nil, input, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/lexicons/temp/account/addEmail.json b/lexicons/temp/account/addEmail.json new file mode 100644 index 00000000..5b06850a --- /dev/null +++ b/lexicons/temp/account/addEmail.json @@ -0,0 +1,26 @@ +{ + "lexicon": 1, + "id": "org.tangled.temp.account.addEmail", + "defs": { + "main": { + "type": "procedure", + "description": "Add an email address to the authenticated account. Sends a verification code; the address remains unverified until the code is submitted via verifyEmail. Calling again for an already-added unverified address resends a fresh code.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": ["email"], + "properties": { + "email": { + "type": "string", + "description": "Email address to add." + } + } + } + }, + "errors": [ + { "name": "EmailAlreadyRegistered", "description": "An account already exists for this email address." } + ] + } + } +} diff --git a/lexicons/temp/account/verifyEmail.json b/lexicons/temp/account/verifyEmail.json new file mode 100644 index 00000000..298e738c --- /dev/null +++ b/lexicons/temp/account/verifyEmail.json @@ -0,0 +1,39 @@ +{ + "lexicon": 1, + "id": "org.tangled.temp.account.verifyEmail", + "defs": { + "main": { + "type": "procedure", + "description": "Verify an email address using the token from the verification link emailed by addEmail. The address becomes verified, and is made primary if it is the account's first verified address. Tokens are single-use.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": ["token"], + "properties": { + "token": { + "type": "string", + "description": "Verification token from the emailed link." + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": ["email"], + "properties": { + "email": { + "type": "string", + "description": "The address that was verified." + } + } + } + }, + "errors": [ + { "name": "InvalidCode", "description": "The verification link is invalid or expired." } + ] + } + } +}