@logto/schemas 1.28.0 → 1.30.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 (129) hide show
  1. package/alterations/1.29.0-1748832174-add-webauthn-related-origins.ts +20 -0
  2. package/alterations/1.29.0-1749005587-user-sso-identities-table-add-updated-at-column.ts +31 -0
  3. package/alterations/1.29.0-1749026308-add-oidc-session-extension-table.ts +41 -0
  4. package/alterations/1.29.0-1749523818-add-custom-profile-fields.ts +58 -0
  5. package/alterations/1.29.0-1749724664-drop-sie-order-constraint-from-custom-profile-fields.ts +20 -0
  6. package/alterations/1.29.0-1750663091-change-user-password-encrypted-length.ts +18 -0
  7. package/alterations/1.29.0-1750744518-add-secrets-table.ts +50 -0
  8. package/alterations/1.29.0-1750744539-add-secret-connector-relations-table.ts +109 -0
  9. package/alterations/1.30.0-1750744685-add-triggers-to-delete-secrets-on-social-identities-deletion.ts +81 -0
  10. package/alterations/1.30.0-1750748516-add-enable-token-storage-column-to-connectors-table.ts +20 -0
  11. package/alterations/1.30.0-1751255436-split-secret-connector-relatioins-table.ts +359 -0
  12. package/alterations/1.30.0-1751337183-add-require-mfa-on-sign-in-to-users.ts +20 -0
  13. package/alterations/1.30.0-1751400000-move-require-mfa-on-sign-in-to-logto-config.ts +21 -0
  14. package/alterations/1.30.0-1751529530-add-enable-token-storage-column-to-sso-connectors-table.ts +20 -0
  15. package/alterations/1.30.0-1752630302-alterate-enable-column-default-value-in-account-centers-table.ts +20 -0
  16. package/alterations/1.30.0-1753669579-add-organization-user-relations-foreign-key.ts +46 -0
  17. package/alterations-js/1.29.0-1748832174-add-webauthn-related-origins.js +16 -0
  18. package/alterations-js/1.29.0-1749005587-user-sso-identities-table-add-updated-at-column.js +25 -0
  19. package/alterations-js/1.29.0-1749026308-add-oidc-session-extension-table.js +33 -0
  20. package/alterations-js/1.29.0-1749523818-add-custom-profile-fields.js +52 -0
  21. package/alterations-js/1.29.0-1749724664-drop-sie-order-constraint-from-custom-profile-fields.js +16 -0
  22. package/alterations-js/1.29.0-1750663091-change-user-password-encrypted-length.js +14 -0
  23. package/alterations-js/1.29.0-1750744518-add-secrets-table.js +42 -0
  24. package/alterations-js/1.29.0-1750744539-add-secret-connector-relations-table.js +99 -0
  25. package/alterations-js/1.30.0-1750744685-add-triggers-to-delete-secrets-on-social-identities-deletion.js +76 -0
  26. package/alterations-js/1.30.0-1750748516-add-enable-token-storage-column-to-connectors-table.js +16 -0
  27. package/alterations-js/1.30.0-1751255436-split-secret-connector-relatioins-table.js +338 -0
  28. package/alterations-js/1.30.0-1751337183-add-require-mfa-on-sign-in-to-users.js +16 -0
  29. package/alterations-js/1.30.0-1751400000-move-require-mfa-on-sign-in-to-logto-config.js +17 -0
  30. package/alterations-js/1.30.0-1751529530-add-enable-token-storage-column-to-sso-connectors-table.js +16 -0
  31. package/alterations-js/1.30.0-1752630302-alterate-enable-column-default-value-in-account-centers-table.js +16 -0
  32. package/alterations-js/1.30.0-1753669579-add-organization-user-relations-foreign-key.js +38 -0
  33. package/lib/consts/oidc.d.ts +9 -1
  34. package/lib/consts/oidc.js +5 -0
  35. package/lib/db-entries/account-center.d.ts +4 -2
  36. package/lib/db-entries/account-center.js +5 -1
  37. package/lib/db-entries/connector.d.ts +5 -1
  38. package/lib/db-entries/connector.js +4 -0
  39. package/lib/db-entries/custom-profile-field.d.ts +32 -0
  40. package/lib/db-entries/custom-profile-field.js +58 -0
  41. package/lib/db-entries/index.d.ts +5 -0
  42. package/lib/db-entries/index.js +5 -0
  43. package/lib/db-entries/oidc-session-extension.d.ts +24 -0
  44. package/lib/db-entries/oidc-session-extension.js +42 -0
  45. package/lib/db-entries/secret-enterprise-sso-connector-relation.d.ts +28 -0
  46. package/lib/db-entries/secret-enterprise-sso-connector-relation.js +37 -0
  47. package/lib/db-entries/secret-social-connector-relation.d.ts +28 -0
  48. package/lib/db-entries/secret-social-connector-relation.js +37 -0
  49. package/lib/db-entries/secret.d.ts +44 -0
  50. package/lib/db-entries/secret.js +62 -0
  51. package/lib/db-entries/sso-connector.d.ts +5 -1
  52. package/lib/db-entries/sso-connector.js +4 -0
  53. package/lib/db-entries/user-sso-identity.d.ts +5 -1
  54. package/lib/db-entries/user-sso-identity.js +4 -0
  55. package/lib/db-entries/user.js +2 -2
  56. package/lib/foundations/jsonb-types/account-centers.d.ts +5 -0
  57. package/lib/foundations/jsonb-types/account-centers.js +2 -0
  58. package/lib/foundations/jsonb-types/custom-profile-fields.d.ts +441 -0
  59. package/lib/foundations/jsonb-types/custom-profile-fields.js +44 -0
  60. package/lib/foundations/jsonb-types/index.d.ts +2 -1
  61. package/lib/foundations/jsonb-types/index.js +2 -1
  62. package/lib/foundations/jsonb-types/secrets.d.ts +11 -0
  63. package/lib/foundations/jsonb-types/secrets.js +15 -0
  64. package/lib/foundations/jsonb-types/sign-in-experience.d.ts +3 -1
  65. package/lib/foundations/jsonb-types/sign-in-experience.js +2 -0
  66. package/lib/foundations/jsonb-types/users.d.ts +126 -0
  67. package/lib/foundations/jsonb-types/users.js +22 -10
  68. package/lib/types/connector.d.ts +39 -0
  69. package/lib/types/connector.js +1 -0
  70. package/lib/types/consent.d.ts +44 -0
  71. package/lib/types/custom-profile-fields.d.ts +2587 -0
  72. package/lib/types/custom-profile-fields.js +159 -0
  73. package/lib/types/index.d.ts +4 -0
  74. package/lib/types/index.js +4 -0
  75. package/lib/types/interactions.d.ts +181 -1
  76. package/lib/types/interactions.js +49 -1
  77. package/lib/types/log/interaction.d.ts +2 -1
  78. package/lib/types/logto-config/index.d.ts +1139 -18
  79. package/lib/types/logto-config/jwt-customizer.d.ts +2529 -32
  80. package/lib/types/logto-config/jwt-customizer.js +55 -1
  81. package/lib/types/logto-config/oidc-provider.d.ts +6 -6
  82. package/lib/types/mfa.d.ts +10 -10
  83. package/lib/types/secrets.d.ts +436 -0
  84. package/lib/types/secrets.js +73 -0
  85. package/lib/types/sign-in-experience.d.ts +21 -3
  86. package/lib/types/sign-in-experience.js +3 -1
  87. package/lib/types/sso-connector.d.ts +28 -2
  88. package/lib/types/sso-connector.js +3 -0
  89. package/lib/types/tenant.d.ts +1 -0
  90. package/lib/types/tenant.js +1 -0
  91. package/lib/types/user-logto-config.d.ts +45 -0
  92. package/lib/types/user-logto-config.js +18 -0
  93. package/lib/types/user.d.ts +626 -0
  94. package/lib/types/user.js +17 -1
  95. package/lib/types/verification-records/backup-code-verification.d.ts +47 -0
  96. package/lib/types/verification-records/backup-code-verification.js +12 -0
  97. package/lib/types/verification-records/code-verification.d.ts +89 -0
  98. package/lib/types/verification-records/code-verification.js +22 -0
  99. package/lib/types/verification-records/enterprise-sso-verification.d.ts +213 -0
  100. package/lib/types/verification-records/enterprise-sso-verification.js +15 -0
  101. package/lib/types/verification-records/index.d.ts +16 -0
  102. package/lib/types/verification-records/index.js +16 -0
  103. package/lib/types/verification-records/new-password-identity-verification.d.ts +85 -0
  104. package/lib/types/verification-records/new-password-identity-verification.js +20 -0
  105. package/lib/types/verification-records/one-time-token-verification.d.ts +55 -0
  106. package/lib/types/verification-records/one-time-token-verification.js +13 -0
  107. package/lib/types/verification-records/password-verification.d.ts +40 -0
  108. package/lib/types/verification-records/password-verification.js +9 -0
  109. package/lib/types/verification-records/social-verification.d.ts +270 -0
  110. package/lib/types/verification-records/social-verification.js +16 -0
  111. package/lib/types/verification-records/totp-verification.d.ts +47 -0
  112. package/lib/types/verification-records/totp-verification.js +12 -0
  113. package/lib/types/verification-records/web-authn-verification.d.ts +124 -0
  114. package/lib/types/verification-records/web-authn-verification.js +17 -0
  115. package/package.json +6 -6
  116. package/tables/account_centers.sql +2 -1
  117. package/tables/connectors.sql +4 -0
  118. package/tables/custom_profile_fields.sql +31 -0
  119. package/tables/oidc_model_instances.sql +2 -0
  120. package/tables/oidc_session_extensions.sql +18 -0
  121. package/tables/organization_user_relations.sql +4 -1
  122. package/tables/secret_enterprise_sso_connector_relations.sql +60 -0
  123. package/tables/secret_social_connector_relations.sql +75 -0
  124. package/tables/secrets.sql +26 -0
  125. package/tables/sso_connectors.sql +2 -0
  126. package/tables/user_sso_identities.sql +8 -0
  127. package/tables/users.sql +3 -2
  128. /package/lib/{foundations/jsonb-types/verification-records.d.ts → types/verification-records/verification-type.d.ts} +0 -0
  129. /package/lib/{foundations/jsonb-types/verification-records.js → types/verification-records/verification-type.js} +0 -0
