@logto/schemas 1.10.0 → 1.10.1

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 (144) hide show
  1. package/alterations/1.10.1-1695647183-update-private-key-type.ts +108 -0
  2. package/alterations/1.10.1-1696657546-organization-tables.ts +150 -0
  3. package/alterations/1.10.1-1697683802-add-sso-connectors-table.ts +66 -0
  4. package/alterations/1.10.1-1698646271-add-organization-created-flag.ts +75 -0
  5. package/alterations/1.10.1-1698820410-add-user-sso-identities-table.ts +61 -0
  6. package/alterations/1.10.1-1698910485-user-logto-data.ts +20 -0
  7. package/alterations-js/1.10.1-1695647183-update-private-key-type.d.ts +3 -0
  8. package/alterations-js/1.10.1-1695647183-update-private-key-type.js +50 -0
  9. package/alterations-js/1.10.1-1696657546-organization-tables.d.ts +3 -0
  10. package/alterations-js/1.10.1-1696657546-organization-tables.js +136 -0
  11. package/alterations-js/1.10.1-1697683802-add-sso-connectors-table.d.ts +3 -0
  12. package/alterations-js/1.10.1-1697683802-add-sso-connectors-table.js +58 -0
  13. package/alterations-js/1.10.1-1698646271-add-organization-created-flag.d.ts +3 -0
  14. package/alterations-js/1.10.1-1698646271-add-organization-created-flag.js +26 -0
  15. package/alterations-js/1.10.1-1698820410-add-user-sso-identities-table.d.ts +4 -0
  16. package/alterations-js/1.10.1-1698820410-add-user-sso-identities-table.js +53 -0
  17. package/alterations-js/1.10.1-1698910485-user-logto-data.d.ts +3 -0
  18. package/alterations-js/1.10.1-1698910485-user-logto-data.js +16 -0
  19. package/lib/db-entries/application.d.ts +7 -1
  20. package/lib/db-entries/application.js +1 -0
  21. package/lib/db-entries/applications-role.d.ts +7 -1
  22. package/lib/db-entries/applications-role.js +1 -0
  23. package/lib/db-entries/connector.d.ts +7 -1
  24. package/lib/db-entries/connector.js +1 -0
  25. package/lib/db-entries/custom-phrase.d.ts +7 -1
  26. package/lib/db-entries/custom-phrase.js +1 -0
  27. package/lib/db-entries/daily-active-user.d.ts +7 -1
  28. package/lib/db-entries/daily-active-user.js +1 -0
  29. package/lib/db-entries/domain.d.ts +7 -1
  30. package/lib/db-entries/domain.js +1 -0
  31. package/lib/db-entries/hook.d.ts +7 -1
  32. package/lib/db-entries/hook.js +1 -0
  33. package/lib/db-entries/index.d.ts +8 -0
  34. package/lib/db-entries/index.js +8 -0
  35. package/lib/db-entries/log.d.ts +7 -1
  36. package/lib/db-entries/log.js +1 -0
  37. package/lib/db-entries/logto-config.d.ts +10 -4
  38. package/lib/db-entries/logto-config.js +4 -3
  39. package/lib/db-entries/oidc-model-instance.d.ts +7 -1
  40. package/lib/db-entries/oidc-model-instance.js +1 -0
  41. package/lib/db-entries/organization-role-scope-relation.d.ts +20 -0
  42. package/lib/db-entries/organization-role-scope-relation.js +29 -0
  43. package/lib/db-entries/organization-role-user-relation.d.ts +22 -0
  44. package/lib/db-entries/organization-role-user-relation.js +33 -0
  45. package/lib/db-entries/organization-role.d.ts +28 -0
  46. package/lib/db-entries/organization-role.js +33 -0
  47. package/lib/db-entries/organization-scope.d.ts +28 -0
  48. package/lib/db-entries/organization-scope.js +33 -0
  49. package/lib/db-entries/organization-user-relation.d.ts +20 -0
  50. package/lib/db-entries/organization-user-relation.js +29 -0
  51. package/lib/db-entries/organization.d.ts +32 -0
  52. package/lib/db-entries/organization.js +37 -0
  53. package/lib/db-entries/passcode.d.ts +7 -1
  54. package/lib/db-entries/passcode.js +1 -0
  55. package/lib/db-entries/resource.d.ts +7 -1
  56. package/lib/db-entries/resource.js +1 -0
  57. package/lib/db-entries/role.d.ts +7 -1
  58. package/lib/db-entries/role.js +1 -0
  59. package/lib/db-entries/roles-scope.d.ts +7 -1
  60. package/lib/db-entries/roles-scope.js +1 -0
  61. package/lib/db-entries/scope.d.ts +7 -1
  62. package/lib/db-entries/scope.js +1 -0
  63. package/lib/db-entries/sentinel-activity.d.ts +7 -1
  64. package/lib/db-entries/sentinel-activity.js +1 -0
  65. package/lib/db-entries/service-log.d.ts +7 -1
  66. package/lib/db-entries/service-log.js +1 -0
  67. package/lib/db-entries/sign-in-experience.d.ts +7 -1
  68. package/lib/db-entries/sign-in-experience.js +1 -0
  69. package/lib/db-entries/sso-connector.d.ts +50 -0
  70. package/lib/db-entries/sso-connector.js +58 -0
  71. package/lib/db-entries/system.d.ts +7 -1
  72. package/lib/db-entries/system.js +1 -0
  73. package/lib/db-entries/user-sso-identity.d.ts +30 -0
  74. package/lib/db-entries/user-sso-identity.js +46 -0
  75. package/lib/db-entries/user.d.ts +9 -1
  76. package/lib/db-entries/user.js +5 -0
  77. package/lib/db-entries/users-role.d.ts +7 -1
  78. package/lib/db-entries/users-role.js +1 -0
  79. package/lib/db-entries/verification-status.d.ts +7 -1
  80. package/lib/db-entries/verification-status.js +1 -0
  81. package/lib/foundations/index.d.ts +1 -1
  82. package/lib/foundations/index.js +1 -1
  83. package/lib/foundations/jsonb-types/custom-domain.d.ts +134 -0
  84. package/lib/foundations/jsonb-types/custom-domain.js +36 -0
  85. package/lib/foundations/jsonb-types/hooks.d.ts +32 -0
  86. package/lib/foundations/jsonb-types/hooks.js +24 -0
  87. package/lib/foundations/jsonb-types/index.d.ts +15 -0
  88. package/lib/foundations/jsonb-types/index.js +16 -0
  89. package/lib/foundations/jsonb-types/logs.d.ts +106 -0
  90. package/lib/foundations/jsonb-types/logs.js +20 -0
  91. package/lib/foundations/jsonb-types/oidc-module.d.ts +80 -0
  92. package/lib/foundations/jsonb-types/oidc-module.js +54 -0
  93. package/lib/foundations/jsonb-types/phrases.d.ts +5 -0
  94. package/lib/foundations/jsonb-types/phrases.js +2 -0
  95. package/lib/foundations/jsonb-types/sentinel.d.ts +27 -0
  96. package/lib/foundations/jsonb-types/sentinel.js +28 -0
  97. package/lib/foundations/jsonb-types/sign-in-experience.d.ts +118 -0
  98. package/lib/foundations/jsonb-types/sign-in-experience.js +56 -0
  99. package/lib/foundations/jsonb-types/sso-connector.d.ts +14 -0
  100. package/lib/foundations/jsonb-types/sso-connector.js +6 -0
  101. package/lib/foundations/jsonb-types/users.d.ts +285 -0
  102. package/lib/foundations/jsonb-types/users.js +47 -0
  103. package/lib/foundations/schemas.d.ts +11 -13
  104. package/lib/models/tenants.d.ts +7 -11
  105. package/lib/seeds/logto-config.js +1 -0
  106. package/lib/types/application.d.ts +51 -1
  107. package/lib/types/application.js +7 -1
  108. package/lib/types/connector.d.ts +516 -2360
  109. package/lib/types/domain.d.ts +65 -27
  110. package/lib/types/hook.d.ts +15 -16
  111. package/lib/types/index.d.ts +3 -0
  112. package/lib/types/index.js +3 -0
  113. package/lib/types/interactions.d.ts +502 -10
  114. package/lib/types/interactions.js +83 -5
  115. package/lib/types/log/interaction.d.ts +4 -3
  116. package/lib/types/log/interaction.js +1 -0
  117. package/lib/types/logto-config.d.ts +50 -2
  118. package/lib/types/logto-config.js +30 -3
  119. package/lib/types/mfa.d.ts +211 -0
  120. package/lib/types/mfa.js +62 -0
  121. package/lib/types/organization.d.ts +44 -0
  122. package/lib/types/organization.js +20 -0
  123. package/lib/types/role.d.ts +5 -3
  124. package/lib/types/scope.d.ts +12 -27
  125. package/lib/types/sso-connector.d.ts +21 -0
  126. package/lib/types/sso-connector.js +10 -0
  127. package/lib/types/system.d.ts +26 -7
  128. package/lib/types/system.js +8 -0
  129. package/lib/types/user-assets.d.ts +2 -2
  130. package/lib/types/user.d.ts +209 -66
  131. package/lib/types/user.js +8 -2
  132. package/package.json +6 -6
  133. package/tables/logto_configs.sql +1 -1
  134. package/tables/organization_role_scope_relations.sql +12 -0
  135. package/tables/organization_role_user_relations.sql +14 -0
  136. package/tables/organization_roles.sql +19 -0
  137. package/tables/organization_scopes.sql +19 -0
  138. package/tables/organization_user_relations.sql +12 -0
  139. package/tables/organizations.sql +19 -0
  140. package/tables/sso_connectors.sql +29 -0
  141. package/tables/user_sso_identities.sql +17 -0
  142. package/tables/users.sql +1 -0
  143. package/lib/foundations/jsonb-types.d.ts +0 -673
  144. package/lib/foundations/jsonb-types.js +0 -260
