@logto/schemas 1.19.0 → 1.20.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 (43) hide show
  1. package/alterations/1.20.0-1723448981-personal-access-tokens.ts +35 -0
  2. package/alterations/1.20.0-1724229102-add-report-sub-updates-cloud-scope.ts +102 -0
  3. package/alterations/1.20.0-1724316971-add-verified-identifier-to-verification-statuses.ts +18 -0
  4. package/alterations/1.20.0-1725971571-add-verification-record.ts +35 -0
  5. package/alterations-js/1.20.0-1723448981-personal-access-tokens.js +30 -0
  6. package/alterations-js/1.20.0-1724229102-add-report-sub-updates-cloud-scope.js +59 -0
  7. package/alterations-js/1.20.0-1724316971-add-verified-identifier-to-verification-statuses.js +14 -0
  8. package/alterations-js/1.20.0-1725971571-add-verification-record.js +30 -0
  9. package/lib/consts/experience.d.ts +8 -5
  10. package/lib/consts/experience.js +3 -0
  11. package/lib/consts/oidc.d.ts +34 -3
  12. package/lib/consts/oidc.js +26 -1
  13. package/lib/consts/subscriptions.d.ts +1 -0
  14. package/lib/consts/subscriptions.js +1 -0
  15. package/lib/db-entries/index.d.ts +2 -0
  16. package/lib/db-entries/index.js +2 -0
  17. package/lib/db-entries/personal-access-token.d.ts +26 -0
  18. package/lib/db-entries/personal-access-token.js +41 -0
  19. package/lib/db-entries/verification-record.d.ts +26 -0
  20. package/lib/db-entries/verification-record.js +42 -0
  21. package/lib/db-entries/verification-status.d.ts +3 -1
  22. package/lib/db-entries/verification-status.js +4 -0
  23. package/lib/foundations/jsonb-types/index.d.ts +1 -0
  24. package/lib/foundations/jsonb-types/index.js +1 -0
  25. package/lib/foundations/jsonb-types/logs.d.ts +3 -0
  26. package/lib/foundations/jsonb-types/logs.js +1 -0
  27. package/lib/foundations/jsonb-types/sign-in-experience.d.ts +4 -3
  28. package/lib/foundations/jsonb-types/sign-in-experience.js +1 -0
  29. package/lib/foundations/jsonb-types/verification-records.d.ts +13 -0
  30. package/lib/foundations/jsonb-types/verification-records.js +14 -0
  31. package/lib/seeds/cloud-api.d.ts +4 -0
  32. package/lib/seeds/cloud-api.js +5 -0
  33. package/lib/types/connector.d.ts +8 -0
  34. package/lib/types/interactions.d.ts +0 -12
  35. package/lib/types/interactions.js +0 -13
  36. package/lib/types/log/interaction.d.ts +2 -2
  37. package/lib/types/logto-config/jwt-customizer.d.ts +48 -0
  38. package/lib/types/logto-config/jwt-customizer.js +17 -0
  39. package/lib/types/sign-in-experience.d.ts +6 -2
  40. package/package.json +4 -4
  41. package/tables/personal_access_tokens.sql +16 -0
  42. package/tables/verification_records.sql +15 -0
  43. package/tables/verification_statuses.sql +1 -0
