@logto/schemas 1.28.0 → 1.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/alterations/1.29.0-1748832174-add-webauthn-related-origins.ts +20 -0
  2. package/alterations/1.29.0-1749005587-user-sso-identities-table-add-updated-at-column.ts +31 -0
  3. package/alterations/1.29.0-1749026308-add-oidc-session-extension-table.ts +41 -0
  4. package/alterations/1.29.0-1749523818-add-custom-profile-fields.ts +58 -0
  5. package/alterations/1.29.0-1749724664-drop-sie-order-constraint-from-custom-profile-fields.ts +20 -0
  6. package/alterations/1.29.0-1750663091-change-user-password-encrypted-length.ts +18 -0
  7. package/alterations/1.29.0-1750744518-add-secrets-table.ts +50 -0
  8. package/alterations/1.29.0-1750744539-add-secret-connector-relations-table.ts +109 -0
  9. package/alterations/1.30.0-1750744685-add-triggers-to-delete-secrets-on-social-identities-deletion.ts +81 -0
  10. package/alterations/1.30.0-1750748516-add-enable-token-storage-column-to-connectors-table.ts +20 -0
  11. package/alterations/1.30.0-1751255436-split-secret-connector-relatioins-table.ts +359 -0
  12. package/alterations/1.30.0-1751337183-add-require-mfa-on-sign-in-to-users.ts +20 -0
  13. package/alterations/1.30.0-1751400000-move-require-mfa-on-sign-in-to-logto-config.ts +21 -0
  14. package/alterations/1.30.0-1751529530-add-enable-token-storage-column-to-sso-connectors-table.ts +20 -0
  15. package/alterations/1.30.0-1752630302-alterate-enable-column-default-value-in-account-centers-table.ts +20 -0
  16. package/alterations/1.30.0-1753669579-add-organization-user-relations-foreign-key.ts +46 -0
  17. package/alterations-js/1.29.0-1748832174-add-webauthn-related-origins.js +16 -0
  18. package/alterations-js/1.29.0-1749005587-user-sso-identities-table-add-updated-at-column.js +25 -0
  19. package/alterations-js/1.29.0-1749026308-add-oidc-session-extension-table.js +33 -0
  20. package/alterations-js/1.29.0-1749523818-add-custom-profile-fields.js +52 -0
  21. package/alterations-js/1.29.0-1749724664-drop-sie-order-constraint-from-custom-profile-fields.js +16 -0
  22. package/alterations-js/1.29.0-1750663091-change-user-password-encrypted-length.js +14 -0
  23. package/alterations-js/1.29.0-1750744518-add-secrets-table.js +42 -0
  24. package/alterations-js/1.29.0-1750744539-add-secret-connector-relations-table.js +99 -0
  25. package/alterations-js/1.30.0-1750744685-add-triggers-to-delete-secrets-on-social-identities-deletion.js +76 -0
  26. package/alterations-js/1.30.0-1750748516-add-enable-token-storage-column-to-connectors-table.js +16 -0
  27. package/alterations-js/1.30.0-1751255436-split-secret-connector-relatioins-table.js +338 -0
  28. package/alterations-js/1.30.0-1751337183-add-require-mfa-on-sign-in-to-users.js +16 -0
  29. package/alterations-js/1.30.0-1751400000-move-require-mfa-on-sign-in-to-logto-config.js +17 -0
  30. package/alterations-js/1.30.0-1751529530-add-enable-token-storage-column-to-sso-connectors-table.js +16 -0
  31. package/alterations-js/1.30.0-1752630302-alterate-enable-column-default-value-in-account-centers-table.js +16 -0
  32. package/alterations-js/1.30.0-1753669579-add-organization-user-relations-foreign-key.js +38 -0
  33. package/lib/consts/oidc.d.ts +9 -1
  34. package/lib/consts/oidc.js +5 -0
  35. package/lib/db-entries/account-center.d.ts +4 -2
  36. package/lib/db-entries/account-center.js +5 -1
  37. package/lib/db-entries/connector.d.ts +5 -1
  38. package/lib/db-entries/connector.js +4 -0
  39. package/lib/db-entries/custom-profile-field.d.ts +32 -0
  40. package/lib/db-entries/custom-profile-field.js +58 -0
  41. package/lib/db-entries/index.d.ts +5 -0
  42. package/lib/db-entries/index.js +5 -0
  43. package/lib/db-entries/oidc-session-extension.d.ts +24 -0
  44. package/lib/db-entries/oidc-session-extension.js +42 -0
  45. package/lib/db-entries/secret-enterprise-sso-connector-relation.d.ts +28 -0
  46. package/lib/db-entries/secret-enterprise-sso-connector-relation.js +37 -0
  47. package/lib/db-entries/secret-social-connector-relation.d.ts +28 -0
  48. package/lib/db-entries/secret-social-connector-relation.js +37 -0
  49. package/lib/db-entries/secret.d.ts +44 -0
  50. package/lib/db-entries/secret.js +62 -0
  51. package/lib/db-entries/sso-connector.d.ts +5 -1
  52. package/lib/db-entries/sso-connector.js +4 -0
  53. package/lib/db-entries/user-sso-identity.d.ts +5 -1
  54. package/lib/db-entries/user-sso-identity.js +4 -0
  55. package/lib/db-entries/user.js +2 -2
  56. package/lib/foundations/jsonb-types/account-centers.d.ts +5 -0
  57. package/lib/foundations/jsonb-types/account-centers.js +2 -0
  58. package/lib/foundations/jsonb-types/custom-profile-fields.d.ts +441 -0
  59. package/lib/foundations/jsonb-types/custom-profile-fields.js +44 -0
  60. package/lib/foundations/jsonb-types/index.d.ts +2 -1
  61. package/lib/foundations/jsonb-types/index.js +2 -1
  62. package/lib/foundations/jsonb-types/secrets.d.ts +11 -0
  63. package/lib/foundations/jsonb-types/secrets.js +15 -0
  64. package/lib/foundations/jsonb-types/sign-in-experience.d.ts +3 -1
  65. package/lib/foundations/jsonb-types/sign-in-experience.js +2 -0
  66. package/lib/foundations/jsonb-types/users.d.ts +126 -0
  67. package/lib/foundations/jsonb-types/users.js +22 -10
  68. package/lib/types/connector.d.ts +39 -0
  69. package/lib/types/connector.js +1 -0
  70. package/lib/types/consent.d.ts +44 -0
  71. package/lib/types/custom-profile-fields.d.ts +2587 -0
  72. package/lib/types/custom-profile-fields.js +159 -0
  73. package/lib/types/index.d.ts +4 -0
  74. package/lib/types/index.js +4 -0
  75. package/lib/types/interactions.d.ts +181 -1
  76. package/lib/types/interactions.js +49 -1
  77. package/lib/types/log/interaction.d.ts +2 -1
  78. package/lib/types/logto-config/index.d.ts +1139 -18
  79. package/lib/types/logto-config/jwt-customizer.d.ts +2529 -32
  80. package/lib/types/logto-config/jwt-customizer.js +55 -1
  81. package/lib/types/logto-config/oidc-provider.d.ts +6 -6
  82. package/lib/types/mfa.d.ts +10 -10
  83. package/lib/types/secrets.d.ts +436 -0
  84. package/lib/types/secrets.js +73 -0
  85. package/lib/types/sign-in-experience.d.ts +21 -3
  86. package/lib/types/sign-in-experience.js +3 -1
  87. package/lib/types/sso-connector.d.ts +28 -2
  88. package/lib/types/sso-connector.js +3 -0
  89. package/lib/types/tenant.d.ts +1 -0
  90. package/lib/types/tenant.js +1 -0
  91. package/lib/types/user-logto-config.d.ts +45 -0
  92. package/lib/types/user-logto-config.js +18 -0
  93. package/lib/types/user.d.ts +626 -0
  94. package/lib/types/user.js +17 -1
  95. package/lib/types/verification-records/backup-code-verification.d.ts +47 -0
  96. package/lib/types/verification-records/backup-code-verification.js +12 -0
  97. package/lib/types/verification-records/code-verification.d.ts +89 -0
  98. package/lib/types/verification-records/code-verification.js +22 -0
  99. package/lib/types/verification-records/enterprise-sso-verification.d.ts +213 -0
  100. package/lib/types/verification-records/enterprise-sso-verification.js +15 -0
  101. package/lib/types/verification-records/index.d.ts +16 -0
  102. package/lib/types/verification-records/index.js +16 -0
  103. package/lib/types/verification-records/new-password-identity-verification.d.ts +85 -0
  104. package/lib/types/verification-records/new-password-identity-verification.js +20 -0
  105. package/lib/types/verification-records/one-time-token-verification.d.ts +55 -0
  106. package/lib/types/verification-records/one-time-token-verification.js +13 -0
  107. package/lib/types/verification-records/password-verification.d.ts +40 -0
  108. package/lib/types/verification-records/password-verification.js +9 -0
  109. package/lib/types/verification-records/social-verification.d.ts +270 -0
  110. package/lib/types/verification-records/social-verification.js +16 -0
  111. package/lib/types/verification-records/totp-verification.d.ts +47 -0
  112. package/lib/types/verification-records/totp-verification.js +12 -0
  113. package/lib/types/verification-records/web-authn-verification.d.ts +124 -0
  114. package/lib/types/verification-records/web-authn-verification.js +17 -0
  115. package/package.json +6 -6
  116. package/tables/account_centers.sql +2 -1
  117. package/tables/connectors.sql +4 -0
  118. package/tables/custom_profile_fields.sql +31 -0
  119. package/tables/oidc_model_instances.sql +2 -0
  120. package/tables/oidc_session_extensions.sql +18 -0
  121. package/tables/organization_user_relations.sql +4 -1
  122. package/tables/secret_enterprise_sso_connector_relations.sql +60 -0
  123. package/tables/secret_social_connector_relations.sql +75 -0
  124. package/tables/secrets.sql +26 -0
  125. package/tables/sso_connectors.sql +2 -0
  126. package/tables/user_sso_identities.sql +8 -0
  127. package/tables/users.sql +3 -2
  128. /package/lib/{foundations/jsonb-types/verification-records.d.ts → types/verification-records/verification-type.d.ts} +0 -0
  129. /package/lib/{foundations/jsonb-types/verification-records.js → types/verification-records/verification-type.js} +0 -0
