@logto/schemas 1.21.0 → 1.23.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 (72) hide show
  1. package/alterations/1.22.0-1730689363-add-account-center.ts +31 -0
  2. package/alterations/1.22.0-1731054001-init-account-center.ts +43 -0
  3. package/alterations/1.22.0-1731304920-add-support-email-and-website-to-sie-table.ts +22 -0
  4. package/alterations/1.22.0-1731377260-add-unknown-session-redirect-url-to-sie.ts +20 -0
  5. package/alterations/1.22.0-1731900596-add-saml-application-type.ts +50 -0
  6. package/alterations/1.22.0-1731900631-add-saml-app-third-party-consistency-check.ts +20 -0
  7. package/alterations/1.22.0-1731901231-add-saml-application-secrets-table.ts +40 -0
  8. package/alterations/1.22.0-1731904029-add-saml-application-configs-table.ts +33 -0
  9. package/alterations/1.23.0-1732851150-rename-saml-application-constraints.ts +34 -0
  10. package/alterations/1.23.0-1733212543-add-saml-application-type-to-idp-initiated-sso-application-allow-list.ts +30 -0
  11. package/alterations/1.23.0-1735012422-add-saml-application-sessions-table.ts +37 -0
  12. package/alterations-js/1.22.0-1730689363-add-account-center.js +26 -0
  13. package/alterations-js/1.22.0-1731054001-init-account-center.js +35 -0
  14. package/alterations-js/1.22.0-1731304920-add-support-email-and-website-to-sie-table.js +18 -0
  15. package/alterations-js/1.22.0-1731377260-add-unknown-session-redirect-url-to-sie.js +16 -0
  16. package/alterations-js/1.22.0-1731900596-add-saml-application-type.js +46 -0
  17. package/alterations-js/1.22.0-1731900631-add-saml-app-third-party-consistency-check.js +16 -0
  18. package/alterations-js/1.22.0-1731901231-add-saml-application-secrets-table.js +35 -0
  19. package/alterations-js/1.22.0-1731904029-add-saml-application-configs-table.js +28 -0
  20. package/alterations-js/1.23.0-1732851150-rename-saml-application-constraints.js +28 -0
  21. package/alterations-js/1.23.0-1733212543-add-saml-application-type-to-idp-initiated-sso-application-allow-list.js +24 -0
  22. package/alterations-js/1.23.0-1735012422-add-saml-application-sessions-table.js +32 -0
  23. package/lib/consts/subscriptions.d.ts +16 -15
  24. package/lib/consts/subscriptions.js +16 -14
  25. package/lib/db-entries/account-center.d.ts +24 -0
  26. package/lib/db-entries/account-center.js +34 -0
  27. package/lib/db-entries/custom-types.d.ts +2 -1
  28. package/lib/db-entries/custom-types.js +1 -0
  29. package/lib/db-entries/index.d.ts +4 -0
  30. package/lib/db-entries/index.js +4 -0
  31. package/lib/db-entries/saml-application-config.d.ts +24 -0
  32. package/lib/db-entries/saml-application-config.js +38 -0
  33. package/lib/db-entries/saml-application-secret.d.ts +28 -0
  34. package/lib/db-entries/saml-application-secret.js +49 -0
  35. package/lib/db-entries/saml-application-session.d.ts +40 -0
  36. package/lib/db-entries/saml-application-session.js +53 -0
  37. package/lib/db-entries/sign-in-experience.d.ts +7 -1
  38. package/lib/db-entries/sign-in-experience.js +12 -0
  39. package/lib/foundations/jsonb-types/account-centers.d.ts +43 -0
  40. package/lib/foundations/jsonb-types/account-centers.js +25 -0
  41. package/lib/foundations/jsonb-types/index.d.ts +3 -0
  42. package/lib/foundations/jsonb-types/index.js +3 -0
  43. package/lib/foundations/jsonb-types/saml-application-configs.d.ts +21 -0
  44. package/lib/foundations/jsonb-types/saml-application-configs.js +11 -0
  45. package/lib/foundations/jsonb-types/saml-application-sessions.d.ts +45 -0
  46. package/lib/foundations/jsonb-types/saml-application-sessions.js +10 -0
  47. package/lib/foundations/jsonb-types/sign-in-experience.d.ts +9 -1
  48. package/lib/foundations/jsonb-types/sign-in-experience.js +8 -0
  49. package/lib/seeds/account-center.d.ts +2 -0
  50. package/lib/seeds/account-center.js +6 -0
  51. package/lib/seeds/index.d.ts +1 -0
  52. package/lib/seeds/index.js +1 -0
  53. package/lib/types/application.d.ts +6 -6
  54. package/lib/types/consent.d.ts +8 -8
  55. package/lib/types/hook.d.ts +2 -2
  56. package/lib/types/index.d.ts +1 -0
  57. package/lib/types/index.js +1 -0
  58. package/lib/types/logto-config/index.d.ts +9 -9
  59. package/lib/types/logto-config/jwt-customizer.d.ts +17 -17
  60. package/lib/types/saml-application.d.ts +493 -0
  61. package/lib/types/saml-application.js +54 -0
  62. package/lib/types/sign-in-experience.d.ts +10 -1
  63. package/lib/types/user.d.ts +7 -7
  64. package/lib/utils/application.js +2 -0
  65. package/package.json +8 -8
  66. package/tables/account_centers.sql +10 -0
  67. package/tables/applications.sql +5 -2
  68. package/tables/saml_application_configs.sql +15 -0
  69. package/tables/saml_application_secrets.sql +22 -0
  70. package/tables/saml_application_sessions.sql +23 -0
  71. package/tables/sign_in_experiences.sql +3 -0
  72. package/tables/sso_connector_idp_initiated_auth_configs.sql +1 -1
