@kayjs/auth 1.104.3 → 1.106.0

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.
Files changed (208) hide show
  1. package/llms/admin-and-organizations.md +8 -8
  2. package/llms/admin-pages.md +2 -2
  3. package/llms/grouped-methods.md +33 -17
  4. package/llms/hardening-and-testing.md +9 -9
  5. package/llms/oauth-passkeys-two-factor.md +14 -14
  6. package/llms/oauth-providers.md +1 -1
  7. package/llms/oauth-server-and-tokens.md +7 -7
  8. package/llms/passwords-and-mails.md +15 -15
  9. package/llms/sessions-and-guards.md +9 -1
  10. package/llms/setup.md +6 -6
  11. package/llms/signed-in-components.md +20 -11
  12. package/llms.txt +1 -1
  13. package/package.json +10 -6
  14. package/src/account.ts +6 -15
  15. package/src/admin.ts +9 -25
  16. package/src/auth.ts +9 -6
  17. package/src/authorize/clients.ts +1 -1
  18. package/src/authorize/grants.ts +2 -4
  19. package/src/authorize/request.ts +2 -4
  20. package/src/bearer.ts +5 -11
  21. package/src/captcha.ts +5 -3
  22. package/src/components/sign-in-link.kay +19 -0
  23. package/src/components/sign-out-button.kay +17 -0
  24. package/src/components/signed-in.kay +7 -2
  25. package/src/components/user-menu.kay +11 -8
  26. package/src/context.ts +1 -1
  27. package/src/deletion.ts +2 -4
  28. package/src/email.ts +16 -28
  29. package/src/erase.ts +5 -4
  30. package/src/export.ts +2 -4
  31. package/src/failure.ts +37 -9
  32. package/src/guard.ts +8 -1
  33. package/src/guards.ts +12 -5
  34. package/src/index.ts +14 -16
  35. package/src/limits.ts +97 -5
  36. package/src/mail.ts +5 -3
  37. package/src/memoryStore.ts +6 -6
  38. package/src/messages/fr.ts +1 -0
  39. package/src/methods/account.ts +30 -14
  40. package/src/methods/admin.ts +31 -14
  41. package/src/methods/captcha.ts +18 -0
  42. package/src/methods/email.ts +16 -7
  43. package/src/methods/magicLink.ts +5 -5
  44. package/src/methods/oauth.ts +16 -7
  45. package/src/methods/oauthServer.ts +32 -6
  46. package/src/methods/organizations.ts +51 -20
  47. package/src/methods/passkeys.ts +13 -7
  48. package/src/methods/password.ts +10 -10
  49. package/src/methods/proof.ts +22 -0
  50. package/src/methods/sessions.ts +3 -2
  51. package/src/methods/tokens.ts +17 -5
  52. package/src/methods/twoFactor.ts +10 -10
  53. package/src/oauth/flow.ts +2 -4
  54. package/src/oauth/providers.ts +1 -1
  55. package/src/oauthTest.ts +8 -4
  56. package/src/organizations.ts +12 -30
  57. package/src/organizationsCore.ts +1 -1
  58. package/src/own.ts +21 -19
  59. package/src/pages/components/frame.kay +3 -3
  60. package/src/pages/components/passkey-add.kay +2 -2
  61. package/src/pages/components/passkey-sign-in.kay +2 -2
  62. package/src/pages/components/passkey-two-factor.kay +2 -2
  63. package/src/pages/components/provider-buttons.kay +1 -1
  64. package/src/pages/forms.ts +6 -6
  65. package/src/pages/index.ts +9 -8
  66. package/src/pages/routes/account/clients.kay +2 -2
  67. package/src/pages/routes/account/connections.kay +4 -4
  68. package/src/pages/routes/account/data.kay +7 -7
  69. package/src/pages/routes/account/index.kay +15 -15
  70. package/src/pages/routes/account/organizations/[org].kay +15 -15
  71. package/src/pages/routes/account/organizations/index.kay +5 -5
  72. package/src/pages/routes/account/security.kay +15 -15
  73. package/src/pages/routes/account/tokens.kay +4 -4
  74. package/src/pages/routes/admin/_layout.kay +1 -1
  75. package/src/pages/routes/admin/audit.kay +1 -1
  76. package/src/pages/routes/admin/users/[id].kay +11 -11
  77. package/src/pages/routes/confirm-email.kay +3 -3
  78. package/src/pages/routes/invitation.kay +8 -8
  79. package/src/pages/routes/magic-link.kay +3 -3
  80. package/src/pages/routes/oauth/authorize.kay +2 -2
  81. package/src/pages/routes/register.kay +4 -4
  82. package/src/pages/routes/reset-password.kay +6 -6
  83. package/src/pages/routes/sign-in.kay +10 -10
  84. package/src/pages/routes/two-factor.kay +4 -4
  85. package/src/pages/routes/verify-email.kay +8 -8
  86. package/src/passkeys.ts +10 -21
  87. package/src/password.ts +8 -11
  88. package/src/pg.ts +3 -3
  89. package/src/profile.ts +1 -3
  90. package/src/proof.ts +3 -5
  91. package/src/request.ts +77 -46
  92. package/src/requiredTwoFactor.ts +2 -2
  93. package/src/routes.ts +2 -2
  94. package/src/sessions.ts +3 -7
  95. package/src/setup.ts +6 -4
  96. package/src/sqlite.ts +6 -0
  97. package/src/test.ts +15 -3
  98. package/src/testHelpers.ts +16 -7
  99. package/src/testHook.ts +31 -0
  100. package/src/testing.ts +5 -4
  101. package/src/twoFactor.ts +9 -18
  102. package/src/viewer.ts +26 -4
  103. package/src/webauthn.ts +2 -2
  104. package/types/account.d.ts +10 -23
  105. package/types/account.d.ts.map +1 -1
  106. package/types/admin.d.ts +21 -39
  107. package/types/admin.d.ts.map +1 -1
  108. package/types/auth.d.ts +18 -5
  109. package/types/auth.d.ts.map +1 -1
  110. package/types/authorize/grants.d.ts +2 -5
  111. package/types/authorize/grants.d.ts.map +1 -1
  112. package/types/authorize/request.d.ts +3 -5
  113. package/types/authorize/request.d.ts.map +1 -1
  114. package/types/bearer.d.ts +9 -17
  115. package/types/bearer.d.ts.map +1 -1
  116. package/types/captcha.d.ts +3 -1
  117. package/types/captcha.d.ts.map +1 -1
  118. package/types/context.d.ts +1 -1
  119. package/types/deletion.d.ts +2 -5
  120. package/types/deletion.d.ts.map +1 -1
  121. package/types/email.d.ts +23 -28
  122. package/types/email.d.ts.map +1 -1
  123. package/types/erase.d.ts.map +1 -1
  124. package/types/export.d.ts +3 -5
  125. package/types/export.d.ts.map +1 -1
  126. package/types/failure.d.ts +22 -3
  127. package/types/failure.d.ts.map +1 -1
  128. package/types/guard.d.ts +2 -0
  129. package/types/guard.d.ts.map +1 -1
  130. package/types/guards.d.ts +2 -1
  131. package/types/guards.d.ts.map +1 -1
  132. package/types/index.d.ts +14 -16
  133. package/types/index.d.ts.map +1 -1
  134. package/types/limits.d.ts +57 -1
  135. package/types/limits.d.ts.map +1 -1
  136. package/types/mail.d.ts +5 -0
  137. package/types/mail.d.ts.map +1 -1
  138. package/types/messages/fr.d.ts +1 -0
  139. package/types/methods/account.d.ts +27 -13
  140. package/types/methods/account.d.ts.map +1 -1
  141. package/types/methods/admin.d.ts +39 -15
  142. package/types/methods/admin.d.ts.map +1 -1
  143. package/types/methods/captcha.d.ts +9 -0
  144. package/types/methods/captcha.d.ts.map +1 -0
  145. package/types/methods/email.d.ts +21 -7
  146. package/types/methods/email.d.ts.map +1 -1
  147. package/types/methods/magicLink.d.ts +9 -4
  148. package/types/methods/magicLink.d.ts.map +1 -1
  149. package/types/methods/oauth.d.ts +12 -7
  150. package/types/methods/oauth.d.ts.map +1 -1
  151. package/types/methods/oauthServer.d.ts +13 -5
  152. package/types/methods/oauthServer.d.ts.map +1 -1
  153. package/types/methods/organizations.d.ts +40 -15
  154. package/types/methods/organizations.d.ts.map +1 -1
  155. package/types/methods/passkeys.d.ts +18 -7
  156. package/types/methods/passkeys.d.ts.map +1 -1
  157. package/types/methods/password.d.ts +23 -10
  158. package/types/methods/password.d.ts.map +1 -1
  159. package/types/methods/proof.d.ts +12 -0
  160. package/types/methods/proof.d.ts.map +1 -0
  161. package/types/methods/sessions.d.ts +3 -2
  162. package/types/methods/sessions.d.ts.map +1 -1
  163. package/types/methods/tokens.d.ts +12 -5
  164. package/types/methods/tokens.d.ts.map +1 -1
  165. package/types/methods/twoFactor.d.ts +22 -10
  166. package/types/methods/twoFactor.d.ts.map +1 -1
  167. package/types/oauth/flow.d.ts +4 -6
  168. package/types/oauth/flow.d.ts.map +1 -1
  169. package/types/oauthTest.d.ts +2 -0
  170. package/types/oauthTest.d.ts.map +1 -1
  171. package/types/organizations.d.ts +24 -48
  172. package/types/organizations.d.ts.map +1 -1
  173. package/types/own.d.ts +1 -1
  174. package/types/own.d.ts.map +1 -1
  175. package/types/pages/forms.d.ts +5 -3
  176. package/types/pages/forms.d.ts.map +1 -1
  177. package/types/pages/index.d.ts +5 -2
  178. package/types/pages/index.d.ts.map +1 -1
  179. package/types/passkeys.d.ts +20 -27
  180. package/types/passkeys.d.ts.map +1 -1
  181. package/types/password.d.ts +13 -20
  182. package/types/password.d.ts.map +1 -1
  183. package/types/profile.d.ts +1 -4
  184. package/types/profile.d.ts.map +1 -1
  185. package/types/proof.d.ts +1 -4
  186. package/types/proof.d.ts.map +1 -1
  187. package/types/request.d.ts +33 -7
  188. package/types/request.d.ts.map +1 -1
  189. package/types/requiredTwoFactor.d.ts +3 -1
  190. package/types/requiredTwoFactor.d.ts.map +1 -1
  191. package/types/routes.d.ts +3 -1
  192. package/types/routes.d.ts.map +1 -1
  193. package/types/sessions.d.ts +3 -10
  194. package/types/sessions.d.ts.map +1 -1
  195. package/types/setup.d.ts.map +1 -1
  196. package/types/sqlite.d.ts +3 -0
  197. package/types/sqlite.d.ts.map +1 -0
  198. package/types/test.d.ts +4 -1
  199. package/types/test.d.ts.map +1 -1
  200. package/types/testHelpers.d.ts +1 -0
  201. package/types/testHelpers.d.ts.map +1 -1
  202. package/types/testHook.d.ts +15 -0
  203. package/types/testHook.d.ts.map +1 -0
  204. package/types/testing.d.ts.map +1 -1
  205. package/types/twoFactor.d.ts +10 -21
  206. package/types/twoFactor.d.ts.map +1 -1
  207. package/types/viewer.d.ts +3 -1
  208. package/types/viewer.d.ts.map +1 -1