@@ -53,7 +53,11 @@ export declare enum ExtraParamsKey {
53
53
  /**
54
54
  * The one-time token used as a proof for the user's identity. Example use case: Magic link.
55
55
  */
56
- OneTimeToken = "one_time_token"
56
+ OneTimeToken = "one_time_token",
57
+ /**
58
+ * The Google One Tap credential JWT token for external website integration.
59
+ */
60
+ GoogleOneTapCredential = "google_one_tap_credential"
57
61
  }
58
62
  /** @deprecated Use {@link FirstScreen} instead. */
59
63
  export declare enum InteractionMode {
@@ -78,6 +82,7 @@ export declare const extraParamsObjectGuard: z.ZodObject<{
78
82
  login_hint: z.ZodOptional<z.ZodString>;
79
83
  identifier: z.ZodOptional<z.ZodString>;
80
84
  one_time_token: z.ZodOptional<z.ZodString>;
85
+ google_one_tap_credential: z.ZodOptional<z.ZodString>;
81
86
  }, "strip", z.ZodTypeAny, {
82
87
  interaction_mode?: InteractionMode | undefined;
83
88
  first_screen?: FirstScreen | undefined;
@@ -86,6 +91,7 @@ export declare const extraParamsObjectGuard: z.ZodObject<{
86
91
  login_hint?: string | undefined;
87
92
  identifier?: string | undefined;
88
93
  one_time_token?: string | undefined;
94
+ google_one_tap_credential?: string | undefined;
89
95
  }, {
90
96
  interaction_mode?: InteractionMode | undefined;
91
97
  first_screen?: FirstScreen | undefined;
@@ -94,6 +100,7 @@ export declare const extraParamsObjectGuard: z.ZodObject<{
94
100
  login_hint?: string | undefined;
95
101
  identifier?: string | undefined;
96
102
  one_time_token?: string | undefined;
103
+ google_one_tap_credential?: string | undefined;
97
104
  }>;
98
105
  export type ExtraParamsObject = Partial<{
99
106
  [ExtraParamsKey.InteractionMode]: InteractionMode;
@@ -103,4 +110,5 @@ export type ExtraParamsObject = Partial<{
103
110
  [ExtraParamsKey.LoginHint]: string;
104
111
  [ExtraParamsKey.Identifier]: string;
105
112
  [ExtraParamsKey.OneTimeToken]: string;
113
+ [ExtraParamsKey.GoogleOneTapCredential]: string;
106
114
  }>;
@@ -56,6 +56,10 @@ export var ExtraParamsKey;
56
56
  * The one-time token used as a proof for the user's identity. Example use case: Magic link.
57
57
  */
58
58
  ExtraParamsKey["OneTimeToken"] = "one_time_token";
59
+ /**
60
+ * The Google One Tap credential JWT token for external website integration.
61
+ */
62
+ ExtraParamsKey["GoogleOneTapCredential"] = "google_one_tap_credential";
59
63
  })(ExtraParamsKey || (ExtraParamsKey = {}));
60
64
  /** @deprecated Use {@link FirstScreen} instead. */
61
65
  export var InteractionMode;
@@ -83,5 +87,6 @@ export const extraParamsObjectGuard = z
83
87
  [ExtraParamsKey.LoginHint]: z.string(),
84
88
  [ExtraParamsKey.Identifier]: z.string(),
85
89
  [ExtraParamsKey.OneTimeToken]: z.string(),
90
+ [ExtraParamsKey.GoogleOneTapCredential]: z.string(),
86
91
  })
