@spfn/auth 0.2.0-beta.87 → 0.2.0-beta.88

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 (50) hide show
  1. package/README.md +333 -18
  2. package/dist/{authenticate-C7w-pLOR.d.ts → authenticate-ZssfqJ7d.d.ts} +150 -9
  3. package/dist/client-proof.d.ts +1 -1
  4. package/dist/client-proof.js +30 -0
  5. package/dist/client-proof.js.map +1 -1
  6. package/dist/config.d.ts +36 -0
  7. package/dist/config.js +18 -0
  8. package/dist/config.js.map +1 -1
  9. package/dist/errors.d.ts +93 -2
  10. package/dist/errors.js +57 -0
  11. package/dist/errors.js.map +1 -1
  12. package/dist/index.d.ts +36 -7
  13. package/dist/index.js +60 -0
  14. package/dist/index.js.map +1 -1
  15. package/dist/nextjs/server.d.ts +2 -2
  16. package/dist/server.d.ts +195 -80
  17. package/dist/server.js +515 -106
  18. package/dist/server.js.map +1 -1
  19. package/dist/{session-CGxgH3C9.d.ts → session-CFK4BT25.d.ts} +1 -1
  20. package/dist/{types-1BMx0OX1.d.ts → types-CD95yudz.d.ts} +15 -1
  21. package/migrations/20251125021229_premium_famine/snapshot.json +2641 -0
  22. package/migrations/20260225130050_smooth_the_fury/snapshot.json +2686 -0
  23. package/migrations/20260308141417_deep_iceman/snapshot.json +2686 -0
  24. package/migrations/20260308151309_perfect_deathbird/snapshot.json +2731 -0
  25. package/migrations/20260308201135_concerned_rawhide_kid/snapshot.json +2786 -0
  26. package/migrations/20260629103209_lethal_lifeguard/snapshot.json +2786 -0
  27. package/migrations/20260709073531_easy_hardball/snapshot.json +3119 -0
  28. package/migrations/20260714081434_glossy_major_mapleleaf/snapshot.json +3112 -0
  29. package/migrations/20260804105939_amazing_bushwacker/migration.sql +3 -0
  30. package/migrations/20260804105939_amazing_bushwacker/snapshot.json +3112 -0
  31. package/migrations/20260804110033_fat_piledriver/migration.sql +2 -0
  32. package/migrations/20260804110033_fat_piledriver/snapshot.json +3138 -0
  33. package/package.json +3 -6
  34. package/migrations/meta/0000_snapshot.json +0 -1632
  35. package/migrations/meta/0001_snapshot.json +0 -1660
  36. package/migrations/meta/0002_snapshot.json +0 -1660
  37. package/migrations/meta/0003_snapshot.json +0 -1689
  38. package/migrations/meta/0004_snapshot.json +0 -1721
  39. package/migrations/meta/0005_snapshot.json +0 -1721
  40. package/migrations/meta/0006_snapshot.json +0 -1921
  41. package/migrations/meta/0007_snapshot.json +0 -1916
  42. package/migrations/meta/_journal.json +0 -62
  43. /package/migrations/{0000_premium_famine.sql → 20251125021229_premium_famine/migration.sql} +0 -0
  44. /package/migrations/{0001_smooth_the_fury.sql → 20260225130050_smooth_the_fury/migration.sql} +0 -0
  45. /package/migrations/{0002_deep_iceman.sql → 20260308141417_deep_iceman/migration.sql} +0 -0
  46. /package/migrations/{0003_perfect_deathbird.sql → 20260308151309_perfect_deathbird/migration.sql} +0 -0
  47. /package/migrations/{0004_concerned_rawhide_kid.sql → 20260308201135_concerned_rawhide_kid/migration.sql} +0 -0
  48. /package/migrations/{0005_lethal_lifeguard.sql → 20260629103209_lethal_lifeguard/migration.sql} +0 -0
  49. /package/migrations/{0006_easy_hardball.sql → 20260709073531_easy_hardball/migration.sql} +0 -0
  50. /package/migrations/{0007_glossy_major_mapleleaf.sql → 20260714081434_glossy_major_mapleleaf/migration.sql} +0 -0