@@ -1,24 +1,38 @@
1
- import type { ChangeUsernameResult, DeleteAccountResult, UpdateLocaleResult } from '../account';
2
- import type { CancelDeletionResult } from '../deletion';
1
+ import type { BareUser } from '../core';
3
2
  import type { DeletionImpact } from '../erase';
4
- import type { ExportResult } from '../export';
5
- import type { ProfileFieldView } from '../pages';
6
- import type { SaveProfileResult } from '../profile';
7
- import type { Proof } from '../proof';
3
+ import type { DataExport } from '../export';
4
+ import type { Result } from '../failure';
5
+ import type { ProfileFieldView, ProfileProblem } from '../pages';
6
+ import type { Proof, ProofFailure } from '../proof';
7
+ import type { UsernameProblem } from '../rules';
8
8
  import type { RequestState } from '../state';
9
9
  export declare class AccountMethods {
10
10
  private readonly state;
11
11
  constructor(state: RequestState);
12
- changeUsername(username: string): Promise<ChangeUsernameResult>;
13
- updateLocale(locale: string): Promise<UpdateLocaleResult>;
14
- delete(proof: Proof): Promise<DeleteAccountResult>;
15
- cancelDeletion(): Promise<CancelDeletionResult>;
12
+ updateUsername(username: string): Promise<Result<{
13
+ user: BareUser;
14
+ }, 'signed-out', {
15
+ username: UsernameProblem | 'taken' | 'unchanged';
16
+ }>>;
17
+ updateLocale(locale: string): Promise<Result<object, 'signed-out' | 'invalid-locale'>>;
18
+ delete(proof: Proof): Promise<Result<{
19
+ deleteAt?: Date;
20
+ }, ProofFailure | 'last-admin' | 'last-owner' | 'refused'>>;
21
+ cancelDeletion(): Promise<Result<object, 'signed-out' | 'not-pending'>>;
16
22
  deletion(): Promise<{
17
23
  deleteAt: Date;
18
24
  } | null>;
19
25
  deletionImpact(): Promise<DeletionImpact>;
20
- profile(locale?: string): Promise<ProfileFieldView[] | null>;
21
- saveProfile(values: Record<string, unknown>): Promise<SaveProfileResult>;
22
- export(): Promise<ExportResult>;
26
+ getProfile(locale?: string): Promise<ProfileFieldView[] | null>;
27
+ updateProfile(values: Record<string, unknown>): Promise<Result<object, 'signed-out', Record<string, ProfileProblem>>>;
28
+ export(): Promise<Result<{
29
+ data: DataExport;
30
+ }, 'signed-out' | 'limited' | 'impersonating' | 'stale'>>;
31
+ /** @deprecated Use `account.updateUsername`. Removed in 1.108.0; `deprecated-auth-methods` rewrites it. */
32
+ changeUsername(...args: Parameters<AccountMethods['updateUsername']>): ReturnType<AccountMethods['updateUsername']>;
33
+ /** @deprecated Use `account.getProfile`. Removed in 1.108.0; `deprecated-auth-methods` rewrites it. */
34
+ profile(...args: Parameters<AccountMethods['getProfile']>): ReturnType<AccountMethods['getProfile']>;
35
+ /** @deprecated Use `account.updateProfile`. Removed in 1.108.0; `deprecated-auth-methods` rewrites it. */
36
+ saveProfile(...args: Parameters<AccountMethods['updateProfile']>): ReturnType<AccountMethods['updateProfile']>;
23
37
  }
