@logto/schemas 1.2.3 → 1.5.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.
- package/alterations/1.3.0-1683292832-update-hooks.ts +105 -0
- package/alterations/1.5.0-1684382842-add-name-tag-created-at-for-tenants-table.ts +22 -0
- package/alterations/1.5.0-1684739802-create-hook-id-index-for-logs.ts +18 -0
- package/alterations/1.5.0-1684822341-init-domains.ts +66 -0
- package/alterations/1.5.0-1684837981-add-manage-tenant-self-scope-to-user-role.ts +56 -0
- package/alterations/1.5.0-1685285719-support-default-resource.ts +23 -0
- package/alterations-js/1.3.0-1683292832-update-hooks.d.ts +3 -0
- package/alterations-js/1.3.0-1683292832-update-hooks.js +73 -0
- package/alterations-js/1.5.0-1684382842-add-name-tag-created-at-for-tenants-table.d.ts +3 -0
- package/alterations-js/1.5.0-1684382842-add-name-tag-created-at-for-tenants-table.js +19 -0
- package/alterations-js/1.5.0-1684739802-create-hook-id-index-for-logs.d.ts +3 -0
- package/alterations-js/1.5.0-1684739802-create-hook-id-index-for-logs.js +14 -0
- package/alterations-js/1.5.0-1684822341-init-domains.d.ts +3 -0
- package/alterations-js/1.5.0-1684822341-init-domains.js +57 -0
- package/alterations-js/1.5.0-1684837981-add-manage-tenant-self-scope-to-user-role.d.ts +3 -0
- package/alterations-js/1.5.0-1684837981-add-manage-tenant-self-scope-to-user-role.js +50 -0
- package/alterations-js/1.5.0-1685285719-support-default-resource.d.ts +3 -0
- package/alterations-js/1.5.0-1685285719-support-default-resource.js +19 -0
- package/lib/db-entries/application.js +6 -6
- package/lib/db-entries/applications-role.js +6 -6
- package/lib/db-entries/connector.js +4 -4
- package/lib/db-entries/custom-phrase.js +4 -4
- package/lib/db-entries/domain.d.ts +24 -0
- package/lib/db-entries/domain.js +53 -0
- package/lib/db-entries/hook.d.ts +11 -3
- package/lib/db-entries/hook.js +21 -5
- package/lib/db-entries/index.d.ts +1 -0
- package/lib/db-entries/index.js +1 -0
- package/lib/db-entries/log.js +4 -4
- package/lib/db-entries/logto-config.js +2 -2
- package/lib/db-entries/oidc-model-instance.js +4 -4
- package/lib/db-entries/passcode.js +6 -6
- package/lib/db-entries/resource.d.ts +2 -0
- package/lib/db-entries/resource.js +10 -6
- package/lib/db-entries/role.js +6 -6
- package/lib/db-entries/roles-scope.js +6 -6
- package/lib/db-entries/scope.js +8 -8
- package/lib/db-entries/service-log.js +4 -4
- package/lib/db-entries/sign-in-experience.js +2 -2
- package/lib/db-entries/system.js +2 -2
- package/lib/db-entries/user.js +2 -2
- package/lib/db-entries/users-role.js +6 -6
- package/lib/db-entries/verification-status.js +4 -4
- package/lib/foundations/jsonb-types.d.ts +160 -11
- package/lib/foundations/jsonb-types.js +52 -2
- package/lib/models/tenants.d.ts +4 -1
- package/lib/models/tenants.js +4 -0
- package/lib/seeds/application.js +1 -1
- package/lib/seeds/cloud-api.d.ts +4 -0
- package/lib/seeds/cloud-api.js +8 -1
- package/lib/seeds/management-api.d.ts +3 -3
- package/lib/seeds/management-api.js +38 -30
- package/lib/types/connector.d.ts +2984 -8
- package/lib/types/connector.js +22 -0
- package/lib/types/dashboard.d.ts +116 -0
- package/lib/types/dashboard.js +18 -0
- package/lib/types/domain.d.ts +90 -0
- package/lib/types/domain.js +22 -0
- package/lib/types/hook.d.ts +82 -2
- package/lib/types/hook.js +9 -1
- package/lib/types/index.d.ts +2 -0
- package/lib/types/index.js +2 -0
- package/lib/types/interactions.d.ts +6 -6
- package/lib/types/log/hook.d.ts +1 -1
- package/lib/types/log/hook.js +1 -1
- package/lib/types/scope.d.ts +42 -4
- package/lib/types/scope.js +4 -1
- package/lib/types/system.d.ts +26 -3
- package/lib/types/system.js +15 -0
- package/lib/types/tenant.d.ts +34 -1
- package/lib/types/tenant.js +19 -1
- package/lib/types/user.d.ts +129 -5
- package/lib/types/user.js +6 -0
- package/package.json +2 -2
- package/tables/domains.sql +17 -0
- package/tables/hooks.sql +13 -11
- package/tables/logs.sql +3 -0
- package/tables/resources.sql +5 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DomainDnsRecords, CloudflareData, GeneratedSchema } from './../foundations/index.js';
|
|
2
|
+
export type CreateDomain = {
|
|
3
|
+
tenantId?: string;
|
|
4
|
+
id: string;
|
|
5
|
+
domain: string;
|
|
6
|
+
status?: string;
|
|
7
|
+
errorMessage?: string | null;
|
|
8
|
+
dnsRecords?: DomainDnsRecords;
|
|
9
|
+
cloudflareData?: CloudflareData | null;
|
|
10
|
+
updatedAt?: number;
|
|
11
|
+
createdAt?: number;
|
|
12
|
+
};
|
|
13
|
+
export type Domain = {
|
|
14
|
+
tenantId: string;
|
|
15
|
+
id: string;
|
|
16
|
+
domain: string;
|
|
17
|
+
status: string;
|
|
18
|
+
errorMessage: string | null;
|
|
19
|
+
dnsRecords: DomainDnsRecords;
|
|
20
|
+
cloudflareData: CloudflareData | null;
|
|
21
|
+
updatedAt: number;
|
|
22
|
+
createdAt: number;
|
|
23
|
+
};
|
|
24
|
+
export declare const Domains: GeneratedSchema<CreateDomain, Domain>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { domainDnsRecordsGuard, cloudflareDataGuard } 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
|
+
domain: z.string().min(1).max(256),
|
|
8
|
+
status: z.string().min(1).max(32).optional(),
|
|
9
|
+
errorMessage: z.string().max(1024).nullable().optional(),
|
|
10
|
+
dnsRecords: domainDnsRecordsGuard.optional(),
|
|
11
|
+
cloudflareData: cloudflareDataGuard.nullable().optional(),
|
|
12
|
+
updatedAt: z.number().optional(),
|
|
13
|
+
createdAt: z.number().optional(),
|
|
14
|
+
});
|
|
15
|
+
const guard = z.object({
|
|
16
|
+
tenantId: z.string().max(21),
|
|
17
|
+
id: z.string().min(1).max(21),
|
|
18
|
+
domain: z.string().min(1).max(256),
|
|
19
|
+
status: z.string().max(32),
|
|
20
|
+
errorMessage: z.string().max(1024).nullable(),
|
|
21
|
+
dnsRecords: domainDnsRecordsGuard,
|
|
22
|
+
cloudflareData: cloudflareDataGuard.nullable(),
|
|
23
|
+
updatedAt: z.number(),
|
|
24
|
+
createdAt: z.number(),
|
|
25
|
+
});
|
|
26
|
+
export const Domains = Object.freeze({
|
|
27
|
+
table: 'domains',
|
|
28
|
+
tableSingular: 'domain',
|
|
29
|
+
fields: {
|
|
30
|
+
tenantId: 'tenant_id',
|
|
31
|
+
id: 'id',
|
|
32
|
+
domain: 'domain',
|
|
33
|
+
status: 'status',
|
|
34
|
+
errorMessage: 'error_message',
|
|
35
|
+
dnsRecords: 'dns_records',
|
|
36
|
+
cloudflareData: 'cloudflare_data',
|
|
37
|
+
updatedAt: 'updated_at',
|
|
38
|
+
createdAt: 'created_at',
|
|
39
|
+
},
|
|
40
|
+
fieldKeys: [
|
|
41
|
+
'tenantId',
|
|
42
|
+
'id',
|
|
43
|
+
'domain',
|
|
44
|
+
'status',
|
|
45
|
+
'errorMessage',
|
|
46
|
+
'dnsRecords',
|
|
47
|
+
'cloudflareData',
|
|
48
|
+
'updatedAt',
|
|
49
|
+
'createdAt',
|
|
50
|
+
],
|
|
51
|
+
createGuard,
|
|
52
|
+
guard,
|
|
53
|
+
});
|
package/lib/db-entries/hook.d.ts
CHANGED
|
@@ -1,16 +1,24 @@
|
|
|
1
|
-
import { HookEvent, HookConfig, GeneratedSchema } from './../foundations/index.js';
|
|
1
|
+
import { HookEvent, HookEvents, HookConfig, GeneratedSchema } from './../foundations/index.js';
|
|
2
2
|
export type CreateHook = {
|
|
3
3
|
tenantId?: string;
|
|
4
4
|
id: string;
|
|
5
|
-
|
|
5
|
+
name?: string;
|
|
6
|
+
event?: HookEvent | null;
|
|
7
|
+
events?: HookEvents;
|
|
6
8
|
config: HookConfig;
|
|
9
|
+
signingKey?: string;
|
|
10
|
+
enabled?: boolean;
|
|
7
11
|
createdAt?: number;
|
|
8
12
|
};
|
|
9
13
|
export type Hook = {
|
|
10
14
|
tenantId: string;
|
|
11
15
|
id: string;
|
|
12
|
-
|
|
16
|
+
name: string;
|
|
17
|
+
event: HookEvent | null;
|
|
18
|
+
events: HookEvents;
|
|
13
19
|
config: HookConfig;
|
|
20
|
+
signingKey: string;
|
|
21
|
+
enabled: boolean;
|
|
14
22
|
createdAt: number;
|
|
15
23
|
};
|
|
16
24
|
export declare const Hooks: GeneratedSchema<CreateHook, Hook>;
|
package/lib/db-entries/hook.js
CHANGED
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { hookEventGuard, hookConfigGuard } from './../foundations/index.js';
|
|
3
|
+
import { hookEventGuard, hookEventsGuard, hookConfigGuard } from './../foundations/index.js';
|
|
4
4
|
const createGuard = z.object({
|
|
5
5
|
tenantId: z.string().max(21).optional(),
|
|
6
|
-
id: z.string().max(21),
|
|
7
|
-
|
|
6
|
+
id: z.string().min(1).max(21),
|
|
7
|
+
name: z.string().min(1).max(256).optional(),
|
|
8
|
+
event: hookEventGuard.nullable().optional(),
|
|
9
|
+
events: hookEventsGuard.optional(),
|
|
8
10
|
config: hookConfigGuard,
|
|
11
|
+
signingKey: z.string().min(1).max(64).optional(),
|
|
12
|
+
enabled: z.boolean().optional(),
|
|
9
13
|
createdAt: z.number().optional(),
|
|
10
14
|
});
|
|
11
15
|
const guard = z.object({
|
|
12
16
|
tenantId: z.string().max(21),
|
|
13
|
-
id: z.string().max(21),
|
|
14
|
-
|
|
17
|
+
id: z.string().min(1).max(21),
|
|
18
|
+
name: z.string().max(256),
|
|
19
|
+
event: hookEventGuard.nullable(),
|
|
20
|
+
events: hookEventsGuard,
|
|
15
21
|
config: hookConfigGuard,
|
|
22
|
+
signingKey: z.string().max(64),
|
|
23
|
+
enabled: z.boolean(),
|
|
16
24
|
createdAt: z.number(),
|
|
17
25
|
});
|
|
18
26
|
export const Hooks = Object.freeze({
|
|
@@ -21,15 +29,23 @@ export const Hooks = Object.freeze({
|
|
|
21
29
|
fields: {
|
|
22
30
|
tenantId: 'tenant_id',
|
|
23
31
|
id: 'id',
|
|
32
|
+
name: 'name',
|
|
24
33
|
event: 'event',
|
|
34
|
+
events: 'events',
|
|
25
35
|
config: 'config',
|
|
36
|
+
signingKey: 'signing_key',
|
|
37
|
+
enabled: 'enabled',
|
|
26
38
|
createdAt: 'created_at',
|
|
27
39
|
},
|
|
28
40
|
fieldKeys: [
|
|
29
41
|
'tenantId',
|
|
30
42
|
'id',
|
|
43
|
+
'name',
|
|
31
44
|
'event',
|
|
45
|
+
'events',
|
|
32
46
|
'config',
|
|
47
|
+
'signingKey',
|
|
48
|
+
'enabled',
|
|
33
49
|
'createdAt',
|
|
34
50
|
],
|
|
35
51
|
createGuard,
|
|
@@ -7,6 +7,7 @@ export * from './application.js';
|
|
|
7
7
|
export * from './applications-role.js';
|
|
8
8
|
export * from './connector.js';
|
|
9
9
|
export * from './custom-phrase.js';
|
|
10
|
+
export * from './domain.js';
|
|
10
11
|
export * from './hook.js';
|
|
11
12
|
export * from './log.js';
|
|
12
13
|
export * from './logto-config.js';
|
package/lib/db-entries/index.js
CHANGED
|
@@ -8,6 +8,7 @@ export * from './application.js';
|
|
|
8
8
|
export * from './applications-role.js';
|
|
9
9
|
export * from './connector.js';
|
|
10
10
|
export * from './custom-phrase.js';
|
|
11
|
+
export * from './domain.js';
|
|
11
12
|
export * from './hook.js';
|
|
12
13
|
export * from './log.js';
|
|
13
14
|
export * from './logto-config.js';
|
package/lib/db-entries/log.js
CHANGED
|
@@ -3,15 +3,15 @@ import { z } from 'zod';
|
|
|
3
3
|
import { logContextPayloadGuard } from './../foundations/index.js';
|
|
4
4
|
const createGuard = z.object({
|
|
5
5
|
tenantId: z.string().max(21).optional(),
|
|
6
|
-
id: z.string().max(21),
|
|
7
|
-
key: z.string().max(128),
|
|
6
|
+
id: z.string().min(1).max(21),
|
|
7
|
+
key: z.string().min(1).max(128),
|
|
8
8
|
payload: logContextPayloadGuard.optional(),
|
|
9
9
|
createdAt: z.number().optional(),
|
|
10
10
|
});
|
|
11
11
|
const guard = z.object({
|
|
12
12
|
tenantId: z.string().max(21),
|
|
13
|
-
id: z.string().max(21),
|
|
14
|
-
key: z.string().max(128),
|
|
13
|
+
id: z.string().min(1).max(21),
|
|
14
|
+
key: z.string().min(1).max(128),
|
|
15
15
|
payload: logContextPayloadGuard,
|
|
16
16
|
createdAt: z.number(),
|
|
17
17
|
});
|
|
@@ -3,12 +3,12 @@ import { z } from 'zod';
|
|
|
3
3
|
import { jsonObjectGuard } from './../foundations/index.js';
|
|
4
4
|
const createGuard = z.object({
|
|
5
5
|
tenantId: z.string().max(21).optional(),
|
|
6
|
-
key: z.string().max(256),
|
|
6
|
+
key: z.string().min(1).max(256),
|
|
7
7
|
value: jsonObjectGuard.optional(),
|
|
8
8
|
});
|
|
9
9
|
const guard = z.object({
|
|
10
10
|
tenantId: z.string().max(21),
|
|
11
|
-
key: z.string().max(256),
|
|
11
|
+
key: z.string().min(1).max(256),
|
|
12
12
|
value: jsonObjectGuard,
|
|
13
13
|
});
|
|
14
14
|
export const LogtoConfigs = Object.freeze({
|
|
@@ -3,16 +3,16 @@ import { z } from 'zod';
|
|
|
3
3
|
import { oidcModelInstancePayloadGuard } from './../foundations/index.js';
|
|
4
4
|
const createGuard = z.object({
|
|
5
5
|
tenantId: z.string().max(21).optional(),
|
|
6
|
-
modelName: z.string().max(64),
|
|
7
|
-
id: z.string().max(128),
|
|
6
|
+
modelName: z.string().min(1).max(64),
|
|
7
|
+
id: z.string().min(1).max(128),
|
|
8
8
|
payload: oidcModelInstancePayloadGuard,
|
|
9
9
|
expiresAt: z.number(),
|
|
10
10
|
consumedAt: z.number().nullable().optional(),
|
|
11
11
|
});
|
|
12
12
|
const guard = z.object({
|
|
13
13
|
tenantId: z.string().max(21),
|
|
14
|
-
modelName: z.string().max(64),
|
|
15
|
-
id: z.string().max(128),
|
|
14
|
+
modelName: z.string().min(1).max(64),
|
|
15
|
+
id: z.string().min(1).max(128),
|
|
16
16
|
payload: oidcModelInstancePayloadGuard,
|
|
17
17
|
expiresAt: z.number(),
|
|
18
18
|
consumedAt: z.number().nullable(),
|
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
const createGuard = z.object({
|
|
4
4
|
tenantId: z.string().max(21).optional(),
|
|
5
|
-
id: z.string().max(21),
|
|
5
|
+
id: z.string().min(1).max(21),
|
|
6
6
|
interactionJti: z.string().max(128).nullable().optional(),
|
|
7
7
|
phone: z.string().max(32).nullable().optional(),
|
|
8
8
|
email: z.string().max(128).nullable().optional(),
|
|
9
|
-
type: z.string().max(32),
|
|
10
|
-
code: z.string().max(6),
|
|
9
|
+
type: z.string().min(1).max(32),
|
|
10
|
+
code: z.string().min(1).max(6),
|
|
11
11
|
consumed: z.boolean().optional(),
|
|
12
12
|
tryCount: z.number().optional(),
|
|
13
13
|
createdAt: z.number().optional(),
|
|
14
14
|
});
|
|
15
15
|
const guard = z.object({
|
|
16
16
|
tenantId: z.string().max(21),
|
|
17
|
-
id: z.string().max(21),
|
|
17
|
+
id: z.string().min(1).max(21),
|
|
18
18
|
interactionJti: z.string().max(128).nullable(),
|
|
19
19
|
phone: z.string().max(32).nullable(),
|
|
20
20
|
email: z.string().max(128).nullable(),
|
|
21
|
-
type: z.string().max(32),
|
|
22
|
-
code: z.string().max(6),
|
|
21
|
+
type: z.string().min(1).max(32),
|
|
22
|
+
code: z.string().min(1).max(6),
|
|
23
23
|
consumed: z.boolean(),
|
|
24
24
|
tryCount: z.number(),
|
|
25
25
|
createdAt: z.number(),
|
|
@@ -4,6 +4,7 @@ export type CreateResource = {
|
|
|
4
4
|
id: string;
|
|
5
5
|
name: string;
|
|
6
6
|
indicator: string;
|
|
7
|
+
isDefault?: boolean;
|
|
7
8
|
accessTokenTtl?: number;
|
|
8
9
|
};
|
|
9
10
|
export type Resource = {
|
|
@@ -11,6 +12,7 @@ export type Resource = {
|
|
|
11
12
|
id: string;
|
|
12
13
|
name: string;
|
|
13
14
|
indicator: string;
|
|
15
|
+
isDefault: boolean;
|
|
14
16
|
accessTokenTtl: number;
|
|
15
17
|
};
|
|
16
18
|
export declare const Resources: GeneratedSchema<CreateResource, Resource>;
|
|
@@ -2,16 +2,18 @@
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
const createGuard = z.object({
|
|
4
4
|
tenantId: z.string().max(21).optional(),
|
|
5
|
-
id: z.string().max(21),
|
|
6
|
-
name: z.string(),
|
|
7
|
-
indicator: z.string(),
|
|
5
|
+
id: z.string().min(1).max(21),
|
|
6
|
+
name: z.string().min(1),
|
|
7
|
+
indicator: z.string().min(1),
|
|
8
|
+
isDefault: z.boolean().optional(),
|
|
8
9
|
accessTokenTtl: z.number().optional(),
|
|
9
10
|
});
|
|
10
11
|
const guard = z.object({
|
|
11
12
|
tenantId: z.string().max(21),
|
|
12
|
-
id: z.string().max(21),
|
|
13
|
-
name: z.string(),
|
|
14
|
-
indicator: z.string(),
|
|
13
|
+
id: z.string().min(1).max(21),
|
|
14
|
+
name: z.string().min(1),
|
|
15
|
+
indicator: z.string().min(1),
|
|
16
|
+
isDefault: z.boolean(),
|
|
15
17
|
accessTokenTtl: z.number(),
|
|
16
18
|
});
|
|
17
19
|
export const Resources = Object.freeze({
|
|
@@ -22,6 +24,7 @@ export const Resources = Object.freeze({
|
|
|
22
24
|
id: 'id',
|
|
23
25
|
name: 'name',
|
|
24
26
|
indicator: 'indicator',
|
|
27
|
+
isDefault: 'is_default',
|
|
25
28
|
accessTokenTtl: 'access_token_ttl',
|
|
26
29
|
},
|
|
27
30
|
fieldKeys: [
|
|
@@ -29,6 +32,7 @@ export const Resources = Object.freeze({
|
|
|
29
32
|
'id',
|
|
30
33
|
'name',
|
|
31
34
|
'indicator',
|
|
35
|
+
'isDefault',
|
|
32
36
|
'accessTokenTtl',
|
|
33
37
|
],
|
|
34
38
|
createGuard,
|
package/lib/db-entries/role.js
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
const createGuard = z.object({
|
|
4
4
|
tenantId: z.string().max(21).optional(),
|
|
5
|
-
id: z.string().max(21),
|
|
6
|
-
name: z.string().max(128),
|
|
7
|
-
description: z.string().max(128),
|
|
5
|
+
id: z.string().min(1).max(21),
|
|
6
|
+
name: z.string().min(1).max(128),
|
|
7
|
+
description: z.string().min(1).max(128),
|
|
8
8
|
});
|
|
9
9
|
const guard = z.object({
|
|
10
10
|
tenantId: z.string().max(21),
|
|
11
|
-
id: z.string().max(21),
|
|
12
|
-
name: z.string().max(128),
|
|
13
|
-
description: z.string().max(128),
|
|
11
|
+
id: z.string().min(1).max(21),
|
|
12
|
+
name: z.string().min(1).max(128),
|
|
13
|
+
description: z.string().min(1).max(128),
|
|
14
14
|
});
|
|
15
15
|
export const Roles = Object.freeze({
|
|
16
16
|
table: 'roles',
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
const createGuard = z.object({
|
|
4
4
|
tenantId: z.string().max(21).optional(),
|
|
5
|
-
id: z.string().max(21),
|
|
6
|
-
roleId: z.string().max(21),
|
|
7
|
-
scopeId: z.string().max(21),
|
|
5
|
+
id: z.string().min(1).max(21),
|
|
6
|
+
roleId: z.string().min(1).max(21),
|
|
7
|
+
scopeId: z.string().min(1).max(21),
|
|
8
8
|
});
|
|
9
9
|
const guard = z.object({
|
|
10
10
|
tenantId: z.string().max(21),
|
|
11
|
-
id: z.string().max(21),
|
|
12
|
-
roleId: z.string().max(21),
|
|
13
|
-
scopeId: z.string().max(21),
|
|
11
|
+
id: z.string().min(1).max(21),
|
|
12
|
+
roleId: z.string().min(1).max(21),
|
|
13
|
+
scopeId: z.string().min(1).max(21),
|
|
14
14
|
});
|
|
15
15
|
export const RolesScopes = Object.freeze({
|
|
16
16
|
table: 'roles_scopes',
|
package/lib/db-entries/scope.js
CHANGED
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
const createGuard = z.object({
|
|
4
4
|
tenantId: z.string().max(21).optional(),
|
|
5
|
-
id: z.string().max(21),
|
|
6
|
-
resourceId: z.string().max(21),
|
|
7
|
-
name: z.string().max(256),
|
|
8
|
-
description: z.string(),
|
|
5
|
+
id: z.string().min(1).max(21),
|
|
6
|
+
resourceId: z.string().min(1).max(21),
|
|
7
|
+
name: z.string().min(1).max(256),
|
|
8
|
+
description: z.string().min(1),
|
|
9
9
|
createdAt: z.number().optional(),
|
|
10
10
|
});
|
|
11
11
|
const guard = z.object({
|
|
12
12
|
tenantId: z.string().max(21),
|
|
13
|
-
id: z.string().max(21),
|
|
14
|
-
resourceId: z.string().max(21),
|
|
15
|
-
name: z.string().max(256),
|
|
16
|
-
description: z.string(),
|
|
13
|
+
id: z.string().min(1).max(21),
|
|
14
|
+
resourceId: z.string().min(1).max(21),
|
|
15
|
+
name: z.string().min(1).max(256),
|
|
16
|
+
description: z.string().min(1),
|
|
17
17
|
createdAt: z.number(),
|
|
18
18
|
});
|
|
19
19
|
export const Scopes = Object.freeze({
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { jsonObjectGuard } from './../foundations/index.js';
|
|
4
4
|
const createGuard = z.object({
|
|
5
|
-
id: z.string().max(21),
|
|
5
|
+
id: z.string().min(1).max(21),
|
|
6
6
|
tenantId: z.string().max(21).optional(),
|
|
7
|
-
type: z.string().max(64),
|
|
7
|
+
type: z.string().min(1).max(64),
|
|
8
8
|
payload: jsonObjectGuard.optional(),
|
|
9
9
|
createdAt: z.number().optional(),
|
|
10
10
|
});
|
|
11
11
|
const guard = z.object({
|
|
12
|
-
id: z.string().max(21),
|
|
12
|
+
id: z.string().min(1).max(21),
|
|
13
13
|
tenantId: z.string().max(21),
|
|
14
|
-
type: z.string().max(64),
|
|
14
|
+
type: z.string().min(1).max(64),
|
|
15
15
|
payload: jsonObjectGuard,
|
|
16
16
|
createdAt: z.number(),
|
|
17
17
|
});
|
|
@@ -4,7 +4,7 @@ import { colorGuard, brandingGuard, languageInfoGuard, signInGuard, signUpGuard,
|
|
|
4
4
|
import { SignInMode } from './custom-types.js';
|
|
5
5
|
const createGuard = z.object({
|
|
6
6
|
tenantId: z.string().max(21).optional(),
|
|
7
|
-
id: z.string().max(21),
|
|
7
|
+
id: z.string().min(1).max(21),
|
|
8
8
|
color: colorGuard,
|
|
9
9
|
branding: brandingGuard,
|
|
10
10
|
languageInfo: languageInfoGuard,
|
|
@@ -19,7 +19,7 @@ const createGuard = z.object({
|
|
|
19
19
|
});
|
|
20
20
|
const guard = z.object({
|
|
21
21
|
tenantId: z.string().max(21),
|
|
22
|
-
id: z.string().max(21),
|
|
22
|
+
id: z.string().min(1).max(21),
|
|
23
23
|
color: colorGuard,
|
|
24
24
|
branding: brandingGuard,
|
|
25
25
|
languageInfo: languageInfoGuard,
|
package/lib/db-entries/system.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { jsonObjectGuard } from './../foundations/index.js';
|
|
4
4
|
const createGuard = z.object({
|
|
5
|
-
key: z.string().max(256),
|
|
5
|
+
key: z.string().min(1).max(256),
|
|
6
6
|
value: jsonObjectGuard.optional(),
|
|
7
7
|
});
|
|
8
8
|
const guard = z.object({
|
|
9
|
-
key: z.string().max(256),
|
|
9
|
+
key: z.string().min(1).max(256),
|
|
10
10
|
value: jsonObjectGuard,
|
|
11
11
|
});
|
|
12
12
|
export const Systems = Object.freeze({
|
package/lib/db-entries/user.js
CHANGED
|
@@ -4,7 +4,7 @@ import { identitiesGuard, jsonObjectGuard } from './../foundations/index.js';
|
|
|
4
4
|
import { UsersPasswordEncryptionMethod } from './custom-types.js';
|
|
5
5
|
const createGuard = z.object({
|
|
6
6
|
tenantId: z.string().max(21).optional(),
|
|
7
|
-
id: z.string().max(12),
|
|
7
|
+
id: z.string().min(1).max(12),
|
|
8
8
|
username: z.string().max(128).nullable().optional(),
|
|
9
9
|
primaryEmail: z.string().max(128).nullable().optional(),
|
|
10
10
|
primaryPhone: z.string().max(128).nullable().optional(),
|
|
@@ -21,7 +21,7 @@ const createGuard = z.object({
|
|
|
21
21
|
});
|
|
22
22
|
const guard = z.object({
|
|
23
23
|
tenantId: z.string().max(21),
|
|
24
|
-
id: z.string().max(12),
|
|
24
|
+
id: z.string().min(1).max(12),
|
|
25
25
|
username: z.string().max(128).nullable(),
|
|
26
26
|
primaryEmail: z.string().max(128).nullable(),
|
|
27
27
|
primaryPhone: z.string().max(128).nullable(),
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
const createGuard = z.object({
|
|
4
4
|
tenantId: z.string().max(21).optional(),
|
|
5
|
-
id: z.string().max(21),
|
|
6
|
-
userId: z.string().max(21),
|
|
7
|
-
roleId: z.string().max(21),
|
|
5
|
+
id: z.string().min(1).max(21),
|
|
6
|
+
userId: z.string().min(1).max(21),
|
|
7
|
+
roleId: z.string().min(1).max(21),
|
|
8
8
|
});
|
|
9
9
|
const guard = z.object({
|
|
10
10
|
tenantId: z.string().max(21),
|
|
11
|
-
id: z.string().max(21),
|
|
12
|
-
userId: z.string().max(21),
|
|
13
|
-
roleId: z.string().max(21),
|
|
11
|
+
id: z.string().min(1).max(21),
|
|
12
|
+
userId: z.string().min(1).max(21),
|
|
13
|
+
roleId: z.string().min(1).max(21),
|
|
14
14
|
});
|
|
15
15
|
export const UsersRoles = Object.freeze({
|
|
16
16
|
table: 'users_roles',
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
const createGuard = z.object({
|
|
4
4
|
tenantId: z.string().max(21).optional(),
|
|
5
|
-
id: z.string().max(21),
|
|
6
|
-
userId: z.string().max(21),
|
|
5
|
+
id: z.string().min(1).max(21),
|
|
6
|
+
userId: z.string().min(1).max(21),
|
|
7
7
|
createdAt: z.number().optional(),
|
|
8
8
|
});
|
|
9
9
|
const guard = z.object({
|
|
10
10
|
tenantId: z.string().max(21),
|
|
11
|
-
id: z.string().max(21),
|
|
12
|
-
userId: z.string().max(21),
|
|
11
|
+
id: z.string().min(1).max(21),
|
|
12
|
+
userId: z.string().min(1).max(21),
|
|
13
13
|
createdAt: z.number(),
|
|
14
14
|
});
|
|
15
15
|
export const VerificationStatuses = Object.freeze({
|