@@ -0,0 +1,493 @@
1
+ import { z } from 'zod';
2
+ export declare const samlApplicationCreateGuard: z.ZodObject<z.objectUtil.extendShape<Pick<z.objectUtil.extendShape<{
3
+ type: z.ZodOptional<z.ZodType<import("../index.js").ApplicationType, z.ZodTypeDef, import("../index.js").ApplicationType>>;
4
+ name: z.ZodOptional<z.ZodType<string, z.ZodTypeDef, string>>;
5
+ customData: z.ZodOptional<z.ZodOptional<z.ZodType<import("@withtyped/server").JsonObject, z.ZodTypeDef, import("@withtyped/server").JsonObject>>>;
6
+ description: z.ZodOptional<z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>>;
7
+ oidcClientMetadata: z.ZodOptional<z.ZodType<import("../index.js").OidcClientMetadata, z.ZodTypeDef, import("../index.js").OidcClientMetadata>>;
8
+ customClientMetadata: z.ZodOptional<z.ZodOptional<z.ZodType<{
9
+ corsAllowedOrigins?: string[] | undefined;
10
+ idTokenTtl?: number | undefined;
11
+ refreshTokenTtl?: number | undefined;
12
+ refreshTokenTtlInDays?: number | undefined;
13
+ tenantId?: string | undefined;
14
+ alwaysIssueRefreshToken?: boolean | undefined;
15
+ rotateRefreshToken?: boolean | undefined;
16
+ }, z.ZodTypeDef, {
17
+ corsAllowedOrigins?: string[] | undefined;
18
+ idTokenTtl?: number | undefined;
19
+ refreshTokenTtl?: number | undefined;
20
+ refreshTokenTtlInDays?: number | undefined;
21
+ tenantId?: string | undefined;
22
+ alwaysIssueRefreshToken?: boolean | undefined;
23
+ rotateRefreshToken?: boolean | undefined;
24
+ }>>>;
25
+ protectedAppMetadata: z.ZodOptional<z.ZodOptional<z.ZodType<{
26
+ host: string;
27
+ origin: string;
28
+ sessionDuration: number;
29
+ pageRules: {
30
+ path: string;
31
+ }[];
32
+ customDomains?: {
33
+ status: import("../index.js").DomainStatus;
34
+ domain: string;
35
+ errorMessage: string | null;
36
+ dnsRecords: {
37
+ type: string;
38
+ value: string;
39
+ name: string;
40
+ }[];
41
+ cloudflareData: {
42
+ status: string;
43
+ id: string;
44
+ ssl: {
45
+ status: string;
46
+ validation_errors?: {
47
+ message: string;
48
+ }[] | undefined;
49
+ };
50
+ verification_errors?: string[] | undefined;
51
+ } | null;
52
+ }[] | undefined;
53
+ } | null, z.ZodTypeDef, {
54
+ host: string;
55
+ origin: string;
56
+ sessionDuration: number;
57
+ pageRules: {
58
+ path: string;
59
+ }[];
60
+ customDomains?: {
61
+ status: import("../index.js").DomainStatus;
62
+ domain: string;
63
+ errorMessage: string | null;
64
+ dnsRecords: {
65
+ type: string;
66
+ value: string;
67
+ name: string;
68
+ }[];
69
+ cloudflareData: {
70
+ status: string;
71
+ id: string;
72
+ ssl: {
73
+ status: string;
74
+ validation_errors?: {
75
+ message: string;
76
+ }[] | undefined;
77
+ };
78
+ verification_errors?: string[] | undefined;
79
+ } | null;
80
+ }[] | undefined;
81
+ } | null>>>;
82
+ isThirdParty: z.ZodOptional<z.ZodOptional<z.ZodType<boolean, z.ZodTypeDef, boolean>>>;
83
+ }, Pick<{
84
+ tenantId: z.ZodOptional<z.ZodType<string, z.ZodTypeDef, string>>;
85
+ id: z.ZodType<string, z.ZodTypeDef, string>;
86
+ name: z.ZodType<string, z.ZodTypeDef, string>;
87
+ secret: z.ZodType<string, z.ZodTypeDef, string>;
88
+ description: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
89
+ type: z.ZodType<import("../index.js").ApplicationType, z.ZodTypeDef, import("../index.js").ApplicationType>;
90
+ oidcClientMetadata: z.ZodType<import("../index.js").OidcClientMetadata, z.ZodTypeDef, import("../index.js").OidcClientMetadata>;
91
+ customClientMetadata: z.ZodOptional<z.ZodType<{
92
+ corsAllowedOrigins?: string[] | undefined;
93
+ idTokenTtl?: number | undefined;
94
+ refreshTokenTtl?: number | undefined;
95
+ refreshTokenTtlInDays?: number | undefined;
96
+ tenantId?: string | undefined;
97
+ alwaysIssueRefreshToken?: boolean | undefined;
98
+ rotateRefreshToken?: boolean | undefined;
99
+ }, z.ZodTypeDef, {
100
+ corsAllowedOrigins?: string[] | undefined;
101
+ idTokenTtl?: number | undefined;
102
+ refreshTokenTtl?: number | undefined;
103
+ refreshTokenTtlInDays?: number | undefined;
104
+ tenantId?: string | undefined;
105
+ alwaysIssueRefreshToken?: boolean | undefined;
106
+ rotateRefreshToken?: boolean | undefined;
107
+ }>>;
108
+ protectedAppMetadata: z.ZodOptional<z.ZodType<{
109
+ host: string;
110
+ origin: string;
111
+ sessionDuration: number;
112
+ pageRules: {
113
+ path: string;
114
+ }[];
115
+ customDomains?: {
116
+ status: import("../index.js").DomainStatus;
117
+ domain: string;
118
+ errorMessage: string | null;
119
+ dnsRecords: {
120
+ type: string;
121
+ value: string;
122
+ name: string;
123
+ }[];
124
+ cloudflareData: {
125
+ status: string;
126
+ id: string;
127
+ ssl: {
128
+ status: string;
129
+ validation_errors?: {
130
+ message: string;
131
+ }[] | undefined;
132
+ };
133
+ verification_errors?: string[] | undefined;
134
+ } | null;
135
+ }[] | undefined;
136
+ } | null, z.ZodTypeDef, {
137
+ host: string;
138
+ origin: string;
139
+ sessionDuration: number;
140
+ pageRules: {
141
+ path: string;
142
+ }[];
143
+ customDomains?: {
144
+ status: import("../index.js").DomainStatus;
145
+ domain: string;
146
+ errorMessage: string | null;
147
+ dnsRecords: {
148
+ type: string;
149
+ value: string;
150
+ name: string;
151
+ }[];
152
+ cloudflareData: {
153
+ status: string;
154
+ id: string;
155
+ ssl: {
156
+ status: string;
157
+ validation_errors?: {
158
+ message: string;
159
+ }[] | undefined;
160
+ };
161
+ verification_errors?: string[] | undefined;
162
+ } | null;
163
+ }[] | undefined;
164
+ } | null>>;
165
+ customData: z.ZodOptional<z.ZodType<import("@withtyped/server").JsonObject, z.ZodTypeDef, import("@withtyped/server").JsonObject>>;
166
+ isThirdParty: z.ZodOptional<z.ZodType<boolean, z.ZodTypeDef, boolean>>;
167
+ createdAt: z.ZodOptional<z.ZodType<number, z.ZodTypeDef, number>>;
168
+ }, "type" | "name">>, "name" | "customData" | "description">, {
169
+ attributeMapping: z.ZodOptional<z.ZodType<import("../index.js").SamlAttributeMapping, z.ZodTypeDef, import("../index.js").SamlAttributeMapping>>;
170
+ entityId: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
171
+ acsUrl: z.ZodOptional<z.ZodType<import("../index.js").SamlAcsUrl | null, z.ZodTypeDef, import("../index.js").SamlAcsUrl | null>>;
172
+ }>, "strip", z.ZodTypeAny, {
173
+ name: string;
174
+ customData?: import("@withtyped/server").JsonObject;
175
+ description?: string | null;
176
+ attributeMapping?: import("../index.js").SamlAttributeMapping | undefined;
177
+ entityId?: string | null | undefined;
178
+ acsUrl?: import("../index.js").SamlAcsUrl | null | undefined;
179
+ }, {
180
+ name: string;
181
+ customData?: import("@withtyped/server").JsonObject;
182
+ description?: string | null;
183
+ attributeMapping?: import("../index.js").SamlAttributeMapping | undefined;
184
+ entityId?: string | null | undefined;
185
+ acsUrl?: import("../index.js").SamlAcsUrl | null | undefined;
186
+ }>;
187
+ export type CreateSamlApplication = z.infer<typeof samlApplicationCreateGuard>;
188
+ export declare const samlApplicationPatchGuard: z.ZodObject<z.objectUtil.extendShape<Pick<Omit<{
189
+ customData: z.ZodOptional<z.ZodOptional<z.ZodOptional<z.ZodType<import("@withtyped/server").JsonObject, z.ZodTypeDef, import("@withtyped/server").JsonObject>>>>;
190
+ description: z.ZodOptional<z.ZodOptional<z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>>>;
191
+ oidcClientMetadata: z.ZodOptional<z.ZodOptional<z.ZodType<import("../index.js").OidcClientMetadata, z.ZodTypeDef, import("../index.js").OidcClientMetadata>>>;
192
+ customClientMetadata: z.ZodOptional<z.ZodOptional<z.ZodOptional<z.ZodType<{
193
+ corsAllowedOrigins?: string[] | undefined;
194
+ idTokenTtl?: number | undefined;
195
+ refreshTokenTtl?: number | undefined;
196
+ refreshTokenTtlInDays?: number | undefined;
197
+ tenantId?: string | undefined;
198
+ alwaysIssueRefreshToken?: boolean | undefined;
199
+ rotateRefreshToken?: boolean | undefined;
200
+ }, z.ZodTypeDef, {
201
+ corsAllowedOrigins?: string[] | undefined;
202
+ idTokenTtl?: number | undefined;
203
+ refreshTokenTtl?: number | undefined;
204
+ refreshTokenTtlInDays?: number | undefined;
205
+ tenantId?: string | undefined;
206
+ alwaysIssueRefreshToken?: boolean | undefined;
207
+ rotateRefreshToken?: boolean | undefined;
208
+ }>>>>;
209
+ protectedAppMetadata: z.ZodOptional<z.ZodOptional<z.ZodOptional<z.ZodType<{
210
+ host: string;
211
+ origin: string;
212
+ sessionDuration: number;
213
+ pageRules: {
214
+ path: string;
215
+ }[];
216
+ customDomains?: {
217
+ status: import("../index.js").DomainStatus;
218
+ domain: string;
219
+ errorMessage: string | null;
220
+ dnsRecords: {
221
+ type: string;
222
+ value: string;
223
+ name: string;
224
+ }[];
225
+ cloudflareData: {
226
+ status: string;
227
+ id: string;
228
+ ssl: {
229
+ status: string;
230
+ validation_errors?: {
231
+ message: string;
232
+ }[] | undefined;
233
+ };
234
+ verification_errors?: string[] | undefined;
235
+ } | null;
236
+ }[] | undefined;
237
+ } | null, z.ZodTypeDef, {
238
+ host: string;
239
+ origin: string;
240
+ sessionDuration: number;
241
+ pageRules: {
242
+ path: string;
243
+ }[];
244
+ customDomains?: {
245
+ status: import("../index.js").DomainStatus;
246
+ domain: string;
247
+ errorMessage: string | null;
248
+ dnsRecords: {
249
+ type: string;
250
+ value: string;
251
+ name: string;
252
+ }[];
253
+ cloudflareData: {
254
+ status: string;
255
+ id: string;
256
+ ssl: {
257
+ status: string;
258
+ validation_errors?: {
259
+ message: string;
260
+ }[] | undefined;
261
+ };
262
+ verification_errors?: string[] | undefined;
263
+ } | null;
264
+ }[] | undefined;
265
+ } | null>>>>;
266
+ isThirdParty: z.ZodOptional<z.ZodOptional<z.ZodOptional<z.ZodType<boolean, z.ZodTypeDef, boolean>>>>;
267
+ type: z.ZodOptional<z.ZodType<import("../index.js").ApplicationType, z.ZodTypeDef, import("../index.js").ApplicationType>>;
268
+ name: z.ZodOptional<z.ZodType<string, z.ZodTypeDef, string>>;
269
+ }, "type" | "isThirdParty">, "name" | "customData" | "description">, {
270
+ attributeMapping: z.ZodOptional<z.ZodType<import("../index.js").SamlAttributeMapping, z.ZodTypeDef, import("../index.js").SamlAttributeMapping>>;
271
+ entityId: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
272
+ acsUrl: z.ZodOptional<z.ZodType<import("../index.js").SamlAcsUrl | null, z.ZodTypeDef, import("../index.js").SamlAcsUrl | null>>;
273
+ }>, "strip", z.ZodTypeAny, {
274
+ name?: string | undefined;
275
+ customData?: import("@withtyped/server").JsonObject;
276
+ description?: string | null;
277
+ attributeMapping?: import("../index.js").SamlAttributeMapping | undefined;
278
+ entityId?: string | null | undefined;
279
+ acsUrl?: import("../index.js").SamlAcsUrl | null | undefined;
280
+ }, {
281
+ name?: string | undefined;
282
+ customData?: import("@withtyped/server").JsonObject;
283
+ description?: string | null;
284
+ attributeMapping?: import("../index.js").SamlAttributeMapping | undefined;
285
+ entityId?: string | null | undefined;
286
+ acsUrl?: import("../index.js").SamlAcsUrl | null | undefined;
287
+ }>;
288
+ export type PatchSamlApplication = z.infer<typeof samlApplicationPatchGuard>;
289
+ export declare const samlApplicationResponseGuard: z.ZodObject<z.objectUtil.extendShape<Omit<{
290
+ tenantId: z.ZodType<string, z.ZodTypeDef, string>;
291
+ id: z.ZodType<string, z.ZodTypeDef, string>;
292
+ name: z.ZodType<string, z.ZodTypeDef, string>;
293
+ secret: z.ZodType<string, z.ZodTypeDef, string>;
294
+ description: z.ZodType<string | null, z.ZodTypeDef, string | null>;
295
+ type: z.ZodType<import("../index.js").ApplicationType, z.ZodTypeDef, import("../index.js").ApplicationType>;
296
+ oidcClientMetadata: z.ZodType<import("../index.js").OidcClientMetadata, z.ZodTypeDef, import("../index.js").OidcClientMetadata>;
297
+ customClientMetadata: z.ZodType<{
298
+ corsAllowedOrigins?: string[] | undefined;
299
+ idTokenTtl?: number | undefined;
300
+ refreshTokenTtl?: number | undefined;
301
+ refreshTokenTtlInDays?: number | undefined;
302
+ tenantId?: string | undefined;
303
+ alwaysIssueRefreshToken?: boolean | undefined;
304
+ rotateRefreshToken?: boolean | undefined;
305
+ }, z.ZodTypeDef, {
306
+ corsAllowedOrigins?: string[] | undefined;
307
+ idTokenTtl?: number | undefined;
308
+ refreshTokenTtl?: number | undefined;
309
+ refreshTokenTtlInDays?: number | undefined;
310
+ tenantId?: string | undefined;
311
+ alwaysIssueRefreshToken?: boolean | undefined;
312
+ rotateRefreshToken?: boolean | undefined;
313
+ }>;
314
+ protectedAppMetadata: z.ZodType<{
315
+ host: string;
316
+ origin: string;
317
+ sessionDuration: number;
318
+ pageRules: {
319
+ path: string;
320
+ }[];
321
+ customDomains?: {
322
+ status: import("../index.js").DomainStatus;
323
+ domain: string;
324
+ errorMessage: string | null;
325
+ dnsRecords: {
326
+ type: string;
327
+ value: string;
328
+ name: string;
329
+ }[];
330
+ cloudflareData: {
331
+ status: string;
332
+ id: string;
333
+ ssl: {
334
+ status: string;
335
+ validation_errors?: {
336
+ message: string;
337
+ }[] | undefined;
338
+ };
339
+ verification_errors?: string[] | undefined;
340
+ } | null;
341
+ }[] | undefined;
342
+ } | null, z.ZodTypeDef, {
343
+ host: string;
344
+ origin: string;
345
+ sessionDuration: number;
346
+ pageRules: {
347
+ path: string;
348
+ }[];
349
+ customDomains?: {
350
+ status: import("../index.js").DomainStatus;
351
+ domain: string;
352
+ errorMessage: string | null;
353
+ dnsRecords: {
354
+ type: string;
355
+ value: string;
356
+ name: string;
357
+ }[];
358
+ cloudflareData: {
359
+ status: string;
360
+ id: string;
361
+ ssl: {
362
+ status: string;
363
+ validation_errors?: {
364
+ message: string;
365
+ }[] | undefined;
366
+ };
367
+ verification_errors?: string[] | undefined;
368
+ } | null;
369
+ }[] | undefined;
370
+ } | null>;
371
+ customData: z.ZodType<import("@withtyped/server").JsonObject, z.ZodTypeDef, import("@withtyped/server").JsonObject>;
372
+ isThirdParty: z.ZodType<boolean, z.ZodTypeDef, boolean>;
373
+ createdAt: z.ZodType<number, z.ZodTypeDef, number>;
374
+ }, "secret" | "oidcClientMetadata" | "customClientMetadata" | "protectedAppMetadata">, Pick<{
375
+ applicationId: z.ZodType<string, z.ZodTypeDef, string>;
376
+ tenantId: z.ZodType<string, z.ZodTypeDef, string>;
377
+ attributeMapping: z.ZodType<import("../index.js").SamlAttributeMapping, z.ZodTypeDef, import("../index.js").SamlAttributeMapping>;
378
+ entityId: z.ZodType<string | null, z.ZodTypeDef, string | null>;
379
+ acsUrl: z.ZodType<import("../index.js").SamlAcsUrl | null, z.ZodTypeDef, import("../index.js").SamlAcsUrl | null>;
380
+ }, "attributeMapping" | "entityId" | "acsUrl">>, "strip", z.ZodTypeAny, {
381
+ type: import("../index.js").ApplicationType;
382
+ name: string;
383
+ id: string;
384
+ tenantId: string;
385
+ createdAt: number;
386
+ customData: import("@withtyped/server").JsonObject;
387
+ description: string | null;
388
+ isThirdParty: boolean;
389
+ attributeMapping: import("../index.js").SamlAttributeMapping;
390
+ entityId: string | null;
391
+ acsUrl: import("../index.js").SamlAcsUrl | null;
392
+ }, {
393
+ type: import("../index.js").ApplicationType;
394
+ name: string;
395
+ id: string;
396
+ tenantId: string;
397
+ createdAt: number;
398
+ customData: import("@withtyped/server").JsonObject;
399
+ description: string | null;
400
+ isThirdParty: boolean;
401
+ attributeMapping: import("../index.js").SamlAttributeMapping;
402
+ entityId: string | null;
403
+ acsUrl: import("../index.js").SamlAcsUrl | null;
404
+ }>;
405
+ export type SamlApplicationResponse = z.infer<typeof samlApplicationResponseGuard>;
406
+ type FingerprintFormat = {
407
+ formatted: string;
408
+ unformatted: string;
409
+ };
410
+ export type CertificateFingerprints = {
411
+ sha256: FingerprintFormat;
412
+ };
413
+ export declare const certificateFingerprintsGuard: z.ZodObject<{
414
+ sha256: z.ZodObject<{
415
+ formatted: z.ZodString;
416
+ unformatted: z.ZodString;
417
+ }, "strip", z.ZodTypeAny, {
418
+ formatted: string;
419
+ unformatted: string;
420
+ }, {
421
+ formatted: string;
422
+ unformatted: string;
423
+ }>;
424
+ }, "strip", z.ZodTypeAny, {
425
+ sha256: {
426
+ formatted: string;
427
+ unformatted: string;
428
+ };
429
+ }, {
430
+ sha256: {
431
+ formatted: string;
432
+ unformatted: string;
433
+ };
434
+ }>;
435
+ export declare const samlApplicationSecretResponseGuard: z.ZodObject<z.objectUtil.extendShape<Omit<{
436
+ id: z.ZodType<string, z.ZodTypeDef, string>;
437
+ tenantId: z.ZodType<string, z.ZodTypeDef, string>;
438
+ applicationId: z.ZodType<string, z.ZodTypeDef, string>;
439
+ privateKey: z.ZodType<string, z.ZodTypeDef, string>;
440
+ certificate: z.ZodType<string, z.ZodTypeDef, string>;
441
+ createdAt: z.ZodType<number, z.ZodTypeDef, number>;
442
+ expiresAt: z.ZodType<number, z.ZodTypeDef, number>;
443
+ active: z.ZodType<boolean, z.ZodTypeDef, boolean>;
444
+ }, "applicationId" | "tenantId" | "privateKey">, {
445
+ fingerprints: z.ZodObject<{
446
+ sha256: z.ZodObject<{
447
+ formatted: z.ZodString;
448
+ unformatted: z.ZodString;
449
+ }, "strip", z.ZodTypeAny, {
450
+ formatted: string;
451
+ unformatted: string;
452
+ }, {
453
+ formatted: string;
454
+ unformatted: string;
455
+ }>;
456
+ }, "strip", z.ZodTypeAny, {
457
+ sha256: {
458
+ formatted: string;
459
+ unformatted: string;
460
+ };
461
+ }, {
462
+ sha256: {
463
+ formatted: string;
464
+ unformatted: string;
465
+ };
466
+ }>;
467
+ }>, "strip", z.ZodTypeAny, {
468
+ id: string;
469
+ createdAt: number;
470
+ expiresAt: number;
471
+ certificate: string;
472
+ active: boolean;
473
+ fingerprints: {
474
+ sha256: {
475
+ formatted: string;
476
+ unformatted: string;
477
+ };
478
+ };
479
+ }, {
480
+ id: string;
481
+ createdAt: number;
482
+ expiresAt: number;
483
+ certificate: string;
484
+ active: boolean;
485
+ fingerprints: {
486
+ sha256: {
487
+ formatted: string;
488
+ unformatted: string;
489
+ };
490
+ };
491
+ }>;
492
+ export type SamlApplicationSecretResponse = z.infer<typeof samlApplicationSecretResponseGuard>;
493
+ export {};
@@ -0,0 +1,54 @@
1
+ import { z } from 'zod';
2
+ import { Applications } from '../db-entries/application.js';
3
+ import { SamlApplicationConfigs } from '../db-entries/saml-application-config.js';
4
+ import { SamlApplicationSecrets } from '../db-entries/saml-application-secret.js';
5
+ import { applicationCreateGuard, applicationPatchGuard } from './application.js';
6
+ const samlAppConfigGuard = SamlApplicationConfigs.guard.pick({
7
+ attributeMapping: true,
8
+ entityId: true,
9
+ acsUrl: true,
10
+ });
11
+ export const samlApplicationCreateGuard = applicationCreateGuard
12
+ .pick({
13
+ name: true,
14
+ description: true,
15
+ customData: true,
16
+ })
17
+ // The reason for encapsulating attributeMapping and spMetadata into an object within the config field is that you cannot provide only one of `attributeMapping` or `spMetadata`. Due to the structure of the `saml_application_configs` table, both must be not null.
18
+ .merge(samlAppConfigGuard.partial());
19
+ export const samlApplicationPatchGuard = applicationPatchGuard
20
+ .pick({
21
+ name: true,
22
+ description: true,
23
+ customData: true,
24
+ })
25
+ // The reason for encapsulating attributeMapping and spMetadata into an object within the config field is that you cannot provide only one of `attributeMapping` or `spMetadata`. Due to the structure of the `saml_application_configs` table, both must be not null.
26
+ .merge(samlAppConfigGuard.partial());
27
+ export const samlApplicationResponseGuard = Applications.guard
28
+ .omit({
29
+ secret: true,
30
+ oidcClientMetadata: true,
31
+ customClientMetadata: true,
32
+ protectedAppMetadata: true,
33
+ })
34
+ .merge(
35
+ // Partial to allow the optional fields to be omitted in the response.
36
+ // When starting to create a SAML application, SAML configuration is optional, which can lead to the absence of SAML configuration.
37
+ samlAppConfigGuard);
38
+ const fingerprintFormatGuard = z.object({
39
+ formatted: z.string(),
40
+ unformatted: z.string(),
41
+ });
42
+ export const certificateFingerprintsGuard = z.object({
43
+ sha256: fingerprintFormatGuard,
44
+ });
45
+ // Make sure the `privateKey` is not exposed in the response.
46
+ export const samlApplicationSecretResponseGuard = SamlApplicationSecrets.guard
47
+ .omit({
48
+ tenantId: true,
49
+ applicationId: true,
50
+ privateKey: true,
51
+ })
52
+ .extend({
53
+ fingerprints: certificateFingerprintsGuard,
54
+ });
@@ -135,6 +135,9 @@ export declare const fullSignInExperienceGuard: z.ZodObject<z.objectUtil.extendS
135
135
  policy: import("../index.js").MfaPolicy;
