@logto/schemas 1.42.0 → 1.43.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 (113) hide show
  1. package/alterations/1.43.0-1785393731-add-oidc-model-instances-account-id-partial-index.ts +33 -0
  2. package/alterations/1.43.0-1785481546-add-tenant-aware-scope-indexes.ts +33 -0
  3. package/alterations/1.43.0-1785488115-add-cimd-permission-ceiling-tables.ts +77 -0
  4. package/alterations/1.43.0-1785722831-add-oidc-session-extensions-account-id-index.ts +27 -0
  5. package/alterations/1.43.0-1785835991-add-cimd-client-identifier-columns.ts +31 -0
  6. package/alterations/1.43.0-1786325989-add-cimd-grant-organizations-table.ts +54 -0
  7. package/alterations/1.43.0-1786333495-add-trusted-devices.ts +57 -0
  8. package/alterations/1.43.0-1786373004-tighten-cimd-grant-organizations-pkey.ts +28 -0
  9. package/alterations/1.43.0-1786414712-add-service-logs-email-indexes.ts +34 -0
  10. package/alterations/1.43.0-1786431364-add-cimd-grant-client-snapshots-table.ts +43 -0
  11. package/alterations-js/1.43.0-1785393731-add-oidc-model-instances-account-id-partial-index.js +28 -0
  12. package/alterations-js/1.43.0-1785481546-add-tenant-aware-scope-indexes.js +28 -0
  13. package/alterations-js/1.43.0-1785488115-add-cimd-permission-ceiling-tables.js +69 -0
  14. package/alterations-js/1.43.0-1785722831-add-oidc-session-extensions-account-id-index.js +23 -0
  15. package/alterations-js/1.43.0-1785835991-add-cimd-client-identifier-columns.js +27 -0
  16. package/alterations-js/1.43.0-1786325989-add-cimd-grant-organizations-table.js +49 -0
  17. package/alterations-js/1.43.0-1786333495-add-trusted-devices.js +50 -0
  18. package/alterations-js/1.43.0-1786373004-tighten-cimd-grant-organizations-pkey.js +24 -0
  19. package/alterations-js/1.43.0-1786414712-add-service-logs-email-indexes.js +30 -0
  20. package/alterations-js/1.43.0-1786431364-add-cimd-grant-client-snapshots-table.js +38 -0
  21. package/lib/consts/index.d.ts +1 -0
  22. package/lib/consts/index.js +1 -0
  23. package/lib/consts/product-event.d.ts +5 -1
  24. package/lib/consts/product-event.js +4 -0
  25. package/lib/consts/social-state.d.ts +12 -0
  26. package/lib/consts/social-state.js +12 -0
  27. package/lib/db-entries/cimd-grant-client-snapshot.d.ts +32 -0
  28. package/lib/db-entries/cimd-grant-client-snapshot.js +45 -0
  29. package/lib/db-entries/cimd-grant-organization.d.ts +30 -0
  30. package/lib/db-entries/cimd-grant-organization.js +37 -0
  31. package/lib/db-entries/cimd-organization-resource-scope.d.ts +20 -0
  32. package/lib/db-entries/cimd-organization-resource-scope.js +25 -0
  33. package/lib/db-entries/cimd-organization-scope.d.ts +20 -0
  34. package/lib/db-entries/cimd-organization-scope.js +25 -0
  35. package/lib/db-entries/cimd-resource-scope.d.ts +20 -0
  36. package/lib/db-entries/cimd-resource-scope.js +25 -0
  37. package/lib/db-entries/cimd-user-scope.d.ts +20 -0
  38. package/lib/db-entries/cimd-user-scope.js +25 -0
  39. package/lib/db-entries/index.d.ts +7 -0
  40. package/lib/db-entries/index.js +7 -0
  41. package/lib/db-entries/oidc-session-extension.d.ts +3 -1
  42. package/lib/db-entries/oidc-session-extension.js +4 -0
  43. package/lib/db-entries/organization.d.ts +5 -1
  44. package/lib/db-entries/organization.js +4 -0
  45. package/lib/db-entries/sign-in-experience.d.ts +4 -2
  46. package/lib/db-entries/sign-in-experience.js +5 -1
  47. package/lib/db-entries/trusted-device.d.ts +36 -0
  48. package/lib/db-entries/trusted-device.js +62 -0
  49. package/lib/db-entries/user.d.ts +3 -1
  50. package/lib/db-entries/user.js +4 -0
  51. package/lib/foundations/jsonb-types/account-centers.d.ts +3 -0
  52. package/lib/foundations/jsonb-types/account-centers.js +1 -0
  53. package/lib/foundations/jsonb-types/account-centers.test.d.ts +1 -0
  54. package/lib/foundations/jsonb-types/account-centers.test.js +13 -0
  55. package/lib/foundations/jsonb-types/hooks.d.ts +8 -4
  56. package/lib/foundations/jsonb-types/hooks.js +7 -0
  57. package/lib/foundations/jsonb-types/logs.d.ts +18 -0
  58. package/lib/foundations/jsonb-types/logs.js +6 -0
  59. package/lib/foundations/jsonb-types/sign-in-experience.d.ts +23 -3
  60. package/lib/foundations/jsonb-types/sign-in-experience.js +9 -0
  61. package/lib/foundations/jsonb-types/sign-in-experience.test.js +17 -1
  62. package/lib/types/connector.d.ts +8 -0
  63. package/lib/types/consent.d.ts +16 -190
  64. package/lib/types/consent.js +10 -1
  65. package/lib/types/custom-profile-fields.d.ts +1 -0
  66. package/lib/types/hook.d.ts +31 -6
  67. package/lib/types/index.d.ts +1 -0
  68. package/lib/types/index.js +1 -0
  69. package/lib/types/log/index.d.ts +5 -2
  70. package/lib/types/log/index.js +1 -0
  71. package/lib/types/log/trusted-device.d.ts +7 -0
  72. package/lib/types/log/trusted-device.js +6 -0
  73. package/lib/types/logto-config/action.d.ts +1 -1
  74. package/lib/types/logto-config/action.js +1 -1
  75. package/lib/types/logto-config/index.d.ts +36 -7
  76. package/lib/types/logto-config/index.js +13 -0
  77. package/lib/types/logto-config/index.test.js +23 -0
  78. package/lib/types/logto-config/jwt-customizer.d.ts +31 -10
  79. package/lib/types/logto-config/jwt-customizer.js +1 -1
  80. package/lib/types/logto-config/oidc-provider.d.ts +2 -2
  81. package/lib/types/service-log.d.ts +14 -1
  82. package/lib/types/service-log.js +13 -0
  83. package/lib/types/sign-in-experience.d.ts +18 -8
  84. package/lib/types/sign-in-experience.js +2 -1
  85. package/lib/types/system.d.ts +2 -2
  86. package/lib/types/trusted-device.d.ts +67 -0
  87. package/lib/types/trusted-device.js +16 -0
  88. package/lib/types/user-sessions.d.ts +39 -209
  89. package/lib/types/user-sessions.js +9 -4
  90. package/lib/types/user.d.ts +10 -3
  91. package/lib/types/user.js +1 -0
  92. package/lib/utils/cimd.d.ts +14 -0
  93. package/lib/utils/cimd.js +14 -0
  94. package/lib/utils/cimd.test.d.ts +1 -0
  95. package/lib/utils/cimd.test.js +9 -0
  96. package/lib/utils/index.d.ts +1 -0
  97. package/lib/utils/index.js +1 -0
  98. package/package.json +7 -7
  99. package/tables/cimd_grant_client_snapshots.sql +27 -0
  100. package/tables/cimd_grant_organizations.sql +38 -0
  101. package/tables/cimd_organization_resource_scopes.sql +16 -0
  102. package/tables/cimd_organization_scopes.sql +15 -0
  103. package/tables/cimd_resource_scopes.sql +15 -0
  104. package/tables/cimd_user_scopes.sql +13 -0
  105. package/tables/oidc_model_instances.sql +5 -0
  106. package/tables/oidc_session_extensions.sql +5 -0
  107. package/tables/organization_scopes.sql +4 -0
  108. package/tables/organizations.sql +2 -0
  109. package/tables/scopes.sql +4 -0
  110. package/tables/service_logs.sql +14 -0
  111. package/tables/sign_in_experiences.sql +1 -0
  112. package/tables/trusted_devices.sql +25 -0
  113. package/tables/users.sql +1 -0
