@famgia/omnify-react-sso 0.0.1 → 2.0.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 +19 -1
- package/dist/index.cjs +75 -395
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +83 -347
- package/dist/index.js.map +1 -1
- package/dist/schemas/index.cjs +74 -396
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +54 -570
- package/dist/schemas/index.d.ts +54 -570
- package/dist/schemas/index.js +83 -347
- package/dist/schemas/index.js.map +1 -1
- package/package.json +3 -3
package/dist/schemas/index.cjs
CHANGED
|
@@ -20,439 +20,117 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/schemas/index.ts
|
|
21
21
|
var schemas_exports = {};
|
|
22
22
|
__export(schemas_exports, {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
23
|
+
branchCreateSchema: () => branchCreateSchema,
|
|
24
|
+
branchI18n: () => import_Branch.branchI18n,
|
|
25
|
+
branchSchemas: () => branchSchemas,
|
|
26
|
+
branchUpdateSchema: () => branchUpdateSchema,
|
|
27
|
+
defaultLocale: () => import_i18n.defaultLocale,
|
|
28
|
+
fallbackLocale: () => import_i18n.fallbackLocale,
|
|
29
|
+
getBranchFieldLabel: () => import_Branch.getBranchFieldLabel,
|
|
30
|
+
getBranchFieldPlaceholder: () => import_Branch.getBranchFieldPlaceholder,
|
|
31
|
+
getBranchLabel: () => import_Branch.getBranchLabel,
|
|
32
|
+
getMessage: () => import_i18n.getMessage,
|
|
33
|
+
getMessages: () => import_i18n.getMessages,
|
|
34
|
+
getPermissionFieldLabel: () => import_Permission.getPermissionFieldLabel,
|
|
35
|
+
getPermissionFieldPlaceholder: () => import_Permission.getPermissionFieldPlaceholder,
|
|
36
|
+
getPermissionLabel: () => import_Permission.getPermissionLabel,
|
|
37
|
+
getRoleFieldLabel: () => import_Role.getRoleFieldLabel,
|
|
38
|
+
getRoleFieldPlaceholder: () => import_Role.getRoleFieldPlaceholder,
|
|
39
|
+
getRoleLabel: () => import_Role.getRoleLabel,
|
|
40
|
+
getRolePermissionFieldLabel: () => import_RolePermission.getRolePermissionFieldLabel,
|
|
41
|
+
getRolePermissionFieldPlaceholder: () => import_RolePermission.getRolePermissionFieldPlaceholder,
|
|
42
|
+
getRolePermissionLabel: () => import_RolePermission.getRolePermissionLabel,
|
|
43
|
+
getTeamFieldLabel: () => import_Team.getTeamFieldLabel,
|
|
44
|
+
getTeamFieldPlaceholder: () => import_Team.getTeamFieldPlaceholder,
|
|
45
|
+
getTeamLabel: () => import_Team.getTeamLabel,
|
|
46
|
+
getTeamPermissionFieldLabel: () => import_TeamPermission.getTeamPermissionFieldLabel,
|
|
47
|
+
getTeamPermissionFieldPlaceholder: () => import_TeamPermission.getTeamPermissionFieldPlaceholder,
|
|
48
|
+
getTeamPermissionLabel: () => import_TeamPermission.getTeamPermissionLabel,
|
|
49
|
+
getUserFieldLabel: () => import_User.getUserFieldLabel,
|
|
50
|
+
getUserFieldPlaceholder: () => import_User.getUserFieldPlaceholder,
|
|
51
|
+
getUserLabel: () => import_User.getUserLabel,
|
|
45
52
|
permissionCreateSchema: () => permissionCreateSchema,
|
|
46
|
-
permissionI18n: () => permissionI18n,
|
|
53
|
+
permissionI18n: () => import_Permission.permissionI18n,
|
|
47
54
|
permissionSchemas: () => permissionSchemas,
|
|
48
55
|
permissionUpdateSchema: () => permissionUpdateSchema,
|
|
49
56
|
roleCreateSchema: () => roleCreateSchema,
|
|
50
|
-
roleI18n: () => roleI18n,
|
|
57
|
+
roleI18n: () => import_Role.roleI18n,
|
|
51
58
|
rolePermissionCreateSchema: () => rolePermissionCreateSchema,
|
|
52
|
-
rolePermissionI18n: () => rolePermissionI18n,
|
|
59
|
+
rolePermissionI18n: () => import_RolePermission.rolePermissionI18n,
|
|
53
60
|
rolePermissionSchemas: () => rolePermissionSchemas,
|
|
54
61
|
rolePermissionUpdateSchema: () => rolePermissionUpdateSchema,
|
|
55
62
|
roleSchemas: () => roleSchemas,
|
|
56
63
|
roleUpdateSchema: () => roleUpdateSchema,
|
|
57
|
-
supportedLocales: () => supportedLocales,
|
|
64
|
+
supportedLocales: () => import_i18n.supportedLocales,
|
|
58
65
|
teamCreateSchema: () => teamCreateSchema,
|
|
59
|
-
teamI18n: () => teamI18n,
|
|
66
|
+
teamI18n: () => import_Team.teamI18n,
|
|
60
67
|
teamPermissionCreateSchema: () => teamPermissionCreateSchema,
|
|
61
|
-
teamPermissionI18n: () => teamPermissionI18n,
|
|
68
|
+
teamPermissionI18n: () => import_TeamPermission.teamPermissionI18n,
|
|
62
69
|
teamPermissionSchemas: () => teamPermissionSchemas,
|
|
63
70
|
teamPermissionUpdateSchema: () => teamPermissionUpdateSchema,
|
|
64
71
|
teamSchemas: () => teamSchemas,
|
|
65
72
|
teamUpdateSchema: () => teamUpdateSchema,
|
|
66
73
|
userCreateSchema: () => userCreateSchema,
|
|
67
|
-
userI18n: () => userI18n,
|
|
74
|
+
userI18n: () => import_User.userI18n,
|
|
68
75
|
userSchemas: () => userSchemas,
|
|
69
76
|
userUpdateSchema: () => userUpdateSchema,
|
|
70
|
-
validationMessages: () => validationMessages
|
|
77
|
+
validationMessages: () => import_i18n.validationMessages
|
|
71
78
|
});
|
|
72
79
|
module.exports = __toCommonJS(schemas_exports);
|
|
73
|
-
|
|
74
|
-
// src/schemas/i18n.ts
|
|
75
|
-
var defaultLocale = "ja";
|
|
76
|
-
var fallbackLocale = "en";
|
|
77
|
-
var supportedLocales = ["ja", "en"];
|
|
78
|
-
var validationMessages = {
|
|
79
|
-
"required": {
|
|
80
|
-
"ja": "${displayName}\u306F\u5FC5\u9808\u3067\u3059",
|
|
81
|
-
"en": "${displayName} is required"
|
|
82
|
-
},
|
|
83
|
-
"minLength": {
|
|
84
|
-
"ja": "${displayName}\u306F${min}\u6587\u5B57\u4EE5\u4E0A\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
85
|
-
"en": "${displayName} must be at least ${min} characters"
|
|
86
|
-
},
|
|
87
|
-
"maxLength": {
|
|
88
|
-
"ja": "${displayName}\u306F${max}\u6587\u5B57\u4EE5\u5185\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
89
|
-
"en": "${displayName} must be at most ${max} characters"
|
|
90
|
-
},
|
|
91
|
-
"min": {
|
|
92
|
-
"ja": "${displayName}\u306F${min}\u4EE5\u4E0A\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
93
|
-
"en": "${displayName} must be at least ${min}"
|
|
94
|
-
},
|
|
95
|
-
"max": {
|
|
96
|
-
"ja": "${displayName}\u306F${max}\u4EE5\u4E0B\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
97
|
-
"en": "${displayName} must be at most ${max}"
|
|
98
|
-
},
|
|
99
|
-
"email": {
|
|
100
|
-
"ja": "\u6709\u52B9\u306A\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
101
|
-
"en": "Please enter a valid email address"
|
|
102
|
-
},
|
|
103
|
-
"url": {
|
|
104
|
-
"ja": "\u6709\u52B9\u306AURL\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
105
|
-
"en": "Please enter a valid URL"
|
|
106
|
-
},
|
|
107
|
-
"pattern": {
|
|
108
|
-
"ja": "${displayName}\u306E\u5F62\u5F0F\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093",
|
|
109
|
-
"en": "${displayName} format is invalid"
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
function getMessage(key, locale, params = {}) {
|
|
113
|
-
const messages = validationMessages[key];
|
|
114
|
-
if (!messages) return key;
|
|
115
|
-
let message = messages[locale] ?? messages[fallbackLocale] ?? messages[defaultLocale] ?? key;
|
|
116
|
-
for (const [param, value] of Object.entries(params)) {
|
|
117
|
-
message = message.replace(new RegExp(`\\\${${param}}`, "g"), String(value));
|
|
118
|
-
}
|
|
119
|
-
return message;
|
|
120
|
-
}
|
|
121
|
-
function getMessages(locale) {
|
|
122
|
-
const result = {};
|
|
123
|
-
for (const [key, messages] of Object.entries(validationMessages)) {
|
|
124
|
-
result[key] = messages[locale] ?? messages[fallbackLocale] ?? messages[defaultLocale] ?? key;
|
|
125
|
-
}
|
|
126
|
-
return result;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// src/schemas/base/User.ts
|
|
130
|
-
var import_zod = require("zod");
|
|
131
|
-
var userI18n = {
|
|
132
|
-
/** Model display name */
|
|
133
|
-
label: { "en": "User" },
|
|
134
|
-
/** Field labels and placeholders */
|
|
135
|
-
fields: {
|
|
136
|
-
name: {
|
|
137
|
-
label: { "en": "Name" }
|
|
138
|
-
},
|
|
139
|
-
email: {
|
|
140
|
-
label: { "en": "Email" }
|
|
141
|
-
},
|
|
142
|
-
email_verified_at: {
|
|
143
|
-
label: { "en": "Email Verified At" }
|
|
144
|
-
},
|
|
145
|
-
password: {
|
|
146
|
-
label: { "en": "Password" }
|
|
147
|
-
},
|
|
148
|
-
remember_token: {
|
|
149
|
-
label: { "en": "Remember Token" }
|
|
150
|
-
},
|
|
151
|
-
console_user_id: {
|
|
152
|
-
label: { "en": "Console User ID" }
|
|
153
|
-
},
|
|
154
|
-
console_access_token: {
|
|
155
|
-
label: { "en": "Console Access Token" }
|
|
156
|
-
},
|
|
157
|
-
console_refresh_token: {
|
|
158
|
-
label: { "en": "Console Refresh Token" }
|
|
159
|
-
},
|
|
160
|
-
console_token_expires_at: {
|
|
161
|
-
label: { "en": "Console Token Expiry" }
|
|
162
|
-
},
|
|
163
|
-
role: {
|
|
164
|
-
label: { "en": "Role" }
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
var baseUserSchemas = {
|
|
169
|
-
name: import_zod.z.string().min(1),
|
|
170
|
-
email: import_zod.z.string().min(1),
|
|
171
|
-
email_verified_at: import_zod.z.string().datetime({ offset: true }).optional().nullable(),
|
|
172
|
-
password: import_zod.z.string().min(1),
|
|
173
|
-
remember_token: import_zod.z.string().max(100).optional().nullable(),
|
|
174
|
-
console_user_id: import_zod.z.number().int().optional().nullable(),
|
|
175
|
-
console_access_token: import_zod.z.string().optional().nullable(),
|
|
176
|
-
console_refresh_token: import_zod.z.string().optional().nullable(),
|
|
177
|
-
console_token_expires_at: import_zod.z.string().datetime({ offset: true }).optional().nullable()
|
|
178
|
-
};
|
|
179
|
-
var baseUserCreateSchema = import_zod.z.object({
|
|
180
|
-
name: baseUserSchemas.name,
|
|
181
|
-
email: baseUserSchemas.email,
|
|
182
|
-
password: baseUserSchemas.password,
|
|
183
|
-
remember_token: baseUserSchemas.remember_token,
|
|
184
|
-
console_user_id: baseUserSchemas.console_user_id,
|
|
185
|
-
console_access_token: baseUserSchemas.console_access_token,
|
|
186
|
-
console_refresh_token: baseUserSchemas.console_refresh_token,
|
|
187
|
-
console_token_expires_at: baseUserSchemas.console_token_expires_at
|
|
188
|
-
});
|
|
189
|
-
var baseUserUpdateSchema = baseUserCreateSchema.partial();
|
|
190
|
-
function getUserLabel(locale) {
|
|
191
|
-
return userI18n.label[locale] ?? userI18n.label["en"] ?? "User";
|
|
192
|
-
}
|
|
193
|
-
function getUserFieldLabel(field, locale) {
|
|
194
|
-
const fieldI18n = userI18n.fields[field];
|
|
195
|
-
if (!fieldI18n) return field;
|
|
196
|
-
return fieldI18n.label[locale] ?? fieldI18n.label["en"] ?? field;
|
|
197
|
-
}
|
|
198
|
-
function getUserFieldPlaceholder(field, locale) {
|
|
199
|
-
const fieldI18n = userI18n.fields[field];
|
|
200
|
-
if (!fieldI18n || !("placeholder" in fieldI18n)) return "";
|
|
201
|
-
const placeholder = fieldI18n.placeholder;
|
|
202
|
-
return placeholder[locale] ?? placeholder["en"] ?? "";
|
|
203
|
-
}
|
|
80
|
+
var import_i18n = require("@omnify-base/schemas/i18n");
|
|
204
81
|
|
|
205
82
|
// src/schemas/User.ts
|
|
206
|
-
var
|
|
207
|
-
var
|
|
208
|
-
var
|
|
83
|
+
var import_User = require("@omnify-base/schemas/User");
|
|
84
|
+
var userSchemas = { ...import_User.baseUserSchemas };
|
|
85
|
+
var userCreateSchema = import_User.baseUserCreateSchema;
|
|
86
|
+
var userUpdateSchema = import_User.baseUserUpdateSchema;
|
|
209
87
|
|
|
210
|
-
// src/schemas/
|
|
211
|
-
var
|
|
212
|
-
var
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
/** Field labels and placeholders */
|
|
216
|
-
fields: {
|
|
217
|
-
name: {
|
|
218
|
-
label: { "en": "Permission Name" }
|
|
219
|
-
},
|
|
220
|
-
slug: {
|
|
221
|
-
label: { "en": "Slug" }
|
|
222
|
-
},
|
|
223
|
-
group: {
|
|
224
|
-
label: { "en": "Group" }
|
|
225
|
-
},
|
|
226
|
-
roles: {
|
|
227
|
-
label: { "en": "Roles" }
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
};
|
|
231
|
-
var basePermissionSchemas = {
|
|
232
|
-
name: import_zod2.z.string().min(1).max(100),
|
|
233
|
-
slug: import_zod2.z.string().min(1).max(100),
|
|
234
|
-
group: import_zod2.z.string().max(50).optional().nullable()
|
|
235
|
-
};
|
|
236
|
-
var basePermissionCreateSchema = import_zod2.z.object({
|
|
237
|
-
name: basePermissionSchemas.name,
|
|
238
|
-
slug: basePermissionSchemas.slug,
|
|
239
|
-
group: basePermissionSchemas.group
|
|
240
|
-
});
|
|
241
|
-
var basePermissionUpdateSchema = basePermissionCreateSchema.partial();
|
|
242
|
-
function getPermissionLabel(locale) {
|
|
243
|
-
return permissionI18n.label[locale] ?? permissionI18n.label["en"] ?? "Permission";
|
|
244
|
-
}
|
|
245
|
-
function getPermissionFieldLabel(field, locale) {
|
|
246
|
-
const fieldI18n = permissionI18n.fields[field];
|
|
247
|
-
if (!fieldI18n) return field;
|
|
248
|
-
return fieldI18n.label[locale] ?? fieldI18n.label["en"] ?? field;
|
|
249
|
-
}
|
|
250
|
-
function getPermissionFieldPlaceholder(field, locale) {
|
|
251
|
-
const fieldI18n = permissionI18n.fields[field];
|
|
252
|
-
if (!fieldI18n || !("placeholder" in fieldI18n)) return "";
|
|
253
|
-
const placeholder = fieldI18n.placeholder;
|
|
254
|
-
return placeholder[locale] ?? placeholder["en"] ?? "";
|
|
255
|
-
}
|
|
88
|
+
// src/schemas/Branch.ts
|
|
89
|
+
var import_Branch = require("@omnify-base/schemas/Branch");
|
|
90
|
+
var branchSchemas = { ...import_Branch.baseBranchSchemas };
|
|
91
|
+
var branchCreateSchema = import_Branch.baseBranchCreateSchema;
|
|
92
|
+
var branchUpdateSchema = import_Branch.baseBranchUpdateSchema;
|
|
256
93
|
|
|
257
94
|
// src/schemas/Permission.ts
|
|
258
|
-
var
|
|
259
|
-
var
|
|
260
|
-
var
|
|
261
|
-
|
|
262
|
-
// src/schemas/base/Role.ts
|
|
263
|
-
var import_zod3 = require("zod");
|
|
264
|
-
var roleI18n = {
|
|
265
|
-
/** Model display name */
|
|
266
|
-
label: { "en": "Role" },
|
|
267
|
-
/** Field labels and placeholders */
|
|
268
|
-
fields: {
|
|
269
|
-
name: {
|
|
270
|
-
label: { "en": "Role Name" }
|
|
271
|
-
},
|
|
272
|
-
slug: {
|
|
273
|
-
label: { "en": "Slug" }
|
|
274
|
-
},
|
|
275
|
-
description: {
|
|
276
|
-
label: { "en": "Description" }
|
|
277
|
-
},
|
|
278
|
-
level: {
|
|
279
|
-
label: { "en": "Level" }
|
|
280
|
-
},
|
|
281
|
-
permissions: {
|
|
282
|
-
label: { "en": "Permissions" }
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
};
|
|
286
|
-
var baseRoleSchemas = {
|
|
287
|
-
name: import_zod3.z.string().min(1).max(100),
|
|
288
|
-
slug: import_zod3.z.string().min(1).max(100),
|
|
289
|
-
description: import_zod3.z.string().optional().nullable(),
|
|
290
|
-
level: import_zod3.z.number().int()
|
|
291
|
-
};
|
|
292
|
-
var baseRoleCreateSchema = import_zod3.z.object({
|
|
293
|
-
name: baseRoleSchemas.name,
|
|
294
|
-
slug: baseRoleSchemas.slug,
|
|
295
|
-
description: baseRoleSchemas.description,
|
|
296
|
-
level: baseRoleSchemas.level
|
|
297
|
-
});
|
|
298
|
-
var baseRoleUpdateSchema = baseRoleCreateSchema.partial();
|
|
299
|
-
function getRoleLabel(locale) {
|
|
300
|
-
return roleI18n.label[locale] ?? roleI18n.label["en"] ?? "Role";
|
|
301
|
-
}
|
|
302
|
-
function getRoleFieldLabel(field, locale) {
|
|
303
|
-
const fieldI18n = roleI18n.fields[field];
|
|
304
|
-
if (!fieldI18n) return field;
|
|
305
|
-
return fieldI18n.label[locale] ?? fieldI18n.label["en"] ?? field;
|
|
306
|
-
}
|
|
307
|
-
function getRoleFieldPlaceholder(field, locale) {
|
|
308
|
-
const fieldI18n = roleI18n.fields[field];
|
|
309
|
-
if (!fieldI18n || !("placeholder" in fieldI18n)) return "";
|
|
310
|
-
const placeholder = fieldI18n.placeholder;
|
|
311
|
-
return placeholder[locale] ?? placeholder["en"] ?? "";
|
|
312
|
-
}
|
|
95
|
+
var import_Permission = require("@omnify-base/schemas/Permission");
|
|
96
|
+
var permissionSchemas = { ...import_Permission.basePermissionSchemas };
|
|
97
|
+
var permissionCreateSchema = import_Permission.basePermissionCreateSchema;
|
|
98
|
+
var permissionUpdateSchema = import_Permission.basePermissionUpdateSchema;
|
|
313
99
|
|
|
314
100
|
// src/schemas/Role.ts
|
|
315
|
-
var
|
|
316
|
-
var
|
|
317
|
-
var
|
|
318
|
-
|
|
319
|
-
// src/schemas/base/RolePermission.ts
|
|
320
|
-
var import_zod4 = require("zod");
|
|
321
|
-
var rolePermissionI18n = {
|
|
322
|
-
/** Model display name */
|
|
323
|
-
label: { "en": "Role Permission" },
|
|
324
|
-
/** Field labels and placeholders */
|
|
325
|
-
fields: {
|
|
326
|
-
role: {
|
|
327
|
-
label: { "en": "Role" }
|
|
328
|
-
},
|
|
329
|
-
permission: {
|
|
330
|
-
label: { "en": "Permission" }
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
};
|
|
334
|
-
var baseRolePermissionSchemas = {};
|
|
335
|
-
var baseRolePermissionCreateSchema = import_zod4.z.object({});
|
|
336
|
-
var baseRolePermissionUpdateSchema = baseRolePermissionCreateSchema.partial();
|
|
337
|
-
function getRolePermissionLabel(locale) {
|
|
338
|
-
return rolePermissionI18n.label[locale] ?? rolePermissionI18n.label["en"] ?? "RolePermission";
|
|
339
|
-
}
|
|
340
|
-
function getRolePermissionFieldLabel(field, locale) {
|
|
341
|
-
const fieldI18n = rolePermissionI18n.fields[field];
|
|
342
|
-
if (!fieldI18n) return field;
|
|
343
|
-
return fieldI18n.label[locale] ?? fieldI18n.label["en"] ?? field;
|
|
344
|
-
}
|
|
345
|
-
function getRolePermissionFieldPlaceholder(field, locale) {
|
|
346
|
-
const fieldI18n = rolePermissionI18n.fields[field];
|
|
347
|
-
if (!fieldI18n || !("placeholder" in fieldI18n)) return "";
|
|
348
|
-
const placeholder = fieldI18n.placeholder;
|
|
349
|
-
return placeholder[locale] ?? placeholder["en"] ?? "";
|
|
350
|
-
}
|
|
101
|
+
var import_Role = require("@omnify-base/schemas/Role");
|
|
102
|
+
var roleSchemas = { ...import_Role.baseRoleSchemas };
|
|
103
|
+
var roleCreateSchema = import_Role.baseRoleCreateSchema;
|
|
104
|
+
var roleUpdateSchema = import_Role.baseRoleUpdateSchema;
|
|
351
105
|
|
|
352
106
|
// src/schemas/RolePermission.ts
|
|
353
|
-
var
|
|
354
|
-
var
|
|
355
|
-
var
|
|
356
|
-
|
|
357
|
-
// src/schemas/base/Team.ts
|
|
358
|
-
var import_zod5 = require("zod");
|
|
359
|
-
var teamI18n = {
|
|
360
|
-
/** Model display name */
|
|
361
|
-
label: { "en": "Team" },
|
|
362
|
-
/** Field labels and placeholders */
|
|
363
|
-
fields: {
|
|
364
|
-
console_team_id: {
|
|
365
|
-
label: { "en": "Console Team ID" }
|
|
366
|
-
},
|
|
367
|
-
console_org_id: {
|
|
368
|
-
label: { "en": "Console Organization ID" }
|
|
369
|
-
},
|
|
370
|
-
name: {
|
|
371
|
-
label: { "en": "Team Name" }
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
};
|
|
375
|
-
var baseTeamSchemas = {
|
|
376
|
-
console_team_id: import_zod5.z.number().int(),
|
|
377
|
-
console_org_id: import_zod5.z.number().int(),
|
|
378
|
-
name: import_zod5.z.string().min(1).max(100)
|
|
379
|
-
};
|
|
380
|
-
var baseTeamCreateSchema = import_zod5.z.object({
|
|
381
|
-
console_team_id: baseTeamSchemas.console_team_id,
|
|
382
|
-
console_org_id: baseTeamSchemas.console_org_id,
|
|
383
|
-
name: baseTeamSchemas.name
|
|
384
|
-
});
|
|
385
|
-
var baseTeamUpdateSchema = baseTeamCreateSchema.partial();
|
|
386
|
-
function getTeamLabel(locale) {
|
|
387
|
-
return teamI18n.label[locale] ?? teamI18n.label["en"] ?? "Team";
|
|
388
|
-
}
|
|
389
|
-
function getTeamFieldLabel(field, locale) {
|
|
390
|
-
const fieldI18n = teamI18n.fields[field];
|
|
391
|
-
if (!fieldI18n) return field;
|
|
392
|
-
return fieldI18n.label[locale] ?? fieldI18n.label["en"] ?? field;
|
|
393
|
-
}
|
|
394
|
-
function getTeamFieldPlaceholder(field, locale) {
|
|
395
|
-
const fieldI18n = teamI18n.fields[field];
|
|
396
|
-
if (!fieldI18n || !("placeholder" in fieldI18n)) return "";
|
|
397
|
-
const placeholder = fieldI18n.placeholder;
|
|
398
|
-
return placeholder[locale] ?? placeholder["en"] ?? "";
|
|
399
|
-
}
|
|
107
|
+
var import_RolePermission = require("@omnify-base/schemas/RolePermission");
|
|
108
|
+
var rolePermissionSchemas = { ...import_RolePermission.baseRolePermissionSchemas };
|
|
109
|
+
var rolePermissionCreateSchema = import_RolePermission.baseRolePermissionCreateSchema;
|
|
110
|
+
var rolePermissionUpdateSchema = import_RolePermission.baseRolePermissionUpdateSchema;
|
|
400
111
|
|
|
401
112
|
// src/schemas/Team.ts
|
|
402
|
-
var
|
|
403
|
-
var
|
|
404
|
-
var
|
|
405
|
-
|
|
406
|
-
// src/schemas/base/TeamPermission.ts
|
|
407
|
-
var import_zod6 = require("zod");
|
|
408
|
-
var teamPermissionI18n = {
|
|
409
|
-
/** Model display name */
|
|
410
|
-
label: { "en": "Team Permission" },
|
|
411
|
-
/** Field labels and placeholders */
|
|
412
|
-
fields: {
|
|
413
|
-
console_org_id: {
|
|
414
|
-
label: { "en": "Console Organization ID" }
|
|
415
|
-
},
|
|
416
|
-
console_team_id: {
|
|
417
|
-
label: { "en": "Console Team ID" }
|
|
418
|
-
},
|
|
419
|
-
permission: {
|
|
420
|
-
label: { "en": "Permission" }
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
};
|
|
424
|
-
var baseTeamPermissionSchemas = {
|
|
425
|
-
console_org_id: import_zod6.z.number().int(),
|
|
426
|
-
console_team_id: import_zod6.z.number().int()
|
|
427
|
-
};
|
|
428
|
-
var baseTeamPermissionCreateSchema = import_zod6.z.object({
|
|
429
|
-
console_org_id: baseTeamPermissionSchemas.console_org_id,
|
|
430
|
-
console_team_id: baseTeamPermissionSchemas.console_team_id
|
|
431
|
-
});
|
|
432
|
-
var baseTeamPermissionUpdateSchema = baseTeamPermissionCreateSchema.partial();
|
|
433
|
-
function getTeamPermissionLabel(locale) {
|
|
434
|
-
return teamPermissionI18n.label[locale] ?? teamPermissionI18n.label["en"] ?? "TeamPermission";
|
|
435
|
-
}
|
|
436
|
-
function getTeamPermissionFieldLabel(field, locale) {
|
|
437
|
-
const fieldI18n = teamPermissionI18n.fields[field];
|
|
438
|
-
if (!fieldI18n) return field;
|
|
439
|
-
return fieldI18n.label[locale] ?? fieldI18n.label["en"] ?? field;
|
|
440
|
-
}
|
|
441
|
-
function getTeamPermissionFieldPlaceholder(field, locale) {
|
|
442
|
-
const fieldI18n = teamPermissionI18n.fields[field];
|
|
443
|
-
if (!fieldI18n || !("placeholder" in fieldI18n)) return "";
|
|
444
|
-
const placeholder = fieldI18n.placeholder;
|
|
445
|
-
return placeholder[locale] ?? placeholder["en"] ?? "";
|
|
446
|
-
}
|
|
113
|
+
var import_Team = require("@omnify-base/schemas/Team");
|
|
114
|
+
var teamSchemas = { ...import_Team.baseTeamSchemas };
|
|
115
|
+
var teamCreateSchema = import_Team.baseTeamCreateSchema;
|
|
116
|
+
var teamUpdateSchema = import_Team.baseTeamUpdateSchema;
|
|
447
117
|
|
|
448
118
|
// src/schemas/TeamPermission.ts
|
|
449
|
-
var
|
|
450
|
-
var
|
|
451
|
-
var
|
|
119
|
+
var import_TeamPermission = require("@omnify-base/schemas/TeamPermission");
|
|
120
|
+
var teamPermissionSchemas = { ...import_TeamPermission.baseTeamPermissionSchemas };
|
|
121
|
+
var teamPermissionCreateSchema = import_TeamPermission.baseTeamPermissionCreateSchema;
|
|
122
|
+
var teamPermissionUpdateSchema = import_TeamPermission.baseTeamPermissionUpdateSchema;
|
|
452
123
|
// Annotate the CommonJS export names for ESM import in node:
|
|
453
124
|
0 && (module.exports = {
|
|
125
|
+
branchCreateSchema,
|
|
126
|
+
branchI18n,
|
|
127
|
+
branchSchemas,
|
|
128
|
+
branchUpdateSchema,
|
|
454
129
|
defaultLocale,
|
|
455
130
|
fallbackLocale,
|
|
131
|
+
getBranchFieldLabel,
|
|
132
|
+
getBranchFieldPlaceholder,
|
|
133
|
+
getBranchLabel,
|
|
456
134
|
getMessage,
|
|
457
135
|
getMessages,
|
|
458
136
|
getPermissionFieldLabel,
|