@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
@@ -255,6 +255,7 @@ export declare const connectorResponseGuard: z.ZodObject<{
255
255
  es?: string | undefined;
256
256
  "es-ES"?: string | undefined;
257
257
  "es-419"?: string | undefined;
258
+ "es-MX"?: string | undefined;
258
259
  "et-EE"?: string | undefined;
259
260
  "eu-ES"?: string | undefined;
260
261
  "fa-IR"?: string | undefined;
@@ -389,6 +390,7 @@ export declare const connectorResponseGuard: z.ZodObject<{
389
390
  es?: string | undefined;
390
391
  "es-ES"?: string | undefined;
391
392
  "es-419"?: string | undefined;
393
+ "es-MX"?: string | undefined;
392
394
  "et-EE"?: string | undefined;
393
395
  "eu-ES"?: string | undefined;
394
396
  "fa-IR"?: string | undefined;
@@ -593,6 +595,7 @@ export declare const connectorResponseGuard: z.ZodObject<{
593
595
  es?: string | undefined;
594
596
  "es-ES"?: string | undefined;
595
597
  "es-419"?: string | undefined;
598
+ "es-MX"?: string | undefined;
596
599
  "et-EE"?: string | undefined;
597
600
  "eu-ES"?: string | undefined;
598
601
  "fa-IR"?: string | undefined;
@@ -727,6 +730,7 @@ export declare const connectorResponseGuard: z.ZodObject<{
727
730
  es?: string | undefined;
728
731
  "es-ES"?: string | undefined;
729
732
  "es-419"?: string | undefined;
733
+ "es-MX"?: string | undefined;
730
734
  "et-EE"?: string | undefined;
731
735
  "eu-ES"?: string | undefined;
732
736
  "fa-IR"?: string | undefined;
@@ -1136,6 +1140,7 @@ export declare const connectorFactoryResponseGuard: z.ZodObject<{
1136
1140
  es?: string | undefined;
1137
1141
  "es-ES"?: string | undefined;
1138
1142
  "es-419"?: string | undefined;
1143
+ "es-MX"?: string | undefined;
1139
1144
  "et-EE"?: string | undefined;
1140
1145
  "eu-ES"?: string | undefined;
1141
1146
  "fa-IR"?: string | undefined;
@@ -1270,6 +1275,7 @@ export declare const connectorFactoryResponseGuard: z.ZodObject<{
1270
1275
  es?: string | undefined;
1271
1276
  "es-ES"?: string | undefined;
1272
1277
  "es-419"?: string | undefined;
1278
+ "es-MX"?: string | undefined;
1273
1279
  "et-EE"?: string | undefined;
1274
1280
  "eu-ES"?: string | undefined;
1275
1281
  "fa-IR"?: string | undefined;
@@ -1467,6 +1473,7 @@ export declare const connectorFactoryResponseGuard: z.ZodObject<{
1467
1473
  es?: string | undefined;
1468
1474
  "es-ES"?: string | undefined;
1469
1475
  "es-419"?: string | undefined;
1476
+ "es-MX"?: string | undefined;
1470
1477
  "et-EE"?: string | undefined;
1471
1478
  "eu-ES"?: string | undefined;
1472
1479
  "fa-IR"?: string | undefined;
@@ -1601,6 +1608,7 @@ export declare const connectorFactoryResponseGuard: z.ZodObject<{
1601
1608
  es?: string | undefined;
1602
1609
  "es-ES"?: string | undefined;
1603
1610
  "es-419"?: string | undefined;
1611
+ "es-MX"?: string | undefined;
1604
1612
  "et-EE"?: string | undefined;
1605
1613
  "eu-ES"?: string | undefined;
1606
1614
  "fa-IR"?: string | undefined;
@@ -54,6 +54,7 @@ export declare const publicUserInfoGuard: 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").Json> | undefined;
@@ -144,102 +145,15 @@ export declare const publicUserInfoGuard: z.ZodObject<Pick<{
144
145
  export type PublicUserInfo = z.infer<typeof publicUserInfoGuard>;
145
146
  /**
146
147
  * Define the public application info that can be exposed to the public. e.g. on the user consent page.
148
+ *
149
+ * The overrides lift the applications-table column length bounds for CIMD clients: `id` carries
150
+ * the identifier URL (up to 2048 characters), and `name` the remote document's `client_name`,
151
+ * which is unbounded and empty when the document omits it.
147
152
  */
148
- export declare const publicApplicationGuard: z.ZodObject<Pick<{
149
- tenantId: z.ZodType<string, z.ZodTypeDef, string>;
150
- id: z.ZodType<string, z.ZodTypeDef, string>;
151
- name: z.ZodType<string, z.ZodTypeDef, string>;
152
- secret: z.ZodType<string, z.ZodTypeDef, string>;
153
- description: z.ZodType<string | null, z.ZodTypeDef, string | null>;
154
- type: z.ZodType<import("../db-entries/custom-types.js").ApplicationType, z.ZodTypeDef, import("../db-entries/custom-types.js").ApplicationType>;
155
- oidcClientMetadata: z.ZodType<import("../index.js").OidcClientMetadata, z.ZodTypeDef, import("../index.js").OidcClientMetadata>;
156
- customClientMetadata: z.ZodType<{
157
- corsAllowedOrigins?: string[] | undefined;
158
- idTokenTtl?: number | undefined;
159
- refreshTokenTtl?: number | undefined;
160
- refreshTokenTtlInDays?: number | undefined;
161
- tenantId?: string | undefined;
162
- alwaysIssueRefreshToken?: boolean | undefined;
163
- rotateRefreshToken?: boolean | undefined;
164
- allowTokenExchange?: boolean | undefined;
165
- isDeviceFlow?: boolean | undefined;
166
- maxAllowedGrants?: number | undefined;
167
- }, z.ZodTypeDef, {
168
- corsAllowedOrigins?: string[] | undefined;
169
- idTokenTtl?: number | undefined;
170
- refreshTokenTtl?: number | undefined;
171
- refreshTokenTtlInDays?: number | undefined;
172
- tenantId?: string | undefined;
173
- alwaysIssueRefreshToken?: boolean | undefined;
174
- rotateRefreshToken?: boolean | undefined;
175
- allowTokenExchange?: boolean | undefined;
176
- isDeviceFlow?: boolean | undefined;
177
- maxAllowedGrants?: number | undefined;
178
- }>;
179
- protectedAppMetadata: z.ZodType<{
180
- host: string;
181
- origin: string;
182
- sessionDuration: number;
183
- pageRules: {
184
- path: string;
185
- }[];
186
- 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;
187
- customDomains?: {
188
- status: import("../index.js").DomainStatus;
189
- domain: string;
190
- errorMessage: string | null;
191
- dnsRecords: {
192
- value: string;
193
- type: string;
194
- name: string;
195
- }[];
196
- cloudflareData: {
197
- status: string;
198
- id: string;
199
- ssl: {
200
- status: string;
201
- validation_errors?: {
202
- message: string;
203
- }[] | undefined;
204
- };
205
- verification_errors?: string[] | undefined;
206
- } | null;
207
- }[] | undefined;
208
- } | null, z.ZodTypeDef, {
209
- host: string;
210
- origin: string;
211
- sessionDuration: number;
212
- pageRules: {
213
- path: string;
214
- }[];
215
- 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;
216
- customDomains?: {
217
- status: import("../index.js").DomainStatus;
218
- domain: string;
219
- errorMessage: string | null;
220
- dnsRecords: {
221
- value: string;
222
- type: string;
223
- name: string;
224
- }[];
225
- cloudflareData: {
226
- status: string;
227
- id: string;
228
- ssl: {
229
- status: string;
230
- validation_errors?: {
231
- message: string;
232
- }[] | undefined;
233
- };
234
- verification_errors?: string[] | undefined;
235
- } | null;
236
- }[] | undefined;
237
- } | null>;
238
- customData: z.ZodType<import("@withtyped/server").JsonObject, z.ZodTypeDef, import("@withtyped/server").JsonObject>;
239
- isThirdParty: z.ZodType<boolean, z.ZodTypeDef, boolean>;
240
- appLevelAccessControlEnabled: z.ZodType<boolean, z.ZodTypeDef, boolean>;
241
- createdAt: z.ZodType<number, z.ZodTypeDef, number>;
242
- }, "name" | "id">, "strip", z.ZodTypeAny, {
153
+ export declare const publicApplicationGuard: z.ZodObject<{} & {
154
+ id: z.ZodString;
155
+ name: z.ZodString;
156
+ }, "strip", z.ZodTypeAny, {
243
157
  name: string;
244
158
  id: string;
245
159
  }, {
@@ -357,6 +271,7 @@ export declare const publicOrganizationGuard: z.ZodObject<Pick<{
357
271
  description: z.ZodType<string | null, z.ZodTypeDef, string | null>;
358
272
  customData: z.ZodType<import("@withtyped/server").JsonObject, z.ZodTypeDef, import("@withtyped/server").JsonObject>;
359
273
  isMfaRequired: z.ZodType<boolean, z.ZodTypeDef, boolean>;
274
+ isTrustedDeviceAllowed: z.ZodType<boolean, z.ZodTypeDef, boolean>;
360
275
  color: z.ZodType<Partial<{
361
276
  primaryColor: string;
362
277
  isDarkModeEnabled: boolean;
@@ -471,101 +386,10 @@ export declare const publicOrganizationGuard: z.ZodObject<Pick<{
471
386
  }>;
472
387
  export type PublicOrganization = z.infer<typeof publicOrganizationGuard>;
473
388
  export declare const consentInfoResponseGuard: z.ZodObject<{
474
- application: z.ZodObject<Pick<{
475
- tenantId: z.ZodType<string, z.ZodTypeDef, string>;
476
- id: z.ZodType<string, z.ZodTypeDef, string>;
477
- name: z.ZodType<string, z.ZodTypeDef, string>;
478
- secret: z.ZodType<string, z.ZodTypeDef, string>;
479
- description: z.ZodType<string | null, z.ZodTypeDef, string | null>;
480
- type: z.ZodType<import("../db-entries/custom-types.js").ApplicationType, z.ZodTypeDef, import("../db-entries/custom-types.js").ApplicationType>;
481
- oidcClientMetadata: z.ZodType<import("../index.js").OidcClientMetadata, z.ZodTypeDef, import("../index.js").OidcClientMetadata>;
482
- customClientMetadata: z.ZodType<{
483
- corsAllowedOrigins?: string[] | undefined;
484
- idTokenTtl?: number | undefined;
485
- refreshTokenTtl?: number | undefined;
486
- refreshTokenTtlInDays?: number | undefined;
487
- tenantId?: string | undefined;
488
- alwaysIssueRefreshToken?: boolean | undefined;
489
- rotateRefreshToken?: boolean | undefined;
490
- allowTokenExchange?: boolean | undefined;
491
- isDeviceFlow?: boolean | undefined;
492
- maxAllowedGrants?: number | undefined;
493
- }, z.ZodTypeDef, {
494
- corsAllowedOrigins?: string[] | undefined;
495
- idTokenTtl?: number | undefined;
496
- refreshTokenTtl?: number | undefined;
497
- refreshTokenTtlInDays?: number | undefined;
498
- tenantId?: string | undefined;
499
- alwaysIssueRefreshToken?: boolean | undefined;
500
- rotateRefreshToken?: boolean | undefined;
501
- allowTokenExchange?: boolean | undefined;
502
- isDeviceFlow?: boolean | undefined;
503
- maxAllowedGrants?: number | undefined;
504
- }>;
505
- protectedAppMetadata: z.ZodType<{
506
- host: string;
507
- origin: string;
508
- sessionDuration: number;
509
- pageRules: {
510
- path: string;
511
- }[];
512
- 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;
513
- customDomains?: {
514
- status: import("../index.js").DomainStatus;
515
- domain: string;
516
- errorMessage: string | null;
517
- dnsRecords: {
518
- value: string;
519
- type: string;
520
- name: string;
521
- }[];
522
- cloudflareData: {
523
- status: string;
524
- id: string;
525
- ssl: {
526
- status: string;
527
- validation_errors?: {
528
- message: string;
529
- }[] | undefined;
530
- };
531
- verification_errors?: string[] | undefined;
532
- } | null;
533
- }[] | undefined;
534
- } | null, z.ZodTypeDef, {
535
- host: string;
536
- origin: string;
537
- sessionDuration: number;
538
- pageRules: {
539
- path: string;
540
- }[];
541
- 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;
542
- customDomains?: {
543
- status: import("../index.js").DomainStatus;
544
- domain: string;
545
- errorMessage: string | null;
546
- dnsRecords: {
547
- value: string;
548
- type: string;
549
- name: string;
550
- }[];
551
- cloudflareData: {
552
- status: string;
553
- id: string;
554
- ssl: {
555
- status: string;
556
- validation_errors?: {
557
- message: string;
558
- }[] | undefined;
559
- };
560
- verification_errors?: string[] | undefined;
561
- } | null;
562
- }[] | undefined;
563
- } | null>;
564
- customData: z.ZodType<import("@withtyped/server").JsonObject, z.ZodTypeDef, import("@withtyped/server").JsonObject>;
565
- isThirdParty: z.ZodType<boolean, z.ZodTypeDef, boolean>;
566
- appLevelAccessControlEnabled: z.ZodType<boolean, z.ZodTypeDef, boolean>;
567
- createdAt: z.ZodType<number, z.ZodTypeDef, number>;
568
- }, "name" | "id"> & {
389
+ application: z.ZodObject<{} & {
390
+ id: z.ZodString;
391
+ name: z.ZodString;
392
+ } & {
569
393
  displayName: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
570
394
  branding: z.ZodOptional<z.ZodType<{
571
395
  logoUrl?: string | undefined;
@@ -657,6 +481,7 @@ export declare const consentInfoResponseGuard: z.ZodObject<{
657
481
  }>;
658
482
  }>>;
659
483
  applicationId: z.ZodType<string | null, z.ZodTypeDef, string | null>;
484
+ cimdClientId: z.ZodType<string | null, z.ZodTypeDef, string | null>;
660
485
  identities: z.ZodType<Record<string, {
661
486
  userId: string;
662
487
  details?: Record<string, import("@withtyped/server").Json> | undefined;
@@ -751,6 +576,7 @@ export declare const consentInfoResponseGuard: z.ZodObject<{
751
576
  description: z.ZodType<string | null, z.ZodTypeDef, string | null>;
752
577
  customData: z.ZodType<import("@withtyped/server").JsonObject, z.ZodTypeDef, import("@withtyped/server").JsonObject>;
753
578
  isMfaRequired: z.ZodType<boolean, z.ZodTypeDef, boolean>;
579
+ isTrustedDeviceAllowed: z.ZodType<boolean, z.ZodTypeDef, boolean>;
754
580
  color: z.ZodType<Partial<{
755
581
  primaryColor: string;
756
582
  isDarkModeEnabled: boolean;
@@ -13,10 +13,19 @@ export const publicUserInfoGuard = Users.guard.pick({
13
13
  });
14
14
  /**
15
15
  * Define the public application info that can be exposed to the public. e.g. on the user consent page.
16
+ *
17
+ * The overrides lift the applications-table column length bounds for CIMD clients: `id` carries
18
+ * the identifier URL (up to 2048 characters), and `name` the remote document's `client_name`,
19
+ * which is unbounded and empty when the document omits it.
16
20
  */
17
- export const publicApplicationGuard = Applications.guard.pick({
21
+ export const publicApplicationGuard = Applications.guard
22
+ .pick({
18
23
  id: true,
19
24
  name: true,
25
+ })
26
+ .extend({
27
+ id: z.string(),
28
+ name: z.string(),
20
29
  });
21
30
  export const applicationSignInExperienceGuard = ApplicationSignInExperiences.guard.pick({
22
31
  branding: true,
@@ -2457,6 +2457,7 @@ export declare const signInIdentifierKeyGuard: z.ZodObject<Pick<{
2457
2457
  }>;
2458
2458
  }>>>;
2459
2459
  applicationId: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
2460
+ cimdClientId: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
2460
2461
  identities: z.ZodOptional<z.ZodType<Record<string, {
2461
2462
  userId: string;
2462
2463
  details?: Record<string, import("@withtyped/server/lib/types.js").Json> | undefined;
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { type Application, type User } from '../db-entries/index.js';
2
+ import { type Application, type TrustedDevice, type User } from '../db-entries/index.js';
3
3
  import { type ExceptionHookEvent, type DataHookEvent, type InteractionHookEvent } from '../foundations/index.js';
4
4
  import { type InteractionEvent } from './interactions.js';
5
5
  import { type userInfoSelectFields } from './user.js';
@@ -18,8 +18,8 @@ export declare const hookResponseGuard: z.ZodObject<{
18
18
  tenantId: z.ZodType<string, z.ZodTypeDef, string>;
19
19
  id: z.ZodType<string, z.ZodTypeDef, string>;
20
20
  name: z.ZodType<string, z.ZodTypeDef, string>;
21
- event: z.ZodType<"User.Created" | "User.Deleted" | "Role.Created" | "Role.Deleted" | "Scope.Created" | "Scope.Deleted" | "Organization.Created" | "Organization.Deleted" | "OrganizationRole.Created" | "OrganizationRole.Deleted" | "OrganizationScope.Created" | "OrganizationScope.Deleted" | "User.Data.Updated" | "Role.Data.Updated" | "Scope.Data.Updated" | "Organization.Data.Updated" | "OrganizationRole.Data.Updated" | "OrganizationScope.Data.Updated" | "User.SuspensionStatus.Updated" | "Role.Scopes.Updated" | "Organization.Membership.Updated" | "OrganizationRole.Scopes.Updated" | "Identifier.Lockout" | "Message.RateLimited" | "Grant.LimitExceeded" | InteractionHookEvent | null, z.ZodTypeDef, "User.Created" | "User.Deleted" | "Role.Created" | "Role.Deleted" | "Scope.Created" | "Scope.Deleted" | "Organization.Created" | "Organization.Deleted" | "OrganizationRole.Created" | "OrganizationRole.Deleted" | "OrganizationScope.Created" | "OrganizationScope.Deleted" | "User.Data.Updated" | "Role.Data.Updated" | "Scope.Data.Updated" | "Organization.Data.Updated" | "OrganizationRole.Data.Updated" | "OrganizationScope.Data.Updated" | "User.SuspensionStatus.Updated" | "Role.Scopes.Updated" | "Organization.Membership.Updated" | "OrganizationRole.Scopes.Updated" | "Identifier.Lockout" | "Message.RateLimited" | "Grant.LimitExceeded" | InteractionHookEvent | null>;
22
- events: z.ZodType<("User.Created" | "User.Deleted" | "Role.Created" | "Role.Deleted" | "Scope.Created" | "Scope.Deleted" | "Organization.Created" | "Organization.Deleted" | "OrganizationRole.Created" | "OrganizationRole.Deleted" | "OrganizationScope.Created" | "OrganizationScope.Deleted" | "User.Data.Updated" | "Role.Data.Updated" | "Scope.Data.Updated" | "Organization.Data.Updated" | "OrganizationRole.Data.Updated" | "OrganizationScope.Data.Updated" | "User.SuspensionStatus.Updated" | "Role.Scopes.Updated" | "Organization.Membership.Updated" | "OrganizationRole.Scopes.Updated" | "Identifier.Lockout" | "Message.RateLimited" | "Grant.LimitExceeded" | InteractionHookEvent)[], z.ZodTypeDef, ("User.Created" | "User.Deleted" | "Role.Created" | "Role.Deleted" | "Scope.Created" | "Scope.Deleted" | "Organization.Created" | "Organization.Deleted" | "OrganizationRole.Created" | "OrganizationRole.Deleted" | "OrganizationScope.Created" | "OrganizationScope.Deleted" | "User.Data.Updated" | "Role.Data.Updated" | "Scope.Data.Updated" | "Organization.Data.Updated" | "OrganizationRole.Data.Updated" | "OrganizationScope.Data.Updated" | "User.SuspensionStatus.Updated" | "Role.Scopes.Updated" | "Organization.Membership.Updated" | "OrganizationRole.Scopes.Updated" | "Identifier.Lockout" | "Message.RateLimited" | "Grant.LimitExceeded" | InteractionHookEvent)[]>;
21
+ event: z.ZodType<"User.Created" | "User.Deleted" | "TrustedDevice.Created" | "TrustedDevice.Deleted" | "Role.Created" | "Role.Deleted" | "Scope.Created" | "Scope.Deleted" | "Organization.Created" | "Organization.Deleted" | "OrganizationRole.Created" | "OrganizationRole.Deleted" | "OrganizationScope.Created" | "OrganizationScope.Deleted" | "User.Data.Updated" | "Role.Data.Updated" | "Scope.Data.Updated" | "Organization.Data.Updated" | "OrganizationRole.Data.Updated" | "OrganizationScope.Data.Updated" | "User.SuspensionStatus.Updated" | "Role.Scopes.Updated" | "Organization.Membership.Updated" | "OrganizationRole.Scopes.Updated" | "Identifier.Lockout" | "Message.RateLimited" | "Grant.LimitExceeded" | InteractionHookEvent | null, z.ZodTypeDef, "User.Created" | "User.Deleted" | "TrustedDevice.Created" | "TrustedDevice.Deleted" | "Role.Created" | "Role.Deleted" | "Scope.Created" | "Scope.Deleted" | "Organization.Created" | "Organization.Deleted" | "OrganizationRole.Created" | "OrganizationRole.Deleted" | "OrganizationScope.Created" | "OrganizationScope.Deleted" | "User.Data.Updated" | "Role.Data.Updated" | "Scope.Data.Updated" | "Organization.Data.Updated" | "OrganizationRole.Data.Updated" | "OrganizationScope.Data.Updated" | "User.SuspensionStatus.Updated" | "Role.Scopes.Updated" | "Organization.Membership.Updated" | "OrganizationRole.Scopes.Updated" | "Identifier.Lockout" | "Message.RateLimited" | "Grant.LimitExceeded" | InteractionHookEvent | null>;
22
+ events: z.ZodType<("User.Created" | "User.Deleted" | "TrustedDevice.Created" | "TrustedDevice.Deleted" | "Role.Created" | "Role.Deleted" | "Scope.Created" | "Scope.Deleted" | "Organization.Created" | "Organization.Deleted" | "OrganizationRole.Created" | "OrganizationRole.Deleted" | "OrganizationScope.Created" | "OrganizationScope.Deleted" | "User.Data.Updated" | "Role.Data.Updated" | "Scope.Data.Updated" | "Organization.Data.Updated" | "OrganizationRole.Data.Updated" | "OrganizationScope.Data.Updated" | "User.SuspensionStatus.Updated" | "Role.Scopes.Updated" | "Organization.Membership.Updated" | "OrganizationRole.Scopes.Updated" | "Identifier.Lockout" | "Message.RateLimited" | "Grant.LimitExceeded" | InteractionHookEvent)[], z.ZodTypeDef, ("User.Created" | "User.Deleted" | "TrustedDevice.Created" | "TrustedDevice.Deleted" | "Role.Created" | "Role.Deleted" | "Scope.Created" | "Scope.Deleted" | "Organization.Created" | "Organization.Deleted" | "OrganizationRole.Created" | "OrganizationRole.Deleted" | "OrganizationScope.Created" | "OrganizationScope.Deleted" | "User.Data.Updated" | "Role.Data.Updated" | "Scope.Data.Updated" | "Organization.Data.Updated" | "OrganizationRole.Data.Updated" | "OrganizationScope.Data.Updated" | "User.SuspensionStatus.Updated" | "Role.Scopes.Updated" | "Organization.Membership.Updated" | "OrganizationRole.Scopes.Updated" | "Identifier.Lockout" | "Message.RateLimited" | "Grant.LimitExceeded" | InteractionHookEvent)[]>;
23
23
  config: z.ZodType<{
24
24
  url: string;
25
25
  headers?: Record<string, string> | undefined;
@@ -90,8 +90,13 @@ export type HookTestErrorResponseData = z.infer<typeof hookTestErrorResponseData
90
90
  * we will store the context before processing the interaction and consume it after the interaction is processed if needed.
91
91
  */
92
92
  export type InteractionApiMetadata = {
93
- /** The application ID if the hook is triggered by interaction API. */
93
+ /** The registered application ID if the hook is triggered by interaction API. */
94
94
  applicationId?: string;
95
+ /**
96
+ * The CIMD client identifier URL, kept apart from `applicationId` so payload consumers
97
+ * branch on key presence instead of URL shape.
98
+ */
99
+ cimdClientId?: string;
95
100
  /** The session ID if the hook is triggered by interaction API. */
96
101
  sessionId?: string;
97
102
  /** The InteractionEvent if the hook is triggered by interaction API. */
@@ -100,6 +105,8 @@ export type InteractionApiMetadata = {
100
105
  type InteractionApiContextPayload = {
101
106
  /** Fetch application detail by application ID before sending the hook event */
102
107
  application?: Pick<Application, 'id' | 'type' | 'name' | 'description'>;
108
+ /** CIMD clients are unregistered, so the identifier URL stands in for `application`. */
109
+ cimdClientId?: string;
103
110
  sessionId?: string;
104
111
  interactionEvent?: InteractionEvent;
105
112
  };
@@ -140,12 +147,30 @@ export type DataHookEventPayload = {
140
147
  userAgent?: string;
141
148
  data?: unknown;
142
149
  } & Partial<InteractionApiContextPayload> & Partial<ManagementApiContext> & Record<string, unknown>;
143
- export type ExceptionHookEventPayload = Omit<DataHookEventPayload, 'event'> & {
150
+ /** The intentionally limited trusted-device projection exposed by lifecycle events. */
151
+ export type TrustedDeviceEventData = Pick<TrustedDevice, 'id' | 'userId' | 'expiresAt'>;
152
+ /**
153
+ * A key-remapping omit instead of the built-in `Omit`: on a type carrying a string index
154
+ * signature (e.g. the hook event payloads), `Omit` collapses every named property into
155
+ * `unknown`; the homomorphic form keeps the named properties typed.
156
+ */
157
+ export type BetterOmit<T, Ignore> = {
158
+ [key in keyof T as key extends Ignore ? never : key]: T[key];
159
+ };
160
+ export type ExceptionHookEventPayload = BetterOmit<DataHookEventPayload, 'event'> & {
144
161
  event: ExceptionHookEvent;
145
162
  };
146
163
  export type GrantLimitExceededEventData = {
147
164
  userId: string;
148
- applicationId: string;
165
+ /** The registered application ID; absent for a CIMD client. */
166
+ applicationId?: string;
167
+ /**
168
+ * The CIMD client identifier URL, set instead of `applicationId`. No grant-ceiling source
169
+ * exists for CIMD clients today (the CIMD policy denies Logto private client metadata
170
+ * regardless of source), so this key is defensive: it keeps `applicationId` registered-only
171
+ * by construction should a ceiling for CIMD clients ever be introduced.
172
+ */
173
+ cimdClientId?: string;
149
174
  revokedGrantIds: string[];
150
175
  maxAllowedGrants: number;
151
176
  preRevocationActiveGrantCount: number;
@@ -36,3 +36,4 @@ export * from './custom-profile-fields.js';
36
36
  export * from './secrets.js';
37
37
  export * from './user-logto-config.js';
38
38
  export * from './user-sessions.js';
39
+ export * from './trusted-device.js';
@@ -36,3 +36,4 @@ export * from './custom-profile-fields.js';
36
36
  export * from './secrets.js';
37
37
  export * from './user-logto-config.js';
38
38
  export * from './user-sessions.js';
39
+ export * from './trusted-device.js';
@@ -4,12 +4,14 @@ import type * as interaction from './interaction.js';
4
4
  import type * as jwtCustomizer from './jwt-customizer.js';
5
5
  import type * as saml from './saml.js';
6
6
  import type * as token from './token.js';
7
+ import type * as trustedDevice from './trusted-device.js';
7
8
  export * as interaction from './interaction.js';
8
9
  export * as token from './token.js';
9
10
  export * as hook from './hook.js';
10
11
  export * as action from './action.js';
11
12
  export * as jwtCustomizer from './jwt-customizer.js';
12
13
  export * as saml from './saml.js';
14
+ export * as trustedDevice from './trusted-device.js';
13
15
  /** Fallback for empty or unrecognized log keys. */
14
16
  export declare const LogKeyUnknown = "Unknown";
15
17
  export type InteractionLogKey = interaction.LogKey;
@@ -18,17 +20,18 @@ export type WebhookLogKey = hook.LogKey;
18
20
  export type ActionLogKey = action.LogKey;
19
21
  export type JwtCustomizerLogKey = jwtCustomizer.LogKey;
20
22
  export type SamlLogKey = saml.LogKey;
23
+ export type TrustedDeviceLogKey = trustedDevice.LogKey;
21
24
  /**
22
25
  * The union type of all available audit log keys.
23
26
  *
24
27
  * - All user-facing audit log keys should be included here.
25
28
  * - Webhook log keys are excluded.
26
29
  */
27
- export type AuditLogKey = typeof LogKeyUnknown | InteractionLogKey | TokenLogKey | SamlLogKey | ActionLogKey | JwtCustomizerLogKey;
30
+ export type AuditLogKey = typeof LogKeyUnknown | InteractionLogKey | TokenLogKey | SamlLogKey | ActionLogKey | JwtCustomizerLogKey | TrustedDeviceLogKey;
28
31
  /**
29
32
  * The union type of all available log keys.
30
33
  * Note duplicate keys are allowed but should be avoided.
31
34
  **/
32
35
  export type LogKey = AuditLogKey | WebhookLogKey;
33
- export type AuditLogPrefix = interaction.Prefix | token.Type | saml.Prefix | action.Prefix | jwtCustomizer.Prefix | typeof LogKeyUnknown;
36
+ export type AuditLogPrefix = interaction.Prefix | token.Type | saml.Prefix | action.Prefix | jwtCustomizer.Prefix | trustedDevice.Prefix | typeof LogKeyUnknown;
34
37
  export type WebhookLogPrefix = hook.Type;
@@ -4,5 +4,6 @@ export * as hook from './hook.js';
4
4
  export * as action from './action.js';
5
5
  export * as jwtCustomizer from './jwt-customizer.js';
6
6
  export * as saml from './saml.js';
7
+ export * as trustedDevice from './trusted-device.js';
7
8
  /** Fallback for empty or unrecognized log keys. */
8
9
  export const LogKeyUnknown = 'Unknown';
@@ -0,0 +1,7 @@
1
+ export type Prefix = 'TrustedDevice';
2
+ export declare const prefix: Prefix;
3
+ export declare enum Type {
4
+ Created = "Created",
5
+ Used = "Used"
6
+ }
7
+ export type LogKey = `${Prefix}.${Type}`;
@@ -0,0 +1,6 @@
1
+ export const prefix = 'TrustedDevice';
2
+ export var Type;
3
+ (function (Type) {
4
+ Type["Created"] = "Created";
5
+ Type["Used"] = "Used";
6
+ })(Type || (Type = {}));
@@ -39,7 +39,7 @@ export declare const logtoActionGuard: z.ZodObject<{
39
39
  }>;
40
40
  /**
41
41
  * Shared execution payload for production Actions and Management API dry runs.
42
- * Cloud remote execution and the local VM runner both accept this shape.
42
+ * Cloud remote execution and the local runner both accept this shape.
43
43
  */
44
44
  export declare const actionExecutionRequestBodyGuard: z.ZodObject<{
45
45
  script: z.ZodString;
@@ -21,7 +21,7 @@ export const logtoActionGuard = z
21
21
  .strict();
22
22
  /**
23
23
  * Shared execution payload for production Actions and Management API dry runs.
24
- * Cloud remote execution and the local VM runner both accept this shape.
24
+ * Cloud remote execution and the local runner both accept this shape.
25
25
  */
26
26
  export const actionExecutionRequestBodyGuard = z
27
27
  .object({