@@ -626,7 +626,7 @@ export declare const userExtendedSessionGuard: z.ZodObject<{
626
626
  type: import("../foundations/index.js").SignInIdentifier;
627
627
  }>;
628
628
  passwordEncrypted: z.ZodOptional<z.ZodString>;
629
- passwordEncryptionMethod: z.ZodOptional<z.ZodLiteral<import("../db-entries/custom-types.js").UsersPasswordEncryptionMethod.Argon2i>>;
629
+ passwordEncryptionMethod: z.ZodOptional<z.ZodLiteral<import("../index.js").UsersPasswordEncryptionMethod.Argon2i>>;
630
630
  }, "passwordEncrypted" | "passwordEncryptionMethod">, "strip", z.ZodTypeAny, {
631
631
  type: import("./index.js").VerificationType.NewPasswordIdentity;
632
632
  id: string;
@@ -880,6 +880,7 @@ export declare const userExtendedSessionGuard: z.ZodObject<{
880
880
  }, "strip", z.ZodTypeAny, {
881
881
  accountId: string | null;
882
882
  expiresAt: number;
883
+ clientId: string | null;
883
884
  payload: {
884
885
  uid: string;
885
886
  exp: number;
@@ -1012,10 +1013,10 @@ export declare const userExtendedSessionGuard: z.ZodObject<{
1012
1013
  })[];
1013
1014
  signInContext?: Record<string, string> | undefined;
1014
1015
  } | null;
1015
- clientId: string | null;
1016
1016
  }, {
1017
1017
  accountId: string | null;
1018
1018
  expiresAt: number;
1019
+ clientId: string | null;
1019
1020
  payload: {
1020
1021
  uid: string;
1021
1022
  exp: number;
@@ -1148,7 +1149,6 @@ export declare const userExtendedSessionGuard: z.ZodObject<{
1148
1149
  })[];
1149
1150
  signInContext?: Record<string, string> | undefined;
1150
1151
  } | null;
1151
- clientId: string | null;
1152
1152
  }>;