24
38
  //# sourceMappingURL=account.d.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C,CAEvH;IAGK,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,aAAa,CAAC,CAAC,CAE5E;IAGK,QAAQ,IAAI,OAAO,CAAC;QAAE,QAAQ,EAAE,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC,CAInD;IAGK,cAAc,IAAI,OAAO,CAAC,cAAc,CAAC,CAE9C;IAGK,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,GAAG,IAAI,CAAC,CAQpE;IAGK,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,CAa1H;IAGK,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,EAAE,YAAY,GAAG,SAAS,GAAG,eAAe,GAAG,OAAO,CAAC,CAAC,CAE1G;IAED,2GAA2G;IACrG,cAAc,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC,GAAG,UAAU,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC,CAExH;IAED,uGAAuG;IACjG,OAAO,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,GAAG,UAAU,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,CAEzG;IAED,0GAA0G;IACpG,WAAW,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,GAAG,UAAU,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAEnH;CACF"}
@@ -1,30 +1,54 @@
1
- import type { AdminAuditLogResult, BanResult, DeleteResult, GetUserResult, ImpersonateResult, ListUsersResult, RoleResult, UnbanResult } from '../admin';
2
- import type { AuditCursorInput } from '../events';
1
+ import type { AdminChangeFailure, AdminFailure, ManagedUser } from '../admin';
2
+ import type { User } from '../core';
3
+ import type { AuditCursorInput, AuditEntry } from '../events';
4
+ import type { Result } from '../failure';
3
5
  import type { RequestState } from '../state';
4
- export declare class AdminMethods<Role extends string = string> {
6
+ export declare class AdminMethods<Role extends string = string, UserData extends object = Record<string, unknown>> {
5
7
  private readonly state;
6
- constructor(state: RequestState);
8
+ private readonly asking;
9
+ constructor(state: RequestState, asking: () => Promise<User<UserData>>);
10
+ require(): Promise<User<UserData>>;
7
11
  listUsers(query?: {
8
12
  search?: string;
9
13
  offset?: number;
10
14
  limit?: number;
11
- }): Promise<ListUsersResult>;
12
- getUser(userId: string): Promise<GetUserResult>;
13
- roles(): string[];
14
- grantRole(userId: string, role: Role): Promise<RoleResult>;
15
- revokeRole(userId: string, role: Role): Promise<RoleResult>;
15
+ }): Promise<Result<{
16
+ users: ManagedUser[];
17
+ total: number;
18
+ }, 'forbidden' | 'two-factor-required'>>;
19
+ getUser(userId: string): Promise<Result<{
20
+ user: ManagedUser;
21
+ admin: boolean;
22
+ }, AdminFailure>>;
23
+ listRoles(): string[];
24
+ grantRole(userId: string, role: Role): Promise<Result<{
25
+ user: ManagedUser;
26
+ }, AdminChangeFailure | 'unknown-role' | 'self' | 'last-admin'>>;
27
+ revokeRole(userId: string, role: Role): Promise<Result<{
28
+ user: ManagedUser;
29
+ }, AdminChangeFailure | 'unknown-role' | 'self' | 'last-admin'>>;
16
30
  ban(userId: string, options?: {
17
31
  reason?: string;
18
32
  until?: Date;
19
- }): Promise<BanResult>;
20
- unban(userId: string): Promise<UnbanResult>;
21
- deleteUser(userId: string): Promise<DeleteResult>;
22
- auditLog(query?: {
33
+ }): Promise<Result<{
34
+ user: ManagedUser;
35
+ }, AdminChangeFailure | 'self' | 'admin' | 'until'>>;
36
+ unban(userId: string): Promise<Result<{
37
+ user: ManagedUser;
38
+ }, AdminChangeFailure>>;
39
+ deleteUser(userId: string): Promise<Result<object, AdminChangeFailure | 'self' | 'admin' | 'refused'>>;
40
+ listAuditLog(query?: {
23
41
  userId?: string;
24
42
  before?: AuditCursorInput;
25
43
  limit?: number;
26
- }): Promise<AdminAuditLogResult>;
27
- impersonate(userId: string): Promise<ImpersonateResult>;
44
+ }): Promise<Result<{
45
+ entries: AuditEntry[];
46
+ }, 'forbidden' | 'two-factor-required'>>;
47
+ impersonate(userId: string): Promise<Result<object, AdminFailure | 'stale' | 'self' | 'admin' | 'banned'>>;
28
48
  stopImpersonating(): Promise<boolean>;