136
136
  }>;
137
137
  singleSignOnEnabled: z.ZodType<boolean, z.ZodTypeDef, boolean>;
138
+ supportEmail: z.ZodType<string | null, z.ZodTypeDef, string | null>;
139
+ supportWebsiteUrl: z.ZodType<string | null, z.ZodTypeDef, string | null>;
140
+ unknownSessionRedirectUrl: z.ZodType<string | null, z.ZodTypeDef, string | null>;
138
141
  }, {
139
142
  socialConnectors: z.ZodArray<z.ZodObject<Omit<z.objectUtil.extendShape<{
140
143
  id: z.ZodString;
@@ -326,7 +329,7 @@ export declare const fullSignInExperienceGuard: z.ZodObject<z.objectUtil.extendS
326
329
  }, {
327
330
  platform: z.ZodNullable<z.ZodNativeEnum<typeof import("@logto/connector-kit").ConnectorPlatform>>;
328
331
  isStandard: z.ZodOptional<z.ZodBoolean>;
329
- }>, "description" | "customData" | "readme" | "configTemplate" | "formItems">, "strip", z.ZodTypeAny, {
332
+ }>, "customData" | "description" | "readme" | "configTemplate" | "formItems">, "strip", z.ZodTypeAny, {
330
333
  name: {
331
334
  en: string;
332
335
  } & {
@@ -667,6 +670,9 @@ export declare const fullSignInExperienceGuard: z.ZodObject<z.objectUtil.extendS
667
670
  passwordPolicy: import("../index.js").PartialPasswordPolicy;
668
671
  mfa: import("../index.js").Mfa;
669
672
  singleSignOnEnabled: boolean;
673
+ supportEmail: string | null;
674
+ supportWebsiteUrl: string | null;
675
+ unknownSessionRedirectUrl: string | null;
670
676
  socialConnectors: {
671
677
  name: {
672
678
  en: string;
@@ -842,6 +848,9 @@ export declare const fullSignInExperienceGuard: z.ZodObject<z.objectUtil.extendS
842
848
  passwordPolicy: import("../index.js").PartialPasswordPolicy;
843
849
  mfa: import("../index.js").Mfa;
844
850
  singleSignOnEnabled: boolean;
851
+ supportEmail: string | null;
852
+ supportWebsiteUrl: string | null;
853
+ unknownSessionRedirectUrl: string | null;
845
854
  socialConnectors: {
846
855
  name: {
847
856
  en: string;
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { type User } from '../db-entries/index.js';
3
3
  import { MfaFactor } from '../foundations/index.js';
4
- export declare const userInfoSelectFields: readonly ("name" | "id" | "applicationId" | "username" | "createdAt" | "profile" | "customData" | "updatedAt" | "primaryEmail" | "primaryPhone" | "avatar" | "identities" | "isSuspended" | "lastSignInAt")[];
4
+ export declare const userInfoSelectFields: readonly ("name" | "id" | "applicationId" | "username" | "createdAt" | "profile" | "avatar" | "customData" | "updatedAt" | "primaryEmail" | "primaryPhone" | "identities" | "isSuspended" | "lastSignInAt")[];
5
5
  export declare const userInfoGuard: z.ZodObject<Pick<{
6
6
  tenantId: z.ZodType<string, z.ZodTypeDef, string>;
7
7
  id: z.ZodType<string, z.ZodTypeDef, string>;
@@ -118,18 +118,18 @@ export declare const userInfoGuard: z.ZodObject<Pick<{
118
118
  lastSignInAt: z.ZodType<number | null, z.ZodTypeDef, number | null>;
119
119
  createdAt: z.ZodType<number, z.ZodTypeDef, number>;
120
120
  updatedAt: z.ZodType<number, z.ZodTypeDef, number>;
121
- }, "name" | "id" | "applicationId" | "username" | "createdAt" | "profile" | "customData" | "updatedAt" | "primaryEmail" | "primaryPhone" | "avatar" | "identities" | "isSuspended" | "lastSignInAt">, "strip", z.ZodTypeAny, {
121
+ }, "name" | "id" | "applicationId" | "username" | "createdAt" | "profile" | "avatar" | "customData" | "updatedAt" | "primaryEmail" | "primaryPhone" | "identities" | "isSuspended" | "lastSignInAt">, "strip", z.ZodTypeAny, {
122
122
  name: string | null;
123
123
  id: string;
124
124
  applicationId: string | null;
125
125
  username: string | null;
126
126
  createdAt: number;
127
127
  profile: import("../foundations/index.js").UserProfile;
128
+ avatar: string | null;
128
129
  customData: import("@withtyped/server/lib/types.js").JsonObject;
129
130
  updatedAt: number;
130
131
  primaryEmail: string | null;
131
132
  primaryPhone: string | null;
132
- avatar: string | null;
133
133
  identities: import("../foundations/index.js").Identities;
134
134
  isSuspended: boolean;
135
135
  lastSignInAt: number | null;
@@ -140,11 +140,11 @@ export declare const userInfoGuard: z.ZodObject<Pick<{
140
140
  username: string | null;
141
141
  createdAt: number;
142
142
  profile: import("../foundations/index.js").UserProfile;
143
+ avatar: string | null;
143
144
  customData: import("@withtyped/server/lib/types.js").JsonObject;
144
145
  updatedAt: number;
145
146
  primaryEmail: string | null;
146
147
  primaryPhone: string | null;
147
- avatar: string | null;
148
148
  identities: import("../foundations/index.js").Identities;
149
149
  isSuspended: boolean;
150
150
  lastSignInAt: number | null;
@@ -266,7 +266,7 @@ export declare const userProfileResponseGuard: z.ZodObject<z.objectUtil.extendSh
266
266
  lastSignInAt: z.ZodType<number | null, z.ZodTypeDef, number | null>;
267
267
  createdAt: z.ZodType<number, z.ZodTypeDef, number>;
268
268
  updatedAt: z.ZodType<number, z.ZodTypeDef, number>;
269
- }, "name" | "id" | "applicationId" | "username" | "createdAt" | "profile" | "customData" | "updatedAt" | "primaryEmail" | "primaryPhone" | "avatar" | "identities" | "isSuspended" | "lastSignInAt">, {
269
+ }, "name" | "id" | "applicationId" | "username" | "createdAt" | "profile" | "avatar" | "customData" | "updatedAt" | "primaryEmail" | "primaryPhone" | "identities" | "isSuspended" | "lastSignInAt">, {
270
270
  hasPassword: z.ZodOptional<z.ZodBoolean>;
271
271
  ssoIdentities: z.ZodOptional<z.ZodArray<import("../foundations/schemas.js").Guard<import("../db-entries/user-sso-identity.js").UserSsoIdentity>, "many">>;
272
272
  }>, "strip", z.ZodTypeAny, {
@@ -276,11 +276,11 @@ export declare const userProfileResponseGuard: z.ZodObject<z.objectUtil.extendSh
276
276
  username: string | null;
277
277
  createdAt: number;
278
278
  profile: import("../foundations/index.js").UserProfile;
279
+ avatar: string | null;
279
280
  customData: import("@withtyped/server/lib/types.js").JsonObject;
280
281
  updatedAt: number;
281
282
  primaryEmail: string | null;
282
283
  primaryPhone: string | null;
283
- avatar: string | null;
284
284
  identities: import("../foundations/index.js").Identities;
285
285
  isSuspended: boolean;
286
286
  lastSignInAt: number | null;
@@ -293,11 +293,11 @@ export declare const userProfileResponseGuard: z.ZodObject<z.objectUtil.extendSh
293
293
  username: string | null;
294
294
  createdAt: number;
295
295
  profile: import("../foundations/index.js").UserProfile;
296
+ avatar: string | null;
296
297
  customData: import("@withtyped/server/lib/types.js").JsonObject;
297
298
  updatedAt: number;
298
299
  primaryEmail: string | null;
299
300
  primaryPhone: string | null;
300
- avatar: string | null;
301
301
  identities: import("../foundations/index.js").Identities;
302
302
  isSuspended: boolean;
303
303
  lastSignInAt: number | null;
@@ -4,4 +4,6 @@ export const hasSecrets = (type) => [
4
4
  ApplicationType.MachineToMachine,
5
5
  ApplicationType.Protected,
6
6
  ApplicationType.Traditional,
7
+ // SAML applications are used as traditional web applications.
8
+ ApplicationType.SAML,
7
9
  ].includes(type);