@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,32 @@
1
+ import { sql } from '@silverhand/slonik';
2
+ import { applyTableRls, dropTableRls } from './utils/1704934999-tables.js';
3
+ const alteration = {
4
+ up: async (pool) => {
5
+ await pool.query(sql `
6
+ create table saml_application_sessions (
7
+ tenant_id varchar(21) not null
8
+ references tenants (id) on update cascade on delete cascade,
9
+ id varchar(32) not null,
10
+ application_id varchar(21) not null
11
+ references applications (id) on update cascade on delete cascade,
12
+ saml_request_id varchar(128) not null,
13
+ oidc_state varchar(32),
14
+ relay_state varchar(256),
15
+ raw_auth_request text not null,
16
+ created_at timestamptz not null default(now()),
17
+ expires_at timestamptz not null,
18
+ primary key (tenant_id, id),
19
+ constraint saml_application_sessions__application_type
20
+ check (check_application_type(application_id, 'SAML'))
21
+ );
22
+ `);
23
+ await applyTableRls(pool, 'saml_application_sessions');
24
+ },
25
+ down: async (pool) => {
26
+ await dropTableRls(pool, 'saml_application_sessions');
27
+ await pool.query(sql `
28
+ drop table if exists saml_application_sessions;
29
+ `);
30
+ },
31
+ };
32
+ export default alteration;
@@ -8,26 +8,27 @@ export declare enum ReservedPlanId {
8
8
  Free = "free",
9
9
  /**
10
10
  * @deprecated
11
- * In recent refactoring, the `hobby` plan is now treated as the `pro` plan.
12
- * Only use this plan ID to check if a plan is a `pro` plan or not.
13
- * This plan ID will be renamed to `pro` after legacy Stripe data is migrated by @darcyYe
14
- *
15
- * Todo @darcyYe:
16
- * - LOG-7846: Rename `hobby` to `pro` and `pro` to `legacy-pro`
17
- * - LOG-8339: Migrate legacy Stripe data
11
+ * Grandfathered Pro plan ID deprecated from 2024-11.
12
+ * Use {@link Pro202411} instead.
18
13
  */
19
- Hobby = "hobby",
20
14
  Pro = "pro",
21
- Enterprise = "enterprise",
22
- /**
23
- * @deprecated
24
- * Should not use this plan ID, we only use this tag as a record for the legacy `pro` plan since we will rename the `hobby` plan to be `pro`.
25
- */
26
- GrandfatheredPro = "grandfathered-pro",
27
15
  Development = "dev",
28
16
  /**
29
17
  * This plan ID is reserved for Admin tenant.
30
18
  * In our new pricing model, we plan to add a special plan for Admin tenant, previously, admin tenant is using the `pro` plan, which is not suitable.
31
19
  */
32
- Admin = "admin"
20
+ Admin = "admin",
21
+ /**
22
+ * The latest Pro plan ID applied from 2024-11.
23
+ */
24
+ Pro202411 = "pro-202411"
25
+ }
26
+ /**
27
+ * Tenant subscription related Redis cache keys.
28
+ *
29
+ * We use Redis to cache the tenant subscription data to reduce the number of requests to the Cloud.
30
+ * Both @logto/core and @logto/cloud will need to access the cache, so we define the cache keys here as the SSOT.
31
+ */
32
+ export declare enum SubscriptionRedisCacheKey {
33
+ Subscription = "subscription"
33
34
  }
@@ -9,26 +9,28 @@ export var ReservedPlanId;
9
9
  ReservedPlanId["Free"] = "free";
10
10
  /**
11
11
  * @deprecated
12
- * In recent refactoring, the `hobby` plan is now treated as the `pro` plan.
13
- * Only use this plan ID to check if a plan is a `pro` plan or not.
14
- * This plan ID will be renamed to `pro` after legacy Stripe data is migrated by @darcyYe
15
- *
16
- * Todo @darcyYe:
17
- * - LOG-7846: Rename `hobby` to `pro` and `pro` to `legacy-pro`
18
- * - LOG-8339: Migrate legacy Stripe data
12
+ * Grandfathered Pro plan ID deprecated from 2024-11.
13
+ * Use {@link Pro202411} instead.
19
14
  */
