@logto/schemas 1.40.1 → 1.42.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 (111) hide show
  1. package/alterations/1.41.0-1779864280-add-password-expiration-policy.ts +23 -0
  2. package/alterations/1.41.0-1779864281-add-is-password-expired-to-users.ts +18 -0
  3. package/alterations/1.41.0-1780358400-drop-oidc-model-instances-legacy-grant-id-index.ts +25 -0
  4. package/alterations/1.41.0-1780381219-add-username-policy.ts +41 -0
  5. package/alterations/1.41.0-1780643665-set-sign-up-profile-fields-default.ts +20 -0
  6. package/alterations/1.41.0-1780906060-add-verification-code-policy.ts +19 -0
  7. package/alterations/1.41.0-1781689400-add-sentinel-activities-created-at-index.ts +25 -0
  8. package/alterations/1.41.0-1782354362-set-admin-account-center-profile-fields.ts +28 -0
  9. package/alterations/1.41.0-1782375106-cover-service-logs-tenant-type-index-with-created-at.ts +36 -0
  10. package/alterations/1.42.0-1783916980-add-domain-verification-files.ts +20 -0
  11. package/alterations/1.42.0-1784619793-add-service-logs-created-at-index.ts +33 -0
  12. package/alterations/1.42.0-1784620000-add-saml-sso-connector-signing-keys-table.ts +38 -0
  13. package/alterations/utils/1704934999-tables.ts +22 -1
  14. package/alterations-js/1.41.0-1779864280-add-password-expiration-policy.js +19 -0
  15. package/alterations-js/1.41.0-1779864281-add-is-password-expired-to-users.js +14 -0
  16. package/alterations-js/1.41.0-1780358400-drop-oidc-model-instances-legacy-grant-id-index.js +21 -0
  17. package/alterations-js/1.41.0-1780381219-add-username-policy.js +37 -0
  18. package/alterations-js/1.41.0-1780643665-set-sign-up-profile-fields-default.js +16 -0
  19. package/alterations-js/1.41.0-1780906060-add-verification-code-policy.js +15 -0
  20. package/alterations-js/1.41.0-1781689400-add-sentinel-activities-created-at-index.js +21 -0
  21. package/alterations-js/1.41.0-1782354362-set-admin-account-center-profile-fields.js +23 -0
  22. package/alterations-js/1.41.0-1782375106-cover-service-logs-tenant-type-index-with-created-at.js +32 -0
  23. package/alterations-js/1.42.0-1783916980-add-domain-verification-files.js +16 -0
  24. package/alterations-js/1.42.0-1784619793-add-service-logs-created-at-index.js +29 -0
  25. package/alterations-js/1.42.0-1784620000-add-saml-sso-connector-signing-keys-table.js +33 -0
  26. package/alterations-js/utils/1704934999-tables.js +19 -1
  27. package/lib/consts/experience.d.ts +3 -0
  28. package/lib/consts/experience.js +3 -0
  29. package/lib/consts/index.d.ts +2 -0
  30. package/lib/consts/index.js +2 -0
  31. package/lib/consts/message-rate-limit.d.ts +65 -0
  32. package/lib/consts/message-rate-limit.js +29 -0
  33. package/lib/consts/message-rate-limit.test.d.ts +1 -0
  34. package/lib/consts/message-rate-limit.test.js +20 -0
  35. package/lib/consts/verification-code.d.ts +10 -0
  36. package/lib/consts/verification-code.js +10 -0
  37. package/lib/db-entries/domain.d.ts +4 -2
  38. package/lib/db-entries/domain.js +5 -1
  39. package/lib/db-entries/index.d.ts +1 -0
  40. package/lib/db-entries/index.js +1 -0
  41. package/lib/db-entries/saml-sso-connector-signing-key.d.ts +32 -0
  42. package/lib/db-entries/saml-sso-connector-signing-key.js +49 -0
  43. package/lib/db-entries/sign-in-experience.d.ts +10 -4
  44. package/lib/db-entries/sign-in-experience.js +13 -1
  45. package/lib/db-entries/user.d.ts +5 -1
  46. package/lib/db-entries/user.js +8 -0
  47. package/lib/foundations/jsonb-types/account-centers.d.ts +3 -0
  48. package/lib/foundations/jsonb-types/account-centers.js +1 -0
  49. package/lib/foundations/jsonb-types/custom-domain.d.ts +57 -0
  50. package/lib/foundations/jsonb-types/custom-domain.js +51 -0
  51. package/lib/foundations/jsonb-types/custom-domain.test.d.ts +1 -0
  52. package/lib/foundations/jsonb-types/custom-domain.test.js +38 -0
  53. package/lib/foundations/jsonb-types/hooks.d.ts +4 -4
  54. package/lib/foundations/jsonb-types/hooks.js +2 -0
  55. package/lib/foundations/jsonb-types/one-time-tokens.d.ts +5 -0
  56. package/lib/foundations/jsonb-types/one-time-tokens.js +2 -0
  57. package/lib/foundations/jsonb-types/sentinel.d.ts +16 -1
  58. package/lib/foundations/jsonb-types/sentinel.js +15 -0
  59. package/lib/foundations/jsonb-types/sign-in-experience.d.ts +90 -3
  60. package/lib/foundations/jsonb-types/sign-in-experience.js +20 -0
  61. package/lib/foundations/jsonb-types/sign-in-experience.test.js +49 -1
  62. package/lib/foundations/jsonb-types/users.d.ts +9 -0
  63. package/lib/foundations/jsonb-types/users.js +1 -0
  64. package/lib/seeds/account-center.js +1 -0
  65. package/lib/seeds/sign-in-experience.js +1 -0
  66. package/lib/seeds/sign-in-experience.test.js +5 -1
  67. package/lib/types/application.d.ts +131 -1
  68. package/lib/types/application.js +8 -0
  69. package/lib/types/consent.d.ts +8 -0
  70. package/lib/types/custom-profile-fields.d.ts +5 -1
  71. package/lib/types/domain.d.ts +9 -0
  72. package/lib/types/hook.d.ts +9 -2
  73. package/lib/types/interaction-event.d.ts +11 -0
  74. package/lib/types/interaction-event.js +12 -0
  75. package/lib/types/interactions.d.ts +2 -11
  76. package/lib/types/interactions.js +5 -12
  77. package/lib/types/log/action.d.ts +7 -0
  78. package/lib/types/log/action.js +6 -0
  79. package/lib/types/log/index.d.ts +5 -2
  80. package/lib/types/log/index.js +1 -0
  81. package/lib/types/logto-config/action.d.ts +963 -0
  82. package/lib/types/logto-config/action.js +77 -0
  83. package/lib/types/logto-config/index.d.ts +91 -13
  84. package/lib/types/logto-config/index.js +12 -0
  85. package/lib/types/logto-config/index.test.js +25 -1
  86. package/lib/types/logto-config/jwt-customizer.d.ts +162 -1
  87. package/lib/types/logto-config/jwt-customizer.js +14 -0
  88. package/lib/types/organization.d.ts +136 -1
  89. package/lib/types/organization.js +3 -2
  90. package/lib/types/saml-application.d.ts +3 -0
  91. package/lib/types/saml-application.js +3 -0
  92. package/lib/types/sign-in-experience.d.ts +11 -4
  93. package/lib/types/sign-in-experience.js +1 -1
  94. package/lib/types/sso-connector.d.ts +58 -0
  95. package/lib/types/sso-connector.js +12 -0
  96. package/lib/types/ssr.d.ts +11 -0
  97. package/lib/types/user-assets.d.ts +10 -0
  98. package/lib/types/user-assets.js +17 -0
  99. package/lib/types/user-sessions.d.ts +309 -34
  100. package/lib/types/user-sessions.js +5 -0
  101. package/lib/types/user.d.ts +15 -0
  102. package/lib/types/user.js +1 -0
  103. package/lib/types/verification-records/one-time-token-verification.d.ts +5 -0
  104. package/package.json +8 -8
  105. package/tables/domains.sql +1 -0
  106. package/tables/oidc_model_instances.sql +0 -8
  107. package/tables/saml_sso_connector_signing_keys.sql +21 -0
  108. package/tables/sentinel_activities.sql +4 -0
  109. package/tables/service_logs.sql +7 -2
  110. package/tables/sign_in_experiences.sql +15 -2
  111. package/tables/users.sql +7 -0