1153
1153
  export declare const getUserSessionsResponseGuard: z.ZodObject<{
1154
1154
  sessions: z.ZodArray<z.ZodObject<{
@@ -1739,7 +1739,7 @@ export declare const getUserSessionsResponseGuard: z.ZodObject<{
1739
1739
  type: import("../foundations/index.js").SignInIdentifier;
1740
1740
  }>;
1741
1741
  passwordEncrypted: z.ZodOptional<z.ZodString>;
1742
- passwordEncryptionMethod: z.ZodOptional<z.ZodLiteral<import("../db-entries/custom-types.js").UsersPasswordEncryptionMethod.Argon2i>>;
1742
+ passwordEncryptionMethod: z.ZodOptional<z.ZodLiteral<import("../index.js").UsersPasswordEncryptionMethod.Argon2i>>;
1743
1743
  }, "passwordEncrypted" | "passwordEncryptionMethod">, "strip", z.ZodTypeAny, {
1744
1744
  type: import("./index.js").VerificationType.NewPasswordIdentity;
1745
1745
  id: string;
@@ -1993,6 +1993,7 @@ export declare const getUserSessionsResponseGuard: z.ZodObject<{
1993
1993
  }, "strip", z.ZodTypeAny, {
1994
1994
  accountId: string | null;
1995
1995
  expiresAt: number;
1996
+ clientId: string | null;
1996
1997
  payload: {
1997
1998
  uid: string;
1998
1999
  exp: number;
@@ -2125,10 +2126,10 @@ export declare const getUserSessionsResponseGuard: z.ZodObject<{
2125
2126
  })[];
2126
2127
  signInContext?: Record<string, string> | undefined;
2127
2128
  } | null;
2128
- clientId: string | null;
2129
2129
  }, {
2130
2130
  accountId: string | null;
2131
2131
  expiresAt: number;
2132
+ clientId: string | null;
2132
2133
  payload: {
2133
2134
  uid: string;
2134
2135
  exp: number;
@@ -2261,12 +2262,12 @@ export declare const getUserSessionsResponseGuard: z.ZodObject<{
2261
2262
  })[];
2262
2263
  signInContext?: Record<string, string> | undefined;
2263
2264
  } | null;
2264
- clientId: string | null;
2265
2265
  }>, "many">;
2266
2266
  }, "strip", z.ZodTypeAny, {
2267
2267
  sessions: {
2268
2268
  accountId: string | null;
2269
2269
  expiresAt: number;
2270
+ clientId: string | null;
2270
2271
  payload: {
2271
2272
  uid: string;
2272
2273
  exp: number;
@@ -2399,12 +2400,12 @@ export declare const getUserSessionsResponseGuard: z.ZodObject<{
2399
2400
  })[];
2400
2401
  signInContext?: Record<string, string> | undefined;
2401
2402
  } | null;
2402
- clientId: string | null;
2403
2403
  }[];
2404
2404
  }, {
2405
2405
  sessions: {
2406
2406
  accountId: string | null;
2407
2407
  expiresAt: number;
2408
+ clientId: string | null;
2408
2409
  payload: {
2409
2410
  uid: string;
2410
2411
  exp: number;
@@ -2537,7 +2538,6 @@ export declare const getUserSessionsResponseGuard: z.ZodObject<{
2537
2538
  })[];
2538
2539
  signInContext?: Record<string, string> | undefined;
2539
2540
  } | null;
2540
- clientId: string | null;
2541
2541
  }[];
2542
2542
  }>;
2543
2543
  /** Response type for `GET /users/:userId/sessions`. */
@@ -3130,7 +3130,7 @@ export declare const getUserSessionResponseGuard: z.ZodObject<{
3130
3130
  type: import("../foundations/index.js").SignInIdentifier;
3131
3131
  }>;
3132
3132
  passwordEncrypted: z.ZodOptional<z.ZodString>;
3133
- passwordEncryptionMethod: z.ZodOptional<z.ZodLiteral<import("../db-entries/custom-types.js").UsersPasswordEncryptionMethod.Argon2i>>;
3133
+ passwordEncryptionMethod: z.ZodOptional<z.ZodLiteral<import("../index.js").UsersPasswordEncryptionMethod.Argon2i>>;
3134
3134
  }, "passwordEncrypted" | "passwordEncryptionMethod">, "strip", z.ZodTypeAny, {
3135
3135
  type: import("./index.js").VerificationType.NewPasswordIdentity;
3136
3136
  id: string;
@@ -3384,6 +3384,7 @@ export declare const getUserSessionResponseGuard: z.ZodObject<{
3384
3384
  }, "strip", z.ZodTypeAny, {
3385
3385
  accountId: string | null;
3386
3386
  expiresAt: number;
3387
+ clientId: string | null;
3387
3388
  payload: {
3388
3389
  uid: string;
3389
3390
  exp: number;
@@ -3516,10 +3517,10 @@ export declare const getUserSessionResponseGuard: z.ZodObject<{
3516
3517
  })[];
3517
3518
  signInContext?: Record<string, string> | undefined;
3518
3519
  } | null;
3519
- clientId: string | null;
3520
3520
  }, {
3521
3521
  accountId: string | null;
3522
3522
  expiresAt: number;
3523
+ clientId: string | null;
3523
3524
  payload: {
3524
3525
  uid: string;
3525
3526
  exp: number;
@@ -3652,7 +3653,6 @@ export declare const getUserSessionResponseGuard: z.ZodObject<{
3652
3653
  })[];
3653
3654
  signInContext?: Record<string, string> | undefined;
3654
3655
  } | null;
3655
- clientId: string | null;
3656
3656
  }>;
3657
3657
  /** Response type for `GET /users/:userId/sessions/:sessionId`. */
3658
3658
  export type GetUserSessionResponse = z.infer<typeof getUserSessionResponseGuard>;
@@ -4252,7 +4252,7 @@ export declare const accountUserExtendedSessionGuard: z.ZodObject<{
4252
4252
  type: import("../foundations/index.js").SignInIdentifier;
4253
4253
  }>;
4254
4254
  passwordEncrypted: z.ZodOptional<z.ZodString>;
