@logto/schemas 1.29.0 → 1.30.1

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 (83) hide show
  1. package/alterations/1.30.0-1750744685-add-triggers-to-delete-secrets-on-social-identities-deletion.ts +81 -0
  2. package/alterations/1.30.0-1750748516-add-enable-token-storage-column-to-connectors-table.ts +20 -0
  3. package/alterations/1.30.0-1751255436-split-secret-connector-relatioins-table.ts +359 -0
  4. package/alterations/1.30.0-1751337183-add-require-mfa-on-sign-in-to-users.ts +20 -0
  5. package/alterations/1.30.0-1751400000-move-require-mfa-on-sign-in-to-logto-config.ts +21 -0
  6. package/alterations/1.30.0-1751529530-add-enable-token-storage-column-to-sso-connectors-table.ts +20 -0
  7. package/alterations/1.30.0-1752630302-alterate-enable-column-default-value-in-account-centers-table.ts +20 -0
  8. package/alterations/1.30.0-1753669579-add-organization-user-relations-foreign-key.ts +46 -0
  9. package/alterations-js/1.30.0-1750744685-add-triggers-to-delete-secrets-on-social-identities-deletion.js +76 -0
  10. package/alterations-js/1.30.0-1750748516-add-enable-token-storage-column-to-connectors-table.js +16 -0
  11. package/alterations-js/1.30.0-1751255436-split-secret-connector-relatioins-table.js +338 -0
  12. package/alterations-js/1.30.0-1751337183-add-require-mfa-on-sign-in-to-users.js +16 -0
  13. package/alterations-js/1.30.0-1751400000-move-require-mfa-on-sign-in-to-logto-config.js +17 -0
  14. package/alterations-js/1.30.0-1751529530-add-enable-token-storage-column-to-sso-connectors-table.js +16 -0
  15. package/alterations-js/1.30.0-1752630302-alterate-enable-column-default-value-in-account-centers-table.js +16 -0
  16. package/alterations-js/1.30.0-1753669579-add-organization-user-relations-foreign-key.js +38 -0
  17. package/lib/consts/oidc.d.ts +9 -1
  18. package/lib/consts/oidc.js +5 -0
  19. package/lib/db-entries/connector.d.ts +5 -1
  20. package/lib/db-entries/connector.js +4 -0
  21. package/lib/db-entries/index.d.ts +2 -1
  22. package/lib/db-entries/index.js +2 -1
  23. package/lib/db-entries/secret-enterprise-sso-connector-relation.d.ts +28 -0
  24. package/lib/db-entries/secret-enterprise-sso-connector-relation.js +37 -0
  25. package/lib/db-entries/secret-social-connector-relation.d.ts +28 -0
  26. package/lib/db-entries/secret-social-connector-relation.js +37 -0
  27. package/lib/db-entries/secret.d.ts +9 -9
  28. package/lib/db-entries/secret.js +9 -9
  29. package/lib/db-entries/sso-connector.d.ts +5 -1
  30. package/lib/db-entries/sso-connector.js +4 -0
  31. package/lib/foundations/jsonb-types/custom-profile-fields.d.ts +336 -11
  32. package/lib/foundations/jsonb-types/custom-profile-fields.js +17 -9
  33. package/lib/foundations/jsonb-types/secrets.d.ts +2 -0
  34. package/lib/foundations/jsonb-types/secrets.js +5 -0
  35. package/lib/foundations/jsonb-types/sign-in-experience.d.ts +3 -1
  36. package/lib/foundations/jsonb-types/sign-in-experience.js +2 -0
  37. package/lib/foundations/jsonb-types/users.d.ts +94 -0
  38. package/lib/foundations/jsonb-types/users.js +11 -0
  39. package/lib/types/connector.d.ts +39 -0
  40. package/lib/types/connector.js +1 -0
  41. package/lib/types/consent.d.ts +40 -0
  42. package/lib/types/custom-profile-fields.d.ts +1410 -133
  43. package/lib/types/custom-profile-fields.js +51 -15
  44. package/lib/types/index.d.ts +2 -0
  45. package/lib/types/index.js +2 -0
  46. package/lib/types/interactions.d.ts +175 -1
  47. package/lib/types/interactions.js +48 -1
  48. package/lib/types/logto-config/index.d.ts +214 -179
  49. package/lib/types/logto-config/jwt-customizer.d.ts +453 -328
  50. package/lib/types/logto-config/jwt-customizer.js +6 -1
  51. package/lib/types/secrets.d.ts +436 -0
  52. package/lib/types/secrets.js +73 -0
  53. package/lib/types/sign-in-experience.d.ts +19 -1
  54. package/lib/types/sign-in-experience.js +3 -1
  55. package/lib/types/sso-connector.d.ts +5 -2
  56. package/lib/types/user-logto-config.d.ts +45 -0
  57. package/lib/types/user-logto-config.js +18 -0
  58. package/lib/types/user.d.ts +615 -0
  59. package/lib/types/user.js +14 -1
  60. package/lib/types/verification-records/backup-code-verification.d.ts +18 -0
  61. package/lib/types/verification-records/backup-code-verification.js +3 -0
  62. package/lib/types/verification-records/enterprise-sso-verification.d.ts +145 -0
  63. package/lib/types/verification-records/enterprise-sso-verification.js +5 -0
  64. package/lib/types/verification-records/new-password-identity-verification.d.ts +31 -0
  65. package/lib/types/verification-records/new-password-identity-verification.js +4 -0
  66. package/lib/types/verification-records/social-verification.d.ts +164 -0
  67. package/lib/types/verification-records/social-verification.js +6 -0
  68. package/lib/types/verification-records/totp-verification.d.ts +18 -0
  69. package/lib/types/verification-records/totp-verification.js +3 -0
  70. package/lib/types/verification-records/web-authn-verification.d.ts +44 -0
  71. package/lib/types/verification-records/web-authn-verification.js +5 -0
  72. package/package.json +7 -7
  73. package/tables/account_centers.sql +1 -1
  74. package/tables/connectors.sql +2 -0
  75. package/tables/organization_user_relations.sql +4 -1
  76. package/tables/secret_enterprise_sso_connector_relations.sql +60 -0
  77. package/tables/secret_social_connector_relations.sql +75 -0
  78. package/tables/secrets.sql +4 -4
  79. package/tables/sso_connectors.sql +2 -0
  80. package/tables/users.sql +2 -1
  81. package/lib/db-entries/secret-connector-relation.d.ts +0 -40
  82. package/lib/db-entries/secret-connector-relation.js +0 -49
  83. package/tables/secret_connector_relations.sql +0 -78