@@ -0,0 +1,33 @@
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(21),
6
+ name: z.string().min(1).max(128),
7
+ description: z.string().max(256).nullable().optional(),
8
+ });
9
+ const guard = z.object({
10
+ tenantId: z.string().max(21),
11
+ id: z.string().min(1).max(21),
12
+ name: z.string().min(1).max(128),
13
+ description: z.string().max(256).nullable(),
14
+ });
15
+ export const OrganizationRoles = Object.freeze({
16
+ table: 'organization_roles',
17
+ tableSingular: 'organization_role',
18
+ fields: {
19
+ tenantId: 'tenant_id',
20
+ id: 'id',
21
+ name: 'name',
22
+ description: 'description',
23
+ },
24
+ fieldKeys: [
25
+ 'tenantId',
26
+ 'id',
27
+ 'name',
28
+ 'description',
29
+ ],
30
+ createGuard,
31
+ guard,
32
+ updateGuard: guard.partial(),
33
+ });
@@ -0,0 +1,28 @@
1
+ import { GeneratedSchema } from './../foundations/index.js';
2
+ /**
3
+ * The scopes (permissions) defined by the organization template.
4
+ *
5
+ * @remarks This is a type for database creation.
6
+ * @see {@link OrganizationScope} for the original type.
7
+ */
8
+ export type CreateOrganizationScope = {
9
+ tenantId?: string;
10
+ /** The globally unique identifier of the organization scope. */
11
+ id: string;
12
+ /** The organization scope's name, unique within the organization template. */
13
+ name: string;
14
+ /** A brief description of the organization scope. */
15
+ description?: string | null;
16
+ };
17
+ /** The scopes (permissions) defined by the organization template. */
18
+ export type OrganizationScope = {
19
+ tenantId: string;
20
+ /** The globally unique identifier of the organization scope. */
21
+ id: string;
22
+ /** The organization scope's name, unique within the organization template. */
23
+ name: string;
24
+ /** A brief description of the organization scope. */
25
+ description: string | null;
26
+ };
27
+ export type OrganizationScopeKeys = 'tenantId' | 'id' | 'name' | 'description';
28
+ export declare const OrganizationScopes: GeneratedSchema<OrganizationScopeKeys, CreateOrganizationScope, OrganizationScope, 'organization_scopes', 'organization_scope'>;
@@ -0,0 +1,33 @@
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(21),
6
+ name: z.string().min(1).max(128),
7
+ description: z.string().max(256).nullable().optional(),
8
+ });
9
+ const guard = z.object({
10
+ tenantId: z.string().max(21),
11
+ id: z.string().min(1).max(21),
12
+ name: z.string().min(1).max(128),
13
+ description: z.string().max(256).nullable(),
14
+ });
15
+ export const OrganizationScopes = Object.freeze({
16
+ table: 'organization_scopes',
17
+ tableSingular: 'organization_scope',
18
+ fields: {
19
+ tenantId: 'tenant_id',
20
+ id: 'id',
21
+ name: 'name',
22
+ description: 'description',
23
+ },
24
+ fieldKeys: [
25
+ 'tenantId',
26
+ 'id',
27
+ 'name',
28
+ 'description',
29
+ ],
30
+ createGuard,
31
+ guard,
32
+ updateGuard: guard.partial(),
33
+ });
@@ -0,0 +1,20 @@
1
+ import { GeneratedSchema } from './../foundations/index.js';
2
+ /**
3
+ * The relations between organizations and users. It indicates membership of users in organizations.
4
+ *
5
+ * @remarks This is a type for database creation.
6
+ * @see {@link OrganizationUserRelation} for the original type.
7
+ */
8
+ export type CreateOrganizationUserRelation = {
9
+ tenantId?: string;
10
+ organizationId: string;
11
+ userId: string;
12
+ };
13
+ /** The relations between organizations and users. It indicates membership of users in organizations. */
14
+ export type OrganizationUserRelation = {
15
+ tenantId: string;
16
+ organizationId: string;
17
+ userId: string;
18
+ };
19
+ export type OrganizationUserRelationKeys = 'tenantId' | 'organizationId' | 'userId';
20
+ export declare const OrganizationUserRelations: GeneratedSchema<OrganizationUserRelationKeys, CreateOrganizationUserRelation, OrganizationUserRelation, 'organization_user_relations', 'organization_user_relation'>;
@@ -0,0 +1,29 @@
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
+ organizationId: z.string().min(1).max(21),
6
+ userId: z.string().min(1).max(21),
7
+ });
8
+ const guard = z.object({
9
+ tenantId: z.string().max(21),
10
+ organizationId: z.string().min(1).max(21),
11
+ userId: z.string().min(1).max(21),
12
+ });
13
+ export const OrganizationUserRelations = Object.freeze({
14
+ table: 'organization_user_relations',
15
+ tableSingular: 'organization_user_relation',
16
+ fields: {
17
+ tenantId: 'tenant_id',
18
+ organizationId: 'organization_id',
19
+ userId: 'user_id',
20
+ },
21
+ fieldKeys: [
22
+ 'tenantId',
23
+ 'organizationId',
24
+ 'userId',
25
+ ],
26
+ createGuard,
27
+ guard,
28
+ updateGuard: guard.partial(),
29
+ });
@@ -0,0 +1,32 @@
1
+ import { GeneratedSchema } from './../foundations/index.js';
2
+ /**
3
+ * Organizations defined by [RFC 0001](https://github.com/logto-io/rfcs/blob/HEAD/active/0001-organization.md).
4
+ *
5
+ * @remarks This is a type for database creation.
6
+ * @see {@link Organization} for the original type.
7
+ */
8
+ export type CreateOrganization = {
9
+ tenantId?: string;
10
+ /** The globally unique identifier of the organization. */
11
+ id: string;
12
+ /** The organization's name for display. */
13
+ name: string;
14
+ /** A brief description of the organization. */
15
+ description?: string | null;
16
+ /** When the organization was created. */
17
+ createdAt?: number;
18
+ };
19
+ /** Organizations defined by [RFC 0001](https://github.com/logto-io/rfcs/blob/HEAD/active/0001-organization.md). */
20
+ export type Organization = {
21
+ tenantId: string;
22
+ /** The globally unique identifier of the organization. */
23
+ id: string;
24
+ /** The organization's name for display. */
25
+ name: string;
26
+ /** A brief description of the organization. */
27
+ description: string | null;
28
+ /** When the organization was created. */
29
+ createdAt: number;
30
+ };
31
+ export type OrganizationKeys = 'tenantId' | 'id' | 'name' | 'description' | 'createdAt';
32
+ export declare const Organizations: GeneratedSchema<OrganizationKeys, CreateOrganization, Organization, 'organizations', 'organization'>;
@@ -0,0 +1,37 @@
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(21),
6
+ name: z.string().min(1).max(128),
7
+ description: z.string().max(256).nullable().optional(),
8
+ createdAt: z.number().optional(),
9
+ });
10
+ const guard = z.object({
11
+ tenantId: z.string().max(21),
12
+ id: z.string().min(1).max(21),
13
+ name: z.string().min(1).max(128),
14
+ description: z.string().max(256).nullable(),
15
+ createdAt: z.number(),
16
+ });
17
+ export const Organizations = Object.freeze({
18
+ table: 'organizations',
19
+ tableSingular: 'organization',
20
+ fields: {
21
+ tenantId: 'tenant_id',
22
+ id: 'id',
23
+ name: 'name',
24
+ description: 'description',
25
+ createdAt: 'created_at',
26
+ },
27
+ fieldKeys: [
28
+ 'tenantId',
29
+ 'id',
30
+ 'name',
31
+ 'description',
32
+ 'createdAt',
33
+ ],
34
+ createGuard,
35
+ guard,
36
+ updateGuard: guard.partial(),
37
+ });
@@ -1,4 +1,9 @@
1
1
  import { GeneratedSchema } from './../foundations/index.js';