@@ -0,0 +1,35 @@
1
+ import { sql } from '@silverhand/slonik';
2
+
3
+ import type { AlterationScript } from '../lib/types/alteration.js';
4
+
5
+ import { applyTableRls, dropTableRls } from './utils/1704934999-tables.js';
6
+
7
+ const alteration: AlterationScript = {
8
+ up: async (pool) => {
9
+ await pool.query(sql`
10
+ create table personal_access_tokens (
11
+ tenant_id varchar(21) not null
12
+ references tenants (id) on update cascade on delete cascade,
13
+ user_id varchar(21) not null
14
+ references users (id) on update cascade on delete cascade,
15
+ /** The name of the secret. Should be unique within the user. */
16
+ name varchar(256) not null,
17
+ value varchar(64) not null,
18
+ created_at timestamptz not null default now(),
19
+ expires_at timestamptz,
20
+ primary key (tenant_id, user_id, name)
21
+ );
22
+
23
+ create index personal_access_token__value on personal_access_tokens (tenant_id, value);
24
+ `);
25
+ await applyTableRls(pool, 'personal_access_tokens');
26
+ },
27
+ down: async (pool) => {
28
+ await dropTableRls(pool, 'personal_access_tokens');
29
+ await pool.query(sql`
30
+ drop table personal_access_tokens;
31
+ `);
32
+ },
33
+ };
34
+
35
+ export default alteration;
@@ -0,0 +1,102 @@
1
+ import { sql } from '@silverhand/slonik';
2
+
3
+ import type { AlterationScript } from '../lib/types/alteration.js';
4
+
5
+ import { generateStandardId } from './utils/1716643968-id-generation.js';
6
+
7
+ type Resource = {
8
+ tenantId: string;
9
+ id: string;
10
+ name: string;
11
+ indicator: string;
12
+ isDefault: boolean;
13
+ };
14
+
15
+ type Scope = {
16
+ tenantId: string;
17
+ id: string;
18
+ resourceId: string;
19
+ name: string;
20
+ description: string;
21
+ };
22
+
23
+ type Role = {
24
+ tenantId: string;
25
+ id: string;
26
+ name: string;
27
+ description: string;
28
+ };
29
+
30
+ const cloudApiIndicator = 'https://cloud.logto.io/api';
31
+
32
+ const cloudConnectionAppRoleName = 'tenantApplication';
33
+
34
+ const adminTenantId = 'admin';
35
+
36
+ const reportSubscriptionUpdatesScopeName = 'report:subscription:updates';
37
+ const reportSubscriptionUpdatesScopeDescription =
38
+ 'Allow reporting changes on Stripe subscription to Logto Cloud.';
39
+
40
+ const alteration: AlterationScript = {
41
+ up: async (pool) => {
42
+ // Get the Cloud API resource
43
+ const cloudApiResource = await pool.maybeOne<Resource>(sql`
44
+ select * from resources
45
+ where tenant_id = ${adminTenantId}
46
+ and indicator = ${cloudApiIndicator}
47
+ `);
48
+
49
+ if (!cloudApiResource) {
50
+ return;
51
+ }
52
+
53
+ // Get cloud connection application role
54
+ const tenantApplicationRole = await pool.one<Role>(sql`
55
+ select * from roles
56
+ where tenant_id = ${adminTenantId}
57
+ and name = ${cloudConnectionAppRoleName} and type = 'MachineToMachine'
58
+ `);
59
+
60
+ // Create the `report:subscription:updates` scope
61
+ const reportSubscriptionUpdatesCloudScope = await pool.one<Scope>(sql`
62
+ insert into scopes (id, tenant_id, resource_id, name, description)
63
+ values (${generateStandardId()}, ${adminTenantId}, ${
64
+ cloudApiResource.id
65
+ }, ${reportSubscriptionUpdatesScopeName}, ${reportSubscriptionUpdatesScopeDescription})
66
+ on conflict (tenant_id, name, resource_id) do nothing
67
+ returning *;
68
+ `);
69
+
70
+ // Assign the `report:subscription:updates` scope to cloud connection application role
71
+ await pool.query(sql`
72
+ insert into roles_scopes (id, tenant_id, role_id, scope_id)
73
+ values (${generateStandardId()}, ${adminTenantId}, ${tenantApplicationRole.id}, ${
74
+ reportSubscriptionUpdatesCloudScope.id
75
+ }) on conflict (tenant_id, role_id, scope_id) do nothing;
76
+ `);
77
+ },
78
+ down: async (pool) => {
79
+ // Get the Cloud API resource
80
+ const cloudApiResource = await pool.maybeOne<Resource>(sql`
81
+ select * from resources
82
+ where tenant_id = ${adminTenantId}
83
+ and indicator = ${cloudApiIndicator}
84
+ `);
85
+
86
+ if (!cloudApiResource) {
87
+ return;
88
+ }
89
+
90
+ // Remove the `report:subscription:updates` scope
91
+ await pool.query(sql`
92
+ delete from scopes
93
+ where
94
+ tenant_id = ${adminTenantId} and
95
+ name = ${reportSubscriptionUpdatesScopeName} and
96
+ description = ${reportSubscriptionUpdatesScopeDescription} and
97
+ resource_id = ${cloudApiResource.id}
98
+ `);
99
+ },
100
+ };
101
+
102
+ export default alteration;
@@ -0,0 +1,18 @@
1
+ import { sql } from '@silverhand/slonik';
2
+
3
+ import type { AlterationScript } from '../lib/types/alteration.js';
4
+
5
+ const alteration: AlterationScript = {
6
+ up: async (pool) => {
7
+ await pool.query(sql`
8
+ alter table verification_statuses add column verified_identifier varchar(255);
9
+ `);
10
+ },
11
+ down: async (pool) => {
12
+ await pool.query(sql`
13
+ alter table verification_statuses drop column verified_identifier;
14
+ `);
15
+ },
16
+ };
17
+
18
+ export default alteration;
@@ -0,0 +1,35 @@
1
+ import { sql } from '@silverhand/slonik';
2
+
3
+ import type { AlterationScript } from '../lib/types/alteration.js';
4
+
5
+ import { applyTableRls, dropTableRls } from './utils/1704934999-tables.js';
6
+
7
+ const alteration: AlterationScript = {
8
+ up: async (pool) => {
9
+ await pool.query(sql`
10
+ create table verification_records (
11
+ tenant_id varchar(21) not null
12
+ references tenants (id) on update cascade on delete cascade,
13
+ id varchar(21) not null,
14
+ user_id varchar(21)
15
+ references users (id) on update cascade on delete cascade,
16
+ created_at timestamptz not null default(now()),
17
+ expires_at timestamptz not null,
18
+ data jsonb /* @use VerificationRecordData */ not null default '{}'::jsonb,
19
+ primary key (id)
20
+ );
21
+
22
+ create index verification_records__id
23
+ on verification_records (tenant_id, id);
24
+ `);
25
+ await applyTableRls(pool, 'verification_records');
26
+ },
27
+ down: async (pool) => {
28
+ await dropTableRls(pool, 'verification_records');
29
+ await pool.query(sql`
30
+ drop table verification_records;
31
+ `);
32
+ },
33
+ };
34
+
35
+ export default alteration;
@@ -0,0 +1,30 @@
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 personal_access_tokens (
7
+ tenant_id varchar(21) not null
8
+ references tenants (id) on update cascade on delete cascade,
9
+ user_id varchar(21) not null
10
+ references users (id) on update cascade on delete cascade,
11
+ /** The name of the secret. Should be unique within the user. */
12
+ name varchar(256) not null,
13
+ value varchar(64) not null,
14
+ created_at timestamptz not null default now(),
15
+ expires_at timestamptz,
16
+ primary key (tenant_id, user_id, name)
17
+ );
18
+
19
+ create index personal_access_token__value on personal_access_tokens (tenant_id, value);
20
+ `);
21
+ await applyTableRls(pool, 'personal_access_tokens');
22
+ },
23
+ down: async (pool) => {
24
+ await dropTableRls(pool, 'personal_access_tokens');
25
+ await pool.query(sql `
26
+ drop table personal_access_tokens;
27
+ `);
28
+ },
29
+ };
30
+ export default alteration;
@@ -0,0 +1,59 @@
1
+ import { sql } from '@silverhand/slonik';
2
+ import { generateStandardId } from './utils/1716643968-id-generation.js';
3
+ const cloudApiIndicator = 'https://cloud.logto.io/api';
4
+ const cloudConnectionAppRoleName = 'tenantApplication';
5
+ const adminTenantId = 'admin';
6
+ const reportSubscriptionUpdatesScopeName = 'report:subscription:updates';
7
+ const reportSubscriptionUpdatesScopeDescription = 'Allow reporting changes on Stripe subscription to Logto Cloud.';
8
+ const alteration = {
9
+ up: async (pool) => {
10
+ // Get the Cloud API resource
11
+ const cloudApiResource = await pool.maybeOne(sql `
12
+ select * from resources
13
+ where tenant_id = ${adminTenantId}
14
+ and indicator = ${cloudApiIndicator}
15
+ `);
16
+ if (!cloudApiResource) {
17
+ return;
18
+ }
19
+ // Get cloud connection application role
20
+ const tenantApplicationRole = await pool.one(sql `
21
+ select * from roles
22
+ where tenant_id = ${adminTenantId}
23
+ and name = ${cloudConnectionAppRoleName} and type = 'MachineToMachine'
24
+ `);
25
+ // Create the `report:subscription:updates` scope
26
+ const reportSubscriptionUpdatesCloudScope = await pool.one(sql `
27
+ insert into scopes (id, tenant_id, resource_id, name, description)
28
+ values (${generateStandardId()}, ${adminTenantId}, ${cloudApiResource.id}, ${reportSubscriptionUpdatesScopeName}, ${reportSubscriptionUpdatesScopeDescription})
29
+ on conflict (tenant_id, name, resource_id) do nothing
30
+ returning *;
31
+ `);
32
+ // Assign the `report:subscription:updates` scope to cloud connection application role
33
+ await pool.query(sql `
34
+ insert into roles_scopes (id, tenant_id, role_id, scope_id)
35
+ values (${generateStandardId()}, ${adminTenantId}, ${tenantApplicationRole.id}, ${reportSubscriptionUpdatesCloudScope.id}) on conflict (tenant_id, role_id, scope_id) do nothing;
36
+ `);
37
+ },
38
+ down: async (pool) => {
39
+ // Get the Cloud API resource
40
+ const cloudApiResource = await pool.maybeOne(sql `
41
+ select * from resources
42
+ where tenant_id = ${adminTenantId}
43
+ and indicator = ${cloudApiIndicator}
44
+ `);
45
+ if (!cloudApiResource) {
46
+ return;
47
+ }
48
+ // Remove the `report:subscription:updates` scope
49
+ await pool.query(sql `
50
+ delete from scopes
51
+ where
52
+ tenant_id = ${adminTenantId} and
53
+ name = ${reportSubscriptionUpdatesScopeName} and
54
+ description = ${reportSubscriptionUpdatesScopeDescription} and
55
+ resource_id = ${cloudApiResource.id}
56
+ `);
57
+ },
58
+ };
59
+ export default alteration;
@@ -0,0 +1,14 @@
1
+ import { sql } from '@silverhand/slonik';
2
+ const alteration = {
3
+ up: async (pool) => {
4
+ await pool.query(sql `
5
+ alter table verification_statuses add column verified_identifier varchar(255);
6
+ `);
7
+ },
8
+ down: async (pool) => {
9
+ await pool.query(sql `
10
+ alter table verification_statuses drop column verified_identifier;
11
+ `);
12
+ },
13
+ };
14
+ export default alteration;
@@ -0,0 +1,30 @@
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 verification_records (
7
+ tenant_id varchar(21) not null
8
+ references tenants (id) on update cascade on delete cascade,
9
+ id varchar(21) not null,
10
+ user_id varchar(21)
11
+ references users (id) on update cascade on delete cascade,
12
+ created_at timestamptz not null default(now()),
13
+ expires_at timestamptz not null,
14
+ data jsonb /* @use VerificationRecordData */ not null default '{}'::jsonb,
15
+ primary key (id)
16
+ );
17
+
18
+ create index verification_records__id
19
+ on verification_records (tenant_id, id);
20
+ `);
21
+ await applyTableRls(pool, 'verification_records');
22
+ },
23
+ down: async (pool) => {
24
+ await dropTableRls(pool, 'verification_records');
25
+ await pool.query(sql `
26
+ drop table verification_records;
27
+ `);
28
+ },
29
+ };
30
+ export default alteration;
@@ -1,8 +1,11 @@
1
1
  export declare const experience: Readonly<{
2
- routes: Readonly<{
3
- signIn: "sign-in";
4
- register: "register";
5
- sso: "single-sign-on";
6
- consent: "consent";
2
+ readonly routes: Readonly<{
3
+ readonly signIn: "sign-in";
4
+ readonly register: "register";
5
+ readonly sso: "single-sign-on";
6
+ readonly consent: "consent";
7
+ readonly resetPassword: "reset-password";
8
+ readonly identifierSignIn: "identifier-sign-in";
9
+ readonly identifierRegister: "identifier-register";
7
10
  }>;
8
11
  }>;
@@ -3,6 +3,9 @@ const routes = Object.freeze({
3
3
  register: 'register',
4
4
  sso: 'single-sign-on',
5
5
  consent: 'consent',
6
+ resetPassword: 'reset-password',
7
+ identifierSignIn: 'identifier-sign-in',
8
+ identifierRegister: 'identifier-register',
6
9
  });
7
10
  export const experience = Object.freeze({
8
11
  routes,
@@ -32,7 +32,24 @@ export declare enum ExtraParamsKey {
32
32
  * Override the default sign-in experience configuration with the settings from the specified
33
33
  * organization ID.
34
34
  */
35
- OrganizationId = "organization_id"
35
+ OrganizationId = "organization_id",
36
+ /**
37
+ * Provides a hint about the login identifier the user might use.
38
+ * This can be used to pre-fill the identifier field **only on the first screen** of the sign-in/sign-up flow.
39
+ */
40
+ LoginHint = "login_hint",
41
+ /**
42
+ * Specifies the identifier used in the identifier sign-in or identifier register page.
43
+ *
44
+ * This parameter is applicable only when first_screen is set to either `FirstScreen.IdentifierSignIn` or `FirstScreen.IdentifierRegister`.
45
+ * Multiple identifiers can be provided in the identifier parameter, separated by spaces.
46
+ *
47
+ * If the provided identifier is not supported in the Logto sign-in experience configuration, it will be ignored,
48
+ * and if no one of them is supported, it will fallback to the sign-in / sign-up method value set in the sign-in experience configuration.
49
+ *
50
+ * @see {@link SignInIdentifier} for available values.
51
+ */
52
+ Identifier = "identifier"
36
53
  }
37
54
  /** @deprecated Use {@link FirstScreen} instead. */
38
55
  export declare enum InteractionMode {
@@ -40,28 +57,42 @@ export declare enum InteractionMode {
40
57
  SignUp = "signUp"
41
58
  }
42
59
  export declare enum FirstScreen {
43
- SignIn = "signIn",
44
- Register = "register"
60
+ SignIn = "sign_in",
61
+ Register = "register",
62
+ ResetPassword = "reset_password",
63
+ IdentifierSignIn = "identifier:sign_in",
64
+ IdentifierRegister = "identifier:register",
65
+ SingleSignOn = "single_sign_on",
66
+ /** @deprecated Use snake_case 'sign_in' instead. */
67
+ SignInDeprecated = "signIn"
45
68
  }
46
69
  export declare const extraParamsObjectGuard: z.ZodObject<{
47
70
  interaction_mode: z.ZodOptional<z.ZodNativeEnum<typeof InteractionMode>>;
48
71
  first_screen: z.ZodOptional<z.ZodNativeEnum<typeof FirstScreen>>;
49
72
  direct_sign_in: z.ZodOptional<z.ZodString>;
50
73
  organization_id: z.ZodOptional<z.ZodString>;
74
+ login_hint: z.ZodOptional<z.ZodString>;
75
+ identifier: z.ZodOptional<z.ZodString>;
51
76
  }, "strip", z.ZodTypeAny, {
52
77
  interaction_mode?: InteractionMode | undefined;
53
78
  first_screen?: FirstScreen | undefined;
54
79
  direct_sign_in?: string | undefined;
55
80
  organization_id?: string | undefined;
81
+ login_hint?: string | undefined;
82
+ identifier?: string | undefined;
56
83
  }, {
57
84
  interaction_mode?: InteractionMode | undefined;
58
85
  first_screen?: FirstScreen | undefined;
59
86
  direct_sign_in?: string | undefined;
60
87
  organization_id?: string | undefined;
88
+ login_hint?: string | undefined;
89
+ identifier?: string | undefined;
61
90
  }>;
62
91
  export type ExtraParamsObject = Partial<{
63
92
  [ExtraParamsKey.InteractionMode]: InteractionMode;
64
93
  [ExtraParamsKey.FirstScreen]: FirstScreen;
65
94
  [ExtraParamsKey.DirectSignIn]: string;
66
95
  [ExtraParamsKey.OrganizationId]: string;
96
+ [ExtraParamsKey.LoginHint]: string;
97
+ [ExtraParamsKey.Identifier]: string;
67
98
  }>;
@@ -35,6 +35,23 @@ export var ExtraParamsKey;
35
35
  * organization ID.
36
36
  */
37
37
  ExtraParamsKey["OrganizationId"] = "organization_id";
38
+ /**
39
+ * Provides a hint about the login identifier the user might use.
40
+ * This can be used to pre-fill the identifier field **only on the first screen** of the sign-in/sign-up flow.
41
+ */
42
+ ExtraParamsKey["LoginHint"] = "login_hint";
43
+ /**
44
+ * Specifies the identifier used in the identifier sign-in or identifier register page.
45
+ *
46
+ * This parameter is applicable only when first_screen is set to either `FirstScreen.IdentifierSignIn` or `FirstScreen.IdentifierRegister`.
47
+ * Multiple identifiers can be provided in the identifier parameter, separated by spaces.
48
+ *
49
+ * If the provided identifier is not supported in the Logto sign-in experience configuration, it will be ignored,
50
+ * and if no one of them is supported, it will fallback to the sign-in / sign-up method value set in the sign-in experience configuration.
51
+ *
52
+ * @see {@link SignInIdentifier} for available values.
53
+ */
54
+ ExtraParamsKey["Identifier"] = "identifier";
38
55
  })(ExtraParamsKey || (ExtraParamsKey = {}));
39
56
  /** @deprecated Use {@link FirstScreen} instead. */
40
57
  export var InteractionMode;
@@ -44,8 +61,14 @@ export var InteractionMode;
44
61
  })(InteractionMode || (InteractionMode = {}));