20
- ReservedPlanId["Hobby"] = "hobby";
21
15
  ReservedPlanId["Pro"] = "pro";
22
- ReservedPlanId["Enterprise"] = "enterprise";
23
- /**
24
- * @deprecated
25
- * Should not use this plan ID, we only use this tag as a record for the legacy `pro` plan since we will rename the `hobby` plan to be `pro`.
26
- */
27
- ReservedPlanId["GrandfatheredPro"] = "grandfathered-pro";
28
16
  ReservedPlanId["Development"] = "dev";
29
17
  /**
30
18
  * This plan ID is reserved for Admin tenant.
31
19
  * In our new pricing model, we plan to add a special plan for Admin tenant, previously, admin tenant is using the `pro` plan, which is not suitable.
32
20
  */
33
21
  ReservedPlanId["Admin"] = "admin";
22
+ /**
23
+ * The latest Pro plan ID applied from 2024-11.
24
+ */
25
+ ReservedPlanId["Pro202411"] = "pro-202411";
34
26
  })(ReservedPlanId || (ReservedPlanId = {}));
27
+ /**
28
+ * Tenant subscription related Redis cache keys.
29
+ *
30
+ * We use Redis to cache the tenant subscription data to reduce the number of requests to the Cloud.
31
+ * Both @logto/core and @logto/cloud will need to access the cache, so we define the cache keys here as the SSOT.
32
+ */
33
+ export var SubscriptionRedisCacheKey;
34
+ (function (SubscriptionRedisCacheKey) {
35
+ SubscriptionRedisCacheKey["Subscription"] = "subscription";
36
+ })(SubscriptionRedisCacheKey || (SubscriptionRedisCacheKey = {}));
@@ -0,0 +1,24 @@
1
+ import { AccountCenterFieldControl, GeneratedSchema } from './../foundations/index.js';
2
+ /**
3
+ *
4
+ * @remarks This is a type for database creation.
5
+ * @see {@link AccountCenter} for the original type.
6
+ */
7
+ export type CreateAccountCenter = {
8
+ tenantId?: string;
9
+ id: string;
10
+ /** The whole feature can be disabled */
11
+ enabled?: boolean;
12
+ /** Control each fields */
13
+ fields?: AccountCenterFieldControl;
14
+ };
15
+ export type AccountCenter = {
16
+ tenantId: string;
17
+ id: string;
18
+ /** The whole feature can be disabled */
19
+ enabled: boolean;
20
+ /** Control each fields */
21
+ fields: AccountCenterFieldControl;
22
+ };
23
+ export type AccountCenterKeys = 'tenantId' | 'id' | 'enabled' | 'fields';
24
+ export declare const AccountCenters: GeneratedSchema<AccountCenterKeys, CreateAccountCenter, AccountCenter, 'account_centers', 'account_center'>;
@@ -0,0 +1,34 @@
1
+ // THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
+ import { z } from 'zod';
3
+ import { accountCenterFieldControlGuard } from './../foundations/index.js';
4
+ const createGuard = z.object({
5
+ tenantId: z.string().max(21).optional(),
6
+ id: z.string().min(1).max(21),
7
+ enabled: z.boolean().optional(),
8
+ fields: accountCenterFieldControlGuard.optional(),
9
+ });
10
+ const guard = z.object({
11
+ tenantId: z.string().max(21),
12
+ id: z.string().min(1).max(21),
13
+ enabled: z.boolean(),
14
+ fields: accountCenterFieldControlGuard,
15
+ });
16
+ export const AccountCenters = Object.freeze({
17
+ table: 'account_centers',
18
+ tableSingular: 'account_center',
19
+ fields: {
20
+ tenantId: 'tenant_id',
21
+ id: 'id',
22
+ enabled: 'enabled',
23
+ fields: 'fields',
24
+ },
25
+ fieldKeys: [
26
+ 'tenantId',
27
+ 'id',
28
+ 'enabled',
29
+ 'fields',
30
+ ],
31
+ createGuard,
32
+ guard,
33
+ updateGuard: guard.partial(),
34
+ });
@@ -3,7 +3,8 @@ export declare enum ApplicationType {
3
3
  SPA = "SPA",
4
4
  Traditional = "Traditional",
5
5
  MachineToMachine = "MachineToMachine",
6
- Protected = "Protected"
6
+ Protected = "Protected",
7
+ SAML = "SAML"
7
8
  }