@@ -1,5 +1,5 @@
1
1
  import * as _spfn_core_route from '@spfn/core/route';
2
- import { K as KeyAlgorithmType, e as SocialProvider } from './types-1BMx0OX1.js';
2
+ import { K as KeyAlgorithmType, d as KeyPlatformType, h as SocialProvider } from './types-CD95yudz.js';
3
3
  import * as _sinclair_typebox from '@sinclair/typebox';
4
4
  import { Static } from '@sinclair/typebox';
5
5
  import { Context } from 'hono';
@@ -101,6 +101,8 @@ interface RegisterParams {
101
101
  keyId: string;
102
102
  fingerprint: string;
103
103
  algorithm?: KeyAlgorithmType;
104
+ deviceName?: string;
105
+ platform?: KeyPlatformType;
104
106
  metadata?: Record<string, unknown>;
105
107
  }
106
108
  interface RegisterResult {
@@ -118,6 +120,8 @@ interface LoginParams {
118
120
  fingerprint: string;
119
121
  oldKeyId?: string;
120
122
  algorithm?: KeyAlgorithmType;
123
+ deviceName?: string;
124
+ platform?: KeyPlatformType;
121
125
  }
122
126
  interface LoginResult {
123
127
  userId: string;
@@ -155,6 +159,16 @@ declare function changePasswordService(params: ChangePasswordParams): Promise<vo
155
159
 
156
160
  declare const EmailSchema: _sinclair_typebox.TString;
157
161
  declare const PhoneSchema: _sinclair_typebox.TString;
162
+ /**
163
+ * Optional device labels a client may send when registering a key.
164
+ *
165
+ * Display only: the key list uses them to tell one device from another, and
166
+ * nothing is authorized or refused by either value, so a client that lies about
167
+ * them gains nothing. Both are omitted by every key registered before they
168
+ * existed, hence optional rather than defaulted.
169
+ */
170
+ declare const DeviceNameSchema: _sinclair_typebox.TString;
171
+ declare const PlatformSchema: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"ios" | "android" | "web" | "desktop">[]>;
158
172
  declare const PasswordSchema: _sinclair_typebox.TString;
159
173
  declare const TargetTypeSchema: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"email">, _sinclair_typebox.TLiteral<"phone">]>;
160
174
  type VerificationTargetType = Static<typeof TargetTypeSchema>;
@@ -212,6 +226,9 @@ interface RegisterPublicKeyParams {
212
226
  publicKey: string;
213
227
  fingerprint: string;
214
228
  algorithm?: KeyAlgorithmType;
229
+ /** Device label for the key list. Display only — nothing is authorized by it. */
230
+ deviceName?: string;
231
+ platform?: KeyPlatformType;
215
232
  }
216
233
  interface RotateKeyParams {
217
234
  userId: number;
@@ -220,6 +237,9 @@ interface RotateKeyParams {
220
237
  newPublicKey: string;
221
238
  fingerprint: string;
222
239
  algorithm?: KeyAlgorithmType;
240
+ /** Omitted: the replaced key's label carries over, so rotation keeps its name. */
241
+ deviceName?: string;
242
+ platform?: KeyPlatformType;
223
243
  }
224
244
  interface RotateKeyResult {
225
245
  success: boolean;
@@ -230,8 +250,53 @@ interface RevokeKeyParams {
230
250
  keyId: string;
231
251
  reason: string;
232
252
  }
253
+ interface RevokeAllKeysParams {
254
+ userId: number;
255
+ /** The key the request itself is signed with — spared unless includeCurrent. */
256
+ currentKeyId: string;
257
+ /** true signs the caller out too. Default false: "my other devices". */
258
+ includeCurrent?: boolean;
259
+ reason: string;
260
+ }
261
+ interface RevokeAllKeysResult {
262
+ revokedCount: number;
263
+ currentKeyRevoked: boolean;
264
+ }
265
+ /** One registered device as the account surface shows it. */
266
+ interface KeySummary {
267
+ keyId: string;
268
+ deviceName?: string;
269
+ platform?: string;
270
+ algorithm: KeyAlgorithmType;
271
+ /** First bytes of the fingerprint — enough to tell two entries apart. */
272
+ fingerprintPrefix: string;
273
+ createdAt: string;
274
+ lastUsedAt?: string;
275
+ expiresAt?: string;
276
+ /** The TTL has run out. The key still reads as active; authenticate refuses it. */
277
+ isExpired: boolean;
278
+ /** False once revoked. Only ever false when the caller asked for revoked keys. */
279
+ isActive: boolean;
280
+ /** When it was revoked, for the "what did I cut off, and when" reading. */
281
+ revokedAt?: string;
282
+ }
283
+ interface ListKeysParams {
284
+ userId: number;
285
+ /** Also return keys already revoked. Default false: only what can still sign. */
286
+ includeRevoked?: boolean;
287
+ }
288
+ /** How much of the fingerprint the list returns. */
289
+ declare const KEY_FINGERPRINT_PREFIX_LENGTH = 8;
233
290
  /**
234
291
  * Register a new public key for a user
292
+ *
293
+ * `keyId` is UNIQUE across all users, so the lookup must ignore `isActive` —
294
+ * filtering on it misses a revoked row and the insert then fails on the unique
295
+ * index, rolling the whole login transaction back into a 500. Reuse is refused
296
+ * with a domain error instead, telling the client to generate a fresh keyId.
297
+ *
298
+ * @throws KeyIdAlreadyRegisteredError keyId가 이미 쓰인 값일 때 (자기 폐기 키 재사용 · 남의 키)
299
+ * @throws InvalidKeyFingerprintError fingerprint가 publicKey와 맞지 않을 때
235
300
  */
236
301
  declare function registerPublicKeyService(params: RegisterPublicKeyParams): Promise<void>;
237
302
  /**
@@ -239,9 +304,36 @@ declare function registerPublicKeyService(params: RegisterPublicKeyParams): Prom
239
304
  */
240
305
  declare function rotateKeyService(params: RotateKeyParams): Promise<RotateKeyResult>;
241
306
  /**
242
- * Revoke a user's public key
307
+ * Revoke a user's public key.
308
+ *
309
+ * Returns false when the key does not belong to this user, so a caller acting
310
+ * on a key id from outside (the device list) can answer "not found" instead of
311
+ * reporting a revocation that never happened. The repository already scopes the
312
+ * update by userId, so someone else's key is never touched either way.
313
+ */
314
+ declare function revokeKeyService(params: RevokeKeyParams): Promise<boolean>;
315
+ /**
316
+ * List the caller's active keys — one entry per device that can sign for them.
317
+ *
318
+ * `isExpired` is computed rather than stored: an expired key keeps `isActive`
319
+ * true (nothing flips it), and `authenticate` refuses it at request time. A list
320
+ * that showed it as simply "active" would be telling the user something the
321
+ * server does not act on.
322
+ *
323
+ * The fingerprint is truncated. Its full value is what a native sign-in must
324
+ * send as its nonce (issue #63), and an account page has no use for it beyond
325
+ * telling two entries apart.
326
+ */
327
+ declare function listKeysService(params: ListKeysParams): Promise<KeySummary[]>;
328
+ /**
329
+ * Revoke every active key the user has, optionally sparing the current one.
330
+ *
331
+ * The caller's own key is spared by default, so "sign out my other devices"
332
+ * does not also end the session making the request. Passing
333
+ * `includeCurrent: true` is the full sign-out, which until now was reachable
334
+ * only as a side effect of changing a password.
243
335
  */
244
- declare function revokeKeyService(params: RevokeKeyParams): Promise<void>;
336
+ declare function revokeAllKeysService(params: RevokeAllKeysParams): Promise<RevokeAllKeysResult>;
245
337
 
246
338
  /**
247
339
  * @spfn/auth - RBAC Type Definitions
@@ -392,6 +484,16 @@ interface OAuthTokens {
392
484
  interface NativeVerifyOptions {
393
485
  /** 클라이언트가 생성한 raw nonce. provider별 규약(raw 또는 SHA-256 해시)으로 대조된다. */
394
486
  nonce: string;
487
+ /**
488
+ * 같은 로그인에서 SDK가 함께 받은 provider access token (선택).
489
+ *
490
+ * id_token만으로는 알 수 없는 claim을 provider API로 보강하려는 provider가 쓴다
491
+ * (카카오: id_token에 email_verified가 없어 /v2/user/me의 이메일 유효·인증 플래그를 본다).
492
+ *
493
+ * ⚠️ 클라이언트가 보낸 검증되지 않은 값이다. 다른 사용자의 토큰일 수 있으므로,
494
+ * 이 값으로 조회한 신원은 반드시 id_token의 sub와 대조한 뒤에만 신뢰해야 한다.
495
+ */
496
+ accessToken?: string;
395
497
  }
396
498
  interface OAuthCodeExchangeOptions {
397
499
  /** Provider가 callback에 돌려준 원본 state. 일부 provider는 token 교환에도 요구한다. */
@@ -621,6 +723,16 @@ interface OAuthNativeParams {
621
723
  keyId: string;
622
724
  fingerprint: string;
623
725
  algorithm: KeyAlgorithmType;
726
+ /** 키 목록에 보일 기기 라벨 (선택). 표시용이라 권한 판정에 쓰이지 않는다. */
727
+ deviceName?: string;
728
+ platform?: KeyPlatformType;
729
+ /**
730
+ * SDK가 id_token과 함께 받은 provider access token (선택).
731
+ *
732
+ * provider가 id_token만으로 확인할 수 없는 claim을 보강할 때만 쓴다. 없으면 provider는
733
+ * id_token이 담은 정보만으로 신원을 정규화한다.
734
+ */
735
+ accessToken?: string;
624
736
  /** Apple은 첫 로그인에만 이름을 별도로 주므로 클라이언트가 전달할 수 있다. */
625
737
  profile?: {
626
738
  name?: string;
@@ -635,7 +747,7 @@ interface OAuthNativeResult {
635
747
  /**
636
748
  * native id_token 로그인 처리
637
749
  *
638
- * @throws ValidationError provider가 native sign-in을 지원하지 않을 때
750
+ * @throws NativeSignInUnsupportedError provider가 native sign-in을 지원하지 않을 때
639
751
  * @throws InvalidSocialTokenError id_token 검증 실패 시
640
752
  */
641
753
  declare function oauthNativeService(params: OAuthNativeParams): Promise<OAuthNativeResult>;
@@ -690,6 +802,8 @@ declare const mainAuthRouter: _spfn_core_route.Router<{
690
802
  keyId: _sinclair_typebox.TString;
691
803
  fingerprint: _sinclair_typebox.TString;
692
804
  algorithm: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"ES256" | "RS256">[]>;
805
+ deviceName: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
806
+ platform: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"ios" | "android" | "web" | "desktop">[]>>;
693
807
  }>;
694
808
  }, RegisterResult>;
695
809
  login: _spfn_core_route.RouteDef<{
@@ -705,6 +819,8 @@ declare const mainAuthRouter: _spfn_core_route.Router<{
705
819
  fingerprint: _sinclair_typebox.TString;
706
820
  algorithm: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"ES256" | "RS256">[]>;
707
821
  oldKeyId: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
822
+ deviceName: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
823
+ platform: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"ios" | "android" | "web" | "desktop">[]>>;
708
824
  }>;
709
825
  }, LoginResult>;
710
826
  logout: _spfn_core_route.RouteDef<{}, {}, void>;
@@ -714,8 +830,30 @@ declare const mainAuthRouter: _spfn_core_route.Router<{
714
830
  keyId: _sinclair_typebox.TString;
715
831
  fingerprint: _sinclair_typebox.TString;
716
832
  algorithm: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"ES256" | "RS256">[]>;
833
+ deviceName: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
834
+ platform: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"ios" | "android" | "web" | "desktop">[]>>;
717
835
  }>;
718
836
  }, RotateKeyResult>;
837
+ listKeys: _spfn_core_route.RouteDef<{
838
+ body: _sinclair_typebox.TObject<{
839
+ includeRevoked: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
840
+ }>;
841
+ }, {}, {
842
+ keys: KeySummary[];
843
+ }>;
844
+ revokeKey: _spfn_core_route.RouteDef<{
845
+ body: _sinclair_typebox.TObject<{
846
+ keyId: _sinclair_typebox.TString;
847
+ }>;
848
+ }, {}, {
849
+ keyId: string;
850
+ selfRevoked: boolean;
851
+ }>;
852
+ revokeAllKeys: _spfn_core_route.RouteDef<{
853
+ body: _sinclair_typebox.TObject<{
854
+ includeCurrent: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
855
+ }>;
856
+ }, {}, RevokeAllKeysResult>;
719
857
  changePassword: _spfn_core_route.RouteDef<{
720
858
  body: _sinclair_typebox.TObject<{
721
859
  currentPassword: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
@@ -733,7 +871,7 @@ declare const mainAuthRouter: _spfn_core_route.Router<{
733
871
  id: number;
734
872
  name: string;
735
873
  displayName: string;
736
- category: "auth" | "custom" | "user" | "rbac" | "system" | undefined;
874
+ category: "custom" | "user" | "auth" | "rbac" | "system" | undefined;
737
875
  }[];
738
876
  userId: number;
739
877
  publicId: string;
@@ -847,10 +985,13 @@ declare const mainAuthRouter: _spfn_core_route.Router<{
847
985
  body: _sinclair_typebox.TObject<{
848
986
  idToken: _sinclair_typebox.TString;
849
987
  nonce: _sinclair_typebox.TString;
988
+ accessToken: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
850
989
  publicKey: _sinclair_typebox.TString;
851
990
  keyId: _sinclair_typebox.TString;
852
991
  fingerprint: _sinclair_typebox.TString;
853
992
  algorithm: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"ES256" | "RS256">[]>;
993
+ deviceName: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
994
+ platform: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"ios" | "android" | "web" | "desktop">[]>>;
854
995
  profile: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
855
996
  name: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
856
997
  }>>;
@@ -1030,8 +1171,8 @@ declare const mainAuthRouter: _spfn_core_route.Router<{
1030
1171
  }, {}, {
1031
1172
  roles: {
1032
1173
  description: string | null;
1033
- name: string;
1034
1174
  id: number;
1175
+ name: string;
1035
1176
  displayName: string;
1036
1177
  isBuiltin: boolean;
1037
1178
  isSystem: boolean;
@@ -1052,8 +1193,8 @@ declare const mainAuthRouter: _spfn_core_route.Router<{
1052
1193
  }, {}, {
1053
1194
  role: {
1054
1195
  description: string | null;
1055
- name: string;
1056
1196
  id: number;
1197
+ name: string;
1057
1198
  displayName: string;
1058
1199
  isBuiltin: boolean;
1059
1200
  isSystem: boolean;
@@ -1076,8 +1217,8 @@ declare const mainAuthRouter: _spfn_core_route.Router<{
1076
1217
  }, {}, {
1077
1218
  role: {
1078
1219
  description: string | null;
1079
- name: string;
1080
1220
  id: number;
1221
+ name: string;
1081
1222
  displayName: string;
1082
1223
  isBuiltin: boolean;
1083
1224
  isSystem: boolean;
@@ -1231,4 +1372,4 @@ declare const authenticate: _spfn_core_route.NamedMiddleware<"auth">;
1231
1372
  */
1232
1373
  declare const optionalAuth: _spfn_core_route.NamedMiddleware<"optionalAuth">;
1233
1374
 
1234
- export { type OAuthCallbackResult as $, type AuthSession as A, rotateKeyService as B, type ChangePasswordParams as C, revokeKeyService as D, type RegisterPublicKeyParams as E, type RotateKeyParams as F, type RevokeKeyParams as G, issueOneTimeTokenService as H, type IssueOneTimeTokenResult as I, verifyOneTimeTokenService as J, oauthStartService as K, type LoginResult as L, oauthCallbackService as M, buildOAuthErrorUrl as N, type OAuthStartResult as O, type PermissionConfig as P, isOAuthProviderEnabled as Q, type RoleConfig as R, type SendVerificationCodeResult as S, requireEnabledProvider as T, type UserProfile as U, type VerificationTargetType as V, getEnabledOAuthProviders as W, getGoogleAccessToken as X, oauthUnlinkNotifyService as Y, type OAuthStartParams as Z, type OAuthCallbackParams as _, type RegisterResult as a, type UnlinkNotifyResult as a0, oauthNativeService as a1, type OAuthNativeParams as a2, selectAuthProfile as a3, resolveAuthenticatedUser as a4, type AuthProfileVerifier as a5, authenticate as a6, optionalAuth as a7, EmailSchema as a8, PhoneSchema as a9, PasswordSchema as aa, TargetTypeSchema as ab, VerificationPurposeSchema as ac, type NormalizedIdentity as ad, type OAuthTokens as ae, type NativeVerifyOptions as af, type OAuthCodeExchangeOptions as ag, type UnlinkNotifyRequest as ah, type UnlinkNotification as ai, UnlinkNotifyRejection as aj, registerOAuthProvider as ak, getOAuthProvider as al, getRegisteredProviders as am, type RotateKeyResult as b, type OAuthNativeResult as c, type ProfileInfo as d, type VerificationPurpose as e, VERIFICATION_TARGET_TYPES as f, VERIFICATION_PURPOSES as g, PERMISSION_CATEGORIES as h, type PermissionCategory as i, type AuthInitOptions as j, type OAuthProvider as k, type AuthContext as l, mainAuthRouter as m, loginService as n, logoutService as o, changePasswordService as p, type RegisterParams as q, registerService as r, type LoginParams as s, type LogoutParams as t, sendVerificationCodeService as u, verifyCodeService as v, type SendVerificationCodeParams as w, type VerifyCodeParams as x, type VerifyCodeResult as y, registerPublicKeyService as z };
1375
+ export { requireEnabledProvider as $, type AuthSession as A, registerPublicKeyService as B, type ChangePasswordParams as C, rotateKeyService as D, revokeKeyService as E, listKeysService as F, revokeAllKeysService as G, KEY_FINGERPRINT_PREFIX_LENGTH as H, type IssueOneTimeTokenResult as I, type RegisterPublicKeyParams as J, type KeySummary as K, type LoginResult as L, type RotateKeyParams as M, type RevokeKeyParams as N, type OAuthStartResult as O, type PermissionConfig as P, type RevokeAllKeysParams as Q, type RoleConfig as R, type SendVerificationCodeResult as S, issueOneTimeTokenService as T, type UserProfile as U, type VerificationTargetType as V, verifyOneTimeTokenService as W, oauthStartService as X, oauthCallbackService as Y, buildOAuthErrorUrl as Z, isOAuthProviderEnabled as _, type RegisterResult as a, getEnabledOAuthProviders as a0, getGoogleAccessToken as a1, oauthUnlinkNotifyService as a2, type OAuthStartParams as a3, type OAuthCallbackParams as a4, type OAuthCallbackResult as a5, type UnlinkNotifyResult as a6, oauthNativeService as a7, type OAuthNativeParams as a8, selectAuthProfile as a9, resolveAuthenticatedUser as aa, type AuthProfileVerifier as ab, authenticate as ac, optionalAuth as ad, EmailSchema as ae, PhoneSchema as af, DeviceNameSchema as ag, PlatformSchema as ah, PasswordSchema as ai, TargetTypeSchema as aj, VerificationPurposeSchema as ak, type NormalizedIdentity as al, type OAuthTokens as am, type NativeVerifyOptions as an, type OAuthCodeExchangeOptions as ao, type UnlinkNotifyRequest as ap, type UnlinkNotification as aq, UnlinkNotifyRejection as ar, registerOAuthProvider as as, getOAuthProvider as at, getRegisteredProviders as au, type RotateKeyResult as b, type RevokeAllKeysResult as c, type OAuthNativeResult as d, type ProfileInfo as e, type VerificationPurpose as f, VERIFICATION_TARGET_TYPES as g, VERIFICATION_PURPOSES as h, PERMISSION_CATEGORIES as i, type PermissionCategory as j, type AuthInitOptions as k, type OAuthProvider as l, mainAuthRouter as m, type AuthContext as n, loginService as o, logoutService as p, changePasswordService as q, registerService as r, type RegisterParams as s, type LoginParams as t, type LogoutParams as u, sendVerificationCodeService as v, verifyCodeService as w, type SendVerificationCodeParams as x, type VerifyCodeParams as y, type VerifyCodeResult as z };
@@ -430,7 +430,7 @@ declare function getClientProofReplayStore(): ClientProofReplayStore;
430
430
  */
431
431
 
432
432
  interface ContractOperation {
433
- id: 'auth.clientProof.handshake' | 'echo.send' | 'items.list' | 'auth.enroll.register' | 'auth.enroll.login' | 'auth.enroll.oauthNative' | 'auth.keys.rotate';
433
+ id: 'auth.clientProof.handshake' | 'echo.send' | 'items.list' | 'auth.enroll.register' | 'auth.enroll.login' | 'auth.enroll.oauthNative' | 'auth.keys.rotate' | 'auth.keys.list' | 'auth.keys.revoke' | 'auth.keys.revokeAll';
434
434
  method: 'POST';
435
435
  path: string;
436
436
  /**
@@ -983,6 +983,36 @@ var AUTH_SURFACE_OPERATIONS = [
983
983
  requestType: "RotateKeyRequest",
984
984
  responseType: "RotateKeyResponse",
985
985
  summary: "Replaces the authenticated key with a new client-generated public key before its TTL runs out."
986
+ },
987
+ {
988
+ id: "auth.keys.list",
989
+ method: "POST",
990
+ path: "/_auth/keys/list",
991
+ authProfile: "clientProofV1",
992
+ requiresSession: false,
993
+ requestType: "ListKeysRequest",
994
+ responseType: "ListKeysResponse",
995
+ summary: "Lists the keys registered to the caller, one per device that can sign for them."
996
+ },
997
+ {
998
+ id: "auth.keys.revoke",
999
+ method: "POST",
1000
+ path: "/_auth/keys/revoke",
1001
+ authProfile: "clientProofV1",
1002
+ requiresSession: false,
1003
+ requestType: "RevokeKeyRequest",
1004
+ responseType: "RevokeKeyResponse",
1005
+ summary: "Revokes one of the caller's keys, signing that device out."
1006
+ },
1007
+ {
1008
+ id: "auth.keys.revokeAll",
1009
+ method: "POST",
1010
+ path: "/_auth/keys/revoke-all",
1011
+ authProfile: "clientProofV1",
1012
+ requiresSession: false,
1013
+ requestType: "RevokeAllKeysRequest",
1014
+ responseType: "RevokeAllKeysResponse",
1015
+ summary: "Revokes every key the caller has, sparing the calling device unless asked otherwise."
986
1016
  }
987
1017
  ];
988
1018
  var ContractTypeError = class extends Error {