49
+ /** @deprecated Use `admin.listRoles`. Removed in 1.108.0; `deprecated-auth-methods` rewrites it. */
50
+ roles(...args: Parameters<AdminMethods<Role>['listRoles']>): ReturnType<AdminMethods<Role>['listRoles']>;
51
+ /** @deprecated Use `admin.listAuditLog`. Removed in 1.108.0; `deprecated-auth-methods` rewrites it. */
52
+ auditLog(...args: Parameters<AdminMethods<Role>['listAuditLog']>): ReturnType<AdminMethods<Role>['listAuditLog']>;
29
53
  }
30
54
  //# sourceMappingURL=admin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../src/methods/admin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,eAAe,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AACxJ,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAI5C,qBAAa,YAAY,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM;IACxC,OAAO,CAAC,QAAQ,CAAC,KAAK;IAAlC,YAA6B,KAAK,EAAE,YAAY,EAAI;IAG9C,SAAS,CAAC,KAAK,GAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAA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GAAoG;IACpG,KAAK,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,CAAC,GAAG,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,CAAC,CAEvG;IAED,uGAAuG;IACjG,QAAQ,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,cAAc,CAAC,CAAC,GAAG,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,cAAc,CAAC,CAAC,CAEtH;CACF"}
@@ -0,0 +1,9 @@
1
+ import type { CaptchaAction } from '../captcha';
2
+ import type { RequestState } from '../state';
3
+ export declare class CaptchaMethods {
4
+ private readonly state;
5
+ constructor(state: RequestState);
6
+ required(action: CaptchaAction): Promise<boolean>;
7
+ challenge(action: CaptchaAction): Promise<string | null>;
8
+ }
9
+ //# sourceMappingURL=captcha.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"captcha.d.ts","sourceRoot":"","sources":["../../src/methods/captcha.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAI5C,qBAAa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,KAAK;IAAlC,YAA6B,KAAK,EAAE,YAAY,EAAI;IAG9C,QAAQ,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,CAEtD;IAGK,SAAS,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAE7D;CACF"}
@@ -1,14 +1,28 @@
1
- import type { ChangeEmailResult, CodeResult, LinkResult, PendingEmailCode, SendVerificationResult, VerifyEmailResult } from '../email';
2
- import type { Proof } from '../proof';
1
+ import type { Off } from '../core';
2
+ import type { PendingEmailCode } from '../email';
3
+ import type { Result } from '../failure';
4
+ import type { Proof, ProofFailure } from '../proof';
5
+ import type { EmailProblem } from '../rules';
3
6
  import type { RequestState } from '../state';
4
7
  export declare class EmailMethods {
5
8
  private readonly state;
6
9
  constructor(state: RequestState);
7
- sendVerification(): Promise<SendVerificationResult>;
8
- verify(token: string, password?: string): Promise<VerifyEmailResult>;
9
- verifyCode(code: string): Promise<CodeResult>;
10
+ sendVerification(): Promise<Result<object, 'limited' | 'captcha' | 'unavailable' | 'signed-out' | 'verified'>>;
11
+ verify(token: string, password?: string): Promise<Result<{
12
+ redirect: string;
13
+ }, 'invalid' | 'limited' | 'banned' | 'confirm'>>;
14
+ signInWithCode(code: string): Promise<Result<{
15
+ redirect: string;
16
+ }, 'invalid' | 'expired' | 'limited' | 'banned'> | Off>;
17
+ verifyCode(code: string): Promise<Result<{
18
+ redirect: string;
19
+ }, 'invalid' | 'expired' | 'limited' | 'banned'>>;
10
20
  pendingCode(): Promise<PendingEmailCode>;
11
- change(proof: Proof, email: string): Promise<ChangeEmailResult>;
12
- confirmChange(token: string): Promise<LinkResult>;
21
+ change(proof: Proof, email: string): Promise<Result<object, ProofFailure | 'unavailable', {
22
+ email: EmailProblem | 'taken' | 'unchanged';
23
+ }>>;
24
+ confirmChange(token: string): Promise<Result<{
25
+ redirect: string;
26
+ }, 'invalid' | 'limited' | 'banned'>>;
13
27
  }
14
28
  //# sourceMappingURL=email.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../src/methods/email.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,UAAU,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AACtI,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAI5C,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CA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AC,MAAM,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC,CAAC,CAElI;IAGK,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC,GAAG,GAAG,CAAC,CAE5H;IAGK,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC,CAAC,CAElH;IAGK,WAAW,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAE7C;IAGK,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,aAAa,EAAE;QAAE,KAAK,EAAE,YAAY,GAAG,OAAO,GAAG,WAAW,CAAA;KAAE,CAAC,CAAC,CAEhJ;IAGK,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC,CAAC,CAE1G;CACF"}
@@ -1,12 +1,17 @@
1
1
  import type { Off } from '../core';
2
- import type { CodeResult, LinkResult, MailRequestResult } from '../email';
2
+ import type { Result } from '../failure';
3
3
  import type { SignInOptions } from '../signInOptions';
4
4
  import type { RequestState } from '../state';
5
5
  export declare class MagicLinkMethods {
6
6
  private readonly state;
7
7
  constructor(state: RequestState);
8
- request(email: string, options?: SignInOptions): Promise<MailRequestResult | Off>;
9
- signIn(token: string): Promise<LinkResult | Off>;
10
- signInWithCode(code: string): Promise<CodeResult | Off>;
8
+ request(email: string, options?: SignInOptions): Promise<Result<object, 'limited' | 'captcha' | 'unavailable'> | Off>;
9
+ signIn(token: string): Promise<Result<{
10
+ redirect: string;
11
+ }, 'invalid' | 'limited' | 'banned'> | Off>;
12
+ /** @deprecated Use `email.signInWithCode`. Removed in 1.108.0; `deprecated-auth-methods` rewrites it. */
13
+ signInWithCode(code: string): Promise<Result<{
14
+ redirect: string;
15
+ }, 'invalid' | 'expired' | 'limited' | 'banned'> | Off>;
11
16
  }