2
+ /**
3
+ *
4
+ * @remarks This is a type for database creation.
5
+ * @see {@link Passcode} for the original type.
6
+ */
2
7
  export type CreatePasscode = {
3
8
  tenantId?: string;
4
9
  id: string;
@@ -23,4 +28,5 @@ export type Passcode = {
23
28
  tryCount: number;
24
29
  createdAt: number;
25
30
  };
26
- export declare const Passcodes: GeneratedSchema<CreatePasscode, Passcode>;
31
+ export type PasscodeKeys = 'tenantId' | 'id' | 'interactionJti' | 'phone' | 'email' | 'type' | 'code' | 'consumed' | 'tryCount' | 'createdAt';
32
+ export declare const Passcodes: GeneratedSchema<PasscodeKeys, CreatePasscode, Passcode, 'passcodes', 'passcode'>;
@@ -53,4 +53,5 @@ export const Passcodes = Object.freeze({
53
53
  ],
54
54
  createGuard,
55
55
  guard,
56
+ updateGuard: guard.partial(),
56
57
  });
@@ -1,4 +1,9 @@
1
1
  import { GeneratedSchema } from './../foundations/index.js';
2
+ /**
3
+ *
4
+ * @remarks This is a type for database creation.
5
+ * @see {@link Resource} for the original type.
6
+ */
2
7
  export type CreateResource = {
3
8
  tenantId?: string;
4
9
  id: string;
@@ -15,4 +20,5 @@ export type Resource = {
15
20
  isDefault: boolean;
16
21
  accessTokenTtl: number;
17
22
  };
18
- export declare const Resources: GeneratedSchema<CreateResource, Resource>;
23
+ export type ResourceKeys = 'tenantId' | 'id' | 'name' | 'indicator' | 'isDefault' | 'accessTokenTtl';
24
+ export declare const Resources: GeneratedSchema<ResourceKeys, CreateResource, Resource, 'resources', 'resource'>;
@@ -37,4 +37,5 @@ export const Resources = Object.freeze({
37
37
  ],
38
38
  createGuard,
39
39
  guard,
40
+ updateGuard: guard.partial(),
40
41
  });
