@logto/schemas 1.10.0 → 1.11.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 (153) 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/1.11.0-1699422979-add-sso-connector-id-col-to-user-sso-identities-table.ts +18 -0
  8. package/alterations/1.11.0-1699598903-remove-sso-only-column-in-sso-connectors-table.ts +18 -0
  9. package/alterations-js/1.10.1-1695647183-update-private-key-type.d.ts +3 -0
  10. package/alterations-js/1.10.1-1695647183-update-private-key-type.js +50 -0
  11. package/alterations-js/1.10.1-1696657546-organization-tables.d.ts +3 -0
  12. package/alterations-js/1.10.1-1696657546-organization-tables.js +136 -0
  13. package/alterations-js/1.10.1-1697683802-add-sso-connectors-table.d.ts +3 -0
  14. package/alterations-js/1.10.1-1697683802-add-sso-connectors-table.js +58 -0
  15. package/alterations-js/1.10.1-1698646271-add-organization-created-flag.d.ts +3 -0
  16. package/alterations-js/1.10.1-1698646271-add-organization-created-flag.js +26 -0
  17. package/alterations-js/1.10.1-1698820410-add-user-sso-identities-table.d.ts +4 -0
  18. package/alterations-js/1.10.1-1698820410-add-user-sso-identities-table.js +53 -0
  19. package/alterations-js/1.10.1-1698910485-user-logto-data.d.ts +3 -0
  20. package/alterations-js/1.10.1-1698910485-user-logto-data.js +16 -0
  21. package/alterations-js/1.11.0-1699422979-add-sso-connector-id-col-to-user-sso-identities-table.d.ts +3 -0
  22. package/alterations-js/1.11.0-1699422979-add-sso-connector-id-col-to-user-sso-identities-table.js +14 -0
  23. package/alterations-js/1.11.0-1699598903-remove-sso-only-column-in-sso-connectors-table.d.ts +3 -0
  24. package/alterations-js/1.11.0-1699598903-remove-sso-only-column-in-sso-connectors-table.js +14 -0
  25. package/lib/db-entries/application.d.ts +7 -1
  26. package/lib/db-entries/application.js +1 -0
  27. package/lib/db-entries/applications-role.d.ts +7 -1
  28. package/lib/db-entries/applications-role.js +1 -0
  29. package/lib/db-entries/connector.d.ts +7 -1
  30. package/lib/db-entries/connector.js +1 -0
  31. package/lib/db-entries/custom-phrase.d.ts +7 -1
  32. package/lib/db-entries/custom-phrase.js +1 -0
  33. package/lib/db-entries/daily-active-user.d.ts +7 -1
  34. package/lib/db-entries/daily-active-user.js +1 -0
  35. package/lib/db-entries/domain.d.ts +7 -1
  36. package/lib/db-entries/domain.js +1 -0
  37. package/lib/db-entries/hook.d.ts +7 -1
  38. package/lib/db-entries/hook.js +1 -0
  39. package/lib/db-entries/index.d.ts +8 -0
  40. package/lib/db-entries/index.js +8 -0
  41. package/lib/db-entries/log.d.ts +7 -1
  42. package/lib/db-entries/log.js +1 -0
  43. package/lib/db-entries/logto-config.d.ts +10 -4
  44. package/lib/db-entries/logto-config.js +4 -3
  45. package/lib/db-entries/oidc-model-instance.d.ts +7 -1
  46. package/lib/db-entries/oidc-model-instance.js +1 -0
  47. package/lib/db-entries/organization-role-scope-relation.d.ts +20 -0
  48. package/lib/db-entries/organization-role-scope-relation.js +29 -0
  49. package/lib/db-entries/organization-role-user-relation.d.ts +22 -0
  50. package/lib/db-entries/organization-role-user-relation.js +33 -0
  51. package/lib/db-entries/organization-role.d.ts +28 -0
  52. package/lib/db-entries/organization-role.js +33 -0
  53. package/lib/db-entries/organization-scope.d.ts +28 -0
  54. package/lib/db-entries/organization-scope.js +33 -0
  55. package/lib/db-entries/organization-user-relation.d.ts +20 -0
  56. package/lib/db-entries/organization-user-relation.js +29 -0
  57. package/lib/db-entries/organization.d.ts +32 -0
  58. package/lib/db-entries/organization.js +37 -0
  59. package/lib/db-entries/passcode.d.ts +7 -1
  60. package/lib/db-entries/passcode.js +1 -0
  61. package/lib/db-entries/resource.d.ts +7 -1
  62. package/lib/db-entries/resource.js +1 -0
  63. package/lib/db-entries/role.d.ts +7 -1
  64. package/lib/db-entries/role.js +1 -0
  65. package/lib/db-entries/roles-scope.d.ts +7 -1
  66. package/lib/db-entries/roles-scope.js +1 -0
  67. package/lib/db-entries/scope.d.ts +7 -1
  68. package/lib/db-entries/scope.js +1 -0
  69. package/lib/db-entries/sentinel-activity.d.ts +7 -1
  70. package/lib/db-entries/sentinel-activity.js +1 -0
  71. package/lib/db-entries/service-log.d.ts +7 -1
  72. package/lib/db-entries/service-log.js +1 -0
  73. package/lib/db-entries/sign-in-experience.d.ts +7 -1
  74. package/lib/db-entries/sign-in-experience.js +1 -0
  75. package/lib/db-entries/sso-connector.d.ts +46 -0
  76. package/lib/db-entries/sso-connector.js +54 -0
  77. package/lib/db-entries/system.d.ts +7 -1
  78. package/lib/db-entries/system.js +1 -0
  79. package/lib/db-entries/user-sso-identity.d.ts +32 -0
  80. package/lib/db-entries/user-sso-identity.js +50 -0
  81. package/lib/db-entries/user.d.ts +9 -1
  82. package/lib/db-entries/user.js +5 -0
  83. package/lib/db-entries/users-role.d.ts +7 -1
  84. package/lib/db-entries/users-role.js +1 -0
  85. package/lib/db-entries/verification-status.d.ts +7 -1
  86. package/lib/db-entries/verification-status.js +1 -0
  87. package/lib/foundations/index.d.ts +1 -1
  88. package/lib/foundations/index.js +1 -1
  89. package/lib/foundations/jsonb-types/custom-domain.d.ts +134 -0
  90. package/lib/foundations/jsonb-types/custom-domain.js +36 -0
  91. package/lib/foundations/jsonb-types/hooks.d.ts +32 -0
  92. package/lib/foundations/jsonb-types/hooks.js +24 -0
  93. package/lib/foundations/jsonb-types/index.d.ts +15 -0
  94. package/lib/foundations/jsonb-types/index.js +16 -0
  95. package/lib/foundations/jsonb-types/logs.d.ts +106 -0
  96. package/lib/foundations/jsonb-types/logs.js +20 -0
  97. package/lib/foundations/jsonb-types/oidc-module.d.ts +80 -0
  98. package/lib/foundations/jsonb-types/oidc-module.js +54 -0
  99. package/lib/foundations/jsonb-types/phrases.d.ts +5 -0
  100. package/lib/foundations/jsonb-types/phrases.js +2 -0
  101. package/lib/foundations/jsonb-types/sentinel.d.ts +27 -0
  102. package/lib/foundations/jsonb-types/sentinel.js +28 -0
  103. package/lib/foundations/jsonb-types/sign-in-experience.d.ts +118 -0
  104. package/lib/foundations/jsonb-types/sign-in-experience.js +56 -0
  105. package/lib/foundations/jsonb-types/sso-connector.d.ts +14 -0
  106. package/lib/foundations/jsonb-types/sso-connector.js +6 -0
  107. package/lib/foundations/jsonb-types/users.d.ts +285 -0
  108. package/lib/foundations/jsonb-types/users.js +47 -0
  109. package/lib/foundations/schemas.d.ts +11 -13
  110. package/lib/models/tenants.d.ts +8 -16
  111. package/lib/models/tenants.js +1 -6
  112. package/lib/seeds/logto-config.js +1 -0
  113. package/lib/types/application.d.ts +51 -1
  114. package/lib/types/application.js +7 -1
  115. package/lib/types/connector.d.ts +516 -2360
  116. package/lib/types/domain.d.ts +65 -27
  117. package/lib/types/hook.d.ts +15 -16
  118. package/lib/types/index.d.ts +4 -0
  119. package/lib/types/index.js +4 -0
  120. package/lib/types/interactions.d.ts +502 -10
  121. package/lib/types/interactions.js +83 -5
  122. package/lib/types/log/interaction.d.ts +4 -3
  123. package/lib/types/log/interaction.js +1 -0
  124. package/lib/types/logto-config.d.ts +74 -2
  125. package/lib/types/logto-config.js +38 -3
  126. package/lib/types/mfa.d.ts +211 -0
  127. package/lib/types/mfa.js +62 -0
  128. package/lib/types/organization.d.ts +48 -0
  129. package/lib/types/organization.js +21 -0
  130. package/lib/types/role.d.ts +5 -3
  131. package/lib/types/scope.d.ts +12 -27
  132. package/lib/types/sso-connector.d.ts +137 -0
  133. package/lib/types/sso-connector.js +24 -0
  134. package/lib/types/system.d.ts +26 -7
  135. package/lib/types/system.js +8 -0
  136. package/lib/types/tenant.d.ts +5 -0
  137. package/lib/types/tenant.js +6 -0
  138. package/lib/types/user-assets.d.ts +2 -2
  139. package/lib/types/user.d.ts +209 -66
  140. package/lib/types/user.js +8 -2
  141. package/package.json +7 -7
  142. package/tables/logto_configs.sql +1 -1
  143. package/tables/organization_role_scope_relations.sql +12 -0
  144. package/tables/organization_role_user_relations.sql +14 -0
  145. package/tables/organization_roles.sql +19 -0
  146. package/tables/organization_scopes.sql +19 -0
  147. package/tables/organization_user_relations.sql +12 -0
  148. package/tables/organizations.sql +19 -0
  149. package/tables/sso_connectors.sql +28 -0
  150. package/tables/user_sso_identities.sql +20 -0
  151. package/tables/users.sql +1 -0
  152. package/lib/foundations/jsonb-types.d.ts +0 -673
  153. package/lib/foundations/jsonb-types.js +0 -260