12
17
  //# sourceMappingURL=magicLink.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"magicLink.d.ts","sourceRoot":"","sources":["../../src/methods/magicLink.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,SAAS,CAAA;AAClC,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAM5C,qBAAa,gBAAgB;IACf,OAAO,CAAC,QAAQ,CAAC,KAAK;IAAlC,YAA6B,KAAK,EAAE,YAAY,EAAI;IAG9C,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,iBAAiB,GAAG,GAAG,CAAC,CAO1F;IAGK,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,GAAG,CAAC,CAErD;IAGK,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,GAAG,CAAC,CAE5D;CACF"}
1
+ {"version":3,"file":"magicLink.d.ts","sourceRoot":"","sources":["../../src/methods/magicLink.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,SAAS,CAAA;AAClC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAM5C,qBAAa,gBAAgB;IACf,OAAO,CAAC,QAAQ,CAAC,KAAK;IAAlC,YAA6B,KAAK,EAAE,YAAY,EAAI;IAG9C,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,aAAa,CAAC,GAAG,GAAG,CAAC,CAO9H;IAGK,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC,GAAG,GAAG,CAAC,CAEzG;IAED,yGAAyG;IACnG,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC,GAAG,GAAG,CAAC,CAE5H;CACF"}
@@ -1,6 +1,5 @@
1
- import type { UnlinkResult } from '../account';
2
- import type { LinkProviderResult } from '../oauth/flow';
3
- import type { Proof } from '../proof';
1
+ import type { Result } from '../failure';
2
+ import type { Proof, ProofFailure } from '../proof';
4
3
  import type { RequestState } from '../state';
5
4
  export declare class OAuthMethods {
6
5
  private readonly state;
@@ -8,9 +7,15 @@ export declare class OAuthMethods {
8
7
  constructor(state: RequestState, forget: () => void);
9
8
  link(provider: string, proof: Proof, options?: {
10
9
  redirect?: string;
11
- }): Promise<LinkProviderResult>;
12
- unlink(provider: string, proof: Proof): Promise<UnlinkResult>;
13
- identities(): Promise<string[]>;
14
- providerToken(provider: string): Promise<string | null>;
10
+ }): Promise<Result<{
11
+ url: string;
12
+ }, ProofFailure | 'not-found' | 'unavailable'>>;
13
+ unlink(provider: string, proof: Proof): Promise<Result<object, ProofFailure | 'not-linked' | 'last-way-in'>>;
14
+ listIdentities(): Promise<string[]>;
15
+ getProviderToken(provider: string): Promise<string | null>;
16
+ /** @deprecated Use `oauth.listIdentities`. Removed in 1.108.0; `deprecated-auth-methods` rewrites it. */
17
+ identities(...args: Parameters<OAuthMethods['listIdentities']>): ReturnType<OAuthMethods['listIdentities']>;
18
+ /** @deprecated Use `oauth.getProviderToken`. Removed in 1.108.0; `deprecated-auth-methods` rewrites it. */
19
+ providerToken(...args: Parameters<OAuthMethods['getProviderToken']>): ReturnType<OAuthMethods['getProviderToken']>;
15
20
  }
16
21
  //# sourceMappingURL=oauth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../src/methods/oauth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AACvD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAK5C,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CAAC,KAAK;IAAgB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAAzE,YAA6B,KAAK,EAAE,YAAY,EAAmB,MAAM,EAAE,MAAM,IAAI,EAAI;IAGnF,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,GAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAE3G;IAGK,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,YAAY,CAAC,CAIlE;IAGK,UAAU,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC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Aa,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC,GAAG,UAAU,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC,CAEvH;CACF"}
@@ -1,13 +1,21 @@
1
- import type { ApprovedClient, RevokeGrantResult } from '../authorize/grants';
2
- import type { AuthorizeOutcome, AuthorizeParams, DecideResult } from '../authorize/request';
1
+ import type { ApprovedClient } from '../authorize/grants';
2
+ import type { AuthorizeOutcome, AuthorizeParams } from '../authorize/request';
3
+ import type { Result } from '../failure';
3
4
  import type { RequestState } from '../state';
4
5
  export declare class OAuthServerMethods {
5
6
  private readonly state;
6
7
  private readonly request;
7
8
  constructor(state: RequestState, request: Request);
8
9
  authorize(params: AuthorizeParams): Promise<AuthorizeOutcome>;
9
- decide(fields: AuthorizeParams, allow: boolean): Promise<DecideResult>;
10
- clients(): Promise<ApprovedClient[]>;
11
- revokeGrant(clientId: string): Promise<RevokeGrantResult>;
10
+ decide(fields: AuthorizeParams, allow: boolean): Promise<Result<{
11
+ redirect: string;
12
+ }, 'client' | 'redirect_uri' | 'signed-out'>>;
13
+ resource(path: string, name: string): Record<string, unknown> | null;
14
+ origin(): string | undefined;
15
+ fixed(): boolean;
16
+ listClients(): Promise<ApprovedClient[]>;
17
+ revokeGrant(clientId: string): Promise<Result<object, 'signed-out' | 'not-found'>>;
18
+ /** @deprecated Use `oauthServer.listClients`. Removed in 1.108.0; `deprecated-auth-methods` rewrites it. */
19
+ clients(...args: Parameters<OAuthServerMethods['listClients']>): ReturnType<OAuthServerMethods['listClients']>;
12
20
  }
13
21
  //# sourceMappingURL=oauthServer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"oauthServer.d.ts","sourceRoot":"","sources":["../../src/methods/oauthServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAC5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe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E,MAAM,CAAA;KAAE,EAAE,QAAQ,GAAG,cAAc,GAAG,YAAY,CAAC,CAAC,CAErI;IAGD,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAOnE;IAGD,MAAM,IAAI,MAAM,GAAG,SAAS,CAE3B;IAGD,KAAK,IAAI,OAAO,CAEf;IAGK,WAAW,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,CAE7C;IAGK,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,WAAW,CAAC,CAAC,CAEvF;IAED,4GAA4G;IACtG,OAAO,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC,GAAG,UAAU,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC,CAEnH;CACF"}