4255
- passwordEncryptionMethod: z.ZodOptional<z.ZodLiteral<import("../db-entries/custom-types.js").UsersPasswordEncryptionMethod.Argon2i>>;
4255
+ passwordEncryptionMethod: z.ZodOptional<z.ZodLiteral<import("../index.js").UsersPasswordEncryptionMethod.Argon2i>>;
4256
4256
  }, "passwordEncrypted" | "passwordEncryptionMethod">, "strip", z.ZodTypeAny, {
4257
4257
  type: import("./index.js").VerificationType.NewPasswordIdentity;
4258
4258
  id: string;
@@ -4515,6 +4515,7 @@ export declare const accountUserExtendedSessionGuard: z.ZodObject<{
4515
4515
  }, "strip", z.ZodTypeAny, {
4516
4516
  accountId: string | null;
4517
4517
  expiresAt: number;
4518
+ clientId: string | null;
4518
4519
  payload: {
4519
4520
  uid: string;
4520
4521
  exp: number;
@@ -4647,11 +4648,11 @@ export declare const accountUserExtendedSessionGuard: z.ZodObject<{
4647
4648
  })[];
4648
4649
  signInContext?: Record<string, string> | undefined;
4649
4650
  } | null;
4650
- clientId: string | null;
4651
4651
  isCurrent: boolean;
4652
4652
  }, {
4653
4653
  accountId: string | null;
4654
4654
  expiresAt: number;
4655
+ clientId: string | null;
4655
4656
  payload: {
4656
4657
  uid: string;
4657
4658
  exp: number;
@@ -4784,7 +4785,6 @@ export declare const accountUserExtendedSessionGuard: z.ZodObject<{
4784
4785
  })[];
4785
4786
  signInContext?: Record<string, string> | undefined;
4786
4787
  } | null;
4787
- clientId: string | null;
4788
4788
  isCurrent: boolean;
4789
4789
  }>;
4790
4790
  export declare const getAccountUserSessionsResponseGuard: z.ZodObject<{
@@ -5376,7 +5376,7 @@ export declare const getAccountUserSessionsResponseGuard: z.ZodObject<{
5376
5376
  type: import("../foundations/index.js").SignInIdentifier;
5377
5377
  }>;
5378
5378
  passwordEncrypted: z.ZodOptional<z.ZodString>;
5379
- passwordEncryptionMethod: z.ZodOptional<z.ZodLiteral<import("../db-entries/custom-types.js").UsersPasswordEncryptionMethod.Argon2i>>;
5379
+ passwordEncryptionMethod: z.ZodOptional<z.ZodLiteral<import("../index.js").UsersPasswordEncryptionMethod.Argon2i>>;
5380
5380
  }, "passwordEncrypted" | "passwordEncryptionMethod">, "strip", z.ZodTypeAny, {
5381
5381
  type: import("./index.js").VerificationType.NewPasswordIdentity;
5382
5382
  id: string;
@@ -5639,6 +5639,7 @@ export declare const getAccountUserSessionsResponseGuard: z.ZodObject<{
5639
5639
  }, "strip", z.ZodTypeAny, {
5640
5640
  accountId: string | null;
5641
5641
  expiresAt: number;
5642
+ clientId: string | null;
5642
5643
  payload: {
5643
5644
  uid: string;
5644
5645
  exp: number;
@@ -5771,11 +5772,11 @@ export declare const getAccountUserSessionsResponseGuard: z.ZodObject<{
5771
5772
  })[];
5772
5773
  signInContext?: Record<string, string> | undefined;
5773
5774
  } | null;
5774
- clientId: string | null;
5775
5775
  isCurrent: boolean;
5776
5776
  }, {
5777
5777
  accountId: string | null;
5778
5778
  expiresAt: number;
5779
+ clientId: string | null;
5779
5780
  payload: {
5780
5781
  uid: string;
5781
5782
  exp: number;
@@ -5908,13 +5909,13 @@ export declare const getAccountUserSessionsResponseGuard: z.ZodObject<{
5908
5909
  })[];
5909
5910
  signInContext?: Record<string, string> | undefined;
5910
5911
  } | null;
5911
- clientId: string | null;
5912
5912
  isCurrent: boolean;
5913
5913
  }>, "many">;
5914
5914
  }, "strip", z.ZodTypeAny, {
5915
5915
  sessions: {
5916
5916
  accountId: string | null;
5917
5917
  expiresAt: number;
5918
+ clientId: string | null;
5918
5919
  payload: {
5919
5920
  uid: string;
5920
5921
  exp: number;
@@ -6047,13 +6048,13 @@ export declare const getAccountUserSessionsResponseGuard: z.ZodObject<{
6047
6048
  })[];
6048
6049
  signInContext?: Record<string, string> | undefined;
6049
6050
  } | null;
6050
- clientId: string | null;
6051
6051
  isCurrent: boolean;
6052
6052
  }[];
6053
6053
  }, {
6054
6054
  sessions: {
6055
6055
  accountId: string | null;
6056
6056
  expiresAt: number;
6057
+ clientId: string | null;
6057
6058
  payload: {
6058
6059
  uid: string;
6059
6060
  exp: number;
@@ -6186,7 +6187,6 @@ export declare const getAccountUserSessionsResponseGuard: z.ZodObject<{
6186
6187
  })[];
6187
6188
  signInContext?: Record<string, string> | undefined;
6188
6189
  } | null;
6189
- clientId: string | null;
6190
6190
  isCurrent: boolean;
6191
6191
  }[];
6192
6192
  }>;
@@ -6252,101 +6252,16 @@ export declare const userApplicationGrantGuard: z.ZodObject<{
6252
6252
  accountId: z.ZodString;
6253
6253
  }, z.ZodUnknown, "strip">>;
6254
6254
  expiresAt: z.ZodNumber;