@@ -1,5 +1,10 @@
1
1
  import { GeneratedSchema } from './../foundations/index.js';
2
2
  import { RoleType } from './custom-types.js';
3
+ /**
4
+ *
5
+ * @remarks This is a type for database creation.
6
+ * @see {@link Role} for the original type.
7
+ */
3
8
  export type CreateRole = {
4
9
  tenantId?: string;
5
10
  id: string;
@@ -14,4 +19,5 @@ export type Role = {
14
19
  description: string;
15
20
  type: RoleType;
16
21
  };
17
- export declare const Roles: GeneratedSchema<CreateRole, Role>;
22
+ export type RoleKeys = 'tenantId' | 'id' | 'name' | 'description' | 'type';
23
+ export declare const Roles: GeneratedSchema<RoleKeys, CreateRole, Role, 'roles', 'role'>;
@@ -34,4 +34,5 @@ export const Roles = Object.freeze({
34
34
  ],
35
35
  createGuard,
36
36
  guard,
37
+ updateGuard: guard.partial(),
37
38
  });
@@ -1,4 +1,9 @@
1
1
  import { GeneratedSchema } from './../foundations/index.js';
2
+ /**
3
+ *
4
+ * @remarks This is a type for database creation.
5
+ * @see {@link RolesScope} for the original type.
6
+ */
2
7
  export type CreateRolesScope = {
3
8
  tenantId?: string;
4
9
  id: string;
@@ -11,4 +16,5 @@ export type RolesScope = {
11
16
  roleId: string;
12
17
  scopeId: string;
13
18
  };
14
- export declare const RolesScopes: GeneratedSchema<CreateRolesScope, RolesScope>;
19
+ export type RolesScopeKeys = 'tenantId' | 'id' | 'roleId' | 'scopeId';
20
+ export declare const RolesScopes: GeneratedSchema<RolesScopeKeys, CreateRolesScope, RolesScope, 'roles_scopes', 'roles_scope'>;
@@ -29,4 +29,5 @@ export const RolesScopes = Object.freeze({
29
29
  ],
30
30
  createGuard,
31
31
  guard,
32
+ updateGuard: guard.partial(),
32
33
  });