@@ -214,7 +214,9 @@ export type CustomContent = z.infer<typeof customContentGuard>;
214
214
  export declare enum MfaFactor {
215
215
  TOTP = "Totp",
216
216
  WebAuthn = "WebAuthn",
217
- BackupCode = "BackupCode"
217
+ BackupCode = "BackupCode",
218
+ EmailVerificationCode = "EmailVerificationCode",
219
+ PhoneVerificationCode = "PhoneVerificationCode"
218
220
  }
219
221
  export declare const mfaFactorsGuard: z.ZodArray<z.ZodNativeEnum<typeof MfaFactor>, "many">;
220
222
  export type MfaFactors = z.infer<typeof mfaFactorsGuard>;
@@ -72,6 +72,8 @@ export var MfaFactor;
72
72
  MfaFactor["TOTP"] = "Totp";
73
73
  MfaFactor["WebAuthn"] = "WebAuthn";
74
74
  MfaFactor["BackupCode"] = "BackupCode";
75
+ MfaFactor["EmailVerificationCode"] = "EmailVerificationCode";
76
+ MfaFactor["PhoneVerificationCode"] = "PhoneVerificationCode";
75
77
  })(MfaFactor || (MfaFactor = {}));
76
78
  export const mfaFactorsGuard = z.nativeEnum(MfaFactor).array();
77
79
  export var MfaPolicy;
@@ -21,6 +21,28 @@ export type UserProfile = Partial<{
21
21
  country: string;
22
22
  }>;
23
23
  }>;
