@m5kdev/commons 0.21.9 → 0.23.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/dist/src/modules/auth/auth.constants.cjs +2 -0
- package/dist/src/modules/auth/auth.constants.cjs.map +1 -1
- package/dist/src/modules/auth/auth.constants.d.cts +2 -1
- package/dist/src/modules/auth/auth.constants.d.mts +2 -1
- package/dist/src/modules/auth/auth.constants.mjs +2 -1
- package/dist/src/modules/auth/auth.constants.mjs.map +1 -1
- package/dist/src/modules/auth/auth.locale.cjs +73 -0
- package/dist/src/modules/auth/auth.locale.cjs.map +1 -0
- package/dist/src/modules/auth/auth.locale.d.cts +28 -0
- package/dist/src/modules/auth/auth.locale.d.mts +28 -0
- package/dist/src/modules/auth/auth.locale.mjs +66 -0
- package/dist/src/modules/auth/auth.locale.mjs.map +1 -0
- package/dist/src/modules/notification/notification.schema.d.cts +3 -3
- package/dist/src/modules/notification/notification.schema.d.mts +3 -3
- package/dist/src/modules/schemas/query.schema.d.cts +6 -6
- package/dist/src/modules/schemas/query.schema.d.mts +6 -6
- package/dist/src/modules/tag/tag.schema.d.cts +2 -2
- package/dist/src/modules/tag/tag.schema.d.mts +2 -2
- package/dist/src/modules/workflow/workflow.schema.d.cts +4 -4
- package/dist/src/modules/workflow/workflow.schema.d.mts +4 -4
- package/package.json +2 -2
|
@@ -2,8 +2,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
//#region src/modules/auth/auth.constants.ts
|
|
3
3
|
const ADMIN_CREATE_VERIFIED_USER_HEADER = "Admin-Create-Verified-User";
|
|
4
4
|
const ADMIN_CREATE_VERIFIED_USER_HEADER_VALUE = "true";
|
|
5
|
+
const USER_LOCALE_HEADER = "User-Locale";
|
|
5
6
|
//#endregion
|
|
6
7
|
exports.ADMIN_CREATE_VERIFIED_USER_HEADER = ADMIN_CREATE_VERIFIED_USER_HEADER;
|
|
7
8
|
exports.ADMIN_CREATE_VERIFIED_USER_HEADER_VALUE = ADMIN_CREATE_VERIFIED_USER_HEADER_VALUE;
|
|
9
|
+
exports.USER_LOCALE_HEADER = USER_LOCALE_HEADER;
|
|
8
10
|
|
|
9
11
|
//# sourceMappingURL=auth.constants.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.constants.cjs","names":[],"sources":["../../../../src/modules/auth/auth.constants.ts"],"sourcesContent":["export const ADMIN_CREATE_VERIFIED_USER_HEADER = \"Admin-Create-Verified-User\" as const;\r\nexport const ADMIN_CREATE_VERIFIED_USER_HEADER_VALUE = \"true\" as const;\r\n"],"mappings":";;AAAA,MAAa,oCAAoC;AACjD,MAAa,0CAA0C"}
|
|
1
|
+
{"version":3,"file":"auth.constants.cjs","names":[],"sources":["../../../../src/modules/auth/auth.constants.ts"],"sourcesContent":["export const ADMIN_CREATE_VERIFIED_USER_HEADER = \"Admin-Create-Verified-User\" as const;\r\nexport const ADMIN_CREATE_VERIFIED_USER_HEADER_VALUE = \"true\" as const;\r\nexport const USER_LOCALE_HEADER = \"User-Locale\" as const;\r\n"],"mappings":";;AAAA,MAAa,oCAAoC;AACjD,MAAa,0CAA0C;AACvD,MAAa,qBAAqB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
//#region src/modules/auth/auth.constants.d.ts
|
|
2
2
|
declare const ADMIN_CREATE_VERIFIED_USER_HEADER: "Admin-Create-Verified-User";
|
|
3
3
|
declare const ADMIN_CREATE_VERIFIED_USER_HEADER_VALUE: "true";
|
|
4
|
+
declare const USER_LOCALE_HEADER: "User-Locale";
|
|
4
5
|
//#endregion
|
|
5
|
-
export { ADMIN_CREATE_VERIFIED_USER_HEADER, ADMIN_CREATE_VERIFIED_USER_HEADER_VALUE };
|
|
6
|
+
export { ADMIN_CREATE_VERIFIED_USER_HEADER, ADMIN_CREATE_VERIFIED_USER_HEADER_VALUE, USER_LOCALE_HEADER };
|
|
6
7
|
//# sourceMappingURL=auth.constants.d.cts.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
//#region src/modules/auth/auth.constants.d.ts
|
|
2
2
|
declare const ADMIN_CREATE_VERIFIED_USER_HEADER: "Admin-Create-Verified-User";
|
|
3
3
|
declare const ADMIN_CREATE_VERIFIED_USER_HEADER_VALUE: "true";
|
|
4
|
+
declare const USER_LOCALE_HEADER: "User-Locale";
|
|
4
5
|
//#endregion
|
|
5
|
-
export { ADMIN_CREATE_VERIFIED_USER_HEADER, ADMIN_CREATE_VERIFIED_USER_HEADER_VALUE };
|
|
6
|
+
export { ADMIN_CREATE_VERIFIED_USER_HEADER, ADMIN_CREATE_VERIFIED_USER_HEADER_VALUE, USER_LOCALE_HEADER };
|
|
6
7
|
//# sourceMappingURL=auth.constants.d.mts.map
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
//#region src/modules/auth/auth.constants.ts
|
|
2
2
|
const ADMIN_CREATE_VERIFIED_USER_HEADER = "Admin-Create-Verified-User";
|
|
3
3
|
const ADMIN_CREATE_VERIFIED_USER_HEADER_VALUE = "true";
|
|
4
|
+
const USER_LOCALE_HEADER = "User-Locale";
|
|
4
5
|
//#endregion
|
|
5
|
-
export { ADMIN_CREATE_VERIFIED_USER_HEADER, ADMIN_CREATE_VERIFIED_USER_HEADER_VALUE };
|
|
6
|
+
export { ADMIN_CREATE_VERIFIED_USER_HEADER, ADMIN_CREATE_VERIFIED_USER_HEADER_VALUE, USER_LOCALE_HEADER };
|
|
6
7
|
|
|
7
8
|
//# sourceMappingURL=auth.constants.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.constants.mjs","names":[],"sources":["../../../../src/modules/auth/auth.constants.ts"],"sourcesContent":["export const ADMIN_CREATE_VERIFIED_USER_HEADER = \"Admin-Create-Verified-User\" as const;\r\nexport const ADMIN_CREATE_VERIFIED_USER_HEADER_VALUE = \"true\" as const;\r\n"],"mappings":";AAAA,MAAa,oCAAoC;AACjD,MAAa,0CAA0C"}
|
|
1
|
+
{"version":3,"file":"auth.constants.mjs","names":[],"sources":["../../../../src/modules/auth/auth.constants.ts"],"sourcesContent":["export const ADMIN_CREATE_VERIFIED_USER_HEADER = \"Admin-Create-Verified-User\" as const;\r\nexport const ADMIN_CREATE_VERIFIED_USER_HEADER_VALUE = \"true\" as const;\r\nexport const USER_LOCALE_HEADER = \"User-Locale\" as const;\r\n"],"mappings":";AAAA,MAAa,oCAAoC;AACjD,MAAa,0CAA0C;AACvD,MAAa,qBAAqB"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let zod = require("zod");
|
|
3
|
+
//#region src/modules/auth/auth.locale.ts
|
|
4
|
+
function getAllowedLocaleCodes(config) {
|
|
5
|
+
return config.locales.map((locale) => locale.code);
|
|
6
|
+
}
|
|
7
|
+
function getLocaleDisplayName(config, code) {
|
|
8
|
+
return config.locales.find((locale) => locale.code === code)?.displayName ?? code;
|
|
9
|
+
}
|
|
10
|
+
function normalizeLocaleTag(tag) {
|
|
11
|
+
const trimmed = tag.trim();
|
|
12
|
+
if (!trimmed) return null;
|
|
13
|
+
const parts = trimmed.replace(/_/g, "-").split("-").filter(Boolean);
|
|
14
|
+
if (parts.length === 0) return null;
|
|
15
|
+
const language = parts[0].toLowerCase();
|
|
16
|
+
const region = parts.length > 1 ? parts[1].toUpperCase() : null;
|
|
17
|
+
return {
|
|
18
|
+
language,
|
|
19
|
+
region,
|
|
20
|
+
compareKey: region ? `${language}_${region}` : language
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function buildCompareKeyFromCanonical(canonical) {
|
|
24
|
+
return normalizeLocaleTag(canonical)?.compareKey ?? canonical.toLowerCase();
|
|
25
|
+
}
|
|
26
|
+
function toCanonicalLocale(tag, allowedLocales) {
|
|
27
|
+
const normalized = normalizeLocaleTag(tag);
|
|
28
|
+
if (!normalized) return null;
|
|
29
|
+
const allowedByKey = /* @__PURE__ */ new Map();
|
|
30
|
+
for (const locale of allowedLocales) allowedByKey.set(buildCompareKeyFromCanonical(locale), locale);
|
|
31
|
+
if (normalized.region) {
|
|
32
|
+
const regionMatch = allowedByKey.get(`${normalized.language}_${normalized.region}`);
|
|
33
|
+
if (regionMatch) return regionMatch;
|
|
34
|
+
}
|
|
35
|
+
if (!normalized.region) {
|
|
36
|
+
const languageMatch = allowedByKey.get(normalized.language);
|
|
37
|
+
if (languageMatch) return languageMatch;
|
|
38
|
+
}
|
|
39
|
+
if (normalized.region) {
|
|
40
|
+
const languageMatch = allowedByKey.get(normalized.language);
|
|
41
|
+
if (languageMatch) return languageMatch;
|
|
42
|
+
}
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
function toI18nLanguageTag(canonical) {
|
|
46
|
+
const normalized = normalizeLocaleTag(canonical);
|
|
47
|
+
if (!normalized) return canonical;
|
|
48
|
+
if (normalized.region) return `${normalized.language}-${normalized.region}`;
|
|
49
|
+
return normalized.language;
|
|
50
|
+
}
|
|
51
|
+
function resolveAppLocale(requested, config) {
|
|
52
|
+
const allowedLocales = getAllowedLocaleCodes(config);
|
|
53
|
+
if (requested) {
|
|
54
|
+
const canonical = toCanonicalLocale(requested, allowedLocales);
|
|
55
|
+
if (canonical) return canonical;
|
|
56
|
+
}
|
|
57
|
+
return toCanonicalLocale(config.defaultLocale, allowedLocales) ?? allowedLocales[0] ?? config.defaultLocale;
|
|
58
|
+
}
|
|
59
|
+
function createLocaleValueSchema(config) {
|
|
60
|
+
const allowed = [...getAllowedLocaleCodes(config)];
|
|
61
|
+
if (allowed.length === 0) return zod.z.string();
|
|
62
|
+
return zod.z.enum(allowed);
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
exports.createLocaleValueSchema = createLocaleValueSchema;
|
|
66
|
+
exports.getAllowedLocaleCodes = getAllowedLocaleCodes;
|
|
67
|
+
exports.getLocaleDisplayName = getLocaleDisplayName;
|
|
68
|
+
exports.normalizeLocaleTag = normalizeLocaleTag;
|
|
69
|
+
exports.resolveAppLocale = resolveAppLocale;
|
|
70
|
+
exports.toCanonicalLocale = toCanonicalLocale;
|
|
71
|
+
exports.toI18nLanguageTag = toI18nLanguageTag;
|
|
72
|
+
|
|
73
|
+
//# sourceMappingURL=auth.locale.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.locale.cjs","names":["z"],"sources":["../../../../src/modules/auth/auth.locale.ts"],"sourcesContent":["import { z } from \"zod\";\r\n\r\nexport interface AuthLocaleDefinition {\r\n code: string;\r\n displayName: string;\r\n}\r\n\r\nexport interface AuthLocaleConfig {\r\n defaultLocale: string;\r\n locales: readonly AuthLocaleDefinition[];\r\n}\r\n\r\nexport function getAllowedLocaleCodes(config: AuthLocaleConfig): readonly string[] {\r\n return config.locales.map((locale) => locale.code);\r\n}\r\n\r\nexport function getLocaleDisplayName(config: AuthLocaleConfig, code: string): string {\r\n return config.locales.find((locale) => locale.code === code)?.displayName ?? code;\r\n}\r\n\r\nexport interface NormalizedLocaleTag {\r\n language: string;\r\n region: string | null;\r\n compareKey: string;\r\n}\r\n\r\nexport function normalizeLocaleTag(tag: string): NormalizedLocaleTag | null {\r\n const trimmed = tag.trim();\r\n if (!trimmed) return null;\r\n\r\n const parts = trimmed.replace(/_/g, \"-\").split(\"-\").filter(Boolean);\r\n if (parts.length === 0) return null;\r\n\r\n const language = parts[0].toLowerCase();\r\n const region = parts.length > 1 ? parts[1].toUpperCase() : null;\r\n const compareKey = region ? `${language}_${region}` : language;\r\n\r\n return { language, region, compareKey };\r\n}\r\n\r\nfunction buildCompareKeyFromCanonical(canonical: string): string {\r\n return normalizeLocaleTag(canonical)?.compareKey ?? canonical.toLowerCase();\r\n}\r\n\r\nexport function toCanonicalLocale(\r\n tag: string,\r\n allowedLocales: readonly string[]\r\n): string | null {\r\n const normalized = normalizeLocaleTag(tag);\r\n if (!normalized) return null;\r\n\r\n const allowedByKey = new Map<string, string>();\r\n for (const locale of allowedLocales) {\r\n allowedByKey.set(buildCompareKeyFromCanonical(locale), locale);\r\n }\r\n\r\n if (normalized.region) {\r\n const regionMatch = allowedByKey.get(`${normalized.language}_${normalized.region}`);\r\n if (regionMatch) return regionMatch;\r\n }\r\n\r\n if (!normalized.region) {\r\n const languageMatch = allowedByKey.get(normalized.language);\r\n if (languageMatch) return languageMatch;\r\n }\r\n\r\n if (normalized.region) {\r\n const languageMatch = allowedByKey.get(normalized.language);\r\n if (languageMatch) return languageMatch;\r\n }\r\n\r\n return null;\r\n}\r\n\r\nexport function toI18nLanguageTag(canonical: string): string {\r\n const normalized = normalizeLocaleTag(canonical);\r\n if (!normalized) return canonical;\r\n if (normalized.region) {\r\n return `${normalized.language}-${normalized.region}`;\r\n }\r\n return normalized.language;\r\n}\r\n\r\nexport function resolveAppLocale(\r\n requested: string | null | undefined,\r\n config: AuthLocaleConfig\r\n): string {\r\n const allowedLocales = getAllowedLocaleCodes(config);\r\n if (requested) {\r\n const canonical = toCanonicalLocale(requested, allowedLocales);\r\n if (canonical) return canonical;\r\n }\r\n\r\n const defaultCanonical = toCanonicalLocale(config.defaultLocale, allowedLocales);\r\n return defaultCanonical ?? allowedLocales[0] ?? config.defaultLocale;\r\n}\r\n\r\nexport function createLocaleValueSchema(config: AuthLocaleConfig) {\r\n const allowed = [...getAllowedLocaleCodes(config)];\r\n if (allowed.length === 0) {\r\n return z.string();\r\n }\r\n return z.enum(allowed as [string, ...string[]]);\r\n}\r\n"],"mappings":";;;AAYA,SAAgB,sBAAsB,QAA6C;AACjF,QAAO,OAAO,QAAQ,KAAK,WAAW,OAAO,KAAK;;AAGpD,SAAgB,qBAAqB,QAA0B,MAAsB;AACnF,QAAO,OAAO,QAAQ,MAAM,WAAW,OAAO,SAAS,KAAK,EAAE,eAAe;;AAS/E,SAAgB,mBAAmB,KAAyC;CAC1E,MAAM,UAAU,IAAI,MAAM;AAC1B,KAAI,CAAC,QAAS,QAAO;CAErB,MAAM,QAAQ,QAAQ,QAAQ,MAAM,IAAI,CAAC,MAAM,IAAI,CAAC,OAAO,QAAQ;AACnE,KAAI,MAAM,WAAW,EAAG,QAAO;CAE/B,MAAM,WAAW,MAAM,GAAG,aAAa;CACvC,MAAM,SAAS,MAAM,SAAS,IAAI,MAAM,GAAG,aAAa,GAAG;AAG3D,QAAO;EAAE;EAAU;EAAQ,YAFR,SAAS,GAAG,SAAS,GAAG,WAAW;EAEf;;AAGzC,SAAS,6BAA6B,WAA2B;AAC/D,QAAO,mBAAmB,UAAU,EAAE,cAAc,UAAU,aAAa;;AAG7E,SAAgB,kBACd,KACA,gBACe;CACf,MAAM,aAAa,mBAAmB,IAAI;AAC1C,KAAI,CAAC,WAAY,QAAO;CAExB,MAAM,+BAAe,IAAI,KAAqB;AAC9C,MAAK,MAAM,UAAU,eACnB,cAAa,IAAI,6BAA6B,OAAO,EAAE,OAAO;AAGhE,KAAI,WAAW,QAAQ;EACrB,MAAM,cAAc,aAAa,IAAI,GAAG,WAAW,SAAS,GAAG,WAAW,SAAS;AACnF,MAAI,YAAa,QAAO;;AAG1B,KAAI,CAAC,WAAW,QAAQ;EACtB,MAAM,gBAAgB,aAAa,IAAI,WAAW,SAAS;AAC3D,MAAI,cAAe,QAAO;;AAG5B,KAAI,WAAW,QAAQ;EACrB,MAAM,gBAAgB,aAAa,IAAI,WAAW,SAAS;AAC3D,MAAI,cAAe,QAAO;;AAG5B,QAAO;;AAGT,SAAgB,kBAAkB,WAA2B;CAC3D,MAAM,aAAa,mBAAmB,UAAU;AAChD,KAAI,CAAC,WAAY,QAAO;AACxB,KAAI,WAAW,OACb,QAAO,GAAG,WAAW,SAAS,GAAG,WAAW;AAE9C,QAAO,WAAW;;AAGpB,SAAgB,iBACd,WACA,QACQ;CACR,MAAM,iBAAiB,sBAAsB,OAAO;AACpD,KAAI,WAAW;EACb,MAAM,YAAY,kBAAkB,WAAW,eAAe;AAC9D,MAAI,UAAW,QAAO;;AAIxB,QADyB,kBAAkB,OAAO,eAAe,eAAe,IACrD,eAAe,MAAM,OAAO;;AAGzD,SAAgB,wBAAwB,QAA0B;CAChE,MAAM,UAAU,CAAC,GAAG,sBAAsB,OAAO,CAAC;AAClD,KAAI,QAAQ,WAAW,EACrB,QAAOA,IAAAA,EAAE,QAAQ;AAEnB,QAAOA,IAAAA,EAAE,KAAK,QAAiC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/modules/auth/auth.locale.d.ts
|
|
4
|
+
interface AuthLocaleDefinition {
|
|
5
|
+
code: string;
|
|
6
|
+
displayName: string;
|
|
7
|
+
}
|
|
8
|
+
interface AuthLocaleConfig {
|
|
9
|
+
defaultLocale: string;
|
|
10
|
+
locales: readonly AuthLocaleDefinition[];
|
|
11
|
+
}
|
|
12
|
+
declare function getAllowedLocaleCodes(config: AuthLocaleConfig): readonly string[];
|
|
13
|
+
declare function getLocaleDisplayName(config: AuthLocaleConfig, code: string): string;
|
|
14
|
+
interface NormalizedLocaleTag {
|
|
15
|
+
language: string;
|
|
16
|
+
region: string | null;
|
|
17
|
+
compareKey: string;
|
|
18
|
+
}
|
|
19
|
+
declare function normalizeLocaleTag(tag: string): NormalizedLocaleTag | null;
|
|
20
|
+
declare function toCanonicalLocale(tag: string, allowedLocales: readonly string[]): string | null;
|
|
21
|
+
declare function toI18nLanguageTag(canonical: string): string;
|
|
22
|
+
declare function resolveAppLocale(requested: string | null | undefined, config: AuthLocaleConfig): string;
|
|
23
|
+
declare function createLocaleValueSchema(config: AuthLocaleConfig): z.ZodString | z.ZodEnum<{
|
|
24
|
+
[x: string]: string;
|
|
25
|
+
}>;
|
|
26
|
+
//#endregion
|
|
27
|
+
export { AuthLocaleConfig, AuthLocaleDefinition, NormalizedLocaleTag, createLocaleValueSchema, getAllowedLocaleCodes, getLocaleDisplayName, normalizeLocaleTag, resolveAppLocale, toCanonicalLocale, toI18nLanguageTag };
|
|
28
|
+
//# sourceMappingURL=auth.locale.d.cts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/modules/auth/auth.locale.d.ts
|
|
4
|
+
interface AuthLocaleDefinition {
|
|
5
|
+
code: string;
|
|
6
|
+
displayName: string;
|
|
7
|
+
}
|
|
8
|
+
interface AuthLocaleConfig {
|
|
9
|
+
defaultLocale: string;
|
|
10
|
+
locales: readonly AuthLocaleDefinition[];
|
|
11
|
+
}
|
|
12
|
+
declare function getAllowedLocaleCodes(config: AuthLocaleConfig): readonly string[];
|
|
13
|
+
declare function getLocaleDisplayName(config: AuthLocaleConfig, code: string): string;
|
|
14
|
+
interface NormalizedLocaleTag {
|
|
15
|
+
language: string;
|
|
16
|
+
region: string | null;
|
|
17
|
+
compareKey: string;
|
|
18
|
+
}
|
|
19
|
+
declare function normalizeLocaleTag(tag: string): NormalizedLocaleTag | null;
|
|
20
|
+
declare function toCanonicalLocale(tag: string, allowedLocales: readonly string[]): string | null;
|
|
21
|
+
declare function toI18nLanguageTag(canonical: string): string;
|
|
22
|
+
declare function resolveAppLocale(requested: string | null | undefined, config: AuthLocaleConfig): string;
|
|
23
|
+
declare function createLocaleValueSchema(config: AuthLocaleConfig): z.ZodString | z.ZodEnum<{
|
|
24
|
+
[x: string]: string;
|
|
25
|
+
}>;
|
|
26
|
+
//#endregion
|
|
27
|
+
export { AuthLocaleConfig, AuthLocaleDefinition, NormalizedLocaleTag, createLocaleValueSchema, getAllowedLocaleCodes, getLocaleDisplayName, normalizeLocaleTag, resolveAppLocale, toCanonicalLocale, toI18nLanguageTag };
|
|
28
|
+
//# sourceMappingURL=auth.locale.d.mts.map
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/modules/auth/auth.locale.ts
|
|
3
|
+
function getAllowedLocaleCodes(config) {
|
|
4
|
+
return config.locales.map((locale) => locale.code);
|
|
5
|
+
}
|
|
6
|
+
function getLocaleDisplayName(config, code) {
|
|
7
|
+
return config.locales.find((locale) => locale.code === code)?.displayName ?? code;
|
|
8
|
+
}
|
|
9
|
+
function normalizeLocaleTag(tag) {
|
|
10
|
+
const trimmed = tag.trim();
|
|
11
|
+
if (!trimmed) return null;
|
|
12
|
+
const parts = trimmed.replace(/_/g, "-").split("-").filter(Boolean);
|
|
13
|
+
if (parts.length === 0) return null;
|
|
14
|
+
const language = parts[0].toLowerCase();
|
|
15
|
+
const region = parts.length > 1 ? parts[1].toUpperCase() : null;
|
|
16
|
+
return {
|
|
17
|
+
language,
|
|
18
|
+
region,
|
|
19
|
+
compareKey: region ? `${language}_${region}` : language
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function buildCompareKeyFromCanonical(canonical) {
|
|
23
|
+
return normalizeLocaleTag(canonical)?.compareKey ?? canonical.toLowerCase();
|
|
24
|
+
}
|
|
25
|
+
function toCanonicalLocale(tag, allowedLocales) {
|
|
26
|
+
const normalized = normalizeLocaleTag(tag);
|
|
27
|
+
if (!normalized) return null;
|
|
28
|
+
const allowedByKey = /* @__PURE__ */ new Map();
|
|
29
|
+
for (const locale of allowedLocales) allowedByKey.set(buildCompareKeyFromCanonical(locale), locale);
|
|
30
|
+
if (normalized.region) {
|
|
31
|
+
const regionMatch = allowedByKey.get(`${normalized.language}_${normalized.region}`);
|
|
32
|
+
if (regionMatch) return regionMatch;
|
|
33
|
+
}
|
|
34
|
+
if (!normalized.region) {
|
|
35
|
+
const languageMatch = allowedByKey.get(normalized.language);
|
|
36
|
+
if (languageMatch) return languageMatch;
|
|
37
|
+
}
|
|
38
|
+
if (normalized.region) {
|
|
39
|
+
const languageMatch = allowedByKey.get(normalized.language);
|
|
40
|
+
if (languageMatch) return languageMatch;
|
|
41
|
+
}
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
function toI18nLanguageTag(canonical) {
|
|
45
|
+
const normalized = normalizeLocaleTag(canonical);
|
|
46
|
+
if (!normalized) return canonical;
|
|
47
|
+
if (normalized.region) return `${normalized.language}-${normalized.region}`;
|
|
48
|
+
return normalized.language;
|
|
49
|
+
}
|
|
50
|
+
function resolveAppLocale(requested, config) {
|
|
51
|
+
const allowedLocales = getAllowedLocaleCodes(config);
|
|
52
|
+
if (requested) {
|
|
53
|
+
const canonical = toCanonicalLocale(requested, allowedLocales);
|
|
54
|
+
if (canonical) return canonical;
|
|
55
|
+
}
|
|
56
|
+
return toCanonicalLocale(config.defaultLocale, allowedLocales) ?? allowedLocales[0] ?? config.defaultLocale;
|
|
57
|
+
}
|
|
58
|
+
function createLocaleValueSchema(config) {
|
|
59
|
+
const allowed = [...getAllowedLocaleCodes(config)];
|
|
60
|
+
if (allowed.length === 0) return z.string();
|
|
61
|
+
return z.enum(allowed);
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
64
|
+
export { createLocaleValueSchema, getAllowedLocaleCodes, getLocaleDisplayName, normalizeLocaleTag, resolveAppLocale, toCanonicalLocale, toI18nLanguageTag };
|
|
65
|
+
|
|
66
|
+
//# sourceMappingURL=auth.locale.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.locale.mjs","names":[],"sources":["../../../../src/modules/auth/auth.locale.ts"],"sourcesContent":["import { z } from \"zod\";\r\n\r\nexport interface AuthLocaleDefinition {\r\n code: string;\r\n displayName: string;\r\n}\r\n\r\nexport interface AuthLocaleConfig {\r\n defaultLocale: string;\r\n locales: readonly AuthLocaleDefinition[];\r\n}\r\n\r\nexport function getAllowedLocaleCodes(config: AuthLocaleConfig): readonly string[] {\r\n return config.locales.map((locale) => locale.code);\r\n}\r\n\r\nexport function getLocaleDisplayName(config: AuthLocaleConfig, code: string): string {\r\n return config.locales.find((locale) => locale.code === code)?.displayName ?? code;\r\n}\r\n\r\nexport interface NormalizedLocaleTag {\r\n language: string;\r\n region: string | null;\r\n compareKey: string;\r\n}\r\n\r\nexport function normalizeLocaleTag(tag: string): NormalizedLocaleTag | null {\r\n const trimmed = tag.trim();\r\n if (!trimmed) return null;\r\n\r\n const parts = trimmed.replace(/_/g, \"-\").split(\"-\").filter(Boolean);\r\n if (parts.length === 0) return null;\r\n\r\n const language = parts[0].toLowerCase();\r\n const region = parts.length > 1 ? parts[1].toUpperCase() : null;\r\n const compareKey = region ? `${language}_${region}` : language;\r\n\r\n return { language, region, compareKey };\r\n}\r\n\r\nfunction buildCompareKeyFromCanonical(canonical: string): string {\r\n return normalizeLocaleTag(canonical)?.compareKey ?? canonical.toLowerCase();\r\n}\r\n\r\nexport function toCanonicalLocale(\r\n tag: string,\r\n allowedLocales: readonly string[]\r\n): string | null {\r\n const normalized = normalizeLocaleTag(tag);\r\n if (!normalized) return null;\r\n\r\n const allowedByKey = new Map<string, string>();\r\n for (const locale of allowedLocales) {\r\n allowedByKey.set(buildCompareKeyFromCanonical(locale), locale);\r\n }\r\n\r\n if (normalized.region) {\r\n const regionMatch = allowedByKey.get(`${normalized.language}_${normalized.region}`);\r\n if (regionMatch) return regionMatch;\r\n }\r\n\r\n if (!normalized.region) {\r\n const languageMatch = allowedByKey.get(normalized.language);\r\n if (languageMatch) return languageMatch;\r\n }\r\n\r\n if (normalized.region) {\r\n const languageMatch = allowedByKey.get(normalized.language);\r\n if (languageMatch) return languageMatch;\r\n }\r\n\r\n return null;\r\n}\r\n\r\nexport function toI18nLanguageTag(canonical: string): string {\r\n const normalized = normalizeLocaleTag(canonical);\r\n if (!normalized) return canonical;\r\n if (normalized.region) {\r\n return `${normalized.language}-${normalized.region}`;\r\n }\r\n return normalized.language;\r\n}\r\n\r\nexport function resolveAppLocale(\r\n requested: string | null | undefined,\r\n config: AuthLocaleConfig\r\n): string {\r\n const allowedLocales = getAllowedLocaleCodes(config);\r\n if (requested) {\r\n const canonical = toCanonicalLocale(requested, allowedLocales);\r\n if (canonical) return canonical;\r\n }\r\n\r\n const defaultCanonical = toCanonicalLocale(config.defaultLocale, allowedLocales);\r\n return defaultCanonical ?? allowedLocales[0] ?? config.defaultLocale;\r\n}\r\n\r\nexport function createLocaleValueSchema(config: AuthLocaleConfig) {\r\n const allowed = [...getAllowedLocaleCodes(config)];\r\n if (allowed.length === 0) {\r\n return z.string();\r\n }\r\n return z.enum(allowed as [string, ...string[]]);\r\n}\r\n"],"mappings":";;AAYA,SAAgB,sBAAsB,QAA6C;AACjF,QAAO,OAAO,QAAQ,KAAK,WAAW,OAAO,KAAK;;AAGpD,SAAgB,qBAAqB,QAA0B,MAAsB;AACnF,QAAO,OAAO,QAAQ,MAAM,WAAW,OAAO,SAAS,KAAK,EAAE,eAAe;;AAS/E,SAAgB,mBAAmB,KAAyC;CAC1E,MAAM,UAAU,IAAI,MAAM;AAC1B,KAAI,CAAC,QAAS,QAAO;CAErB,MAAM,QAAQ,QAAQ,QAAQ,MAAM,IAAI,CAAC,MAAM,IAAI,CAAC,OAAO,QAAQ;AACnE,KAAI,MAAM,WAAW,EAAG,QAAO;CAE/B,MAAM,WAAW,MAAM,GAAG,aAAa;CACvC,MAAM,SAAS,MAAM,SAAS,IAAI,MAAM,GAAG,aAAa,GAAG;AAG3D,QAAO;EAAE;EAAU;EAAQ,YAFR,SAAS,GAAG,SAAS,GAAG,WAAW;EAEf;;AAGzC,SAAS,6BAA6B,WAA2B;AAC/D,QAAO,mBAAmB,UAAU,EAAE,cAAc,UAAU,aAAa;;AAG7E,SAAgB,kBACd,KACA,gBACe;CACf,MAAM,aAAa,mBAAmB,IAAI;AAC1C,KAAI,CAAC,WAAY,QAAO;CAExB,MAAM,+BAAe,IAAI,KAAqB;AAC9C,MAAK,MAAM,UAAU,eACnB,cAAa,IAAI,6BAA6B,OAAO,EAAE,OAAO;AAGhE,KAAI,WAAW,QAAQ;EACrB,MAAM,cAAc,aAAa,IAAI,GAAG,WAAW,SAAS,GAAG,WAAW,SAAS;AACnF,MAAI,YAAa,QAAO;;AAG1B,KAAI,CAAC,WAAW,QAAQ;EACtB,MAAM,gBAAgB,aAAa,IAAI,WAAW,SAAS;AAC3D,MAAI,cAAe,QAAO;;AAG5B,KAAI,WAAW,QAAQ;EACrB,MAAM,gBAAgB,aAAa,IAAI,WAAW,SAAS;AAC3D,MAAI,cAAe,QAAO;;AAG5B,QAAO;;AAGT,SAAgB,kBAAkB,WAA2B;CAC3D,MAAM,aAAa,mBAAmB,UAAU;AAChD,KAAI,CAAC,WAAY,QAAO;AACxB,KAAI,WAAW,OACb,QAAO,GAAG,WAAW,SAAS,GAAG,WAAW;AAE9C,QAAO,WAAW;;AAGpB,SAAgB,iBACd,WACA,QACQ;CACR,MAAM,iBAAiB,sBAAsB,OAAO;AACpD,KAAI,WAAW;EACb,MAAM,YAAY,kBAAkB,WAAW,eAAe;AAC9D,MAAI,UAAW,QAAO;;AAIxB,QADyB,kBAAkB,OAAO,eAAe,eAAe,IACrD,eAAe,MAAM,OAAO;;AAGzD,SAAgB,wBAAwB,QAA0B;CAChE,MAAM,UAAU,CAAC,GAAG,sBAAsB,OAAO,CAAC;AAClD,KAAI,QAAQ,WAAW,EACrB,QAAO,EAAE,QAAQ;AAEnB,QAAO,EAAE,KAAK,QAAiC"}
|
|
@@ -12,9 +12,9 @@ declare const notificationProviderSchema: z.ZodEnum<{
|
|
|
12
12
|
fcm: "fcm";
|
|
13
13
|
}>;
|
|
14
14
|
declare const notificationSendStatusSchema: z.ZodEnum<{
|
|
15
|
+
failed: "failed";
|
|
15
16
|
pending: "pending";
|
|
16
17
|
sent: "sent";
|
|
17
|
-
failed: "failed";
|
|
18
18
|
}>;
|
|
19
19
|
/** Web Push `PushSubscriptionJSON` subset we persist and accept from clients. */
|
|
20
20
|
declare const pushSubscriptionJsonSchema: z.ZodObject<{
|
|
@@ -100,9 +100,9 @@ declare const notificationSendLogSelectSchema: z.ZodObject<{
|
|
|
100
100
|
body: z.ZodString;
|
|
101
101
|
data: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
102
102
|
status: z.ZodEnum<{
|
|
103
|
+
failed: "failed";
|
|
103
104
|
pending: "pending";
|
|
104
105
|
sent: "sent";
|
|
105
|
-
failed: "failed";
|
|
106
106
|
}>;
|
|
107
107
|
error: z.ZodNullable<z.ZodString>;
|
|
108
108
|
jobId: z.ZodNullable<z.ZodString>;
|
|
@@ -127,9 +127,9 @@ declare const notificationListSendLogsOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
127
127
|
body: z.ZodString;
|
|
128
128
|
data: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
129
129
|
status: z.ZodEnum<{
|
|
130
|
+
failed: "failed";
|
|
130
131
|
pending: "pending";
|
|
131
132
|
sent: "sent";
|
|
132
|
-
failed: "failed";
|
|
133
133
|
}>;
|
|
134
134
|
error: z.ZodNullable<z.ZodString>;
|
|
135
135
|
jobId: z.ZodNullable<z.ZodString>;
|
|
@@ -12,9 +12,9 @@ declare const notificationProviderSchema: z.ZodEnum<{
|
|
|
12
12
|
fcm: "fcm";
|
|
13
13
|
}>;
|
|
14
14
|
declare const notificationSendStatusSchema: z.ZodEnum<{
|
|
15
|
+
failed: "failed";
|
|
15
16
|
pending: "pending";
|
|
16
17
|
sent: "sent";
|
|
17
|
-
failed: "failed";
|
|
18
18
|
}>;
|
|
19
19
|
/** Web Push `PushSubscriptionJSON` subset we persist and accept from clients. */
|
|
20
20
|
declare const pushSubscriptionJsonSchema: z.ZodObject<{
|
|
@@ -100,9 +100,9 @@ declare const notificationSendLogSelectSchema: z.ZodObject<{
|
|
|
100
100
|
body: z.ZodString;
|
|
101
101
|
data: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
102
102
|
status: z.ZodEnum<{
|
|
103
|
+
failed: "failed";
|
|
103
104
|
pending: "pending";
|
|
104
105
|
sent: "sent";
|
|
105
|
-
failed: "failed";
|
|
106
106
|
}>;
|
|
107
107
|
error: z.ZodNullable<z.ZodString>;
|
|
108
108
|
jobId: z.ZodNullable<z.ZodString>;
|
|
@@ -127,9 +127,9 @@ declare const notificationListSendLogsOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
127
127
|
body: z.ZodString;
|
|
128
128
|
data: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
129
129
|
status: z.ZodEnum<{
|
|
130
|
+
failed: "failed";
|
|
130
131
|
pending: "pending";
|
|
131
132
|
sent: "sent";
|
|
132
|
-
failed: "failed";
|
|
133
133
|
}>;
|
|
134
134
|
error: z.ZodNullable<z.ZodString>;
|
|
135
135
|
jobId: z.ZodNullable<z.ZodString>;
|
|
@@ -12,10 +12,10 @@ declare const filterSchema: z.ZodObject<{
|
|
|
12
12
|
jsonArray: "jsonArray";
|
|
13
13
|
}>;
|
|
14
14
|
method: z.ZodEnum<{
|
|
15
|
-
contains: "contains";
|
|
16
|
-
equals: "equals";
|
|
17
15
|
starts_with: "starts_with";
|
|
18
16
|
ends_with: "ends_with";
|
|
17
|
+
contains: "contains";
|
|
18
|
+
equals: "equals";
|
|
19
19
|
greater_than: "greater_than";
|
|
20
20
|
less_than: "less_than";
|
|
21
21
|
on: "on";
|
|
@@ -44,10 +44,10 @@ declare const filtersSchema: z.ZodArray<z.ZodObject<{
|
|
|
44
44
|
jsonArray: "jsonArray";
|
|
45
45
|
}>;
|
|
46
46
|
method: z.ZodEnum<{
|
|
47
|
-
contains: "contains";
|
|
48
|
-
equals: "equals";
|
|
49
47
|
starts_with: "starts_with";
|
|
50
48
|
ends_with: "ends_with";
|
|
49
|
+
contains: "contains";
|
|
50
|
+
equals: "equals";
|
|
51
51
|
greater_than: "greater_than";
|
|
52
52
|
less_than: "less_than";
|
|
53
53
|
on: "on";
|
|
@@ -84,10 +84,10 @@ declare const querySchema: z.ZodObject<{
|
|
|
84
84
|
jsonArray: "jsonArray";
|
|
85
85
|
}>;
|
|
86
86
|
method: z.ZodEnum<{
|
|
87
|
-
contains: "contains";
|
|
88
|
-
equals: "equals";
|
|
89
87
|
starts_with: "starts_with";
|
|
90
88
|
ends_with: "ends_with";
|
|
89
|
+
contains: "contains";
|
|
90
|
+
equals: "equals";
|
|
91
91
|
greater_than: "greater_than";
|
|
92
92
|
less_than: "less_than";
|
|
93
93
|
on: "on";
|
|
@@ -12,10 +12,10 @@ declare const filterSchema: z.ZodObject<{
|
|
|
12
12
|
jsonArray: "jsonArray";
|
|
13
13
|
}>;
|
|
14
14
|
method: z.ZodEnum<{
|
|
15
|
-
contains: "contains";
|
|
16
|
-
equals: "equals";
|
|
17
15
|
starts_with: "starts_with";
|
|
18
16
|
ends_with: "ends_with";
|
|
17
|
+
contains: "contains";
|
|
18
|
+
equals: "equals";
|
|
19
19
|
greater_than: "greater_than";
|
|
20
20
|
less_than: "less_than";
|
|
21
21
|
on: "on";
|
|
@@ -44,10 +44,10 @@ declare const filtersSchema: z.ZodArray<z.ZodObject<{
|
|
|
44
44
|
jsonArray: "jsonArray";
|
|
45
45
|
}>;
|
|
46
46
|
method: z.ZodEnum<{
|
|
47
|
-
contains: "contains";
|
|
48
|
-
equals: "equals";
|
|
49
47
|
starts_with: "starts_with";
|
|
50
48
|
ends_with: "ends_with";
|
|
49
|
+
contains: "contains";
|
|
50
|
+
equals: "equals";
|
|
51
51
|
greater_than: "greater_than";
|
|
52
52
|
less_than: "less_than";
|
|
53
53
|
on: "on";
|
|
@@ -84,10 +84,10 @@ declare const querySchema: z.ZodObject<{
|
|
|
84
84
|
jsonArray: "jsonArray";
|
|
85
85
|
}>;
|
|
86
86
|
method: z.ZodEnum<{
|
|
87
|
-
contains: "contains";
|
|
88
|
-
equals: "equals";
|
|
89
87
|
starts_with: "starts_with";
|
|
90
88
|
ends_with: "ends_with";
|
|
89
|
+
contains: "contains";
|
|
90
|
+
equals: "equals";
|
|
91
91
|
greater_than: "greater_than";
|
|
92
92
|
less_than: "less_than";
|
|
93
93
|
on: "on";
|
|
@@ -42,10 +42,10 @@ declare const tagListInputSchema: z.ZodObject<{
|
|
|
42
42
|
jsonArray: "jsonArray";
|
|
43
43
|
}>;
|
|
44
44
|
method: z.ZodEnum<{
|
|
45
|
-
contains: "contains";
|
|
46
|
-
equals: "equals";
|
|
47
45
|
starts_with: "starts_with";
|
|
48
46
|
ends_with: "ends_with";
|
|
47
|
+
contains: "contains";
|
|
48
|
+
equals: "equals";
|
|
49
49
|
greater_than: "greater_than";
|
|
50
50
|
less_than: "less_than";
|
|
51
51
|
on: "on";
|
|
@@ -42,10 +42,10 @@ declare const tagListInputSchema: z.ZodObject<{
|
|
|
42
42
|
jsonArray: "jsonArray";
|
|
43
43
|
}>;
|
|
44
44
|
method: z.ZodEnum<{
|
|
45
|
-
contains: "contains";
|
|
46
|
-
equals: "equals";
|
|
47
45
|
starts_with: "starts_with";
|
|
48
46
|
ends_with: "ends_with";
|
|
47
|
+
contains: "contains";
|
|
48
|
+
equals: "equals";
|
|
49
49
|
greater_than: "greater_than";
|
|
50
50
|
less_than: "less_than";
|
|
51
51
|
on: "on";
|
|
@@ -11,10 +11,10 @@ declare const workflowSelectSchema: z.ZodObject<{
|
|
|
11
11
|
input: z.ZodUnknown;
|
|
12
12
|
output: z.ZodUnknown;
|
|
13
13
|
status: z.ZodEnum<{
|
|
14
|
-
failed: "failed";
|
|
15
14
|
queued: "queued";
|
|
16
15
|
running: "running";
|
|
17
16
|
completed: "completed";
|
|
17
|
+
failed: "failed";
|
|
18
18
|
}>;
|
|
19
19
|
error: z.ZodNullable<z.ZodString>;
|
|
20
20
|
retries: z.ZodNumber;
|
|
@@ -28,10 +28,10 @@ declare const workflowReadInputSchema: z.ZodObject<{
|
|
|
28
28
|
}, z.core.$strip>;
|
|
29
29
|
declare const workflowListInputSchema: z.ZodObject<{
|
|
30
30
|
status: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
31
|
-
failed: "failed";
|
|
32
31
|
queued: "queued";
|
|
33
32
|
running: "running";
|
|
34
33
|
completed: "completed";
|
|
34
|
+
failed: "failed";
|
|
35
35
|
}>>>;
|
|
36
36
|
jobName: z.ZodOptional<z.ZodString>;
|
|
37
37
|
}, z.core.$strip>;
|
|
@@ -51,10 +51,10 @@ declare const workflowReadOutputSchema: z.ZodObject<{
|
|
|
51
51
|
input: z.ZodUnknown;
|
|
52
52
|
output: z.ZodUnknown;
|
|
53
53
|
status: z.ZodEnum<{
|
|
54
|
-
failed: "failed";
|
|
55
54
|
queued: "queued";
|
|
56
55
|
running: "running";
|
|
57
56
|
completed: "completed";
|
|
57
|
+
failed: "failed";
|
|
58
58
|
}>;
|
|
59
59
|
error: z.ZodNullable<z.ZodString>;
|
|
60
60
|
retries: z.ZodNumber;
|
|
@@ -73,10 +73,10 @@ declare const workflowListOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
73
73
|
input: z.ZodUnknown;
|
|
74
74
|
output: z.ZodUnknown;
|
|
75
75
|
status: z.ZodEnum<{
|
|
76
|
-
failed: "failed";
|
|
77
76
|
queued: "queued";
|
|
78
77
|
running: "running";
|
|
79
78
|
completed: "completed";
|
|
79
|
+
failed: "failed";
|
|
80
80
|
}>;
|
|
81
81
|
error: z.ZodNullable<z.ZodString>;
|
|
82
82
|
retries: z.ZodNumber;
|
|
@@ -11,10 +11,10 @@ declare const workflowSelectSchema: z.ZodObject<{
|
|
|
11
11
|
input: z.ZodUnknown;
|
|
12
12
|
output: z.ZodUnknown;
|
|
13
13
|
status: z.ZodEnum<{
|
|
14
|
-
failed: "failed";
|
|
15
14
|
queued: "queued";
|
|
16
15
|
running: "running";
|
|
17
16
|
completed: "completed";
|
|
17
|
+
failed: "failed";
|
|
18
18
|
}>;
|
|
19
19
|
error: z.ZodNullable<z.ZodString>;
|
|
20
20
|
retries: z.ZodNumber;
|
|
@@ -28,10 +28,10 @@ declare const workflowReadInputSchema: z.ZodObject<{
|
|
|
28
28
|
}, z.core.$strip>;
|
|
29
29
|
declare const workflowListInputSchema: z.ZodObject<{
|
|
30
30
|
status: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
31
|
-
failed: "failed";
|
|
32
31
|
queued: "queued";
|
|
33
32
|
running: "running";
|
|
34
33
|
completed: "completed";
|
|
34
|
+
failed: "failed";
|
|
35
35
|
}>>>;
|
|
36
36
|
jobName: z.ZodOptional<z.ZodString>;
|
|
37
37
|
}, z.core.$strip>;
|
|
@@ -51,10 +51,10 @@ declare const workflowReadOutputSchema: z.ZodObject<{
|
|
|
51
51
|
input: z.ZodUnknown;
|
|
52
52
|
output: z.ZodUnknown;
|
|
53
53
|
status: z.ZodEnum<{
|
|
54
|
-
failed: "failed";
|
|
55
54
|
queued: "queued";
|
|
56
55
|
running: "running";
|
|
57
56
|
completed: "completed";
|
|
57
|
+
failed: "failed";
|
|
58
58
|
}>;
|
|
59
59
|
error: z.ZodNullable<z.ZodString>;
|
|
60
60
|
retries: z.ZodNumber;
|
|
@@ -73,10 +73,10 @@ declare const workflowListOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
73
73
|
input: z.ZodUnknown;
|
|
74
74
|
output: z.ZodUnknown;
|
|
75
75
|
status: z.ZodEnum<{
|
|
76
|
-
failed: "failed";
|
|
77
76
|
queued: "queued";
|
|
78
77
|
running: "running";
|
|
79
78
|
completed: "completed";
|
|
79
|
+
failed: "failed";
|
|
80
80
|
}>;
|
|
81
81
|
error: z.ZodNullable<z.ZodString>;
|
|
82
82
|
retries: z.ZodNumber;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m5kdev/commons",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"license": "GPL-3.0-only",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"tsdown": "0.21.7",
|
|
20
20
|
"typescript": "6.0.3",
|
|
21
|
-
"@m5kdev/config": "0.
|
|
21
|
+
"@m5kdev/config": "0.23.0"
|
|
22
22
|
},
|
|
23
23
|
"exports": {
|
|
24
24
|
"./utils/*": {
|