@@ -1,4 +1,9 @@
1
1
  import { OidcModelInstancePayload, GeneratedSchema } from './../foundations/index.js';
2
+ /**
3
+ *
4
+ * @remarks This is a type for database creation.
5
+ * @see {@link OidcModelInstance} for the original type.
6
+ */
2
7
  export type CreateOidcModelInstance = {
3
8
  tenantId?: string;
4
9
  modelName: string;
@@ -15,4 +20,5 @@ export type OidcModelInstance = {
15
20
  expiresAt: number;
16
21
  consumedAt: number | null;
17
22
  };
18
- export declare const OidcModelInstances: GeneratedSchema<CreateOidcModelInstance, OidcModelInstance>;
23
+ export type OidcModelInstanceKeys = 'tenantId' | 'modelName' | 'id' | 'payload' | 'expiresAt' | 'consumedAt';
24
+ export declare const OidcModelInstances: GeneratedSchema<OidcModelInstanceKeys, CreateOidcModelInstance, OidcModelInstance, 'oidc_model_instances', 'oidc_model_instance'>;
@@ -38,4 +38,5 @@ export const OidcModelInstances = Object.freeze({
38
38
  ],
39
39
  createGuard,
40
40
  guard,
41
+ updateGuard: guard.partial(),
41
42
  });