45
62
  export var FirstScreen;
46
63
  (function (FirstScreen) {
47
- FirstScreen["SignIn"] = "signIn";
64
+ FirstScreen["SignIn"] = "sign_in";
48
65
  FirstScreen["Register"] = "register";
66
+ FirstScreen["ResetPassword"] = "reset_password";
67
+ FirstScreen["IdentifierSignIn"] = "identifier:sign_in";
68
+ FirstScreen["IdentifierRegister"] = "identifier:register";
69
+ FirstScreen["SingleSignOn"] = "single_sign_on";
70
+ /** @deprecated Use snake_case 'sign_in' instead. */
71
+ FirstScreen["SignInDeprecated"] = "signIn";
49
72
  })(FirstScreen || (FirstScreen = {}));
50
73
  export const extraParamsObjectGuard = z
51
74
  .object({
@@ -53,5 +76,7 @@ export const extraParamsObjectGuard = z
53
76
  [ExtraParamsKey.FirstScreen]: z.nativeEnum(FirstScreen),
54
77
  [ExtraParamsKey.DirectSignIn]: z.string(),
55
78
  [ExtraParamsKey.OrganizationId]: z.string(),
79
+ [ExtraParamsKey.LoginHint]: z.string(),
80
+ [ExtraParamsKey.Identifier]: z.string(),
56
81
  })
57
82
  .partial();
@@ -18,6 +18,7 @@ export declare enum ReservedPlanId {
18
18
  */
19
19
  Hobby = "hobby",
20
20
  Pro = "pro",
21
+ Enterprise = "enterprise",
21
22
  /**
22
23
  * @deprecated
23
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`.
@@ -19,6 +19,7 @@ export var ReservedPlanId;
19
19
  */
20
20
  ReservedPlanId["Hobby"] = "hobby";
21
21
  ReservedPlanId["Pro"] = "pro";
22
+ ReservedPlanId["Enterprise"] = "enterprise";
22
23
  /**
23
24
  * @deprecated
24
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`.
@@ -36,6 +36,7 @@ export * from './organization-scope.js';
36
36
  export * from './organization-user-relation.js';
37
37
  export * from './organization.js';
38
38
  export * from './passcode.js';
39
+ export * from './personal-access-token.js';
39
40
  export * from './resource.js';
40
41
  export * from './role.js';
41
42
  export * from './roles-scope.js';
@@ -49,4 +50,5 @@ export * from './system.js';
49
50
  export * from './user-sso-identity.js';
50
51
  export * from './user.js';
51
52
  export * from './users-role.js';
53
+ export * from './verification-record.js';
52
54
  export * from './verification-status.js';
@@ -37,6 +37,7 @@ export * from './organization-scope.js';
37
37
  export * from './organization-user-relation.js';
38
38
  export * from './organization.js';
39
39
  export * from './passcode.js';
40
+ export * from './personal-access-token.js';
40
41
  export * from './resource.js';
41
42
  export * from './role.js';
42
43
  export * from './roles-scope.js';
@@ -50,4 +51,5 @@ export * from './system.js';
50
51
  export * from './user-sso-identity.js';
51
52
  export * from './user.js';
52
53
  export * from './users-role.js';
54
+ export * from './verification-record.js';
53
55
  export * from './verification-status.js';
@@ -0,0 +1,26 @@
1
+ import { GeneratedSchema } from './../foundations/index.js';
2
+ /**
3
+ *
4
+ * @remarks This is a type for database creation.
5
+ * @see {@link PersonalAccessToken} for the original type.
6
+ */
7
+ export type CreatePersonalAccessToken = {
8
+ tenantId?: string;
9
+ userId: string;
10
+ /** The name of the secret. Should be unique within the user. */
11
+ name: string;
12
+ value: string;
13
+ createdAt?: number;
14
+ expiresAt?: number | null;
15
+ };
16
+ export type PersonalAccessToken = {
17
+ tenantId: string;
18
+ userId: string;
19
+ /** The name of the secret. Should be unique within the user. */
20
+ name: string;
21
+ value: string;
22
+ createdAt: number;
23
+ expiresAt: number | null;
24
+ };
25
+ export type PersonalAccessTokenKeys = 'tenantId' | 'userId' | 'name' | 'value' | 'createdAt' | 'expiresAt';
26
+ export declare const PersonalAccessTokens: GeneratedSchema<PersonalAccessTokenKeys, CreatePersonalAccessToken, PersonalAccessToken, 'personal_access_tokens', 'personal_access_token'>;
@@ -0,0 +1,41 @@
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
+ userId: z.string().min(1).max(21),
6
+ name: z.string().min(1).max(256),
7
+ value: z.string().min(1).max(64),
8
+ createdAt: z.number().optional(),
9
+ expiresAt: z.number().nullable().optional(),
10
+ });
11
+ const guard = z.object({
12
+ tenantId: z.string().max(21),
13
+ userId: z.string().min(1).max(21),
14
+ name: z.string().min(1).max(256),
15
+ value: z.string().min(1).max(64),
16
+ createdAt: z.number(),
17
+ expiresAt: z.number().nullable(),
18
+ });
19
+ export const PersonalAccessTokens = Object.freeze({
20
+ table: 'personal_access_tokens',
21
+ tableSingular: 'personal_access_token',
22
+ fields: {
23
+ tenantId: 'tenant_id',
24
+ userId: 'user_id',
25
+ name: 'name',
26
+ value: 'value',
27
+ createdAt: 'created_at',
28
+ expiresAt: 'expires_at',
29
+ },
30
+ fieldKeys: [
31
+ 'tenantId',
32
+ 'userId',
33
+ 'name',
34
+ 'value',
35
+ 'createdAt',
36
+ 'expiresAt',
37
+ ],
38
+ createGuard,
39
+ guard,
40
+ updateGuard: guard.partial(),
41
+ });
@@ -0,0 +1,26 @@
1
+ import { JsonObject, GeneratedSchema } from './../foundations/index.js';
2
+ /**
3
+ *
4
+ * @remarks This is a type for database creation.
5
+ * @see {@link VerificationRecord} for the original type.
6
+ */
7
+ export type CreateVerificationRecord = {
8
+ tenantId?: string;
9
+ id: string;
10
+ userId?: string | null;
11
+ createdAt?: number;
12
+ expiresAt: number;
13
+ /** Use JsonObject here to avoid complex typing, the type will be validated in verification classes. */
14
+ data?: JsonObject;
15
+ };
16
+ export type VerificationRecord = {
17
+ tenantId: string;
18
+ id: string;
19
+ userId: string | null;
20
+ createdAt: number;
21
+ expiresAt: number;
22
+ /** Use JsonObject here to avoid complex typing, the type will be validated in verification classes. */
23
+ data: JsonObject;
24
+ };
25
+ export type VerificationRecordKeys = 'tenantId' | 'id' | 'userId' | 'createdAt' | 'expiresAt' | 'data';
26
+ export declare const VerificationRecords: GeneratedSchema<VerificationRecordKeys, CreateVerificationRecord, VerificationRecord, 'verification_records', 'verification_record'>;
@@ -0,0 +1,42 @@
1
+ // THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
+ import { z } from 'zod';
3
+ import { jsonObjectGuard } 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
+ userId: z.string().max(21).nullable().optional(),
8
+ createdAt: z.number().optional(),
9
+ expiresAt: z.number(),
10
+ data: jsonObjectGuard.optional(),
11
+ });
12
+ const guard = z.object({
13
+ tenantId: z.string().max(21),
14
+ id: z.string().min(1).max(21),
15
+ userId: z.string().max(21).nullable(),
16
+ createdAt: z.number(),
17
+ expiresAt: z.number(),
18
+ data: jsonObjectGuard,
19
+ });
20
+ export const VerificationRecords = Object.freeze({
21
+ table: 'verification_records',
22
+ tableSingular: 'verification_record',
23
+ fields: {
24
+ tenantId: 'tenant_id',
25
+ id: 'id',
26
+ userId: 'user_id',
27
+ createdAt: 'created_at',
28
+ expiresAt: 'expires_at',
29
+ data: 'data',
30
+ },
31
+ fieldKeys: [
32
+ 'tenantId',
33
+ 'id',
34
+ 'userId',
35
+ 'createdAt',
36
+ 'expiresAt',
37
+ 'data',
38
+ ],
39
+ createGuard,
40
+ guard,
41
+ updateGuard: guard.partial(),
42
+ });
@@ -9,12 +9,14 @@ export type CreateVerificationStatus = {
9
9
  id: string;
10
10
  userId: string;
11
11
  createdAt?: number;
12
+ verifiedIdentifier?: string | null;
12
13
  };
13
14
  export type VerificationStatus = {
14
15
  tenantId: string;
15
16
  id: string;
16
17
  userId: string;
17
18
  createdAt: number;
19
+ verifiedIdentifier: string | null;
18
20
  };
19
- export type VerificationStatusKeys = 'tenantId' | 'id' | 'userId' | 'createdAt';
21
+ export type VerificationStatusKeys = 'tenantId' | 'id' | 'userId' | 'createdAt' | 'verifiedIdentifier';
20
22
  export declare const VerificationStatuses: GeneratedSchema<VerificationStatusKeys, CreateVerificationStatus, VerificationStatus, 'verification_statuses', 'verification_status'>;