24
+ export declare const addressGuard: z.ZodObject<{
25
+ formatted: z.ZodOptional<z.ZodString>;
26
+ streetAddress: z.ZodOptional<z.ZodString>;
27
+ locality: z.ZodOptional<z.ZodString>;
28
+ region: z.ZodOptional<z.ZodString>;
29
+ postalCode: z.ZodOptional<z.ZodString>;
30
+ country: z.ZodOptional<z.ZodString>;
31
+ }, "strip", z.ZodTypeAny, {
32
+ formatted?: string | undefined;
33
+ streetAddress?: string | undefined;
34
+ locality?: string | undefined;
35
+ region?: string | undefined;
36
+ postalCode?: string | undefined;
37
+ country?: string | undefined;
38
+ }, {
39
+ formatted?: string | undefined;
40
+ streetAddress?: string | undefined;
41
+ locality?: string | undefined;
42
+ region?: string | undefined;
43
+ postalCode?: string | undefined;
44
+ country?: string | undefined;
45
+ }>;
24
46
  export declare const userProfileGuard: z.ZodObject<{
25
47
  familyName: z.ZodOptional<z.ZodString>;
26
48
  givenName: z.ZodOptional<z.ZodString>;
@@ -97,6 +119,7 @@ export declare const userProfileGuard: z.ZodObject<{
97
119
  } | undefined;
98
120
  }>;
99
121
  export declare const userProfileKeys: readonly ["familyName", "givenName", "middleName", "nickname", "preferredUsername", "profile", "website", "gender", "birthdate", "zoneinfo", "locale", "address"];
122
+ export declare const userProfileAddressKeys: readonly ["formatted", "streetAddress", "locality", "region", "postalCode", "country"];
100
123
  export declare const roleNamesGuard: z.ZodArray<z.ZodString, "many">;