@@ -0,0 +1,20 @@
1
+ import { GeneratedSchema } from './../foundations/index.js';
2
+ /**
3
+ * The relations between organization roles and organization scopes. It indicates which organization scopes are available to which organization roles.
4
+ *
5
+ * @remarks This is a type for database creation.
6
+ * @see {@link OrganizationRoleScopeRelation} for the original type.
7
+ */
8
+ export type CreateOrganizationRoleScopeRelation = {
9
+ tenantId?: string;
10
+ organizationRoleId: string;
11
+ organizationScopeId: string;
12
+ };
13
+ /** The relations between organization roles and organization scopes. It indicates which organization scopes are available to which organization roles. */
14
+ export type OrganizationRoleScopeRelation = {
15
+ tenantId: string;
16
+ organizationRoleId: string;
17
+ organizationScopeId: string;
18
+ };
19
+ export type OrganizationRoleScopeRelationKeys = 'tenantId' | 'organizationRoleId' | 'organizationScopeId';
20
+ export declare const OrganizationRoleScopeRelations: GeneratedSchema<OrganizationRoleScopeRelationKeys, CreateOrganizationRoleScopeRelation, OrganizationRoleScopeRelation, 'organization_role_scope_relations', 'organization_role_scope_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
+ organizationRoleId: z.string().min(1).max(21),
6
+ organizationScopeId: z.string().min(1).max(21),
7
+ });
8
+ const guard = z.object({
9
+ tenantId: z.string().max(21),
10
+ organizationRoleId: z.string().min(1).max(21),
11
+ organizationScopeId: z.string().min(1).max(21),
12
+ });
13
+ export const OrganizationRoleScopeRelations = Object.freeze({
14
+ table: 'organization_role_scope_relations',
15
+ tableSingular: 'organization_role_scope_relation',
16
+ fields: {
17
+ tenantId: 'tenant_id',
18
+ organizationRoleId: 'organization_role_id',
19
+ organizationScopeId: 'organization_scope_id',
20
+ },
21
+ fieldKeys: [
22
+ 'tenantId',
23
+ 'organizationRoleId',
24
+ 'organizationScopeId',
25
+ ],
26
+ createGuard,
27
+ guard,
28
+ updateGuard: guard.partial(),
29
+ });
@@ -0,0 +1,22 @@
1
+ import { GeneratedSchema } from './../foundations/index.js';
2
+ /**
3
+ * The relations between organizations, organization roles, and users. A relation means that a user has a role in an organization.
4
+ *
5
+ * @remarks This is a type for database creation.
6
+ * @see {@link OrganizationRoleUserRelation} for the original type.
7
+ */
8
+ export type CreateOrganizationRoleUserRelation = {
9
+ tenantId?: string;
10
+ organizationId: string;
11
+ organizationRoleId: string;
12
+ userId: string;
13
+ };
14
+ /** The relations between organizations, organization roles, and users. A relation means that a user has a role in an organization. */
15
+ export type OrganizationRoleUserRelation = {
16
+ tenantId: string;
17
+ organizationId: string;
18
+ organizationRoleId: string;
19
+ userId: string;
20
+ };
21
+ export type OrganizationRoleUserRelationKeys = 'tenantId' | 'organizationId' | 'organizationRoleId' | 'userId';
22
+ export declare const OrganizationRoleUserRelations: GeneratedSchema<OrganizationRoleUserRelationKeys, CreateOrganizationRoleUserRelation, OrganizationRoleUserRelation, 'organization_role_user_relations', 'organization_role_user_relation'>;
@@ -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
+ organizationId: z.string().min(1).max(21),
6
+ organizationRoleId: z.string().min(1).max(21),
7
+ userId: z.string().min(1).max(21),
8
+ });
9
+ const guard = z.object({
10
+ tenantId: z.string().max(21),
11
+ organizationId: z.string().min(1).max(21),
12
+ organizationRoleId: z.string().min(1).max(21),
13
+ userId: z.string().min(1).max(21),
14
+ });
15
+ export const OrganizationRoleUserRelations = Object.freeze({
16
+ table: 'organization_role_user_relations',
17
+ tableSingular: 'organization_role_user_relation',
18
+ fields: {
19
+ tenantId: 'tenant_id',
20
+ organizationId: 'organization_id',
21
+ organizationRoleId: 'organization_role_id',
22
+ userId: 'user_id',
23
+ },
24
+ fieldKeys: [
25
+ 'tenantId',
26
+ 'organizationId',
27
+ 'organizationRoleId',
28
+ 'userId',
29
+ ],
30
+ createGuard,
31
+ guard,
32
+ updateGuard: guard.partial(),
33
+ });
@@ -0,0 +1,28 @@
1
+ import { GeneratedSchema } from './../foundations/index.js';
2
+ /**
3
+ * The roles defined by the organization template.
4
+ *
5
+ * @remarks This is a type for database creation.
6
+ * @see {@link OrganizationRole} for the original type.
7
+ */
8
+ export type CreateOrganizationRole = {
9
+ tenantId?: string;
10
+ /** The globally unique identifier of the organization role. */
11
+ id: string;
12
+ /** The organization role's name, unique within the organization template. */
13
+ name: string;
14
+ /** A brief description of the organization role. */
15
+ description?: string | null;
16
+ };
17
+ /** The roles defined by the organization template. */
18
+ export type OrganizationRole = {
19
+ tenantId: string;
20
+ /** The globally unique identifier of the organization role. */
21
+ id: string;
22
+ /** The organization role's name, unique within the organization template. */
23
+ name: string;
24
+ /** A brief description of the organization role. */
25
+ description: string | null;
26
+ };
27
+ export type OrganizationRoleKeys = 'tenantId' | 'id' | 'name' | 'description';
28
+ export declare const OrganizationRoles: GeneratedSchema<OrganizationRoleKeys, CreateOrganizationRole, OrganizationRole, 'organization_roles', 'organization_role'>;
@@ -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,46 @@
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
+ /** When the SSO connector was created. */
24
+ createdAt?: number;
25
+ };
26
+ export type SsoConnector = {
27
+ tenantId: string;
28
+ /** The globally unique identifier of the SSO connector. */
29
+ id: string;
30
+ /** The connector factory name of the SSO provider. */
31
+ providerName: string;
32
+ /** The name of the SSO provider for display. */
33
+ connectorName: string;
34
+ /** The connector configuration. Different schemas for different provide type */
35
+ config: JsonObject;
36
+ /** The SSO email domains. */
37
+ domains: SsoDomains;
38
+ /** The SSO branding. */
39
+ branding: SsoBranding;
40
+ /** Determines whether to synchronize the user's profile on each login. */
41
+ syncProfile: boolean;
42
+ /** When the SSO connector was created. */
43
+ createdAt: number;
44
+ };
45
+ export type SsoConnectorKeys = 'tenantId' | 'id' | 'providerName' | 'connectorName' | 'config' | 'domains' | 'branding' | 'syncProfile' | 'createdAt';
46
+ export declare const SsoConnectors: GeneratedSchema<SsoConnectorKeys, CreateSsoConnector, SsoConnector, 'sso_connectors', 'sso_connector'>;