@@ -0,0 +1,963 @@
1
+ import { z } from 'zod';
2
+ import type { Json } from '../../foundations/index.js';
3
+ import { InteractionEvent, type InteractionIdentifier } from '../interactions.js';
4
+ import { type UserInfo } from '../user.js';
5
+ import { VerificationType } from '../verification-records/index.js';
6
+ import type { JwtCustomizerUserContext } from './jwt-customizer.js';
7
+ /** Values map to config key names in `logto_configs`. */
8
+ export declare enum LogtoActionKey {
9
+ PostFirstFactorVerification = "action.postFirstFactorVerification",
10
+ PostSignIn = "action.postSignIn"
11
+ }
12
+ export declare const actionExecutionErrorPolicies: readonly ["block", "allow"];
13
+ export type ActionExecutionErrorPolicy = (typeof actionExecutionErrorPolicies)[number];
14
+ export type LogtoAction = {
15
+ script: string;
16
+ environmentVariables?: Record<string, string>;
17
+ contextSample?: Json;
18
+ enabled?: boolean;
19
+ onExecutionError?: ActionExecutionErrorPolicy;
20
+ };
21
+ export declare const logtoActionGuard: z.ZodObject<{
22
+ script: z.ZodString;
23
+ environmentVariables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
24
+ contextSample: z.ZodOptional<z.ZodType<Json, z.ZodTypeDef, Json>>;
25
+ enabled: z.ZodOptional<z.ZodBoolean>;
26
+ onExecutionError: z.ZodOptional<z.ZodEnum<["block", "allow"]>>;
27
+ }, "strict", z.ZodTypeAny, {
28
+ script: string;
29
+ enabled?: boolean | undefined;
30
+ environmentVariables?: Record<string, string> | undefined;
31
+ contextSample?: Json | undefined;
32
+ onExecutionError?: "block" | "allow" | undefined;
33
+ }, {
34
+ script: string;
35
+ enabled?: boolean | undefined;
36
+ environmentVariables?: Record<string, string> | undefined;
37
+ contextSample?: Json | undefined;
38
+ onExecutionError?: "block" | "allow" | undefined;
39
+ }>;
40
+ /**
41
+ * Shared execution payload for production Actions and Management API dry runs.
42
+ * Cloud remote execution and the local VM runner both accept this shape.
43
+ */
44
+ export declare const actionExecutionRequestBodyGuard: z.ZodObject<{
45
+ script: z.ZodString;
46
+ actionType: z.ZodNativeEnum<typeof LogtoActionKey>;
47
+ event: z.ZodType<Json, z.ZodTypeDef, Json>;
48
+ environmentVariables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
49
+ }, "strict", z.ZodTypeAny, {
50
+ event: Json;
51
+ script: string;
52
+ actionType: LogtoActionKey;
53
+ environmentVariables?: Record<string, string> | undefined;
54
+ }, {
55
+ event: Json;
56
+ script: string;
57
+ actionType: LogtoActionKey;
58
+ environmentVariables?: Record<string, string> | undefined;
59
+ }>;
60
+ export type ActionExecutionRequestBody = z.infer<typeof actionExecutionRequestBodyGuard>;
61
+ export type ActionUser = Pick<UserInfo, 'id' | 'username' | 'primaryEmail' | 'primaryPhone' | 'name' | 'avatar' | 'customData' | 'profile'>;
62
+ export declare const actionUserPatchGuard: z.ZodObject<{
63
+ name: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
64
+ username: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
65
+ profile: z.ZodOptional<z.ZodType<Partial<{
66
+ familyName: string;
67
+ givenName: string;
68
+ middleName: string;
69
+ nickname: string;
70
+ preferredUsername: string;
71
+ profile: string;
72
+ website: string;
73
+ gender: string;
74
+ birthdate: string;
75
+ zoneinfo: string;
76
+ locale: string;
77
+ address: Partial<{
78
+ formatted: string;
79
+ streetAddress: string;
80
+ locality: string;
81
+ region: string;
82
+ postalCode: string;
83
+ country: string;
84
+ }>;
85
+ }>, z.ZodTypeDef, Partial<{
86
+ familyName: string;
87
+ givenName: string;
88
+ middleName: string;
89
+ nickname: string;
90
+ preferredUsername: string;
91
+ profile: string;
92
+ website: string;
93
+ gender: string;
94
+ birthdate: string;
95
+ zoneinfo: string;
96
+ locale: string;
97
+ address: Partial<{
98
+ formatted: string;
99
+ streetAddress: string;
100
+ locality: string;
101
+ region: string;
102
+ postalCode: string;
103
+ country: string;
104
+ }>;
105
+ }>>>;
106
+ avatar: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
107
+ customData: z.ZodOptional<z.ZodType<import("@withtyped/server/lib/types.js").JsonObject, z.ZodTypeDef, import("@withtyped/server/lib/types.js").JsonObject>>;
108
+ primaryEmail: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
109
+ primaryPhone: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
110
+ }, "strip", z.ZodTypeAny, {
111
+ name?: string | null | undefined;
112
+ username?: string | null | undefined;
113
+ profile?: Partial<{
114
+ familyName: string;
115
+ givenName: string;
116
+ middleName: string;
117
+ nickname: string;
118
+ preferredUsername: string;
119
+ profile: string;
120
+ website: string;
121
+ gender: string;
122
+ birthdate: string;
123
+ zoneinfo: string;
124
+ locale: string;
125
+ address: Partial<{
126
+ formatted: string;
127
+ streetAddress: string;
128
+ locality: string;
129
+ region: string;
130
+ postalCode: string;
131
+ country: string;
132
+ }>;
133
+ }> | undefined;
134
+ avatar?: string | null | undefined;
135
+ customData?: import("@withtyped/server/lib/types.js").JsonObject | undefined;
136
+ primaryEmail?: string | null | undefined;
137
+ primaryPhone?: string | null | undefined;
138
+ }, {
139
+ name?: string | null | undefined;
140
+ username?: string | null | undefined;
141
+ profile?: Partial<{
142
+ familyName: string;
143
+ givenName: string;
144
+ middleName: string;
145
+ nickname: string;
146
+ preferredUsername: string;
147
+ profile: string;
148
+ website: string;
149
+ gender: string;
150
+ birthdate: string;
151
+ zoneinfo: string;
152
+ locale: string;
153
+ address: Partial<{
154
+ formatted: string;
155
+ streetAddress: string;
156
+ locality: string;
157
+ region: string;
158
+ postalCode: string;
159
+ country: string;
160
+ }>;
161
+ }> | undefined;
162
+ avatar?: string | null | undefined;
163
+ customData?: import("@withtyped/server/lib/types.js").JsonObject | undefined;
164
+ primaryEmail?: string | null | undefined;
165
+ primaryPhone?: string | null | undefined;
166
+ }>;
167
+ export type ActionUserPatch = z.infer<typeof actionUserPatchGuard>;
168
+ export type PostFirstFactorVerificationEvent = {
169
+ key: LogtoActionKey.PostFirstFactorVerification;
170
+ interactionEvent: InteractionEvent.SignIn;
171
+ verificationType: VerificationType.Password;
172
+ identifier: InteractionIdentifier;
173
+ user: ActionUser | null;
174
+ /** Sensitive credential provided for Action-controlled password verification. */
175
+ password: string;
176
+ };
177
+ export type PostSignInEvent = {
178
+ key: LogtoActionKey.PostSignIn;
179
+ interactionEvent: InteractionEvent.SignIn;
180
+ user: JwtCustomizerUserContext;
181
+ };
182
+ export declare const postFirstFactorVerificationResultGuard: z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
183
+ action: z.ZodLiteral<"createUser">;
184
+ user: z.ZodObject<{
185
+ name: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
186
+ username: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
187
+ profile: z.ZodOptional<z.ZodType<Partial<{
188
+ familyName: string;
189
+ givenName: string;
190
+ middleName: string;
191
+ nickname: string;
192
+ preferredUsername: string;
193
+ profile: string;
194
+ website: string;
195
+ gender: string;
196
+ birthdate: string;
197
+ zoneinfo: string;
198
+ locale: string;
199
+ address: Partial<{
200
+ formatted: string;
201
+ streetAddress: string;
202
+ locality: string;
203
+ region: string;
204
+ postalCode: string;
205
+ country: string;
206
+ }>;
207
+ }>, z.ZodTypeDef, Partial<{
208
+ familyName: string;
209
+ givenName: string;
210
+ middleName: string;
211
+ nickname: string;
212
+ preferredUsername: string;
213
+ profile: string;
214
+ website: string;
215
+ gender: string;
216
+ birthdate: string;
217
+ zoneinfo: string;
218
+ locale: string;
219
+ address: Partial<{
220
+ formatted: string;
221
+ streetAddress: string;
222
+ locality: string;
223
+ region: string;
224
+ postalCode: string;
225
+ country: string;
226
+ }>;
227
+ }>>>;
228
+ avatar: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
229
+ customData: z.ZodOptional<z.ZodType<import("@withtyped/server/lib/types.js").JsonObject, z.ZodTypeDef, import("@withtyped/server/lib/types.js").JsonObject>>;
230
+ primaryEmail: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
231
+ primaryPhone: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
232
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
233
+ name: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
234
+ username: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
235
+ profile: z.ZodOptional<z.ZodType<Partial<{
236
+ familyName: string;
237
+ givenName: string;
238
+ middleName: string;
239
+ nickname: string;
240
+ preferredUsername: string;
241
+ profile: string;
242
+ website: string;
243
+ gender: string;
244
+ birthdate: string;
245
+ zoneinfo: string;
246
+ locale: string;
247
+ address: Partial<{
248
+ formatted: string;
249
+ streetAddress: string;
250
+ locality: string;
251
+ region: string;
252
+ postalCode: string;
253
+ country: string;
254
+ }>;
255
+ }>, z.ZodTypeDef, Partial<{
256
+ familyName: string;
257
+ givenName: string;
258
+ middleName: string;
259
+ nickname: string;
260
+ preferredUsername: string;
261
+ profile: string;
262
+ website: string;
263
+ gender: string;
264
+ birthdate: string;
265
+ zoneinfo: string;
266
+ locale: string;
267
+ address: Partial<{
268
+ formatted: string;
269
+ streetAddress: string;
270
+ locality: string;
271
+ region: string;
272
+ postalCode: string;
273
+ country: string;
274
+ }>;
275
+ }>>>;
276
+ avatar: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
277
+ customData: z.ZodOptional<z.ZodType<import("@withtyped/server/lib/types.js").JsonObject, z.ZodTypeDef, import("@withtyped/server/lib/types.js").JsonObject>>;
278
+ primaryEmail: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
279
+ primaryPhone: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
280
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
281
+ name: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
282
+ username: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
283
+ profile: z.ZodOptional<z.ZodType<Partial<{
284
+ familyName: string;
285
+ givenName: string;
286
+ middleName: string;
287
+ nickname: string;
288
+ preferredUsername: string;
289
+ profile: string;
290
+ website: string;
291
+ gender: string;
292
+ birthdate: string;
293
+ zoneinfo: string;
294
+ locale: string;
295
+ address: Partial<{
296
+ formatted: string;
297
+ streetAddress: string;
298
+ locality: string;
299
+ region: string;
300
+ postalCode: string;
301
+ country: string;
302
+ }>;
303
+ }>, z.ZodTypeDef, Partial<{
304
+ familyName: string;
305
+ givenName: string;
306
+ middleName: string;
307
+ nickname: string;
308
+ preferredUsername: string;
309
+ profile: string;
310
+ website: string;
311
+ gender: string;
312
+ birthdate: string;
313
+ zoneinfo: string;
314
+ locale: string;
315
+ address: Partial<{
316
+ formatted: string;
317
+ streetAddress: string;
318
+ locality: string;
319
+ region: string;
320
+ postalCode: string;
321
+ country: string;
322
+ }>;
323
+ }>>>;
324
+ avatar: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
325
+ customData: z.ZodOptional<z.ZodType<import("@withtyped/server/lib/types.js").JsonObject, z.ZodTypeDef, import("@withtyped/server/lib/types.js").JsonObject>>;
326
+ primaryEmail: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
327
+ primaryPhone: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
328
+ }, z.ZodTypeAny, "passthrough">>;
329
+ passwordVerified: z.ZodLiteral<true>;
330
+ }, "strip", z.ZodTypeAny, {
331
+ action: "createUser";
332
+ user: {
333
+ name?: string | null | undefined;
334
+ username?: string | null | undefined;
335
+ profile?: Partial<{
336
+ familyName: string;
337
+ givenName: string;
338
+ middleName: string;
339
+ nickname: string;
340
+ preferredUsername: string;
341
+ profile: string;
342
+ website: string;
343
+ gender: string;
344
+ birthdate: string;
345
+ zoneinfo: string;
346
+ locale: string;
347
+ address: Partial<{
348
+ formatted: string;
349
+ streetAddress: string;
350
+ locality: string;
351
+ region: string;
352
+ postalCode: string;
353
+ country: string;
354
+ }>;
355
+ }> | undefined;
356
+ avatar?: string | null | undefined;
357
+ customData?: import("@withtyped/server/lib/types.js").JsonObject | undefined;
358
+ primaryEmail?: string | null | undefined;
359
+ primaryPhone?: string | null | undefined;
360
+ } & {
361
+ [k: string]: unknown;
362
+ };
363
+ passwordVerified: true;
364
+ }, {
365
+ action: "createUser";
366
+ user: {
367
+ name?: string | null | undefined;
368
+ username?: string | null | undefined;
369
+ profile?: Partial<{
370
+ familyName: string;
371
+ givenName: string;
372
+ middleName: string;
373
+ nickname: string;
374
+ preferredUsername: string;
375
+ profile: string;
376
+ website: string;
377
+ gender: string;
378
+ birthdate: string;
379
+ zoneinfo: string;
380
+ locale: string;
381
+ address: Partial<{
382
+ formatted: string;
383
+ streetAddress: string;
384
+ locality: string;
385
+ region: string;
386
+ postalCode: string;
387
+ country: string;
388
+ }>;
389
+ }> | undefined;
390
+ avatar?: string | null | undefined;
391
+ customData?: import("@withtyped/server/lib/types.js").JsonObject | undefined;
392
+ primaryEmail?: string | null | undefined;
393
+ primaryPhone?: string | null | undefined;
394
+ } & {
395
+ [k: string]: unknown;
396
+ };
397
+ passwordVerified: true;
398
+ }>, z.ZodObject<{
399
+ action: z.ZodLiteral<"updateUser">;
400
+ user: z.ZodObject<{
401
+ name: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
402
+ username: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
403
+ profile: z.ZodOptional<z.ZodType<Partial<{
404
+ familyName: string;
405
+ givenName: string;
406
+ middleName: string;
407
+ nickname: string;
408
+ preferredUsername: string;
409
+ profile: string;
410
+ website: string;
411
+ gender: string;
412
+ birthdate: string;
413
+ zoneinfo: string;
414
+ locale: string;
415
+ address: Partial<{
416
+ formatted: string;
417
+ streetAddress: string;
418
+ locality: string;
419
+ region: string;
420
+ postalCode: string;
421
+ country: string;
422
+ }>;
423
+ }>, z.ZodTypeDef, Partial<{
424
+ familyName: string;
425
+ givenName: string;
426
+ middleName: string;
427
+ nickname: string;
428
+ preferredUsername: string;
429
+ profile: string;
430
+ website: string;
431
+ gender: string;
432
+ birthdate: string;
433
+ zoneinfo: string;
434
+ locale: string;
435
+ address: Partial<{
436
+ formatted: string;
437
+ streetAddress: string;
438
+ locality: string;
439
+ region: string;
440
+ postalCode: string;
441
+ country: string;
442
+ }>;
443
+ }>>>;
444
+ avatar: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
445
+ customData: z.ZodOptional<z.ZodType<import("@withtyped/server/lib/types.js").JsonObject, z.ZodTypeDef, import("@withtyped/server/lib/types.js").JsonObject>>;
446
+ primaryEmail: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
447
+ primaryPhone: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
448
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
449
+ name: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
450
+ username: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
451
+ profile: z.ZodOptional<z.ZodType<Partial<{
452
+ familyName: string;
453
+ givenName: string;
454
+ middleName: string;
455
+ nickname: string;
456
+ preferredUsername: string;
457
+ profile: string;
458
+ website: string;
459
+ gender: string;
460
+ birthdate: string;
461
+ zoneinfo: string;
462
+ locale: string;
463
+ address: Partial<{
464
+ formatted: string;
465
+ streetAddress: string;
466
+ locality: string;
467
+ region: string;
468
+ postalCode: string;
469
+ country: string;
470
+ }>;
471
+ }>, z.ZodTypeDef, Partial<{
472
+ familyName: string;
473
+ givenName: string;
474
+ middleName: string;
475
+ nickname: string;
476
+ preferredUsername: string;
477
+ profile: string;
478
+ website: string;
479
+ gender: string;
480
+ birthdate: string;
481
+ zoneinfo: string;
482
+ locale: string;
483
+ address: Partial<{
484
+ formatted: string;
485
+ streetAddress: string;
486
+ locality: string;
487
+ region: string;
488
+ postalCode: string;
489
+ country: string;
490
+ }>;
491
+ }>>>;
492
+ avatar: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
493
+ customData: z.ZodOptional<z.ZodType<import("@withtyped/server/lib/types.js").JsonObject, z.ZodTypeDef, import("@withtyped/server/lib/types.js").JsonObject>>;
494
+ primaryEmail: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
495
+ primaryPhone: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
496
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
497
+ name: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
498
+ username: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
499
+ profile: z.ZodOptional<z.ZodType<Partial<{
500
+ familyName: string;
501
+ givenName: string;
502
+ middleName: string;
503
+ nickname: string;
504
+ preferredUsername: string;
505
+ profile: string;
506
+ website: string;
507
+ gender: string;
508
+ birthdate: string;
509
+ zoneinfo: string;
510
+ locale: string;
511
+ address: Partial<{
512
+ formatted: string;
513
+ streetAddress: string;
514
+ locality: string;
515
+ region: string;
516
+ postalCode: string;
517
+ country: string;
518
+ }>;
519
+ }>, z.ZodTypeDef, Partial<{
520
+ familyName: string;
521
+ givenName: string;
522
+ middleName: string;
523
+ nickname: string;
524
+ preferredUsername: string;
525
+ profile: string;
526
+ website: string;
527
+ gender: string;
528
+ birthdate: string;
529
+ zoneinfo: string;
530
+ locale: string;
531
+ address: Partial<{
532
+ formatted: string;
533
+ streetAddress: string;
534
+ locality: string;
535
+ region: string;
536
+ postalCode: string;
537
+ country: string;
538
+ }>;
539
+ }>>>;
540
+ avatar: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
541
+ customData: z.ZodOptional<z.ZodType<import("@withtyped/server/lib/types.js").JsonObject, z.ZodTypeDef, import("@withtyped/server/lib/types.js").JsonObject>>;
542
+ primaryEmail: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
543
+ primaryPhone: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
544
+ }, z.ZodTypeAny, "passthrough">>;
545
+ passwordVerified: z.ZodLiteral<true>;
546
+ }, "strip", z.ZodTypeAny, {
547
+ action: "updateUser";
548
+ user: {
549
+ name?: string | null | undefined;
550
+ username?: string | null | undefined;
551
+ profile?: Partial<{
552
+ familyName: string;
553
+ givenName: string;
554
+ middleName: string;
555
+ nickname: string;
556
+ preferredUsername: string;
557
+ profile: string;
558
+ website: string;
559
+ gender: string;
560
+ birthdate: string;
561
+ zoneinfo: string;
562
+ locale: string;
563
+ address: Partial<{
564
+ formatted: string;
565
+ streetAddress: string;
566
+ locality: string;
567
+ region: string;
568
+ postalCode: string;
569
+ country: string;
570
+ }>;
571
+ }> | undefined;
572
+ avatar?: string | null | undefined;
573
+ customData?: import("@withtyped/server/lib/types.js").JsonObject | undefined;
574
+ primaryEmail?: string | null | undefined;
575
+ primaryPhone?: string | null | undefined;
576
+ } & {
577
+ [k: string]: unknown;
578
+ };
579
+ passwordVerified: true;
580
+ }, {
581
+ action: "updateUser";
582
+ user: {
583
+ name?: string | null | undefined;
584
+ username?: string | null | undefined;
585
+ profile?: Partial<{
586
+ familyName: string;
587
+ givenName: string;
588
+ middleName: string;
589
+ nickname: string;
590
+ preferredUsername: string;
591
+ profile: string;
592
+ website: string;
593
+ gender: string;
594
+ birthdate: string;
595
+ zoneinfo: string;
596
+ locale: string;
597
+ address: Partial<{
598
+ formatted: string;
599
+ streetAddress: string;
600
+ locality: string;
601
+ region: string;
602
+ postalCode: string;
603
+ country: string;
604
+ }>;
605
+ }> | undefined;
606
+ avatar?: string | null | undefined;
607
+ customData?: import("@withtyped/server/lib/types.js").JsonObject | undefined;
608
+ primaryEmail?: string | null | undefined;
609
+ primaryPhone?: string | null | undefined;
610
+ } & {
611
+ [k: string]: unknown;
612
+ };
613
+ passwordVerified: true;
614
+ }>]>;
615
+ export type PostFirstFactorVerificationResult = z.infer<typeof postFirstFactorVerificationResultGuard>;
616
+ export declare const postSignInResultGuard: z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
617
+ action: z.ZodLiteral<"updateUser">;
618
+ user: z.ZodOptional<z.ZodObject<{
619
+ name: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
620
+ username: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
621
+ profile: z.ZodOptional<z.ZodType<Partial<{
622
+ familyName: string;
623
+ givenName: string;
624
+ middleName: string;
625
+ nickname: string;
626
+ preferredUsername: string;
627
+ profile: string;
628
+ website: string;
629
+ gender: string;
630
+ birthdate: string;
631
+ zoneinfo: string;
632
+ locale: string;
633
+ address: Partial<{
634
+ formatted: string;
635
+ streetAddress: string;
636
+ locality: string;
637
+ region: string;
638
+ postalCode: string;
639
+ country: string;
640
+ }>;
641
+ }>, z.ZodTypeDef, Partial<{
642
+ familyName: string;
643
+ givenName: string;
644
+ middleName: string;
645
+ nickname: string;
646
+ preferredUsername: string;
647
+ profile: string;
648
+ website: string;
649
+ gender: string;
650
+ birthdate: string;
651
+ zoneinfo: string;
652
+ locale: string;
653
+ address: Partial<{
654
+ formatted: string;
655
+ streetAddress: string;
656
+ locality: string;
657
+ region: string;
658
+ postalCode: string;
659
+ country: string;
660
+ }>;
661
+ }>>>;
662
+ avatar: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
663
+ customData: z.ZodOptional<z.ZodType<import("@withtyped/server/lib/types.js").JsonObject, z.ZodTypeDef, import("@withtyped/server/lib/types.js").JsonObject>>;
664
+ primaryEmail: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
665
+ primaryPhone: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
666
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
667
+ name: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
668
+ username: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
669
+ profile: z.ZodOptional<z.ZodType<Partial<{
670
+ familyName: string;
671
+ givenName: string;
672
+ middleName: string;
673
+ nickname: string;
674
+ preferredUsername: string;
675
+ profile: string;
676
+ website: string;
677
+ gender: string;
678
+ birthdate: string;
679
+ zoneinfo: string;
680
+ locale: string;
681
+ address: Partial<{
682
+ formatted: string;
683
+ streetAddress: string;
684
+ locality: string;
685
+ region: string;
686
+ postalCode: string;
687
+ country: string;
688
+ }>;
689
+ }>, z.ZodTypeDef, Partial<{
690
+ familyName: string;
691
+ givenName: string;
692
+ middleName: string;
693
+ nickname: string;
694
+ preferredUsername: string;
695
+ profile: string;
696
+ website: string;
697
+ gender: string;
698
+ birthdate: string;
699
+ zoneinfo: string;
700
+ locale: string;
701
+ address: Partial<{
702
+ formatted: string;
703
+ streetAddress: string;
704
+ locality: string;
705
+ region: string;
706
+ postalCode: string;
707
+ country: string;
708
+ }>;
709
+ }>>>;
710
+ avatar: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
711
+ customData: z.ZodOptional<z.ZodType<import("@withtyped/server/lib/types.js").JsonObject, z.ZodTypeDef, import("@withtyped/server/lib/types.js").JsonObject>>;
712
+ primaryEmail: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
713
+ primaryPhone: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
714
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
715
+ name: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
716
+ username: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
717
+ profile: z.ZodOptional<z.ZodType<Partial<{
718
+ familyName: string;
719
+ givenName: string;
720
+ middleName: string;
721
+ nickname: string;
722
+ preferredUsername: string;
723
+ profile: string;
724
+ website: string;
725
+ gender: string;
726
+ birthdate: string;
727
+ zoneinfo: string;
728
+ locale: string;
729
+ address: Partial<{
730
+ formatted: string;
731
+ streetAddress: string;
732
+ locality: string;
733
+ region: string;
734
+ postalCode: string;
735
+ country: string;
736
+ }>;
737
+ }>, z.ZodTypeDef, Partial<{
738
+ familyName: string;
739
+ givenName: string;
740
+ middleName: string;
741
+ nickname: string;
742
+ preferredUsername: string;
743
+ profile: string;
744
+ website: string;
745
+ gender: string;
746
+ birthdate: string;
747
+ zoneinfo: string;
748
+ locale: string;
749
+ address: Partial<{
750
+ formatted: string;
751
+ streetAddress: string;
752
+ locality: string;
753
+ region: string;
754
+ postalCode: string;
755
+ country: string;
756
+ }>;
757
+ }>>>;
758
+ avatar: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
759
+ customData: z.ZodOptional<z.ZodType<import("@withtyped/server/lib/types.js").JsonObject, z.ZodTypeDef, import("@withtyped/server/lib/types.js").JsonObject>>;
760
+ primaryEmail: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
761
+ primaryPhone: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
762
+ }, z.ZodTypeAny, "passthrough">>>;
763
+ }, "strip", z.ZodTypeAny, {
764
+ action: "updateUser";
765
+ user?: z.objectOutputType<{
766
+ name: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
767
+ username: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
768
+ profile: z.ZodOptional<z.ZodType<Partial<{
769
+ familyName: string;
770
+ givenName: string;
771
+ middleName: string;
772
+ nickname: string;
773
+ preferredUsername: string;
774
+ profile: string;
775
+ website: string;
776
+ gender: string;
777
+ birthdate: string;
778
+ zoneinfo: string;
779
+ locale: string;
780
+ address: Partial<{
781
+ formatted: string;
782
+ streetAddress: string;
783
+ locality: string;
784
+ region: string;
785
+ postalCode: string;
786
+ country: string;
787
+ }>;
788
+ }>, z.ZodTypeDef, Partial<{
789
+ familyName: string;
790
+ givenName: string;
791
+ middleName: string;
792
+ nickname: string;
793
+ preferredUsername: string;
794
+ profile: string;
795
+ website: string;
796
+ gender: string;
797
+ birthdate: string;
798
+ zoneinfo: string;
799
+ locale: string;
800
+ address: Partial<{
801
+ formatted: string;
802
+ streetAddress: string;
803
+ locality: string;
804
+ region: string;
805
+ postalCode: string;
806
+ country: string;
807
+ }>;
808
+ }>>>;
809
+ avatar: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
810
+ customData: z.ZodOptional<z.ZodType<import("@withtyped/server/lib/types.js").JsonObject, z.ZodTypeDef, import("@withtyped/server/lib/types.js").JsonObject>>;
811
+ primaryEmail: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
812
+ primaryPhone: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
813
+ }, z.ZodTypeAny, "passthrough"> | undefined;
814
+ }, {
815
+ action: "updateUser";
816
+ user?: z.objectInputType<{
817
+ name: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
818
+ username: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
819
+ profile: z.ZodOptional<z.ZodType<Partial<{
820
+ familyName: string;
821
+ givenName: string;
822
+ middleName: string;
823
+ nickname: string;
824
+ preferredUsername: string;
825
+ profile: string;
826
+ website: string;
827
+ gender: string;
828
+ birthdate: string;
829
+ zoneinfo: string;
830
+ locale: string;
831
+ address: Partial<{
832
+ formatted: string;
833
+ streetAddress: string;
834
+ locality: string;
835
+ region: string;
836
+ postalCode: string;
837
+ country: string;
838
+ }>;
839
+ }>, z.ZodTypeDef, Partial<{
840
+ familyName: string;
841
+ givenName: string;
842
+ middleName: string;
843
+ nickname: string;
844
+ preferredUsername: string;
845
+ profile: string;
846
+ website: string;
847
+ gender: string;
848
+ birthdate: string;
849
+ zoneinfo: string;
850
+ locale: string;
851
+ address: Partial<{
852
+ formatted: string;
853
+ streetAddress: string;
854
+ locality: string;
855
+ region: string;
856
+ postalCode: string;
857
+ country: string;
858
+ }>;
859
+ }>>>;
860
+ avatar: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
861
+ customData: z.ZodOptional<z.ZodType<import("@withtyped/server/lib/types.js").JsonObject, z.ZodTypeDef, import("@withtyped/server/lib/types.js").JsonObject>>;
862
+ primaryEmail: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
863
+ primaryPhone: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
864
+ }, z.ZodTypeAny, "passthrough"> | undefined;
865
+ }>]>;
866
+ export type PostSignInResult = z.infer<typeof postSignInResultGuard>;
867
+ export declare const actionUserPatchFields: readonly ["profile", "name", "username", "avatar", "customData", "primaryEmail", "primaryPhone"];
868
+ /**
869
+ * The subset of {@link PostFirstFactorVerificationEvent} that is safe to persist in audit logs.
870
+ *
871
+ * The end user's password is the only credential in the event that the tenant does not already own,
872
+ * so it is dropped rather than masked. The user object collapses to its ID because the audit log
873
+ * records the same ID as a top-level `userId`.
874
+ */
875
+ export type LoggablePostFirstFactorVerificationEvent = Omit<PostFirstFactorVerificationEvent, 'password' | 'user'> & {
876
+ user: Pick<ActionUser, 'id'> | null;
877
+ };
878
+ export declare const loggablePostFirstFactorVerificationEventGuard: z.ZodObject<{
879
+ key: z.ZodLiteral<LogtoActionKey.PostFirstFactorVerification>;
880
+ interactionEvent: z.ZodLiteral<InteractionEvent.SignIn>;
881
+ verificationType: z.ZodLiteral<VerificationType.Password>;
882
+ identifier: z.ZodObject<{
883
+ type: z.ZodNativeEnum<typeof import("../../foundations/index.js").SignInIdentifier>;
884
+ value: z.ZodString;
885
+ }, "strip", z.ZodTypeAny, {
886
+ value: string;
887
+ type: import("../../foundations/index.js").SignInIdentifier;
888
+ }, {
889
+ value: string;
890
+ type: import("../../foundations/index.js").SignInIdentifier;
891
+ }>;
892
+ user: z.ZodNullable<z.ZodObject<{
893
+ id: z.ZodString;
894
+ }, "strip", z.ZodTypeAny, {
895
+ id: string;
896
+ }, {
897
+ id: string;
898
+ }>>;
899
+ }, "strip", z.ZodTypeAny, {
900
+ key: LogtoActionKey.PostFirstFactorVerification;
901
+ identifier: {
902
+ value: string;
903
+ type: import("../../foundations/index.js").SignInIdentifier;
904
+ };
905
+ interactionEvent: InteractionEvent.SignIn;
906
+ user: {
907
+ id: string;
908
+ } | null;
909
+ verificationType: VerificationType.Password;
910
+ }, {
911
+ key: LogtoActionKey.PostFirstFactorVerification;
912
+ identifier: {
913
+ value: string;
914
+ type: import("../../foundations/index.js").SignInIdentifier;
915
+ };
916
+ interactionEvent: InteractionEvent.SignIn;
917
+ user: {
918
+ id: string;
919
+ } | null;
920
+ verificationType: VerificationType.Password;
921
+ }>;
922
+ /**
923
+ * The subset of {@link PostSignInEvent} that is safe to persist in audit logs. The full
924
+ * {@link JwtCustomizerUserContext} carries the user's identifiers, SSO identities, MFA factors,
925
+ * roles, and organizations, none of which the audit log needs to describe the action run.
926
+ */
927
+ export type LoggablePostSignInEvent = Omit<PostSignInEvent, 'user'> & {
928
+ user: Pick<JwtCustomizerUserContext, 'id'>;
929
+ };
930
+ export declare const loggablePostSignInEventGuard: z.ZodObject<{
931
+ key: z.ZodLiteral<LogtoActionKey.PostSignIn>;
932
+ interactionEvent: z.ZodLiteral<InteractionEvent.SignIn>;
933
+ user: z.ZodObject<{
934
+ id: z.ZodString;
935
+ }, "strip", z.ZodTypeAny, {
936
+ id: string;
937
+ }, {
938
+ id: string;
939
+ }>;
940
+ }, "strip", z.ZodTypeAny, {
941
+ key: LogtoActionKey.PostSignIn;
942
+ interactionEvent: InteractionEvent.SignIn;
943
+ user: {
944
+ id: string;
945
+ };
946
+ }, {
947
+ key: LogtoActionKey.PostSignIn;
948
+ interactionEvent: InteractionEvent.SignIn;
949
+ user: {
950
+ id: string;
951
+ };
952
+ }>;
953
+ export type LoggableActionEvent = LoggablePostFirstFactorVerificationEvent | LoggablePostSignInEvent;
954
+ /**
955
+ * The audit-log description of what a script asked Logto to do. Action results are authored by
956
+ * untrusted scripts, so this reports the shape of the requested user patch instead of its values,
957
+ * and names only fields on the {@link actionUserPatchFields} allowlist.
958
+ */
959
+ export type LoggableActionResult = {
960
+ passwordVerified: boolean;
961
+ userFields: Array<keyof ActionUserPatch>;
962
+ unknownFieldCount: number;
963
+ };