@famgia/omnify-react-sso 2.2.1 → 2.2.3
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/README.md +404 -113
- package/dist/@omnify-base/schemas/Branch.ts +12 -12
- package/dist/@omnify-base/schemas/BranchCache.ts +131 -0
- package/dist/@omnify-base/schemas/OrganizationCache.ts +117 -0
- package/dist/@omnify-base/schemas/Permission.ts +10 -10
- package/dist/@omnify-base/schemas/Role.ts +19 -12
- package/dist/@omnify-base/schemas/RolePermission.ts +6 -6
- package/dist/@omnify-base/schemas/Team.ts +6 -6
- package/dist/@omnify-base/schemas/TeamCache.ts +110 -0
- package/dist/@omnify-base/schemas/TeamPermission.ts +6 -6
- package/dist/@omnify-base/schemas/User.ts +13 -13
- package/dist/@omnify-base/schemas/UserCache.ts +142 -0
- package/dist/index.cjs +1846 -427
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +623 -14
- package/dist/index.d.ts +623 -14
- package/dist/index.js +1790 -400
- package/dist/index.js.map +1 -1
- package/dist/schemas/index.cjs +245 -167
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +67 -28
- package/dist/schemas/index.d.ts +67 -28
- package/dist/schemas/index.js +217 -146
- package/dist/schemas/index.js.map +1 -1
- package/dist/testing/index.d.cts +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/{types-BCBSfJJr.d.cts → types-bD5deLxs.d.cts} +102 -1
- package/dist/{types-BCBSfJJr.d.ts → types-bD5deLxs.d.ts} +102 -1
- package/package.json +121 -106
- package/scripts/build-schemas.ts +1 -1
|
@@ -13,7 +13,7 @@ import { z } from 'zod';
|
|
|
13
13
|
import type { DateTimeString } from './common';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* 支店
|
|
17
17
|
*/
|
|
18
18
|
export interface Branch {
|
|
19
19
|
/** Primary key */
|
|
@@ -22,13 +22,13 @@ export interface Branch {
|
|
|
22
22
|
console_branch_id: unknown;
|
|
23
23
|
/** Console Organization ID */
|
|
24
24
|
console_org_id: unknown;
|
|
25
|
-
/**
|
|
25
|
+
/** 支店コード */
|
|
26
26
|
code: string;
|
|
27
|
-
/**
|
|
27
|
+
/** 支店名 */
|
|
28
28
|
name: string;
|
|
29
|
-
/**
|
|
29
|
+
/** 本社 */
|
|
30
30
|
is_headquarters: boolean;
|
|
31
|
-
/**
|
|
31
|
+
/** 有効 */
|
|
32
32
|
is_active: boolean;
|
|
33
33
|
/** Creation timestamp */
|
|
34
34
|
created_at?: DateTimeString;
|
|
@@ -48,26 +48,26 @@ export interface Branch {
|
|
|
48
48
|
*/
|
|
49
49
|
export const branchI18n = {
|
|
50
50
|
/** Model display name */
|
|
51
|
-
label: {"en":"Branch"},
|
|
51
|
+
label: {"ja":"支店","en":"Branch"},
|
|
52
52
|
/** Field labels and placeholders */
|
|
53
53
|
fields: {
|
|
54
54
|
console_branch_id: {
|
|
55
|
-
label: {"en":"Console Branch ID"},
|
|
55
|
+
label: {"ja":"Console Branch ID","en":"Console Branch ID"},
|
|
56
56
|
},
|
|
57
57
|
console_org_id: {
|
|
58
|
-
label: {"en":"Console Organization ID"},
|
|
58
|
+
label: {"ja":"Console Organization ID","en":"Console Organization ID"},
|
|
59
59
|
},
|
|
60
60
|
code: {
|
|
61
|
-
label: {"en":"Branch Code"},
|
|
61
|
+
label: {"ja":"支店コード","en":"Branch Code"},
|
|
62
62
|
},
|
|
63
63
|
name: {
|
|
64
|
-
label: {"en":"Branch Name"},
|
|
64
|
+
label: {"ja":"支店名","en":"Branch Name"},
|
|
65
65
|
},
|
|
66
66
|
is_headquarters: {
|
|
67
|
-
label: {"en":"Is Headquarters"},
|
|
67
|
+
label: {"ja":"本社","en":"Is Headquarters"},
|
|
68
68
|
},
|
|
69
69
|
is_active: {
|
|
70
|
-
label: {"en":"Active"},
|
|
70
|
+
label: {"ja":"有効","en":"Active"},
|
|
71
71
|
},
|
|
72
72
|
},
|
|
73
73
|
} as const;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ⚠️ DO NOT EDIT THIS FILE! ⚠️
|
|
3
|
+
* このファイルを編集しないでください!
|
|
4
|
+
* KHÔNG ĐƯỢC SỬA FILE NÀY!
|
|
5
|
+
*
|
|
6
|
+
* Auto-generated TypeScript types from Omnify schemas.
|
|
7
|
+
* Any manual changes will be OVERWRITTEN on next generation.
|
|
8
|
+
*
|
|
9
|
+
* To modify: Edit the schema YAML file and run: npx omnify generate
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { z } from 'zod';
|
|
13
|
+
import type { DateTimeString } from './common';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 支店キャッシュ
|
|
17
|
+
*/
|
|
18
|
+
export interface BranchCache {
|
|
19
|
+
/** Primary key */
|
|
20
|
+
id: string;
|
|
21
|
+
/** Console Branch ID */
|
|
22
|
+
console_branch_id: unknown;
|
|
23
|
+
/** Console Organization ID */
|
|
24
|
+
console_org_id: unknown;
|
|
25
|
+
/** 支店コード */
|
|
26
|
+
code: string;
|
|
27
|
+
/** 支店名 */
|
|
28
|
+
name: string;
|
|
29
|
+
/** 本社 */
|
|
30
|
+
is_headquarters: boolean;
|
|
31
|
+
/** 有効 */
|
|
32
|
+
is_active: boolean;
|
|
33
|
+
/** Creation timestamp */
|
|
34
|
+
created_at?: DateTimeString;
|
|
35
|
+
/** Last update timestamp */
|
|
36
|
+
updated_at?: DateTimeString;
|
|
37
|
+
/** Soft delete timestamp */
|
|
38
|
+
deleted_at?: DateTimeString;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// ============================================================================
|
|
42
|
+
// I18n (Internationalization)
|
|
43
|
+
// ============================================================================
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Unified i18n object for BranchCache
|
|
47
|
+
* Contains model label and all field labels/placeholders
|
|
48
|
+
*/
|
|
49
|
+
export const branchCacheI18n = {
|
|
50
|
+
/** Model display name */
|
|
51
|
+
label: {"ja":"支店キャッシュ","en":"Branch Cache"},
|
|
52
|
+
/** Field labels and placeholders */
|
|
53
|
+
fields: {
|
|
54
|
+
console_branch_id: {
|
|
55
|
+
label: {"ja":"Console Branch ID","en":"Console Branch ID"},
|
|
56
|
+
},
|
|
57
|
+
console_org_id: {
|
|
58
|
+
label: {"ja":"Console Organization ID","en":"Console Organization ID"},
|
|
59
|
+
},
|
|
60
|
+
code: {
|
|
61
|
+
label: {"ja":"支店コード","en":"Branch Code"},
|
|
62
|
+
},
|
|
63
|
+
name: {
|
|
64
|
+
label: {"ja":"支店名","en":"Branch Name"},
|
|
65
|
+
},
|
|
66
|
+
is_headquarters: {
|
|
67
|
+
label: {"ja":"本社","en":"Is Headquarters"},
|
|
68
|
+
},
|
|
69
|
+
is_active: {
|
|
70
|
+
label: {"ja":"有効","en":"Active"},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
} as const;
|
|
74
|
+
|
|
75
|
+
// ============================================================================
|
|
76
|
+
// Zod Schemas
|
|
77
|
+
// ============================================================================
|
|
78
|
+
|
|
79
|
+
/** Field schemas for BranchCache */
|
|
80
|
+
export const baseBranchCacheSchemas = {
|
|
81
|
+
console_branch_id: z.string(),
|
|
82
|
+
console_org_id: z.string(),
|
|
83
|
+
code: z.string().min(1).max(20),
|
|
84
|
+
name: z.string().min(1).max(100),
|
|
85
|
+
is_headquarters: z.boolean(),
|
|
86
|
+
is_active: z.boolean(),
|
|
87
|
+
} as const;
|
|
88
|
+
|
|
89
|
+
/** Create schema for BranchCache (POST requests) */
|
|
90
|
+
export const baseBranchCacheCreateSchema = z.object({
|
|
91
|
+
console_branch_id: baseBranchCacheSchemas.console_branch_id,
|
|
92
|
+
console_org_id: baseBranchCacheSchemas.console_org_id,
|
|
93
|
+
code: baseBranchCacheSchemas.code,
|
|
94
|
+
name: baseBranchCacheSchemas.name,
|
|
95
|
+
is_headquarters: baseBranchCacheSchemas.is_headquarters,
|
|
96
|
+
is_active: baseBranchCacheSchemas.is_active,
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
/** Update schema for BranchCache (PUT/PATCH requests) */
|
|
100
|
+
export const baseBranchCacheUpdateSchema = baseBranchCacheCreateSchema.partial();
|
|
101
|
+
|
|
102
|
+
// ============================================================================
|
|
103
|
+
// Inferred Types
|
|
104
|
+
// ============================================================================
|
|
105
|
+
|
|
106
|
+
export type BaseBranchCacheCreate = z.infer<typeof baseBranchCacheCreateSchema>;
|
|
107
|
+
export type BaseBranchCacheUpdate = z.infer<typeof baseBranchCacheUpdateSchema>;
|
|
108
|
+
|
|
109
|
+
// ============================================================================
|
|
110
|
+
// I18n Helper Functions
|
|
111
|
+
// ============================================================================
|
|
112
|
+
|
|
113
|
+
/** Get model label for a specific locale */
|
|
114
|
+
export function getBranchCacheLabel(locale: string): string {
|
|
115
|
+
return branchCacheI18n.label[locale as keyof typeof branchCacheI18n.label] ?? branchCacheI18n.label['en'] ?? 'BranchCache';
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** Get field label for a specific locale */
|
|
119
|
+
export function getBranchCacheFieldLabel(field: string, locale: string): string {
|
|
120
|
+
const fieldI18n = branchCacheI18n.fields[field as keyof typeof branchCacheI18n.fields];
|
|
121
|
+
if (!fieldI18n) return field;
|
|
122
|
+
return fieldI18n.label[locale as keyof typeof fieldI18n.label] ?? fieldI18n.label['en'] ?? field;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** Get field placeholder for a specific locale */
|
|
126
|
+
export function getBranchCacheFieldPlaceholder(field: string, locale: string): string {
|
|
127
|
+
const fieldI18n = branchCacheI18n.fields[field as keyof typeof branchCacheI18n.fields];
|
|
128
|
+
if (!fieldI18n || !('placeholder' in fieldI18n)) return '';
|
|
129
|
+
const placeholder = fieldI18n.placeholder as Record<string, string>;
|
|
130
|
+
return placeholder[locale] ?? placeholder['en'] ?? '';
|
|
131
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ⚠️ DO NOT EDIT THIS FILE! ⚠️
|
|
3
|
+
* このファイルを編集しないでください!
|
|
4
|
+
* KHÔNG ĐƯỢC SỬA FILE NÀY!
|
|
5
|
+
*
|
|
6
|
+
* Auto-generated TypeScript types from Omnify schemas.
|
|
7
|
+
* Any manual changes will be OVERWRITTEN on next generation.
|
|
8
|
+
*
|
|
9
|
+
* To modify: Edit the schema YAML file and run: npx omnify generate
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { z } from 'zod';
|
|
13
|
+
import type { DateTimeString } from './common';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 組織キャッシュ
|
|
17
|
+
*/
|
|
18
|
+
export interface OrganizationCache {
|
|
19
|
+
/** Primary key */
|
|
20
|
+
id: string;
|
|
21
|
+
/** Console Organization ID */
|
|
22
|
+
console_org_id: unknown;
|
|
23
|
+
/** 組織名 */
|
|
24
|
+
name: string;
|
|
25
|
+
/** 組織コード */
|
|
26
|
+
code: string;
|
|
27
|
+
/** 有効 */
|
|
28
|
+
is_active: boolean;
|
|
29
|
+
/** Creation timestamp */
|
|
30
|
+
created_at?: DateTimeString;
|
|
31
|
+
/** Last update timestamp */
|
|
32
|
+
updated_at?: DateTimeString;
|
|
33
|
+
/** Soft delete timestamp */
|
|
34
|
+
deleted_at?: DateTimeString;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// ============================================================================
|
|
38
|
+
// I18n (Internationalization)
|
|
39
|
+
// ============================================================================
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Unified i18n object for OrganizationCache
|
|
43
|
+
* Contains model label and all field labels/placeholders
|
|
44
|
+
*/
|
|
45
|
+
export const organizationCacheI18n = {
|
|
46
|
+
/** Model display name */
|
|
47
|
+
label: {"ja":"組織キャッシュ","en":"Organization Cache"},
|
|
48
|
+
/** Field labels and placeholders */
|
|
49
|
+
fields: {
|
|
50
|
+
console_org_id: {
|
|
51
|
+
label: {"ja":"Console Organization ID","en":"Console Organization ID"},
|
|
52
|
+
},
|
|
53
|
+
name: {
|
|
54
|
+
label: {"ja":"組織名","en":"Organization Name"},
|
|
55
|
+
},
|
|
56
|
+
code: {
|
|
57
|
+
label: {"ja":"組織コード","en":"Organization Code"},
|
|
58
|
+
},
|
|
59
|
+
is_active: {
|
|
60
|
+
label: {"ja":"有効","en":"Active"},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
} as const;
|
|
64
|
+
|
|
65
|
+
// ============================================================================
|
|
66
|
+
// Zod Schemas
|
|
67
|
+
// ============================================================================
|
|
68
|
+
|
|
69
|
+
/** Field schemas for OrganizationCache */
|
|
70
|
+
export const baseOrganizationCacheSchemas = {
|
|
71
|
+
console_org_id: z.string(),
|
|
72
|
+
name: z.string().min(1).max(100),
|
|
73
|
+
code: z.string().min(1).max(20),
|
|
74
|
+
is_active: z.boolean(),
|
|
75
|
+
} as const;
|
|
76
|
+
|
|
77
|
+
/** Create schema for OrganizationCache (POST requests) */
|
|
78
|
+
export const baseOrganizationCacheCreateSchema = z.object({
|
|
79
|
+
console_org_id: baseOrganizationCacheSchemas.console_org_id,
|
|
80
|
+
name: baseOrganizationCacheSchemas.name,
|
|
81
|
+
code: baseOrganizationCacheSchemas.code,
|
|
82
|
+
is_active: baseOrganizationCacheSchemas.is_active,
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
/** Update schema for OrganizationCache (PUT/PATCH requests) */
|
|
86
|
+
export const baseOrganizationCacheUpdateSchema = baseOrganizationCacheCreateSchema.partial();
|
|
87
|
+
|
|
88
|
+
// ============================================================================
|
|
89
|
+
// Inferred Types
|
|
90
|
+
// ============================================================================
|
|
91
|
+
|
|
92
|
+
export type BaseOrganizationCacheCreate = z.infer<typeof baseOrganizationCacheCreateSchema>;
|
|
93
|
+
export type BaseOrganizationCacheUpdate = z.infer<typeof baseOrganizationCacheUpdateSchema>;
|
|
94
|
+
|
|
95
|
+
// ============================================================================
|
|
96
|
+
// I18n Helper Functions
|
|
97
|
+
// ============================================================================
|
|
98
|
+
|
|
99
|
+
/** Get model label for a specific locale */
|
|
100
|
+
export function getOrganizationCacheLabel(locale: string): string {
|
|
101
|
+
return organizationCacheI18n.label[locale as keyof typeof organizationCacheI18n.label] ?? organizationCacheI18n.label['en'] ?? 'OrganizationCache';
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** Get field label for a specific locale */
|
|
105
|
+
export function getOrganizationCacheFieldLabel(field: string, locale: string): string {
|
|
106
|
+
const fieldI18n = organizationCacheI18n.fields[field as keyof typeof organizationCacheI18n.fields];
|
|
107
|
+
if (!fieldI18n) return field;
|
|
108
|
+
return fieldI18n.label[locale as keyof typeof fieldI18n.label] ?? fieldI18n.label['en'] ?? field;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** Get field placeholder for a specific locale */
|
|
112
|
+
export function getOrganizationCacheFieldPlaceholder(field: string, locale: string): string {
|
|
113
|
+
const fieldI18n = organizationCacheI18n.fields[field as keyof typeof organizationCacheI18n.fields];
|
|
114
|
+
if (!fieldI18n || !('placeholder' in fieldI18n)) return '';
|
|
115
|
+
const placeholder = fieldI18n.placeholder as Record<string, string>;
|
|
116
|
+
return placeholder[locale] ?? placeholder['en'] ?? '';
|
|
117
|
+
}
|
|
@@ -14,18 +14,18 @@ import type { DateTimeString } from './common';
|
|
|
14
14
|
import type { Role } from './Role';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* 権限
|
|
18
18
|
*/
|
|
19
19
|
export interface Permission {
|
|
20
20
|
/** Primary key */
|
|
21
21
|
id: string;
|
|
22
|
-
/**
|
|
22
|
+
/** 権限名 */
|
|
23
23
|
name: string;
|
|
24
|
-
/**
|
|
24
|
+
/** スラッグ */
|
|
25
25
|
slug: string;
|
|
26
|
-
/**
|
|
26
|
+
/** グループ */
|
|
27
27
|
group?: string;
|
|
28
|
-
/**
|
|
28
|
+
/** ロール */
|
|
29
29
|
roles: Role[];
|
|
30
30
|
/** Creation timestamp */
|
|
31
31
|
created_at?: DateTimeString;
|
|
@@ -43,20 +43,20 @@ export interface Permission {
|
|
|
43
43
|
*/
|
|
44
44
|
export const permissionI18n = {
|
|
45
45
|
/** Model display name */
|
|
46
|
-
label: {"en":"Permission"},
|
|
46
|
+
label: {"ja":"権限","en":"Permission"},
|
|
47
47
|
/** Field labels and placeholders */
|
|
48
48
|
fields: {
|
|
49
49
|
name: {
|
|
50
|
-
label: {"en":"Permission Name"},
|
|
50
|
+
label: {"ja":"権限名","en":"Permission Name"},
|
|
51
51
|
},
|
|
52
52
|
slug: {
|
|
53
|
-
label: {"en":"Slug"},
|
|
53
|
+
label: {"ja":"スラッグ","en":"Slug"},
|
|
54
54
|
},
|
|
55
55
|
group: {
|
|
56
|
-
label: {"en":"Group"},
|
|
56
|
+
label: {"ja":"グループ","en":"Group"},
|
|
57
57
|
},
|
|
58
58
|
roles: {
|
|
59
|
-
label: {"en":"Roles"},
|
|
59
|
+
label: {"ja":"ロール","en":"Roles"},
|
|
60
60
|
},
|
|
61
61
|
},
|
|
62
62
|
} as const;
|
|
@@ -14,20 +14,22 @@ import type { DateTimeString } from './common';
|
|
|
14
14
|
import type { Permission } from './Permission';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* ロール
|
|
18
18
|
*/
|
|
19
19
|
export interface Role {
|
|
20
20
|
/** Primary key */
|
|
21
21
|
id: string;
|
|
22
|
-
/**
|
|
22
|
+
/** 組織ID */
|
|
23
|
+
console_org_id?: string;
|
|
24
|
+
/** ロール名 */
|
|
23
25
|
name: string;
|
|
24
|
-
/**
|
|
26
|
+
/** スラッグ */
|
|
25
27
|
slug: string;
|
|
26
|
-
/**
|
|
28
|
+
/** 説明 */
|
|
27
29
|
description?: string;
|
|
28
|
-
/**
|
|
30
|
+
/** レベル */
|
|
29
31
|
level: number;
|
|
30
|
-
/**
|
|
32
|
+
/** 権限 */
|
|
31
33
|
permissions: Permission[];
|
|
32
34
|
/** Creation timestamp */
|
|
33
35
|
created_at?: DateTimeString;
|
|
@@ -45,23 +47,26 @@ export interface Role {
|
|
|
45
47
|
*/
|
|
46
48
|
export const roleI18n = {
|
|
47
49
|
/** Model display name */
|
|
48
|
-
label: {"en":"Role"},
|
|
50
|
+
label: {"ja":"ロール","en":"Role"},
|
|
49
51
|
/** Field labels and placeholders */
|
|
50
52
|
fields: {
|
|
53
|
+
console_org_id: {
|
|
54
|
+
label: {"ja":"組織ID","en":"Organization ID"},
|
|
55
|
+
},
|
|
51
56
|
name: {
|
|
52
|
-
label: {"en":"Role Name"},
|
|
57
|
+
label: {"ja":"ロール名","en":"Role Name"},
|
|
53
58
|
},
|
|
54
59
|
slug: {
|
|
55
|
-
label: {"en":"Slug"},
|
|
60
|
+
label: {"ja":"スラッグ","en":"Slug"},
|
|
56
61
|
},
|
|
57
62
|
description: {
|
|
58
|
-
label: {"en":"Description"},
|
|
63
|
+
label: {"ja":"説明","en":"Description"},
|
|
59
64
|
},
|
|
60
65
|
level: {
|
|
61
|
-
label: {"en":"Level"},
|
|
66
|
+
label: {"ja":"レベル","en":"Level"},
|
|
62
67
|
},
|
|
63
68
|
permissions: {
|
|
64
|
-
label: {"en":"Permissions"},
|
|
69
|
+
label: {"ja":"権限","en":"Permissions"},
|
|
65
70
|
},
|
|
66
71
|
},
|
|
67
72
|
} as const;
|
|
@@ -72,6 +77,7 @@ export const roleI18n = {
|
|
|
72
77
|
|
|
73
78
|
/** Field schemas for Role */
|
|
74
79
|
export const baseRoleSchemas = {
|
|
80
|
+
console_org_id: z.string().max(36).optional().nullable(),
|
|
75
81
|
name: z.string().min(1).max(100),
|
|
76
82
|
slug: z.string().min(1).max(100),
|
|
77
83
|
description: z.string().optional().nullable(),
|
|
@@ -80,6 +86,7 @@ export const baseRoleSchemas = {
|
|
|
80
86
|
|
|
81
87
|
/** Create schema for Role (POST requests) */
|
|
82
88
|
export const baseRoleCreateSchema = z.object({
|
|
89
|
+
console_org_id: baseRoleSchemas.console_org_id,
|
|
83
90
|
name: baseRoleSchemas.name,
|
|
84
91
|
slug: baseRoleSchemas.slug,
|
|
85
92
|
description: baseRoleSchemas.description,
|
|
@@ -15,12 +15,12 @@ import type { Permission } from './Permission';
|
|
|
15
15
|
import type { Role } from './Role';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* ロール権限
|
|
19
19
|
*/
|
|
20
20
|
export interface RolePermission {
|
|
21
|
-
/**
|
|
21
|
+
/** ロール */
|
|
22
22
|
role: Role;
|
|
23
|
-
/**
|
|
23
|
+
/** 権限 */
|
|
24
24
|
permission: Permission;
|
|
25
25
|
/** Creation timestamp */
|
|
26
26
|
created_at?: DateTimeString;
|
|
@@ -38,14 +38,14 @@ export interface RolePermission {
|
|
|
38
38
|
*/
|
|
39
39
|
export const rolePermissionI18n = {
|
|
40
40
|
/** Model display name */
|
|
41
|
-
label: {"en":"Role Permission"},
|
|
41
|
+
label: {"ja":"ロール権限","en":"Role Permission"},
|
|
42
42
|
/** Field labels and placeholders */
|
|
43
43
|
fields: {
|
|
44
44
|
role: {
|
|
45
|
-
label: {"en":"Role"},
|
|
45
|
+
label: {"ja":"ロール","en":"Role"},
|
|
46
46
|
},
|
|
47
47
|
permission: {
|
|
48
|
-
label: {"en":"Permission"},
|
|
48
|
+
label: {"ja":"権限","en":"Permission"},
|
|
49
49
|
},
|
|
50
50
|
},
|
|
51
51
|
} as const;
|
|
@@ -13,7 +13,7 @@ import { z } from 'zod';
|
|
|
13
13
|
import type { DateTimeString } from './common';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* チーム
|
|
17
17
|
*/
|
|
18
18
|
export interface Team {
|
|
19
19
|
/** Primary key */
|
|
@@ -22,7 +22,7 @@ export interface Team {
|
|
|
22
22
|
console_team_id: unknown;
|
|
23
23
|
/** Console Organization ID */
|
|
24
24
|
console_org_id: unknown;
|
|
25
|
-
/**
|
|
25
|
+
/** チーム名 */
|
|
26
26
|
name: string;
|
|
27
27
|
/** Creation timestamp */
|
|
28
28
|
created_at?: DateTimeString;
|
|
@@ -42,17 +42,17 @@ export interface Team {
|
|
|
42
42
|
*/
|
|
43
43
|
export const teamI18n = {
|
|
44
44
|
/** Model display name */
|
|
45
|
-
label: {"en":"Team"},
|
|
45
|
+
label: {"ja":"チーム","en":"Team"},
|
|
46
46
|
/** Field labels and placeholders */
|
|
47
47
|
fields: {
|
|
48
48
|
console_team_id: {
|
|
49
|
-
label: {"en":"Console Team ID"},
|
|
49
|
+
label: {"ja":"Console Team ID","en":"Console Team ID"},
|
|
50
50
|
},
|
|
51
51
|
console_org_id: {
|
|
52
|
-
label: {"en":"Console Organization ID"},
|
|
52
|
+
label: {"ja":"Console Organization ID","en":"Console Organization ID"},
|
|
53
53
|
},
|
|
54
54
|
name: {
|
|
55
|
-
label: {"en":"Team Name"},
|
|
55
|
+
label: {"ja":"チーム名","en":"Team Name"},
|
|
56
56
|
},
|
|
57
57
|
},
|
|
58
58
|
} as const;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ⚠️ DO NOT EDIT THIS FILE! ⚠️
|
|
3
|
+
* このファイルを編集しないでください!
|
|
4
|
+
* KHÔNG ĐƯỢC SỬA FILE NÀY!
|
|
5
|
+
*
|
|
6
|
+
* Auto-generated TypeScript types from Omnify schemas.
|
|
7
|
+
* Any manual changes will be OVERWRITTEN on next generation.
|
|
8
|
+
*
|
|
9
|
+
* To modify: Edit the schema YAML file and run: npx omnify generate
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { z } from 'zod';
|
|
13
|
+
import type { DateTimeString } from './common';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* チームキャッシュ
|
|
17
|
+
*/
|
|
18
|
+
export interface TeamCache {
|
|
19
|
+
/** Primary key */
|
|
20
|
+
id: string;
|
|
21
|
+
/** Console Team ID */
|
|
22
|
+
console_team_id: unknown;
|
|
23
|
+
/** Console Organization ID */
|
|
24
|
+
console_org_id: unknown;
|
|
25
|
+
/** チーム名 */
|
|
26
|
+
name: string;
|
|
27
|
+
/** Creation timestamp */
|
|
28
|
+
created_at?: DateTimeString;
|
|
29
|
+
/** Last update timestamp */
|
|
30
|
+
updated_at?: DateTimeString;
|
|
31
|
+
/** Soft delete timestamp */
|
|
32
|
+
deleted_at?: DateTimeString;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// ============================================================================
|
|
36
|
+
// I18n (Internationalization)
|
|
37
|
+
// ============================================================================
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Unified i18n object for TeamCache
|
|
41
|
+
* Contains model label and all field labels/placeholders
|
|
42
|
+
*/
|
|
43
|
+
export const teamCacheI18n = {
|
|
44
|
+
/** Model display name */
|
|
45
|
+
label: {"ja":"チームキャッシュ","en":"Team Cache"},
|
|
46
|
+
/** Field labels and placeholders */
|
|
47
|
+
fields: {
|
|
48
|
+
console_team_id: {
|
|
49
|
+
label: {"ja":"Console Team ID","en":"Console Team ID"},
|
|
50
|
+
},
|
|
51
|
+
console_org_id: {
|
|
52
|
+
label: {"ja":"Console Organization ID","en":"Console Organization ID"},
|
|
53
|
+
},
|
|
54
|
+
name: {
|
|
55
|
+
label: {"ja":"チーム名","en":"Team Name"},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
} as const;
|
|
59
|
+
|
|
60
|
+
// ============================================================================
|
|
61
|
+
// Zod Schemas
|
|
62
|
+
// ============================================================================
|
|
63
|
+
|
|
64
|
+
/** Field schemas for TeamCache */
|
|
65
|
+
export const baseTeamCacheSchemas = {
|
|
66
|
+
console_team_id: z.string(),
|
|
67
|
+
console_org_id: z.string(),
|
|
68
|
+
name: z.string().min(1).max(100),
|
|
69
|
+
} as const;
|
|
70
|
+
|
|
71
|
+
/** Create schema for TeamCache (POST requests) */
|
|
72
|
+
export const baseTeamCacheCreateSchema = z.object({
|
|
73
|
+
console_team_id: baseTeamCacheSchemas.console_team_id,
|
|
74
|
+
console_org_id: baseTeamCacheSchemas.console_org_id,
|
|
75
|
+
name: baseTeamCacheSchemas.name,
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
/** Update schema for TeamCache (PUT/PATCH requests) */
|
|
79
|
+
export const baseTeamCacheUpdateSchema = baseTeamCacheCreateSchema.partial();
|
|
80
|
+
|
|
81
|
+
// ============================================================================
|
|
82
|
+
// Inferred Types
|
|
83
|
+
// ============================================================================
|
|
84
|
+
|
|
85
|
+
export type BaseTeamCacheCreate = z.infer<typeof baseTeamCacheCreateSchema>;
|
|
86
|
+
export type BaseTeamCacheUpdate = z.infer<typeof baseTeamCacheUpdateSchema>;
|
|
87
|
+
|
|
88
|
+
// ============================================================================
|
|
89
|
+
// I18n Helper Functions
|
|
90
|
+
// ============================================================================
|
|
91
|
+
|
|
92
|
+
/** Get model label for a specific locale */
|
|
93
|
+
export function getTeamCacheLabel(locale: string): string {
|
|
94
|
+
return teamCacheI18n.label[locale as keyof typeof teamCacheI18n.label] ?? teamCacheI18n.label['en'] ?? 'TeamCache';
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** Get field label for a specific locale */
|
|
98
|
+
export function getTeamCacheFieldLabel(field: string, locale: string): string {
|
|
99
|
+
const fieldI18n = teamCacheI18n.fields[field as keyof typeof teamCacheI18n.fields];
|
|
100
|
+
if (!fieldI18n) return field;
|
|
101
|
+
return fieldI18n.label[locale as keyof typeof fieldI18n.label] ?? fieldI18n.label['en'] ?? field;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** Get field placeholder for a specific locale */
|
|
105
|
+
export function getTeamCacheFieldPlaceholder(field: string, locale: string): string {
|
|
106
|
+
const fieldI18n = teamCacheI18n.fields[field as keyof typeof teamCacheI18n.fields];
|
|
107
|
+
if (!fieldI18n || !('placeholder' in fieldI18n)) return '';
|
|
108
|
+
const placeholder = fieldI18n.placeholder as Record<string, string>;
|
|
109
|
+
return placeholder[locale] ?? placeholder['en'] ?? '';
|
|
110
|
+
}
|
|
@@ -14,7 +14,7 @@ import type { DateTimeString } from './common';
|
|
|
14
14
|
import type { Permission } from './Permission';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* チーム権限
|
|
18
18
|
*/
|
|
19
19
|
export interface TeamPermission {
|
|
20
20
|
/** Primary key */
|
|
@@ -23,7 +23,7 @@ export interface TeamPermission {
|
|
|
23
23
|
console_org_id: unknown;
|
|
24
24
|
/** Console Team ID */
|
|
25
25
|
console_team_id: unknown;
|
|
26
|
-
/**
|
|
26
|
+
/** 権限 */
|
|
27
27
|
permission: Permission;
|
|
28
28
|
/** Creation timestamp */
|
|
29
29
|
created_at?: DateTimeString;
|
|
@@ -43,17 +43,17 @@ export interface TeamPermission {
|
|
|
43
43
|
*/
|
|
44
44
|
export const teamPermissionI18n = {
|
|
45
45
|
/** Model display name */
|
|
46
|
-
label: {"en":"Team Permission"},
|
|
46
|
+
label: {"ja":"チーム権限","en":"Team Permission"},
|
|
47
47
|
/** Field labels and placeholders */
|
|
48
48
|
fields: {
|
|
49
49
|
console_org_id: {
|
|
50
|
-
label: {"en":"Console Organization ID"},
|
|
50
|
+
label: {"ja":"Console Organization ID","en":"Console Organization ID"},
|
|
51
51
|
},
|
|
52
52
|
console_team_id: {
|
|
53
|
-
label: {"en":"Console Team ID"},
|
|
53
|
+
label: {"ja":"Console Team ID","en":"Console Team ID"},
|
|
54
54
|
},
|
|
55
55
|
permission: {
|
|
56
|
-
label: {"en":"Permission"},
|
|
56
|
+
label: {"ja":"権限","en":"Permission"},
|
|
57
57
|
},
|
|
58
58
|
},
|
|
59
59
|
} as const;
|