@@ -1,4 +1,9 @@
1
1
  import { GeneratedSchema } from './../foundations/index.js';
2
+ /**
3
+ *
4
+ * @remarks This is a type for database creation.
5
+ * @see {@link Scope} for the original type.
6
+ */
2
7
  export type CreateScope = {
3
8
  tenantId?: string;
4
9
  id: string;
@@ -15,4 +20,5 @@ export type Scope = {
15
20
  description: string;
16
21
  createdAt: number;
17
22
  };
18
- export declare const Scopes: GeneratedSchema<CreateScope, Scope>;
23
+ export type ScopeKeys = 'tenantId' | 'id' | 'resourceId' | 'name' | 'description' | 'createdAt';
24
+ export declare const Scopes: GeneratedSchema<ScopeKeys, CreateScope, Scope, 'scopes', 'scope'>;
@@ -37,4 +37,5 @@ export const Scopes = Object.freeze({
37
37
  ],
38
38
  createGuard,
39
39
  guard,
40
+ updateGuard: guard.partial(),
40
41
  });
@@ -1,5 +1,10 @@
1
1
  import { SentinelActivityTargetType, SentinelActivityAction, SentinelActivityPayload, GeneratedSchema } from './../foundations/index.js';
2
2
  import { SentinelActionResult, SentinelDecision } from './custom-types.js';