6255
- application: z.ZodObject<Pick<{
6256
- tenantId: z.ZodType<string, z.ZodTypeDef, string>;
6257
- id: z.ZodType<string, z.ZodTypeDef, string>;
6258
- name: z.ZodType<string, z.ZodTypeDef, string>;
6259
- secret: z.ZodType<string, z.ZodTypeDef, string>;
6260
- description: z.ZodType<string | null, z.ZodTypeDef, string | null>;
6261
- type: z.ZodType<import("../db-entries/custom-types.js").ApplicationType, z.ZodTypeDef, import("../db-entries/custom-types.js").ApplicationType>;
6262
- oidcClientMetadata: z.ZodType<import("../foundations/index.js").OidcClientMetadata, z.ZodTypeDef, import("../foundations/index.js").OidcClientMetadata>;
6263
- customClientMetadata: z.ZodType<{
6264
- corsAllowedOrigins?: string[] | undefined;
6265
- idTokenTtl?: number | undefined;
6266
- refreshTokenTtl?: number | undefined;
6267
- refreshTokenTtlInDays?: number | undefined;
6268
- tenantId?: string | undefined;
6269
- alwaysIssueRefreshToken?: boolean | undefined;
6270
- rotateRefreshToken?: boolean | undefined;
6271
- allowTokenExchange?: boolean | undefined;
6272
- isDeviceFlow?: boolean | undefined;
6273
- maxAllowedGrants?: number | undefined;
6274
- }, z.ZodTypeDef, {
6275
- corsAllowedOrigins?: string[] | undefined;
6276
- idTokenTtl?: number | undefined;
6277
- refreshTokenTtl?: number | undefined;
6278
- refreshTokenTtlInDays?: number | undefined;
6279
- tenantId?: string | undefined;
6280
- alwaysIssueRefreshToken?: boolean | undefined;
6281
- rotateRefreshToken?: boolean | undefined;
6282
- allowTokenExchange?: boolean | undefined;
6283
- isDeviceFlow?: boolean | undefined;
6284
- maxAllowedGrants?: number | undefined;
6285
- }>;
6286
- protectedAppMetadata: z.ZodType<{
6287
- host: string;
6288
- origin: string;
6289
- sessionDuration: number;
6290
- pageRules: {
6291
- path: string;
6292
- }[];
6293
- additionalScopes?: (import("@logto/core-kit").UserScope.CustomData | import("@logto/core-kit").UserScope.Identities | import("@logto/core-kit").UserScope.Roles | import("@logto/core-kit").UserScope.Organizations | import("@logto/core-kit").UserScope.OrganizationRoles)[] | undefined;
6294
- customDomains?: {
6295
- status: import("../foundations/index.js").DomainStatus;
6296
- domain: string;
6297
- errorMessage: string | null;
6298
- dnsRecords: {
6299
- value: string;
6300
- type: string;
6301
- name: string;
6302
- }[];
6303
- cloudflareData: {
6304
- status: string;
6305
- id: string;
6306
- ssl: {
6307
- status: string;
6308
- validation_errors?: {
6309
- message: string;
6310
- }[] | undefined;
6311
- };
6312
- verification_errors?: string[] | undefined;
6313
- } | null;
6314
- }[] | undefined;
6315
- } | null, z.ZodTypeDef, {
6316
- host: string;
6317
- origin: string;
6318
- sessionDuration: number;
6319
- pageRules: {
6320
- path: string;
6321
- }[];
6322
- additionalScopes?: (import("@logto/core-kit").UserScope.CustomData | import("@logto/core-kit").UserScope.Identities | import("@logto/core-kit").UserScope.Roles | import("@logto/core-kit").UserScope.Organizations | import("@logto/core-kit").UserScope.OrganizationRoles)[] | undefined;
6323
- customDomains?: {
6324
- status: import("../foundations/index.js").DomainStatus;
6325
- domain: string;
6326
- errorMessage: string | null;
6327
- dnsRecords: {
6328
- value: string;
6329
- type: string;
6330
- name: string;
6331
- }[];
6332
- cloudflareData: {
6333
- status: string;
6334
- id: string;
6335
- ssl: {
6336
- status: string;
6337
- validation_errors?: {
6338
- message: string;
6339
- }[] | undefined;
6340
- };
6341
- verification_errors?: string[] | undefined;
6342
- } | null;
6343
- }[] | undefined;
6344
- } | null>;
6345
- customData: z.ZodType<import("@withtyped/server/lib/types.js").JsonObject, z.ZodTypeDef, import("@withtyped/server/lib/types.js").JsonObject>;
6346
- isThirdParty: z.ZodType<boolean, z.ZodTypeDef, boolean>;
6347
- appLevelAccessControlEnabled: z.ZodType<boolean, z.ZodTypeDef, boolean>;
6348
- createdAt: z.ZodType<number, z.ZodTypeDef, number>;
6349
- }, "name" | "id">, "strip", z.ZodTypeAny, {
6255
+ /**
6256
+ * A CIMD (client ID metadata document) grant fills this slot with a URL identity that has no
6257
+ * `applications` row: the identifier URL lands in `id` and `name` comes from the consent-time
6258
+ * snapshot, so neither field can keep the applications table varchar bounds. Consumers tell
6259
+ * the kinds apart by the id shape.
6260
+ */
6261
+ application: z.ZodObject<{
6262
+ id: z.ZodString;
6263
+ name: z.ZodString;
6264
+ }, "strip", z.ZodTypeAny, {
6350
6265
  name: string;
6351
6266
  id: string;
6352
6267
  }, {
@@ -6421,101 +6336,16 @@ export declare const getUserApplicationGrantsResponseGuard: z.ZodObject<{
6421
6336
  accountId: z.ZodString;
6422
6337
  }, z.ZodUnknown, "strip">>;
6423
6338
  expiresAt: z.ZodNumber;
6424
- application: z.ZodObject<Pick<{
6425
- tenantId: z.ZodType<string, z.ZodTypeDef, string>;
6426
- id: z.ZodType<string, z.ZodTypeDef, string>;
6427
- name: z.ZodType<string, z.ZodTypeDef, string>;
6428
- secret: z.ZodType<string, z.ZodTypeDef, string>;
6429
- description: z.ZodType<string | null, z.ZodTypeDef, string | null>;
6430
- type: z.ZodType<import("../db-entries/custom-types.js").ApplicationType, z.ZodTypeDef, import("../db-entries/custom-types.js").ApplicationType>;
6431
- oidcClientMetadata: z.ZodType<import("../foundations/index.js").OidcClientMetadata, z.ZodTypeDef, import("../foundations/index.js").OidcClientMetadata>;
6432
- customClientMetadata: z.ZodType<{
6433
- corsAllowedOrigins?: string[] | undefined;
6434
- idTokenTtl?: number | undefined;
6435
- refreshTokenTtl?: number | undefined;
6436
- refreshTokenTtlInDays?: number | undefined;
6437
- tenantId?: string | undefined;
6438
- alwaysIssueRefreshToken?: boolean | undefined;
6439
- rotateRefreshToken?: boolean | undefined;
6440
- allowTokenExchange?: boolean | undefined;
6441
- isDeviceFlow?: boolean | undefined;
6442
- maxAllowedGrants?: number | undefined;
6443
- }, z.ZodTypeDef, {
6444
- corsAllowedOrigins?: string[] | undefined;
6445
- idTokenTtl?: number | undefined;
6446
- refreshTokenTtl?: number | undefined;
6447
- refreshTokenTtlInDays?: number | undefined;
6448
- tenantId?: string | undefined;
6449
- alwaysIssueRefreshToken?: boolean | undefined;
6450
- rotateRefreshToken?: boolean | undefined;
6451
- allowTokenExchange?: boolean | undefined;
6452
- isDeviceFlow?: boolean | undefined;
6453
- maxAllowedGrants?: number | undefined;
6454
- }>;
6455
- protectedAppMetadata: z.ZodType<{
6456
- host: string;
6457
- origin: string;
6458
- sessionDuration: number;
6459
- pageRules: {
6460
- path: string;
6461
- }[];
6462
- additionalScopes?: (import("@logto/core-kit").UserScope.CustomData | import("@logto/core-kit").UserScope.Identities | import("@logto/core-kit").UserScope.Roles | import("@logto/core-kit").UserScope.Organizations | import("@logto/core-kit").UserScope.OrganizationRoles)[] | undefined;
6463
- customDomains?: {
6464
- status: import("../foundations/index.js").DomainStatus;
6465
- domain: string;
6466
- errorMessage: string | null;
6467
- dnsRecords: {
6468
- value: string;
6469
- type: string;
6470
- name: string;
6471
- }[];
6472
- cloudflareData: {
6473
- status: string;
6474
- id: string;
6475
- ssl: {
6476
- status: string;
6477
- validation_errors?: {
6478
- message: string;
6479
- }[] | undefined;
6480
- };
6481
- verification_errors?: string[] | undefined;
6482
- } | null;
6483
- }[] | undefined;
6484
- } | null, z.ZodTypeDef, {
6485
- host: string;
6486
- origin: string;
6487
- sessionDuration: number;
6488
- pageRules: {
6489
- path: string;
6490
- }[];
6491
- additionalScopes?: (import("@logto/core-kit").UserScope.CustomData | import("@logto/core-kit").UserScope.Identities | import("@logto/core-kit").UserScope.Roles | import("@logto/core-kit").UserScope.Organizations | import("@logto/core-kit").UserScope.OrganizationRoles)[] | undefined;
6492
- customDomains?: {
6493
- status: import("../foundations/index.js").DomainStatus;
6494
- domain: string;
6495
- errorMessage: string | null;
6496
- dnsRecords: {
6497
- value: string;
6498
- type: string;
6499
- name: string;
6500
- }[];
6501
- cloudflareData: {
6502
- status: string;
6503
- id: string;
6504
- ssl: {
6505
- status: string;
6506
- validation_errors?: {
6507
- message: string;
6508
- }[] | undefined;
6509
- };
6510
- verification_errors?: string[] | undefined;
6511
- } | null;
6512
- }[] | undefined;
6513
- } | null>;
6514
- customData: z.ZodType<import("@withtyped/server/lib/types.js").JsonObject, z.ZodTypeDef, import("@withtyped/server/lib/types.js").JsonObject>;
6515
- isThirdParty: z.ZodType<boolean, z.ZodTypeDef, boolean>;
6516
- appLevelAccessControlEnabled: z.ZodType<boolean, z.ZodTypeDef, boolean>;
6517
- createdAt: z.ZodType<number, z.ZodTypeDef, number>;
6518
- }, "name" | "id">, "strip", z.ZodTypeAny, {
6339
+ /**
6340
+ * A CIMD (client ID metadata document) grant fills this slot with a URL identity that has no
6341
+ * `applications` row: the identifier URL lands in `id` and `name` comes from the consent-time
6342
+ * snapshot, so neither field can keep the applications table varchar bounds. Consumers tell
6343
+ * the kinds apart by the id shape.
6344
+ */
6345
+ application: z.ZodObject<{
6346
+ id: z.ZodString;
6347
+ name: z.ZodString;
6348
+ }, "strip", z.ZodTypeAny, {
6519
6349
  name: string;
6520
6350
  id: string;
6521
6351
  }, {
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
- import { Applications } from '../db-entries/index.js';
3
2
  import { oidcSessionInstancePayloadGuard } from '../foundations/index.js';
4
3
  import { jwtCustomizerUserInteractionContextGuard } from './logto-config/jwt-customizer.js';
5
4
  export const userSessionSignInContextGuard = z
@@ -73,9 +72,15 @@ export const userApplicationGrantGuard = z.object({
73
72
  id: z.string(),
74
73
  payload: userApplicationGrantPayloadGuard,
75
74
  expiresAt: z.number(),
76
- application: Applications.guard.pick({
77
- id: true,
78
- name: true,
75
+ /**
76
+ * A CIMD (client ID metadata document) grant fills this slot with a URL identity that has no
77
+ * `applications` row: the identifier URL lands in `id` and `name` comes from the consent-time
78
+ * snapshot, so neither field can keep the applications table varchar bounds. Consumers tell
79
+ * the kinds apart by the id shape.
80
+ */
81
+ application: z.object({
82
+ id: z.string(),
83
+ name: z.string(),
79
84
  }),
80
85
  });
81
86
  export const getUserApplicationGrantsResponseGuard = z.object({
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { type User } from '../db-entries/index.js';
3
3
  import { MfaFactor } from '../foundations/index.js';
4
- export declare const userInfoSelectFields: readonly ("name" | "id" | "applicationId" | "username" | "createdAt" | "profile" | "avatar" | "customData" | "identities" | "updatedAt" | "lastSignInAt" | "primaryEmail" | "primaryPhone" | "isSuspended")[];
4
+ export declare const userInfoSelectFields: readonly ("name" | "id" | "applicationId" | "cimdClientId" | "username" | "createdAt" | "profile" | "avatar" | "customData" | "identities" | "updatedAt" | "lastSignInAt" | "primaryEmail" | "primaryPhone" | "isSuspended")[];
5
5
  export declare const userInfoGuard: z.ZodObject<Pick<{
6
6
  tenantId: z.ZodType<string, z.ZodTypeDef, string>;
7
7
  id: z.ZodType<string, z.ZodTypeDef, string>;
@@ -54,6 +54,7 @@ export declare const userInfoGuard: z.ZodObject<Pick<{
54
54
  }>;
55
55
  }>>;
56
56
  applicationId: z.ZodType<string | null, z.ZodTypeDef, string | null>;
57
+ cimdClientId: z.ZodType<string | null, z.ZodTypeDef, string | null>;
57
58
  identities: z.ZodType<Record<string, {
58
59
  userId: string;
59
60
  details?: Record<string, import("@withtyped/server/lib/types.js").Json> | undefined;
@@ -126,10 +127,11 @@ export declare const userInfoGuard: z.ZodObject<Pick<{
126
127
  passwordUpdatedAt: z.ZodType<number | null, z.ZodTypeDef, number | null>;
127
128
  createdAt: z.ZodType<number, z.ZodTypeDef, number>;
128
129
  updatedAt: z.ZodType<number, z.ZodTypeDef, number>;
129
- }, "name" | "id" | "applicationId" | "username" | "createdAt" | "profile" | "avatar" | "customData" | "identities" | "updatedAt" | "lastSignInAt" | "primaryEmail" | "primaryPhone" | "isSuspended">, "strip", z.ZodTypeAny, {
130
+ }, "name" | "id" | "applicationId" | "cimdClientId" | "username" | "createdAt" | "profile" | "avatar" | "customData" | "identities" | "updatedAt" | "lastSignInAt" | "primaryEmail" | "primaryPhone" | "isSuspended">, "strip", z.ZodTypeAny, {
130
131
  name: string | null;
131
132
  id: string;
132
133
  applicationId: string | null;
134
+ cimdClientId: string | null;
133
135
  username: string | null;
134
136
  createdAt: number;
135
137
  profile: import("../foundations/index.js").UserProfile;
@@ -145,6 +147,7 @@ export declare const userInfoGuard: z.ZodObject<Pick<{
145
147
  name: string | null;
146
148
  id: string;
147
149
  applicationId: string | null;
150
+ cimdClientId: string | null;
148
151
  username: string | null;
149
152
  createdAt: number;
150
153
  profile: import("../foundations/index.js").UserProfile;
@@ -210,6 +213,7 @@ export declare const userProfileResponseGuard: z.ZodObject<Pick<{
210
213
  }>;
211
214
  }>>;
212
215
  applicationId: z.ZodType<string | null, z.ZodTypeDef, string | null>;
216
+ cimdClientId: z.ZodType<string | null, z.ZodTypeDef, string | null>;
213
217
  identities: z.ZodType<Record<string, {
214
218
  userId: string;
215
219
  details?: Record<string, import("@withtyped/server/lib/types.js").Json> | undefined;
@@ -282,7 +286,7 @@ export declare const userProfileResponseGuard: z.ZodObject<Pick<{
282
286
  passwordUpdatedAt: z.ZodType<number | null, z.ZodTypeDef, number | null>;
283
287
  createdAt: z.ZodType<number, z.ZodTypeDef, number>;
284
288
  updatedAt: z.ZodType<number, z.ZodTypeDef, number>;
285
- }, "name" | "id" | "applicationId" | "username" | "createdAt" | "profile" | "avatar" | "customData" | "identities" | "updatedAt" | "lastSignInAt" | "primaryEmail" | "primaryPhone" | "isSuspended"> & {
289
+ }, "name" | "id" | "applicationId" | "cimdClientId" | "username" | "createdAt" | "profile" | "avatar" | "customData" | "identities" | "updatedAt" | "lastSignInAt" | "primaryEmail" | "primaryPhone" | "isSuspended"> & {
286
290
  hasPassword: z.ZodOptional<z.ZodBoolean>;
287
291
  hasSecurityVerificationMethod: z.ZodOptional<z.ZodBoolean>;
288
292
  ssoIdentities: z.ZodOptional<z.ZodArray<import("../foundations/schemas.js").Guard<import("../db-entries/user-sso-identity.js").UserSsoIdentity>, "many">>;
@@ -290,6 +294,7 @@ export declare const userProfileResponseGuard: z.ZodObject<Pick<{
290
294
  name: string | null;
291
295
  id: string;
292
296
  applicationId: string | null;
297
+ cimdClientId: string | null;
293
298
  username: string | null;
294
299
  createdAt: number;
295
300
  profile: import("../foundations/index.js").UserProfile;
@@ -308,6 +313,7 @@ export declare const userProfileResponseGuard: z.ZodObject<Pick<{
308
313
  name: string | null;
309
314
  id: string;
310
315
  applicationId: string | null;
316
+ cimdClientId: string | null;
311
317
  username: string | null;
312
318
  createdAt: number;
313
319
  profile: import("../foundations/index.js").UserProfile;
@@ -430,6 +436,7 @@ export declare const featuredUserGuard: z.ZodObject<Pick<{
430
436
  }>;
431
437
  }>>;
432
438
  applicationId: z.ZodType<string | null, z.ZodTypeDef, string | null>;
439
+ cimdClientId: z.ZodType<string | null, z.ZodTypeDef, string | null>;
433
440
  identities: z.ZodType<Record<string, {
434
441
  userId: string;
435
442
  details?: Record<string, import("@withtyped/server/lib/types.js").Json> | undefined;
package/lib/types/user.js CHANGED
@@ -16,6 +16,7 @@ export const userInfoSelectFields = Object.freeze([
16
16
  'updatedAt',
17
17
  'profile',
18
18
  'applicationId',
19
+ 'cimdClientId',
19
20
  'isSuspended',
20
21
  ]);
21
22
  export const userInfoGuard = Users.guard.pick(
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @overview The CIMD (OAuth Client ID Metadata Document) client identifier namespace predicate.
3
+ *
4
+ * Lives in `@logto/schemas` because both runtimes classify the same identifier: core wires the
5
+ * feature configuration and request-time matching, while the experience client recognizes a CIMD
6
+ * identifier carried over from the authorization request (e.g. to accept SSR settings rendered
7
+ * without an `appId`).
8
+ */
9
+ /**
10
+ * Whether the identifier is in the CIMD namespace. Mirrors the scheme test of the fork's
11
+ * `isValidClientIdUrl` (case-insensitive); registered application ids never take the URL shape,
12
+ * so the shape safely routes — the resolved client stays the authority on what a client is.
13
+ */
14
+ export declare const isCimdClientId: (clientId: string) => boolean;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @overview The CIMD (OAuth Client ID Metadata Document) client identifier namespace predicate.
3
+ *
4
+ * Lives in `@logto/schemas` because both runtimes classify the same identifier: core wires the
5
+ * feature configuration and request-time matching, while the experience client recognizes a CIMD
6
+ * identifier carried over from the authorization request (e.g. to accept SSR settings rendered
7
+ * without an `appId`).
8
+ */
9
+ /**
10
+ * Whether the identifier is in the CIMD namespace. Mirrors the scheme test of the fork's
11
+ * `isValidClientIdUrl` (case-insensitive); registered application ids never take the URL shape,
12
+ * so the shape safely routes — the resolved client stays the authority on what a client is.
13
+ */
14
+ export const isCimdClientId = (clientId) => /^https:\/\//iu.test(clientId);
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { isCimdClientId } from './cimd.js';
3
+ describe('isCimdClientId', () => {
4
+ it('matches the fork scheme test case-insensitively and never matches registered ids', () => {
5
+ expect(isCimdClientId('https://client.example.com/metadata.json')).toBe(true);
6
+ expect(isCimdClientId('HTTPS://client.example.com/metadata.json')).toBe(true);
7
+ expect(isCimdClientId('registered_client_id')).toBe(false);
8
+ });
9
+ });
@@ -3,3 +3,4 @@ export * from './role.js';
3
3
  export * from './management-api.js';
4
4
  export * from './domain.js';
5
5
  export * from './oidc-private-key.js';
6
+ export * from './cimd.js';
@@ -3,3 +3,4 @@ export * from './role.js';
3
3
  export * from './management-api.js';
4
4
  export * from './domain.js';
5
5
  export * from './oidc-private-key.js';
6
+ export * from './cimd.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logto/schemas",
3
- "version": "1.42.0",
3
+ "version": "1.43.0",
4
4
  "author": "Silverhand Inc. <contact@silverhand.io>",
5
5
  "license": "MPL-2.0",
6
6
  "type": "module",
@@ -65,12 +65,12 @@
65
65
  "dependencies": {
66
66
  "@withtyped/server": "^0.14.0",
67
67
  "nanoid": "^5.0.9",
68
- "@logto/connector-kit": "^5.1.0",
69
- "@logto/language-kit": "^1.3.0",
70
- "@logto/phrases": "^1.30.0",
71
- "@logto/core-kit": "^2.12.0",
72
- "@logto/shared": "^3.4.2",
73
- "@logto/phrases-experience": "^1.14.1"
68
+ "@logto/core-kit": "^2.13.0",
69
+ "@logto/connector-kit": "^5.1.1",
70
+ "@logto/language-kit": "^1.4.0",
71
+ "@logto/phrases": "^1.31.0",
72
+ "@logto/phrases-experience": "^1.15.0",
73
+ "@logto/shared": "^3.4.3"
74
74
  },
75
75
  "peerDependencies": {
76
76
  "zod": "3.24.3"