87
92
  .partial();
@@ -1,4 +1,4 @@
1
- import { AccountCenterFieldControl, GeneratedSchema } from './../foundations/index.js';
1
+ import { AccountCenterFieldControl, WebauthnRelatedOrigins, GeneratedSchema } from './../foundations/index.js';
2
2
  /**
3
3
  *
4
4
  * @remarks This is a type for database creation.
@@ -11,6 +11,7 @@ export type CreateAccountCenter = {
11
11
  enabled?: boolean;
12
12
  /** Control each fields */
13
13
  fields?: AccountCenterFieldControl;
14
+ webauthnRelatedOrigins?: WebauthnRelatedOrigins;
14
15
  };
15
16
  export type AccountCenter = {
16
17
  tenantId: string;
@@ -19,6 +20,7 @@ export type AccountCenter = {
19
20
  enabled: boolean;
20
21
  /** Control each fields */
21
22
  fields: AccountCenterFieldControl;
23
+ webauthnRelatedOrigins: WebauthnRelatedOrigins;
22
24
  };
23
- export type AccountCenterKeys = 'tenantId' | 'id' | 'enabled' | 'fields';
25
+ export type AccountCenterKeys = 'tenantId' | 'id' | 'enabled' | 'fields' | 'webauthnRelatedOrigins';
24
26
  export declare const AccountCenters: GeneratedSchema<AccountCenterKeys, CreateAccountCenter, AccountCenter, 'account_centers', 'account_center'>;
@@ -1,17 +1,19 @@
1
1
  // THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
2
  import { z } from 'zod';
3
- import { accountCenterFieldControlGuard } from './../foundations/index.js';
3
+ import { accountCenterFieldControlGuard, webauthnRelatedOriginsGuard } from './../foundations/index.js';
4
4
  const createGuard = z.object({
5
5
  tenantId: z.string().max(21).optional(),
6
6
  id: z.string().min(1).max(21),
7
7
  enabled: z.boolean().optional(),
8
8
  fields: accountCenterFieldControlGuard.optional(),
9
+ webauthnRelatedOrigins: webauthnRelatedOriginsGuard.optional(),
9
10
  });
10
11
  const guard = z.object({
11
12
  tenantId: z.string().max(21),
12
13
  id: z.string().min(1).max(21),
13
14
  enabled: z.boolean(),
14
15
  fields: accountCenterFieldControlGuard,
16
+ webauthnRelatedOrigins: webauthnRelatedOriginsGuard,
15
17
  });
16
18
  export const AccountCenters = Object.freeze({
17
19
  table: 'account_centers',
@@ -21,12 +23,14 @@ export const AccountCenters = Object.freeze({
21
23
  id: 'id',
22
24
  enabled: 'enabled',
23
25
  fields: 'fields',
26
+ webauthnRelatedOrigins: 'webauthn_related_origins',
24
27
  },
25
28
  fieldKeys: [
26
29
  'tenantId',
27
30
  'id',
28
31
  'enabled',
29
32
  'fields',
33
+ 'webauthnRelatedOrigins',
30
34
  ],
31
35
  createGuard,
32
36
  guard,
@@ -8,6 +8,8 @@ export type CreateConnector = {
8
8
  tenantId?: string;
9
9
  id: string;
10
10
  syncProfile?: boolean;
11
+ /** Whether the token storage is enabled for this connector. Only applied for OAuth2/OIDC social connectors. */
12
+ enableTokenStorage?: boolean;
11
13
  connectorId: string;
12
14
  config?: JsonObject;
13
15
  metadata?: ConfigurableConnectorMetadata;
@@ -17,10 +19,12 @@ export type Connector = {
17
19
  tenantId: string;
18
20
  id: string;
19
21
  syncProfile: boolean;
22
+ /** Whether the token storage is enabled for this connector. Only applied for OAuth2/OIDC social connectors. */
23
+ enableTokenStorage: boolean;
20
24
  connectorId: string;
21
25
  config: JsonObject;
22
26
  metadata: ConfigurableConnectorMetadata;
23
27
  createdAt: number;
24
28
  };
25
- export type ConnectorKeys = 'tenantId' | 'id' | 'syncProfile' | 'connectorId' | 'config' | 'metadata' | 'createdAt';
29
+ export type ConnectorKeys = 'tenantId' | 'id' | 'syncProfile' | 'enableTokenStorage' | 'connectorId' | 'config' | 'metadata' | 'createdAt';
26
30
  export declare const Connectors: GeneratedSchema<ConnectorKeys, CreateConnector, Connector, 'connectors', 'connector'>;
@@ -5,6 +5,7 @@ const createGuard = z.object({
5
5
  tenantId: z.string().max(21).optional(),
6
6
  id: z.string().min(1).max(128),
7
7
  syncProfile: z.boolean().optional(),
8
+ enableTokenStorage: z.boolean().optional(),
8
9
  connectorId: z.string().min(1).max(128),
9
10
  config: jsonObjectGuard.optional(),
10
11
  metadata: configurableConnectorMetadataGuard.optional(),
@@ -14,6 +15,7 @@ const guard = z.object({
14
15
  tenantId: z.string().max(21),
15
16
  id: z.string().min(1).max(128),
16
17
  syncProfile: z.boolean(),
18
+ enableTokenStorage: z.boolean(),
17
19
  connectorId: z.string().min(1).max(128),
18
20
  config: jsonObjectGuard,
19
21
  metadata: configurableConnectorMetadataGuard,
@@ -26,6 +28,7 @@ export const Connectors = Object.freeze({
26
28
  tenantId: 'tenant_id',
27
29
  id: 'id',
28
30
  syncProfile: 'sync_profile',
31
+ enableTokenStorage: 'enable_token_storage',
29
32
  connectorId: 'connector_id',
30
33
  config: 'config',
31
34
  metadata: 'metadata',
@@ -35,6 +38,7 @@ export const Connectors = Object.freeze({
35
38
  'tenantId',
36
39
  'id',
37
40
  'syncProfile',
41
+ 'enableTokenStorage',
38
42
  'connectorId',
39
43
  'config',
40
44
  'metadata',
@@ -0,0 +1,32 @@
1
+ import { CustomProfileFieldType, CustomProfileFieldConfig, GeneratedSchema } from './../foundations/index.js';
2
+ /**
3
+ *
4
+ * @remarks This is a type for database creation.
5
+ * @see {@link CustomProfileField} for the original type.
6
+ */
7
+ export type CreateCustomProfileField = {
8
+ tenantId?: string;
9
+ id: string;
10
+ name: string;
11
+ type: CustomProfileFieldType;
12
+ label?: string;
13
+ description?: string | null;
14
+ required?: boolean;
15
+ config?: CustomProfileFieldConfig;
16
+ createdAt?: number;
17
+ sieOrder?: number;
18
+ };
19
+ export type CustomProfileField = {
20
+ tenantId: string;
21
+ id: string;
22
+ name: string;
23
+ type: CustomProfileFieldType;
24
+ label: string;
25
+ description: string | null;
26
+ required: boolean;
27
+ config: CustomProfileFieldConfig;
28
+ createdAt: number;
29
+ sieOrder: number;
30
+ };
31
+ export type CustomProfileFieldKeys = 'tenantId' | 'id' | 'name' | 'type' | 'label' | 'description' | 'required' | 'config' | 'createdAt' | 'sieOrder';
32
+ export declare const CustomProfileFields: GeneratedSchema<CustomProfileFieldKeys, CreateCustomProfileField, CustomProfileField, 'custom_profile_fields', 'custom_profile_field'>;
@@ -0,0 +1,58 @@
1
+ // THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
+ import { z } from 'zod';
3
+ import { customProfileFieldTypeGuard, customProfileFieldConfigGuard } from './../foundations/index.js';
4
+ const createGuard = z.object({
5
+ tenantId: z.string().max(21).optional(),
6
+ id: z.string().min(1).max(21),
7
+ name: z.string().min(1).max(128),
8
+ type: customProfileFieldTypeGuard,
9
+ label: z.string().min(1).max(128).optional(),
10
+ description: z.string().max(256).nullable().optional(),
11
+ required: z.boolean().optional(),
12
+ config: customProfileFieldConfigGuard.optional(),
13
+ createdAt: z.number().optional(),
14
+ sieOrder: z.number().optional(),
15
+ });
16
+ const guard = z.object({
17
+ tenantId: z.string().max(21),
18
+ id: z.string().min(1).max(21),
19
+ name: z.string().min(1).max(128),
20
+ type: customProfileFieldTypeGuard,
21
+ label: z.string().max(128),
22
+ description: z.string().max(256).nullable(),
23
+ required: z.boolean(),
24
+ config: customProfileFieldConfigGuard,
25
+ createdAt: z.number(),
26
+ sieOrder: z.number(),
27
+ });
28
+ export const CustomProfileFields = Object.freeze({
29
+ table: 'custom_profile_fields',
30
+ tableSingular: 'custom_profile_field',
31
+ fields: {
32
+ tenantId: 'tenant_id',
33
+ id: 'id',
34
+ name: 'name',
35
+ type: 'type',
36
+ label: 'label',
37
+ description: 'description',
38
+ required: 'required',
39
+ config: 'config',
40
+ createdAt: 'created_at',
41
+ sieOrder: 'sie_order',
42
+ },
43
+ fieldKeys: [
44
+ 'tenantId',
45
+ 'id',
46
+ 'name',
47
+ 'type',
48
+ 'label',
49
+ 'description',
50
+ 'required',
51
+ 'config',
52
+ 'createdAt',
53
+ 'sieOrder',
54
+ ],
55
+ createGuard,
56
+ guard,
57
+ updateGuard: guard.partial(),
58
+ });
@@ -16,6 +16,7 @@ export * from './applications-role.js';
16
16
  export * from './captcha-provider.js';
17
17
  export * from './connector.js';
18
18
  export * from './custom-phrase.js';
19
+ export * from './custom-profile-field.js';
19
20
  export * from './daily-active-user.js';
20
21
  export * from './daily-token-usage.js';
21
22
  export * from './domain.js';
@@ -25,6 +26,7 @@ export * from './idp-initiated-saml-sso-session.js';
25
26
  export * from './log.js';
26
27
  export * from './logto-config.js';
27
28
  export * from './oidc-model-instance.js';
29
+ export * from './oidc-session-extension.js';
28
30
  export * from './one-time-token.js';
29
31
  export * from './organization-application-relation.js';
30
32
  export * from './organization-invitation-role-relation.js';
@@ -49,6 +51,9 @@ export * from './saml-application-config.js';
49
51
  export * from './saml-application-secret.js';
50
52
  export * from './saml-application-session.js';
51
53
  export * from './scope.js';
54
+ export * from './secret-enterprise-sso-connector-relation.js';
55
+ export * from './secret-social-connector-relation.js';
56
+ export * from './secret.js';
52
57
  export * from './sentinel-activity.js';
53
58
  export * from './service-log.js';
54
59
  export * from './sign-in-experience.js';
@@ -17,6 +17,7 @@ export * from './applications-role.js';
17
17
  export * from './captcha-provider.js';
18
18
  export * from './connector.js';
19
19
  export * from './custom-phrase.js';
20
+ export * from './custom-profile-field.js';
20
21
  export * from './daily-active-user.js';
21
22
  export * from './daily-token-usage.js';
22
23
  export * from './domain.js';
@@ -26,6 +27,7 @@ export * from './idp-initiated-saml-sso-session.js';
26
27
  export * from './log.js';
27
28
  export * from './logto-config.js';
28
29
  export * from './oidc-model-instance.js';
30
+ export * from './oidc-session-extension.js';
29
31
  export * from './one-time-token.js';
30
32
  export * from './organization-application-relation.js';
31
33
  export * from './organization-invitation-role-relation.js';
@@ -50,6 +52,9 @@ export * from './saml-application-config.js';
50
52
  export * from './saml-application-secret.js';
51
53
  export * from './saml-application-session.js';
52
54
  export * from './scope.js';
55
+ export * from './secret-enterprise-sso-connector-relation.js';
56
+ export * from './secret-social-connector-relation.js';
57
+ export * from './secret.js';
53
58
  export * from './sentinel-activity.js';
54
59
  export * from './service-log.js';
55
60
  export * from './sign-in-experience.js';
@@ -0,0 +1,24 @@
1
+ import { JsonObject, GeneratedSchema } from './../foundations/index.js';
2
+ /**
3
+ *
4
+ * @remarks This is a type for database creation.
5
+ * @see {@link OidcSessionExtension} for the original type.
6
+ */
7
+ export type CreateOidcSessionExtension = {
8
+ tenantId?: string;
9
+ sessionUid: string;
10
+ accountId: string;
11
+ lastSubmission?: JsonObject;
12
+ createdAt?: number;
13
+ updatedAt?: number;
14
+ };
15
+ export type OidcSessionExtension = {
16
+ tenantId: string;
17
+ sessionUid: string;
18
+ accountId: string;
19
+ lastSubmission: JsonObject;
20
+ createdAt: number;
21
+ updatedAt: number;
22
+ };
23
+ export type OidcSessionExtensionKeys = 'tenantId' | 'sessionUid' | 'accountId' | 'lastSubmission' | 'createdAt' | 'updatedAt';
24
+ export declare const OidcSessionExtensions: GeneratedSchema<OidcSessionExtensionKeys, CreateOidcSessionExtension, OidcSessionExtension, 'oidc_session_extensions', 'oidc_session_extension'>;
@@ -0,0 +1,42 @@
1
+ // THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
+ import { z } from 'zod';
3
+ import { jsonObjectGuard } from './../foundations/index.js';
4
+ const createGuard = z.object({
5
+ tenantId: z.string().max(21).optional(),
6
+ sessionUid: z.string().min(1).max(128),
7
+ accountId: z.string().min(1).max(12),
8
+ lastSubmission: jsonObjectGuard.optional(),
9
+ createdAt: z.number().optional(),
10
+ updatedAt: z.number().optional(),
11
+ });
12
+ const guard = z.object({
13
+ tenantId: z.string().max(21),
14
+ sessionUid: z.string().min(1).max(128),
15
+ accountId: z.string().min(1).max(12),
16
+ lastSubmission: jsonObjectGuard,
17
+ createdAt: z.number(),
18
+ updatedAt: z.number(),
19
+ });
20
+ export const OidcSessionExtensions = Object.freeze({
21
+ table: 'oidc_session_extensions',
22
+ tableSingular: 'oidc_session_extension',
23
+ fields: {
24
+ tenantId: 'tenant_id',
25
+ sessionUid: 'session_uid',
26
+ accountId: 'account_id',
27
+ lastSubmission: 'last_submission',
28
+ createdAt: 'created_at',
29
+ updatedAt: 'updated_at',
30
+ },
31
+ fieldKeys: [
32
+ 'tenantId',
33
+ 'sessionUid',
34
+ 'accountId',
35
+ 'lastSubmission',
36
+ 'createdAt',
37
+ 'updatedAt',
38
+ ],
39
+ createGuard,
40
+ guard,
41
+ updateGuard: guard.partial(),
42
+ });
@@ -0,0 +1,28 @@
1
+ import { GeneratedSchema } from './../foundations/index.js';
2
+ /**
3
+ *
4
+ * @remarks This is a type for database creation.
5
+ * @see {@link SecretEnterpriseSsoConnectorRelation} for the original type.
6
+ */
7
+ export type CreateSecretEnterpriseSsoConnectorRelation = {
8
+ tenantId?: string;
9
+ secretId: string;
10
+ /** SSO connector ID foreign reference. Only present for secrets that store SSO connector tokens. Note: avoid directly cascading deletes here, need to delete the secrets first. */
11
+ ssoConnectorId: string;
12
+ /** User SSO connector issuer. Only present for secrets that store SSO connector tokens. */
13
+ issuer: string;
14
+ /** User SSO identity ID. Only present for secrets that store SSO identity tokens. */
15
+ identityId: string;
16
+ };
17
+ export type SecretEnterpriseSsoConnectorRelation = {
18
+ tenantId: string;
19
+ secretId: string;
20
+ /** SSO connector ID foreign reference. Only present for secrets that store SSO connector tokens. Note: avoid directly cascading deletes here, need to delete the secrets first. */
21
+ ssoConnectorId: string;
22
+ /** User SSO connector issuer. Only present for secrets that store SSO connector tokens. */
23
+ issuer: string;
24
+ /** User SSO identity ID. Only present for secrets that store SSO identity tokens. */
25
+ identityId: string;
26
+ };
27
+ export type SecretEnterpriseSsoConnectorRelationKeys = 'tenantId' | 'secretId' | 'ssoConnectorId' | 'issuer' | 'identityId';
28
+ export declare const SecretEnterpriseSsoConnectorRelations: GeneratedSchema<SecretEnterpriseSsoConnectorRelationKeys, CreateSecretEnterpriseSsoConnectorRelation, SecretEnterpriseSsoConnectorRelation, 'secret_enterprise_sso_connector_relations', 'secret_enterprise_sso_connector_relation'>;
@@ -0,0 +1,37 @@
1
+ // THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
+ import { z } from 'zod';
3
+ const createGuard = z.object({
4
+ tenantId: z.string().max(21).optional(),
5
+ secretId: z.string().min(1).max(21),
6
+ ssoConnectorId: z.string().min(1).max(128),
7
+ issuer: z.string().min(1).max(256),
8
+ identityId: z.string().min(1).max(128),
9
+ });
10
+ const guard = z.object({
11
+ tenantId: z.string().max(21),
12
+ secretId: z.string().min(1).max(21),
13
+ ssoConnectorId: z.string().min(1).max(128),
14
+ issuer: z.string().min(1).max(256),
15
+ identityId: z.string().min(1).max(128),
16
+ });
17
+ export const SecretEnterpriseSsoConnectorRelations = Object.freeze({
18
+ table: 'secret_enterprise_sso_connector_relations',
19
+ tableSingular: 'secret_enterprise_sso_connector_relation',
20
+ fields: {
21
+ tenantId: 'tenant_id',
22
+ secretId: 'secret_id',
23
+ ssoConnectorId: 'sso_connector_id',
24
+ issuer: 'issuer',
25
+ identityId: 'identity_id',
26
+ },
27
+ fieldKeys: [
28
+ 'tenantId',
29
+ 'secretId',
30
+ 'ssoConnectorId',
31
+ 'issuer',
32
+ 'identityId',
33
+ ],
34
+ createGuard,
35
+ guard,
36
+ updateGuard: guard.partial(),
37
+ });
@@ -0,0 +1,28 @@
1
+ import { GeneratedSchema } from './../foundations/index.js';
2
+ /**
3
+ *
4
+ * @remarks This is a type for database creation.
5
+ * @see {@link SecretSocialConnectorRelation} for the original type.
6
+ */
7
+ export type CreateSecretSocialConnectorRelation = {
8
+ tenantId?: string;
9
+ secretId: string;
10
+ /** Social connector ID foreign reference. Only present for secrets that store social connector tokens. Note: avoid directly cascading deletes here, need to delete the secrets first. */
11
+ connectorId: string;
12
+ /** The target of the social connector. e.g. 'github', 'google', etc. */
13
+ target: string;
14
+ /** User social identity ID foreign reference. Only present for secrets that store social identity tokens. */
15
+ identityId: string;
16
+ };
17
+ export type SecretSocialConnectorRelation = {
18
+ tenantId: string;
19
+ secretId: string;
20
+ /** Social connector ID foreign reference. Only present for secrets that store social connector tokens. Note: avoid directly cascading deletes here, need to delete the secrets first. */
21
+ connectorId: string;
22
+ /** The target of the social connector. e.g. 'github', 'google', etc. */
23
+ target: string;
24
+ /** User social identity ID foreign reference. Only present for secrets that store social identity tokens. */
25
+ identityId: string;
26
+ };
27
+ export type SecretSocialConnectorRelationKeys = 'tenantId' | 'secretId' | 'connectorId' | 'target' | 'identityId';
28
+ export declare const SecretSocialConnectorRelations: GeneratedSchema<SecretSocialConnectorRelationKeys, CreateSecretSocialConnectorRelation, SecretSocialConnectorRelation, 'secret_social_connector_relations', 'secret_social_connector_relation'>;
@@ -0,0 +1,37 @@
1
+ // THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
+ import { z } from 'zod';
3
+ const createGuard = z.object({
4
+ tenantId: z.string().max(21).optional(),
5
+ secretId: z.string().min(1).max(21),
6
+ connectorId: z.string().min(1).max(128),
7
+ target: z.string().min(1).max(256),
8
+ identityId: z.string().min(1).max(128),
9
+ });
10
+ const guard = z.object({
11
+ tenantId: z.string().max(21),
12
+ secretId: z.string().min(1).max(21),
13
+ connectorId: z.string().min(1).max(128),
14
+ target: z.string().min(1).max(256),
15
+ identityId: z.string().min(1).max(128),
16
+ });
17
+ export const SecretSocialConnectorRelations = Object.freeze({
18
+ table: 'secret_social_connector_relations',
19
+ tableSingular: 'secret_social_connector_relation',
20
+ fields: {
21
+ tenantId: 'tenant_id',
22
+ secretId: 'secret_id',
23
+ connectorId: 'connector_id',
24
+ target: 'target',
25
+ identityId: 'identity_id',
26
+ },
27
+ fieldKeys: [
28
+ 'tenantId',
29
+ 'secretId',
30
+ 'connectorId',
31
+ 'target',
32
+ 'identityId',
33
+ ],
34
+ createGuard,
35
+ guard,
36
+ updateGuard: guard.partial(),
37
+ });
@@ -0,0 +1,44 @@
1
+ import { SecretType, BufferLike, JsonObject, GeneratedSchema } from './../foundations/index.js';
2
+ /**
3
+ *
4
+ * @remarks This is a type for database creation.
5
+ * @see {@link Secret} for the original type.
6
+ */
7
+ export type CreateSecret = {
8
+ tenantId?: string;
9
+ id: string;
10
+ userId: string;
11
+ type: SecretType;
12
+ /** Encrypted data encryption key (DEK) for the secret. */
13
+ encryptedDek: BufferLike;
14
+ /** Initialization vector for the secret encryption. */
15
+ iv: BufferLike;
16
+ /** Authentication tag for the secret encryption. */
17
+ authTag: BufferLike;
18
+ /** The encrypted secret data. e.g. { access_token, refresh_token } */
19
+ ciphertext: BufferLike;
20
+ /** The metadata associated with the secret. */
21
+ metadata?: JsonObject;
22
+ createdAt?: number;
23
+ updatedAt?: number;
24
+ };
25
+ export type Secret = {
26
+ tenantId: string;
27
+ id: string;
28
+ userId: string;
29
+ type: SecretType;
30
+ /** Encrypted data encryption key (DEK) for the secret. */
31
+ encryptedDek: BufferLike;
32
+ /** Initialization vector for the secret encryption. */
33
+ iv: BufferLike;
34
+ /** Authentication tag for the secret encryption. */
35
+ authTag: BufferLike;
36
+ /** The encrypted secret data. e.g. { access_token, refresh_token } */
37
+ ciphertext: BufferLike;
38
+ /** The metadata associated with the secret. */
39
+ metadata: JsonObject;
40
+ createdAt: number;
41
+ updatedAt: number;
42
+ };
43
+ export type SecretKeys = 'tenantId' | 'id' | 'userId' | 'type' | 'encryptedDek' | 'iv' | 'authTag' | 'ciphertext' | 'metadata' | 'createdAt' | 'updatedAt';
44
+ export declare const Secrets: GeneratedSchema<SecretKeys, CreateSecret, Secret, 'secrets', 'secret'>;
@@ -0,0 +1,62 @@
1
+ // THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
+ import { z } from 'zod';
3
+ import { secretTypeGuard, bufferLikeGuard, jsonObjectGuard } from './../foundations/index.js';
4
+ const createGuard = z.object({
5
+ tenantId: z.string().max(21).optional(),
6
+ id: z.string().min(1).max(21),
7
+ userId: z.string().min(1).max(21),
8
+ type: secretTypeGuard,
9
+ encryptedDek: bufferLikeGuard,
10
+ iv: bufferLikeGuard,
11
+ authTag: bufferLikeGuard,
12
+ ciphertext: bufferLikeGuard,
13
+ metadata: jsonObjectGuard.optional(),
14
+ createdAt: z.number().optional(),
15
+ updatedAt: z.number().optional(),
16
+ });
17
+ const guard = z.object({
18
+ tenantId: z.string().max(21),
19
+ id: z.string().min(1).max(21),
20
+ userId: z.string().min(1).max(21),
21
+ type: secretTypeGuard,
22
+ encryptedDek: bufferLikeGuard,
23
+ iv: bufferLikeGuard,
24
+ authTag: bufferLikeGuard,
25
+ ciphertext: bufferLikeGuard,
26
+ metadata: jsonObjectGuard,
27
+ createdAt: z.number(),
28
+ updatedAt: z.number(),
29
+ });
30
+ export const Secrets = Object.freeze({
31
+ table: 'secrets',
32
+ tableSingular: 'secret',
33
+ fields: {
34
+ tenantId: 'tenant_id',
35
+ id: 'id',
36
+ userId: 'user_id',
37
+ type: 'type',
38
+ encryptedDek: 'encrypted_dek',
39
+ iv: 'iv',
40
+ authTag: 'auth_tag',
41
+ ciphertext: 'ciphertext',
42
+ metadata: 'metadata',
43
+ createdAt: 'created_at',
44
+ updatedAt: 'updated_at',
45
+ },
46
+ fieldKeys: [
47
+ 'tenantId',
48
+ 'id',
49
+ 'userId',
50
+ 'type',
51
+ 'encryptedDek',
52
+ 'iv',
53
+ 'authTag',
54
+ 'ciphertext',
55
+ 'metadata',
56
+ 'createdAt',
57
+ 'updatedAt',
58
+ ],
59
+ createGuard,
60
+ guard,
61
+ updateGuard: guard.partial(),
62
+ });
@@ -20,6 +20,8 @@ export type CreateSsoConnector = {
20
20
  branding?: SsoBranding;
21
21
  /** Determines whether to synchronize the user's profile on each login. */
22
22
  syncProfile?: boolean;
23
+ /** Whether the token storage is enabled for this connector. Only applied for OAuth2/OIDC SSO connectors. */
24
+ enableTokenStorage?: boolean;
23
25
  /** When the SSO connector was created. */
24
26
  createdAt?: number;
25
27
  };
@@ -39,8 +41,10 @@ export type SsoConnector = {
39
41
  branding: SsoBranding;
40
42
  /** Determines whether to synchronize the user's profile on each login. */
41
43
  syncProfile: boolean;
44
+ /** Whether the token storage is enabled for this connector. Only applied for OAuth2/OIDC SSO connectors. */
45
+ enableTokenStorage: boolean;
42
46
  /** When the SSO connector was created. */
43
47
  createdAt: number;
44
48
  };
45
- export type SsoConnectorKeys = 'tenantId' | 'id' | 'providerName' | 'connectorName' | 'config' | 'domains' | 'branding' | 'syncProfile' | 'createdAt';
49
+ export type SsoConnectorKeys = 'tenantId' | 'id' | 'providerName' | 'connectorName' | 'config' | 'domains' | 'branding' | 'syncProfile' | 'enableTokenStorage' | 'createdAt';
46
50
  export declare const SsoConnectors: GeneratedSchema<SsoConnectorKeys, CreateSsoConnector, SsoConnector, 'sso_connectors', 'sso_connector'>;