3
+ /**
4
+ *
5
+ * @remarks This is a type for database creation.
6
+ * @see {@link SentinelActivity} for the original type.
7
+ */
3
8
  export type CreateSentinelActivity = {
4
9
  tenantId?: string;
5
10
  id: string;
@@ -40,4 +45,5 @@ export type SentinelActivity = {
40
45
  /** The time the activity was created. */
41
46
  createdAt: number;
42
47
  };
43
- export declare const SentinelActivities: GeneratedSchema<CreateSentinelActivity, SentinelActivity>;
48
+ export type SentinelActivityKeys = 'tenantId' | 'id' | 'targetType' | 'targetHash' | 'action' | 'actionResult' | 'payload' | 'decision' | 'decisionExpiresAt' | 'createdAt';
49
+ export declare const SentinelActivities: GeneratedSchema<SentinelActivityKeys, CreateSentinelActivity, SentinelActivity, 'sentinel_activities', 'sentinel_activity'>;
@@ -55,4 +55,5 @@ export const SentinelActivities = Object.freeze({
55
55
  ],
56
56
  createGuard,
57
57
  guard,
58
+ updateGuard: guard.partial(),
58
59
  });
@@ -1,4 +1,9 @@
1
1
  import { JsonObject, GeneratedSchema } from './../foundations/index.js';
2
+ /**
3
+ *
4
+ * @remarks This is a type for database creation.
5
+ * @see {@link ServiceLog} for the original type.
6
+ */
2
7
  export type CreateServiceLog = {
3
8
  id: string;
4
9
  tenantId?: string;
@@ -13,4 +18,5 @@ export type ServiceLog = {
13
18
  payload: JsonObject;
14
19
  createdAt: number;
15
20
  };
16
- export declare const ServiceLogs: GeneratedSchema<CreateServiceLog, ServiceLog>;
21
+ export type ServiceLogKeys = 'id' | 'tenantId' | 'type' | 'payload' | 'createdAt';
22
+ export declare const ServiceLogs: GeneratedSchema<ServiceLogKeys, CreateServiceLog, ServiceLog, 'service_logs', 'service_log'>;
@@ -34,4 +34,5 @@ export const ServiceLogs = Object.freeze({
34
34
  ],
35
35
  createGuard,
36
36
  guard,
37
+ updateGuard: guard.partial(),
37
38
  });
@@ -1,5 +1,10 @@
1
1
  import { Color, Branding, LanguageInfo, SignIn, SignUp, ConnectorTargets, CustomContent, PartialPasswordPolicy, Mfa, GeneratedSchema } from './../foundations/index.js';
2
2
  import { SignInMode } from './custom-types.js';
3
+ /**
4
+ *
5
+ * @remarks This is a type for database creation.
6
+ * @see {@link SignInExperience} for the original type.
7
+ */
3
8
  export type CreateSignInExperience = {
4
9
  tenantId?: string;
5
10
  id: string;
@@ -34,4 +39,5 @@ export type SignInExperience = {
34
39
  passwordPolicy: PartialPasswordPolicy;
35
40
  mfa: Mfa;
36
41
  };
37
- export declare const SignInExperiences: GeneratedSchema<CreateSignInExperience, SignInExperience>;
42
+ export type SignInExperienceKeys = 'tenantId' | 'id' | 'color' | 'branding' | 'languageInfo' | 'termsOfUseUrl' | 'privacyPolicyUrl' | 'signIn' | 'signUp' | 'socialSignInConnectorTargets' | 'signInMode' | 'customCss' | 'customContent' | 'passwordPolicy' | 'mfa';
43
+ export declare const SignInExperiences: GeneratedSchema<SignInExperienceKeys, CreateSignInExperience, SignInExperience, 'sign_in_experiences', 'sign_in_experience'>;
@@ -75,4 +75,5 @@ export const SignInExperiences = Object.freeze({
75
75
  ],
76
76
  createGuard,
77
77
  guard,
78
+ updateGuard: guard.partial(),
78
79
  });
