- 
                Notifications
    You must be signed in to change notification settings 
- Fork 26
feat: register, change and verify email addresses #148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
046298c
              9bfbf4d
              89429d1
              f421aa0
              000faa2
              b465f2f
              be5fb7d
              5b8e3cf
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -30,11 +30,19 @@ import type { | |
| } from './safe-messages' | ||
| import type { DelegateResponse, DelegatesRequest } from './delegates' | ||
| import type { RegisterNotificationsRequest } from './notifications' | ||
| import type { | ||
| ChangeEmailRequestBody, | ||
| GetEmailResponse, | ||
| RegisterEmailRequestBody, | ||
| AuthorizationEmailRequestHeader, | ||
| VerifyEmailRequestBody, | ||
| } from './emails' | ||
|  | ||
| export type Primitive = string | number | boolean | null | ||
|  | ||
| interface Params { | ||
| path?: { [key: string]: Primitive } | ||
| headers?: Record<string, string> | ||
| } | ||
|  | ||
| interface GetParams extends Params { | ||
|  | @@ -70,6 +78,13 @@ export interface PostEndpoint extends Endpoint { | |
| } | ||
| } | ||
|  | ||
| export interface PutEndpoint extends Endpoint { | ||
| put: { | ||
| parameters: PostParams | null | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does  There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did not duplicate the types here as they are identical. 
 | ||
| responses: Responses | ||
| } | ||
| } | ||
|  | ||
| export interface DeleteEndpoint extends Endpoint { | ||
| delete: { | ||
| parameters: Params | null | ||
|  | @@ -78,7 +93,7 @@ export interface DeleteEndpoint extends Endpoint { | |
| } | ||
|  | ||
| interface PathRegistry { | ||
| [key: string]: GetEndpoint | PostEndpoint | (GetEndpoint & PostEndpoint) | DeleteEndpoint | ||
| [key: string]: GetEndpoint | PostEndpoint | PutEndpoint | DeleteEndpoint | ||
| } | ||
|  | ||
| export interface paths extends PathRegistry { | ||
|  | @@ -332,6 +347,47 @@ export interface paths extends PathRegistry { | |
| } | ||
| } | ||
| } | ||
| '/v1/chains/{chainId}/safes/{safe_address}/emails': { | ||
| post: operations['register_email'] | ||
| parameters: { | ||
| path: { | ||
| chainId: string | ||
| safe_address: string | ||
| } | ||
| } | ||
| } | ||
| '/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}': { | ||
| put: operations['change_email'] | ||
| get: operations['get_email'] | ||
| delete: operations['delete_email'] | ||
| parameters: { | ||
| path: { | ||
| chainId: string | ||
| safe_address: string | ||
| signer: string | ||
| } | ||
| } | ||
| } | ||
| '/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}/verify-resend': { | ||
| post: operations['verify_resend'] | ||
| parameters: { | ||
| path: { | ||
| chainId: string | ||
| safe_address: string | ||
| signer: string | ||
| } | ||
| } | ||
| } | ||
| '/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}/verify': { | ||
| put: operations['verify_email'] | ||
| parameters: { | ||
| path: { | ||
| chainId: string | ||
| safe_address: string | ||
| signer: string | ||
| } | ||
| } | ||
| } | ||
| } | ||
|  | ||
| export interface operations { | ||
|  | @@ -833,4 +889,114 @@ export interface operations { | |
| } | ||
| } | ||
| } | ||
| register_email: { | ||
| parameters: { | ||
| path: { | ||
| chainId: string | ||
| safe_address: string | ||
| } | ||
| body: RegisterEmailRequestBody | ||
| headers: AuthorizationEmailRequestHeader | ||
| } | ||
| responses: { | ||
| 200: { | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here it should be 201. | ||
| schema: void | ||
| } | ||
| 201: { | ||
| schema: void | ||
| } | ||
| } | ||
| } | ||
| change_email: { | ||
| parameters: { | ||
| path: { | ||
| chainId: string | ||
| safe_address: string | ||
| signer: string | ||
| } | ||
| body: ChangeEmailRequestBody | ||
| headers: AuthorizationEmailRequestHeader | ||
| } | ||
| responses: { | ||
| 200: { | ||
| schema: void | ||
| } | ||
| 202: { | ||
| schema: void | ||
| } | ||
| } | ||
| 
      Comment on lines
    
      +920
     to 
      +927
    
   There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this only include successful responses? If so then only  | ||
| } | ||
| get_email: { | ||
| parameters: { | ||
| path: { | ||
| chainId: string | ||
| safe_address: string | ||
| signer: string | ||
| } | ||
| headers: AuthorizationEmailRequestHeader | ||
| } | ||
| responses: { | ||
| 200: { | ||
| schema: GetEmailResponse | ||
| } | ||
| } | ||
| } | ||
| verify_resend: { | ||
| parameters: { | ||
| path: { | ||
| chainId: string | ||
| safe_address: string | ||
| signer: string | ||
| } | ||
| body: '' | ||
| } | ||
| responses: { | ||
| 202: { | ||
| schema: void | ||
| } | ||
| 200: { | ||
| schema: void | ||
| } | ||
| } | ||
| } | ||
| verify_email: { | ||
| parameters: { | ||
| path: { | ||
| chainId: string | ||
| safe_address: string | ||
| signer: string | ||
| } | ||
| body: VerifyEmailRequestBody | ||
| } | ||
|  | ||
| responses: { | ||
| 204: { | ||
| schema: void | ||
| } | ||
| 200: { | ||
| schema: void | ||
| } | ||
| 
      Comment on lines
    
      +976
     to 
      +978
    
   There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This status code is not expected to be returned on this endpoint. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Currently our types enforce a 200 response code this. We should look into how to make them more flexible. | ||
| 400: unknown | ||
| } | ||
| } | ||
| delete_email: { | ||
| parameters: { | ||
| path: { | ||
| chainId: string | ||
| safe_address: string | ||
| signer: string | ||
| } | ||
| headers: AuthorizationEmailRequestHeader | ||
| } | ||
|  | ||
| responses: { | ||
| 204: { | ||
| schema: void | ||
| } | ||
| 200: { | ||
| schema: void | ||
| } | ||
| 403: unknown | ||
| } | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.