@@ -1,4 +1,5 @@
1
- import type { AcceptResult, CreateOrganizationResult, DeleteOrganizationResult, Invitation, InviteResult, ListInvitationsResult, ListMembersResult, MemberResult, Membership, RejectInvitationResult, RevokeInvitationResult, UpdateOrganizationResult } from '../organizations';
1
+ import type { Result } from '../failure';
2
+ import type { AuthMember, Invitation, Membership, Organization, OrganizationFailure, OrganizationWriteFailure } from '../organizations';
2
3
  import type { RequestState } from '../state';
3
4
  export declare class OrganizationMethods<OrgRole extends string = string> {
4
5
  private readonly state;
@@ -6,25 +7,49 @@ export declare class OrganizationMethods<OrgRole extends string = string> {
6
7
  create(input: {
7
8
  name: string;
8
9
  slug?: string | null | undefined;
9
- }): Promise<CreateOrganizationResult<OrgRole>>;
10
+ }): Promise<Result<{
11
+ membership: Membership<OrgRole>;
12
+ }, 'signed-out' | 'impersonating' | 'forbidden' | 'invalid-name' | 'invalid-slug' | 'slug-taken' | 'limited'>>;
10
13
  list(): Promise<Membership<OrgRole>[]>;
11
14
  get(ref: string): Promise<Membership<OrgRole> | null>;
12
15
  isMember(ref: string, role?: OrgRole): Promise<boolean>;
13
16
  update(ref: string, patch: {
14
17
  name?: string | undefined;
15
18
  slug?: string | null | undefined;
16
- }): Promise<UpdateOrganizationResult>;
17
- delete(ref: string): Promise<DeleteOrganizationResult>;
18
- members(ref: string): Promise<ListMembersResult<OrgRole>>;
19
- setMemberRoles(ref: string, userId: string, roles: OrgRole[]): Promise<MemberResult>;
20
- removeMember(ref: string, userId: string): Promise<MemberResult>;
21
- leave(ref: string): Promise<MemberResult>;
22
- invite(ref: string, email: string, roles?: OrgRole[]): Promise<InviteResult<OrgRole>>;
23
- invitations(ref: string): Promise<ListInvitationsResult<OrgRole>>;
24
- revokeInvitation(ref: string, invitationId: string): Promise<RevokeInvitationResult>;
25
- myInvitations(): Promise<Invitation<OrgRole>[]>;
26
- invitation(invitationId: string): Promise<Invitation<OrgRole> | null>;
27
- acceptInvitation(invitationId: string): Promise<AcceptResult<OrgRole>>;
28
- rejectInvitation(invitationId: string): Promise<RejectInvitationResult>;
19
+ }): Promise<Result<{
20
+ organization: Organization;
21
+ }, OrganizationWriteFailure | 'invalid-name' | 'invalid-slug' | 'slug-taken'>>;
22
+ delete(ref: string): Promise<Result<object, OrganizationWriteFailure>>;
23
+ listMembers(ref: string): Promise<Result<{
24
+ members: AuthMember<OrgRole>[];
25
+ }, OrganizationFailure>>;
26
+ updateMemberRoles(ref: string, userId: string, roles: OrgRole[]): Promise<Result<object, OrganizationWriteFailure | 'unknown-role' | 'last-owner'>>;
27
+ deleteMember(ref: string, userId: string): Promise<Result<object, OrganizationWriteFailure | 'unknown-role' | 'last-owner'>>;
28
+ leave(ref: string): Promise<Result<object, OrganizationWriteFailure | 'unknown-role' | 'last-owner'>>;
29
+ invite(ref: string, email: string, roles?: OrgRole[]): Promise<Result<{
30
+ invitation: Invitation<OrgRole>;
31
+ }, OrganizationWriteFailure | 'unverified' | 'unknown-role' | 'invalid-email' | 'member' | 'limited' | 'unavailable'>>;
32
+ listInvitations(ref: string): Promise<Result<{
33
+ invitations: Invitation<OrgRole>[];
34
+ }, OrganizationFailure>>;
35
+ revokeInvitation(ref: string, invitationId: string): Promise<Result<object, OrganizationWriteFailure>>;
36
+ listMyInvitations(): Promise<Invitation<OrgRole>[]>;
37
+ getInvitation(invitationId: string): Promise<Invitation<OrgRole> | null>;
38
+ acceptInvitation(invitationId: string): Promise<Result<{
39
+ membership: Membership<OrgRole>;
40
+ }, 'signed-out' | 'impersonating' | 'not-found' | 'wrong-account' | 'unverified' | 'member'>>;
41
+ rejectInvitation(invitationId: string): Promise<Result<object, 'signed-out' | 'impersonating' | 'not-found'>>;
42
+ /** @deprecated Use `organizations.listMembers`. Removed in 1.108.0; `deprecated-auth-methods` rewrites it. */
43
+ members(...args: Parameters<OrganizationMethods<OrgRole>['listMembers']>): ReturnType<OrganizationMethods<OrgRole>['listMembers']>;
44
+ /** @deprecated Use `organizations.updateMemberRoles`. Removed in 1.108.0; `deprecated-auth-methods` rewrites it. */
45
+ setMemberRoles(...args: Parameters<OrganizationMethods<OrgRole>['updateMemberRoles']>): ReturnType<OrganizationMethods<OrgRole>['updateMemberRoles']>;
46
+ /** @deprecated Use `organizations.deleteMember`. Removed in 1.108.0; `deprecated-auth-methods` rewrites it. */
47
+ removeMember(...args: Parameters<OrganizationMethods<OrgRole>['deleteMember']>): ReturnType<OrganizationMethods<OrgRole>['deleteMember']>;
48
+ /** @deprecated Use `organizations.listInvitations`. Removed in 1.108.0; `deprecated-auth-methods` rewrites it. */
49
+ invitations(...args: Parameters<OrganizationMethods<OrgRole>['listInvitations']>): ReturnType<OrganizationMethods<OrgRole>['listInvitations']>;
50
+ /** @deprecated Use `organizations.listMyInvitations`. Removed in 1.108.0; `deprecated-auth-methods` rewrites it. */
51
+ myInvitations(...args: Parameters<OrganizationMethods<OrgRole>['listMyInvitations']>): ReturnType<OrganizationMethods<OrgRole>['listMyInvitations']>;
52
+ /** @deprecated Use `organizations.getInvitation`. Removed in 1.108.0; `deprecated-auth-methods` rewrites it. */
53
+ invitation(...args: Parameters<OrganizationMethods<OrgRole>['getInvitation']>): ReturnType<OrganizationMethods<OrgRole>['getInvitation']>;
29
54
  }
