@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
@@ -127,8 +127,8 @@ export declare const jwtCustomizerConfigsGuard: z.ZodDiscriminatedUnion<"key", [
127
127
  kind?: "AccessToken" | undefined;
128
128
  accountId?: string | undefined;
129
129
  scope?: string | undefined;
130
- sessionUid?: string | undefined;
131
130
  clientId?: string | undefined;
131
+ sessionUid?: string | undefined;
132
132
  expiresWithSession?: boolean | undefined;
133
133
  gty?: string | undefined;
134
134
  aud?: string | string[] | undefined;
@@ -139,8 +139,8 @@ export declare const jwtCustomizerConfigsGuard: z.ZodDiscriminatedUnion<"key", [
139
139
  kind?: "AccessToken" | undefined;
140
140
  accountId?: string | undefined;
141
141
  scope?: string | undefined;
142
- sessionUid?: string | undefined;
143
142
  clientId?: string | undefined;
143
+ sessionUid?: string | undefined;
144
144
  expiresWithSession?: boolean | undefined;
145
145
  gty?: string | undefined;
146
146
  aud?: string | string[] | undefined;
@@ -150,6 +150,7 @@ export declare const jwtCustomizerConfigsGuard: z.ZodDiscriminatedUnion<"key", [
150
150
  name: z.ZodOptional<ZodType<string | null, z.ZodTypeDef, string | null>>;
151
151
  id: z.ZodOptional<ZodType<string, z.ZodTypeDef, string>>;
152
152
  applicationId: z.ZodOptional<ZodType<string | null, z.ZodTypeDef, string | null>>;
153
+ cimdClientId: z.ZodOptional<ZodType<string | null, z.ZodTypeDef, string | null>>;
153
154
  username: z.ZodOptional<ZodType<string | null, z.ZodTypeDef, string | null>>;
154
155
  createdAt: z.ZodOptional<ZodType<number, z.ZodTypeDef, number>>;
155
156
  profile: z.ZodOptional<ZodType<Partial<{
@@ -288,6 +289,7 @@ export declare const jwtCustomizerConfigsGuard: z.ZodDiscriminatedUnion<"key", [
288
289
  description: ZodType<string | null, z.ZodTypeDef, string | null>;
289
290
  customData: ZodType<import("@withtyped/server").JsonObject, z.ZodTypeDef, import("@withtyped/server").JsonObject>;
290
291
  isMfaRequired: ZodType<boolean, z.ZodTypeDef, boolean>;
292
+ isTrustedDeviceAllowed: ZodType<boolean, z.ZodTypeDef, boolean>;
291
293
  color: ZodType<Partial<{
292
294
  primaryColor: string;
293
295
  isDarkModeEnabled: boolean;
@@ -336,6 +338,7 @@ export declare const jwtCustomizerConfigsGuard: z.ZodDiscriminatedUnion<"key", [
336
338
  name?: string | null | undefined;
337
339
  id?: string | undefined;
338
340
  applicationId?: string | null | undefined;
341
+ cimdClientId?: string | null | undefined;
339
342
  username?: string | null | undefined;
340
343
  createdAt?: number | undefined;
341
344
  profile?: Partial<{
@@ -403,6 +406,7 @@ export declare const jwtCustomizerConfigsGuard: z.ZodDiscriminatedUnion<"key", [
403
406
  name?: string | null | undefined;
404
407
  id?: string | undefined;
405
408
  applicationId?: string | null | undefined;
409
+ cimdClientId?: string | null | undefined;
406
410
  username?: string | null | undefined;
407
411
  createdAt?: number | undefined;
408
412
  profile?: Partial<{
@@ -1469,6 +1473,7 @@ export declare const jwtCustomizerConfigsGuard: z.ZodDiscriminatedUnion<"key", [
1469
1473
  name?: string | null | undefined;
1470
1474
  id?: string | undefined;
1471
1475
  applicationId?: string | null | undefined;
1476
+ cimdClientId?: string | null | undefined;
1472
1477
  username?: string | null | undefined;
1473
1478
  createdAt?: number | undefined;
1474
1479
  profile?: Partial<{
@@ -1718,6 +1723,7 @@ export declare const jwtCustomizerConfigsGuard: z.ZodDiscriminatedUnion<"key", [
1718
1723
  name?: string | null | undefined;
1719
1724
  id?: string | undefined;
1720
1725
  applicationId?: string | null | undefined;
1726
+ cimdClientId?: string | null | undefined;
1721
1727
  username?: string | null | undefined;
1722
1728
  createdAt?: number | undefined;
1723
1729
  profile?: Partial<{
@@ -1971,6 +1977,7 @@ export declare const jwtCustomizerConfigsGuard: z.ZodDiscriminatedUnion<"key", [
1971
1977
  name?: string | null | undefined;
1972
1978
  id?: string | undefined;
1973
1979
  applicationId?: string | null | undefined;
1980
+ cimdClientId?: string | null | undefined;
1974
1981
  username?: string | null | undefined;
1975
1982
  createdAt?: number | undefined;
1976
1983
  profile?: Partial<{
@@ -2224,8 +2231,8 @@ export declare const jwtCustomizerConfigsGuard: z.ZodDiscriminatedUnion<"key", [
2224
2231
  kind?: "AccessToken" | undefined;
2225
2232
  accountId?: string | undefined;
2226
2233
  scope?: string | undefined;
2227
- sessionUid?: string | undefined;
2228
2234
  clientId?: string | undefined;
2235
+ sessionUid?: string | undefined;
2229
2236
  expiresWithSession?: boolean | undefined;
2230
2237
  gty?: string | undefined;
2231
2238
  aud?: string | string[] | undefined;
@@ -2238,6 +2245,7 @@ export declare const jwtCustomizerConfigsGuard: z.ZodDiscriminatedUnion<"key", [
2238
2245
  name?: string | null | undefined;
2239
2246
  id?: string | undefined;
2240
2247
  applicationId?: string | null | undefined;
2248
+ cimdClientId?: string | null | undefined;
2241
2249
  username?: string | null | undefined;
2242
2250
  createdAt?: number | undefined;
2243
2251
  profile?: Partial<{
@@ -2491,8 +2499,8 @@ export declare const jwtCustomizerConfigsGuard: z.ZodDiscriminatedUnion<"key", [
2491
2499
  kind?: "AccessToken" | undefined;
2492
2500
  accountId?: string | undefined;
2493
2501
  scope?: string | undefined;
2494
- sessionUid?: string | undefined;
2495
2502
  clientId?: string | undefined;
2503
+ sessionUid?: string | undefined;
2496
2504
  expiresWithSession?: boolean | undefined;
2497
2505
  gty?: string | undefined;
2498
2506
  aud?: string | string[] | undefined;
@@ -2507,6 +2515,7 @@ export declare const jwtCustomizerConfigsGuard: z.ZodDiscriminatedUnion<"key", [
2507
2515
  name?: string | null | undefined;
2508
2516
  id?: string | undefined;
2509
2517
  applicationId?: string | null | undefined;
2518
+ cimdClientId?: string | null | undefined;
2510
2519
  username?: string | null | undefined;
2511
2520
  createdAt?: number | undefined;
2512
2521
  profile?: Partial<{
@@ -2760,8 +2769,8 @@ export declare const jwtCustomizerConfigsGuard: z.ZodDiscriminatedUnion<"key", [
2760
2769
  kind?: "AccessToken" | undefined;
2761
2770
  accountId?: string | undefined;
2762
2771
  scope?: string | undefined;
2763
- sessionUid?: string | undefined;
2764
2772
  clientId?: string | undefined;
2773
+ sessionUid?: string | undefined;
2765
2774
  expiresWithSession?: boolean | undefined;
2766
2775
  gty?: string | undefined;
2767
2776
  aud?: string | string[] | undefined;
@@ -2777,6 +2786,7 @@ export declare const jwtCustomizerConfigsGuard: z.ZodDiscriminatedUnion<"key", [
2777
2786
  name?: string | null | undefined;
2778
2787
  id?: string | undefined;
2779
2788
  applicationId?: string | null | undefined;
2789
+ cimdClientId?: string | null | undefined;
2780
2790
  username?: string | null | undefined;
2781
2791
  createdAt?: number | undefined;
2782
2792
  profile?: Partial<{
@@ -3030,8 +3040,8 @@ export declare const jwtCustomizerConfigsGuard: z.ZodDiscriminatedUnion<"key", [
3030
3040
  kind?: "AccessToken" | undefined;
3031
3041
  accountId?: string | undefined;
3032
3042
  scope?: string | undefined;
3033
- sessionUid?: string | undefined;
3034
3043
  clientId?: string | undefined;
3044
+ sessionUid?: string | undefined;
3035
3045
  expiresWithSession?: boolean | undefined;
3036
3046
  gty?: string | undefined;
3037
3047
  aud?: string | string[] | undefined;
@@ -3754,6 +3764,22 @@ export declare const signingKeyRotationStateGuard: z.ZodObject<{
3754
3764
  signingKeyRotationAt?: number | undefined;
3755
3765
  }>;
3756
3766
  export type SigningKeyRotationState = z.infer<typeof signingKeyRotationStateGuard>;
3767
+ /**
3768
+ * Config for the OAuth Client ID Metadata Document (CIMD) feature. The row is only written once
3769
+ * the feature is toggled, so readers must fall back to {@link defaultCimdConfig}.
3770
+ */
3771
+ export declare const cimdConfigGuard: z.ZodObject<{
3772
+ enabled: z.ZodBoolean;
3773
+ }, "strip", z.ZodTypeAny, {
3774
+ enabled: boolean;
3775
+ }, {
3776
+ enabled: boolean;
3777
+ }>;
3778
+ export type CimdConfig = z.infer<typeof cimdConfigGuard>;
3779
+ /** Applied when the `cimd` row is absent: the feature is opt-in per tenant. */
3780
+ export declare const defaultCimdConfig: Readonly<{
3781
+ enabled: false;
3782
+ }>;
3757
3783
  export declare enum LogtoTenantConfigKey {
3758
3784
  AdminConsole = "adminConsole",
3759
3785
  CloudConnection = "cloudConnection",
@@ -3764,7 +3790,9 @@ export declare enum LogtoTenantConfigKey {
3764
3790
  /** Tenant-scoped rotation state for staged private signing key activation. */
3765
3791
  SigningKeyRotationState = "signingKeyRotationState",
3766
3792
  /** Internal, ops-only override of the system message send-rate-limit policy. Not exposed by any API. */
3767
- MessageRateLimitOverride = "messageRateLimitOverride"
3793
+ MessageRateLimitOverride = "messageRateLimitOverride",
3794
+ /** Tenant-level switch for the OAuth Client ID Metadata Document feature. */
3795
+ Cimd = "cimd"
3768
3796
  }
3769
3797
  export type LogtoTenantConfigType = {
3770
3798
  [LogtoTenantConfigKey.AdminConsole]: AdminConsoleData;
@@ -3775,6 +3803,7 @@ export type LogtoTenantConfigType = {
3775
3803
  [LogtoTenantConfigKey.IdToken]: IdTokenConfig;
3776
3804
  [LogtoTenantConfigKey.SigningKeyRotationState]: SigningKeyRotationState;
3777
3805
  [LogtoTenantConfigKey.MessageRateLimitOverride]: MessageRateLimitOverride;
3806
+ [LogtoTenantConfigKey.Cimd]: CimdConfig;
3778
3807
  };
3779
3808
  export declare const logtoTenantConfigGuard: Readonly<{
3780
3809
  [key in LogtoTenantConfigKey]: ZodType<LogtoTenantConfigType[key]>;
@@ -116,6 +116,16 @@ export const signingKeyRotationStateGuard = z.object({
116
116
  tenantCacheExpiresAt: z.number().optional(),
117
117
  signingKeyRotationAt: z.number().optional(),
118
118
  });
119
+ /* --- CIMD Config --- */
120
+ /**
121
+ * Config for the OAuth Client ID Metadata Document (CIMD) feature. The row is only written once
122
+ * the feature is toggled, so readers must fall back to {@link defaultCimdConfig}.
123
+ */
124
+ export const cimdConfigGuard = z.object({
125
+ enabled: z.boolean(),
126
+ });
127
+ /** Applied when the `cimd` row is absent: the feature is opt-in per tenant. */
128
+ export const defaultCimdConfig = Object.freeze({ enabled: false });
119
129
  export var LogtoTenantConfigKey;
120
130
  (function (LogtoTenantConfigKey) {
121
131
  LogtoTenantConfigKey["AdminConsole"] = "adminConsole";
@@ -128,6 +138,8 @@ export var LogtoTenantConfigKey;
128
138
  LogtoTenantConfigKey["SigningKeyRotationState"] = "signingKeyRotationState";
129
139
  /** Internal, ops-only override of the system message send-rate-limit policy. Not exposed by any API. */
130
140
  LogtoTenantConfigKey["MessageRateLimitOverride"] = "messageRateLimitOverride";
141
+ /** Tenant-level switch for the OAuth Client ID Metadata Document feature. */
142
+ LogtoTenantConfigKey["Cimd"] = "cimd";
131
143
  })(LogtoTenantConfigKey || (LogtoTenantConfigKey = {}));
132
144
  export const logtoTenantConfigGuard = Object.freeze({
133
145
  [LogtoTenantConfigKey.AdminConsole]: adminConsoleDataGuard,
@@ -136,6 +148,7 @@ export const logtoTenantConfigGuard = Object.freeze({
136
148
  [LogtoTenantConfigKey.IdToken]: idTokenConfigGuard,
137
149
  [LogtoTenantConfigKey.SigningKeyRotationState]: signingKeyRotationStateGuard,
138
150
  [LogtoTenantConfigKey.MessageRateLimitOverride]: messageRateLimitOverrideGuard,
151
+ [LogtoTenantConfigKey.Cimd]: cimdConfigGuard,
139
152
  });
140
153
  export const logtoConfigKeys = Object.freeze([
141
154
  ...Object.values(LogtoOidcConfigKey),
@@ -1,4 +1,5 @@
1
1
  import { describe, expect, it } from 'vitest';
2
+ import { z } from 'zod';
2
3
  import { LogtoActionKey, LogtoOidcConfigKey, LogtoTenantConfigKey, OidcSigningKeyStatus, actionConfigGuard, logtoOidcConfigGuard, logtoConfigGuards, logtoConfigKeys, logtoTenantConfigGuard, oidcConfigKeysResponseGuard, } from './index.js';
3
4
  describe('logto config guards', () => {
4
5
  it('accepts legacy private keys without status', () => {
@@ -50,4 +51,26 @@ describe('logto config guards', () => {
50
51
  expect(logtoConfigKeys).toContain(LogtoActionKey.PostSignIn);
51
52
  expect(logtoConfigGuards[LogtoActionKey.PostSignIn]).toBe(actionConfigGuard[LogtoActionKey.PostSignIn]);
52
53
  });
54
+ it('includes the CIMD key in the logto config summary guards', () => {
55
+ expect(logtoConfigKeys).toContain(LogtoTenantConfigKey.Cimd);
56
+ expect(logtoConfigGuards[LogtoTenantConfigKey.Cimd]).toBe(logtoTenantConfigGuard[LogtoTenantConfigKey.Cimd]);
57
+ });
58
+ it('keeps a stored CIMD config value', () => {
59
+ expect(logtoTenantConfigGuard[LogtoTenantConfigKey.Cimd].parse({ enabled: true })).toEqual({
60
+ enabled: true,
61
+ });
62
+ });
63
+ it('rejects invalid CIMD config values', () => {
64
+ const result = logtoTenantConfigGuard[LogtoTenantConfigKey.Cimd].safeParse({ enabled: 'yes' });
65
+ expect(result.success).toBe(false);
66
+ });
67
+ it('parses OIDC configs without the optional session row', () => {
68
+ const result = z.object(logtoOidcConfigGuard).parse({
69
+ [LogtoOidcConfigKey.PrivateKeys]: [
70
+ { id: 'key_1', value: 'private-key-1', createdAt: 1_710_000_000_000 },
71
+ ],
72
+ [LogtoOidcConfigKey.CookieKeys]: [],
73
+ });
74
+ expect(result[LogtoOidcConfigKey.Session]).toEqual({});
75
+ });
53
76
  });
@@ -92,6 +92,7 @@ export declare const jwtCustomizerUserContextGuard: z.ZodObject<Pick<{
92
92
  }>;
93
93
  }>>;
94
94
  applicationId: ZodType<string | null, z.ZodTypeDef, string | null>;
95
+ cimdClientId: ZodType<string | null, z.ZodTypeDef, string | null>;
95
96
  identities: ZodType<Record<string, {
96
97
  userId: string;
97
98
  details?: Record<string, import("@withtyped/server/lib/types.js").Json> | undefined;
@@ -164,7 +165,7 @@ export declare const jwtCustomizerUserContextGuard: z.ZodObject<Pick<{
164
165
  passwordUpdatedAt: ZodType<number | null, z.ZodTypeDef, number | null>;
165
166
  createdAt: ZodType<number, z.ZodTypeDef, number>;
166
167
  updatedAt: ZodType<number, z.ZodTypeDef, number>;
167
- }, "name" | "id" | "applicationId" | "username" | "createdAt" | "profile" | "avatar" | "customData" | "identities" | "updatedAt" | "lastSignInAt" | "primaryEmail" | "primaryPhone" | "isSuspended"> & {
168
+ }, "name" | "id" | "applicationId" | "cimdClientId" | "username" | "createdAt" | "profile" | "avatar" | "customData" | "identities" | "updatedAt" | "lastSignInAt" | "primaryEmail" | "primaryPhone" | "isSuspended"> & {
168
169
  hasPassword: z.ZodBoolean;
169
170
  ssoIdentities: z.ZodArray<z.ZodObject<Pick<{
170
171
  tenantId: ZodType<string, z.ZodTypeDef, string>;
@@ -246,6 +247,7 @@ export declare const jwtCustomizerUserContextGuard: z.ZodObject<Pick<{
246
247
  description: ZodType<string | null, z.ZodTypeDef, string | null>;
247
248
  customData: ZodType<import("@withtyped/server/lib/types.js").JsonObject, z.ZodTypeDef, import("@withtyped/server/lib/types.js").JsonObject>;
248
249
  isMfaRequired: ZodType<boolean, z.ZodTypeDef, boolean>;
250
+ isTrustedDeviceAllowed: ZodType<boolean, z.ZodTypeDef, boolean>;
249
251
  color: ZodType<Partial<{
250
252
  primaryColor: string;
251
253
  isDarkModeEnabled: boolean;
@@ -294,6 +296,7 @@ export declare const jwtCustomizerUserContextGuard: z.ZodObject<Pick<{
294
296
  name: string | null;
295
297
  id: string;
296
298
  applicationId: string | null;
299
+ cimdClientId: string | null;
297
300
  username: string | null;
298
301
  createdAt: number;
299
302
  profile: import("../../foundations/index.js").UserProfile;
@@ -338,6 +341,7 @@ export declare const jwtCustomizerUserContextGuard: z.ZodObject<Pick<{
338
341
  name: string | null;
339
342
  id: string;
340
343
  applicationId: string | null;
344
+ cimdClientId: string | null;
341
345
  username: string | null;
342
346
  createdAt: number;
343
347
  profile: import("../../foundations/index.js").UserProfile;
@@ -1298,6 +1302,7 @@ export declare const jwtCustomizerOrganizationContextGuard: z.ZodObject<Pick<{
1298
1302
  description: ZodType<string | null, z.ZodTypeDef, string | null>;
1299
1303
  customData: ZodType<import("@withtyped/server/lib/types.js").JsonObject, z.ZodTypeDef, import("@withtyped/server/lib/types.js").JsonObject>;
1300
1304
  isMfaRequired: ZodType<boolean, z.ZodTypeDef, boolean>;
1305
+ isTrustedDeviceAllowed: ZodType<boolean, z.ZodTypeDef, boolean>;
1301
1306
  color: ZodType<Partial<{
1302
1307
  primaryColor: string;
1303
1308
  isDarkModeEnabled: boolean;
@@ -1356,8 +1361,8 @@ export declare const accessTokenJwtCustomizerGuard: z.ZodObject<{
1356
1361
  kind?: "AccessToken" | undefined;
1357
1362
  accountId?: string | undefined;
1358
1363
  scope?: string | undefined;
1359
- sessionUid?: string | undefined;
1360
1364
  clientId?: string | undefined;
1365
+ sessionUid?: string | undefined;
1361
1366
  expiresWithSession?: boolean | undefined;
1362
1367
  gty?: string | undefined;
1363
1368
  aud?: string | string[] | undefined;
@@ -1368,8 +1373,8 @@ export declare const accessTokenJwtCustomizerGuard: z.ZodObject<{
1368
1373
  kind?: "AccessToken" | undefined;
1369
1374
  accountId?: string | undefined;
1370
1375
  scope?: string | undefined;
1371
- sessionUid?: string | undefined;
1372
1376
  clientId?: string | undefined;
1377
+ sessionUid?: string | undefined;
1373
1378
  expiresWithSession?: boolean | undefined;
1374
1379
  gty?: string | undefined;
1375
1380
  aud?: string | string[] | undefined;
@@ -1379,6 +1384,7 @@ export declare const accessTokenJwtCustomizerGuard: z.ZodObject<{
1379
1384
  name: z.ZodOptional<ZodType<string | null, z.ZodTypeDef, string | null>>;
1380
1385
  id: z.ZodOptional<ZodType<string, z.ZodTypeDef, string>>;
1381
1386
  applicationId: z.ZodOptional<ZodType<string | null, z.ZodTypeDef, string | null>>;
1387
+ cimdClientId: z.ZodOptional<ZodType<string | null, z.ZodTypeDef, string | null>>;
1382
1388
  username: z.ZodOptional<ZodType<string | null, z.ZodTypeDef, string | null>>;
1383
1389
  createdAt: z.ZodOptional<ZodType<number, z.ZodTypeDef, number>>;
1384
1390
  profile: z.ZodOptional<ZodType<Partial<{
@@ -1517,6 +1523,7 @@ export declare const accessTokenJwtCustomizerGuard: z.ZodObject<{
1517
1523
  description: ZodType<string | null, z.ZodTypeDef, string | null>;
1518
1524
  customData: ZodType<import("@withtyped/server/lib/types.js").JsonObject, z.ZodTypeDef, import("@withtyped/server/lib/types.js").JsonObject>;
1519
1525
  isMfaRequired: ZodType<boolean, z.ZodTypeDef, boolean>;
1526
+ isTrustedDeviceAllowed: ZodType<boolean, z.ZodTypeDef, boolean>;
1520
1527
  color: ZodType<Partial<{
1521
1528
  primaryColor: string;
1522
1529
  isDarkModeEnabled: boolean;
@@ -1565,6 +1572,7 @@ export declare const accessTokenJwtCustomizerGuard: z.ZodObject<{
1565
1572
  name?: string | null | undefined;
1566
1573
  id?: string | undefined;
1567
1574
  applicationId?: string | null | undefined;
1575
+ cimdClientId?: string | null | undefined;
1568
1576
  username?: string | null | undefined;
1569
1577
  createdAt?: number | undefined;
1570
1578
  profile?: Partial<{
@@ -1632,6 +1640,7 @@ export declare const accessTokenJwtCustomizerGuard: z.ZodObject<{
1632
1640
  name?: string | null | undefined;
1633
1641
  id?: string | undefined;
1634
1642
  applicationId?: string | null | undefined;
1643
+ cimdClientId?: string | null | undefined;
1635
1644
  username?: string | null | undefined;
1636
1645
  createdAt?: number | undefined;
1637
1646
  profile?: Partial<{
@@ -2698,6 +2707,7 @@ export declare const accessTokenJwtCustomizerGuard: z.ZodObject<{
2698
2707
  name?: string | null | undefined;
2699
2708
  id?: string | undefined;
2700
2709
  applicationId?: string | null | undefined;
2710
+ cimdClientId?: string | null | undefined;
2701
2711
  username?: string | null | undefined;
2702
2712
  createdAt?: number | undefined;
2703
2713
  profile?: Partial<{
@@ -2947,6 +2957,7 @@ export declare const accessTokenJwtCustomizerGuard: z.ZodObject<{
2947
2957
  name?: string | null | undefined;
2948
2958
  id?: string | undefined;
2949
2959
  applicationId?: string | null | undefined;
2960
+ cimdClientId?: string | null | undefined;
2950
2961
  username?: string | null | undefined;
2951
2962
  createdAt?: number | undefined;
2952
2963
  profile?: Partial<{
@@ -3200,6 +3211,7 @@ export declare const accessTokenJwtCustomizerGuard: z.ZodObject<{
3200
3211
  name?: string | null | undefined;
3201
3212
  id?: string | undefined;
3202
3213
  applicationId?: string | null | undefined;
3214
+ cimdClientId?: string | null | undefined;
3203
3215
  username?: string | null | undefined;
3204
3216
  createdAt?: number | undefined;
3205
3217
  profile?: Partial<{
@@ -3453,8 +3465,8 @@ export declare const accessTokenJwtCustomizerGuard: z.ZodObject<{
3453
3465
  kind?: "AccessToken" | undefined;
3454
3466
  accountId?: string | undefined;
3455
3467
  scope?: string | undefined;
3456
- sessionUid?: string | undefined;
3457
3468
  clientId?: string | undefined;
3469
+ sessionUid?: string | undefined;
3458
3470
  expiresWithSession?: boolean | undefined;
3459
3471
  gty?: string | undefined;
3460
3472
  aud?: string | string[] | undefined;
@@ -3467,6 +3479,7 @@ export declare const accessTokenJwtCustomizerGuard: z.ZodObject<{
3467
3479
  name?: string | null | undefined;
3468
3480
  id?: string | undefined;
3469
3481
  applicationId?: string | null | undefined;
3482
+ cimdClientId?: string | null | undefined;
3470
3483
  username?: string | null | undefined;
3471
3484
  createdAt?: number | undefined;
3472
3485
  profile?: Partial<{
@@ -3720,8 +3733,8 @@ export declare const accessTokenJwtCustomizerGuard: z.ZodObject<{
3720
3733
  kind?: "AccessToken" | undefined;
3721
3734
  accountId?: string | undefined;
3722
3735
  scope?: string | undefined;
3723
- sessionUid?: string | undefined;
3724
3736
  clientId?: string | undefined;
3737
+ sessionUid?: string | undefined;
3725
3738
  expiresWithSession?: boolean | undefined;
3726
3739
  gty?: string | undefined;
3727
3740
  aud?: string | string[] | undefined;
@@ -4227,8 +4240,8 @@ export declare const jwtCustomizerTestRequestBodyGuard: z.ZodDiscriminatedUnion<
4227
4240
  kind?: "AccessToken" | undefined;
4228
4241
  accountId?: string | undefined;
4229
4242
  scope?: string | undefined;
4230
- sessionUid?: string | undefined;
4231
4243
  clientId?: string | undefined;
4244
+ sessionUid?: string | undefined;
4232
4245
  expiresWithSession?: boolean | undefined;
4233
4246
  gty?: string | undefined;
4234
4247
  aud?: string | string[] | undefined;
@@ -4239,8 +4252,8 @@ export declare const jwtCustomizerTestRequestBodyGuard: z.ZodDiscriminatedUnion<
4239
4252
  kind?: "AccessToken" | undefined;
4240
4253
  accountId?: string | undefined;
4241
4254
  scope?: string | undefined;
4242
- sessionUid?: string | undefined;
4243
4255
  clientId?: string | undefined;
4256
+ sessionUid?: string | undefined;
4244
4257
  expiresWithSession?: boolean | undefined;
4245
4258
  gty?: string | undefined;
4246
4259
  aud?: string | string[] | undefined;
@@ -4250,6 +4263,7 @@ export declare const jwtCustomizerTestRequestBodyGuard: z.ZodDiscriminatedUnion<
4250
4263
  name: z.ZodOptional<ZodType<string | null, z.ZodTypeDef, string | null>>;
4251
4264
  id: z.ZodOptional<ZodType<string, z.ZodTypeDef, string>>;
4252
4265
  applicationId: z.ZodOptional<ZodType<string | null, z.ZodTypeDef, string | null>>;
4266
+ cimdClientId: z.ZodOptional<ZodType<string | null, z.ZodTypeDef, string | null>>;
4253
4267
  username: z.ZodOptional<ZodType<string | null, z.ZodTypeDef, string | null>>;
4254
4268
  createdAt: z.ZodOptional<ZodType<number, z.ZodTypeDef, number>>;
4255
4269
  profile: z.ZodOptional<ZodType<Partial<{
@@ -4388,6 +4402,7 @@ export declare const jwtCustomizerTestRequestBodyGuard: z.ZodDiscriminatedUnion<
4388
4402
  description: ZodType<string | null, z.ZodTypeDef, string | null>;
4389
4403
  customData: ZodType<import("@withtyped/server/lib/types.js").JsonObject, z.ZodTypeDef, import("@withtyped/server/lib/types.js").JsonObject>;
4390
4404
  isMfaRequired: ZodType<boolean, z.ZodTypeDef, boolean>;
4405
+ isTrustedDeviceAllowed: ZodType<boolean, z.ZodTypeDef, boolean>;
4391
4406
  color: ZodType<Partial<{
4392
4407
  primaryColor: string;
4393
4408
  isDarkModeEnabled: boolean;
@@ -4436,6 +4451,7 @@ export declare const jwtCustomizerTestRequestBodyGuard: z.ZodDiscriminatedUnion<
4436
4451
  name?: string | null | undefined;
4437
4452
  id?: string | undefined;
4438
4453
  applicationId?: string | null | undefined;
4454
+ cimdClientId?: string | null | undefined;
4439
4455
  username?: string | null | undefined;
4440
4456
  createdAt?: number | undefined;
4441
4457
  profile?: Partial<{
@@ -4503,6 +4519,7 @@ export declare const jwtCustomizerTestRequestBodyGuard: z.ZodDiscriminatedUnion<
4503
4519
  name?: string | null | undefined;
4504
4520
  id?: string | undefined;
4505
4521
  applicationId?: string | null | undefined;
4522
+ cimdClientId?: string | null | undefined;
4506
4523
  username?: string | null | undefined;
4507
4524
  createdAt?: number | undefined;
4508
4525
  profile?: Partial<{
@@ -5569,6 +5586,7 @@ export declare const jwtCustomizerTestRequestBodyGuard: z.ZodDiscriminatedUnion<
5569
5586
  name?: string | null | undefined;
5570
5587
  id?: string | undefined;
5571
5588
  applicationId?: string | null | undefined;
5589
+ cimdClientId?: string | null | undefined;
5572
5590
  username?: string | null | undefined;
5573
5591
  createdAt?: number | undefined;
5574
5592
  profile?: Partial<{
@@ -5818,6 +5836,7 @@ export declare const jwtCustomizerTestRequestBodyGuard: z.ZodDiscriminatedUnion<
5818
5836
  name?: string | null | undefined;
5819
5837
  id?: string | undefined;
5820
5838
  applicationId?: string | null | undefined;
5839
+ cimdClientId?: string | null | undefined;
5821
5840
  username?: string | null | undefined;
5822
5841
  createdAt?: number | undefined;
5823
5842
  profile?: Partial<{
@@ -6074,8 +6093,8 @@ export declare const jwtCustomizerTestRequestBodyGuard: z.ZodDiscriminatedUnion<
6074
6093
  kind?: "AccessToken" | undefined;
6075
6094
  accountId?: string | undefined;
6076
6095
  scope?: string | undefined;
6077
- sessionUid?: string | undefined;
6078
6096
  clientId?: string | undefined;
6097
+ sessionUid?: string | undefined;
6079
6098
  expiresWithSession?: boolean | undefined;
6080
6099
  gty?: string | undefined;
6081
6100
  aud?: string | string[] | undefined;
@@ -6085,6 +6104,7 @@ export declare const jwtCustomizerTestRequestBodyGuard: z.ZodDiscriminatedUnion<
6085
6104
  name?: string | null | undefined;
6086
6105
  id?: string | undefined;
6087
6106
  applicationId?: string | null | undefined;
6107
+ cimdClientId?: string | null | undefined;
6088
6108
  username?: string | null | undefined;
6089
6109
  createdAt?: number | undefined;
6090
6110
  profile?: Partial<{
@@ -6341,8 +6361,8 @@ export declare const jwtCustomizerTestRequestBodyGuard: z.ZodDiscriminatedUnion<
6341
6361
  kind?: "AccessToken" | undefined;
6342
6362
  accountId?: string | undefined;
6343
6363
  scope?: string | undefined;
6344
- sessionUid?: string | undefined;
6345
6364
  clientId?: string | undefined;
6365
+ sessionUid?: string | undefined;
6346
6366
  expiresWithSession?: boolean | undefined;
6347
6367
  gty?: string | undefined;
6348
6368
  aud?: string | string[] | undefined;
@@ -6352,6 +6372,7 @@ export declare const jwtCustomizerTestRequestBodyGuard: z.ZodDiscriminatedUnion<
6352
6372
  name?: string | null | undefined;
6353
6373
  id?: string | undefined;
6354
6374
  applicationId?: string | null | undefined;
6375
+ cimdClientId?: string | null | undefined;
6355
6376
  username?: string | null | undefined;
6356
6377
  createdAt?: number | undefined;
6357
6378
  profile?: Partial<{
@@ -7121,7 +7142,7 @@ export declare enum CustomJwtErrorCode {
7121
7142
  AccessDenied = "AccessDenied",
7122
7143
  /** General JWT customizer error,
7123
7144
  * this is the fallback custom jwt error code
7124
- * for any internal error thrown by the JWT customizer (localVM, azure function, or CF worker).
7145
+ * for any internal error thrown by the JWT customizer on any runtime.
7125
7146
  */
7126
7147
  General = "General"
7127
7148
  }
@@ -203,7 +203,7 @@ export var CustomJwtErrorCode;
203
203
  CustomJwtErrorCode["AccessDenied"] = "AccessDenied";
204
204
  /** General JWT customizer error,
205
205
  * this is the fallback custom jwt error code
206
- * for any internal error thrown by the JWT customizer (localVM, azure function, or CF worker).
206
+ * for any internal error thrown by the JWT customizer on any runtime.
207
207
  */
208
208
  CustomJwtErrorCode["General"] = "General";
209
209
  })(CustomJwtErrorCode || (CustomJwtErrorCode = {}));
@@ -28,8 +28,8 @@ export declare const accessTokenPayloadGuard: z.ZodObject<{
28
28
  aud: string | string[];
29
29
  sid?: string | undefined;
30
30
  scope?: string | undefined;
31
- sessionUid?: string | undefined;
32
31
  clientId?: string | undefined;
32
+ sessionUid?: string | undefined;
33
33
  expiresWithSession?: boolean | undefined;
34
34
  }, {
35
35
  grantId: string;
@@ -40,8 +40,8 @@ export declare const accessTokenPayloadGuard: z.ZodObject<{
40
40
  aud: string | string[];
41
41
  sid?: string | undefined;
42
42
  scope?: string | undefined;
43
- sessionUid?: string | undefined;
44
43
  clientId?: string | undefined;
44
+ sessionUid?: string | undefined;
45
45
  expiresWithSession?: boolean | undefined;
46
46
  }>;
47
47
  export type AccessTokenPayload = z.infer<typeof accessTokenPayloadGuard>;
@@ -1,5 +1,18 @@
1
+ /**
2
+ * Types of `service_logs` rows. The rows are written by the Logto Cloud service; some members
3
+ * are cloud-only concepts kept here so every type shares this single definition.
4
+ */
1
5
  export declare enum ServiceLogType {
2
6
  SendEmail = "sendEmail",
3
7
  SendSms = "sendSms",
4
- FetchCustomJwt = "fetchCustomJwt"
8
+ /** Cloud-only: custom JWT worker invocations. */
9
+ FetchCustomJwt = "fetchCustomJwt",
10
+ /**
11
+ * Cloud-only: a hosted-email send that failed at the provider; the payload carries the
12
+ * normalized provider error. Deliberately distinct from {@link ServiceLogType.SendEmail}:
13
+ * usage counting matches on that exact type, so failed sends never count toward email usage.
14
+ */
15
+ SendEmailFailed = "sendEmailFailed",
16
+ /** Cloud-only: an Actions script run on the script runner. Mirrors the `runAction` entry. */
17
+ RunAction = "runAction"
5
18
  }
@@ -1,6 +1,19 @@
1
+ /**
2
+ * Types of `service_logs` rows. The rows are written by the Logto Cloud service; some members
3
+ * are cloud-only concepts kept here so every type shares this single definition.
4
+ */
1
5
  export var ServiceLogType;
2
6
  (function (ServiceLogType) {
3
7
  ServiceLogType["SendEmail"] = "sendEmail";
4
8
  ServiceLogType["SendSms"] = "sendSms";
9
+ /** Cloud-only: custom JWT worker invocations. */
5
10
  ServiceLogType["FetchCustomJwt"] = "fetchCustomJwt";
11
+ /**
12
+ * Cloud-only: a hosted-email send that failed at the provider; the payload carries the
13
+ * normalized provider error. Deliberately distinct from {@link ServiceLogType.SendEmail}:
14
+ * usage counting matches on that exact type, so failed sends never count toward email usage.
15
+ */
16
+ ServiceLogType["SendEmailFailed"] = "sendEmailFailed";
17
+ /** Cloud-only: an Actions script run on the script runner. Mirrors the `runAction` entry. */
18
+ ServiceLogType["RunAction"] = "runAction";
6
19
  })(ServiceLogType || (ServiceLogType = {}));