@@ -0,0 +1,50 @@
1
+ import { JsonObject, SsoDomains, SsoBranding, GeneratedSchema } from './../foundations/index.js';
2
+ /**
3
+ *
4
+ * @remarks This is a type for database creation.
5
+ * @see {@link SsoConnector} for the original type.
6
+ */
7
+ export type CreateSsoConnector = {
8
+ tenantId?: string;
9
+ /** The globally unique identifier of the SSO connector. */
10
+ id: string;
11
+ /** The connector factory name of the SSO provider. */
12
+ providerName: string;
13
+ /** The name of the SSO provider for display. */
14
+ connectorName: string;
15
+ /** The connector configuration. Different schemas for different provide type */
16
+ config?: JsonObject;
17
+ /** The SSO email domains. */
18
+ domains?: SsoDomains;
19
+ /** The SSO branding. */
20
+ branding?: SsoBranding;
21
+ /** Determines whether to synchronize the user's profile on each login. */
22
+ syncProfile?: boolean;
23
+ /** Determines whether SSO is the restricted sign-in method for users with the SSO registered email domains */
24
+ ssoOnly?: boolean;
25
+ /** When the SSO connector was created. */
26
+ createdAt?: number;
27
+ };
28
+ export type SsoConnector = {
29
+ tenantId: string;
30
+ /** The globally unique identifier of the SSO connector. */
31
+ id: string;
32
+ /** The connector factory name of the SSO provider. */
33
+ providerName: string;
34
+ /** The name of the SSO provider for display. */
35
+ connectorName: string;
36
+ /** The connector configuration. Different schemas for different provide type */
37
+ config: JsonObject;
38
+ /** The SSO email domains. */
39
+ domains: SsoDomains;
40
+ /** The SSO branding. */
41
+ branding: SsoBranding;
42
+ /** Determines whether to synchronize the user's profile on each login. */
43
+ syncProfile: boolean;
44
+ /** Determines whether SSO is the restricted sign-in method for users with the SSO registered email domains */
45
+ ssoOnly: boolean;
46
+ /** When the SSO connector was created. */
47
+ createdAt: number;
48
+ };
49
+ export type SsoConnectorKeys = 'tenantId' | 'id' | 'providerName' | 'connectorName' | 'config' | 'domains' | 'branding' | 'syncProfile' | 'ssoOnly' | 'createdAt';
50
+ export declare const SsoConnectors: GeneratedSchema<SsoConnectorKeys, CreateSsoConnector, SsoConnector, 'sso_connectors', 'sso_connector'>;
@@ -0,0 +1,58 @@
1
+ // THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
+ import { z } from 'zod';
3
+ import { jsonObjectGuard, ssoDomainsGuard, ssoBrandingGuard } from './../foundations/index.js';
4
+ const createGuard = z.object({
5
+ tenantId: z.string().max(21).optional(),
6
+ id: z.string().min(1).max(128),
7
+ providerName: z.string().min(1).max(128),
8
+ connectorName: z.string().min(1).max(128),
9
+ config: jsonObjectGuard.optional(),
10
+ domains: ssoDomainsGuard.optional(),
11
+ branding: ssoBrandingGuard.optional(),
12
+ syncProfile: z.boolean().optional(),
13
+ ssoOnly: z.boolean().optional(),
14
+ createdAt: z.number().optional(),
15
+ });
16
+ const guard = z.object({
17
+ tenantId: z.string().max(21),
18
+ id: z.string().min(1).max(128),
19
+ providerName: z.string().min(1).max(128),
20
+ connectorName: z.string().min(1).max(128),
21
+ config: jsonObjectGuard,
22
+ domains: ssoDomainsGuard,
23
+ branding: ssoBrandingGuard,
24
+ syncProfile: z.boolean(),
25
+ ssoOnly: z.boolean(),
26
+ createdAt: z.number(),
27
+ });
28
+ export const SsoConnectors = Object.freeze({
29
+ table: 'sso_connectors',
30
+ tableSingular: 'sso_connector',
31
+ fields: {
32
+ tenantId: 'tenant_id',
33
+ id: 'id',
34
+ providerName: 'provider_name',
35
+ connectorName: 'connector_name',
36
+ config: 'config',
37
+ domains: 'domains',
38
+ branding: 'branding',
39
+ syncProfile: 'sync_profile',
40
+ ssoOnly: 'sso_only',
41
+ createdAt: 'created_at',
42
+ },
43
+ fieldKeys: [
44
+ 'tenantId',
45
+ 'id',
46
+ 'providerName',
47
+ 'connectorName',
48
+ 'config',
49
+ 'domains',
50
+ 'branding',
51
+ 'syncProfile',
52
+ 'ssoOnly',
53
+ 'createdAt',
54
+ ],
55
+ createGuard,
56
+ guard,
57
+ updateGuard: guard.partial(),
58
+ });
@@ -1,4 +1,9 @@
1
1
  import { JsonObject, GeneratedSchema } from './../foundations/index.js';
