@atproto/oauth-provider-api 0.5.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/api-endpoints.d.ts +59 -0
- package/dist/api-endpoints.d.ts.map +1 -1
- package/dist/api-endpoints.js.map +1 -1
- package/dist/customization-data.d.ts +1 -0
- package/dist/customization-data.d.ts.map +1 -1
- package/dist/customization-data.js.map +1 -1
- package/dist/errors.d.ts +4 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +16 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/api-endpoints.ts +57 -0
- package/src/customization-data.ts +1 -0
- package/src/errors.ts +21 -0
- package/src/index.ts +1 -0
- package/tsconfig.build.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atproto/oauth-provider-api
|
|
2
2
|
|
|
3
|
+
## 0.6.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#4986](https://github.com/bluesky-social/atproto/pull/4986) [`6c63f7d`](https://github.com/bluesky-social/atproto/commit/6c63f7dca6d37c22a8dd5d579ad6a72e532fc372) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Add ability to change the user handle through the account manager interface
|
|
8
|
+
|
|
9
|
+
## 0.6.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#4883](https://github.com/bluesky-social/atproto/pull/4883) [`64f5148`](https://github.com/bluesky-social/atproto/commit/64f5148ad8dcd669f77a9e022bd2622b2e594e0d) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Add support for email verification and management in the account management interface
|
|
14
|
+
|
|
3
15
|
## 0.5.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/dist/api-endpoints.d.ts
CHANGED
|
@@ -89,6 +89,39 @@ export type ApiEndpoints = {
|
|
|
89
89
|
success: true;
|
|
90
90
|
};
|
|
91
91
|
};
|
|
92
|
+
'/update-email-request': {
|
|
93
|
+
method: 'POST';
|
|
94
|
+
input: InitiateEmailUpdateInput;
|
|
95
|
+
output: InitiateEmailUpdateOutput;
|
|
96
|
+
};
|
|
97
|
+
'/update-email-confirm': {
|
|
98
|
+
method: 'POST';
|
|
99
|
+
input: ConfirmEmailUpdateInput;
|
|
100
|
+
output: {
|
|
101
|
+
success: true;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
'/verify-email-request': {
|
|
105
|
+
method: 'POST';
|
|
106
|
+
input: InitiateEmailVerificationInput;
|
|
107
|
+
output: {
|
|
108
|
+
success: true;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
'/verify-email-confirm': {
|
|
112
|
+
method: 'POST';
|
|
113
|
+
input: ConfirmEmailVerificationInput;
|
|
114
|
+
output: {
|
|
115
|
+
success: true;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
'/update-handle': {
|
|
119
|
+
method: 'POST';
|
|
120
|
+
input: UpdateHandleInput;
|
|
121
|
+
output: {
|
|
122
|
+
success: true;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
92
125
|
'/consent': {
|
|
93
126
|
method: 'POST';
|
|
94
127
|
input: ConsentInput;
|
|
@@ -149,9 +182,35 @@ export type ConfirmResetPasswordInput = {
|
|
|
149
182
|
token: string;
|
|
150
183
|
password: string;
|
|
151
184
|
};
|
|
185
|
+
export type InitiateEmailUpdateInput = {
|
|
186
|
+
sub: string;
|
|
187
|
+
locale?: string;
|
|
188
|
+
};
|
|
189
|
+
export type InitiateEmailUpdateOutput = {
|
|
190
|
+
tokenRequired: boolean;
|
|
191
|
+
};
|
|
192
|
+
export type ConfirmEmailUpdateInput = {
|
|
193
|
+
sub: string;
|
|
194
|
+
token?: string;
|
|
195
|
+
email: string;
|
|
196
|
+
locale?: string;
|
|
197
|
+
};
|
|
198
|
+
export type InitiateEmailVerificationInput = {
|
|
199
|
+
sub: string;
|
|
200
|
+
locale?: string;
|
|
201
|
+
};
|
|
202
|
+
export type ConfirmEmailVerificationInput = {
|
|
203
|
+
sub: string;
|
|
204
|
+
token: string;
|
|
205
|
+
email: string;
|
|
206
|
+
};
|
|
152
207
|
export type VerifyHandleAvailabilityInput = {
|
|
153
208
|
handle: string;
|
|
154
209
|
};
|
|
210
|
+
export type UpdateHandleInput = {
|
|
211
|
+
sub: string;
|
|
212
|
+
handle: string;
|
|
213
|
+
};
|
|
155
214
|
export type RevokeAccountSessionInput = {
|
|
156
215
|
sub: string;
|
|
157
216
|
deviceId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-endpoints.d.ts","sourceRoot":"","sources":["../src/api-endpoints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC/D,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,aAAa,EACb,OAAO,EACR,MAAM,YAAY,CAAA;AAKnB,MAAM,MAAM,YAAY,GAAG;IACzB,6BAA6B,EAAE;QAC7B,MAAM,EAAE,MAAM,CAAA;QACd,KAAK,EAAE,6BAA6B,CAAA;QACpC,MAAM,EAAE;YAAE,SAAS,EAAE,IAAI,CAAA;SAAE,CAAA;KAC5B,CAAA;IACD,UAAU,EAAE;QACV,MAAM,EAAE,MAAM,CAAA;QACd,KAAK,EAAE,WAAW,CAAA;QAClB,MAAM,EAAE,YAAY,CAAA;KACrB,CAAA;IACD,UAAU,EAAE;QACV,MAAM,EAAE,MAAM,CAAA;QACd,KAAK,EAAE,WAAW,CAAA;QAClB,MAAM,EAAE,YAAY,CAAA;KACrB,CAAA;IACD,yBAAyB,EAAE;QACzB,MAAM,EAAE,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AAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG,kBAAkB,EAAE,CAAA;AAEtD,MAAM,MAAM,oBAAoB,GAAG;IACjC,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG,oBAAoB,EAAE,CAAA;AAE1D,MAAM,MAAM,uBAAuB,GAAG;IACpC,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;AAE/C;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,OAAO,CAAA;IAEhB;;OAEG;IACH,aAAa,EAAE,OAAO,CAAA;CACvB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,EAAE,MAAM,CAAA;IAChB,cAAc,EAAE,cAAc,CAAA;IAE9B,eAAe,EAAE,OAAO,CAAA;CACzB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,MAAM,CAAA;IAEf,SAAS,EAAE,aAAa,CAAA;IACxB,SAAS,EAAE,aAAa,CAAA;IAExB,QAAQ,EAAE,MAAM,CAAA;IAChB,+EAA+E;IAC/E,cAAc,CAAC,EAAE,mBAAmB,CAAA;IAEpC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-endpoints.js","sourceRoot":"","sources":["../src/api-endpoints.ts"],"names":[],"mappings":"","sourcesContent":["import type { SignedJwt } from '@atproto/jwk'\nimport type { OAuthClientMetadata } from '@atproto/oauth-types'\nimport type {\n Account,\n DeviceMetadata,\n ISODateString,\n Session,\n} from './types.js'\n\n// These are the endpoints implemented by the OAuth provider, for its UI to\n// call.\n\nexport type ApiEndpoints = {\n '/verify-handle-availability': {\n method: 'POST'\n input: VerifyHandleAvailabilityInput\n output: { available: true }\n }\n '/sign-up': {\n method: 'POST'\n input: SignUpInput\n output: SignUpOutput\n }\n '/sign-in': {\n method: 'POST'\n input: SignInInput\n output: SignInOutput\n }\n '/reset-password-request': {\n method: 'POST'\n input: InitiatePasswordResetInput\n output: { success: true }\n }\n '/reset-password-confirm': {\n method: 'POST'\n input: ConfirmResetPasswordInput\n output: { success: true }\n }\n '/sign-out': {\n method: 'POST'\n input: SignOutInput\n output: { success: true }\n }\n /**\n * Lists all the accounts that are currently active, on the current device.\n */\n '/device-sessions': {\n method: 'GET'\n output: Session[]\n }\n /**\n * Lists all the active OAuth sessions (access/refresh tokens) that where\n * issued to OAuth clients (apps).\n *\n * @NOTE can be revoked using the oauth revocation endpoint (json or form\n * encoded)\n *\n * ```http\n * POST /oauth/revoke\n * Content-Type: application/x-www-form-urlencoded\n *\n * token=<tokenId>\n * ```\n */\n '/oauth-sessions': {\n method: 'GET'\n params: OAuthSessionsInput\n output: OAuthSessionsOutput\n }\n '/revoke-oauth-session': {\n method: 'POST'\n input: RevokeOAuthSessionInput\n output: { success: true }\n }\n /**\n * Lists all the sessions that are currently active for a particular user, on\n * other devices.\n */\n '/account-sessions': {\n method: 'GET'\n params: AccountSessionsInput\n output: AccountSessionsOutput\n }\n '/revoke-account-session': {\n method: 'POST'\n input: RevokeAccountSessionInput\n output: { success: true }\n }\n '/consent': {\n method: 'POST'\n input: ConsentInput\n output: { url: string }\n }\n '/reject': {\n method: 'POST'\n input: RejectInput\n output: { url: string }\n }\n}\n\n/**\n * When a user signs in without the \"remember me\" option, the server returns an\n * ephemeral token. When used as `Bearer` authorization header, the token will\n * be used in order to authenticate the users in place of using the user's\n * cookie based session (which are only created when \"remember me\" is checked).\n *\n * Only include this token in the `Authorization` header when making requests to\n * the OAuth provider API, **FOR THE ACCOUNT IT WAS GENERATED FOR**.\n */\nexport type EphemeralToken = SignedJwt\n\nexport type SignInInput = {\n locale: string\n username: string\n password: string\n emailOtp?: string\n remember?: boolean\n}\n\nexport type SignInOutput = {\n account: Account\n ephemeralToken?: EphemeralToken\n consentRequired?: boolean\n}\n\nexport type SignUpInput = {\n locale: string\n handle: string\n email: string\n password: string\n inviteCode?: string\n hcaptchaToken?: string\n}\n\nexport type SignUpOutput = {\n account: Account\n ephemeralToken?: EphemeralToken\n}\n\nexport type SignOutInput = {\n sub: string | string[]\n}\n\nexport type InitiatePasswordResetInput = {\n locale: string\n email: string\n}\n\nexport type ConfirmResetPasswordInput = {\n token: string\n password: string\n}\n\nexport type VerifyHandleAvailabilityInput = {\n handle: string\n}\n\nexport type RevokeAccountSessionInput = {\n sub: string\n deviceId: string\n}\n\nexport type OAuthSessionsInput = {\n sub: string\n}\n\nexport type OAuthSessionsOutput = ActiveOAuthSession[]\n\nexport type AccountSessionsInput = {\n sub: string\n}\n\nexport type AccountSessionsOutput = ActiveAccountSession[]\n\nexport type RevokeOAuthSessionInput = {\n sub: string\n tokenId: string\n}\n\nexport type ConsentInput = {\n sub: string\n scope?: string\n}\n\nexport type RejectInput = Record<string, never>\n\n/**\n * Represents an account that is currently signed-in to the Authorization\n * Server. If the session was created too long ago, the user may be required to\n * re-authenticate ({@link ActiveDeviceSession.loginRequired}).\n */\nexport type ActiveDeviceSession = {\n account: Account\n\n /**\n * The session is too old and the user must re-authenticate.\n */\n loginRequired: boolean\n}\n\n/**\n * Represents another device on which an account is currently signed-in.\n */\nexport type ActiveAccountSession = {\n deviceId: string\n deviceMetadata: DeviceMetadata\n\n isCurrentDevice: boolean\n}\n\n/**\n * Represents an active OAuth session (access token).\n */\nexport type ActiveOAuthSession = {\n tokenId: string\n\n createdAt: ISODateString\n updatedAt: ISODateString\n\n clientId: string\n /** An \"undefined\" value means that the client metadata could not be fetched */\n clientMetadata?: OAuthClientMetadata\n\n scope?: string\n}\n"]}
|
|
1
|
+
{"version":3,"file":"api-endpoints.js","sourceRoot":"","sources":["../src/api-endpoints.ts"],"names":[],"mappings":"","sourcesContent":["import type { SignedJwt } from '@atproto/jwk'\nimport type { OAuthClientMetadata } from '@atproto/oauth-types'\nimport type {\n Account,\n DeviceMetadata,\n ISODateString,\n Session,\n} from './types.js'\n\n// These are the endpoints implemented by the OAuth provider, for its UI to\n// call.\n\nexport type ApiEndpoints = {\n '/verify-handle-availability': {\n method: 'POST'\n input: VerifyHandleAvailabilityInput\n output: { available: true }\n }\n '/sign-up': {\n method: 'POST'\n input: SignUpInput\n output: SignUpOutput\n }\n '/sign-in': {\n method: 'POST'\n input: SignInInput\n output: SignInOutput\n }\n '/reset-password-request': {\n method: 'POST'\n input: InitiatePasswordResetInput\n output: { success: true }\n }\n '/reset-password-confirm': {\n method: 'POST'\n input: ConfirmResetPasswordInput\n output: { success: true }\n }\n '/sign-out': {\n method: 'POST'\n input: SignOutInput\n output: { success: true }\n }\n /**\n * Lists all the accounts that are currently active, on the current device.\n */\n '/device-sessions': {\n method: 'GET'\n output: Session[]\n }\n /**\n * Lists all the active OAuth sessions (access/refresh tokens) that where\n * issued to OAuth clients (apps).\n *\n * @NOTE can be revoked using the oauth revocation endpoint (json or form\n * encoded)\n *\n * ```http\n * POST /oauth/revoke\n * Content-Type: application/x-www-form-urlencoded\n *\n * token=<tokenId>\n * ```\n */\n '/oauth-sessions': {\n method: 'GET'\n params: OAuthSessionsInput\n output: OAuthSessionsOutput\n }\n '/revoke-oauth-session': {\n method: 'POST'\n input: RevokeOAuthSessionInput\n output: { success: true }\n }\n /**\n * Lists all the sessions that are currently active for a particular user, on\n * other devices.\n */\n '/account-sessions': {\n method: 'GET'\n params: AccountSessionsInput\n output: AccountSessionsOutput\n }\n '/revoke-account-session': {\n method: 'POST'\n input: RevokeAccountSessionInput\n output: { success: true }\n }\n '/update-email-request': {\n method: 'POST'\n input: InitiateEmailUpdateInput\n output: InitiateEmailUpdateOutput\n }\n '/update-email-confirm': {\n method: 'POST'\n input: ConfirmEmailUpdateInput\n output: { success: true }\n }\n '/verify-email-request': {\n method: 'POST'\n input: InitiateEmailVerificationInput\n output: { success: true }\n }\n '/verify-email-confirm': {\n method: 'POST'\n input: ConfirmEmailVerificationInput\n output: { success: true }\n }\n '/update-handle': {\n method: 'POST'\n input: UpdateHandleInput\n output: { success: true }\n }\n '/consent': {\n method: 'POST'\n input: ConsentInput\n output: { url: string }\n }\n '/reject': {\n method: 'POST'\n input: RejectInput\n output: { url: string }\n }\n}\n\n/**\n * When a user signs in without the \"remember me\" option, the server returns an\n * ephemeral token. When used as `Bearer` authorization header, the token will\n * be used in order to authenticate the users in place of using the user's\n * cookie based session (which are only created when \"remember me\" is checked).\n *\n * Only include this token in the `Authorization` header when making requests to\n * the OAuth provider API, **FOR THE ACCOUNT IT WAS GENERATED FOR**.\n */\nexport type EphemeralToken = SignedJwt\n\nexport type SignInInput = {\n locale: string\n username: string\n password: string\n emailOtp?: string\n remember?: boolean\n}\n\nexport type SignInOutput = {\n account: Account\n ephemeralToken?: EphemeralToken\n consentRequired?: boolean\n}\n\nexport type SignUpInput = {\n locale: string\n handle: string\n email: string\n password: string\n inviteCode?: string\n hcaptchaToken?: string\n}\n\nexport type SignUpOutput = {\n account: Account\n ephemeralToken?: EphemeralToken\n}\n\nexport type SignOutInput = {\n sub: string | string[]\n}\n\nexport type InitiatePasswordResetInput = {\n locale: string\n email: string\n}\n\nexport type ConfirmResetPasswordInput = {\n token: string\n password: string\n}\n\nexport type InitiateEmailUpdateInput = {\n sub: string\n locale?: string\n}\n\nexport type InitiateEmailUpdateOutput = {\n tokenRequired: boolean\n}\n\nexport type ConfirmEmailUpdateInput = {\n sub: string\n token?: string\n email: string\n locale?: string\n}\n\nexport type InitiateEmailVerificationInput = {\n sub: string\n locale?: string\n}\n\nexport type ConfirmEmailVerificationInput = {\n sub: string\n token: string\n email: string\n}\n\nexport type VerifyHandleAvailabilityInput = {\n handle: string\n}\n\nexport type UpdateHandleInput = {\n sub: string\n handle: string\n}\n\nexport type RevokeAccountSessionInput = {\n sub: string\n deviceId: string\n}\n\nexport type OAuthSessionsInput = {\n sub: string\n}\n\nexport type OAuthSessionsOutput = ActiveOAuthSession[]\n\nexport type AccountSessionsInput = {\n sub: string\n}\n\nexport type AccountSessionsOutput = ActiveAccountSession[]\n\nexport type RevokeOAuthSessionInput = {\n sub: string\n tokenId: string\n}\n\nexport type ConsentInput = {\n sub: string\n scope?: string\n}\n\nexport type RejectInput = Record<string, never>\n\n/**\n * Represents an account that is currently signed-in to the Authorization\n * Server. If the session was created too long ago, the user may be required to\n * re-authenticate ({@link ActiveDeviceSession.loginRequired}).\n */\nexport type ActiveDeviceSession = {\n account: Account\n\n /**\n * The session is too old and the user must re-authenticate.\n */\n loginRequired: boolean\n}\n\n/**\n * Represents another device on which an account is currently signed-in.\n */\nexport type ActiveAccountSession = {\n deviceId: string\n deviceMetadata: DeviceMetadata\n\n isCurrentDevice: boolean\n}\n\n/**\n * Represents an active OAuth session (access token).\n */\nexport type ActiveOAuthSession = {\n tokenId: string\n\n createdAt: ISODateString\n updatedAt: ISODateString\n\n clientId: string\n /** An \"undefined\" value means that the client metadata could not be fetched */\n clientMetadata?: OAuthClientMetadata\n\n scope?: string\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customization-data.d.ts","sourceRoot":"","sources":["../src/customization-data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAKhD,MAAM,MAAM,iBAAiB,GAAG;IAE9B,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"customization-data.d.ts","sourceRoot":"","sources":["../src/customization-data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAKhD,MAAM,MAAM,iBAAiB,GAAG;IAE9B,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC/B,2BAA2B,CAAC,EAAE,OAAO,CAAA;IAGrC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,cAAc,EAAE,CAAA;CACzB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customization-data.js","sourceRoot":"","sources":["../src/customization-data.ts"],"names":[],"mappings":"","sourcesContent":["import type { LinkDefinition } from './types.js'\n\n// These are the types of the variables that are injected into the HTML by the\n// backend. They are used to configure the frontend.\n\nexport type CustomizationData = {\n // Functional customization\n hcaptchaSiteKey?: string\n inviteCodeRequired?: boolean\n availableUserDomains?: string[]\n\n // Aesthetic customization\n name?: string\n logo?: string\n links?: LinkDefinition[]\n}\n"]}
|
|
1
|
+
{"version":3,"file":"customization-data.js","sourceRoot":"","sources":["../src/customization-data.ts"],"names":[],"mappings":"","sourcesContent":["import type { LinkDefinition } from './types.js'\n\n// These are the types of the variables that are injected into the HTML by the\n// backend. They are used to configure the frontend.\n\nexport type CustomizationData = {\n // Functional customization\n hcaptchaSiteKey?: string\n inviteCodeRequired?: boolean\n availableUserDomains?: string[]\n show2FaWarningOnEmailUpdate?: boolean\n\n // Aesthetic customization\n name?: string\n logo?: string\n links?: LinkDefinition[]\n}\n"]}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const HANDLE_UNAVAILABLE_REASON: readonly ["syntax", "domain", "slur", "taken", "reserved", "resolution", "unsupported"];
|
|
2
|
+
export type HandleUnavailableReason = (typeof HANDLE_UNAVAILABLE_REASON)[number];
|
|
3
|
+
export declare const isHandleUnavailableReason: (value: unknown) => value is HandleUnavailableReason;
|
|
4
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,yFAQ3B,CAAA;AAEX,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEhF,eAAO,MAAM,yBAAyB,GACpC,OAAO,OAAO,KACb,KAAK,IAAI,uBAEX,CAAA"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const HANDLE_UNAVAILABLE_REASON = Object.freeze([
|
|
2
|
+
'syntax',
|
|
3
|
+
'domain',
|
|
4
|
+
'slur',
|
|
5
|
+
'taken',
|
|
6
|
+
'reserved',
|
|
7
|
+
'resolution',
|
|
8
|
+
'unsupported',
|
|
9
|
+
]);
|
|
10
|
+
export const isHandleUnavailableReason = (value) => {
|
|
11
|
+
return HANDLE_UNAVAILABLE_REASON.includes(value);
|
|
12
|
+
};
|
|
13
|
+
// @TODO consider moving JsonErrorResponse & sub-classes here (or only the
|
|
14
|
+
// schemas?), allowing the same code to be used on both the server and client
|
|
15
|
+
// for error handling/parsing/formatting.
|
|
16
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,MAAM,CAAC;IACrD,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,OAAO;IACP,UAAU;IACV,YAAY;IACZ,aAAa;CACL,CAAC,CAAA;AAIX,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACvC,KAAc,EACoB,EAAE;IACpC,OAAQ,yBAAgD,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;AAC1E,CAAC,CAAA;AAED,0EAA0E;AAC1E,6EAA6E;AAC7E,yCAAyC","sourcesContent":["export const HANDLE_UNAVAILABLE_REASON = Object.freeze([\n 'syntax',\n 'domain',\n 'slur',\n 'taken',\n 'reserved',\n 'resolution',\n 'unsupported',\n] as const)\n\nexport type HandleUnavailableReason = (typeof HANDLE_UNAVAILABLE_REASON)[number]\n\nexport const isHandleUnavailableReason = (\n value: unknown,\n): value is HandleUnavailableReason => {\n return (HANDLE_UNAVAILABLE_REASON as readonly unknown[]).includes(value)\n}\n\n// @TODO consider moving JsonErrorResponse & sub-classes here (or only the\n// schemas?), allowing the same code to be used on both the server and client\n// for error handling/parsing/formatting.\n"]}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,oBAAoB,CAAA;AACvC,mBAAmB,yBAAyB,CAAA;AAC5C,mBAAmB,YAAY,CAAA;AAE/B,cAAc,eAAe,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,oBAAoB,CAAA;AACvC,mBAAmB,yBAAyB,CAAA;AAC5C,mBAAmB,YAAY,CAAA;AAE/B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAA","sourcesContent":["export type * from './api-endpoints.js'\nexport type * from './customization-data.js'\nexport type * from './types.js'\n\nexport * from './contants.js'\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA","sourcesContent":["export type * from './api-endpoints.js'\nexport type * from './customization-data.js'\nexport type * from './types.js'\n\nexport * from './contants.js'\nexport * from './errors.js'\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto/oauth-provider-api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=22"
|
|
6
6
|
},
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@atproto/jwk": "^0.7.0",
|
|
30
|
-
"@atproto/oauth-types": "^0.7.
|
|
30
|
+
"@atproto/oauth-types": "^0.7.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"typescript": "^6.0.3"
|
package/src/api-endpoints.ts
CHANGED
|
@@ -86,6 +86,31 @@ export type ApiEndpoints = {
|
|
|
86
86
|
input: RevokeAccountSessionInput
|
|
87
87
|
output: { success: true }
|
|
88
88
|
}
|
|
89
|
+
'/update-email-request': {
|
|
90
|
+
method: 'POST'
|
|
91
|
+
input: InitiateEmailUpdateInput
|
|
92
|
+
output: InitiateEmailUpdateOutput
|
|
93
|
+
}
|
|
94
|
+
'/update-email-confirm': {
|
|
95
|
+
method: 'POST'
|
|
96
|
+
input: ConfirmEmailUpdateInput
|
|
97
|
+
output: { success: true }
|
|
98
|
+
}
|
|
99
|
+
'/verify-email-request': {
|
|
100
|
+
method: 'POST'
|
|
101
|
+
input: InitiateEmailVerificationInput
|
|
102
|
+
output: { success: true }
|
|
103
|
+
}
|
|
104
|
+
'/verify-email-confirm': {
|
|
105
|
+
method: 'POST'
|
|
106
|
+
input: ConfirmEmailVerificationInput
|
|
107
|
+
output: { success: true }
|
|
108
|
+
}
|
|
109
|
+
'/update-handle': {
|
|
110
|
+
method: 'POST'
|
|
111
|
+
input: UpdateHandleInput
|
|
112
|
+
output: { success: true }
|
|
113
|
+
}
|
|
89
114
|
'/consent': {
|
|
90
115
|
method: 'POST'
|
|
91
116
|
input: ConsentInput
|
|
@@ -151,10 +176,42 @@ export type ConfirmResetPasswordInput = {
|
|
|
151
176
|
password: string
|
|
152
177
|
}
|
|
153
178
|
|
|
179
|
+
export type InitiateEmailUpdateInput = {
|
|
180
|
+
sub: string
|
|
181
|
+
locale?: string
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export type InitiateEmailUpdateOutput = {
|
|
185
|
+
tokenRequired: boolean
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export type ConfirmEmailUpdateInput = {
|
|
189
|
+
sub: string
|
|
190
|
+
token?: string
|
|
191
|
+
email: string
|
|
192
|
+
locale?: string
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export type InitiateEmailVerificationInput = {
|
|
196
|
+
sub: string
|
|
197
|
+
locale?: string
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export type ConfirmEmailVerificationInput = {
|
|
201
|
+
sub: string
|
|
202
|
+
token: string
|
|
203
|
+
email: string
|
|
204
|
+
}
|
|
205
|
+
|
|
154
206
|
export type VerifyHandleAvailabilityInput = {
|
|
155
207
|
handle: string
|
|
156
208
|
}
|
|
157
209
|
|
|
210
|
+
export type UpdateHandleInput = {
|
|
211
|
+
sub: string
|
|
212
|
+
handle: string
|
|
213
|
+
}
|
|
214
|
+
|
|
158
215
|
export type RevokeAccountSessionInput = {
|
|
159
216
|
sub: string
|
|
160
217
|
deviceId: string
|
package/src/errors.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export const HANDLE_UNAVAILABLE_REASON = Object.freeze([
|
|
2
|
+
'syntax',
|
|
3
|
+
'domain',
|
|
4
|
+
'slur',
|
|
5
|
+
'taken',
|
|
6
|
+
'reserved',
|
|
7
|
+
'resolution',
|
|
8
|
+
'unsupported',
|
|
9
|
+
] as const)
|
|
10
|
+
|
|
11
|
+
export type HandleUnavailableReason = (typeof HANDLE_UNAVAILABLE_REASON)[number]
|
|
12
|
+
|
|
13
|
+
export const isHandleUnavailableReason = (
|
|
14
|
+
value: unknown,
|
|
15
|
+
): value is HandleUnavailableReason => {
|
|
16
|
+
return (HANDLE_UNAVAILABLE_REASON as readonly unknown[]).includes(value)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// @TODO consider moving JsonErrorResponse & sub-classes here (or only the
|
|
20
|
+
// schemas?), allowing the same code to be used on both the server and client
|
|
21
|
+
// for error handling/parsing/formatting.
|
package/src/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["./src/api-endpoints.ts","./src/contants.ts","./src/customization-data.ts","./src/index.ts","./src/types.ts"],"version":"6.0.3"}
|
|
1
|
+
{"root":["./src/api-endpoints.ts","./src/contants.ts","./src/customization-data.ts","./src/errors.ts","./src/index.ts","./src/types.ts"],"version":"6.0.3"}
|