@@ -5,12 +5,14 @@ const createGuard = z.object({
5
5
  id: z.string().min(1).max(21),
6
6
  userId: z.string().min(1).max(21),
7
7
  createdAt: z.number().optional(),
8
+ verifiedIdentifier: z.string().max(255).nullable().optional(),
8
9
  });
9
10
  const guard = z.object({
10
11
  tenantId: z.string().max(21),
11
12
  id: z.string().min(1).max(21),
12
13
  userId: z.string().min(1).max(21),
13
14
  createdAt: z.number(),
15
+ verifiedIdentifier: z.string().max(255).nullable(),
14
16
  });
15
17
  export const VerificationStatuses = Object.freeze({
16
18
  table: 'verification_statuses',
@@ -20,12 +22,14 @@ export const VerificationStatuses = Object.freeze({
20
22
  id: 'id',
21
23
  userId: 'user_id',
22
24
  createdAt: 'created_at',
25
+ verifiedIdentifier: 'verified_identifier',
23
26
  },
24
27
  fieldKeys: [
25
28
  'tenantId',
26
29
  'id',
27
30
  'userId',
28
31
  'createdAt',
32
+ 'verifiedIdentifier',
29
33
  ],
30
34
  createGuard,
31
35
  guard,
@@ -8,5 +8,6 @@ export * from './sentinel.js';
8
8
  export * from './users.js';
9
9
  export * from './sso-connector.js';
10
10
  export * from './applications.js';
11
+ export * from './verification-records.js';
11
12
  export { configurableConnectorMetadataGuard, type ConfigurableConnectorMetadata, jsonGuard, jsonObjectGuard, } from '@logto/connector-kit';
12
13
  export type { Json, JsonObject } from '@withtyped/server';
@@ -8,4 +8,5 @@ export * from './sentinel.js';
8
8
  export * from './users.js';
9
9
  export * from './sso-connector.js';
10
10
  export * from './applications.js';
11
+ export * from './verification-records.js';
11
12
  export { configurableConnectorMetadataGuard, jsonGuard, jsonObjectGuard, } from '@logto/connector-kit';
@@ -14,6 +14,7 @@ export declare const logContextPayloadGuard: z.ZodObject<{
14
14
  userId: z.ZodOptional<z.ZodString>;
15
15
  applicationId: z.ZodOptional<z.ZodString>;
16
16
  sessionId: z.ZodOptional<z.ZodString>;
17
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
17
18
  }, "strip", z.ZodUnknown, z.objectOutputType<{
18
19
  key: z.ZodString;
19
20
  result: z.ZodNativeEnum<typeof LogResult>;
@@ -23,6 +24,7 @@ export declare const logContextPayloadGuard: z.ZodObject<{
23
24
  userId: z.ZodOptional<z.ZodString>;
24
25
  applicationId: z.ZodOptional<z.ZodString>;
25
26
  sessionId: z.ZodOptional<z.ZodString>;
27
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
26
28
  }, z.ZodUnknown, "strip">, z.objectInputType<{
27
29
  key: z.ZodString;
28
30
  result: z.ZodNativeEnum<typeof LogResult>;
@@ -32,6 +34,7 @@ export declare const logContextPayloadGuard: z.ZodObject<{
32
34
  userId: z.ZodOptional<z.ZodString>;
33
35
  applicationId: z.ZodOptional<z.ZodString>;
34
36
  sessionId: z.ZodOptional<z.ZodString>;
37
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
35
38
  }, z.ZodUnknown, "strip">>;
36
39
  export type PartialPasswordPolicy = DeepPartial<PasswordPolicy>;
37
40
  export declare const partialPasswordPolicyGuard: z.ZodObject<{
@@ -15,6 +15,7 @@ export const logContextPayloadGuard = z
15
15
  userId: z.string().optional(),
16
16
  applicationId: z.string().optional(),
17
17
  sessionId: z.string().optional(),
18
+ params: z.record(z.string(), z.unknown()).optional(),
18
19
  })
19
20
  .catchall(z.unknown());
20
21
  export const partialPasswordPolicyGuard = passwordPolicyGuard.deepPartial();
@@ -51,13 +51,13 @@ export declare const brandingGuard: z.ZodObject<{
51
51
  export type Branding = z.infer<typeof brandingGuard>;
52
52
  export declare const languageInfoGuard: z.ZodObject<{
53
53
  autoDetect: z.ZodBoolean;
54
- fallbackLanguage: z.ZodType<"af-ZA" | "am-ET" | "ar-AR" | "as-IN" | "az-AZ" | "be-BY" | "bg-BG" | "bn-IN" | "br-FR" | "bs-BA" | "ca-ES" | "cb-IQ" | "co-FR" | "cs-CZ" | "cx-PH" | "cy-GB" | "da-DK" | "de" | "de-DE" | "el-GR" | "en" | "en-GB" | "en-US" | "eo-EO" | "es" | "es-ES" | "es-419" | "et-EE" | "eu-ES" | "fa-IR" | "ff-NG" | "fi-FI" | "fo-FO" | "fr" | "fr-CA" | "fr-FR" | "fy-NL" | "ga-IE" | "gl-ES" | "gn-PY" | "gu-IN" | "ha-NG" | "he-IL" | "hi-IN" | "hr-HR" | "ht-HT" | "hu-HU" | "hy-AM" | "id-ID" | "ik-US" | "is-IS" | "it" | "it-IT" | "iu-CA" | "ja" | "ja-JP" | "ja-KS" | "jv-ID" | "ka-GE" | "kk-KZ" | "km-KH" | "kn-IN" | "ko" | "ko-KR" | "ku-TR" | "ky-KG" | "lo-LA" | "lt-LT" | "lv-LV" | "mg-MG" | "mk-MK" | "ml-IN" | "mn-MN" | "mr-IN" | "ms-MY" | "mt-MT" | "my-MM" | "nb-NO" | "ne-NP" | "nl-BE" | "nl-NL" | "nn-NO" | "or-IN" | "pa-IN" | "pl-PL" | "ps-AF" | "pt" | "pt-BR" | "pt-PT" | "ro-RO" | "ru" | "ru-RU" | "rw-RW" | "sc-IT" | "si-LK" | "sk-SK" | "sl-SI" | "sn-ZW" | "sq-AL" | "sr-RS" | "sv-SE" | "sw-KE" | "sy-SY" | "sz-PL" | "ta-IN" | "te-IN" | "tg-TJ" | "th-TH" | "tl-PH" | "tr" | "tr-TR" | "tt-RU" | "tz-MA" | "uk-UA" | "ur-PK" | "uz-UZ" | "vi-VN" | "zh" | "zh-CN" | "zh-HK" | "zh-MO" | "zh-TW" | "zz-TR", z.ZodTypeDef, "af-ZA" | "am-ET" | "ar-AR" | "as-IN" | "az-AZ" | "be-BY" | "bg-BG" | "bn-IN" | "br-FR" | "bs-BA" | "ca-ES" | "cb-IQ" | "co-FR" | "cs-CZ" | "cx-PH" | "cy-GB" | "da-DK" | "de" | "de-DE" | "el-GR" | "en" | "en-GB" | "en-US" | "eo-EO" | "es" | "es-ES" | "es-419" | "et-EE" | "eu-ES" | "fa-IR" | "ff-NG" | "fi-FI" | "fo-FO" | "fr" | "fr-CA" | "fr-FR" | "fy-NL" | "ga-IE" | "gl-ES" | "gn-PY" | "gu-IN" | "ha-NG" | "he-IL" | "hi-IN" | "hr-HR" | "ht-HT" | "hu-HU" | "hy-AM" | "id-ID" | "ik-US" | "is-IS" | "it" | "it-IT" | "iu-CA" | "ja" | "ja-JP" | "ja-KS" | "jv-ID" | "ka-GE" | "kk-KZ" | "km-KH" | "kn-IN" | "ko" | "ko-KR" | "ku-TR" | "ky-KG" | "lo-LA" | "lt-LT" | "lv-LV" | "mg-MG" | "mk-MK" | "ml-IN" | "mn-MN" | "mr-IN" | "ms-MY" | "mt-MT" | "my-MM" | "nb-NO" | "ne-NP" | "nl-BE" | "nl-NL" | "nn-NO" | "or-IN" | "pa-IN" | "pl-PL" | "ps-AF" | "pt" | "pt-BR" | "pt-PT" | "ro-RO" | "ru" | "ru-RU" | "rw-RW" | "sc-IT" | "si-LK" | "sk-SK" | "sl-SI" | "sn-ZW" | "sq-AL" | "sr-RS" | "sv-SE" | "sw-KE" | "sy-SY" | "sz-PL" | "ta-IN" | "te-IN" | "tg-TJ" | "th-TH" | "tl-PH" | "tr" | "tr-TR" | "tt-RU" | "tz-MA" | "uk-UA" | "ur-PK" | "uz-UZ" | "vi-VN" | "zh" | "zh-CN" | "zh-HK" | "zh-MO" | "zh-TW" | "zz-TR">;
54
+ fallbackLanguage: z.ZodType<"af-ZA" | "am-ET" | "ar" | "ar-AR" | "as-IN" | "az-AZ" | "be-BY" | "bg-BG" | "bn-IN" | "br-FR" | "bs-BA" | "ca-ES" | "cb-IQ" | "co-FR" | "cs-CZ" | "cx-PH" | "cy-GB" | "da-DK" | "de" | "de-DE" | "el-GR" | "en" | "en-GB" | "en-US" | "eo-EO" | "es" | "es-ES" | "es-419" | "et-EE" | "eu-ES" | "fa-IR" | "ff-NG" | "fi-FI" | "fo-FO" | "fr" | "fr-CA" | "fr-FR" | "fy-NL" | "ga-IE" | "gl-ES" | "gn-PY" | "gu-IN" | "ha-NG" | "he-IL" | "hi-IN" | "hr-HR" | "ht-HT" | "hu-HU" | "hy-AM" | "id-ID" | "ik-US" | "is-IS" | "it" | "it-IT" | "iu-CA" | "ja" | "ja-JP" | "ja-KS" | "jv-ID" | "ka-GE" | "kk-KZ" | "km-KH" | "kn-IN" | "ko" | "ko-KR" | "ku-TR" | "ky-KG" | "lo-LA" | "lt-LT" | "lv-LV" | "mg-MG" | "mk-MK" | "ml-IN" | "mn-MN" | "mr-IN" | "ms-MY" | "mt-MT" | "my-MM" | "nb-NO" | "ne-NP" | "nl-BE" | "nl-NL" | "nn-NO" | "or-IN" | "pa-IN" | "pl-PL" | "ps-AF" | "pt" | "pt-BR" | "pt-PT" | "ro-RO" | "ru" | "ru-RU" | "rw-RW" | "sc-IT" | "si-LK" | "sk-SK" | "sl-SI" | "sn-ZW" | "sq-AL" | "sr-RS" | "sv-SE" | "sw-KE" | "sy-SY" | "sz-PL" | "ta-IN" | "te-IN" | "tg-TJ" | "th-TH" | "tl-PH" | "tr" | "tr-TR" | "tt-RU" | "tz-MA" | "uk-UA" | "ur-PK" | "uz-UZ" | "vi-VN" | "zh" | "zh-CN" | "zh-HK" | "zh-MO" | "zh-TW" | "zz-TR", z.ZodTypeDef, "af-ZA" | "am-ET" | "ar" | "ar-AR" | "as-IN" | "az-AZ" | "be-BY" | "bg-BG" | "bn-IN" | "br-FR" | "bs-BA" | "ca-ES" | "cb-IQ" | "co-FR" | "cs-CZ" | "cx-PH" | "cy-GB" | "da-DK" | "de" | "de-DE" | "el-GR" | "en" | "en-GB" | "en-US" | "eo-EO" | "es" | "es-ES" | "es-419" | "et-EE" | "eu-ES" | "fa-IR" | "ff-NG" | "fi-FI" | "fo-FO" | "fr" | "fr-CA" | "fr-FR" | "fy-NL" | "ga-IE" | "gl-ES" | "gn-PY" | "gu-IN" | "ha-NG" | "he-IL" | "hi-IN" | "hr-HR" | "ht-HT" | "hu-HU" | "hy-AM" | "id-ID" | "ik-US" | "is-IS" | "it" | "it-IT" | "iu-CA" | "ja" | "ja-JP" | "ja-KS" | "jv-ID" | "ka-GE" | "kk-KZ" | "km-KH" | "kn-IN" | "ko" | "ko-KR" | "ku-TR" | "ky-KG" | "lo-LA" | "lt-LT" | "lv-LV" | "mg-MG" | "mk-MK" | "ml-IN" | "mn-MN" | "mr-IN" | "ms-MY" | "mt-MT" | "my-MM" | "nb-NO" | "ne-NP" | "nl-BE" | "nl-NL" | "nn-NO" | "or-IN" | "pa-IN" | "pl-PL" | "ps-AF" | "pt" | "pt-BR" | "pt-PT" | "ro-RO" | "ru" | "ru-RU" | "rw-RW" | "sc-IT" | "si-LK" | "sk-SK" | "sl-SI" | "sn-ZW" | "sq-AL" | "sr-RS" | "sv-SE" | "sw-KE" | "sy-SY" | "sz-PL" | "ta-IN" | "te-IN" | "tg-TJ" | "th-TH" | "tl-PH" | "tr" | "tr-TR" | "tt-RU" | "tz-MA" | "uk-UA" | "ur-PK" | "uz-UZ" | "vi-VN" | "zh" | "zh-CN" | "zh-HK" | "zh-MO" | "zh-TW" | "zz-TR">;
55
55
  }, "strip", z.ZodTypeAny, {
56
56
  autoDetect: boolean;
57
- fallbackLanguage: "af-ZA" | "am-ET" | "ar-AR" | "as-IN" | "az-AZ" | "be-BY" | "bg-BG" | "bn-IN" | "br-FR" | "bs-BA" | "ca-ES" | "cb-IQ" | "co-FR" | "cs-CZ" | "cx-PH" | "cy-GB" | "da-DK" | "de" | "de-DE" | "el-GR" | "en" | "en-GB" | "en-US" | "eo-EO" | "es" | "es-ES" | "es-419" | "et-EE" | "eu-ES" | "fa-IR" | "ff-NG" | "fi-FI" | "fo-FO" | "fr" | "fr-CA" | "fr-FR" | "fy-NL" | "ga-IE" | "gl-ES" | "gn-PY" | "gu-IN" | "ha-NG" | "he-IL" | "hi-IN" | "hr-HR" | "ht-HT" | "hu-HU" | "hy-AM" | "id-ID" | "ik-US" | "is-IS" | "it" | "it-IT" | "iu-CA" | "ja" | "ja-JP" | "ja-KS" | "jv-ID" | "ka-GE" | "kk-KZ" | "km-KH" | "kn-IN" | "ko" | "ko-KR" | "ku-TR" | "ky-KG" | "lo-LA" | "lt-LT" | "lv-LV" | "mg-MG" | "mk-MK" | "ml-IN" | "mn-MN" | "mr-IN" | "ms-MY" | "mt-MT" | "my-MM" | "nb-NO" | "ne-NP" | "nl-BE" | "nl-NL" | "nn-NO" | "or-IN" | "pa-IN" | "pl-PL" | "ps-AF" | "pt" | "pt-BR" | "pt-PT" | "ro-RO" | "ru" | "ru-RU" | "rw-RW" | "sc-IT" | "si-LK" | "sk-SK" | "sl-SI" | "sn-ZW" | "sq-AL" | "sr-RS" | "sv-SE" | "sw-KE" | "sy-SY" | "sz-PL" | "ta-IN" | "te-IN" | "tg-TJ" | "th-TH" | "tl-PH" | "tr" | "tr-TR" | "tt-RU" | "tz-MA" | "uk-UA" | "ur-PK" | "uz-UZ" | "vi-VN" | "zh" | "zh-CN" | "zh-HK" | "zh-MO" | "zh-TW" | "zz-TR";
57
+ fallbackLanguage: "af-ZA" | "am-ET" | "ar" | "ar-AR" | "as-IN" | "az-AZ" | "be-BY" | "bg-BG" | "bn-IN" | "br-FR" | "bs-BA" | "ca-ES" | "cb-IQ" | "co-FR" | "cs-CZ" | "cx-PH" | "cy-GB" | "da-DK" | "de" | "de-DE" | "el-GR" | "en" | "en-GB" | "en-US" | "eo-EO" | "es" | "es-ES" | "es-419" | "et-EE" | "eu-ES" | "fa-IR" | "ff-NG" | "fi-FI" | "fo-FO" | "fr" | "fr-CA" | "fr-FR" | "fy-NL" | "ga-IE" | "gl-ES" | "gn-PY" | "gu-IN" | "ha-NG" | "he-IL" | "hi-IN" | "hr-HR" | "ht-HT" | "hu-HU" | "hy-AM" | "id-ID" | "ik-US" | "is-IS" | "it" | "it-IT" | "iu-CA" | "ja" | "ja-JP" | "ja-KS" | "jv-ID" | "ka-GE" | "kk-KZ" | "km-KH" | "kn-IN" | "ko" | "ko-KR" | "ku-TR" | "ky-KG" | "lo-LA" | "lt-LT" | "lv-LV" | "mg-MG" | "mk-MK" | "ml-IN" | "mn-MN" | "mr-IN" | "ms-MY" | "mt-MT" | "my-MM" | "nb-NO" | "ne-NP" | "nl-BE" | "nl-NL" | "nn-NO" | "or-IN" | "pa-IN" | "pl-PL" | "ps-AF" | "pt" | "pt-BR" | "pt-PT" | "ro-RO" | "ru" | "ru-RU" | "rw-RW" | "sc-IT" | "si-LK" | "sk-SK" | "sl-SI" | "sn-ZW" | "sq-AL" | "sr-RS" | "sv-SE" | "sw-KE" | "sy-SY" | "sz-PL" | "ta-IN" | "te-IN" | "tg-TJ" | "th-TH" | "tl-PH" | "tr" | "tr-TR" | "tt-RU" | "tz-MA" | "uk-UA" | "ur-PK" | "uz-UZ" | "vi-VN" | "zh" | "zh-CN" | "zh-HK" | "zh-MO" | "zh-TW" | "zz-TR";
58
58
  }, {
59
59
  autoDetect: boolean;
60
- fallbackLanguage: "af-ZA" | "am-ET" | "ar-AR" | "as-IN" | "az-AZ" | "be-BY" | "bg-BG" | "bn-IN" | "br-FR" | "bs-BA" | "ca-ES" | "cb-IQ" | "co-FR" | "cs-CZ" | "cx-PH" | "cy-GB" | "da-DK" | "de" | "de-DE" | "el-GR" | "en" | "en-GB" | "en-US" | "eo-EO" | "es" | "es-ES" | "es-419" | "et-EE" | "eu-ES" | "fa-IR" | "ff-NG" | "fi-FI" | "fo-FO" | "fr" | "fr-CA" | "fr-FR" | "fy-NL" | "ga-IE" | "gl-ES" | "gn-PY" | "gu-IN" | "ha-NG" | "he-IL" | "hi-IN" | "hr-HR" | "ht-HT" | "hu-HU" | "hy-AM" | "id-ID" | "ik-US" | "is-IS" | "it" | "it-IT" | "iu-CA" | "ja" | "ja-JP" | "ja-KS" | "jv-ID" | "ka-GE" | "kk-KZ" | "km-KH" | "kn-IN" | "ko" | "ko-KR" | "ku-TR" | "ky-KG" | "lo-LA" | "lt-LT" | "lv-LV" | "mg-MG" | "mk-MK" | "ml-IN" | "mn-MN" | "mr-IN" | "ms-MY" | "mt-MT" | "my-MM" | "nb-NO" | "ne-NP" | "nl-BE" | "nl-NL" | "nn-NO" | "or-IN" | "pa-IN" | "pl-PL" | "ps-AF" | "pt" | "pt-BR" | "pt-PT" | "ro-RO" | "ru" | "ru-RU" | "rw-RW" | "sc-IT" | "si-LK" | "sk-SK" | "sl-SI" | "sn-ZW" | "sq-AL" | "sr-RS" | "sv-SE" | "sw-KE" | "sy-SY" | "sz-PL" | "ta-IN" | "te-IN" | "tg-TJ" | "th-TH" | "tl-PH" | "tr" | "tr-TR" | "tt-RU" | "tz-MA" | "uk-UA" | "ur-PK" | "uz-UZ" | "vi-VN" | "zh" | "zh-CN" | "zh-HK" | "zh-MO" | "zh-TW" | "zz-TR";
60
+ fallbackLanguage: "af-ZA" | "am-ET" | "ar" | "ar-AR" | "as-IN" | "az-AZ" | "be-BY" | "bg-BG" | "bn-IN" | "br-FR" | "bs-BA" | "ca-ES" | "cb-IQ" | "co-FR" | "cs-CZ" | "cx-PH" | "cy-GB" | "da-DK" | "de" | "de-DE" | "el-GR" | "en" | "en-GB" | "en-US" | "eo-EO" | "es" | "es-ES" | "es-419" | "et-EE" | "eu-ES" | "fa-IR" | "ff-NG" | "fi-FI" | "fo-FO" | "fr" | "fr-CA" | "fr-FR" | "fy-NL" | "ga-IE" | "gl-ES" | "gn-PY" | "gu-IN" | "ha-NG" | "he-IL" | "hi-IN" | "hr-HR" | "ht-HT" | "hu-HU" | "hy-AM" | "id-ID" | "ik-US" | "is-IS" | "it" | "it-IT" | "iu-CA" | "ja" | "ja-JP" | "ja-KS" | "jv-ID" | "ka-GE" | "kk-KZ" | "km-KH" | "kn-IN" | "ko" | "ko-KR" | "ku-TR" | "ky-KG" | "lo-LA" | "lt-LT" | "lv-LV" | "mg-MG" | "mk-MK" | "ml-IN" | "mn-MN" | "mr-IN" | "ms-MY" | "mt-MT" | "my-MM" | "nb-NO" | "ne-NP" | "nl-BE" | "nl-NL" | "nn-NO" | "or-IN" | "pa-IN" | "pl-PL" | "ps-AF" | "pt" | "pt-BR" | "pt-PT" | "ro-RO" | "ru" | "ru-RU" | "rw-RW" | "sc-IT" | "si-LK" | "sk-SK" | "sl-SI" | "sn-ZW" | "sq-AL" | "sr-RS" | "sv-SE" | "sw-KE" | "sy-SY" | "sz-PL" | "ta-IN" | "te-IN" | "tg-TJ" | "th-TH" | "tl-PH" | "tr" | "tr-TR" | "tt-RU" | "tz-MA" | "uk-UA" | "ur-PK" | "uz-UZ" | "vi-VN" | "zh" | "zh-CN" | "zh-HK" | "zh-MO" | "zh-TW" | "zz-TR";
61
61
  }>;
62
62
  export type LanguageInfo = z.infer<typeof languageInfoGuard>;
63
63
  export declare enum SignInIdentifier {
@@ -65,6 +65,7 @@ export declare enum SignInIdentifier {
65
65
  Email = "email",
66
66
  Phone = "phone"
67
67
  }
68
+ export declare const signInIdentifierGuard: z.ZodNativeEnum<typeof SignInIdentifier>;
68
69
  export declare const signUpGuard: z.ZodObject<{
69
70
  identifiers: z.ZodArray<z.ZodNativeEnum<typeof SignInIdentifier>, "many">;
70
71
  password: z.ZodBoolean;
@@ -31,6 +31,7 @@ export var SignInIdentifier;
31
31
  SignInIdentifier["Email"] = "email";
32
32
  SignInIdentifier["Phone"] = "phone";
33
33
  })(SignInIdentifier || (SignInIdentifier = {}));
34
+ export const signInIdentifierGuard = z.nativeEnum(SignInIdentifier);
34
35
  export const signUpGuard = z.object({
35
36
  identifiers: z.nativeEnum(SignInIdentifier).array(),
36
37
  password: z.boolean(),
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ export declare enum VerificationType {
3
+ Password = "Password",
4
+ EmailVerificationCode = "EmailVerificationCode",
5
+ PhoneVerificationCode = "PhoneVerificationCode",
6
+ Social = "Social",
7
+ EnterpriseSso = "EnterpriseSso",
8
+ TOTP = "Totp",
9
+ WebAuthn = "WebAuthn",
10
+ BackupCode = "BackupCode",
11
+ NewPasswordIdentity = "NewPasswordIdentity"
12
+ }
13
+ export declare const verificationTypeGuard: z.ZodNativeEnum<typeof VerificationType>;
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ export var VerificationType;
3
+ (function (VerificationType) {
4
+ VerificationType["Password"] = "Password";
5
+ VerificationType["EmailVerificationCode"] = "EmailVerificationCode";
6
+ VerificationType["PhoneVerificationCode"] = "PhoneVerificationCode";
7
+ VerificationType["Social"] = "Social";
8
+ VerificationType["EnterpriseSso"] = "EnterpriseSso";
9
+ VerificationType["TOTP"] = "Totp";
10
+ VerificationType["WebAuthn"] = "WebAuthn";
11
+ VerificationType["BackupCode"] = "BackupCode";
12
+ VerificationType["NewPasswordIdentity"] = "NewPasswordIdentity";
13
+ })(VerificationType || (VerificationType = {}));
14
+ export const verificationTypeGuard = z.nativeEnum(VerificationType);
@@ -14,6 +14,10 @@ export declare enum CloudScope {
14
14
  * scripts and fetch the parsed token payload.
15
15
  */
16
16
  FetchCustomJwt = "fetch:custom:jwt",
17
+ /**
18
+ * The entity can report changes on Stripe subscription to Logto Cloud.
19
+ */
20
+ ReportSubscriptionUpdates = "report:subscription:updates",
17
21
  /** The user can see and manage affiliates, including create, update, and delete. */
18
22
  ManageAffiliate = "manage:affiliate",
19
23
  /** The user can create new affiliates and logs. */
@@ -17,6 +17,10 @@ export var CloudScope;
17
17
  * scripts and fetch the parsed token payload.
18
18
  */
19
19
  CloudScope["FetchCustomJwt"] = "fetch:custom:jwt";
20
+ /**
21
+ * The entity can report changes on Stripe subscription to Logto Cloud.
22
+ */
23
+ CloudScope["ReportSubscriptionUpdates"] = "report:subscription:updates";
20
24
  /** The user can see and manage affiliates, including create, update, and delete. */
21
25
  CloudScope["ManageAffiliate"] = "manage:affiliate";
22
26
  /** The user can create new affiliates and logs. */
@@ -51,6 +55,7 @@ export const createCloudApi = () => {
51
55
  buildScope(CloudScope.SendEmail, 'Allow sending emails. This scope is only available to M2M application.'),
52
56
  buildScope(CloudScope.SendSms, 'Allow sending SMS. This scope is only available to M2M application.'),
53
57
  buildScope(CloudScope.FetchCustomJwt, 'Allow accessing external resource to execute JWT payload customizer script and fetch the parsed token payload.'),
58
+ buildScope(CloudScope.ReportSubscriptionUpdates, 'Allow reporting changes on Stripe subscription to Logto Cloud.'),
54
59
  buildScope(CloudScope.CreateAffiliate, 'Allow creating new affiliates and logs.'),
55
60
  buildScope(CloudScope.ManageAffiliate, 'Allow managing affiliates, including create, update, and delete.'),
56
61
  ]);
@@ -222,6 +222,7 @@ export declare const connectorResponseGuard: z.ZodObject<z.objectUtil.extendShap
222
222
  } & {
223
223
  "af-ZA"?: string | undefined;
224
224
  "am-ET"?: string | undefined;
225
+ ar?: string | undefined;
225
226
  "ar-AR"?: string | undefined;
226
227
  "as-IN"?: string | undefined;
227
228
  "az-AZ"?: string | undefined;
@@ -350,6 +351,7 @@ export declare const connectorResponseGuard: z.ZodObject<z.objectUtil.extendShap
350
351
  } & {
351
352
  "af-ZA"?: string | undefined;
352
353
  "am-ET"?: string | undefined;
354
+ ar?: string | undefined;
353
355
  "ar-AR"?: string | undefined;
354
356
  "as-IN"?: string | undefined;
355
357
  "az-AZ"?: string | undefined;
@@ -543,6 +545,7 @@ export declare const connectorResponseGuard: z.ZodObject<z.objectUtil.extendShap
543
545
  } & {
544
546
  "af-ZA"?: string | undefined;
545
547
  "am-ET"?: string | undefined;
548
+ ar?: string | undefined;
546
549
  "ar-AR"?: string | undefined;
547
550
  "as-IN"?: string | undefined;
548
551
  "az-AZ"?: string | undefined;
@@ -671,6 +674,7 @@ export declare const connectorResponseGuard: z.ZodObject<z.objectUtil.extendShap
671
674
  } & {
672
675
  "af-ZA"?: string | undefined;
673
676
  "am-ET"?: string | undefined;
677
+ ar?: string | undefined;
674
678
  "ar-AR"?: string | undefined;
675
679
  "as-IN"?: string | undefined;
676
680
  "az-AZ"?: string | undefined;
@@ -1059,6 +1063,7 @@ export declare const connectorFactoryResponseGuard: z.ZodObject<z.objectUtil.ext
1059
1063
  } & {
1060
1064
  "af-ZA"?: string | undefined;
1061
1065
  "am-ET"?: string | undefined;
1066
+ ar?: string | undefined;
1062
1067
  "ar-AR"?: string | undefined;
1063
1068
  "as-IN"?: string | undefined;
1064
1069
  "az-AZ"?: string | undefined;
@@ -1187,6 +1192,7 @@ export declare const connectorFactoryResponseGuard: z.ZodObject<z.objectUtil.ext
1187
1192
  } & {
1188
1193
  "af-ZA"?: string | undefined;
1189
1194
  "am-ET"?: string | undefined;
1195
+ ar?: string | undefined;
1190
1196
  "ar-AR"?: string | undefined;
1191
1197
  "as-IN"?: string | undefined;
1192
1198
  "az-AZ"?: string | undefined;
@@ -1374,6 +1380,7 @@ export declare const connectorFactoryResponseGuard: z.ZodObject<z.objectUtil.ext
1374
1380
  } & {
1375
1381
  "af-ZA"?: string | undefined;
1376
1382
  "am-ET"?: string | undefined;
1383
+ ar?: string | undefined;
1377
1384
  "ar-AR"?: string | undefined;
1378
1385
  "as-IN"?: string | undefined;
1379
1386
  "az-AZ"?: string | undefined;
@@ -1502,6 +1509,7 @@ export declare const connectorFactoryResponseGuard: z.ZodObject<z.objectUtil.ext
1502
1509
  } & {
1503
1510
  "af-ZA"?: string | undefined;
1504
1511
  "am-ET"?: string | undefined;
1512
+ ar?: string | undefined;
1505
1513
  "ar-AR"?: string | undefined;
1506
1514
  "as-IN"?: string | undefined;
1507
1515
  "az-AZ"?: string | undefined;
@@ -41,18 +41,6 @@ export declare const verificationCodeIdentifierGuard: z.ZodObject<{
41
41
  type: SignInIdentifier.Email | SignInIdentifier.Phone;
42
42
  value: string;
43
43
  }>;
44
- /** Logto supported interaction verification types. */
45
- export declare enum VerificationType {
46
- Password = "Password",
47
- EmailVerificationCode = "EmailVerificationCode",
48
- PhoneVerificationCode = "PhoneVerificationCode",
49
- Social = "Social",
50
- EnterpriseSso = "EnterpriseSso",
51
- TOTP = "Totp",
52
- WebAuthn = "WebAuthn",
53
- BackupCode = "BackupCode",
54
- NewPasswordIdentity = "NewPasswordIdentity"
55
- }
56
44
  /** Payload type for `POST /api/experience/verification/{social|sso}/:connectorId/authorization-uri`. */
57
45
  export type SocialAuthorizationUrlPayload = {
58
46
  state: string;
@@ -20,19 +20,6 @@ export const verificationCodeIdentifierGuard = z.object({
20
20
  type: z.enum([SignInIdentifier.Email, SignInIdentifier.Phone]),
21
21
  value: z.string(),
22
22
  });
23
- /** Logto supported interaction verification types. */
24
- export var VerificationType;
25
- (function (VerificationType) {
26
- VerificationType["Password"] = "Password";
27
- VerificationType["EmailVerificationCode"] = "EmailVerificationCode";
28
- VerificationType["PhoneVerificationCode"] = "PhoneVerificationCode";
29
- VerificationType["Social"] = "Social";
30
- VerificationType["EnterpriseSso"] = "EnterpriseSso";
31
- VerificationType["TOTP"] = "Totp";
32
- VerificationType["WebAuthn"] = "WebAuthn";
33
- VerificationType["BackupCode"] = "BackupCode";
34
- VerificationType["NewPasswordIdentity"] = "NewPasswordIdentity";
35
- })(VerificationType || (VerificationType = {}));
36
23
  export const socialAuthorizationUrlPayloadGuard = z.object({
37
24
  state: z.string(),
38
25
  redirectUri: z.string(),
@@ -1,5 +1,5 @@
1
- import { type MfaFactor } from '../../foundations/index.js';
2
- import type { InteractionEvent, VerificationType } from '../interactions.js';
1
+ import { type VerificationType, type MfaFactor } from '../../foundations/index.js';
2
+ import type { InteractionEvent } from '../interactions.js';
3
3
  export type Prefix = 'Interaction';
4
4
  export declare const prefix: Prefix;
5
5
  /** The interaction field to update. This is valid based on we only allow users update one field at a time. */
@@ -1890,3 +1890,51 @@ export declare const customJwtFetcherGuard: z.ZodDiscriminatedUnion<"tokenType",
1890
1890
  environmentVariables?: Record<string, string> | undefined;
1891
1891
  }>]>;
1892
1892
  export type CustomJwtFetcher = z.infer<typeof customJwtFetcherGuard>;
1893
+ export declare enum CustomJwtErrorCode {
1894
+ /**
1895
+ * The `AccessDenied` error explicitly thrown
1896
+ * by calling the `api.denyAccess` function in the custom JWT script.
1897
+ */
1898
+ AccessDenied = "AccessDenied",
1899
+ /** General JWT customizer error,
1900
+ * this is the fallback custom jwt error code
1901
+ * for any internal error thrown by the JWT customizer (localVM, azure function, or CF worker).
1902
+ */
1903
+ General = "General"
1904
+ }
1905
+ export declare const customJwtErrorBodyGuard: z.ZodObject<{
1906
+ code: z.ZodNativeEnum<typeof CustomJwtErrorCode>;
1907
+ message: z.ZodString;
1908
+ }, "strip", z.ZodTypeAny, {
1909
+ code: CustomJwtErrorCode;
1910
+ message: string;
1911
+ }, {
1912
+ code: CustomJwtErrorCode;
1913
+ message: string;
1914
+ }>;
1915
+ export type CustomJwtErrorBody = z.infer<typeof customJwtErrorBodyGuard>;
1916
+ export type CustomJwtApiContext = {
1917
+ /**
1918
+ * Reject the the current token request.
1919
+ *
1920
+ * @remarks
1921
+ * By calling this function, the current token request will be rejected,
1922
+ * and a OIDC `AccessDenied` error will be thrown to the client with the given message.
1923
+ *
1924
+ * @param message The message to be shown to the user.
1925
+ * @throws {ResponseError} with `CustomJwtErrorBody`
1926
+ */
1927
+ denyAccess: (message?: string) => never;
1928
+ };
1929
+ /**
1930
+ * The payload type for the custom JWT script.
1931
+ *
1932
+ * @remarks
1933
+ * We use this type to guard the input payload for the custom JWT script.
1934
+ */
1935
+ export type CustomJwtScriptPayload = {
1936
+ token: Record<string, unknown>;
1937
+ context?: Record<string, unknown>;
1938
+ environmentVariables?: Record<string, string>;
1939
+ api: CustomJwtApiContext;
1940
+ };
@@ -101,3 +101,20 @@ export const customJwtFetcherGuard = z.discriminatedUnion('tokenType', [
101
101
  tokenType: z.literal(LogtoJwtTokenKeyType.ClientCredentials),
102
102
  }),
103
103
  ]);
104
+ export var CustomJwtErrorCode;
105
+ (function (CustomJwtErrorCode) {
106
+ /**
107
+ * The `AccessDenied` error explicitly thrown
108
+ * by calling the `api.denyAccess` function in the custom JWT script.
109
+ */
110
+ CustomJwtErrorCode["AccessDenied"] = "AccessDenied";
111
+ /** General JWT customizer error,
112
+ * this is the fallback custom jwt error code
113
+ * for any internal error thrown by the JWT customizer (localVM, azure function, or CF worker).
114
+ */
115
+ CustomJwtErrorCode["General"] = "General";
116
+ })(CustomJwtErrorCode || (CustomJwtErrorCode = {}));
117
+ export const customJwtErrorBodyGuard = z.object({
118
+ code: z.nativeEnum(CustomJwtErrorCode),
119
+ message: z.string(),
120
+ });
@@ -54,10 +54,10 @@ export declare const fullSignInExperienceGuard: z.ZodObject<z.objectUtil.extendS
54
54
  }>;
55
55
  languageInfo: z.ZodType<{
56
56
  autoDetect: boolean;
57
- fallbackLanguage: "af-ZA" | "am-ET" | "ar-AR" | "as-IN" | "az-AZ" | "be-BY" | "bg-BG" | "bn-IN" | "br-FR" | "bs-BA" | "ca-ES" | "cb-IQ" | "co-FR" | "cs-CZ" | "cx-PH" | "cy-GB" | "da-DK" | "de" | "de-DE" | "el-GR" | "en" | "en-GB" | "en-US" | "eo-EO" | "es" | "es-ES" | "es-419" | "et-EE" | "eu-ES" | "fa-IR" | "ff-NG" | "fi-FI" | "fo-FO" | "fr" | "fr-CA" | "fr-FR" | "fy-NL" | "ga-IE" | "gl-ES" | "gn-PY" | "gu-IN" | "ha-NG" | "he-IL" | "hi-IN" | "hr-HR" | "ht-HT" | "hu-HU" | "hy-AM" | "id-ID" | "ik-US" | "is-IS" | "it" | "it-IT" | "iu-CA" | "ja" | "ja-JP" | "ja-KS" | "jv-ID" | "ka-GE" | "kk-KZ" | "km-KH" | "kn-IN" | "ko" | "ko-KR" | "ku-TR" | "ky-KG" | "lo-LA" | "lt-LT" | "lv-LV" | "mg-MG" | "mk-MK" | "ml-IN" | "mn-MN" | "mr-IN" | "ms-MY" | "mt-MT" | "my-MM" | "nb-NO" | "ne-NP" | "nl-BE" | "nl-NL" | "nn-NO" | "or-IN" | "pa-IN" | "pl-PL" | "ps-AF" | "pt" | "pt-BR" | "pt-PT" | "ro-RO" | "ru" | "ru-RU" | "rw-RW" | "sc-IT" | "si-LK" | "sk-SK" | "sl-SI" | "sn-ZW" | "sq-AL" | "sr-RS" | "sv-SE" | "sw-KE" | "sy-SY" | "sz-PL" | "ta-IN" | "te-IN" | "tg-TJ" | "th-TH" | "tl-PH" | "tr" | "tr-TR" | "tt-RU" | "tz-MA" | "uk-UA" | "ur-PK" | "uz-UZ" | "vi-VN" | "zh" | "zh-CN" | "zh-HK" | "zh-MO" | "zh-TW" | "zz-TR";
57
+ fallbackLanguage: "af-ZA" | "am-ET" | "ar" | "ar-AR" | "as-IN" | "az-AZ" | "be-BY" | "bg-BG" | "bn-IN" | "br-FR" | "bs-BA" | "ca-ES" | "cb-IQ" | "co-FR" | "cs-CZ" | "cx-PH" | "cy-GB" | "da-DK" | "de" | "de-DE" | "el-GR" | "en" | "en-GB" | "en-US" | "eo-EO" | "es" | "es-ES" | "es-419" | "et-EE" | "eu-ES" | "fa-IR" | "ff-NG" | "fi-FI" | "fo-FO" | "fr" | "fr-CA" | "fr-FR" | "fy-NL" | "ga-IE" | "gl-ES" | "gn-PY" | "gu-IN" | "ha-NG" | "he-IL" | "hi-IN" | "hr-HR" | "ht-HT" | "hu-HU" | "hy-AM" | "id-ID" | "ik-US" | "is-IS" | "it" | "it-IT" | "iu-CA" | "ja" | "ja-JP" | "ja-KS" | "jv-ID" | "ka-GE" | "kk-KZ" | "km-KH" | "kn-IN" | "ko" | "ko-KR" | "ku-TR" | "ky-KG" | "lo-LA" | "lt-LT" | "lv-LV" | "mg-MG" | "mk-MK" | "ml-IN" | "mn-MN" | "mr-IN" | "ms-MY" | "mt-MT" | "my-MM" | "nb-NO" | "ne-NP" | "nl-BE" | "nl-NL" | "nn-NO" | "or-IN" | "pa-IN" | "pl-PL" | "ps-AF" | "pt" | "pt-BR" | "pt-PT" | "ro-RO" | "ru" | "ru-RU" | "rw-RW" | "sc-IT" | "si-LK" | "sk-SK" | "sl-SI" | "sn-ZW" | "sq-AL" | "sr-RS" | "sv-SE" | "sw-KE" | "sy-SY" | "sz-PL" | "ta-IN" | "te-IN" | "tg-TJ" | "th-TH" | "tl-PH" | "tr" | "tr-TR" | "tt-RU" | "tz-MA" | "uk-UA" | "ur-PK" | "uz-UZ" | "vi-VN" | "zh" | "zh-CN" | "zh-HK" | "zh-MO" | "zh-TW" | "zz-TR";
58
58
  }, z.ZodTypeDef, {
59
59
  autoDetect: boolean;
60
- fallbackLanguage: "af-ZA" | "am-ET" | "ar-AR" | "as-IN" | "az-AZ" | "be-BY" | "bg-BG" | "bn-IN" | "br-FR" | "bs-BA" | "ca-ES" | "cb-IQ" | "co-FR" | "cs-CZ" | "cx-PH" | "cy-GB" | "da-DK" | "de" | "de-DE" | "el-GR" | "en" | "en-GB" | "en-US" | "eo-EO" | "es" | "es-ES" | "es-419" | "et-EE" | "eu-ES" | "fa-IR" | "ff-NG" | "fi-FI" | "fo-FO" | "fr" | "fr-CA" | "fr-FR" | "fy-NL" | "ga-IE" | "gl-ES" | "gn-PY" | "gu-IN" | "ha-NG" | "he-IL" | "hi-IN" | "hr-HR" | "ht-HT" | "hu-HU" | "hy-AM" | "id-ID" | "ik-US" | "is-IS" | "it" | "it-IT" | "iu-CA" | "ja" | "ja-JP" | "ja-KS" | "jv-ID" | "ka-GE" | "kk-KZ" | "km-KH" | "kn-IN" | "ko" | "ko-KR" | "ku-TR" | "ky-KG" | "lo-LA" | "lt-LT" | "lv-LV" | "mg-MG" | "mk-MK" | "ml-IN" | "mn-MN" | "mr-IN" | "ms-MY" | "mt-MT" | "my-MM" | "nb-NO" | "ne-NP" | "nl-BE" | "nl-NL" | "nn-NO" | "or-IN" | "pa-IN" | "pl-PL" | "ps-AF" | "pt" | "pt-BR" | "pt-PT" | "ro-RO" | "ru" | "ru-RU" | "rw-RW" | "sc-IT" | "si-LK" | "sk-SK" | "sl-SI" | "sn-ZW" | "sq-AL" | "sr-RS" | "sv-SE" | "sw-KE" | "sy-SY" | "sz-PL" | "ta-IN" | "te-IN" | "tg-TJ" | "th-TH" | "tl-PH" | "tr" | "tr-TR" | "tt-RU" | "tz-MA" | "uk-UA" | "ur-PK" | "uz-UZ" | "vi-VN" | "zh" | "zh-CN" | "zh-HK" | "zh-MO" | "zh-TW" | "zz-TR";
60
+ fallbackLanguage: "af-ZA" | "am-ET" | "ar" | "ar-AR" | "as-IN" | "az-AZ" | "be-BY" | "bg-BG" | "bn-IN" | "br-FR" | "bs-BA" | "ca-ES" | "cb-IQ" | "co-FR" | "cs-CZ" | "cx-PH" | "cy-GB" | "da-DK" | "de" | "de-DE" | "el-GR" | "en" | "en-GB" | "en-US" | "eo-EO" | "es" | "es-ES" | "es-419" | "et-EE" | "eu-ES" | "fa-IR" | "ff-NG" | "fi-FI" | "fo-FO" | "fr" | "fr-CA" | "fr-FR" | "fy-NL" | "ga-IE" | "gl-ES" | "gn-PY" | "gu-IN" | "ha-NG" | "he-IL" | "hi-IN" | "hr-HR" | "ht-HT" | "hu-HU" | "hy-AM" | "id-ID" | "ik-US" | "is-IS" | "it" | "it-IT" | "iu-CA" | "ja" | "ja-JP" | "ja-KS" | "jv-ID" | "ka-GE" | "kk-KZ" | "km-KH" | "kn-IN" | "ko" | "ko-KR" | "ku-TR" | "ky-KG" | "lo-LA" | "lt-LT" | "lv-LV" | "mg-MG" | "mk-MK" | "ml-IN" | "mn-MN" | "mr-IN" | "ms-MY" | "mt-MT" | "my-MM" | "nb-NO" | "ne-NP" | "nl-BE" | "nl-NL" | "nn-NO" | "or-IN" | "pa-IN" | "pl-PL" | "ps-AF" | "pt" | "pt-BR" | "pt-PT" | "ro-RO" | "ru" | "ru-RU" | "rw-RW" | "sc-IT" | "si-LK" | "sk-SK" | "sl-SI" | "sn-ZW" | "sq-AL" | "sr-RS" | "sv-SE" | "sw-KE" | "sy-SY" | "sz-PL" | "ta-IN" | "te-IN" | "tg-TJ" | "th-TH" | "tl-PH" | "tr" | "tr-TR" | "tt-RU" | "tz-MA" | "uk-UA" | "ur-PK" | "uz-UZ" | "vi-VN" | "zh" | "zh-CN" | "zh-HK" | "zh-MO" | "zh-TW" | "zz-TR";
61
61
  }>;
62
62
  termsOfUseUrl: z.ZodType<string | null, z.ZodTypeDef, string | null>;
63
63
  privacyPolicyUrl: z.ZodType<string | null, z.ZodTypeDef, string | null>;
@@ -332,6 +332,7 @@ export declare const fullSignInExperienceGuard: z.ZodObject<z.objectUtil.extendS
332
332
  } & {
333
333
  "af-ZA"?: string | undefined;
334
334
  "am-ET"?: string | undefined;
335
+ ar?: string | undefined;
335
336
  "ar-AR"?: string | undefined;
336
337
  "as-IN"?: string | undefined;
337
338
  "az-AZ"?: string | undefined;
@@ -466,6 +467,7 @@ export declare const fullSignInExperienceGuard: z.ZodObject<z.objectUtil.extendS
466
467
  } & {
467
468
  "af-ZA"?: string | undefined;
468
469
  "am-ET"?: string | undefined;
470
+ ar?: string | undefined;
469
471
  "ar-AR"?: string | undefined;
470
472
  "as-IN"?: string | undefined;
471
473
  "az-AZ"?: string | undefined;
@@ -671,6 +673,7 @@ export declare const fullSignInExperienceGuard: z.ZodObject<z.objectUtil.extendS
671
673
  } & {
672
674
  "af-ZA"?: string | undefined;
673
675
  "am-ET"?: string | undefined;
676
+ ar?: string | undefined;
674
677
  "ar-AR"?: string | undefined;
675
678
  "as-IN"?: string | undefined;
676
679
  "az-AZ"?: string | undefined;
@@ -845,6 +848,7 @@ export declare const fullSignInExperienceGuard: z.ZodObject<z.objectUtil.extendS
845
848
  } & {
846
849
  "af-ZA"?: string | undefined;
847
850
  "am-ET"?: string | undefined;
851
+ ar?: string | undefined;
848
852
  "ar-AR"?: string | undefined;
849
853
  "as-IN"?: string | undefined;
850
854
  "az-AZ"?: string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logto/schemas",
3
- "version": "1.19.0",
3
+ "version": "1.20.0",
4
4
  "author": "Silverhand Inc. <contact@silverhand.io>",
5
5
  "license": "MPL-2.0",
6
6
  "type": "module",
@@ -66,10 +66,10 @@
66
66
  "@logto/connector-kit": "^4.0.0",
67
67
  "@logto/core-kit": "^2.5.0",
68
68
  "@logto/language-kit": "^1.1.0",
69
- "@logto/phrases": "^1.13.0",
70
- "@logto/phrases-experience": "^1.7.0",
69
+ "@logto/phrases": "^1.14.0",
70
+ "@logto/phrases-experience": "^1.8.0",
71
71
  "@logto/shared": "^3.1.1",
72
- "@withtyped/server": "^0.13.6",
72
+ "@withtyped/server": "^0.14.0",
73
73
  "nanoid": "^5.0.1"
74
74
  },
75
75
  "peerDependencies": {
@@ -0,0 +1,16 @@
1
+ /* init_order = 2 */
2
+
3
+ create table personal_access_tokens (
4
+ tenant_id varchar(21) not null
5
+ references tenants (id) on update cascade on delete cascade,
6
+ user_id varchar(21) not null
7
+ references users (id) on update cascade on delete cascade,
8
+ /** The name of the secret. Should be unique within the user. */
9
+ name varchar(256) not null,
10
+ value varchar(64) not null,
11
+ created_at timestamptz not null default now(),
12
+ expires_at timestamptz,
13
+ primary key (tenant_id, user_id, name)
14
+ );
15
+
16
+ create index personal_access_token__value on personal_access_tokens (tenant_id, value);
@@ -0,0 +1,15 @@
1
+ create table verification_records (
2
+ tenant_id varchar(21) not null
3
+ references tenants (id) on update cascade on delete cascade,
4
+ id varchar(21) not null,
5
+ user_id varchar(21)
6
+ references users (id) on update cascade on delete cascade,
7
+ created_at timestamptz not null default(now()),
8
+ expires_at timestamptz not null,
9
+ /** Use JsonObject here to avoid complex typing, the type will be validated in verification classes. */
10
+ data jsonb /* @use JsonObject */ not null default '{}'::jsonb,
11
+ primary key (id)
12
+ );
13
+
14
+ create index verification_records__id
15
+ on verification_records (tenant_id, id);
@@ -5,6 +5,7 @@ create table verification_statuses (
5
5
  user_id varchar(21) not null
6
6
  references users (id) on update cascade on delete cascade,
7
7
  created_at timestamptz not null default(now()),
8
+ verified_identifier varchar(255),
8
9
  primary key (id)
9
10
  );
10
11