@logto/schemas 1.11.0 → 1.13.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 (158) hide show
  1. package/alterations/1.12.0-1700031616-update-org-role-foreign-keys.ts +35 -0
  2. package/alterations/1.12.0-1701054133-add-unique-constraint-to-the-sso-connector-name.ts +21 -0
  3. package/alterations/1.12.0-1701245520-add-single-sign-on-enabled-flag-to-sie.ts +20 -0
  4. package/alterations/1.13.0-1702274830-add-new-third-party-column-to-applications-table.ts +20 -0
  5. package/alterations/1.13.0-1702372401-add-application-permissions-tables.ts +93 -0
  6. package/alterations/1.13.0-1702544178-sync-tenant-orgs.ts +296 -0
  7. package/alterations/1.13.0-1702871078-protected-application-type.ts +24 -0
  8. package/alterations/1.13.0-1702877515-protected-app-configs.ts +18 -0
  9. package/alterations/1.13.0-1702978120-application-sign-in-experience-table.ts +61 -0
  10. package/alterations/1.13.0-1703229996-daily-token-usage.ts +62 -0
  11. package/alterations/1.13.0-1703230000-update-tenant-roles.ts +94 -0
  12. package/alterations/1.13.0-1704692973-remove-legacy-resources.ts +147 -0
  13. package/alterations/1.13.0-1704934999-add-magic-links-table.ts +37 -0
  14. package/alterations/1.13.0-1704935001-add-organization-invitation-tables.ts +78 -0
  15. package/alterations/1.13.0-1705288654-add-application-user-consent-organizations-table.ts +62 -0
  16. package/alterations/1.13.0-1705991158-update-invitation-indices.ts +32 -0
  17. package/alterations/1.13.0-1706449174-update-organization-invitation-column.ts +24 -0
  18. package/alterations/1.13.0-1706510290-protected-app-host-index.ts +21 -0
  19. package/alterations/1.13.0-1706512952-restore-get-started-page.ts +17 -0
  20. package/alterations/1.13.0-1706528755-remove-magic-links.ts +46 -0
  21. package/alterations/1.13.0-1706585206-protected-app-custom-domain-unique.ts +21 -0
  22. package/alterations/utils/1704934999-tables.ts +49 -0
  23. package/alterations/utils/README.md +9 -0
  24. package/alterations-js/1.12.0-1700031616-update-org-role-foreign-keys.d.ts +3 -0
  25. package/alterations-js/1.12.0-1700031616-update-org-role-foreign-keys.js +31 -0
  26. package/alterations-js/1.12.0-1701054133-add-unique-constraint-to-the-sso-connector-name.d.ts +3 -0
  27. package/alterations-js/1.12.0-1701054133-add-unique-constraint-to-the-sso-connector-name.js +17 -0
  28. package/alterations-js/1.12.0-1701245520-add-single-sign-on-enabled-flag-to-sie.d.ts +3 -0
  29. package/alterations-js/1.12.0-1701245520-add-single-sign-on-enabled-flag-to-sie.js +16 -0
  30. package/alterations-js/1.13.0-1702274830-add-new-third-party-column-to-applications-table.d.ts +3 -0
  31. package/alterations-js/1.13.0-1702274830-add-new-third-party-column-to-applications-table.js +16 -0
  32. package/alterations-js/1.13.0-1702372401-add-application-permissions-tables.d.ts +3 -0
  33. package/alterations-js/1.13.0-1702372401-add-application-permissions-tables.js +79 -0
  34. package/alterations-js/1.13.0-1702544178-sync-tenant-orgs.d.ts +18 -0
  35. package/alterations-js/1.13.0-1702544178-sync-tenant-orgs.js +225 -0
  36. package/alterations-js/1.13.0-1702871078-protected-application-type.d.ts +3 -0
  37. package/alterations-js/1.13.0-1702871078-protected-application-type.js +20 -0
  38. package/alterations-js/1.13.0-1702877515-protected-app-configs.d.ts +3 -0
  39. package/alterations-js/1.13.0-1702877515-protected-app-configs.js +14 -0
  40. package/alterations-js/1.13.0-1702978120-application-sign-in-experience-table.d.ts +3 -0
  41. package/alterations-js/1.13.0-1702978120-application-sign-in-experience-table.js +51 -0
  42. package/alterations-js/1.13.0-1703229996-daily-token-usage.d.ts +3 -0
  43. package/alterations-js/1.13.0-1703229996-daily-token-usage.js +51 -0
  44. package/alterations-js/1.13.0-1703230000-update-tenant-roles.d.ts +11 -0
  45. package/alterations-js/1.13.0-1703230000-update-tenant-roles.js +87 -0
  46. package/alterations-js/1.13.0-1704692973-remove-legacy-resources.d.ts +3 -0
  47. package/alterations-js/1.13.0-1704692973-remove-legacy-resources.js +124 -0
  48. package/alterations-js/1.13.0-1704934999-add-magic-links-table.d.ts +3 -0
  49. package/alterations-js/1.13.0-1704934999-add-magic-links-table.js +32 -0
  50. package/alterations-js/1.13.0-1704935001-add-organization-invitation-tables.d.ts +3 -0
  51. package/alterations-js/1.13.0-1704935001-add-organization-invitation-tables.js +72 -0
  52. package/alterations-js/1.13.0-1705288654-add-application-user-consent-organizations-table.d.ts +3 -0
  53. package/alterations-js/1.13.0-1705288654-add-application-user-consent-organizations-table.js +52 -0
  54. package/alterations-js/1.13.0-1705991158-update-invitation-indices.d.ts +7 -0
  55. package/alterations-js/1.13.0-1705991158-update-invitation-indices.js +27 -0
  56. package/alterations-js/1.13.0-1706449174-update-organization-invitation-column.d.ts +3 -0
  57. package/alterations-js/1.13.0-1706449174-update-organization-invitation-column.js +20 -0
  58. package/alterations-js/1.13.0-1706510290-protected-app-host-index.d.ts +3 -0
  59. package/alterations-js/1.13.0-1706510290-protected-app-host-index.js +17 -0
  60. package/alterations-js/1.13.0-1706512952-restore-get-started-page.d.ts +3 -0
  61. package/alterations-js/1.13.0-1706512952-restore-get-started-page.js +13 -0
  62. package/alterations-js/1.13.0-1706528755-remove-magic-links.d.ts +3 -0
  63. package/alterations-js/1.13.0-1706528755-remove-magic-links.js +41 -0
  64. package/alterations-js/1.13.0-1706585206-protected-app-custom-domain-unique.d.ts +3 -0
  65. package/alterations-js/1.13.0-1706585206-protected-app-custom-domain-unique.js +17 -0
  66. package/alterations-js/utils/1704934999-tables.d.ts +11 -0
  67. package/alterations-js/utils/1704934999-tables.js +43 -0
  68. package/lib/consts/index.d.ts +1 -0
  69. package/lib/consts/index.js +1 -0
  70. package/lib/consts/subscriptions.d.ts +6 -0
  71. package/lib/consts/subscriptions.js +7 -0
  72. package/lib/db-entries/application-sign-in-experience.d.ts +26 -0
  73. package/lib/db-entries/application-sign-in-experience.js +42 -0
  74. package/lib/db-entries/application-user-consent-organization-scope.d.ts +24 -0
  75. package/lib/db-entries/application-user-consent-organization-scope.js +29 -0
  76. package/lib/db-entries/application-user-consent-organization.d.ts +22 -0
  77. package/lib/db-entries/application-user-consent-organization.js +33 -0
  78. package/lib/db-entries/application-user-consent-resource-scope.d.ts +24 -0
  79. package/lib/db-entries/application-user-consent-resource-scope.js +29 -0
  80. package/lib/db-entries/application-user-consent-user-scope.d.ts +24 -0
  81. package/lib/db-entries/application-user-consent-user-scope.js +29 -0
  82. package/lib/db-entries/application.d.ts +6 -2
  83. package/lib/db-entries/application.js +9 -1
  84. package/lib/db-entries/custom-types.d.ts +8 -1
  85. package/lib/db-entries/custom-types.js +8 -0
  86. package/lib/db-entries/daily-token-usage.d.ts +20 -0
  87. package/lib/db-entries/daily-token-usage.js +33 -0
  88. package/lib/db-entries/index.d.ts +8 -0
  89. package/lib/db-entries/index.js +8 -0
  90. package/lib/db-entries/organization-invitation-role-relation.d.ts +24 -0
  91. package/lib/db-entries/organization-invitation-role-relation.js +29 -0
  92. package/lib/db-entries/organization-invitation.d.ts +53 -0
  93. package/lib/db-entries/organization-invitation.js +58 -0
  94. package/lib/db-entries/sign-in-experience.d.ts +3 -1
  95. package/lib/db-entries/sign-in-experience.js +4 -0
  96. package/lib/db-entries/sso-connector.d.ts +2 -2
  97. package/lib/foundations/jsonb-types/applications.d.ts +380 -0
  98. package/lib/foundations/jsonb-types/applications.js +29 -0
  99. package/lib/foundations/jsonb-types/custom-domain.d.ts +37 -89
  100. package/lib/foundations/jsonb-types/custom-domain.js +4 -9
  101. package/lib/foundations/jsonb-types/index.d.ts +1 -0
  102. package/lib/foundations/jsonb-types/index.js +1 -0
  103. package/lib/foundations/jsonb-types/sso-connector.d.ts +3 -0
  104. package/lib/foundations/jsonb-types/sso-connector.js +1 -0
  105. package/lib/models/tenants.d.ts +1 -1
  106. package/lib/seeds/application.d.ts +1 -1
  107. package/lib/seeds/application.js +3 -1
  108. package/lib/seeds/cloud-api.d.ts +0 -2
  109. package/lib/seeds/cloud-api.js +0 -3
  110. package/lib/seeds/management-api.d.ts +77 -6
  111. package/lib/seeds/management-api.js +14 -10
  112. package/lib/types/application.d.ts +576 -1
  113. package/lib/types/application.js +42 -1
  114. package/lib/types/connector.js +1 -1
  115. package/lib/types/consent.d.ts +568 -0
  116. package/lib/types/consent.js +47 -0
  117. package/lib/types/domain.d.ts +21 -65
  118. package/lib/types/hook.d.ts +1 -0
  119. package/lib/types/index.d.ts +3 -0
  120. package/lib/types/index.js +3 -0
  121. package/lib/types/interactions.d.ts +6 -6
  122. package/lib/types/logto-config.d.ts +32 -6
  123. package/lib/types/logto-config.js +12 -2
  124. package/lib/types/mapi-proxy.d.ts +30 -0
  125. package/lib/types/mapi-proxy.js +49 -0
  126. package/lib/types/organization.d.ts +10 -1
  127. package/lib/types/organization.js +4 -1
  128. package/lib/types/sso-connector.d.ts +63 -66
  129. package/lib/types/sso-connector.js +41 -7
  130. package/lib/types/system.d.ts +28 -1
  131. package/lib/types/system.js +17 -0
  132. package/lib/types/tenant-organization.d.ts +107 -0
  133. package/lib/types/tenant-organization.js +145 -0
  134. package/lib/types/tenant.d.ts +0 -1
  135. package/lib/types/tenant.js +2 -1
  136. package/lib/types/user-assets.d.ts +5 -5
  137. package/lib/types/user-assets.js +1 -0
  138. package/lib/types/user.d.ts +17 -15
  139. package/lib/types/user.js +2 -2
  140. package/lib/utils/domain.d.ts +10 -0
  141. package/lib/utils/domain.js +28 -0
  142. package/lib/utils/domain.test.d.ts +1 -0
  143. package/lib/utils/domain.test.js +34 -0
  144. package/lib/utils/index.d.ts +1 -0
  145. package/lib/utils/index.js +1 -0
  146. package/package.json +15 -15
  147. package/tables/application_sign_in_experiences.sql +15 -0
  148. package/tables/application_user_consent_organization_scopes.sql +14 -0
  149. package/tables/application_user_consent_organizations.sql +16 -0
  150. package/tables/application_user_consent_resource_scopes.sql +14 -0
  151. package/tables/application_user_consent_user_scopes.sql +13 -0
  152. package/tables/applications.sql +16 -1
  153. package/tables/daily_token_usage.sql +11 -0
  154. package/tables/organization_invitation_role_relations.sql +14 -0
  155. package/tables/organization_invitations.sql +36 -0
  156. package/tables/organization_role_user_relations.sql +8 -6
  157. package/tables/sign_in_experiences.sql +1 -0
  158. package/tables/sso_connectors.sql +4 -2