@@ -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
+ });
@@ -1,4 +1,4 @@
1
- import { SecretType, JsonObject, GeneratedSchema } from './../foundations/index.js';
1
+ import { SecretType, BufferLike, JsonObject, GeneratedSchema } from './../foundations/index.js';
2
2
  /**
3
3
  *
4
4
  * @remarks This is a type for database creation.
@@ -10,13 +10,13 @@ export type CreateSecret = {
10
10
  userId: string;
11
11
  type: SecretType;
12
12
  /** Encrypted data encryption key (DEK) for the secret. */
13
- encryptedDek: string;
13
+ encryptedDek: BufferLike;
14
14
  /** Initialization vector for the secret encryption. */
15
- iv: string;
15
+ iv: BufferLike;
16
16
  /** Authentication tag for the secret encryption. */
17
- authTag: string;
17
+ authTag: BufferLike;
18
18
  /** The encrypted secret data. e.g. { access_token, refresh_token } */
19
- ciphertext: string;
19
+ ciphertext: BufferLike;
20
20
  /** The metadata associated with the secret. */
21
21
  metadata?: JsonObject;
22
22
  createdAt?: number;
@@ -28,13 +28,13 @@ export type Secret = {
28
28
  userId: string;
29
29
  type: SecretType;
30
30
  /** Encrypted data encryption key (DEK) for the secret. */
31
- encryptedDek: string;
31
+ encryptedDek: BufferLike;
32
32
  /** Initialization vector for the secret encryption. */
33
- iv: string;
33
+ iv: BufferLike;
34
34
  /** Authentication tag for the secret encryption. */
35
- authTag: string;
35
+ authTag: BufferLike;
36
36
  /** The encrypted secret data. e.g. { access_token, refresh_token } */
37
- ciphertext: string;
37
+ ciphertext: BufferLike;
38
38
  /** The metadata associated with the secret. */
39
39
  metadata: JsonObject;
40
40
  createdAt: number;
@@ -1,15 +1,15 @@
1
1
  // THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
2
  import { z } from 'zod';
3
- import { secretTypeGuard, jsonObjectGuard } from './../foundations/index.js';
3
+ import { secretTypeGuard, bufferLikeGuard, jsonObjectGuard } 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
  userId: z.string().min(1).max(21),
8
8
  type: secretTypeGuard,
9
- encryptedDek: z.string().min(1),
10
- iv: z.string().min(1),
11
- authTag: z.string().min(1),
12
- ciphertext: z.string().min(1),
9
+ encryptedDek: bufferLikeGuard,
10
+ iv: bufferLikeGuard,
11
+ authTag: bufferLikeGuard,
12
+ ciphertext: bufferLikeGuard,
13
13
  metadata: jsonObjectGuard.optional(),
14
14
  createdAt: z.number().optional(),
15
15
  updatedAt: z.number().optional(),
@@ -19,10 +19,10 @@ const guard = z.object({
19
19
  id: z.string().min(1).max(21),
20
20
  userId: z.string().min(1).max(21),
21
21
  type: secretTypeGuard,
22
- encryptedDek: z.string().min(1),
23
- iv: z.string().min(1),
24
- authTag: z.string().min(1),
25
- ciphertext: z.string().min(1),
22
+ encryptedDek: bufferLikeGuard,
23
+ iv: bufferLikeGuard,
24
+ authTag: bufferLikeGuard,
25
+ ciphertext: bufferLikeGuard,
26
26
  metadata: jsonObjectGuard,
27
27
  createdAt: z.number(),
28
28
  updatedAt: z.number(),
@@ -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'>;
@@ -10,6 +10,7 @@ const createGuard = z.object({
10
10
  domains: ssoDomainsGuard.optional(),
11
11
  branding: ssoBrandingGuard.optional(),
12
12
  syncProfile: z.boolean().optional(),
13
+ enableTokenStorage: z.boolean().optional(),
13
14
  createdAt: z.number().optional(),
14
15
  });
15
16
  const guard = z.object({
@@ -21,6 +22,7 @@ const guard = z.object({
21
22
  domains: ssoDomainsGuard,
22
23
  branding: ssoBrandingGuard,
23
24
  syncProfile: z.boolean(),
25
+ enableTokenStorage: z.boolean(),
24
26
  createdAt: z.number(),
25
27
  });
26
28
  export const SsoConnectors = Object.freeze({
@@ -35,6 +37,7 @@ export const SsoConnectors = Object.freeze({
35
37
  domains: 'domains',
36
38
  branding: 'branding',
37
39
  syncProfile: 'sync_profile',
40
+ enableTokenStorage: 'enable_token_storage',
38
41
  createdAt: 'created_at',
39
42
  },
40
43
  fieldKeys: [
@@ -46,6 +49,7 @@ export const SsoConnectors = Object.freeze({
46
49
  'domains',
47
50
  'branding',
48
51
  'syncProfile',
52
+ 'enableTokenStorage',
49
53
  'createdAt',
50
54
  ],
51
55
  createGuard,
@@ -33,26 +33,231 @@ export declare const fieldOptionsGuard: z.ZodArray<z.ZodObject<{
33
33
  label: string;
34
34
  }>, "many">;
35
35
  export type FieldOptions = z.infer<typeof fieldOptionsGuard>;
36
+ export declare const baseConfigGuard: z.ZodObject<{
37
+ placeholder: z.ZodOptional<z.ZodString>;
38
+ minLength: z.ZodOptional<z.ZodNumber>;
39
+ maxLength: z.ZodOptional<z.ZodNumber>;
40
+ minValue: z.ZodOptional<z.ZodNumber>;
41
+ maxValue: z.ZodOptional<z.ZodNumber>;
42
+ format: z.ZodOptional<z.ZodString>;
43
+ customFormat: z.ZodOptional<z.ZodString>;
44
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
45
+ label: z.ZodString;
46
+ value: z.ZodString;
47
+ }, "strip", z.ZodTypeAny, {
48
+ value: string;
49
+ label: string;
50
+ }, {
51
+ value: string;
52
+ label: string;
53
+ }>, "many">>;
54
+ }, "strip", z.ZodTypeAny, {
55
+ options?: {
56
+ value: string;
57
+ label: string;
58
+ }[] | undefined;
59
+ minLength?: number | undefined;
60
+ maxLength?: number | undefined;
61
+ placeholder?: string | undefined;
62
+ minValue?: number | undefined;
63
+ maxValue?: number | undefined;
64
+ format?: string | undefined;
65
+ customFormat?: string | undefined;
66
+ }, {
67
+ options?: {
68
+ value: string;
69
+ label: string;
70
+ }[] | undefined;
71
+ minLength?: number | undefined;
72
+ maxLength?: number | undefined;
73
+ placeholder?: string | undefined;
74
+ minValue?: number | undefined;
75
+ maxValue?: number | undefined;
76
+ format?: string | undefined;
77
+ customFormat?: string | undefined;
78
+ }>;
36
79
  export declare const fieldPartGuard: z.ZodObject<{
37
- key: z.ZodString;
38
80
  enabled: z.ZodBoolean;
81
+ name: z.ZodString;
82
+ type: z.ZodNativeEnum<typeof CustomProfileFieldType>;
83
+ label: z.ZodString;
84
+ description: z.ZodOptional<z.ZodString>;
85
+ required: z.ZodBoolean;
86
+ config: z.ZodOptional<z.ZodObject<{
87
+ placeholder: z.ZodOptional<z.ZodString>;
88
+ minLength: z.ZodOptional<z.ZodNumber>;
89
+ maxLength: z.ZodOptional<z.ZodNumber>;
90
+ minValue: z.ZodOptional<z.ZodNumber>;
91
+ maxValue: z.ZodOptional<z.ZodNumber>;
92
+ format: z.ZodOptional<z.ZodString>;
93
+ customFormat: z.ZodOptional<z.ZodString>;
94
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
95
+ label: z.ZodString;
96
+ value: z.ZodString;
97
+ }, "strip", z.ZodTypeAny, {
98
+ value: string;
99
+ label: string;
100
+ }, {
101
+ value: string;
102
+ label: string;
103
+ }>, "many">>;
104
+ }, "strip", z.ZodTypeAny, {
105
+ options?: {
106
+ value: string;
107
+ label: string;
108
+ }[] | undefined;
109
+ minLength?: number | undefined;
110
+ maxLength?: number | undefined;
111
+ placeholder?: string | undefined;
112
+ minValue?: number | undefined;
113
+ maxValue?: number | undefined;
114
+ format?: string | undefined;
115
+ customFormat?: string | undefined;
116
+ }, {
117
+ options?: {
118
+ value: string;
119
+ label: string;
120
+ }[] | undefined;
121
+ minLength?: number | undefined;
122
+ maxLength?: number | undefined;
123
+ placeholder?: string | undefined;
124
+ minValue?: number | undefined;
125
+ maxValue?: number | undefined;
126
+ format?: string | undefined;
127
+ customFormat?: string | undefined;
128
+ }>>;
39
129
  }, "strip", z.ZodTypeAny, {
40
- key: string;
130
+ type: CustomProfileFieldType;
131
+ name: string;
41
132
  enabled: boolean;
133
+ label: string;
134
+ required: boolean;
135
+ description?: string | undefined;
136
+ config?: {
137
+ options?: {
138
+ value: string;
139
+ label: string;
140
+ }[] | undefined;
141
+ minLength?: number | undefined;
142
+ maxLength?: number | undefined;
143
+ placeholder?: string | undefined;
144
+ minValue?: number | undefined;
145
+ maxValue?: number | undefined;
146
+ format?: string | undefined;
147
+ customFormat?: string | undefined;
148
+ } | undefined;
42
149
  }, {
43
- key: string;
150
+ type: CustomProfileFieldType;
151
+ name: string;
44
152
  enabled: boolean;
153
+ label: string;
154
+ required: boolean;
155
+ description?: string | undefined;
156
+ config?: {
157
+ options?: {
158
+ value: string;
159
+ label: string;
160
+ }[] | undefined;
161
+ minLength?: number | undefined;
162
+ maxLength?: number | undefined;
163
+ placeholder?: string | undefined;
164
+ minValue?: number | undefined;
165
+ maxValue?: number | undefined;
166
+ format?: string | undefined;
167
+ customFormat?: string | undefined;
168
+ } | undefined;
45
169
  }>;
46
170
  export type FieldPart = z.infer<typeof fieldPartGuard>;
47
171
  export declare const fieldPartsGuard: z.ZodArray<z.ZodObject<{
48
- key: z.ZodString;
49
172
  enabled: z.ZodBoolean;
173
+ name: z.ZodString;
174
+ type: z.ZodNativeEnum<typeof CustomProfileFieldType>;
175
+ label: z.ZodString;
176
+ description: z.ZodOptional<z.ZodString>;
177
+ required: z.ZodBoolean;
178
+ config: z.ZodOptional<z.ZodObject<{
179
+ placeholder: z.ZodOptional<z.ZodString>;
180
+ minLength: z.ZodOptional<z.ZodNumber>;
181
+ maxLength: z.ZodOptional<z.ZodNumber>;
182
+ minValue: z.ZodOptional<z.ZodNumber>;
183
+ maxValue: z.ZodOptional<z.ZodNumber>;
184
+ format: z.ZodOptional<z.ZodString>;
185
+ customFormat: z.ZodOptional<z.ZodString>;
186
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
187
+ label: z.ZodString;
188
+ value: z.ZodString;
189
+ }, "strip", z.ZodTypeAny, {
190
+ value: string;
191
+ label: string;
192
+ }, {
193
+ value: string;
194
+ label: string;
195
+ }>, "many">>;
196
+ }, "strip", z.ZodTypeAny, {
197
+ options?: {
198
+ value: string;
199
+ label: string;
200
+ }[] | undefined;
201
+ minLength?: number | undefined;
202
+ maxLength?: number | undefined;
203
+ placeholder?: string | undefined;
204
+ minValue?: number | undefined;
205
+ maxValue?: number | undefined;
206
+ format?: string | undefined;
207
+ customFormat?: string | undefined;
208
+ }, {
209
+ options?: {
210
+ value: string;
211
+ label: string;
212
+ }[] | undefined;
213
+ minLength?: number | undefined;
214
+ maxLength?: number | undefined;
215
+ placeholder?: string | undefined;
216
+ minValue?: number | undefined;
217
+ maxValue?: number | undefined;
218
+ format?: string | undefined;
219
+ customFormat?: string | undefined;
220
+ }>>;
50
221
  }, "strip", z.ZodTypeAny, {
51
- key: string;
222
+ type: CustomProfileFieldType;
223
+ name: string;
52
224
  enabled: boolean;
225
+ label: string;
226
+ required: boolean;
227
+ description?: string | undefined;
228
+ config?: {
229
+ options?: {
230
+ value: string;
231
+ label: string;
232
+ }[] | undefined;
233
+ minLength?: number | undefined;
234
+ maxLength?: number | undefined;
235
+ placeholder?: string | undefined;
236
+ minValue?: number | undefined;
237
+ maxValue?: number | undefined;
238
+ format?: string | undefined;
239
+ customFormat?: string | undefined;
240
+ } | undefined;
53
241
  }, {
54
- key: string;
242
+ type: CustomProfileFieldType;
243
+ name: string;
55
244
  enabled: boolean;
245
+ label: string;
246
+ required: boolean;
247
+ description?: string | undefined;
248
+ config?: {
249
+ options?: {
250
+ value: string;
251
+ label: string;
252
+ }[] | undefined;
253
+ minLength?: number | undefined;
254
+ maxLength?: number | undefined;
255
+ placeholder?: string | undefined;
256
+ minValue?: number | undefined;
257
+ maxValue?: number | undefined;
258
+ format?: string | undefined;
259
+ customFormat?: string | undefined;
260
+ } | undefined;
56
261
  }>, "many">;
57
262
  export type FieldParts = z.infer<typeof fieldPartsGuard>;
58
263
  export declare const customProfileFieldConfigGuard: z.ZodObject<{
@@ -62,6 +267,7 @@ export declare const customProfileFieldConfigGuard: z.ZodObject<{
62
267
  minValue: z.ZodOptional<z.ZodNumber>;
63
268
  maxValue: z.ZodOptional<z.ZodNumber>;
64
269
  format: z.ZodOptional<z.ZodString>;
270
+ customFormat: z.ZodOptional<z.ZodString>;
65
271
  options: z.ZodOptional<z.ZodArray<z.ZodObject<{
66
272
  label: z.ZodString;
67
273
  value: z.ZodString;
@@ -72,15 +278,97 @@ export declare const customProfileFieldConfigGuard: z.ZodObject<{
72
278
  value: string;
73
279
  label: string;
74
280
  }>, "many">>;
281
+ } & {
75
282
  parts: z.ZodOptional<z.ZodArray<z.ZodObject<{
76
- key: z.ZodString;
77
283
  enabled: z.ZodBoolean;
284
+ name: z.ZodString;
285
+ type: z.ZodNativeEnum<typeof CustomProfileFieldType>;
286
+ label: z.ZodString;
287
+ description: z.ZodOptional<z.ZodString>;
288
+ required: z.ZodBoolean;
289
+ config: z.ZodOptional<z.ZodObject<{
290
+ placeholder: z.ZodOptional<z.ZodString>;
291
+ minLength: z.ZodOptional<z.ZodNumber>;
292
+ maxLength: z.ZodOptional<z.ZodNumber>;
293
+ minValue: z.ZodOptional<z.ZodNumber>;
294
+ maxValue: z.ZodOptional<z.ZodNumber>;
295
+ format: z.ZodOptional<z.ZodString>;
296
+ customFormat: z.ZodOptional<z.ZodString>;
297
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
298
+ label: z.ZodString;
299
+ value: z.ZodString;
300
+ }, "strip", z.ZodTypeAny, {
301
+ value: string;
302
+ label: string;
303
+ }, {
304
+ value: string;
305
+ label: string;
306
+ }>, "many">>;
307
+ }, "strip", z.ZodTypeAny, {
308
+ options?: {
309
+ value: string;
310
+ label: string;
311
+ }[] | undefined;
312
+ minLength?: number | undefined;
313
+ maxLength?: number | undefined;
314
+ placeholder?: string | undefined;
315
+ minValue?: number | undefined;
316
+ maxValue?: number | undefined;
317
+ format?: string | undefined;
318
+ customFormat?: string | undefined;
319
+ }, {
320
+ options?: {
321
+ value: string;
322
+ label: string;
323
+ }[] | undefined;
324
+ minLength?: number | undefined;
325
+ maxLength?: number | undefined;
326
+ placeholder?: string | undefined;
327
+ minValue?: number | undefined;
328
+ maxValue?: number | undefined;
329
+ format?: string | undefined;
330
+ customFormat?: string | undefined;
331
+ }>>;
78
332
  }, "strip", z.ZodTypeAny, {
79
- key: string;
333
+ type: CustomProfileFieldType;
334
+ name: string;
80
335
  enabled: boolean;
336
+ label: string;
337
+ required: boolean;
338
+ description?: string | undefined;
339
+ config?: {
340
+ options?: {
341
+ value: string;
342
+ label: string;
343
+ }[] | undefined;
344
+ minLength?: number | undefined;
345
+ maxLength?: number | undefined;
346
+ placeholder?: string | undefined;
347
+ minValue?: number | undefined;
348
+ maxValue?: number | undefined;
349
+ format?: string | undefined;
350
+ customFormat?: string | undefined;
351
+ } | undefined;
81
352
  }, {
82
- key: string;
353
+ type: CustomProfileFieldType;
354
+ name: string;
83
355
  enabled: boolean;
356
+ label: string;
357
+ required: boolean;
358
+ description?: string | undefined;
359
+ config?: {
360
+ options?: {
361
+ value: string;
362
+ label: string;
363
+ }[] | undefined;
364
+ minLength?: number | undefined;
365
+ maxLength?: number | undefined;
366
+ placeholder?: string | undefined;
367
+ minValue?: number | undefined;
368
+ maxValue?: number | undefined;
369
+ format?: string | undefined;
370
+ customFormat?: string | undefined;
371
+ } | undefined;
84
372
  }>, "many">>;
85
373
  }, "strip", z.ZodTypeAny, {
86
374
  options?: {
@@ -93,9 +381,27 @@ export declare const customProfileFieldConfigGuard: z.ZodObject<{
93
381
  minValue?: number | undefined;
94
382
  maxValue?: number | undefined;
95
383
  format?: string | undefined;
384
+ customFormat?: string | undefined;
96
385
  parts?: {
97
- key: string;
386
+ type: CustomProfileFieldType;
387
+ name: string;
98
388
  enabled: boolean;
389
+ label: string;
390
+ required: boolean;
391
+ description?: string | undefined;
392
+ config?: {
393
+ options?: {
394
+ value: string;
395
+ label: string;
396
+ }[] | undefined;
397
+ minLength?: number | undefined;
398
+ maxLength?: number | undefined;
399
+ placeholder?: string | undefined;
400
+ minValue?: number | undefined;
401
+ maxValue?: number | undefined;
402
+ format?: string | undefined;
403
+ customFormat?: string | undefined;
404
+ } | undefined;
99
405
  }[] | undefined;
100
406
  }, {
101
407
  options?: {
@@ -108,9 +414,28 @@ export declare const customProfileFieldConfigGuard: z.ZodObject<{
108
414
  minValue?: number | undefined;
109
415
  maxValue?: number | undefined;
110
416
  format?: string | undefined;
417
+ customFormat?: string | undefined;
111
418
  parts?: {
112
- key: string;
419
+ type: CustomProfileFieldType;
420
+ name: string;
113
421
  enabled: boolean;
422
+ label: string;
423
+ required: boolean;
424
+ description?: string | undefined;
425
+ config?: {
426
+ options?: {
427
+ value: string;
428
+ label: string;
429
+ }[] | undefined;
430
+ minLength?: number | undefined;
431
+ maxLength?: number | undefined;
432
+ placeholder?: string | undefined;
433
+ minValue?: number | undefined;
434
+ maxValue?: number | undefined;
435
+ format?: string | undefined;
436
+ customFormat?: string | undefined;
437
+ } | undefined;
114
438
  }[] | undefined;
115
439
  }>;
440
+ export type CustomProfileFieldBaseConfig = z.infer<typeof baseConfigGuard>;
116
441
  export type CustomProfileFieldConfig = z.infer<typeof customProfileFieldConfigGuard>;
@@ -19,18 +19,26 @@ export const fieldOptionGuard = z.object({
19
19
  value: z.string(),
20
20
  });
21
21
  export const fieldOptionsGuard = fieldOptionGuard.array();
22
+ export const baseConfigGuard = z.object({
23
+ placeholder: z.string().max(256).optional(),
24
+ minLength: z.number().int().min(0).optional(),
25
+ maxLength: z.number().int().min(0).optional(),
26
+ minValue: z.number().int().min(0).optional(),
27
+ maxValue: z.number().int().min(0).optional(),
28
+ format: z.string().max(128).optional(),
29
+ customFormat: z.string().max(128).optional(),
30
+ options: fieldOptionsGuard.optional(),
31
+ });
22
32
  export const fieldPartGuard = z.object({
23
- key: z.string(),
24
33
  enabled: z.boolean(),
34
+ name: z.string(),
35
+ type: customProfileFieldTypeGuard,
36
+ label: z.string(),
37
+ description: z.string().optional(),
38
+ required: z.boolean(),
39
+ config: baseConfigGuard.optional(),
25
40
  });
26
41
  export const fieldPartsGuard = fieldPartGuard.array();
27
- export const customProfileFieldConfigGuard = z.object({
28
- placeholder: z.string().max(256).optional(),
29
- minLength: z.number().int().optional(),
30
- maxLength: z.number().int().optional(),
31
- minValue: z.number().int().optional(),
32
- maxValue: z.number().int().optional(),
33
- format: z.string().max(128).optional(),
34
- options: fieldOptionsGuard.optional(),
42
+ export const customProfileFieldConfigGuard = baseConfigGuard.extend({
35
43
  parts: fieldPartsGuard.optional(),
36
44
  });
@@ -7,3 +7,5 @@ export declare enum SecretType {
7
7
  FederatedTokenSet = "federated_token_set"
8
8
  }
9
9
  export declare const secretTypeGuard: z.ZodNativeEnum<typeof SecretType>;
10
+ export type BufferLike = Buffer;
11
+ export declare const bufferLikeGuard: z.ZodType<Buffer, z.ZodTypeDef, Buffer>;
@@ -8,3 +8,8 @@ export var SecretType;
8
8
  SecretType["FederatedTokenSet"] = "federated_token_set";
9
9
  })(SecretType || (SecretType = {}));
10
10
  export const secretTypeGuard = z.nativeEnum(SecretType);
11
+ export const bufferLikeGuard = z.custom((value) => {
12
+ return Buffer.isBuffer(value);
13
+ }, {
14
+ message: 'Invalid Buffer instance',
15
+ });
@@ -214,7 +214,9 @@ export type CustomContent = z.infer<typeof customContentGuard>;
214
214
  export declare enum MfaFactor {
215
215
  TOTP = "Totp",
216
216
  WebAuthn = "WebAuthn",
217
- BackupCode = "BackupCode"
217
+ BackupCode = "BackupCode",
218
+ EmailVerificationCode = "EmailVerificationCode",
219
+ PhoneVerificationCode = "PhoneVerificationCode"
218
220
  }
219
221
  export declare const mfaFactorsGuard: z.ZodArray<z.ZodNativeEnum<typeof MfaFactor>, "many">;
220
222
  export type MfaFactors = z.infer<typeof mfaFactorsGuard>;
@@ -72,6 +72,8 @@ export var MfaFactor;
72
72
  MfaFactor["TOTP"] = "Totp";
73
73
  MfaFactor["WebAuthn"] = "WebAuthn";
74
74
  MfaFactor["BackupCode"] = "BackupCode";
75
+ MfaFactor["EmailVerificationCode"] = "EmailVerificationCode";
76
+ MfaFactor["PhoneVerificationCode"] = "PhoneVerificationCode";
75
77
  })(MfaFactor || (MfaFactor = {}));
76
78
  export const mfaFactorsGuard = z.nativeEnum(MfaFactor).array();
77
79
  export var MfaPolicy;