8
9
  export declare enum OrganizationInvitationStatus {
9
10
  Pending = "Pending",
@@ -6,6 +6,7 @@ export var ApplicationType;
6
6
  ApplicationType["Traditional"] = "Traditional";
7
7
  ApplicationType["MachineToMachine"] = "MachineToMachine";
8
8
  ApplicationType["Protected"] = "Protected";
9
+ ApplicationType["SAML"] = "SAML";
9
10
  })(ApplicationType || (ApplicationType = {}));
10
11
  export var OrganizationInvitationStatus;
11
12
  (function (OrganizationInvitationStatus) {
@@ -3,6 +3,7 @@ export * from './-after-all.js';
3
3
  export * from './-after-each.js';
4
4
  export * from './-before-all.js';
5
5
  export * from './-function.js';
6
+ export * from './account-center.js';
6
7
  export * from './application-secret.js';
7
8
  export * from './application-sign-in-experience.js';
8
9
  export * from './application-user-consent-organization-resource-scope.js';
@@ -41,6 +42,9 @@ export * from './personal-access-token.js';
41
42
  export * from './resource.js';
42
43
  export * from './role.js';
43
44
  export * from './roles-scope.js';
45
+ export * from './saml-application-config.js';
46
+ export * from './saml-application-secret.js';
47
+ export * from './saml-application-session.js';
44
48
  export * from './scope.js';
45
49
  export * from './sentinel-activity.js';
46
50
  export * from './service-log.js';
@@ -4,6 +4,7 @@ export * from './-after-all.js';
4
4
  export * from './-after-each.js';
5
5
  export * from './-before-all.js';
6
6
  export * from './-function.js';
7
+ export * from './account-center.js';
7
8
  export * from './application-secret.js';
8
9
  export * from './application-sign-in-experience.js';
9
10
  export * from './application-user-consent-organization-resource-scope.js';
@@ -42,6 +43,9 @@ export * from './personal-access-token.js';
42
43
  export * from './resource.js';
43
44
  export * from './role.js';
44
45
  export * from './roles-scope.js';
46
+ export * from './saml-application-config.js';
47
+ export * from './saml-application-secret.js';
48
+ export * from './saml-application-session.js';
45
49
  export * from './scope.js';
46
50
  export * from './sentinel-activity.js';
47
51
  export * from './service-log.js';
@@ -0,0 +1,24 @@
1
+ import { SamlAttributeMapping, SamlAcsUrl, GeneratedSchema } from './../foundations/index.js';
2
+ /**
3
+ * The SAML application config and SAML-type application have a one-to-one correspondence: 1. a SAML-type application can only have one SAML application config. (CANNOT use "semicolon" in comments, since it indicates the end of query.) 2. a SAML application config can only configure one SAML-type application.
4
+ *
5
+ * @remarks This is a type for database creation.
6
+ * @see {@link SamlApplicationConfig} for the original type.
7
+ */
8
+ export type CreateSamlApplicationConfig = {
9
+ applicationId: string;
10
+ tenantId?: string;
11
+ attributeMapping?: SamlAttributeMapping;
12
+ entityId?: string | null;
13
+ acsUrl?: SamlAcsUrl | null;
14
+ };
15
+ /** The SAML application config and SAML-type application have a one-to-one correspondence: 1. a SAML-type application can only have one SAML application config. (CANNOT use "semicolon" in comments, since it indicates the end of query.) 2. a SAML application config can only configure one SAML-type application. */
16
+ export type SamlApplicationConfig = {
17
+ applicationId: string;
18
+ tenantId: string;
19
+ attributeMapping: SamlAttributeMapping;
20
+ entityId: string | null;
21
+ acsUrl: SamlAcsUrl | null;
22
+ };
23
+ export type SamlApplicationConfigKeys = 'applicationId' | 'tenantId' | 'attributeMapping' | 'entityId' | 'acsUrl';
24
+ export declare const SamlApplicationConfigs: GeneratedSchema<SamlApplicationConfigKeys, CreateSamlApplicationConfig, SamlApplicationConfig, 'saml_application_configs', 'saml_application_config'>;
@@ -0,0 +1,38 @@
1
+ // THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
+ import { z } from 'zod';
3
+ import { samlAttributeMappingGuard, samlAcsUrlGuard } from './../foundations/index.js';
4
+ const createGuard = z.object({
5
+ applicationId: z.string().min(1).max(21),
6
+ tenantId: z.string().max(21).optional(),
7
+ attributeMapping: samlAttributeMappingGuard.optional(),
8
+ entityId: z.string().max(128).nullable().optional(),
9
+ acsUrl: samlAcsUrlGuard.nullable().optional(),
10
+ });
11
+ const guard = z.object({
12
+ applicationId: z.string().min(1).max(21),
13
+ tenantId: z.string().max(21),
14
+ attributeMapping: samlAttributeMappingGuard,
15
+ entityId: z.string().max(128).nullable(),
16
+ acsUrl: samlAcsUrlGuard.nullable(),
17
+ });
18
+ export const SamlApplicationConfigs = Object.freeze({
19
+ table: 'saml_application_configs',
20
+ tableSingular: 'saml_application_config',
21
+ fields: {
22
+ applicationId: 'application_id',
23
+ tenantId: 'tenant_id',
24
+ attributeMapping: 'attribute_mapping',
25
+ entityId: 'entity_id',
26
+ acsUrl: 'acs_url',
27
+ },
28
+ fieldKeys: [
29
+ 'applicationId',
30
+ 'tenantId',
31
+ 'attributeMapping',
32
+ 'entityId',
33
+ 'acsUrl',
34
+ ],
35
+ createGuard,
36
+ guard,
37
+ updateGuard: guard.partial(),
38
+ });
@@ -0,0 +1,28 @@
1
+ import { GeneratedSchema } from './../foundations/index.js';
2
+ /**
3
+ *
4
+ * @remarks This is a type for database creation.
5
+ * @see {@link SamlApplicationSecret} for the original type.
6
+ */
7
+ export type CreateSamlApplicationSecret = {
8
+ id: string;
9
+ tenantId?: string;
10
+ applicationId: string;
11
+ privateKey: string;
12
+ certificate: string;
13
+ createdAt?: number;
14
+ expiresAt: number;
15
+ active: boolean;
16
+ };
17
+ export type SamlApplicationSecret = {
18
+ id: string;
19
+ tenantId: string;
20
+ applicationId: string;
21
+ privateKey: string;
22
+ certificate: string;
23
+ createdAt: number;
24
+ expiresAt: number;
25
+ active: boolean;
26
+ };
27
+ export type SamlApplicationSecretKeys = 'id' | 'tenantId' | 'applicationId' | 'privateKey' | 'certificate' | 'createdAt' | 'expiresAt' | 'active';
28
+ export declare const SamlApplicationSecrets: GeneratedSchema<SamlApplicationSecretKeys, CreateSamlApplicationSecret, SamlApplicationSecret, 'saml_application_secrets', 'saml_application_secret'>;
@@ -0,0 +1,49 @@
1
+ // THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
+ import { z } from 'zod';
3
+ const createGuard = z.object({
4
+ id: z.string().min(1).max(21),
5
+ tenantId: z.string().max(21).optional(),
6
+ applicationId: z.string().min(1).max(21),
7
+ privateKey: z.string().min(1),
8
+ certificate: z.string().min(1),
9
+ createdAt: z.number().optional(),
10
+ expiresAt: z.number(),
11
+ active: z.boolean(),
12
+ });
13
+ const guard = z.object({
14
+ id: z.string().min(1).max(21),
15
+ tenantId: z.string().max(21),
16
+ applicationId: z.string().min(1).max(21),
17
+ privateKey: z.string().min(1),
18
+ certificate: z.string().min(1),
19
+ createdAt: z.number(),
20
+ expiresAt: z.number(),
21
+ active: z.boolean(),
22
+ });
23
+ export const SamlApplicationSecrets = Object.freeze({
24
+ table: 'saml_application_secrets',
25
+ tableSingular: 'saml_application_secret',
26
+ fields: {
27
+ id: 'id',
28
+ tenantId: 'tenant_id',
29
+ applicationId: 'application_id',
30
+ privateKey: 'private_key',
31
+ certificate: 'certificate',
32
+ createdAt: 'created_at',
33
+ expiresAt: 'expires_at',
34
+ active: 'active',
35
+ },
36
+ fieldKeys: [
37
+ 'id',
38
+ 'tenantId',
39
+ 'applicationId',
40
+ 'privateKey',
41
+ 'certificate',
42
+ 'createdAt',
43
+ 'expiresAt',
44
+ 'active',
45
+ ],
46
+ createGuard,
47
+ guard,
48
+ updateGuard: guard.partial(),
49
+ });
@@ -0,0 +1,40 @@
1
+ import { GeneratedSchema } from './../foundations/index.js';
2
+ /**
3
+ *
4
+ * @remarks This is a type for database creation.
5
+ * @see {@link SamlApplicationSession} for the original type.
6
+ */
7
+ export type CreateSamlApplicationSession = {
8
+ tenantId?: string;
9
+ /** The globally unique identifier of the session. */
10
+ id: string;
11
+ applicationId: string;
12
+ /** The identifier of the SAML SSO auth request ID, SAML request ID is pretty long. */
13
+ samlRequestId: string;
14
+ /** The identifier of the OIDC auth request state. */
15
+ oidcState?: string | null;
16
+ /** The relay state of the SAML auth request. */
17
+ relayState?: string | null;
18
+ /** The raw request of the SAML auth request. */
19
+ rawAuthRequest: string;
20
+ createdAt?: number;
21
+ expiresAt: number;
22
+ };
23
+ export type SamlApplicationSession = {
24
+ tenantId: string;
25
+ /** The globally unique identifier of the session. */
26
+ id: string;
27
+ applicationId: string;
28
+ /** The identifier of the SAML SSO auth request ID, SAML request ID is pretty long. */
29
+ samlRequestId: string;
30
+ /** The identifier of the OIDC auth request state. */
31
+ oidcState: string | null;
32
+ /** The relay state of the SAML auth request. */
33
+ relayState: string | null;
34
+ /** The raw request of the SAML auth request. */
35
+ rawAuthRequest: string;
36
+ createdAt: number;
37
+ expiresAt: number;
38
+ };
39
+ export type SamlApplicationSessionKeys = 'tenantId' | 'id' | 'applicationId' | 'samlRequestId' | 'oidcState' | 'relayState' | 'rawAuthRequest' | 'createdAt' | 'expiresAt';
40
+ export declare const SamlApplicationSessions: GeneratedSchema<SamlApplicationSessionKeys, CreateSamlApplicationSession, SamlApplicationSession, 'saml_application_sessions', 'saml_application_session'>;
@@ -0,0 +1,53 @@
1
+ // THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
+ import { z } from 'zod';
3
+ const createGuard = z.object({
4
+ tenantId: z.string().max(21).optional(),
5
+ id: z.string().min(1).max(32),
6
+ applicationId: z.string().min(1).max(21),
7
+ samlRequestId: z.string().min(1).max(128),
8
+ oidcState: z.string().max(32).nullable().optional(),
9
+ relayState: z.string().max(256).nullable().optional(),
10
+ rawAuthRequest: z.string().min(1),
11
+ createdAt: z.number().optional(),
12
+ expiresAt: z.number(),
13
+ });
14
+ const guard = z.object({
15
+ tenantId: z.string().max(21),
16
+ id: z.string().min(1).max(32),
17
+ applicationId: z.string().min(1).max(21),
18
+ samlRequestId: z.string().min(1).max(128),
19
+ oidcState: z.string().max(32).nullable(),
20
+ relayState: z.string().max(256).nullable(),
21
+ rawAuthRequest: z.string().min(1),
22
+ createdAt: z.number(),
23
+ expiresAt: z.number(),
24
+ });
25
+ export const SamlApplicationSessions = Object.freeze({
26
+ table: 'saml_application_sessions',
27
+ tableSingular: 'saml_application_session',
28
+ fields: {
29
+ tenantId: 'tenant_id',
30
+ id: 'id',
31
+ applicationId: 'application_id',
32
+ samlRequestId: 'saml_request_id',
33
+ oidcState: 'oidc_state',
34
+ relayState: 'relay_state',
35
+ rawAuthRequest: 'raw_auth_request',
36
+ createdAt: 'created_at',
37
+ expiresAt: 'expires_at',
38
+ },
39
+ fieldKeys: [
40
+ 'tenantId',
41
+ 'id',
42
+ 'applicationId',
43
+ 'samlRequestId',
44
+ 'oidcState',
45
+ 'relayState',
46
+ 'rawAuthRequest',
47
+ 'createdAt',
48
+ 'expiresAt',
49
+ ],
50
+ createGuard,
51
+ guard,
52
+ updateGuard: guard.partial(),
53
+ });
@@ -26,6 +26,9 @@ export type CreateSignInExperience = {
26
26
  passwordPolicy?: PartialPasswordPolicy;
27
27
  mfa?: Mfa;
28
28
  singleSignOnEnabled?: boolean;
29
+ supportEmail?: string | null;
30
+ supportWebsiteUrl?: string | null;
31
+ unknownSessionRedirectUrl?: string | null;
29
32
  };
30
33
  export type SignInExperience = {
31
34
  tenantId: string;
@@ -48,6 +51,9 @@ export type SignInExperience = {
48
51
  passwordPolicy: PartialPasswordPolicy;
49
52
  mfa: Mfa;
50
53
  singleSignOnEnabled: boolean;
54
+ supportEmail: string | null;
55
+ supportWebsiteUrl: string | null;
56
+ unknownSessionRedirectUrl: string | null;
51
57
  };
52
- export type SignInExperienceKeys = 'tenantId' | 'id' | 'color' | 'branding' | 'languageInfo' | 'termsOfUseUrl' | 'privacyPolicyUrl' | 'agreeToTermsPolicy' | 'signIn' | 'signUp' | 'socialSignIn' | 'socialSignInConnectorTargets' | 'signInMode' | 'customCss' | 'customContent' | 'customUiAssets' | 'passwordPolicy' | 'mfa' | 'singleSignOnEnabled';
58
+ export type SignInExperienceKeys = 'tenantId' | 'id' | 'color' | 'branding' | 'languageInfo' | 'termsOfUseUrl' | 'privacyPolicyUrl' | 'agreeToTermsPolicy' | 'signIn' | 'signUp' | 'socialSignIn' | 'socialSignInConnectorTargets' | 'signInMode' | 'customCss' | 'customContent' | 'customUiAssets' | 'passwordPolicy' | 'mfa' | 'singleSignOnEnabled' | 'supportEmail' | 'supportWebsiteUrl' | 'unknownSessionRedirectUrl';
53
59
  export declare const SignInExperiences: GeneratedSchema<SignInExperienceKeys, CreateSignInExperience, SignInExperience, 'sign_in_experiences', 'sign_in_experience'>;
@@ -22,6 +22,9 @@ const createGuard = z.object({
22
22
  passwordPolicy: partialPasswordPolicyGuard.optional(),
23
23
  mfa: mfaGuard.optional(),
24
24
  singleSignOnEnabled: z.boolean().optional(),
25
+ supportEmail: z.string().nullable().optional(),
26
+ supportWebsiteUrl: z.string().nullable().optional(),
27
+ unknownSessionRedirectUrl: z.string().nullable().optional(),
25
28
  });
26
29
  const guard = z.object({
27
30
  tenantId: z.string().max(21),
@@ -43,6 +46,9 @@ const guard = z.object({
43
46
  passwordPolicy: partialPasswordPolicyGuard,
44
47
  mfa: mfaGuard,
45
48
  singleSignOnEnabled: z.boolean(),
49
+ supportEmail: z.string().nullable(),
50
+ supportWebsiteUrl: z.string().nullable(),
51
+ unknownSessionRedirectUrl: z.string().nullable(),
46
52
  });
47
53
  export const SignInExperiences = Object.freeze({
48
54
  table: 'sign_in_experiences',
@@ -67,6 +73,9 @@ export const SignInExperiences = Object.freeze({
67
73
  passwordPolicy: 'password_policy',
68
74
  mfa: 'mfa',
69
75
  singleSignOnEnabled: 'single_sign_on_enabled',
76
+ supportEmail: 'support_email',
77
+ supportWebsiteUrl: 'support_website_url',
78
+ unknownSessionRedirectUrl: 'unknown_session_redirect_url',
70
79
  },
71
80
  fieldKeys: [
72
81
  'tenantId',
@@ -88,6 +97,9 @@ export const SignInExperiences = Object.freeze({
88
97
  'passwordPolicy',
89
98
  'mfa',
90
99
  'singleSignOnEnabled',
100
+ 'supportEmail',
101
+ 'supportWebsiteUrl',
102
+ 'unknownSessionRedirectUrl',
91
103
  ],
92
104
  createGuard,
93
105
  guard,
@@ -0,0 +1,43 @@
1
+ import { z } from 'zod';
2
+ export declare enum AccountCenterControlValue {
3
+ Off = "Off",
4
+ ReadOnly = "ReadOnly",
5
+ Edit = "Edit"
6
+ }
7
+ /**
8
+ * Control list of each field in the account center (profile API)
9
+ * all fields are optional, if not set, the default value is `Off`
10
+ * this can make the alteration of the field control easier
11
+ */
12
+ export declare const accountCenterFieldControlGuard: z.ZodObject<{
13
+ name: z.ZodOptional<z.ZodNativeEnum<typeof AccountCenterControlValue>>;
14
+ avatar: z.ZodOptional<z.ZodNativeEnum<typeof AccountCenterControlValue>>;
15
+ profile: z.ZodOptional<z.ZodNativeEnum<typeof AccountCenterControlValue>>;
16
+ email: z.ZodOptional<z.ZodNativeEnum<typeof AccountCenterControlValue>>;
17
+ phone: z.ZodOptional<z.ZodNativeEnum<typeof AccountCenterControlValue>>;
18
+ password: z.ZodOptional<z.ZodNativeEnum<typeof AccountCenterControlValue>>;
19
+ username: z.ZodOptional<z.ZodNativeEnum<typeof AccountCenterControlValue>>;
20
+ social: z.ZodOptional<z.ZodNativeEnum<typeof AccountCenterControlValue>>;
21
+ customData: z.ZodOptional<z.ZodNativeEnum<typeof AccountCenterControlValue>>;
22
+ }, "strip", z.ZodTypeAny, {
23
+ name?: AccountCenterControlValue | undefined;
24
+ username?: AccountCenterControlValue | undefined;
25
+ email?: AccountCenterControlValue | undefined;
26
+ phone?: AccountCenterControlValue | undefined;
27
+ password?: AccountCenterControlValue | undefined;
28
+ profile?: AccountCenterControlValue | undefined;
29
+ avatar?: AccountCenterControlValue | undefined;
30
+ social?: AccountCenterControlValue | undefined;
31
+ customData?: AccountCenterControlValue | undefined;
32
+ }, {
33
+ name?: AccountCenterControlValue | undefined;
34
+ username?: AccountCenterControlValue | undefined;
35
+ email?: AccountCenterControlValue | undefined;
36
+ phone?: AccountCenterControlValue | undefined;
37
+ password?: AccountCenterControlValue | undefined;
38
+ profile?: AccountCenterControlValue | undefined;
39
+ avatar?: AccountCenterControlValue | undefined;
40
+ social?: AccountCenterControlValue | undefined;
41
+ customData?: AccountCenterControlValue | undefined;
42
+ }>;
43
+ export type AccountCenterFieldControl = z.infer<typeof accountCenterFieldControlGuard>;
@@ -0,0 +1,25 @@
1
+ import { z } from 'zod';
2
+ export var AccountCenterControlValue;
3
+ (function (AccountCenterControlValue) {
4
+ AccountCenterControlValue["Off"] = "Off";
5
+ AccountCenterControlValue["ReadOnly"] = "ReadOnly";
6
+ AccountCenterControlValue["Edit"] = "Edit";
7
+ })(AccountCenterControlValue || (AccountCenterControlValue = {}));
8
+ /**
9
+ * Control list of each field in the account center (profile API)
10
+ * all fields are optional, if not set, the default value is `Off`
11
+ * this can make the alteration of the field control easier
12
+ */
13
+ export const accountCenterFieldControlGuard = z
14
+ .object({
15
+ name: z.nativeEnum(AccountCenterControlValue),
16
+ avatar: z.nativeEnum(AccountCenterControlValue),
17
+ profile: z.nativeEnum(AccountCenterControlValue),
18
+ email: z.nativeEnum(AccountCenterControlValue),
19
+ phone: z.nativeEnum(AccountCenterControlValue),
20
+ password: z.nativeEnum(AccountCenterControlValue),
21
+ username: z.nativeEnum(AccountCenterControlValue),
22
+ social: z.nativeEnum(AccountCenterControlValue),
23
+ customData: z.nativeEnum(AccountCenterControlValue),
24
+ })
25
+ .partial();
@@ -9,5 +9,8 @@ export * from './users.js';
9
9
  export * from './sso-connector.js';
10
10
  export * from './applications.js';
11
11
  export * from './verification-records.js';
12
+ export * from './account-centers.js';
13
+ export * from './saml-application-configs.js';
14
+ export * from './saml-application-sessions.js';
12
15
  export { configurableConnectorMetadataGuard, type ConfigurableConnectorMetadata, jsonGuard, jsonObjectGuard, } from '@logto/connector-kit';
13
16
  export type { Json, JsonObject } from '@withtyped/server';
@@ -9,4 +9,7 @@ export * from './users.js';
9
9
  export * from './sso-connector.js';
10
10
  export * from './applications.js';
11
11
  export * from './verification-records.js';
12
+ export * from './account-centers.js';
13
+ export * from './saml-application-configs.js';
14
+ export * from './saml-application-sessions.js';
12
15
  export { configurableConnectorMetadataGuard, jsonGuard, jsonObjectGuard, } from '@logto/connector-kit';
@@ -0,0 +1,21 @@
1
+ import { z } from 'zod';
2
+ export type SamlAttributeMapping = Record<string, string>;
3
+ export declare const samlAttributeMappingGuard: z.ZodRecord<z.ZodString, z.ZodString>;
4
+ export declare enum BindingType {
5
+ Post = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST",
6
+ Redirect = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
7
+ }
8
+ export type SamlAcsUrl = {
9
+ binding: BindingType;
10
+ url: string;
11
+ };
12
+ export declare const samlAcsUrlGuard: z.ZodObject<{
13
+ binding: z.ZodNativeEnum<typeof BindingType>;
14
+ url: z.ZodString;
15
+ }, "strip", z.ZodTypeAny, {
16
+ url: string;
17
+ binding: BindingType;
18
+ }, {
19
+ url: string;
20
+ binding: BindingType;
21
+ }>;
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+ export const samlAttributeMappingGuard = z.record(z.string());
3
+ export var BindingType;
4
+ (function (BindingType) {
5
+ BindingType["Post"] = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST";
6
+ BindingType["Redirect"] = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect";
7
+ })(BindingType || (BindingType = {}));
8
+ export const samlAcsUrlGuard = z.object({
9
+ binding: z.nativeEnum(BindingType),
10
+ url: z.string().url(),
11
+ });