@@ -1,4 +1,5 @@
1
- import { type z } from 'zod';
1
+ import { UserScope } from '@logto/core-kit';
2
+ import { z } from 'zod';
2
3
  import { type Application } from '../db-entries/index.js';
3
4
  export type ApplicationResponse = Application & {
4
5
  isAdmin: boolean;
@@ -42,6 +43,64 @@ export declare const featuredApplicationGuard: z.ZodObject<Pick<{
42
43
  alwaysIssueRefreshToken?: boolean | undefined;
43
44
  rotateRefreshToken?: boolean | undefined;
44
45
  }>;
46
+ protectedAppMetadata: z.ZodType<{
47
+ host: string;
48
+ origin: string;
49
+ sessionDuration: number;
50
+ pageRules: {
51
+ path: string;
52
+ }[];
53
+ customDomains?: {
54
+ status: import("../index.js").DomainStatus;
55
+ domain: string;
56
+ errorMessage: string | null;
57
+ dnsRecords: {
58
+ type: string;
59
+ value: string;
60
+ name: string;
61
+ }[];
62
+ cloudflareData: {
63
+ status: string;
64
+ id: string;
65
+ ssl: {
66
+ status: string;
67
+ validation_errors?: {
68
+ message: string;
69
+ }[] | undefined;
70
+ };
71
+ verification_errors?: string[] | undefined;
72
+ } | null;
73
+ }[] | undefined;
74
+ } | null, z.ZodTypeDef, {
75
+ host: string;
76
+ origin: string;
77
+ sessionDuration: number;
78
+ pageRules: {
79
+ path: string;
80
+ }[];
81
+ customDomains?: {
82
+ status: import("../index.js").DomainStatus;
83
+ domain: string;
84
+ errorMessage: string | null;
85
+ dnsRecords: {
86
+ type: string;
87
+ value: string;
88
+ name: string;
89
+ }[];
90
+ cloudflareData: {
91
+ status: string;
92
+ id: string;
93
+ ssl: {
94
+ status: string;
95
+ validation_errors?: {
96
+ message: string;
97
+ }[] | undefined;
98
+ };
99
+ verification_errors?: string[] | undefined;
100
+ } | null;
101
+ }[] | undefined;
102
+ } | null>;
103
+ isThirdParty: z.ZodType<boolean, z.ZodTypeDef, boolean>;
45
104
  createdAt: z.ZodType<number, z.ZodTypeDef, number>;
46
105
  }, "type" | "name" | "id">, "strip", z.ZodTypeAny, {
47
106
  type: import("../db-entries/custom-types.js").ApplicationType;
@@ -52,3 +111,519 @@ export declare const featuredApplicationGuard: z.ZodObject<Pick<{
52
111
  name: string;
53
112
  id: string;
54
113
  }>;
114
+ export declare const applicationCreateGuard: z.ZodObject<{
115
+ description: z.ZodOptional<z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>>;
116
+ oidcClientMetadata: z.ZodOptional<z.ZodType<{
117
+ redirectUris: string[];
118
+ postLogoutRedirectUris: string[];
119
+ logoUri?: string | undefined;
120
+ }, z.ZodTypeDef, {
121
+ redirectUris: string[];
122
+ postLogoutRedirectUris: string[];
123
+ logoUri?: string | undefined;
124
+ }>>;
125
+ customClientMetadata: z.ZodOptional<z.ZodOptional<z.ZodType<{
126
+ corsAllowedOrigins?: string[] | undefined;
127
+ idTokenTtl?: number | undefined;
128
+ refreshTokenTtl?: number | undefined;
129
+ refreshTokenTtlInDays?: number | undefined;
130
+ tenantId?: string | undefined;
131
+ alwaysIssueRefreshToken?: boolean | undefined;
132
+ rotateRefreshToken?: boolean | undefined;
133
+ }, z.ZodTypeDef, {
134
+ corsAllowedOrigins?: string[] | undefined;
135
+ idTokenTtl?: number | undefined;
136
+ refreshTokenTtl?: number | undefined;
137
+ refreshTokenTtlInDays?: number | undefined;
138
+ tenantId?: string | undefined;
139
+ alwaysIssueRefreshToken?: boolean | undefined;
140
+ rotateRefreshToken?: boolean | undefined;
141
+ }>>>;
142
+ protectedAppMetadata: z.ZodOptional<z.ZodOptional<z.ZodType<{
143
+ host: string;
144
+ origin: string;
145
+ sessionDuration: number;
146
+ pageRules: {
147
+ path: string;
148
+ }[];
149
+ customDomains?: {
150
+ status: import("../index.js").DomainStatus;
151
+ domain: string;
152
+ errorMessage: string | null;
153
+ dnsRecords: {
154
+ type: string;
155
+ value: string;
156
+ name: string;
157
+ }[];
158
+ cloudflareData: {
159
+ status: string;
160
+ id: string;
161
+ ssl: {
162
+ status: string;
163
+ validation_errors?: {
164
+ message: string;
165
+ }[] | undefined;
166
+ };
167
+ verification_errors?: string[] | undefined;
168
+ } | null;
169
+ }[] | undefined;
170
+ } | null, z.ZodTypeDef, {
171
+ host: string;
172
+ origin: string;
173
+ sessionDuration: number;
174
+ pageRules: {
175
+ path: string;
176
+ }[];
177
+ customDomains?: {
178
+ status: import("../index.js").DomainStatus;
179
+ domain: string;
180
+ errorMessage: string | null;
181
+ dnsRecords: {
182
+ type: string;
183
+ value: string;
184
+ name: string;
185
+ }[];
186
+ cloudflareData: {
187
+ status: string;
188
+ id: string;
189
+ ssl: {
190
+ status: string;
191
+ validation_errors?: {
192
+ message: string;
193
+ }[] | undefined;
194
+ };
195
+ verification_errors?: string[] | undefined;
196
+ } | null;
197
+ }[] | undefined;
198
+ } | null>>>;
199
+ isThirdParty: z.ZodOptional<z.ZodOptional<z.ZodType<boolean, z.ZodTypeDef, boolean>>>;
200
+ type: z.ZodType<import("../db-entries/custom-types.js").ApplicationType, z.ZodTypeDef, import("../db-entries/custom-types.js").ApplicationType>;
201
+ name: z.ZodType<string, z.ZodTypeDef, string>;
202
+ }, "strip", z.ZodTypeAny, {
203
+ type: import("../db-entries/custom-types.js").ApplicationType;
204
+ name: string;
205
+ description?: string | null | undefined;
206
+ oidcClientMetadata?: {
207
+ redirectUris: string[];
208
+ postLogoutRedirectUris: string[];
209
+ logoUri?: string | undefined;
210
+ } | undefined;
211
+ customClientMetadata?: {
212
+ corsAllowedOrigins?: string[] | undefined;
213
+ idTokenTtl?: number | undefined;
214
+ refreshTokenTtl?: number | undefined;
215
+ refreshTokenTtlInDays?: number | undefined;
216
+ tenantId?: string | undefined;
217
+ alwaysIssueRefreshToken?: boolean | undefined;
218
+ rotateRefreshToken?: boolean | undefined;
219
+ } | undefined;
220
+ protectedAppMetadata?: {
221
+ host: string;
222
+ origin: string;
223
+ sessionDuration: number;
224
+ pageRules: {
225
+ path: string;
226
+ }[];
227
+ customDomains?: {
228
+ status: import("../index.js").DomainStatus;
229
+ domain: string;
230
+ errorMessage: string | null;
231
+ dnsRecords: {
232
+ type: string;
233
+ value: string;
234
+ name: string;
235
+ }[];
236
+ cloudflareData: {
237
+ status: string;
238
+ id: string;
239
+ ssl: {
240
+ status: string;
241
+ validation_errors?: {
242
+ message: string;
243
+ }[] | undefined;
244
+ };
245
+ verification_errors?: string[] | undefined;
246
+ } | null;
247
+ }[] | undefined;
248
+ } | null | undefined;
249
+ isThirdParty?: boolean | undefined;
250
+ }, {
251
+ type: import("../db-entries/custom-types.js").ApplicationType;
252
+ name: string;
253
+ description?: string | null | undefined;
254
+ oidcClientMetadata?: {
255
+ redirectUris: string[];
256
+ postLogoutRedirectUris: string[];
257
+ logoUri?: string | undefined;
258
+ } | undefined;
259
+ customClientMetadata?: {
260
+ corsAllowedOrigins?: string[] | undefined;
261
+ idTokenTtl?: number | undefined;
262
+ refreshTokenTtl?: number | undefined;
263
+ refreshTokenTtlInDays?: number | undefined;
264
+ tenantId?: string | undefined;
265
+ alwaysIssueRefreshToken?: boolean | undefined;
266
+ rotateRefreshToken?: boolean | undefined;
267
+ } | undefined;
268
+ protectedAppMetadata?: {
269
+ host: string;
270
+ origin: string;
271
+ sessionDuration: number;
272
+ pageRules: {
273
+ path: string;
274
+ }[];
275
+ customDomains?: {
276
+ status: import("../index.js").DomainStatus;
277
+ domain: string;
278
+ errorMessage: string | null;
279
+ dnsRecords: {
280
+ type: string;
281
+ value: string;
282
+ name: string;
283
+ }[];
284
+ cloudflareData: {
285
+ status: string;
286
+ id: string;
287
+ ssl: {
288
+ status: string;
289
+ validation_errors?: {
290
+ message: string;
291
+ }[] | undefined;
292
+ };
293
+ verification_errors?: string[] | undefined;
294
+ } | null;
295
+ }[] | undefined;
296
+ } | null | undefined;
297
+ isThirdParty?: boolean | undefined;
298
+ }>;
299
+ export declare const applicationPatchGuard: z.ZodObject<Omit<{
300
+ description: z.ZodOptional<z.ZodOptional<z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>>>;
301
+ oidcClientMetadata: z.ZodOptional<z.ZodOptional<z.ZodType<{
302
+ redirectUris: string[];
303
+ postLogoutRedirectUris: string[];
304
+ logoUri?: string | undefined;
305
+ }, z.ZodTypeDef, {
306
+ redirectUris: string[];
307
+ postLogoutRedirectUris: string[];
308
+ logoUri?: string | undefined;
309
+ }>>>;
310
+ customClientMetadata: z.ZodOptional<z.ZodOptional<z.ZodOptional<z.ZodType<{
311
+ corsAllowedOrigins?: string[] | undefined;
312
+ idTokenTtl?: number | undefined;
313
+ refreshTokenTtl?: number | undefined;
314
+ refreshTokenTtlInDays?: number | undefined;
315
+ tenantId?: string | undefined;
316
+ alwaysIssueRefreshToken?: boolean | undefined;
317
+ rotateRefreshToken?: boolean | undefined;
318
+ }, z.ZodTypeDef, {
319
+ corsAllowedOrigins?: string[] | undefined;
320
+ idTokenTtl?: number | undefined;
321
+ refreshTokenTtl?: number | undefined;
322
+ refreshTokenTtlInDays?: number | undefined;
323
+ tenantId?: string | undefined;
324
+ alwaysIssueRefreshToken?: boolean | undefined;
325
+ rotateRefreshToken?: boolean | undefined;
326
+ }>>>>;
327
+ protectedAppMetadata: z.ZodOptional<z.ZodOptional<z.ZodOptional<z.ZodType<{
328
+ host: string;
329
+ origin: string;
330
+ sessionDuration: number;
331
+ pageRules: {
332
+ path: string;
333
+ }[];
334
+ customDomains?: {
335
+ status: import("../index.js").DomainStatus;
336
+ domain: string;
337
+ errorMessage: string | null;
338
+ dnsRecords: {
339
+ type: string;
340
+ value: string;
341
+ name: string;
342
+ }[];
343
+ cloudflareData: {
344
+ status: string;
345
+ id: string;
346
+ ssl: {
347
+ status: string;
348
+ validation_errors?: {
349
+ message: string;
350
+ }[] | undefined;
351
+ };
352
+ verification_errors?: string[] | undefined;
353
+ } | null;
354
+ }[] | undefined;
355
+ } | null, z.ZodTypeDef, {
356
+ host: string;
357
+ origin: string;
358
+ sessionDuration: number;
359
+ pageRules: {
360
+ path: string;
361
+ }[];
362
+ customDomains?: {
363
+ status: import("../index.js").DomainStatus;
364
+ domain: string;
365
+ errorMessage: string | null;
366
+ dnsRecords: {
367
+ type: string;
368
+ value: string;
369
+ name: string;
370
+ }[];
371
+ cloudflareData: {
372
+ status: string;
373
+ id: string;
374
+ ssl: {
375
+ status: string;
376
+ validation_errors?: {
377
+ message: string;
378
+ }[] | undefined;
379
+ };
380
+ verification_errors?: string[] | undefined;
381
+ } | null;
382
+ }[] | undefined;
383
+ } | null>>>>;
384
+ isThirdParty: z.ZodOptional<z.ZodOptional<z.ZodOptional<z.ZodType<boolean, z.ZodTypeDef, boolean>>>>;
385
+ type: z.ZodOptional<z.ZodType<import("../db-entries/custom-types.js").ApplicationType, z.ZodTypeDef, import("../db-entries/custom-types.js").ApplicationType>>;
386
+ name: z.ZodOptional<z.ZodType<string, z.ZodTypeDef, string>>;
387
+ }, "type" | "isThirdParty">, "strip", z.ZodTypeAny, {
388
+ name?: string | undefined;
389
+ description?: string | null | undefined;
390
+ oidcClientMetadata?: {
391
+ redirectUris: string[];
392
+ postLogoutRedirectUris: string[];
393
+ logoUri?: string | undefined;
394
+ } | undefined;
395
+ customClientMetadata?: {
396
+ corsAllowedOrigins?: string[] | undefined;
397
+ idTokenTtl?: number | undefined;
398
+ refreshTokenTtl?: number | undefined;
399
+ refreshTokenTtlInDays?: number | undefined;
400
+ tenantId?: string | undefined;
401
+ alwaysIssueRefreshToken?: boolean | undefined;
402
+ rotateRefreshToken?: boolean | undefined;
403
+ } | undefined;
404
+ protectedAppMetadata?: {
405
+ host: string;
406
+ origin: string;
407
+ sessionDuration: number;
408
+ pageRules: {
409
+ path: string;
410
+ }[];
411
+ customDomains?: {
412
+ status: import("../index.js").DomainStatus;
413
+ domain: string;
414
+ errorMessage: string | null;
415
+ dnsRecords: {
416
+ type: string;
417
+ value: string;
418
+ name: string;
419
+ }[];
420
+ cloudflareData: {
421
+ status: string;
422
+ id: string;
423
+ ssl: {
424
+ status: string;
425
+ validation_errors?: {
426
+ message: string;
427
+ }[] | undefined;
428
+ };
429
+ verification_errors?: string[] | undefined;
430
+ } | null;
431
+ }[] | undefined;
432
+ } | null | undefined;
433
+ }, {
434
+ name?: string | undefined;
435
+ description?: string | null | undefined;
436
+ oidcClientMetadata?: {
437
+ redirectUris: string[];
438
+ postLogoutRedirectUris: string[];
439
+ logoUri?: string | undefined;
440
+ } | undefined;
441
+ customClientMetadata?: {
442
+ corsAllowedOrigins?: string[] | undefined;
443
+ idTokenTtl?: number | undefined;
444
+ refreshTokenTtl?: number | undefined;
445
+ refreshTokenTtlInDays?: number | undefined;
446
+ tenantId?: string | undefined;
447
+ alwaysIssueRefreshToken?: boolean | undefined;
448
+ rotateRefreshToken?: boolean | undefined;
449
+ } | undefined;
450
+ protectedAppMetadata?: {
451
+ host: string;
452
+ origin: string;
453
+ sessionDuration: number;
454
+ pageRules: {
455
+ path: string;
456
+ }[];
457
+ customDomains?: {
458
+ status: import("../index.js").DomainStatus;
459
+ domain: string;
460
+ errorMessage: string | null;
461
+ dnsRecords: {
462
+ type: string;
463
+ value: string;
464
+ name: string;
465
+ }[];
466
+ cloudflareData: {
467
+ status: string;
468
+ id: string;
469
+ ssl: {
470
+ status: string;
471
+ validation_errors?: {
472
+ message: string;
473
+ }[] | undefined;
474
+ };
475
+ verification_errors?: string[] | undefined;
476
+ } | null;
477
+ }[] | undefined;
478
+ } | null | undefined;
479
+ }>;
480
+ export declare const applicationUserConsentScopesResponseGuard: z.ZodObject<{
481
+ organizationScopes: z.ZodArray<z.ZodObject<Pick<{
482
+ tenantId: z.ZodType<string, z.ZodTypeDef, string>;
483
+ id: z.ZodType<string, z.ZodTypeDef, string>;
484
+ name: z.ZodType<string, z.ZodTypeDef, string>;
485
+ description: z.ZodType<string | null, z.ZodTypeDef, string | null>;
486
+ }, "name" | "id" | "description">, "strip", z.ZodTypeAny, {
487
+ name: string;
488
+ id: string;
489
+ description: string | null;
490
+ }, {
491
+ name: string;
492
+ id: string;
493
+ description: string | null;
494
+ }>, "many">;
495
+ resourceScopes: z.ZodArray<z.ZodObject<{
496
+ resource: z.ZodObject<Pick<{
497
+ tenantId: z.ZodType<string, z.ZodTypeDef, string>;
498
+ id: z.ZodType<string, z.ZodTypeDef, string>;
499
+ name: z.ZodType<string, z.ZodTypeDef, string>;
500
+ indicator: z.ZodType<string, z.ZodTypeDef, string>;
501
+ isDefault: z.ZodType<boolean, z.ZodTypeDef, boolean>;
502
+ accessTokenTtl: z.ZodType<number, z.ZodTypeDef, number>;
503
+ }, "name" | "id" | "indicator">, "strip", z.ZodTypeAny, {
504
+ name: string;
505
+ id: string;
506
+ indicator: string;
507
+ }, {
508
+ name: string;
509
+ id: string;
510
+ indicator: string;
511
+ }>;
512
+ scopes: z.ZodArray<z.ZodObject<Pick<{
513
+ tenantId: z.ZodType<string, z.ZodTypeDef, string>;
514
+ id: z.ZodType<string, z.ZodTypeDef, string>;
515
+ resourceId: z.ZodType<string, z.ZodTypeDef, string>;
516
+ name: z.ZodType<string, z.ZodTypeDef, string>;
517
+ description: z.ZodType<string, z.ZodTypeDef, string>;
518
+ createdAt: z.ZodType<number, z.ZodTypeDef, number>;
519
+ }, "name" | "id" | "description">, "strip", z.ZodTypeAny, {
520
+ name: string;
521
+ id: string;
522
+ description: string;
523
+ }, {
524
+ name: string;
525
+ id: string;
526
+ description: string;
527
+ }>, "many">;
528
+ }, "strip", z.ZodTypeAny, {
529
+ resource: {
530
+ name: string;
531
+ id: string;
532
+ indicator: string;
533
+ };
534
+ scopes: {
535
+ name: string;
536
+ id: string;
537
+ description: string;
538
+ }[];
539
+ }, {
540
+ resource: {
541
+ name: string;
542
+ id: string;
543
+ indicator: string;
544
+ };
545
+ scopes: {
546
+ name: string;
547
+ id: string;
548
+ description: string;
549
+ }[];
550
+ }>, "many">;
551
+ userScopes: z.ZodArray<z.ZodNativeEnum<typeof UserScope>, "many">;
552
+ }, "strip", z.ZodTypeAny, {
553
+ organizationScopes: {
554
+ name: string;
555
+ id: string;
556
+ description: string | null;
557
+ }[];
558
+ resourceScopes: {
559
+ resource: {
560
+ name: string;
561
+ id: string;
562
+ indicator: string;
563
+ };
564
+ scopes: {
565
+ name: string;
566
+ id: string;
567
+ description: string;
568
+ }[];
569
+ }[];
570
+ userScopes: UserScope[];
571
+ }, {
572
+ organizationScopes: {
573
+ name: string;
574
+ id: string;
575
+ description: string | null;
576
+ }[];
577
+ resourceScopes: {
578
+ resource: {
579
+ name: string;
580
+ id: string;
581
+ indicator: string;
582
+ };
583
+ scopes: {
584
+ name: string;
585
+ id: string;
586
+ description: string;
587
+ }[];
588
+ }[];
589
+ userScopes: UserScope[];
590
+ }>;
591
+ export declare enum ApplicationUserConsentScopeType {
592
+ OrganizationScopes = "organization-scopes",
593
+ ResourceScopes = "resource-scopes",
594
+ UserScopes = "user-scopes"
595
+ }
596
+ export type ApplicationUserConsentScopesResponse = z.infer<typeof applicationUserConsentScopesResponseGuard>;
597
+ export declare const applicationSignInExperienceCreateGuard: z.ZodObject<{
598
+ displayName: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
599
+ branding: z.ZodOptional<z.ZodType<{
600
+ logoUrl?: string | undefined;
601
+ darkLogoUrl?: string | undefined;
602
+ favicon?: string | undefined;
603
+ }, z.ZodTypeDef, {
604
+ logoUrl?: string | undefined;
605
+ darkLogoUrl?: string | undefined;
606
+ favicon?: string | undefined;
607
+ }>>;
608
+ termsOfUseUrl: z.ZodUnion<[z.ZodNullable<z.ZodOptional<z.ZodString>>, z.ZodLiteral<"">]>;
609
+ privacyPolicyUrl: z.ZodUnion<[z.ZodNullable<z.ZodOptional<z.ZodString>>, z.ZodLiteral<"">]>;
610
+ }, "strip", z.ZodTypeAny, {
611
+ displayName?: string | null | undefined;
612
+ branding?: {
613
+ logoUrl?: string | undefined;
614
+ darkLogoUrl?: string | undefined;
615
+ favicon?: string | undefined;
616
+ } | undefined;
617
+ termsOfUseUrl?: string | null | undefined;
618
+ privacyPolicyUrl?: string | null | undefined;
619
+ }, {
620
+ displayName?: string | null | undefined;
621
+ branding?: {
622
+ logoUrl?: string | undefined;
623
+ darkLogoUrl?: string | undefined;
624
+ favicon?: string | undefined;
625
+ } | undefined;
626
+ termsOfUseUrl?: string | null | undefined;
627
+ privacyPolicyUrl?: string | null | undefined;
628
+ }>;
629
+ export type ApplicationSignInExperienceCreate = z.infer<typeof applicationSignInExperienceCreateGuard>;
@@ -1,7 +1,48 @@
1
- import { Applications } from '../db-entries/index.js';
1
+ import { UserScope } from '@logto/core-kit';
2
+ import { z } from 'zod';
3
+ import { Applications, OrganizationScopes, Resources, Scopes, ApplicationSignInExperiences, } from '../db-entries/index.js';
2
4
  /** The guard for {@link FeaturedApplication}. */
3
5
  export const featuredApplicationGuard = Applications.guard.pick({
4
6
  id: true,
5
7
  name: true,
6
8
  type: true,
7
9
  });
10
+ export const applicationCreateGuard = Applications.createGuard
11
+ .omit({
12
+ id: true,
13
+ createdAt: true,
14
+ secret: true,
15
+ tenantId: true,
16
+ })
17
+ .partial()
18
+ .merge(Applications.createGuard.pick({ name: true, type: true }));
19
+ export const applicationPatchGuard = applicationCreateGuard.partial().omit({
20
+ type: true,
21
+ isThirdParty: true,
22
+ });
23
+ export const applicationUserConsentScopesResponseGuard = z.object({
24
+ organizationScopes: z.array(OrganizationScopes.guard.pick({ id: true, name: true, description: true })),
25
+ resourceScopes: z.array(z.object({
26
+ resource: Resources.guard.pick({ id: true, name: true, indicator: true }),
27
+ scopes: z.array(Scopes.guard.pick({ id: true, name: true, description: true })),
28
+ })),
29
+ userScopes: z.array(z.nativeEnum(UserScope)),
30
+ });
31
+ export var ApplicationUserConsentScopeType;
32
+ (function (ApplicationUserConsentScopeType) {
33
+ ApplicationUserConsentScopeType["OrganizationScopes"] = "organization-scopes";
34
+ ApplicationUserConsentScopeType["ResourceScopes"] = "resource-scopes";
35
+ ApplicationUserConsentScopeType["UserScopes"] = "user-scopes";
36
+ })(ApplicationUserConsentScopeType || (ApplicationUserConsentScopeType = {}));
37
+ export const applicationSignInExperienceCreateGuard = ApplicationSignInExperiences.createGuard
38
+ .omit({
39
+ applicationId: true,
40
+ tenantId: true,
41
+ termsOfUseUrl: true,
42
+ privacyPolicyUrl: true,
43
+ })
44
+ // Align with the sign-in-experience create guard.
45
+ .merge(z.object({
46
+ termsOfUseUrl: z.string().max(2048).url().optional().nullable().or(z.literal('')),
47
+ privacyPolicyUrl: z.string().max(2048).url().optional().nullable().or(z.literal('')),
48
+ }));
@@ -19,7 +19,7 @@ export const connectorResponseGuard = Connectors.guard
19
19
  }));
20
20
  export const connectorFactoryResponseGuard = z
21
21
  .object({
22
- type: z.nativeEnum(ConnectorType),
22
+ type: z.nativeEnum(ConnectorType), // Omit<BaseConnector<ConnectorType>, 'configGuard' | 'metadata'>
23
23
  isDemo: z.boolean().optional(),
24
24
  })
25
25
  .merge(connectorMetadataGuard);