2
+ /**
3
+ *
4
+ * @remarks This is a type for database creation.
5
+ * @see {@link System} for the original type.
6
+ */
2
7
  export type CreateSystem = {
3
8
  key: string;
4
9
  value?: JsonObject;
@@ -7,4 +12,5 @@ export type System = {
7
12
  key: string;
8
13
  value: JsonObject;
9
14
  };
10
- export declare const Systems: GeneratedSchema<CreateSystem, System>;
15
+ export type SystemKeys = 'key' | 'value';
16
+ export declare const Systems: GeneratedSchema<SystemKeys, CreateSystem, System, 'systems', 'system'>;
@@ -22,4 +22,5 @@ export const Systems = Object.freeze({
22
22
  ],
23
23
  createGuard,
24
24
  guard,
25
+ updateGuard: guard.partial(),
25
26
  });
@@ -0,0 +1,30 @@
1
+ import { JsonObject, GeneratedSchema } from './../foundations/index.js';
2
+ /**
3
+ *
4
+ * @remarks This is a type for database creation.
5
+ * @see {@link UserSsoIdentity} for the original type.
6
+ */
7
+ export type CreateUserSsoIdentity = {
8
+ tenantId?: string;
9
+ id: string;
10
+ userId: string;
11
+ /** Unique provider identifier. Issuer of the OIDC connectors, entityId of the SAML providers */
12
+ issuer: string;
13
+ /** Provider user identity id */
14
+ identityId: string;
15
+ detail?: JsonObject;
16
+ createdAt?: number;
17
+ };
18
+ export type UserSsoIdentity = {
19
+ tenantId: string;
20
+ id: string;
21
+ userId: string;
22
+ /** Unique provider identifier. Issuer of the OIDC connectors, entityId of the SAML providers */
23
+ issuer: string;
24
+ /** Provider user identity id */
25
+ identityId: string;
26
+ detail: JsonObject;
27
+ createdAt: number;
28
+ };
29
+ export type UserSsoIdentityKeys = 'tenantId' | 'id' | 'userId' | 'issuer' | 'identityId' | 'detail' | 'createdAt';
30
+ export declare const UserSsoIdentities: GeneratedSchema<UserSsoIdentityKeys, CreateUserSsoIdentity, UserSsoIdentity, 'user_sso_identities', 'user_sso_identity'>;
@@ -0,0 +1,46 @@
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().min(1).max(12),
8
+ issuer: z.string().min(1).max(256),
9
+ identityId: z.string().min(1).max(128),
10
+ detail: jsonObjectGuard.optional(),
11
+ createdAt: z.number().optional(),
12
+ });
13
+ const guard = z.object({
14
+ tenantId: z.string().max(21),
15
+ id: z.string().min(1).max(21),
16
+ userId: z.string().min(1).max(12),
17
+ issuer: z.string().min(1).max(256),
18
+ identityId: z.string().min(1).max(128),
19
+ detail: jsonObjectGuard,
20
+ createdAt: z.number(),
21
+ });
22
+ export const UserSsoIdentities = Object.freeze({
23
+ table: 'user_sso_identities',
24
+ tableSingular: 'user_sso_identity',
25
+ fields: {
26
+ tenantId: 'tenant_id',
27
+ id: 'id',
28
+ userId: 'user_id',
29
+ issuer: 'issuer',
30
+ identityId: 'identity_id',
31
+ detail: 'detail',
32
+ createdAt: 'created_at',
33
+ },
34
+ fieldKeys: [
35
+ 'tenantId',
36
+ 'id',
37
+ 'userId',
38
+ 'issuer',
39
+ 'identityId',
40
+ 'detail',
41
+ 'createdAt',
42
+ ],
43
+ createGuard,
44
+ guard,
45
+ updateGuard: guard.partial(),
46
+ });