30
55
  //# sourceMappingURL=organizations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"organizations.d.ts","sourceRoot":"","sources":["../../src/methods/organizations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,UAAU,EAAE,YAAY,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,YAAY,EAAE,UAAU,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA;AAChR,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAK5C,qBAAa,mBAAmB,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM;IAClD,OAAO,CAAC,QAAQ,CAAC,KAAK;IAAlC,YAA6B,KAAK,EAAE,YAAY,EAAI;IAG9C,MAAM,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;KAAE,GAAG,OAAO,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC,CAElH;IAGK,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC,CAE3C;IAGK,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAE1D;IAGK,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAI5D;IAGK,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IA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mBAAmB,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,CAAC,CAE9I;IAED,kHAAkH;IAC5G,WAAW,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,iBAAiB,CAAC,CAAC,GAAG,UAAU,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAEnJ;IAED,oHAAoH;IAC9G,aAAa,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,mBAAmB,CAAC,CAAC,GAAG,UAAU,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAEzJ;IAED,gHAAgH;IAC1G,UAAU,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,eAAe,CAAC,CAAC,GAAG,UAAU,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,eAAe,CAAC,CAAC,CAE9I;CACF"}
@@ -1,5 +1,6 @@
1
1
  import type { Off } from '../core';
2
- import type { Passkey, PasskeyOptionsResult, PasskeySignInResult, RegisterPasskeyResult, RenamePasskeyResult, RevokePasskeyResult } from '../passkeys';
2
+ import type { Result } from '../failure';
3
+ import type { Passkey } from '../passkeys';
3
4
  import type { Proof, ProofFailure } from '../proof';
4
5
  import type { SignInOptions } from '../signInOptions';
5
6
  import type { RequestState } from '../state';