101
124
  export declare const identityGuard: z.ZodObject<{
102
125
  userId: z.ZodString;
@@ -152,6 +175,7 @@ export declare const mfaVerificationWebAuthn: z.ZodObject<{
152
175
  transports: z.ZodOptional<z.ZodArray<z.ZodEnum<["usb", "nfc", "ble", "internal", "cable", "hybrid", "smart-card"]>, "many">>;
153
176
  counter: z.ZodNumber;
154
177
  agent: z.ZodString;
178
+ name: z.ZodOptional<z.ZodString>;
155
179
  id: z.ZodString;
156
180
  createdAt: z.ZodString;
157
181
  lastUsedAt: z.ZodOptional<z.ZodString>;
@@ -164,6 +188,7 @@ export declare const mfaVerificationWebAuthn: z.ZodObject<{
164
188
  publicKey: string;
165
189
  counter: number;
166
190
  agent: string;
191
+ name?: string | undefined;
167
192
  lastUsedAt?: string | undefined;
168
193
  transports?: ("usb" | "nfc" | "ble" | "internal" | "cable" | "hybrid" | "smart-card")[] | undefined;
169
194
  }, {
@@ -174,6 +199,7 @@ export declare const mfaVerificationWebAuthn: z.ZodObject<{
174
199
  publicKey: string;
175
200
  counter: number;
176
201
  agent: string;
202
+ name?: string | undefined;
177
203
  lastUsedAt?: string | undefined;
178
204
  transports?: ("usb" | "nfc" | "ble" | "internal" | "cable" | "hybrid" | "smart-card")[] | undefined;
179
205
  }>;
@@ -213,6 +239,40 @@ export declare const mfaVerificationBackupCode: z.ZodObject<{
213
239
  lastUsedAt?: string | undefined;
214
240
  }>;
215
241
  export type MfaVerificationBackupCode = z.infer<typeof mfaVerificationBackupCode>;
242
+ export declare const mfaVerificationEmailVerificationCode: z.ZodObject<{
243
+ id: z.ZodString;
244
+ createdAt: z.ZodString;
245
+ lastUsedAt: z.ZodOptional<z.ZodString>;
246
+ type: z.ZodLiteral<MfaFactor.EmailVerificationCode>;
247
+ }, "strip", z.ZodTypeAny, {
248
+ type: MfaFactor.EmailVerificationCode;
249
+ id: string;
250
+ createdAt: string;
251
+ lastUsedAt?: string | undefined;
252
+ }, {
253
+ type: MfaFactor.EmailVerificationCode;
254
+ id: string;
255
+ createdAt: string;
256
+ lastUsedAt?: string | undefined;
257
+ }>;
258
+ export type MfaVerificationEmailVerificationCode = z.infer<typeof mfaVerificationEmailVerificationCode>;
259
+ export declare const mfaVerificationPhoneVerificationCode: z.ZodObject<{
260
+ id: z.ZodString;
261
+ createdAt: z.ZodString;
262
+ lastUsedAt: z.ZodOptional<z.ZodString>;
263
+ type: z.ZodLiteral<MfaFactor.PhoneVerificationCode>;
264
+ }, "strip", z.ZodTypeAny, {
265
+ type: MfaFactor.PhoneVerificationCode;
266
+ id: string;
267
+ createdAt: string;
268
+ lastUsedAt?: string | undefined;
269
+ }, {
270
+ type: MfaFactor.PhoneVerificationCode;
271
+ id: string;
272
+ createdAt: string;
273
+ lastUsedAt?: string | undefined;
274
+ }>;
275
+ export type MfaVerificationPhoneVerificationCode = z.infer<typeof mfaVerificationPhoneVerificationCode>;
216
276
  export declare const mfaVerificationGuard: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
217
277
  key: z.ZodString;
218
278
  id: z.ZodString;
@@ -237,6 +297,7 @@ export declare const mfaVerificationGuard: z.ZodDiscriminatedUnion<"type", [z.Zo
237
297
  transports: z.ZodOptional<z.ZodArray<z.ZodEnum<["usb", "nfc", "ble", "internal", "cable", "hybrid", "smart-card"]>, "many">>;
238
298
  counter: z.ZodNumber;
239
299
  agent: z.ZodString;
300
+ name: z.ZodOptional<z.ZodString>;
240
301
  id: z.ZodString;
241
302
  createdAt: z.ZodString;
242
303
  lastUsedAt: z.ZodOptional<z.ZodString>;
@@ -249,6 +310,7 @@ export declare const mfaVerificationGuard: z.ZodDiscriminatedUnion<"type", [z.Zo
249
310
  publicKey: string;
250
311
  counter: number;
251
312
  agent: string;
313
+ name?: string | undefined;
252
314
  lastUsedAt?: string | undefined;
253
315
  transports?: ("usb" | "nfc" | "ble" | "internal" | "cable" | "hybrid" | "smart-card")[] | undefined;
254
316
  }, {
@@ -259,6 +321,7 @@ export declare const mfaVerificationGuard: z.ZodDiscriminatedUnion<"type", [z.Zo
259
321
  publicKey: string;
260
322
  counter: number;
261
323
  agent: string;
324
+ name?: string | undefined;
262
325
  lastUsedAt?: string | undefined;
263
326
  transports?: ("usb" | "nfc" | "ble" | "internal" | "cable" | "hybrid" | "smart-card")[] | undefined;
264
327
  }>, z.ZodObject<{
@@ -294,6 +357,36 @@ export declare const mfaVerificationGuard: z.ZodDiscriminatedUnion<"type", [z.Zo
294
357
  usedAt?: string | undefined;
295
358
  }[];
296
359
  lastUsedAt?: string | undefined;
360
+ }>, z.ZodObject<{
361
+ id: z.ZodString;
362
+ createdAt: z.ZodString;
363
+ lastUsedAt: z.ZodOptional<z.ZodString>;
364
+ type: z.ZodLiteral<MfaFactor.EmailVerificationCode>;
365
+ }, "strip", z.ZodTypeAny, {
366
+ type: MfaFactor.EmailVerificationCode;
367
+ id: string;
368
+ createdAt: string;
369
+ lastUsedAt?: string | undefined;
370
+ }, {
371
+ type: MfaFactor.EmailVerificationCode;
372
+ id: string;
373
+ createdAt: string;
374
+ lastUsedAt?: string | undefined;
375
+ }>, z.ZodObject<{
376
+ id: z.ZodString;
377
+ createdAt: z.ZodString;
378
+ lastUsedAt: z.ZodOptional<z.ZodString>;
379
+ type: z.ZodLiteral<MfaFactor.PhoneVerificationCode>;
380
+ }, "strip", z.ZodTypeAny, {
381
+ type: MfaFactor.PhoneVerificationCode;
382
+ id: string;
383
+ createdAt: string;
384
+ lastUsedAt?: string | undefined;
385
+ }, {
386
+ type: MfaFactor.PhoneVerificationCode;
387
+ id: string;
388
+ createdAt: string;
389
+ lastUsedAt?: string | undefined;
297
390
  }>]>;
298
391
  export type MfaVerification = z.infer<typeof mfaVerificationGuard>;
299
392
  export declare const mfaVerificationsGuard: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
@@ -320,6 +413,7 @@ export declare const mfaVerificationsGuard: z.ZodArray<z.ZodDiscriminatedUnion<"
320
413
  transports: z.ZodOptional<z.ZodArray<z.ZodEnum<["usb", "nfc", "ble", "internal", "cable", "hybrid", "smart-card"]>, "many">>;
321
414
  counter: z.ZodNumber;
322
415
  agent: z.ZodString;
416
+ name: z.ZodOptional<z.ZodString>;
323
417
  id: z.ZodString;
324
418
  createdAt: z.ZodString;
325
419
  lastUsedAt: z.ZodOptional<z.ZodString>;
@@ -332,6 +426,7 @@ export declare const mfaVerificationsGuard: z.ZodArray<z.ZodDiscriminatedUnion<"
332
426
  publicKey: string;
333
427
  counter: number;
334
428
  agent: string;
429
+ name?: string | undefined;
335
430
  lastUsedAt?: string | undefined;
336
431
  transports?: ("usb" | "nfc" | "ble" | "internal" | "cable" | "hybrid" | "smart-card")[] | undefined;
337
432
  }, {
@@ -342,6 +437,7 @@ export declare const mfaVerificationsGuard: z.ZodArray<z.ZodDiscriminatedUnion<"
342
437
  publicKey: string;
343
438
  counter: number;
344
439
  agent: string;
440
+ name?: string | undefined;
345
441
  lastUsedAt?: string | undefined;
346
442
  transports?: ("usb" | "nfc" | "ble" | "internal" | "cable" | "hybrid" | "smart-card")[] | undefined;
347
443
  }>, z.ZodObject<{
@@ -377,5 +473,35 @@ export declare const mfaVerificationsGuard: z.ZodArray<z.ZodDiscriminatedUnion<"
377
473
  usedAt?: string | undefined;
378
474
  }[];
379
475
  lastUsedAt?: string | undefined;
476
+ }>, z.ZodObject<{
477
+ id: z.ZodString;
478
+ createdAt: z.ZodString;
479
+ lastUsedAt: z.ZodOptional<z.ZodString>;
480
+ type: z.ZodLiteral<MfaFactor.EmailVerificationCode>;
481
+ }, "strip", z.ZodTypeAny, {
482
+ type: MfaFactor.EmailVerificationCode;
483
+ id: string;
484
+ createdAt: string;
485
+ lastUsedAt?: string | undefined;
486
+ }, {
487
+ type: MfaFactor.EmailVerificationCode;
488
+ id: string;
489
+ createdAt: string;
490
+ lastUsedAt?: string | undefined;
491
+ }>, z.ZodObject<{
492
+ id: z.ZodString;
493
+ createdAt: z.ZodString;
494
+ lastUsedAt: z.ZodOptional<z.ZodString>;
495
+ type: z.ZodLiteral<MfaFactor.PhoneVerificationCode>;
496
+ }, "strip", z.ZodTypeAny, {
497
+ type: MfaFactor.PhoneVerificationCode;
498
+ id: string;
499
+ createdAt: string;
500
+ lastUsedAt?: string | undefined;
501
+ }, {
502
+ type: MfaFactor.PhoneVerificationCode;
503
+ id: string;
504
+ createdAt: string;
505
+ lastUsedAt?: string | undefined;
380
506
  }>]>, "many">;
381
507
  export type MfaVerifications = z.infer<typeof mfaVerificationsGuard>;
@@ -1,6 +1,14 @@
1
1
  import { jsonObjectGuard } from '@logto/connector-kit';
2
2
  import { z } from 'zod';
3
3
  import { MfaFactor } from './sign-in-experience.js';
4
+ export const addressGuard = z.object({
5
+ formatted: z.string().optional(),
6
+ streetAddress: z.string().optional(),
7
+ locality: z.string().optional(),
8
+ region: z.string().optional(),
9
+ postalCode: z.string().optional(),
10
+ country: z.string().optional(),
11
+ });
4
12
  export const userProfileGuard = z.object({
5
13
  familyName: z.string(),
6
14
  givenName: z.string(),
@@ -13,18 +21,10 @@ export const userProfileGuard = z.object({
13
21
  birthdate: z.string(),
14
22
  zoneinfo: z.string(),
15
23
  locale: z.string(),
16
- address: z
17
- .object({
18
- formatted: z.string(),
19
- streetAddress: z.string(),
20
- locality: z.string(),
21
- region: z.string(),
22
- postalCode: z.string(),
23
- country: z.string(),
24
- })
25
- .partial(),
24
+ address: addressGuard,
26
25
  }).partial();
27
26
  export const userProfileKeys = Object.freeze(userProfileGuard.keyof().options);
27
+ export const userProfileAddressKeys = Object.freeze(addressGuard.keyof().options);
28
28
  export const roleNamesGuard = z.string().array();
29
29
  export const identityGuard = z.object({
30
30
  userId: z.string(),
@@ -58,15 +58,27 @@ export const mfaVerificationWebAuthn = z.object({
58
58
  transports: webAuthnTransportGuard.array().optional(),
59
59
  counter: z.number(),
60
60
  agent: z.string(),
61
+ name: z.string().optional(),
61
62
  });
62
63
  export const mfaVerificationBackupCode = z.object({
63
64
  type: z.literal(MfaFactor.BackupCode),
64
65
  ...baseMfaVerification,
65
66
  codes: z.object({ code: z.string(), usedAt: z.string().optional() }).array(),
66
67
  });
68
+ // TODO @wangsijie: Implement this later
69
+ export const mfaVerificationEmailVerificationCode = z.object({
70
+ type: z.literal(MfaFactor.EmailVerificationCode),
71
+ ...baseMfaVerification,
72
+ });
73
+ export const mfaVerificationPhoneVerificationCode = z.object({
74
+ type: z.literal(MfaFactor.PhoneVerificationCode),
75
+ ...baseMfaVerification,
76
+ });
67
77
  export const mfaVerificationGuard = z.discriminatedUnion('type', [
68
78
  mfaVerificationTotp,
69
79
  mfaVerificationWebAuthn,
70
80
  mfaVerificationBackupCode,
81
+ mfaVerificationEmailVerificationCode,
82
+ mfaVerificationPhoneVerificationCode,
71
83
  ]);
72
84
  export const mfaVerificationsGuard = mfaVerificationGuard.array();
@@ -5,6 +5,7 @@ export { ConnectorType, ConnectorPlatform } from '@logto/connector-kit';
5
5
  export declare const connectorResponseGuard: z.ZodObject<{
6
6
  config: z.ZodType<import("@withtyped/server").JsonObject, z.ZodTypeDef, import("@withtyped/server").JsonObject>;
7
7
  syncProfile: z.ZodType<boolean, z.ZodTypeDef, boolean>;
8
+ enableTokenStorage: z.ZodType<boolean, z.ZodTypeDef, boolean>;
8
9
  connectorId: z.ZodType<string, z.ZodTypeDef, string>;
9
10
  metadata: z.ZodType<{
10
11
  target?: string | undefined;
@@ -45,6 +46,7 @@ export declare const connectorResponseGuard: z.ZodObject<{
45
46
  description: z.ZodOptional<z.ZodString>;
46
47
  tooltip: z.ZodOptional<z.ZodString>;
47
48
  isConfidential: z.ZodOptional<z.ZodBoolean>;
49
+ isDevFeature: z.ZodOptional<z.ZodBoolean>;
48
50
  type: z.ZodLiteral<import("@logto/connector-kit").ConnectorConfigFormItemType.Select>;
49
51
  selectItems: z.ZodArray<z.ZodObject<{
50
52
  value: z.ZodString;
@@ -74,6 +76,7 @@ export declare const connectorResponseGuard: z.ZodObject<{
74
76
  description?: string | undefined;
75
77
  tooltip?: string | undefined;
76
78
  isConfidential?: boolean | undefined;
79
+ isDevFeature?: boolean | undefined;
77
80
  }, {
78
81
  type: import("@logto/connector-kit").ConnectorConfigFormItemType.Select;
79
82
  selectItems: {
@@ -92,6 +95,7 @@ export declare const connectorResponseGuard: z.ZodObject<{
92
95
  description?: string | undefined;
93
96
  tooltip?: string | undefined;
94
97
  isConfidential?: boolean | undefined;
98
+ isDevFeature?: boolean | undefined;
95
99
  }>, z.ZodObject<{
96
100
  key: z.ZodString;
97
101
  label: z.ZodString;
@@ -111,6 +115,7 @@ export declare const connectorResponseGuard: z.ZodObject<{
111
115
  description: z.ZodOptional<z.ZodString>;
112
116
  tooltip: z.ZodOptional<z.ZodString>;
113
117
  isConfidential: z.ZodOptional<z.ZodBoolean>;
118
+ isDevFeature: z.ZodOptional<z.ZodBoolean>;
114
119
  type: z.ZodLiteral<import("@logto/connector-kit").ConnectorConfigFormItemType.MultiSelect>;
115
120
  selectItems: z.ZodArray<z.ZodObject<{
116
121
  value: z.ZodString;
@@ -136,6 +141,7 @@ export declare const connectorResponseGuard: z.ZodObject<{
136
141
  description?: string | undefined;
137
142
  tooltip?: string | undefined;
138
143
  isConfidential?: boolean | undefined;
144
+ isDevFeature?: boolean | undefined;
139
145
  }, {
140
146
  type: import("@logto/connector-kit").ConnectorConfigFormItemType.MultiSelect;
141
147
  selectItems: {
@@ -153,6 +159,7 @@ export declare const connectorResponseGuard: z.ZodObject<{
153
159
  description?: string | undefined;
154
160
  tooltip?: string | undefined;
155
161
  isConfidential?: boolean | undefined;
162
+ isDevFeature?: boolean | undefined;
156
163
  }>, z.ZodObject<{
157
164
  key: z.ZodString;
158
165
  label: z.ZodString;
@@ -172,6 +179,7 @@ export declare const connectorResponseGuard: z.ZodObject<{
172
179
  description: z.ZodOptional<z.ZodString>;
173
180
  tooltip: z.ZodOptional<z.ZodString>;
174
181
  isConfidential: z.ZodOptional<z.ZodBoolean>;
182
+ isDevFeature: z.ZodOptional<z.ZodBoolean>;
175
183
  type: z.ZodEnum<[import("@logto/connector-kit").ConnectorConfigFormItemType.Text, import("@logto/connector-kit").ConnectorConfigFormItemType.Number, import("@logto/connector-kit").ConnectorConfigFormItemType.MultilineText, import("@logto/connector-kit").ConnectorConfigFormItemType.Switch, import("@logto/connector-kit").ConnectorConfigFormItemType.Json]>;
176
184
  }, "strip", z.ZodTypeAny, {
177
185
  type: import("@logto/connector-kit").ConnectorConfigFormItemType.Text | import("@logto/connector-kit").ConnectorConfigFormItemType.Number | import("@logto/connector-kit").ConnectorConfigFormItemType.MultilineText | import("@logto/connector-kit").ConnectorConfigFormItemType.Switch | import("@logto/connector-kit").ConnectorConfigFormItemType.Json;
@@ -187,6 +195,7 @@ export declare const connectorResponseGuard: z.ZodObject<{
187
195
  description?: string | undefined;
188
196
  tooltip?: string | undefined;
189
197
  isConfidential?: boolean | undefined;
198
+ isDevFeature?: boolean | undefined;
190
199
  }, {
191
200
  type: import("@logto/connector-kit").ConnectorConfigFormItemType.Text | import("@logto/connector-kit").ConnectorConfigFormItemType.Number | import("@logto/connector-kit").ConnectorConfigFormItemType.MultilineText | import("@logto/connector-kit").ConnectorConfigFormItemType.Switch | import("@logto/connector-kit").ConnectorConfigFormItemType.Json;
192
201
  key: string;
@@ -201,11 +210,13 @@ export declare const connectorResponseGuard: z.ZodObject<{
201
210
  description?: string | undefined;
202
211
  tooltip?: string | undefined;
203
212
  isConfidential?: boolean | undefined;
213
+ isDevFeature?: boolean | undefined;
204
214
  }>]>, "many">>;
205
215
  customData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
206
216
  fromEmail: z.ZodOptional<z.ZodString>;
207
217
  platform: z.ZodNullable<z.ZodNativeEnum<typeof import("@logto/connector-kit").ConnectorPlatform>>;
208
218
  isStandard: z.ZodOptional<z.ZodBoolean>;
219
+ isTokenStorageSupported: z.ZodOptional<z.ZodBoolean>;
209
220
  } & {
210
221
  type: z.ZodNativeEnum<typeof ConnectorType>;
211
222
  isDemo: z.ZodOptional<z.ZodBoolean>;
@@ -479,6 +490,7 @@ export declare const connectorResponseGuard: z.ZodObject<{
479
490
  };
480
491
  config: import("@withtyped/server").JsonObject;
481
492
  syncProfile: boolean;
493
+ enableTokenStorage: boolean;
482
494
  connectorId: string;
483
495
  metadata: import("@logto/connector-kit").ConfigurableConnectorMetadata;
484
496
  target: string;
@@ -506,6 +518,7 @@ export declare const connectorResponseGuard: z.ZodObject<{
506
518
  description?: string | undefined;
507
519
  tooltip?: string | undefined;
508
520
  isConfidential?: boolean | undefined;
521
+ isDevFeature?: boolean | undefined;
509
522
  } | {
510
523
  type: import("@logto/connector-kit").ConnectorConfigFormItemType.MultiSelect;
511
524
  selectItems: {
@@ -523,6 +536,7 @@ export declare const connectorResponseGuard: z.ZodObject<{
523
536
  description?: string | undefined;
524
537
  tooltip?: string | undefined;
525
538
  isConfidential?: boolean | undefined;
539
+ isDevFeature?: boolean | undefined;
526
540
  } | {
527
541
  type: import("@logto/connector-kit").ConnectorConfigFormItemType.Text | import("@logto/connector-kit").ConnectorConfigFormItemType.Number | import("@logto/connector-kit").ConnectorConfigFormItemType.MultilineText | import("@logto/connector-kit").ConnectorConfigFormItemType.Switch | import("@logto/connector-kit").ConnectorConfigFormItemType.Json;
528
542
  key: string;
@@ -537,9 +551,11 @@ export declare const connectorResponseGuard: z.ZodObject<{
537
551
  description?: string | undefined;
538
552
  tooltip?: string | undefined;
539
553
  isConfidential?: boolean | undefined;
554
+ isDevFeature?: boolean | undefined;
540
555
  })[] | undefined;
541
556
  fromEmail?: string | undefined;
542
557
  isStandard?: boolean | undefined;
558
+ isTokenStorageSupported?: boolean | undefined;
543
559
  isDemo?: boolean | undefined;
544
560
  extraInfo?: Record<string, unknown> | undefined;
545
561
  }, {
@@ -810,6 +826,7 @@ export declare const connectorResponseGuard: z.ZodObject<{
810
826
  };
811
827
  config: import("@withtyped/server").JsonObject;
812
828
  syncProfile: boolean;
829
+ enableTokenStorage: boolean;
813
830
  connectorId: string;
814
831
  metadata: import("@logto/connector-kit").ConfigurableConnectorMetadata;
815
832
  target: string;
@@ -837,6 +854,7 @@ export declare const connectorResponseGuard: z.ZodObject<{
837
854
  description?: string | undefined;
838
855
  tooltip?: string | undefined;
839
856
  isConfidential?: boolean | undefined;
857
+ isDevFeature?: boolean | undefined;
840
858
  } | {
841
859
  type: import("@logto/connector-kit").ConnectorConfigFormItemType.MultiSelect;
842
860
  selectItems: {
@@ -854,6 +872,7 @@ export declare const connectorResponseGuard: z.ZodObject<{
854
872
  description?: string | undefined;
855
873
  tooltip?: string | undefined;
856
874
  isConfidential?: boolean | undefined;
875
+ isDevFeature?: boolean | undefined;
857
876
  } | {
858
877
  type: import("@logto/connector-kit").ConnectorConfigFormItemType.Text | import("@logto/connector-kit").ConnectorConfigFormItemType.Number | import("@logto/connector-kit").ConnectorConfigFormItemType.MultilineText | import("@logto/connector-kit").ConnectorConfigFormItemType.Switch | import("@logto/connector-kit").ConnectorConfigFormItemType.Json;
859
878
  key: string;
@@ -868,9 +887,11 @@ export declare const connectorResponseGuard: z.ZodObject<{
868
887
  description?: string | undefined;
869
888
  tooltip?: string | undefined;
870
889
  isConfidential?: boolean | undefined;
890
+ isDevFeature?: boolean | undefined;
871
891
  })[] | undefined;
872
892
  fromEmail?: string | undefined;
873
893
  isStandard?: boolean | undefined;
894
+ isTokenStorageSupported?: boolean | undefined;
874
895
  isDemo?: boolean | undefined;
875
896
  extraInfo?: Record<string, unknown> | undefined;
876
897
  }>;
@@ -906,6 +927,7 @@ export declare const connectorFactoryResponseGuard: z.ZodObject<{
906
927
  description: z.ZodOptional<z.ZodString>;
907
928
  tooltip: z.ZodOptional<z.ZodString>;
908
929
  isConfidential: z.ZodOptional<z.ZodBoolean>;
930
+ isDevFeature: z.ZodOptional<z.ZodBoolean>;
909
931
  type: z.ZodLiteral<import("@logto/connector-kit").ConnectorConfigFormItemType.Select>;
910
932
  selectItems: z.ZodArray<z.ZodObject<{
911
933
  value: z.ZodString;
@@ -935,6 +957,7 @@ export declare const connectorFactoryResponseGuard: z.ZodObject<{
935
957
  description?: string | undefined;
936
958
  tooltip?: string | undefined;
937
959
  isConfidential?: boolean | undefined;
960
+ isDevFeature?: boolean | undefined;
938
961
  }, {
939
962
  type: import("@logto/connector-kit").ConnectorConfigFormItemType.Select;
940
963
  selectItems: {
@@ -953,6 +976,7 @@ export declare const connectorFactoryResponseGuard: z.ZodObject<{
953
976
  description?: string | undefined;
954
977
  tooltip?: string | undefined;
955
978
  isConfidential?: boolean | undefined;
979
+ isDevFeature?: boolean | undefined;
956
980
  }>, z.ZodObject<{
957
981
  key: z.ZodString;
958
982
  label: z.ZodString;
@@ -972,6 +996,7 @@ export declare const connectorFactoryResponseGuard: z.ZodObject<{
972
996
  description: z.ZodOptional<z.ZodString>;
973
997
  tooltip: z.ZodOptional<z.ZodString>;
974
998
  isConfidential: z.ZodOptional<z.ZodBoolean>;
999
+ isDevFeature: z.ZodOptional<z.ZodBoolean>;
975
1000
  type: z.ZodLiteral<import("@logto/connector-kit").ConnectorConfigFormItemType.MultiSelect>;
976
1001
  selectItems: z.ZodArray<z.ZodObject<{
977
1002
  value: z.ZodString;
@@ -997,6 +1022,7 @@ export declare const connectorFactoryResponseGuard: z.ZodObject<{
997
1022
  description?: string | undefined;
998
1023
  tooltip?: string | undefined;
999
1024
  isConfidential?: boolean | undefined;
1025
+ isDevFeature?: boolean | undefined;
1000
1026
  }, {
1001
1027
  type: import("@logto/connector-kit").ConnectorConfigFormItemType.MultiSelect;
1002
1028
  selectItems: {
@@ -1014,6 +1040,7 @@ export declare const connectorFactoryResponseGuard: z.ZodObject<{
1014
1040
  description?: string | undefined;
1015
1041
  tooltip?: string | undefined;
1016
1042
  isConfidential?: boolean | undefined;
1043
+ isDevFeature?: boolean | undefined;
1017
1044
  }>, z.ZodObject<{
1018
1045
  key: z.ZodString;
1019
1046
  label: z.ZodString;
@@ -1033,6 +1060,7 @@ export declare const connectorFactoryResponseGuard: z.ZodObject<{
1033
1060
  description: z.ZodOptional<z.ZodString>;
1034
1061
  tooltip: z.ZodOptional<z.ZodString>;
1035
1062
  isConfidential: z.ZodOptional<z.ZodBoolean>;
1063
+ isDevFeature: z.ZodOptional<z.ZodBoolean>;
1036
1064
  type: z.ZodEnum<[import("@logto/connector-kit").ConnectorConfigFormItemType.Text, import("@logto/connector-kit").ConnectorConfigFormItemType.Number, import("@logto/connector-kit").ConnectorConfigFormItemType.MultilineText, import("@logto/connector-kit").ConnectorConfigFormItemType.Switch, import("@logto/connector-kit").ConnectorConfigFormItemType.Json]>;
1037
1065
  }, "strip", z.ZodTypeAny, {
1038
1066
  type: import("@logto/connector-kit").ConnectorConfigFormItemType.Text | import("@logto/connector-kit").ConnectorConfigFormItemType.Number | import("@logto/connector-kit").ConnectorConfigFormItemType.MultilineText | import("@logto/connector-kit").ConnectorConfigFormItemType.Switch | import("@logto/connector-kit").ConnectorConfigFormItemType.Json;
@@ -1048,6 +1076,7 @@ export declare const connectorFactoryResponseGuard: z.ZodObject<{
1048
1076
  description?: string | undefined;
1049
1077
  tooltip?: string | undefined;
1050
1078
  isConfidential?: boolean | undefined;
1079
+ isDevFeature?: boolean | undefined;
1051
1080
  }, {
1052
1081
  type: import("@logto/connector-kit").ConnectorConfigFormItemType.Text | import("@logto/connector-kit").ConnectorConfigFormItemType.Number | import("@logto/connector-kit").ConnectorConfigFormItemType.MultilineText | import("@logto/connector-kit").ConnectorConfigFormItemType.Switch | import("@logto/connector-kit").ConnectorConfigFormItemType.Json;
1053
1082
  key: string;
@@ -1062,12 +1091,14 @@ export declare const connectorFactoryResponseGuard: z.ZodObject<{
1062
1091
  description?: string | undefined;
1063
1092
  tooltip?: string | undefined;
1064
1093
  isConfidential?: boolean | undefined;
1094
+ isDevFeature?: boolean | undefined;
1065
1095
  }>]>, "many">>;
1066
1096
  customData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1067
1097
  fromEmail: z.ZodOptional<z.ZodString>;
1068
1098
  } & {
1069
1099
  platform: z.ZodNullable<z.ZodNativeEnum<typeof import("@logto/connector-kit").ConnectorPlatform>>;
1070
1100
  isStandard: z.ZodOptional<z.ZodBoolean>;
1101
+ isTokenStorageSupported: z.ZodOptional<z.ZodBoolean>;
1071
1102
  }, "strip", z.ZodTypeAny, {
1072
1103
  type: ConnectorType;
1073
1104
  name: {
@@ -1358,6 +1389,7 @@ export declare const connectorFactoryResponseGuard: z.ZodObject<{
1358
1389
  description?: string | undefined;
1359
1390
  tooltip?: string | undefined;
1360
1391
  isConfidential?: boolean | undefined;
1392
+ isDevFeature?: boolean | undefined;
1361
1393
  } | {
1362
1394
  type: import("@logto/connector-kit").ConnectorConfigFormItemType.MultiSelect;
1363
1395
  selectItems: {
@@ -1375,6 +1407,7 @@ export declare const connectorFactoryResponseGuard: z.ZodObject<{
1375
1407
  description?: string | undefined;
1376
1408
  tooltip?: string | undefined;
1377
1409
  isConfidential?: boolean | undefined;
1410
+ isDevFeature?: boolean | undefined;
1378
1411
  } | {
1379
1412
  type: import("@logto/connector-kit").ConnectorConfigFormItemType.Text | import("@logto/connector-kit").ConnectorConfigFormItemType.Number | import("@logto/connector-kit").ConnectorConfigFormItemType.MultilineText | import("@logto/connector-kit").ConnectorConfigFormItemType.Switch | import("@logto/connector-kit").ConnectorConfigFormItemType.Json;
1380
1413
  key: string;
@@ -1389,9 +1422,11 @@ export declare const connectorFactoryResponseGuard: z.ZodObject<{
1389
1422
  description?: string | undefined;
1390
1423
  tooltip?: string | undefined;
1391
1424
  isConfidential?: boolean | undefined;
1425
+ isDevFeature?: boolean | undefined;
1392
1426
  })[] | undefined;
1393
1427
  fromEmail?: string | undefined;
1394
1428
  isStandard?: boolean | undefined;
1429
+ isTokenStorageSupported?: boolean | undefined;
1395
1430
  isDemo?: boolean | undefined;
1396
1431
  }, {
1397
1432
  type: ConnectorType;
@@ -1683,6 +1718,7 @@ export declare const connectorFactoryResponseGuard: z.ZodObject<{
1683
1718
  description?: string | undefined;
1684
1719
  tooltip?: string | undefined;
1685
1720
  isConfidential?: boolean | undefined;
1721
+ isDevFeature?: boolean | undefined;
1686
1722
  } | {
1687
1723
  type: import("@logto/connector-kit").ConnectorConfigFormItemType.MultiSelect;
1688
1724
  selectItems: {
@@ -1700,6 +1736,7 @@ export declare const connectorFactoryResponseGuard: z.ZodObject<{
1700
1736
  description?: string | undefined;
1701
1737
  tooltip?: string | undefined;
1702
1738
  isConfidential?: boolean | undefined;
1739
+ isDevFeature?: boolean | undefined;
1703
1740
  } | {
1704
1741
  type: import("@logto/connector-kit").ConnectorConfigFormItemType.Text | import("@logto/connector-kit").ConnectorConfigFormItemType.Number | import("@logto/connector-kit").ConnectorConfigFormItemType.MultilineText | import("@logto/connector-kit").ConnectorConfigFormItemType.Switch | import("@logto/connector-kit").ConnectorConfigFormItemType.Json;
1705
1742
  key: string;
@@ -1714,9 +1751,11 @@ export declare const connectorFactoryResponseGuard: z.ZodObject<{
1714
1751
  description?: string | undefined;
1715
1752
  tooltip?: string | undefined;
1716
1753
  isConfidential?: boolean | undefined;
1754
+ isDevFeature?: boolean | undefined;
1717
1755
  })[] | undefined;
1718
1756
  fromEmail?: string | undefined;
1719
1757
  isStandard?: boolean | undefined;
1758
+ isTokenStorageSupported?: boolean | undefined;
1720
1759
  isDemo?: boolean | undefined;
1721
1760
  }>;
1722
1761
  export type ConnectorFactoryResponse = z.infer<typeof connectorFactoryResponseGuard>;
@@ -6,6 +6,7 @@ export const connectorResponseGuard = Connectors.guard
6
6
  .pick({
7
7
  id: true,
8
8
  syncProfile: true,
9
+ enableTokenStorage: true,
9
10
  config: true,
10
11
  metadata: true,
11
12
  connectorId: true,