@@ -7,13 +8,23 @@ import type { AuthenticationResponseJSON, PublicKeyCredentialCreationOptionsJSON
7
8
  export declare class PasskeyMethods {
8
9
  private readonly state;
9
10
  constructor(state: RequestState);
10
- registrationOptions(proof: Proof): Promise<PasskeyOptionsResult<PublicKeyCredentialCreationOptionsJSON, ProofFailure | 'off'>>;
11
- register(response: RegistrationResponseJSON, name?: string): Promise<RegisterPasskeyResult | Off>;
11
+ registrationOptions(proof: Proof): Promise<Result<{
12
+ options: PublicKeyCredentialCreationOptionsJSON;
13
+ }, ProofFailure | 'off'>>;
14
+ register(response: RegistrationResponseJSON, name?: string): Promise<Result<{
15
+ passkey: Passkey;
16
+ }, 'signed-out' | 'expired' | 'invalid'> | Off>;
12
17
  list(): Promise<Passkey[]>;
13
- rename(id: string, name: string): Promise<RenamePasskeyResult>;
14
- revoke(id: string, proof: Proof): Promise<RevokePasskeyResult>;
18
+ update(id: string, name: string): Promise<Result<object, 'signed-out' | 'not-found' | 'invalid-name'>>;
19
+ revoke(id: string, proof: Proof): Promise<Result<object, ProofFailure | 'not-found' | 'last-way-in'>>;
15
20
  signInOptions(): Promise<PublicKeyCredentialRequestOptionsJSON>;
16
- signIn(response: AuthenticationResponseJSON, options?: Pick<SignInOptions, 'redirect' | 'remember'>): Promise<PasskeySignInResult | Off>;
17
- proofOptions(): Promise<PasskeyOptionsResult<PublicKeyCredentialRequestOptionsJSON>>;
21
+ signIn(response: AuthenticationResponseJSON, options?: Pick<SignInOptions, 'redirect' | 'remember'>): Promise<Result<{
22
+ redirect: string;
23
+ }, 'expired' | 'invalid' | 'limited' | 'banned'> | Off>;
24
+ proofOptions(): Promise<Result<{
25
+ options: PublicKeyCredentialRequestOptionsJSON;
26
+ }, 'signed-out' | 'none' | 'expired' | 'off'>>;
27
+ /** @deprecated Use `passkeys.update`. Removed in 1.108.0; `deprecated-auth-methods` rewrites it. */
28
+ rename(...args: Parameters<PasskeyMethods['update']>): ReturnType<PasskeyMethods['update']>;
18
29
  }
19
30
  //# sourceMappingURL=passkeys.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"passkeys.d.ts","sourceRoot":"","sources":["../../src/methods/passkeys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,SAAS,CAAA;AAClC,OAAO,KAAK,EAAE,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AACtJ,OAAO,KAAK,EAAE,KAAK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IAGK,aAAa,IAAI,OAAO,CAAC,qCAAqC,CAAC,CAKpE;IAGK,MAAM,CAAC,QAAQ,EAAE,0BAA0B,EAAE,OAAO,GAAE,IAAI,CAAC,aAAa,EAAE,UAAU,GAAG,UAAU,CAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC,GAAG,GAAG,CAAC,CAOxM;IAGK,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC;QAAE,OAAO,EAAE,qCAAqC,CAAA;KAAE,EAAE,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,KAAK,CAAC,CAAC,CAEnI;IAED,oGAAoG;IAC9F,MAAM,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,GAAG,UAAU,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAEhG;CACF"}
@@ -1,17 +1,30 @@
1
- import type { ChangePasswordResult } from '../account';
2
- import type { Off } from '../core';
3
- import type { MailRequestResult, ResetPasswordResult } from '../email';
4
- import type { PasswordSignInInput, PasswordSignInResult, RegisterInput, RegisterResult } from '../password';
5
- import type { Proof } from '../proof';
1
+ import type { BareUser, Off } from '../core';
2
+ import type { Result } from '../failure';
3
+ import type { PasswordSignInInput, RegisterErrors, RegisterInput } from '../password';
4
+ import type { Proof, ProofFailure } from '../proof';
5
+ import type { PasswordProblem } from '../rules';
6
6
  import type { SignInOptions } from '../signInOptions';
7
7
  import type { RequestState } from '../state';
8
8
  export declare class PasswordMethods {
9
9
  private readonly state;
10
10
  constructor(state: RequestState);
11
- register(input: RegisterInput, options?: Pick<SignInOptions, 'remember' | 'captcha' | 'redirect'>): Promise<RegisterResult | Off>;
12
- signIn(input: PasswordSignInInput, options?: SignInOptions): Promise<PasswordSignInResult | Off>;
13
- requestReset(email: string, options?: Pick<SignInOptions, 'captcha' | 'redirect'>): Promise<MailRequestResult | Off>;
14
- reset(token: string, password: string): Promise<ResetPasswordResult | Off>;
15
- change(proof: Proof, password: string): Promise<ChangePasswordResult | Off>;
11
+ register(input: RegisterInput, options?: Pick<SignInOptions, 'remember' | 'captcha' | 'redirect'>): Promise<Result<{
12
+ user: BareUser;
13
+ signedIn: true;
14
+ } | {
15
+ signedIn: false;
16
+ }, 'limited' | 'captcha' | 'off', RegisterErrors> | Off>;
17
+ signIn(input: PasswordSignInInput, options?: SignInOptions): Promise<Result<{
18
+ redirect: string;
19
+ }, 'invalid' | 'limited' | 'captcha' | 'unverified' | 'banned'> | Off>;
20
+ requestReset(email: string, options?: Pick<SignInOptions, 'captcha' | 'redirect'>): Promise<Result<object, 'limited' | 'captcha' | 'unavailable'> | Off>;
21
+ reset(token: string, password: string): Promise<Result<{
22
+ redirect: string;
23
+ }, 'invalid' | 'limited' | 'banned', {
24
+ password: PasswordProblem | 'breached';
25
+ }> | Off>;
26
+ change(proof: Proof, password: string): Promise<Result<object, ProofFailure, {
27
+ password: PasswordProblem | 'breached';
28
+ }> | Off>;
16
29
  }
17
30
  //# sourceMappingURL=password.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"password.d.ts","sourceRoot":"","sources":["../../src/methods/password.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AACtD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,SAAS,CAAA;AAClC,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AACtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC3G,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA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AAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE;QAAE,QAAQ,EAAE,eAAe,GAAG,UAAU,CAAA;KAAE,CAAC,GAAG,GAAG,CAAC,CAEpI;CACF"}
@@ -0,0 +1,12 @@
1
+ import type { Duration } from 'kay';
2
+ import type { Result } from '../failure';
3
+ import type { Proof, ProofFailure } from '../proof';
4
+ import type { RequestState } from '../state';
5
+ export declare class ProofMethods {
6
+ private readonly state;
7
+ private readonly milliseconds;
8
+ constructor(state: RequestState, milliseconds: (fresh: Duration) => number);
9
+ recent(fresh?: Duration): Promise<boolean>;
10
+ renew(proof: Proof): Promise<Result<object, ProofFailure>>;
11
+ }
12
+ //# sourceMappingURL=proof.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proof.d.ts","sourceRoot":"","sources":["../../src/methods/proof.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AACnC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAI5C,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CAAC,KAAK;IAAgB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAA/E,YAA6B,KAAK,EAAE,YAAY,EAAmB,YAAY,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,MAAM,EAAI;IAG1G,MAAM,CAAC,KAAK,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,CAE/C;IAGK,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAI/D;CACF"}
@@ -1,9 +1,10 @@
1
- import type { RevokeSessionResult, UserSession } from '../sessions';
1
+ import type { Result } from '../failure';
2
+ import type { UserSession } from '../sessions';
2
3
  import type { RequestState } from '../state';
3
4
  export declare class SessionMethods {
4
5
  private readonly state;
5
6
  constructor(state: RequestState);
6
7
  list(): Promise<UserSession[]>;
7
- revoke(id: string): Promise<RevokeSessionResult>;
8
+ revoke(id: string): Promise<Result<object, 'signed-out' | 'not-found'>>;
8
9
  }
9
10
  //# sourceMappingURL=sessions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sessions.d.ts","sourceRoot":"","sources":["../../src/methods/sessions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAI5C,qBAAa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,KAAK;IAAlC,YAA6B,KAAK,EAAE,YAAY,EAAI;IAG9C,IAAI,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,CAEnC;IAGK,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAErD;CACF"}
1
+ {"version":3,"file":"sessions.d.ts","sourceRoot":"","sources":["../../src/methods/sessions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAI5C,qBAAa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,KAAK;IAAlC,YAA6B,KAAK,EAAE,YAAY,EAAI;IAG9C,IAAI,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,CAEnC;IAGK,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,WAAW,CAAC,CAAC,CAE5E;CACF"}
@@ -1,11 +1,18 @@
1
- import type { BearerToken, CreateTokenResult, RevokeTokenResult, TokenOptions } from '../bearer';
2
- import type { Proof } from '../proof';
1
+ import type { BearerToken, TokenOptions, TokenProblem } from '../bearer';
2
+ import type { Result } from '../failure';
3
+ import type { Proof, ProofFailure } from '../proof';
3
4
  import type { RequestState } from '../state';
4
5
  export declare class TokenMethods<Scope extends string = string> {
5
6
  private readonly state;
6
- constructor(state: RequestState);
7
- create(proof: Proof, label: string, options?: TokenOptions<Scope>): Promise<CreateTokenResult>;
7
+ private readonly held;
8
+ constructor(state: RequestState, held: () => Promise<string[] | null>);
9
+ scopes(): Promise<string[] | null>;
10
+ hasScope(scope: Scope): Promise<boolean>;
11
+ create(proof: Proof, label: string, options?: TokenOptions<Scope>): Promise<Result<{
12
+ token: string;
13
+ id: string;
14
+ }, ProofFailure | TokenProblem>>;
8
15
  list(): Promise<BearerToken[]>;
9
- revoke(id: string): Promise<RevokeTokenResult>;
16
+ revoke(id: string): Promise<Result<object, 'signed-out' | 'not-found'>>;
10
17
  }
11
18
  //# sourceMappingURL=tokens.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/methods/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAChG,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAI5C,qBAAa,YAAY,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM;IACzC,OAAO,CAAC,QAAQ,CAAC,KAAK;IAAlC,YAA6B,KAAK,EAAE,YAAY,EAAI;IAG9C,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,YAAY,CAAC,KAAK,CAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAEvG;IAGK,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