@m5kdev/commons 0.32.9 → 0.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/src/modules/ai/ai.types.d.cts +1 -1
  2. package/dist/src/modules/ai/ai.types.d.mts +1 -1
  3. package/dist/src/modules/ai/ai.utils.d.cts +1 -1
  4. package/dist/src/modules/ai/ai.utils.d.mts +1 -1
  5. package/dist/src/modules/auth/auth.locale.cjs.map +1 -1
  6. package/dist/src/modules/auth/auth.locale.mjs.map +1 -1
  7. package/dist/src/modules/auth/auth.roles.cjs.map +1 -1
  8. package/dist/src/modules/auth/auth.roles.mjs.map +1 -1
  9. package/dist/src/modules/notification/notification.schema.cjs.map +1 -1
  10. package/dist/src/modules/notification/notification.schema.mjs.map +1 -1
  11. package/dist/src/modules/recurrence/recurrence.schema.d.cts +2 -2
  12. package/dist/src/modules/recurrence/recurrence.schema.d.mts +2 -2
  13. package/dist/src/modules/schemas/query.schema.d.cts +6 -6
  14. package/dist/src/modules/schemas/query.schema.d.mts +6 -6
  15. package/dist/src/modules/schemas/queryMatch.cjs +58 -0
  16. package/dist/src/modules/schemas/queryMatch.cjs.map +1 -0
  17. package/dist/src/modules/schemas/queryMatch.d.cts +83 -0
  18. package/dist/src/modules/schemas/queryMatch.d.mts +83 -0
  19. package/dist/src/modules/schemas/queryMatch.mjs +55 -0
  20. package/dist/src/modules/schemas/queryMatch.mjs.map +1 -0
  21. package/dist/src/modules/tag/tag.schema.cjs +1 -1
  22. package/dist/src/modules/tag/tag.schema.cjs.map +1 -1
  23. package/dist/src/modules/tag/tag.schema.d.cts +4 -4
  24. package/dist/src/modules/tag/tag.schema.d.mts +4 -4
  25. package/dist/src/modules/tag/tag.schema.mjs +1 -1
  26. package/dist/src/modules/tag/tag.schema.mjs.map +1 -1
  27. package/dist/src/modules/workflow/workflow.constants.cjs.map +1 -1
  28. package/dist/src/modules/workflow/workflow.constants.mjs.map +1 -1
  29. package/dist/src/modules/workflow/workflow.schema.cjs.map +1 -1
  30. package/dist/src/modules/workflow/workflow.schema.mjs.map +1 -1
  31. package/package.json +6 -13
@@ -4,7 +4,7 @@ interface RankedModel {
4
4
  inputCost: number;
5
5
  outputCost: number;
6
6
  quality: Record<Category, number>;
7
- responseTimeSeconds: number;
7
+ responseTimeSeconds?: number;
8
8
  }
9
9
  type Category = "structured_output" | "creative" | "research" | "chat" | "tool_use" | "planning" | "classification";
10
10
  type SortType = "quality" | "price" | "speed";
@@ -4,7 +4,7 @@ interface RankedModel {
4
4
  inputCost: number;
5
5
  outputCost: number;
6
6
  quality: Record<Category, number>;
7
- responseTimeSeconds: number;
7
+ responseTimeSeconds?: number;
8
8
  }
9
9
  type Category = "structured_output" | "creative" | "research" | "chat" | "tool_use" | "planning" | "classification";
10
10
  type SortType = "quality" | "price" | "speed";
@@ -17,7 +17,7 @@ declare function rankModels(models: RankedModel[], profile: TokenProfile, catego
17
17
  inputCost: number;
18
18
  outputCost: number;
19
19
  quality: Record<Category, number>;
20
- responseTimeSeconds: number;
20
+ responseTimeSeconds?: number;
21
21
  price: number;
22
22
  estimatedCost: number;
23
23
  speedScore: number;
@@ -17,7 +17,7 @@ declare function rankModels(models: RankedModel[], profile: TokenProfile, catego
17
17
  inputCost: number;
18
18
  outputCost: number;
19
19
  quality: Record<Category, number>;
20
- responseTimeSeconds: number;
20
+ responseTimeSeconds?: number;
21
21
  price: number;
22
22
  estimatedCost: number;
23
23
  speedScore: number;
@@ -1 +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"}
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(tag: string, allowedLocales: readonly string[]): 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,kBAAkB,KAAa,gBAAkD;CAC/F,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"}
@@ -1 +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"}
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(tag: string, allowedLocales: readonly string[]): 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,kBAAkB,KAAa,gBAAkD;CAC/F,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"}
@@ -1 +1 @@
1
- {"version":3,"file":"auth.roles.cjs","names":["z"],"sources":["../../../../src/modules/auth/auth.roles.ts"],"sourcesContent":["import { z } from \"zod\";\r\n\r\nexport type AuthRoleScope = \"user\" | \"organization\" | \"team\";\r\n\r\nexport interface AuthRoleScopeConfig {\r\n roles: readonly string[];\r\n managerRoles?: readonly string[];\r\n assignableRoles?: readonly string[];\r\n defaultRole?: string;\r\n}\r\n\r\nexport interface AuthRolesConfig {\r\n user: AuthRoleScopeConfig;\r\n organization: AuthRoleScopeConfig;\r\n team: AuthRoleScopeConfig;\r\n}\r\n\r\nexport interface NormalizedAuthRoleScopeConfig {\r\n roles: readonly string[];\r\n managerRoles: readonly string[];\r\n assignableRoles: readonly string[];\r\n defaultRole: string;\r\n}\r\n\r\nexport interface NormalizedAuthRolesConfig {\r\n user: NormalizedAuthRoleScopeConfig;\r\n organization: NormalizedAuthRoleScopeConfig;\r\n team: NormalizedAuthRoleScopeConfig;\r\n}\r\n\r\nconst DEFAULT_USER_SCOPE: NormalizedAuthRoleScopeConfig = {\r\n roles: [\"user\", \"admin\"],\r\n managerRoles: [\"admin\"],\r\n assignableRoles: [\"user\", \"admin\"],\r\n defaultRole: \"user\",\r\n};\r\n\r\nconst DEFAULT_ORGANIZATION_SCOPE: NormalizedAuthRoleScopeConfig = {\r\n roles: [\"member\", \"admin\", \"owner\"],\r\n managerRoles: [\"admin\", \"owner\"],\r\n assignableRoles: [\"member\", \"admin\", \"owner\"],\r\n defaultRole: \"member\",\r\n};\r\n\r\nconst DEFAULT_TEAM_SCOPE: NormalizedAuthRoleScopeConfig = {\r\n roles: [\"owner\"],\r\n managerRoles: [\"owner\"],\r\n assignableRoles: [\"owner\"],\r\n defaultRole: \"owner\",\r\n};\r\n\r\nexport const DEFAULT_AUTH_ROLES: NormalizedAuthRolesConfig = {\r\n user: DEFAULT_USER_SCOPE,\r\n organization: DEFAULT_ORGANIZATION_SCOPE,\r\n team: DEFAULT_TEAM_SCOPE,\r\n};\r\n\r\nfunction pickSubset(\r\n values: readonly string[],\r\n allowed: readonly string[],\r\n fallback: readonly string[]\r\n): readonly string[] {\r\n const allowedSet = new Set(allowed);\r\n const picked = values.filter((value) => allowedSet.has(value));\r\n if (picked.length > 0) {\r\n return picked;\r\n }\r\n\r\n const fallbackPicked = fallback.filter((value) => allowedSet.has(value));\r\n if (fallbackPicked.length > 0) {\r\n return fallbackPicked;\r\n }\r\n\r\n return allowed.length > 0 ? [allowed[0]] : [];\r\n}\r\n\r\nexport function normalizeRoleScopeConfig(\r\n scope: AuthRoleScopeConfig,\r\n defaults: NormalizedAuthRoleScopeConfig\r\n): NormalizedAuthRoleScopeConfig {\r\n const roles = scope.roles.length > 0 ? scope.roles : defaults.roles;\r\n const roleSet = new Set(roles);\r\n\r\n const defaultRole =\r\n scope.defaultRole && roleSet.has(scope.defaultRole)\r\n ? scope.defaultRole\r\n : defaults.defaultRole && roleSet.has(defaults.defaultRole)\r\n ? defaults.defaultRole\r\n : roles[0];\r\n\r\n const managerRoles = pickSubset(\r\n scope.managerRoles ?? defaults.managerRoles,\r\n roles,\r\n defaults.managerRoles\r\n );\r\n\r\n const assignableRoles = pickSubset(\r\n scope.assignableRoles ?? roles,\r\n roles,\r\n roles\r\n );\r\n\r\n return {\r\n roles,\r\n managerRoles,\r\n assignableRoles,\r\n defaultRole,\r\n };\r\n}\r\n\r\nexport function normalizeAuthRolesConfig(\r\n config?: AuthRolesConfig | null\r\n): NormalizedAuthRolesConfig {\r\n if (!config) {\r\n return DEFAULT_AUTH_ROLES;\r\n }\r\n\r\n return {\r\n user: normalizeRoleScopeConfig(config.user, DEFAULT_AUTH_ROLES.user),\r\n organization: normalizeRoleScopeConfig(config.organization, DEFAULT_AUTH_ROLES.organization),\r\n team: normalizeRoleScopeConfig(config.team, DEFAULT_AUTH_ROLES.team),\r\n };\r\n}\r\n\r\nexport function defineAuthRoles(config: AuthRolesConfig): NormalizedAuthRolesConfig {\r\n return normalizeAuthRolesConfig(config);\r\n}\r\n\r\nexport function getRoleKeys(\r\n config: NormalizedAuthRolesConfig,\r\n scope: AuthRoleScope\r\n): readonly string[] {\r\n return config[scope].roles;\r\n}\r\n\r\nexport function isAllowedRole(\r\n config: NormalizedAuthRolesConfig,\r\n scope: AuthRoleScope,\r\n role: string\r\n): boolean {\r\n return getRoleKeys(config, scope).includes(role);\r\n}\r\n\r\nexport function createRoleValueSchema(scope: NormalizedAuthRoleScopeConfig) {\r\n const allowed = [...scope.roles];\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\r\nexport function getAppRole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BACd,QAC2B;AAC3B,KAAI,CAAC,OACH,QAAO;AAGT,QAAO;EACL,MAAM,yBAAyB,OAAO,MAAM,mBAAmB,KAAK;EACpE,cAAc,yBAAyB,OAAO,cAAc,mBAAmB,aAAa;EAC5F,MAAM,yBAAyB,OAAO,MAAM,mBAAmB,KAAK;EACrE;;AAGH,SAAgB,gBAAgB,QAAoD;AAClF,QAAO,yBAAyB,OAAO;;AAGzC,SAAgB,YACd,QACA,OACmB;AACnB,QAAO,OAAO,OAAO;;AAGvB,SAAgB,cACd,QACA,OACA,MACS;AACT,QAAO,YAAY,QAAQ,MAAM,CAAC,SAAS,KAAK;;AAGlD,SAAgB,sBAAsB,OAAsC;CAC1E,MAAM,UAAU,CAAC,GAAG,MAAM,MAAM;AAChC,KAAI,QAAQ,WAAW,EACrB,QAAOA,IAAAA,EAAE,QAAQ;AAEnB,QAAOA,IAAAA,EAAE,KAAK,QAAiC;;AAGjD,SAAgB,yBAAyB,OAAsB,MAAsB;AACnF,QAAO,GAAG,MAAM,QAAQ"}
1
+ {"version":3,"file":"auth.roles.cjs","names":["z"],"sources":["../../../../src/modules/auth/auth.roles.ts"],"sourcesContent":["import { z } from \"zod\";\r\n\r\nexport type AuthRoleScope = \"user\" | \"organization\" | \"team\";\r\n\r\nexport interface AuthRoleScopeConfig {\r\n roles: readonly string[];\r\n managerRoles?: readonly string[];\r\n assignableRoles?: readonly string[];\r\n defaultRole?: string;\r\n}\r\n\r\nexport interface AuthRolesConfig {\r\n user: AuthRoleScopeConfig;\r\n organization: AuthRoleScopeConfig;\r\n team: AuthRoleScopeConfig;\r\n}\r\n\r\nexport interface NormalizedAuthRoleScopeConfig {\r\n roles: readonly string[];\r\n managerRoles: readonly string[];\r\n assignableRoles: readonly string[];\r\n defaultRole: string;\r\n}\r\n\r\nexport interface NormalizedAuthRolesConfig {\r\n user: NormalizedAuthRoleScopeConfig;\r\n organization: NormalizedAuthRoleScopeConfig;\r\n team: NormalizedAuthRoleScopeConfig;\r\n}\r\n\r\nconst DEFAULT_USER_SCOPE: NormalizedAuthRoleScopeConfig = {\r\n roles: [\"user\", \"admin\"],\r\n managerRoles: [\"admin\"],\r\n assignableRoles: [\"user\", \"admin\"],\r\n defaultRole: \"user\",\r\n};\r\n\r\nconst DEFAULT_ORGANIZATION_SCOPE: NormalizedAuthRoleScopeConfig = {\r\n roles: [\"member\", \"admin\", \"owner\"],\r\n managerRoles: [\"admin\", \"owner\"],\r\n assignableRoles: [\"member\", \"admin\", \"owner\"],\r\n defaultRole: \"member\",\r\n};\r\n\r\nconst DEFAULT_TEAM_SCOPE: NormalizedAuthRoleScopeConfig = {\r\n roles: [\"owner\"],\r\n managerRoles: [\"owner\"],\r\n assignableRoles: [\"owner\"],\r\n defaultRole: \"owner\",\r\n};\r\n\r\nexport const DEFAULT_AUTH_ROLES: NormalizedAuthRolesConfig = {\r\n user: DEFAULT_USER_SCOPE,\r\n organization: DEFAULT_ORGANIZATION_SCOPE,\r\n team: DEFAULT_TEAM_SCOPE,\r\n};\r\n\r\nfunction pickSubset(\r\n values: readonly string[],\r\n allowed: readonly string[],\r\n fallback: readonly string[]\r\n): readonly string[] {\r\n const allowedSet = new Set(allowed);\r\n const picked = values.filter((value) => allowedSet.has(value));\r\n if (picked.length > 0) {\r\n return picked;\r\n }\r\n\r\n const fallbackPicked = fallback.filter((value) => allowedSet.has(value));\r\n if (fallbackPicked.length > 0) {\r\n return fallbackPicked;\r\n }\r\n\r\n return allowed.length > 0 ? [allowed[0]] : [];\r\n}\r\n\r\nexport function normalizeRoleScopeConfig(\r\n scope: AuthRoleScopeConfig,\r\n defaults: NormalizedAuthRoleScopeConfig\r\n): NormalizedAuthRoleScopeConfig {\r\n const roles = scope.roles.length > 0 ? scope.roles : defaults.roles;\r\n const roleSet = new Set(roles);\r\n\r\n const defaultRole =\r\n scope.defaultRole && roleSet.has(scope.defaultRole)\r\n ? scope.defaultRole\r\n : defaults.defaultRole && roleSet.has(defaults.defaultRole)\r\n ? defaults.defaultRole\r\n : roles[0];\r\n\r\n const managerRoles = pickSubset(\r\n scope.managerRoles ?? defaults.managerRoles,\r\n roles,\r\n defaults.managerRoles\r\n );\r\n\r\n const assignableRoles = pickSubset(scope.assignableRoles ?? roles, roles, roles);\r\n\r\n return {\r\n roles,\r\n managerRoles,\r\n assignableRoles,\r\n defaultRole,\r\n };\r\n}\r\n\r\nexport function normalizeAuthRolesConfig(\r\n config?: AuthRolesConfig | null\r\n): NormalizedAuthRolesConfig {\r\n if (!config) {\r\n return DEFAULT_AUTH_ROLES;\r\n }\r\n\r\n return {\r\n user: normalizeRoleScopeConfig(config.user, DEFAULT_AUTH_ROLES.user),\r\n organization: normalizeRoleScopeConfig(config.organization, DEFAULT_AUTH_ROLES.organization),\r\n team: normalizeRoleScopeConfig(config.team, DEFAULT_AUTH_ROLES.team),\r\n };\r\n}\r\n\r\nexport function defineAuthRoles(config: AuthRolesConfig): NormalizedAuthRolesConfig {\r\n return normalizeAuthRolesConfig(config);\r\n}\r\n\r\nexport function getRoleKeys(\r\n config: NormalizedAuthRolesConfig,\r\n scope: AuthRoleScope\r\n): readonly string[] {\r\n return config[scope].roles;\r\n}\r\n\r\nexport function isAllowedRole(\r\n config: NormalizedAuthRolesConfig,\r\n scope: AuthRoleScope,\r\n role: string\r\n): boolean {\r\n return getRoleKeys(config, scope).includes(role);\r\n}\r\n\r\nexport function createRoleValueSchema(scope: NormalizedAuthRoleScopeConfig) {\r\n const allowed = [...scope.roles];\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\r\nexport function getAppRoleTranslationKey(scope: AuthRoleScope, role: string): string {\r\n return `${scope}.role.${role}`;\r\n}\r\n"],"mappings":";;AAmDA,MAAa,qBAAgD;CAC3D,MAtBwD;EACxD,OAAO,CAAC,QAAQ,QAAQ;EACxB,cAAc,CAAC,QAAQ;EACvB,iBAAiB,CAAC,QAAQ,QAAQ;EAClC,aAAa;EACd;CAkBC,cAhBgE;E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ClF,QAAO,yBAAyB,OAAO;;AAGzC,SAAgB,YACd,QACA,OACmB;AACnB,QAAO,OAAO,OAAO;;AAGvB,SAAgB,cACd,QACA,OACA,MACS;AACT,QAAO,YAAY,QAAQ,MAAM,CAAC,SAAS,KAAK;;AAGlD,SAAgB,sBAAsB,OAAsC;CAC1E,MAAM,UAAU,CAAC,GAAG,MAAM,MAAM;AAChC,KAAI,QAAQ,WAAW,EACrB,QAAOA,IAAAA,EAAE,QAAQ;AAEnB,QAAOA,IAAAA,EAAE,KAAK,QAAiC;;AAGjD,SAAgB,yBAAyB,OAAsB,MAAsB;AACnF,QAAO,GAAG,MAAM,QAAQ"}
@@ -1 +1 @@
1
- {"version":3,"file":"auth.roles.mjs","names":[],"sources":["../../../../src/modules/auth/auth.roles.ts"],"sourcesContent":["import { z } from \"zod\";\r\n\r\nexport type AuthRoleScope = \"user\" | \"organization\" | \"team\";\r\n\r\nexport interface AuthRoleScopeConfig {\r\n roles: readonly string[];\r\n managerRoles?: readonly string[];\r\n assignableRoles?: readonly string[];\r\n defaultRole?: string;\r\n}\r\n\r\nexport interface AuthRolesConfig {\r\n user: AuthRoleScopeConfig;\r\n organization: AuthRoleScopeConfig;\r\n team: AuthRoleScopeConfig;\r\n}\r\n\r\nexport interface NormalizedAuthRoleScopeConfig {\r\n roles: readonly string[];\r\n managerRoles: readonly string[];\r\n assignableRoles: readonly string[];\r\n defaultRole: string;\r\n}\r\n\r\nexport interface NormalizedAuthRolesConfig {\r\n user: NormalizedAuthRoleScopeConfig;\r\n organization: NormalizedAuthRoleScopeConfig;\r\n team: NormalizedAuthRoleScopeConfig;\r\n}\r\n\r\nconst DEFAULT_USER_SCOPE: NormalizedAuthRoleScopeConfig = {\r\n roles: [\"user\", \"admin\"],\r\n managerRoles: [\"admin\"],\r\n assignableRoles: [\"user\", \"admin\"],\r\n defaultRole: \"user\",\r\n};\r\n\r\nconst DEFAULT_ORGANIZATION_SCOPE: NormalizedAuthRoleScopeConfig = {\r\n roles: [\"member\", \"admin\", \"owner\"],\r\n managerRoles: [\"admin\", \"owner\"],\r\n assignableRoles: [\"member\", \"admin\", \"owner\"],\r\n defaultRole: \"member\",\r\n};\r\n\r\nconst DEFAULT_TEAM_SCOPE: NormalizedAuthRoleScopeConfig = {\r\n roles: [\"owner\"],\r\n managerRoles: [\"owner\"],\r\n assignableRoles: [\"owner\"],\r\n defaultRole: \"owner\",\r\n};\r\n\r\nexport const DEFAULT_AUTH_ROLES: NormalizedAuthRolesConfig = {\r\n user: DEFAULT_USER_SCOPE,\r\n organization: DEFAULT_ORGANIZATION_SCOPE,\r\n team: DEFAULT_TEAM_SCOPE,\r\n};\r\n\r\nfunction pickSubset(\r\n values: readonly string[],\r\n allowed: readonly string[],\r\n fallback: readonly string[]\r\n): readonly string[] {\r\n const allowedSet = new Set(allowed);\r\n const picked = values.filter((value) => allowedSet.has(value));\r\n if (picked.length > 0) {\r\n return picked;\r\n }\r\n\r\n const fallbackPicked = fallback.filter((value) => allowedSet.has(value));\r\n if (fallbackPicked.length > 0) {\r\n return fallbackPicked;\r\n }\r\n\r\n return allowed.length > 0 ? [allowed[0]] : [];\r\n}\r\n\r\nexport function normalizeRoleScopeConfig(\r\n scope: AuthRoleScopeConfig,\r\n defaults: NormalizedAuthRoleScopeConfig\r\n): NormalizedAuthRoleScopeConfig {\r\n const roles = scope.roles.length > 0 ? scope.roles : defaults.roles;\r\n const roleSet = new Set(roles);\r\n\r\n const defaultRole =\r\n scope.defaultRole && roleSet.has(scope.defaultRole)\r\n ? scope.defaultRole\r\n : defaults.defaultRole && roleSet.has(defaults.defaultRole)\r\n ? defaults.defaultRole\r\n : roles[0];\r\n\r\n const managerRoles = pickSubset(\r\n scope.managerRoles ?? defaults.managerRoles,\r\n roles,\r\n defaults.managerRoles\r\n );\r\n\r\n const assignableRoles = pickSubset(\r\n scope.assignableRoles ?? roles,\r\n roles,\r\n roles\r\n );\r\n\r\n return {\r\n roles,\r\n managerRoles,\r\n assignableRoles,\r\n defaultRole,\r\n };\r\n}\r\n\r\nexport function normalizeAuthRolesConfig(\r\n config?: AuthRolesConfig | null\r\n): NormalizedAuthRolesConfig {\r\n if (!config) {\r\n return DEFAULT_AUTH_ROLES;\r\n }\r\n\r\n return {\r\n user: normalizeRoleScopeConfig(config.user, DEFAULT_AUTH_ROLES.user),\r\n organization: normalizeRoleScopeConfig(config.organization, DEFAULT_AUTH_ROLES.organization),\r\n team: normalizeRoleScopeConfig(config.team, DEFAULT_AUTH_ROLES.team),\r\n };\r\n}\r\n\r\nexport function defineAuthRoles(config: AuthRolesConfig): NormalizedAuthRolesConfig {\r\n return normalizeAuthRolesConfig(config);\r\n}\r\n\r\nexport function getRoleKeys(\r\n config: NormalizedAuthRolesConfig,\r\n scope: AuthRoleScope\r\n): readonly string[] {\r\n return config[scope].roles;\r\n}\r\n\r\nexport function isAllowedRole(\r\n config: NormalizedAuthRolesConfig,\r\n scope: AuthRoleScope,\r\n role: string\r\n): boolean {\r\n return getRoleKeys(config, scope).includes(role);\r\n}\r\n\r\nexport function createRoleValueSchema(scope: NormalizedAuthRoleScopeConfig) {\r\n const allowed = [...scope.roles];\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\r\nexport function getAppRoleTranslationKey(scope: AuthRoleScope, role: string): string {\r\n return `${scope}.role.${role}`;\r\n}\r\n"],"mappings":";AAmDA,MAAa,qBAAgD;CAC3D,MAtBwD;EACxD,OAAO,CAAC,QAAQ,QAAQ;EACxB,cAAc,CAAC,QAAQ;EACvB,iBAAiB,CAAC,QAAQ,QAAQ;EAClC,aAAa;EACd;CAkBC,cAhBgE;EAChE,OAAO;GAAC;GAAU;GAAS;GAAQ;EACnC,cAAc,CAAC,SAAS,QAAQ;EAChC,iBAAiB;GAAC;GAAU;GAAS;GAAQ;EAC7C,aAAa;EACd;CAYC,MAVwD;EACxD,OAAO,CAAC,QAAQ;EAChB,cAAc,CAAC,QAAQ;EACvB,iBAAiB,C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AAU,CAAC,GAAG,MAAM,MAAM;AAChC,KAAI,QAAQ,WAAW,EACrB,QAAO,EAAE,QAAQ;AAEnB,QAAO,EAAE,KAAK,QAAiC;;AAGjD,SAAgB,yBAAyB,OAAsB,MAAsB;AACnF,QAAO,GAAG,MAAM,QAAQ"}
1
+ {"version":3,"file":"auth.roles.mjs","names":[],"sources":["../../../../src/modules/auth/auth.roles.ts"],"sourcesContent":["import { z } from \"zod\";\r\n\r\nexport type AuthRoleScope = \"user\" | \"organization\" | \"team\";\r\n\r\nexport interface AuthRoleScopeConfig {\r\n roles: readonly string[];\r\n managerRoles?: readonly string[];\r\n assignableRoles?: readonly string[];\r\n defaultRole?: string;\r\n}\r\n\r\nexport interface AuthRolesConfig {\r\n user: AuthRoleScopeConfig;\r\n organization: AuthRoleScopeConfig;\r\n team: AuthRoleScopeConfig;\r\n}\r\n\r\nexport interface NormalizedAuthRoleScopeConfig {\r\n roles: readonly string[];\r\n managerRoles: readonly string[];\r\n assignableRoles: readonly string[];\r\n defaultRole: string;\r\n}\r\n\r\nexport interface NormalizedAuthRolesConfig {\r\n user: NormalizedAuthRoleScopeConfig;\r\n organization: NormalizedAuthRoleScopeConfig;\r\n team: NormalizedAuthRoleScopeConfig;\r\n}\r\n\r\nconst DEFAULT_USER_SCOPE: NormalizedAuthRoleScopeConfig = {\r\n roles: [\"user\", \"admin\"],\r\n managerRoles: [\"admin\"],\r\n assignableRoles: [\"user\", \"admin\"],\r\n defaultRole: \"user\",\r\n};\r\n\r\nconst DEFAULT_ORGANIZATION_SCOPE: NormalizedAuthRoleScopeConfig = {\r\n roles: [\"member\", \"admin\", \"owner\"],\r\n managerRoles: [\"admin\", \"owner\"],\r\n assignableRoles: [\"member\", \"admin\", \"owner\"],\r\n defaultRole: \"member\",\r\n};\r\n\r\nconst DEFAULT_TEAM_SCOPE: NormalizedAuthRoleScopeConfig = {\r\n roles: [\"owner\"],\r\n managerRoles: [\"owner\"],\r\n assignableRoles: [\"owner\"],\r\n defaultRole: \"owner\",\r\n};\r\n\r\nexport const DEFAULT_AUTH_ROLES: NormalizedAuthRolesConfig = {\r\n user: DEFAULT_USER_SCOPE,\r\n organization: DEFAULT_ORGANIZATION_SCOPE,\r\n team: DEFAULT_TEAM_SCOPE,\r\n};\r\n\r\nfunction pickSubset(\r\n values: readonly string[],\r\n allowed: readonly string[],\r\n fallback: readonly string[]\r\n): readonly string[] {\r\n const allowedSet = new Set(allowed);\r\n const picked = values.filter((value) => allowedSet.has(value));\r\n if (picked.length > 0) {\r\n return picked;\r\n }\r\n\r\n const fallbackPicked = fallback.filter((value) => allowedSet.has(value));\r\n if (fallbackPicked.length > 0) {\r\n return fallbackPicked;\r\n }\r\n\r\n return allowed.length > 0 ? [allowed[0]] : [];\r\n}\r\n\r\nexport function normalizeRoleScopeConfig(\r\n scope: AuthRoleScopeConfig,\r\n defaults: NormalizedAuthRoleScopeConfig\r\n): NormalizedAuthRoleScopeConfig {\r\n const roles = scope.roles.length > 0 ? scope.roles : defaults.roles;\r\n const roleSet = new Set(roles);\r\n\r\n const defaultRole =\r\n scope.defaultRole && roleSet.has(scope.defaultRole)\r\n ? scope.defaultRole\r\n : defaults.defaultRole && roleSet.has(defaults.defaultRole)\r\n ? defaults.defaultRole\r\n : roles[0];\r\n\r\n const managerRoles = pickSubset(\r\n scope.managerRoles ?? defaults.managerRoles,\r\n roles,\r\n defaults.managerRoles\r\n );\r\n\r\n const assignableRoles = pickSubset(scope.assignableRoles ?? roles, roles, roles);\r\n\r\n return {\r\n roles,\r\n managerRoles,\r\n assignableRoles,\r\n defaultRole,\r\n };\r\n}\r\n\r\nexport function normalizeAuthRolesConfig(\r\n config?: AuthRolesConfig | null\r\n): NormalizedAuthRolesConfig {\r\n if (!config) {\r\n return DEFAULT_AUTH_ROLES;\r\n }\r\n\r\n return {\r\n user: normalizeRoleScopeConfig(config.user, DEFAULT_AUTH_ROLES.user),\r\n organization: normalizeRoleScopeConfig(config.organization, DEFAULT_AUTH_ROLES.organization),\r\n team: normalizeRoleScopeConfig(config.team, DEFAULT_AUTH_ROLES.team),\r\n };\r\n}\r\n\r\nexport function defineAuthRoles(config: AuthRolesConfig): NormalizedAuthRolesConfig {\r\n return normalizeAuthRolesConfig(config);\r\n}\r\n\r\nexport function getRoleKeys(\r\n config: NormalizedAuthRolesConfig,\r\n scope: AuthRoleScope\r\n): readonly string[] {\r\n return config[scope].roles;\r\n}\r\n\r\nexport function isAllowedRole(\r\n config: NormalizedAuthRolesConfig,\r\n scope: AuthRoleScope,\r\n role: string\r\n): boolean {\r\n return getRoleKeys(config, scope).includes(role);\r\n}\r\n\r\nexport function createRoleValueSchema(scope: NormalizedAuthRoleScopeConfig) {\r\n const allowed = [...scope.roles];\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\r\nexport function getAppRoleTranslationKey(scope: AuthRoleScope, role: string): string {\r\n return `${scope}.role.${role}`;\r\n}\r\n"],"mappings":";AAmDA,MAAa,qBAAgD;CAC3D,MAtBwD;EACxD,OAAO,CAAC,QAAQ,QAAQ;EACxB,cAAc,CAAC,QAAQ;EACvB,iBAAiB,CAAC,QAAQ,QAAQ;EAClC,aAAa;EACd;CAkBC,cAhBgE;EAChE,OAAO;GAAC;GAAU;GAAS;GAAQ;EACnC,cAAc,CAAC,SAAS,QAAQ;EAChC,iBAAiB;GAAC;GAAU;GAAS;GAAQ;EAC7C,aAAa;EACd;CAYC,MAVwD;EACxD,OAAO,CAAC,QAAQ;EAChB,cAAc,CAAC,QAAQ;EACvB,iBAAiB,CAAC,QAAQ;EAC1B,aAAa;EACd;CAMA;AAED,SAAS,WACP,QACA,SACA,UACmB;CACnB,MAAM,aAAa,IAAI,IAAI,QAAQ;CACnC,MAAM,SAAS,OAAO,QAAQ,UAAU,WAAW,IAAI,MAAM,CAAC;AAC9D,KAAI,OAAO,SAAS,EAClB,QAAO;CAGT,MAAM,iBAAiB,SAAS,QAAQ,UAAU,WAAW,IAAI,MA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OTIFICATION_PROVIDERS","NOTIFICATION_SEND_STATUSES"],"sources":["../../../../src/modules/notification/notification.schema.ts"],"sourcesContent":["import { z } from \"zod\";\r\nimport {\r\n NOTIFICATION_PLATFORMS,\r\n NOTIFICATION_PROVIDERS,\r\n NOTIFICATION_SEND_STATUSES,\r\n} from \"./notification.constants\";\r\n\r\nexport const notificationPlatformSchema = z.enum(NOTIFICATION_PLATFORMS);\r\nexport const notificationProviderSchema = z.enum(NOTIFICATION_PROVIDERS);\r\nexport const notificationSendStatusSchema = z.enum(NOTIFICATION_SEND_STATUSES);\r\n\r\n/** Web Push `PushSubscriptionJSON` subset we persist and accept from clients. */\r\nexport const pushSubscriptionJsonSchema = z.object({\r\n endpoint: z.string().url(),\r\n expirationTime: z.number().nullable().optional(),\r\n keys: z.object({\r\n p256dh: z.string(),\r\n auth: z.string(),\r\n }),\r\n});\r\n\r\nexport const notificationRegisterDeviceInputSchema = z.discriminatedUnion(\"platform\", [\r\n z.object({\r\n platform: z.literal(\"web\"),\r\n subscription: pushSubscriptionJsonSchema,\r\n label: z.string().max(120).optional(),\r\n }),\r\n z.object({\r\n platform: z.literal(\"ios\"),\r\n token: z.string().min(1).max(4096),\r\n label: z.string().max(120).optional(),\r\n }),\r\n z.object({\r\n platform: z.literal(\"android\"),\r\n token: z.string().min(1).max(4096),\r\n label: z.string().max(120).optional(),\r\n }),\r\n]);\r\n\r\nexport type NotificationRegisterDeviceInput = z.infer<typeof notificationRegisterDeviceInputSchema>;\r\n\r\nexport const notificationRegisterDeviceOutputSchema = z.object({\r\n deviceId: z.string(),\r\n});\r\n\r\nexport const notificationUnregisterDeviceInputSchema = z.object({\r\n deviceId: z.string(),\r\n});\r\n\r\nexport const notificationUnregisterDeviceOutputSchema = z.object({\r\n ok: z.literal(true),\r\n});\r\n\r\nexport const notificationDeviceSelectSchema = z.object({\r\n id: z.string(),\r\n userId: z.string(),\r\n platform: notificationPlatformSchema,\r\n endpoint: z.string().nullable(),\r\n label: z.string().nullable(),\r\n enabled: z.boolean(),\r\n createdAt: z.date(),\r\n updatedAt: z.date(),\r\n});\r\n\r\nexport const notificationListDevicesOutputSchema = z.array(notificationDeviceSelectSchema);\r\n\r\nexport const notificationVapidPublicKeyOutputSchema = z.object({\r\n publicKey: z.string(),\r\n});\r\n\r\nexport const notificationSendLogSelectSchema = z.object({\r\n id: z.string(),\r\n batchId: z.string(),\r\n userId: z.string(),\r\n deviceId: z.string(),\r\n provider: notificationProviderSchema,\r\n title: z.string(),\r\n body: z.string(),\r\n data: z.record(z.string(), z.unknown()).nullable(),\r\n status: notificationSendStatusSchema,\r\n error: z.string().nullable(),\r\n jobId: z.string().nullable(),\r\n createdAt: z.date(),\r\n updatedAt: z.date(),\r\n});\r\n\r\nexport const notificationListSendLogsInputSchema = z.object({\r\n batchId: z.string().optional(),\r\n limit: z.number().int().min(1).max(100).optional(),\r\n});\r\n\r\nexport const notificationListSendLogsOutputSchema = z.array(notificationSendLogSelectSchema);\r\n\r\nexport const notificationSendTestInputSchema = z.object({\r\n userId: z.string().optional(),\r\n title: z.string().min(1).max(200),\r\n body: z.string().min(1).max(2000),\r\n data: z.record(z.string(), z.unknown()).optional(),\r\n});\r\n\r\nexport const notificationSendTestOutputSchema = z.object({\r\n batchId: z.string(),\r\n jobId: z.string(),\r\n});"],"mappings":";;;;AAOA,MAAa,6BAA6BA,IAAAA,EAAE,KAAKC,wDAAAA,uBAAuB;AACxE,MAAa,6BAA6BD,IAAAA,EAAE,KAAKE,wDAAAA,uBAAuB;AACxE,MAAa,+BAA+BF,IAAAA,EAAE,KAAKG,wDAAAA,2BAA2B;;AAG9E,MAAa,6BAA6BH,IAAAA,EAAE,OAAO;CACjD,UAAUA,IAAAA,EAAE,QAAQ,CAAC,KAAK;CAC1B,gBAAgBA,IAAAA,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU;CAChD,MAAMA,IAAAA,EAAE,OAAO;EACb,QAAQA,IAAAA,EAAE,QAAQ;EAClB,MAAMA,IAAAA,EA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AAA,EAAE,SAAS,CAAC,CAAC,UAAU;CACnD,CAAC;AAEF,MAAa,mCAAmCA,IAAAA,EAAE,OAAO;CACvD,SAASA,IAAAA,EAAE,QAAQ;CACnB,OAAOA,IAAAA,EAAE,QAAQ;CAClB,CAAC"}
1
+ {"version":3,"file":"notification.schema.cjs","names":["z","NOTIFICATION_PLATFORMS","NOTIFICATION_PROVIDERS","NOTIFICATION_SEND_STATUSES"],"sources":["../../../../src/modules/notification/notification.schema.ts"],"sourcesContent":["import { z } from \"zod\";\r\nimport {\r\n NOTIFICATION_PLATFORMS,\r\n NOTIFICATION_PROVIDERS,\r\n NOTIFICATION_SEND_STATUSES,\r\n} from \"./notification.constants\";\r\n\r\nexport const notificationPlatformSchema = z.enum(NOTIFICATION_PLATFORMS);\r\nexport const notificationProviderSchema = z.enum(NOTIFICATION_PROVIDERS);\r\nexport const notificationSendStatusSchema = z.enum(NOTIFICATION_SEND_STATUSES);\r\n\r\n/** Web Push `PushSubscriptionJSON` subset we persist and accept from clients. */\r\nexport const pushSubscriptionJsonSchema = z.object({\r\n endpoint: z.string().url(),\r\n expirationTime: z.number().nullable().optional(),\r\n keys: z.object({\r\n p256dh: z.string(),\r\n auth: z.string(),\r\n }),\r\n});\r\n\r\nexport const notificationRegisterDeviceInputSchema = z.discriminatedUnion(\"platform\", [\r\n z.object({\r\n platform: z.literal(\"web\"),\r\n subscription: pushSubscriptionJsonSchema,\r\n label: z.string().max(120).optional(),\r\n }),\r\n z.object({\r\n platform: z.literal(\"ios\"),\r\n token: z.string().min(1).max(4096),\r\n label: z.string().max(120).optional(),\r\n }),\r\n z.object({\r\n platform: z.literal(\"android\"),\r\n token: z.string().min(1).max(4096),\r\n label: z.string().max(120).optional(),\r\n }),\r\n]);\r\n\r\nexport type NotificationRegisterDeviceInput = z.infer<typeof notificationRegisterDeviceInputSchema>;\r\n\r\nexport const notificationRegisterDeviceOutputSchema = z.object({\r\n deviceId: z.string(),\r\n});\r\n\r\nexport const notificationUnregisterDeviceInputSchema = z.object({\r\n deviceId: z.string(),\r\n});\r\n\r\nexport const notificationUnregisterDeviceOutputSchema = z.object({\r\n ok: z.literal(true),\r\n});\r\n\r\nexport const notificationDeviceSelectSchema = z.object({\r\n id: z.string(),\r\n userId: z.string(),\r\n platform: notificationPlatformSchema,\r\n endpoint: z.string().nullable(),\r\n label: z.string().nullable(),\r\n enabled: z.boolean(),\r\n createdAt: z.date(),\r\n updatedAt: z.date(),\r\n});\r\n\r\nexport const notificationListDevicesOutputSchema = z.array(notificationDeviceSelectSchema);\r\n\r\nexport const notificationVapidPublicKeyOutputSchema = z.object({\r\n publicKey: z.string(),\r\n});\r\n\r\nexport const notificationSendLogSelectSchema = z.object({\r\n id: z.string(),\r\n batchId: z.string(),\r\n userId: z.string(),\r\n deviceId: z.string(),\r\n provider: notificationProviderSchema,\r\n title: z.string(),\r\n body: z.string(),\r\n data: z.record(z.string(), z.unknown()).nullable(),\r\n status: notificationSendStatusSchema,\r\n error: z.string().nullable(),\r\n jobId: z.string().nullable(),\r\n createdAt: z.date(),\r\n updatedAt: z.date(),\r\n});\r\n\r\nexport const notificationListSendLogsInputSchema = z.object({\r\n batchId: z.string().optional(),\r\n limit: z.number().int().min(1).max(100).optional(),\r\n});\r\n\r\nexport const notificationListSendLogsOutputSchema = z.array(notificationSendLogSelectSchema);\r\n\r\nexport const notificationSendTestInputSchema = z.object({\r\n userId: z.string().optional(),\r\n title: z.string().min(1).max(200),\r\n body: z.string().min(1).max(2000),\r\n data: z.record(z.string(), z.unknown()).optional(),\r\n});\r\n\r\nexport const notificationSendTestOutputSchema = z.object({\r\n batchId: z.string(),\r\n jobId: z.string(),\r\n});\r\n"],"mappings":";;;;AAOA,MAAa,6BAA6BA,IAAAA,EAAE,KAAKC,wDAAAA,uBAAuB;AACxE,MAAa,6BAA6BD,IAAAA,EAAE,KAAKE,wDAAAA,uBAAuB;AACxE,MAAa,+BAA+BF,IAAAA,EAAE,KAAKG,wDAAAA,2BAA2B;;AAG9E,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EAAE,QAAQ,CAAC,UAAU;CAC7B,OAAOA,IAAAA,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,IAAI;CACjC,MAAMA,IAAAA,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,IAAK;CACjC,MAAMA,IAAAA,EAAE,OAAOA,IAAAA,EAAE,QAAQ,EAAEA,IAAAA,EAAE,SAAS,CAAC,CAAC,UAAU;CACnD,CAAC;AAEF,MAAa,mCAAmCA,IAAAA,EAAE,OAAO;CACvD,SAASA,IAAAA,EAAE,QAAQ;CACnB,OAAOA,IAAAA,EAAE,QAAQ;CAClB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"notification.schema.mjs","names":[],"sources":["../../../../src/modules/notification/notification.schema.ts"],"sourcesContent":["import { z } from \"zod\";\r\nimport {\r\n NOTIFICATION_PLATFORMS,\r\n NOTIFICATION_PROVIDERS,\r\n NOTIFICATION_SEND_STATUSES,\r\n} from \"./notification.constants\";\r\n\r\nexport const notificationPlatformSchema = z.enum(NOTIFICATION_PLATFORMS);\r\nexport const notificationProviderSchema = z.enum(NOTIFICATION_PROVIDERS);\r\nexport const notificationSendStatusSchema = z.enum(NOTIFICATION_SEND_STATUSES);\r\n\r\n/** Web Push `PushSubscriptionJSON` subset we persist and accept from clients. */\r\nexport const pushSubscriptionJsonSchema = z.object({\r\n endpoint: z.string().url(),\r\n expirationTime: z.number().nullable().optional(),\r\n keys: z.object({\r\n p256dh: z.string(),\r\n auth: z.string(),\r\n }),\r\n});\r\n\r\nexport const notificationRegisterDeviceInputSchema = z.discriminatedUnion(\"platform\", [\r\n z.object({\r\n platform: z.literal(\"web\"),\r\n subscription: pushSubscriptionJsonSchema,\r\n label: z.string().max(120).optional(),\r\n }),\r\n z.object({\r\n platform: z.literal(\"ios\"),\r\n token: z.string().min(1).max(4096),\r\n label: z.string().max(120).optional(),\r\n }),\r\n z.object({\r\n platform: z.literal(\"android\"),\r\n token: z.string().min(1).max(4096),\r\n label: z.string().max(120).optional(),\r\n }),\r\n]);\r\n\r\nexport type NotificationRegisterDeviceInput = z.infer<typeof notificationRegisterDeviceInputSchema>;\r\n\r\nexport const notificationRegisterDeviceOutputSchema = z.object({\r\n deviceId: z.string(),\r\n});\r\n\r\nexport const notificationUnregisterDeviceInputSchema = z.object({\r\n deviceId: z.string(),\r\n});\r\n\r\nexport const notificationUnregisterDeviceOutputSchema = z.object({\r\n ok: z.literal(true),\r\n});\r\n\r\nexport const notificationDeviceSelectSchema = z.object({\r\n id: z.string(),\r\n userId: z.string(),\r\n platform: notificationPlatformSchema,\r\n endpoint: z.string().nullable(),\r\n label: z.string().nullable(),\r\n enabled: z.boolean(),\r\n createdAt: z.date(),\r\n updatedAt: z.date(),\r\n});\r\n\r\nexport const notificationListDevicesOutputSchema = z.array(notificationDeviceSelectSchema);\r\n\r\nexport const notificationVapidPublicKeyOutputSchema = z.object({\r\n publicKey: z.string(),\r\n});\r\n\r\nexport const notificationSendLogSelectSchema = z.object({\r\n id: z.string(),\r\n batchId: z.string(),\r\n userId: z.string(),\r\n deviceId: z.string(),\r\n provider: notificationProviderSchema,\r\n title: z.string(),\r\n body: z.string(),\r\n data: z.record(z.string(), z.unknown()).nullable(),\r\n status: notificationSendStatusSchema,\r\n error: z.string().nullable(),\r\n jobId: z.string().nullable(),\r\n createdAt: z.date(),\r\n updatedAt: z.date(),\r\n});\r\n\r\nexport const notificationListSendLogsInputSchema = z.object({\r\n batchId: z.string().optional(),\r\n limit: z.number().int().min(1).max(100).optional(),\r\n});\r\n\r\nexport const notificationListSendLogsOutputSchema = z.array(notificationSendLogSelectSchema);\r\n\r\nexport const notificationSendTestInputSchema = z.object({\r\n userId: z.string().optional(),\r\n title: z.string().min(1).max(200),\r\n body: z.string().min(1).max(2000),\r\n data: z.record(z.string(), z.unknown()).optional(),\r\n});\r\n\r\nexport const notificationSendTestOutputSchema = z.object({\r\n batchId: z.string(),\r\n jobId: z.string(),\r\n});"],"mappings":";;;AAOA,MAAa,6B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"version":3,"file":"notification.schema.mjs","names":[],"sources":["../../../../src/modules/notification/notification.schema.ts"],"sourcesContent":["import { z } from \"zod\";\r\nimport {\r\n NOTIFICATION_PLATFORMS,\r\n NOTIFICATION_PROVIDERS,\r\n NOTIFICATION_SEND_STATUSES,\r\n} from \"./notification.constants\";\r\n\r\nexport const notificationPlatformSchema = z.enum(NOTIFICATION_PLATFORMS);\r\nexport const notificationProviderSchema = z.enum(NOTIFICATION_PROVIDERS);\r\nexport const notificationSendStatusSchema = z.enum(NOTIFICATION_SEND_STATUSES);\r\n\r\n/** Web Push `PushSubscriptionJSON` subset we persist and accept from clients. */\r\nexport const pushSubscriptionJsonSchema = z.object({\r\n endpoint: z.string().url(),\r\n expirationTime: z.number().nullable().optional(),\r\n keys: z.object({\r\n p256dh: z.string(),\r\n auth: z.string(),\r\n }),\r\n});\r\n\r\nexport const notificationRegisterDeviceInputSchema = z.discriminatedUnion(\"platform\", [\r\n z.object({\r\n platform: z.literal(\"web\"),\r\n subscription: pushSubscriptionJsonSchema,\r\n label: z.string().max(120).optional(),\r\n }),\r\n z.object({\r\n platform: z.literal(\"ios\"),\r\n token: z.string().min(1).max(4096),\r\n label: z.string().max(120).optional(),\r\n }),\r\n z.object({\r\n platform: z.literal(\"android\"),\r\n token: z.string().min(1).max(4096),\r\n label: z.string().max(120).optional(),\r\n }),\r\n]);\r\n\r\nexport type NotificationRegisterDeviceInput = z.infer<typeof notificationRegisterDeviceInputSchema>;\r\n\r\nexport const notificationRegisterDeviceOutputSchema = z.object({\r\n deviceId: z.string(),\r\n});\r\n\r\nexport const notificationUnregisterDeviceInputSchema = z.object({\r\n deviceId: z.string(),\r\n});\r\n\r\nexport const notificationUnregisterDeviceOutputSchema = z.object({\r\n ok: z.literal(true),\r\n});\r\n\r\nexport const notificationDeviceSelectSchema = z.object({\r\n id: z.string(),\r\n userId: z.string(),\r\n platform: notificationPlatformSchema,\r\n endpoint: z.string().nullable(),\r\n label: z.string().nullable(),\r\n enabled: z.boolean(),\r\n createdAt: z.date(),\r\n updatedAt: z.date(),\r\n});\r\n\r\nexport const notificationListDevicesOutputSchema = z.array(notificationDeviceSelectSchema);\r\n\r\nexport const notificationVapidPublicKeyOutputSchema = z.object({\r\n publicKey: z.string(),\r\n});\r\n\r\nexport const notificationSendLogSelectSchema = z.object({\r\n id: z.string(),\r\n batchId: z.string(),\r\n userId: z.string(),\r\n deviceId: z.string(),\r\n provider: notificationProviderSchema,\r\n title: z.string(),\r\n body: z.string(),\r\n data: z.record(z.string(), z.unknown()).nullable(),\r\n status: notificationSendStatusSchema,\r\n error: z.string().nullable(),\r\n jobId: z.string().nullable(),\r\n createdAt: z.date(),\r\n updatedAt: z.date(),\r\n});\r\n\r\nexport const notificationListSendLogsInputSchema = z.object({\r\n batchId: z.string().optional(),\r\n limit: z.number().int().min(1).max(100).optional(),\r\n});\r\n\r\nexport const notificationListSendLogsOutputSchema = z.array(notificationSendLogSelectSchema);\r\n\r\nexport const notificationSendTestInputSchema = z.object({\r\n userId: z.string().optional(),\r\n title: z.string().min(1).max(200),\r\n body: z.string().min(1).max(2000),\r\n data: z.record(z.string(), z.unknown()).optional(),\r\n});\r\n\r\nexport const notificationSendTestOutputSchema = z.object({\r\n batchId: z.string(),\r\n jobId: z.string(),\r\n});\r\n"],"mappings":";;;AAOA,MAAa,6BAA6B,EAAE,KAAK,uBAAuB;AACxE,MAAa,6BAA6B,EAAE,KAAK,uBAAuB;AACxE,MAAa,+BAA+B,EAAE,KAAK,2BAA2B;;AAG9E,MAAa,6BAA6B,EAAE,OAAO;CACjD,UAAU,EAAE,QAAQ,CAAC,KAAK;CAC1B,gBAAgB,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU;CAChD,MAAM,EAAE,OAAO;EACb,QAAQ,EAAE,QAAQ;EAClB,MAAM,EAAE,QAAQ;EACjB,CAAC;CACH,CAAC;AAEF,MAAa,wCAAwC,EAAE,mBAAmB,YAAY;CACpF,EAAE,OAAO;EACP,UAAU,EAAE,QAAQ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;CAChB,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,SAAS,CAAC,CAAC,UAAU;CAClD,QAAQ;CACR,OAAO,EAAE,QAAQ,CAAC,UAAU;CAC5B,OAAO,EAAE,QAAQ,CAAC,UAAU;CAC5B,WAAW,EAAE,MAAM;CACnB,WAAW,EAAE,MAAM;CACpB,CAAC;AAEF,MAAa,sCAAsC,EAAE,OAAO;CAC1D,SAAS,EAAE,QAAQ,CAAC,UAAU;CAC9B,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,IAAI,CAAC,UAAU;CACnD,CAAC;AAEF,MAAa,uCAAuC,EAAE,MAAM,gCAAgC;AAE5F,MAAa,kCAAkC,EAAE,OAAO;CACtD,QAAQ,EAAE,QAAQ,CAAC,UAAU;CAC7B,OAAO,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,IAAI;CACjC,MAAM,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,IAAK;CACjC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,SAAS,CAAC,CAAC,UAAU;CACnD,CAAC;AAEF,MAAa,mCAAmC,EAAE,OAAO;CACvD,SAAS,EAAE,QAAQ;CACnB,OAAO,EAAE,QAAQ;CAClB,CAAC"}
@@ -38,6 +38,7 @@ declare const recurrenceRulesSchema: z.ZodObject<{
38
38
  }, z.core.$strip>;
39
39
  declare const updateRecurrenceRulesSchema: z.ZodObject<{
40
40
  id: z.ZodString;
41
+ interval: z.ZodNumber;
41
42
  bysetpos: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
42
43
  bymonth: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
43
44
  bymonthday: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
@@ -49,7 +50,6 @@ declare const updateRecurrenceRulesSchema: z.ZodObject<{
49
50
  bysecond: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
50
51
  freq: z.ZodNumber;
51
52
  dtstart: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
52
- interval: z.ZodNumber;
53
53
  wkst: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
54
54
  count: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
55
55
  until: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
@@ -61,6 +61,7 @@ declare const createRecurrenceSchema: z.ZodObject<{
61
61
  enabled: z.ZodBoolean;
62
62
  metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
63
63
  recurrenceRules: z.ZodArray<z.ZodObject<{
64
+ interval: z.ZodNumber;
64
65
  bysetpos: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
65
66
  bymonth: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
66
67
  bymonthday: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
@@ -72,7 +73,6 @@ declare const createRecurrenceSchema: z.ZodObject<{
72
73
  bysecond: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
73
74
  freq: z.ZodNumber;
74
75
  dtstart: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
75
- interval: z.ZodNumber;
76
76
  wkst: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
77
77
  count: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
78
78
  until: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
@@ -38,6 +38,7 @@ declare const recurrenceRulesSchema: z.ZodObject<{
38
38
  }, z.core.$strip>;
39
39
  declare const updateRecurrenceRulesSchema: z.ZodObject<{
40
40
  id: z.ZodString;
41
+ interval: z.ZodNumber;
41
42
  bysetpos: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
42
43
  bymonth: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
43
44
  bymonthday: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
@@ -49,7 +50,6 @@ declare const updateRecurrenceRulesSchema: z.ZodObject<{
49
50
  bysecond: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
50
51
  freq: z.ZodNumber;
51
52
  dtstart: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
52
- interval: z.ZodNumber;
53
53
  wkst: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
54
54
  count: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
55
55
  until: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
@@ -61,6 +61,7 @@ declare const createRecurrenceSchema: z.ZodObject<{
61
61
  enabled: z.ZodBoolean;
62
62
  metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
63
63
  recurrenceRules: z.ZodArray<z.ZodObject<{
64
+ interval: z.ZodNumber;
64
65
  bysetpos: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
65
66
  bymonth: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
66
67
  bymonthday: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
@@ -72,7 +73,6 @@ declare const createRecurrenceSchema: z.ZodObject<{
72
73
  bysecond: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
73
74
  freq: z.ZodNumber;
74
75
  dtstart: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
75
- interval: z.ZodNumber;
76
76
  wkst: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
77
77
  count: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
78
78
  until: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
@@ -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";
@@ -0,0 +1,58 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ let zod = require("zod");
3
+ //#region src/modules/schemas/queryMatch.ts
4
+ const QUERY_FILTER_METHOD_TO_OP = {
5
+ equals: "$eq",
6
+ contains: "$contains",
7
+ starts_with: "$starts_with",
8
+ ends_with: "$ends_with",
9
+ greater_than: "$greater_than",
10
+ less_than: "$less_than",
11
+ on: "$on",
12
+ between: "$between",
13
+ before: "$before",
14
+ after: "$after",
15
+ oneOf: "$oneOf",
16
+ intersect: "$intersect",
17
+ isEmpty: "$isEmpty",
18
+ isNotEmpty: "$isNotEmpty",
19
+ is_null: "$is_null",
20
+ is_not_null: "$is_not_null"
21
+ };
22
+ const queryMatchSchema = zod.z.lazy(() => zod.z.record(zod.z.string(), zod.z.unknown()));
23
+ const matchQuerySchema = zod.z.object({
24
+ page: zod.z.number().optional(),
25
+ limit: zod.z.number().optional(),
26
+ sort: zod.z.string().optional(),
27
+ order: zod.z.enum(["asc", "desc"]).optional(),
28
+ match: queryMatchSchema.optional(),
29
+ q: zod.z.string().optional()
30
+ });
31
+ function queryFilterToMatch(filter) {
32
+ const op = QUERY_FILTER_METHOD_TO_OP[filter.method];
33
+ switch (filter.method) {
34
+ case "between": return { [filter.columnId]: { $between: [String(filter.value), filter.valueTo ?? ""] } };
35
+ case "intersect": return { [filter.columnId]: { $intersect: {
36
+ endColumnId: filter.endColumnId ?? "",
37
+ from: String(filter.value),
38
+ to: filter.valueTo ?? ""
39
+ } } };
40
+ case "isEmpty":
41
+ case "isNotEmpty":
42
+ case "is_null":
43
+ case "is_not_null": return { [filter.columnId]: { [op]: true } };
44
+ default: return { [filter.columnId]: { [op]: filter.value } };
45
+ }
46
+ }
47
+ /** Rename QueryFilters into a QueryMatch. Does not bake day bounds or gte. */
48
+ function queryFiltersToMatch(filters) {
49
+ if (!filters || filters.length === 0) return {};
50
+ if (filters.length === 1) return queryFilterToMatch(filters[0]);
51
+ return { $and: filters.map(queryFilterToMatch) };
52
+ }
53
+ //#endregion
54
+ exports.matchQuerySchema = matchQuerySchema;
55
+ exports.queryFiltersToMatch = queryFiltersToMatch;
56
+ exports.queryMatchSchema = queryMatchSchema;
57
+
58
+ //# sourceMappingURL=queryMatch.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queryMatch.cjs","names":["z"],"sources":["../../../../src/modules/schemas/queryMatch.ts"],"sourcesContent":["import { z } from \"zod\";\r\nimport type { QueryFilter, QueryFilters } from \"./query.schema\";\r\n\r\nconst QUERY_FILTER_METHOD_TO_OP = {\r\n equals: \"$eq\",\r\n contains: \"$contains\",\r\n starts_with: \"$starts_with\",\r\n ends_with: \"$ends_with\",\r\n greater_than: \"$greater_than\",\r\n less_than: \"$less_than\",\r\n on: \"$on\",\r\n between: \"$between\",\r\n before: \"$before\",\r\n after: \"$after\",\r\n oneOf: \"$oneOf\",\r\n intersect: \"$intersect\",\r\n isEmpty: \"$isEmpty\",\r\n isNotEmpty: \"$isNotEmpty\",\r\n is_null: \"$is_null\",\r\n is_not_null: \"$is_not_null\",\r\n} as const;\r\n\r\nexport type QueryMatchOp = (typeof QUERY_FILTER_METHOD_TO_OP)[QueryFilter[\"method\"]];\r\n\r\n/** Scalar or list value in a QueryMatch field / operator payload. */\r\nexport type QueryMatchScalar = string | number | boolean | Date | null;\r\n\r\nexport interface QueryMatchIntersect {\r\n readonly endColumnId: string;\r\n readonly from: string;\r\n readonly to: string;\r\n}\r\n\r\nexport interface QueryMatchOperators {\r\n readonly $eq?: QueryMatchScalar | readonly string[];\r\n readonly $ne?: QueryMatchScalar;\r\n readonly $gt?: QueryMatchScalar;\r\n readonly $gte?: QueryMatchScalar;\r\n readonly $lt?: QueryMatchScalar;\r\n readonly $lte?: QueryMatchScalar;\r\n readonly $in?: readonly QueryMatchScalar[];\r\n readonly $nin?: readonly QueryMatchScalar[];\r\n readonly $exists?: boolean;\r\n readonly $like?: string;\r\n readonly $contains?: QueryMatchScalar;\r\n readonly $starts_with?: QueryMatchScalar;\r\n readonly $ends_with?: QueryMatchScalar;\r\n readonly $greater_than?: QueryMatchScalar;\r\n readonly $less_than?: QueryMatchScalar;\r\n readonly $on?: QueryMatchScalar;\r\n readonly $between?: readonly [QueryMatchScalar, QueryMatchScalar];\r\n readonly $before?: QueryMatchScalar;\r\n readonly $after?: QueryMatchScalar;\r\n readonly $oneOf?: readonly string[];\r\n readonly $intersect?: QueryMatchIntersect;\r\n readonly $isEmpty?: boolean;\r\n readonly $isNotEmpty?: boolean;\r\n readonly $is_null?: boolean;\r\n readonly $is_not_null?: boolean;\r\n readonly $not?: QueryMatchOperators;\r\n}\r\n\r\nexport type QueryMatchFieldValue = QueryMatchScalar | readonly string[] | QueryMatchOperators;\r\n\r\nexport interface QueryMatch {\r\n readonly $and?: readonly QueryMatch[];\r\n readonly $or?: readonly QueryMatch[];\r\n readonly $not?: QueryMatch;\r\n readonly [field: string]: QueryMatchFieldValue | readonly QueryMatch[] | QueryMatch | undefined;\r\n}\r\n\r\nexport const queryMatchSchema: z.ZodType<QueryMatch> = z.lazy(() =>\r\n z.record(z.string(), z.unknown())\r\n) as z.ZodType<QueryMatch>;\r\n\r\nexport const matchQuerySchema = z.object({\r\n page: z.number().optional(),\r\n limit: z.number().optional(),\r\n sort: z.string().optional(),\r\n order: z.enum([\"asc\", \"desc\"]).optional(),\r\n match: queryMatchSchema.optional(),\r\n /** Global substring search. Clients should trim; servers treat empty / whitespace-only as no-op. */\r\n q: z.string().optional(),\r\n});\r\n\r\nexport type MatchQueryInput = z.infer<typeof matchQuerySchema>;\r\n\r\nfunction queryFilterToMatch(filter: QueryFilter): QueryMatch {\r\n const op = QUERY_FILTER_METHOD_TO_OP[filter.method];\r\n switch (filter.method) {\r\n case \"between\":\r\n return {\r\n [filter.columnId]: {\r\n $between: [String(filter.value), filter.valueTo ?? \"\"],\r\n },\r\n };\r\n case \"intersect\":\r\n return {\r\n [filter.columnId]: {\r\n $intersect: {\r\n endColumnId: filter.endColumnId ?? \"\",\r\n from: String(filter.value),\r\n to: filter.valueTo ?? \"\",\r\n },\r\n },\r\n };\r\n case \"isEmpty\":\r\n case \"isNotEmpty\":\r\n case \"is_null\":\r\n case \"is_not_null\":\r\n return { [filter.columnId]: { [op]: true } };\r\n default:\r\n return { [filter.columnId]: { [op]: filter.value } };\r\n }\r\n}\r\n\r\n/** Rename QueryFilters into a QueryMatch. Does not bake day bounds or gte. */\r\nexport function queryFiltersToMatch(filters: QueryFilters | undefined): QueryMatch {\r\n if (!filters || filters.length === 0) {\r\n return {};\r\n }\r\n if (filters.length === 1) {\r\n return queryFilterToMatch(filters[0]);\r\n }\r\n return { $and: filters.map(queryFilterToMatch) };\r\n}\r\n"],"mappings":";;;AAGA,MAAM,4BAA4B;CAChC,QAAQ;CACR,UAAU;CACV,aAAa;CACb,WAAW;CACX,cAAc;CACd,WAAW;CACX,IAAI;CACJ,SAAS;CACT,QAAQ;CACR,OAAO;CACP,OAAO;CACP,WAAW;CACX,SAAS;CACT,YAAY;CACZ,SAAS;CACT,aAAa;CACd;AAmDD,M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
3
+
4
+ //#region src/modules/schemas/queryMatch.d.ts
5
+ declare const QUERY_FILTER_METHOD_TO_OP: {
6
+ readonly equals: "$eq";
7
+ readonly contains: "$contains";
8
+ readonly starts_with: "$starts_with";
9
+ readonly ends_with: "$ends_with";
10
+ readonly greater_than: "$greater_than";
11
+ readonly less_than: "$less_than";
12
+ readonly on: "$on";
13
+ readonly between: "$between";
14
+ readonly before: "$before";
15
+ readonly after: "$after";
16
+ readonly oneOf: "$oneOf";
17
+ readonly intersect: "$intersect";
18
+ readonly isEmpty: "$isEmpty";
19
+ readonly isNotEmpty: "$isNotEmpty";
20
+ readonly is_null: "$is_null";
21
+ readonly is_not_null: "$is_not_null";
22
+ };
23
+ type QueryMatchOp = (typeof QUERY_FILTER_METHOD_TO_OP)[QueryFilter["method"]];
24
+ /** Scalar or list value in a QueryMatch field / operator payload. */
25
+ type QueryMatchScalar = string | number | boolean | Date | null;
26
+ interface QueryMatchIntersect {
27
+ readonly endColumnId: string;
28
+ readonly from: string;
29
+ readonly to: string;
30
+ }
31
+ interface QueryMatchOperators {
32
+ readonly $eq?: QueryMatchScalar | readonly string[];
33
+ readonly $ne?: QueryMatchScalar;
34
+ readonly $gt?: QueryMatchScalar;
35
+ readonly $gte?: QueryMatchScalar;
36
+ readonly $lt?: QueryMatchScalar;
37
+ readonly $lte?: QueryMatchScalar;
38
+ readonly $in?: readonly QueryMatchScalar[];
39
+ readonly $nin?: readonly QueryMatchScalar[];
40
+ readonly $exists?: boolean;
41
+ readonly $like?: string;
42
+ readonly $contains?: QueryMatchScalar;
43
+ readonly $starts_with?: QueryMatchScalar;
44
+ readonly $ends_with?: QueryMatchScalar;
45
+ readonly $greater_than?: QueryMatchScalar;
46
+ readonly $less_than?: QueryMatchScalar;
47
+ readonly $on?: QueryMatchScalar;
48
+ readonly $between?: readonly [QueryMatchScalar, QueryMatchScalar];
49
+ readonly $before?: QueryMatchScalar;
50
+ readonly $after?: QueryMatchScalar;
51
+ readonly $oneOf?: readonly string[];
52
+ readonly $intersect?: QueryMatchIntersect;
53
+ readonly $isEmpty?: boolean;
54
+ readonly $isNotEmpty?: boolean;
55
+ readonly $is_null?: boolean;
56
+ readonly $is_not_null?: boolean;
57
+ readonly $not?: QueryMatchOperators;
58
+ }
59
+ type QueryMatchFieldValue = QueryMatchScalar | readonly string[] | QueryMatchOperators;
60
+ interface QueryMatch {
61
+ readonly $and?: readonly QueryMatch[];
62
+ readonly $or?: readonly QueryMatch[];
63
+ readonly $not?: QueryMatch;
64
+ readonly [field: string]: QueryMatchFieldValue | readonly QueryMatch[] | QueryMatch | undefined;
65
+ }
66
+ declare const queryMatchSchema: z.ZodType<QueryMatch>;
67
+ declare const matchQuerySchema: z.ZodObject<{
68
+ page: z.ZodOptional<z.ZodNumber>;
69
+ limit: z.ZodOptional<z.ZodNumber>;
70
+ sort: z.ZodOptional<z.ZodString>;
71
+ order: z.ZodOptional<z.ZodEnum<{
72
+ asc: "asc";
73
+ desc: "desc";
74
+ }>>;
75
+ match: z.ZodOptional<z.ZodType<QueryMatch, unknown, z.core.$ZodTypeInternals<QueryMatch, unknown>>>;
76
+ q: z.ZodOptional<z.ZodString>;
77
+ }, z.core.$strip>;
78
+ type MatchQueryInput = z.infer<typeof matchQuerySchema>;
79
+ /** Rename QueryFilters into a QueryMatch. Does not bake day bounds or gte. */
80
+ declare function queryFiltersToMatch(filters: QueryFilters | undefined): QueryMatch;
81
+ //#endregion
82
+ export { MatchQueryInput, QueryMatch, QueryMatchFieldValue, QueryMatchIntersect, QueryMatchOp, QueryMatchOperators, QueryMatchScalar, matchQuerySchema, queryFiltersToMatch, queryMatchSchema };
83
+ //# sourceMappingURL=queryMatch.d.cts.map
@@ -0,0 +1,83 @@
1
+ import { QueryFilter, QueryFilters } from "./query.schema.mjs";
2
+ import { z } from "zod";
3
+
4
+ //#region src/modules/schemas/queryMatch.d.ts
5
+ declare const QUERY_FILTER_METHOD_TO_OP: {
6
+ readonly equals: "$eq";
7
+ readonly contains: "$contains";
8
+ readonly starts_with: "$starts_with";
9
+ readonly ends_with: "$ends_with";
10
+ readonly greater_than: "$greater_than";
11
+ readonly less_than: "$less_than";
12
+ readonly on: "$on";
13
+ readonly between: "$between";
14
+ readonly before: "$before";
15
+ readonly after: "$after";
16
+ readonly oneOf: "$oneOf";
17
+ readonly intersect: "$intersect";
18
+ readonly isEmpty: "$isEmpty";
19
+ readonly isNotEmpty: "$isNotEmpty";
20
+ readonly is_null: "$is_null";
21
+ readonly is_not_null: "$is_not_null";
22
+ };
23
+ type QueryMatchOp = (typeof QUERY_FILTER_METHOD_TO_OP)[QueryFilter["method"]];
24
+ /** Scalar or list value in a QueryMatch field / operator payload. */
25
+ type QueryMatchScalar = string | number | boolean | Date | null;
26
+ interface QueryMatchIntersect {
27
+ readonly endColumnId: string;
28
+ readonly from: string;
29
+ readonly to: string;
30
+ }
31
+ interface QueryMatchOperators {
32
+ readonly $eq?: QueryMatchScalar | readonly string[];
33
+ readonly $ne?: QueryMatchScalar;
34
+ readonly $gt?: QueryMatchScalar;
35
+ readonly $gte?: QueryMatchScalar;
36
+ readonly $lt?: QueryMatchScalar;
37
+ readonly $lte?: QueryMatchScalar;
38
+ readonly $in?: readonly QueryMatchScalar[];
39
+ readonly $nin?: readonly QueryMatchScalar[];
40
+ readonly $exists?: boolean;
41
+ readonly $like?: string;
42
+ readonly $contains?: QueryMatchScalar;
43
+ readonly $starts_with?: QueryMatchScalar;
44
+ readonly $ends_with?: QueryMatchScalar;
45
+ readonly $greater_than?: QueryMatchScalar;
46
+ readonly $less_than?: QueryMatchScalar;
47
+ readonly $on?: QueryMatchScalar;
48
+ readonly $between?: readonly [QueryMatchScalar, QueryMatchScalar];
49
+ readonly $before?: QueryMatchScalar;
50
+ readonly $after?: QueryMatchScalar;
51
+ readonly $oneOf?: readonly string[];
52
+ readonly $intersect?: QueryMatchIntersect;
53
+ readonly $isEmpty?: boolean;
54
+ readonly $isNotEmpty?: boolean;
55
+ readonly $is_null?: boolean;
56
+ readonly $is_not_null?: boolean;
57
+ readonly $not?: QueryMatchOperators;
58
+ }
59
+ type QueryMatchFieldValue = QueryMatchScalar | readonly string[] | QueryMatchOperators;
60
+ interface QueryMatch {
61
+ readonly $and?: readonly QueryMatch[];
62
+ readonly $or?: readonly QueryMatch[];
63
+ readonly $not?: QueryMatch;
64
+ readonly [field: string]: QueryMatchFieldValue | readonly QueryMatch[] | QueryMatch | undefined;
65
+ }
66
+ declare const queryMatchSchema: z.ZodType<QueryMatch>;
67
+ declare const matchQuerySchema: z.ZodObject<{
68
+ page: z.ZodOptional<z.ZodNumber>;
69
+ limit: z.ZodOptional<z.ZodNumber>;
70
+ sort: z.ZodOptional<z.ZodString>;
71
+ order: z.ZodOptional<z.ZodEnum<{
72
+ asc: "asc";
73
+ desc: "desc";
74
+ }>>;
75
+ match: z.ZodOptional<z.ZodType<QueryMatch, unknown, z.core.$ZodTypeInternals<QueryMatch, unknown>>>;
76
+ q: z.ZodOptional<z.ZodString>;
77
+ }, z.core.$strip>;
78
+ type MatchQueryInput = z.infer<typeof matchQuerySchema>;
79
+ /** Rename QueryFilters into a QueryMatch. Does not bake day bounds or gte. */
80
+ declare function queryFiltersToMatch(filters: QueryFilters | undefined): QueryMatch;
81
+ //#endregion
82
+ export { MatchQueryInput, QueryMatch, QueryMatchFieldValue, QueryMatchIntersect, QueryMatchOp, QueryMatchOperators, QueryMatchScalar, matchQuerySchema, queryFiltersToMatch, queryMatchSchema };
83
+ //# sourceMappingURL=queryMatch.d.mts.map
@@ -0,0 +1,55 @@
1
+ import { z } from "zod";
2
+ //#region src/modules/schemas/queryMatch.ts
3
+ const QUERY_FILTER_METHOD_TO_OP = {
4
+ equals: "$eq",
5
+ contains: "$contains",
6
+ starts_with: "$starts_with",
7
+ ends_with: "$ends_with",
8
+ greater_than: "$greater_than",
9
+ less_than: "$less_than",
10
+ on: "$on",
11
+ between: "$between",
12
+ before: "$before",
13
+ after: "$after",
14
+ oneOf: "$oneOf",
15
+ intersect: "$intersect",
16
+ isEmpty: "$isEmpty",
17
+ isNotEmpty: "$isNotEmpty",
18
+ is_null: "$is_null",
19
+ is_not_null: "$is_not_null"
20
+ };
21
+ const queryMatchSchema = z.lazy(() => z.record(z.string(), z.unknown()));
22
+ const matchQuerySchema = z.object({
23
+ page: z.number().optional(),
24
+ limit: z.number().optional(),
25
+ sort: z.string().optional(),
26
+ order: z.enum(["asc", "desc"]).optional(),
27
+ match: queryMatchSchema.optional(),
28
+ q: z.string().optional()
29
+ });
30
+ function queryFilterToMatch(filter) {
31
+ const op = QUERY_FILTER_METHOD_TO_OP[filter.method];
32
+ switch (filter.method) {
33
+ case "between": return { [filter.columnId]: { $between: [String(filter.value), filter.valueTo ?? ""] } };
34
+ case "intersect": return { [filter.columnId]: { $intersect: {
35
+ endColumnId: filter.endColumnId ?? "",
36
+ from: String(filter.value),
37
+ to: filter.valueTo ?? ""
38
+ } } };
39
+ case "isEmpty":
40
+ case "isNotEmpty":
41
+ case "is_null":
42
+ case "is_not_null": return { [filter.columnId]: { [op]: true } };
43
+ default: return { [filter.columnId]: { [op]: filter.value } };
44
+ }
45
+ }
46
+ /** Rename QueryFilters into a QueryMatch. Does not bake day bounds or gte. */
47
+ function queryFiltersToMatch(filters) {
48
+ if (!filters || filters.length === 0) return {};
49
+ if (filters.length === 1) return queryFilterToMatch(filters[0]);
50
+ return { $and: filters.map(queryFilterToMatch) };
51
+ }
52
+ //#endregion
53
+ export { matchQuerySchema, queryFiltersToMatch, queryMatchSchema };
54
+
55
+ //# sourceMappingURL=queryMatch.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queryMatch.mjs","names":[],"sources":["../../../../src/modules/schemas/queryMatch.ts"],"sourcesContent":["import { z } from \"zod\";\r\nimport type { QueryFilter, QueryFilters } from \"./query.schema\";\r\n\r\nconst QUERY_FILTER_METHOD_TO_OP = {\r\n equals: \"$eq\",\r\n contains: \"$contains\",\r\n starts_with: \"$starts_with\",\r\n ends_with: \"$ends_with\",\r\n greater_than: \"$greater_than\",\r\n less_than: \"$less_than\",\r\n on: \"$on\",\r\n between: \"$between\",\r\n before: \"$before\",\r\n after: \"$after\",\r\n oneOf: \"$oneOf\",\r\n intersect: \"$intersect\",\r\n isEmpty: \"$isEmpty\",\r\n isNotEmpty: \"$isNotEmpty\",\r\n is_null: \"$is_null\",\r\n is_not_null: \"$is_not_null\",\r\n} as const;\r\n\r\nexport type QueryMatchOp = (typeof QUERY_FILTER_METHOD_TO_OP)[QueryFilter[\"method\"]];\r\n\r\n/** Scalar or list value in a QueryMatch field / operator payload. */\r\nexport type QueryMatchScalar = string | number | boolean | Date | null;\r\n\r\nexport interface QueryMatchIntersect {\r\n readonly endColumnId: string;\r\n readonly from: string;\r\n readonly to: string;\r\n}\r\n\r\nexport interface QueryMatchOperators {\r\n readonly $eq?: QueryMatchScalar | readonly string[];\r\n readonly $ne?: QueryMatchScalar;\r\n readonly $gt?: QueryMatchScalar;\r\n readonly $gte?: QueryMatchScalar;\r\n readonly $lt?: QueryMatchScalar;\r\n readonly $lte?: QueryMatchScalar;\r\n readonly $in?: readonly QueryMatchScalar[];\r\n readonly $nin?: readonly QueryMatchScalar[];\r\n readonly $exists?: boolean;\r\n readonly $like?: string;\r\n readonly $contains?: QueryMatchScalar;\r\n readonly $starts_with?: QueryMatchScalar;\r\n readonly $ends_with?: QueryMatchScalar;\r\n readonly $greater_than?: QueryMatchScalar;\r\n readonly $less_than?: QueryMatchScalar;\r\n readonly $on?: QueryMatchScalar;\r\n readonly $between?: readonly [QueryMatchScalar, QueryMatchScalar];\r\n readonly $before?: QueryMatchScalar;\r\n readonly $after?: QueryMatchScalar;\r\n readonly $oneOf?: readonly string[];\r\n readonly $intersect?: QueryMatchIntersect;\r\n readonly $isEmpty?: boolean;\r\n readonly $isNotEmpty?: boolean;\r\n readonly $is_null?: boolean;\r\n readonly $is_not_null?: boolean;\r\n readonly $not?: QueryMatchOperators;\r\n}\r\n\r\nexport type QueryMatchFieldValue = QueryMatchScalar | readonly string[] | QueryMatchOperators;\r\n\r\nexport interface QueryMatch {\r\n readonly $and?: readonly QueryMatch[];\r\n readonly $or?: readonly QueryMatch[];\r\n readonly $not?: QueryMatch;\r\n readonly [field: string]: QueryMatchFieldValue | readonly QueryMatch[] | QueryMatch | undefined;\r\n}\r\n\r\nexport const queryMatchSchema: z.ZodType<QueryMatch> = z.lazy(() =>\r\n z.record(z.string(), z.unknown())\r\n) as z.ZodType<QueryMatch>;\r\n\r\nexport const matchQuerySchema = z.object({\r\n page: z.number().optional(),\r\n limit: z.number().optional(),\r\n sort: z.string().optional(),\r\n order: z.enum([\"asc\", \"desc\"]).optional(),\r\n match: queryMatchSchema.optional(),\r\n /** Global substring search. Clients should trim; servers treat empty / whitespace-only as no-op. */\r\n q: z.string().optional(),\r\n});\r\n\r\nexport type MatchQueryInput = z.infer<typeof matchQuerySchema>;\r\n\r\nfunction queryFilterToMatch(filter: QueryFilter): QueryMatch {\r\n const op = QUERY_FILTER_METHOD_TO_OP[filter.method];\r\n switch (filter.method) {\r\n case \"between\":\r\n return {\r\n [filter.columnId]: {\r\n $between: [String(filter.value), filter.valueTo ?? \"\"],\r\n },\r\n };\r\n case \"intersect\":\r\n return {\r\n [filter.columnId]: {\r\n $intersect: {\r\n endColumnId: filter.endColumnId ?? \"\",\r\n from: String(filter.value),\r\n to: filter.valueTo ?? \"\",\r\n },\r\n },\r\n };\r\n case \"isEmpty\":\r\n case \"isNotEmpty\":\r\n case \"is_null\":\r\n case \"is_not_null\":\r\n return { [filter.columnId]: { [op]: true } };\r\n default:\r\n return { [filter.columnId]: { [op]: filter.value } };\r\n }\r\n}\r\n\r\n/** Rename QueryFilters into a QueryMatch. Does not bake day bounds or gte. */\r\nexport function queryFiltersToMatch(filters: QueryFilters | undefined): QueryMatch {\r\n if (!filters || filters.length === 0) {\r\n return {};\r\n }\r\n if (filters.length === 1) {\r\n return queryFilterToMatch(filters[0]);\r\n }\r\n return { $and: filters.map(queryFilterToMatch) };\r\n}\r\n"],"mappings":";;AAGA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,QAAO,EAAE,MAAM,QAAQ,IAAI,mBAAmB,EAAE"}
@@ -9,7 +9,7 @@ const tagSchema = zod.z.object({
9
9
  createdAt: zod.z.date(),
10
10
  updatedAt: zod.z.date().nullish(),
11
11
  deletedAt: zod.z.date().nullish(),
12
- userId: zod.z.string(),
12
+ userId: zod.z.string().nullish(),
13
13
  name: zod.z.string(),
14
14
  color: zod.z.string().nullish(),
15
15
  type: zod.z.string().nullish(),
@@ -1 +1 @@
1
- {"version":3,"file":"tag.schema.cjs","names":["z","querySchema"],"sources":["../../../../src/modules/tag/tag.schema.ts"],"sourcesContent":["import { z } from \"zod\";\r\nimport { querySchema } from \"../schemas/query.schema\";\r\n\r\nexport const tagSchema = z.object({\r\n id: z.string(),\r\n organizationId: z.string().nullish(),\r\n teamId: z.string().nullish(),\r\n createdAt: z.date(),\r\n updatedAt: z.date().nullish(),\r\n deletedAt: z.date().nullish(),\r\n userId: z.string(),\r\n name: z.string(),\r\n color: z.string().nullish(),\r\n type: z.string().nullish(),\r\n isEnabled: z.boolean(),\r\n parentId: z.string().nullish(),\r\n assignableTo: z.string().array().nullish().default([]),\r\n});\r\n\r\nexport const taggingSchema = z.object({\r\n id: z.string(),\r\n createdAt: z.date(),\r\n tagId: z.string(),\r\n resourceType: z.string(),\r\n resourceId: z.string(),\r\n});\r\n\r\nexport const tagListInputSchema = querySchema;\r\n\r\nexport const tagListOutputSchema = z.object({\r\n rows: z.array(tagSchema),\r\n total: z.number(),\r\n});\r\n\r\nexport const tagListSchema = z.object({\r\n assignableTo: z.string().optional(),\r\n});\r\n\r\nexport const tagCreateSchema = z.object({\r\n organizationId: z.string().optional(),\r\n teamId: z.string().optional(),\r\n name: z.string(),\r\n color: z.string(),\r\n assignableTo: z.string().array().optional().default([]),\r\n resourceType: z.string().optional(),\r\n resourceId: z.string().optional(),\r\n parentId: z.string().nullish(),\r\n type: z.string().nullish(),\r\n});\r\n\r\nexport const tagUpdateSchema = z.object({\r\n id: z.string(),\r\n name: z.string().optional(),\r\n color: z.string().optional(),\r\n assignableTo: z.string().array().optional(),\r\n parentId: z.string().nullish(),\r\n type: z.string().nullish(),\r\n});\r\n\r\nexport const tagLinkSchema = z.object({\r\n tagId: z.string(),\r\n resourceType: z.string(),\r\n resourceId: z.string(),\r\n});\r\n\r\nexport const tagDeleteSchema = z.object({\r\n id: z.string(),\r\n});\r\n\r\nexport type TagSchema = z.infer<typeof tagSchema>;\r\nexport type TaggingSchema = z.infer<typeof taggingSchema>;\r\nexport type TagListSchema = z.infer<typeof tagListSchema>;\r\nexport type TagCreateSchema = z.infer<typeof tagCreateSchema>;\r\nexport type TagUpdateSchema = z.infer<typeof tagUpdateSchema>;\r\nexport type TagLinkSchema = z.infer<typeof tagLinkSchema>;\r\nexport type TagDeleteSchema = z.infer<typeof tagDeleteSchema>;\r\nexport type TagListOutputSchema = z.infer<typeof tagListOutputSchema>;\r\nexport type TagListInputSchema = z.infer<typeof tagListInputSchema>;\r\n"],"mappings":";;;;AAGA,MAAa,YAAYA,IAAAA,EAAE,OAAO;CAChC,IAAIA,IAAAA,EAAE,QAAQ;CACd,gBAAgBA,IAAAA,EAAE,QAAQ,CAAC,SAAS;CACpC,QAAQA,IAAAA,EAAE,QAAQ,CAAC,SAAS;CAC5B,WAAWA,IAAAA,EAAE,MAAM;CACnB,WAAWA,IAAAA,EAAE,MAAM,CAAC,SAAS;CAC7B,WAAWA,IAAAA,EAAE,MAAM,CAAC,SAAS;CAC7B,QAAQA,IAAAA,EAAE,QAAQ;CAClB,MAAMA,IAAAA,EAAE,QAAQ;CAChB,OAAOA,IAAAA,EAAE,QAAQ,CAAC,SAAS;CAC3B,MAAMA,IAAAA,EAAE,QAAQ,CAAC,SAAS;CAC1B,WAAWA,IAAAA,EAAE,SAAS;CACtB,UAAUA,IAAAA,EAAE,QAAQ,CAAC,SAAS;CAC9B,cAAcA,IAAAA,EAAE,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;CACvD,CAAC;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C9B,MAAMA,IAAAA,EAAE,QAAQ,CAAC,SAAS;CAC3B,CAAC;AAEF,MAAa,gBAAgBA,IAAAA,EAAE,OAAO;CACpC,OAAOA,IAAAA,EAAE,QAAQ;CACjB,cAAcA,IAAAA,EAAE,QAAQ;CACxB,YAAYA,IAAAA,EAAE,QAAQ;CACvB,CAAC;AAEF,MAAa,kBAAkBA,IAAAA,EAAE,OAAO,EACtC,IAAIA,IAAAA,EAAE,QAAQ,EACf,CAAC"}
1
+ {"version":3,"file":"tag.schema.cjs","names":["z","querySchema"],"sources":["../../../../src/modules/tag/tag.schema.ts"],"sourcesContent":["import { z } from \"zod\";\r\nimport { querySchema } from \"../schemas/query.schema\";\r\n\r\nexport const tagSchema = z.object({\r\n id: z.string(),\r\n organizationId: z.string().nullish(),\r\n teamId: z.string().nullish(),\r\n createdAt: z.date(),\r\n updatedAt: z.date().nullish(),\r\n deletedAt: z.date().nullish(),\r\n userId: z.string().nullish(),\r\n name: z.string(),\r\n color: z.string().nullish(),\r\n type: z.string().nullish(),\r\n isEnabled: z.boolean(),\r\n parentId: z.string().nullish(),\r\n assignableTo: z.string().array().nullish().default([]),\r\n});\r\n\r\nexport const taggingSchema = z.object({\r\n id: z.string(),\r\n createdAt: z.date(),\r\n tagId: z.string(),\r\n resourceType: z.string(),\r\n resourceId: z.string(),\r\n});\r\n\r\nexport const tagListInputSchema = querySchema;\r\n\r\nexport const tagListOutputSchema = z.object({\r\n rows: z.array(tagSchema),\r\n total: z.number(),\r\n});\r\n\r\nexport const tagListSchema = z.object({\r\n assignableTo: z.string().optional(),\r\n});\r\n\r\nexport const tagCreateSchema = z.object({\r\n organizationId: z.string().optional(),\r\n teamId: z.string().optional(),\r\n name: z.string(),\r\n color: z.string(),\r\n assignableTo: z.string().array().optional().default([]),\r\n resourceType: z.string().optional(),\r\n resourceId: z.string().optional(),\r\n parentId: z.string().nullish(),\r\n type: z.string().nullish(),\r\n});\r\n\r\nexport const tagUpdateSchema = z.object({\r\n id: z.string(),\r\n name: z.string().optional(),\r\n color: z.string().optional(),\r\n assignableTo: z.string().array().optional(),\r\n parentId: z.string().nullish(),\r\n type: z.string().nullish(),\r\n});\r\n\r\nexport const tagLinkSchema = z.object({\r\n tagId: z.string(),\r\n resourceType: z.string(),\r\n resourceId: z.string(),\r\n});\r\n\r\nexport const tagDeleteSchema = z.object({\r\n id: z.string(),\r\n});\r\n\r\nexport type TagSchema = z.infer<typeof tagSchema>;\r\nexport type TaggingSchema = z.infer<typeof taggingSchema>;\r\nexport type TagListSchema = z.infer<typeof tagListSchema>;\r\nexport type TagCreateSchema = z.infer<typeof tagCreateSchema>;\r\nexport type TagUpdateSchema = z.infer<typeof tagUpdateSchema>;\r\nexport type TagLinkSchema = z.infer<typeof tagLinkSchema>;\r\nexport type TagDeleteSchema = z.infer<typeof tagDeleteSchema>;\r\nexport type TagListOutputSchema = z.infer<typeof tagListOutputSchema>;\r\nexport type TagListInputSchema = z.infer<typeof tagListInputSchema>;\r\n"],"mappings":";;;;AAGA,MAAa,YAAYA,IAAAA,EAAE,OAAO;CAChC,IAAIA,IAAAA,EAAE,QAAQ;CACd,gBAAgBA,IAAAA,EAAE,QAAQ,CAAC,SAAS;CACpC,QAAQA,IAAAA,EAAE,QAAQ,CAAC,SAAS;CAC5B,WAAWA,IAAAA,EAAE,MAAM;CACnB,WAAWA,IAAAA,EAAE,MAAM,CAAC,SAAS;CAC7B,WAAWA,IAAAA,EAAE,MAAM,CAAC,SAAS;CAC7B,QAAQA,IAAAA,EAAE,QAAQ,CAAC,SAAS;CAC5B,MAAMA,IAAAA,EAAE,QAAQ;CAChB,OAAOA,IAAAA,EAAE,QAAQ,CAAC,SAAS;CAC3B,MAAMA,IAAAA,EAAE,QAAQ,CAAC,SAAS;CAC1B,WAAWA,IAAAA,EAAE,SAAS;CACtB,UAAUA,IAAAA,EAAE,QAAQ,CAAC,SAAS;CAC9B,cAAcA,IAAAA,EAAE,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,QAA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EAAE,QAAQ,CAAC,SAAS;CAC9B,MAAMA,IAAAA,EAAE,QAAQ,CAAC,SAAS;CAC3B,CAAC;AAEF,MAAa,gBAAgBA,IAAAA,EAAE,OAAO;CACpC,OAAOA,IAAAA,EAAE,QAAQ;CACjB,cAAcA,IAAAA,EAAE,QAAQ;CACxB,YAAYA,IAAAA,EAAE,QAAQ;CACvB,CAAC;AAEF,MAAa,kBAAkBA,IAAAA,EAAE,OAAO,EACtC,IAAIA,IAAAA,EAAE,QAAQ,EACf,CAAC"}
@@ -8,7 +8,7 @@ declare const tagSchema: z.ZodObject<{
8
8
  createdAt: z.ZodDate;
9
9
  updatedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
10
10
  deletedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
11
- userId: z.ZodString;
11
+ userId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
12
  name: z.ZodString;
13
13
  color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
14
14
  type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -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";
@@ -73,7 +73,7 @@ declare const tagListOutputSchema: z.ZodObject<{
73
73
  createdAt: z.ZodDate;
74
74
  updatedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
75
75
  deletedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
76
- userId: z.ZodString;
76
+ userId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
77
77
  name: z.ZodString;
78
78
  color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
79
79
  type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -8,7 +8,7 @@ declare const tagSchema: z.ZodObject<{
8
8
  createdAt: z.ZodDate;
9
9
  updatedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
10
10
  deletedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
11
- userId: z.ZodString;
11
+ userId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
12
  name: z.ZodString;
13
13
  color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
14
14
  type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -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";
@@ -73,7 +73,7 @@ declare const tagListOutputSchema: z.ZodObject<{
73
73
  createdAt: z.ZodDate;
74
74
  updatedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
75
75
  deletedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
76
- userId: z.ZodString;
76
+ userId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
77
77
  name: z.ZodString;
78
78
  color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
79
79
  type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -8,7 +8,7 @@ const tagSchema = z.object({
8
8
  createdAt: z.date(),
9
9
  updatedAt: z.date().nullish(),
10
10
  deletedAt: z.date().nullish(),
11
- userId: z.string(),
11
+ userId: z.string().nullish(),
12
12
  name: z.string(),
13
13
  color: z.string().nullish(),
14
14
  type: z.string().nullish(),
@@ -1 +1 @@
1
- {"version":3,"file":"tag.schema.mjs","names":[],"sources":["../../../../src/modules/tag/tag.schema.ts"],"sourcesContent":["import { z } from \"zod\";\r\nimport { querySchema } from \"../schemas/query.schema\";\r\n\r\nexport const tagSchema = z.object({\r\n id: z.string(),\r\n organizationId: z.string().nullish(),\r\n teamId: z.string().nullish(),\r\n createdAt: z.date(),\r\n updatedAt: z.date().nullish(),\r\n deletedAt: z.date().nullish(),\r\n userId: z.string(),\r\n name: z.string(),\r\n color: z.string().nullish(),\r\n type: z.string().nullish(),\r\n isEnabled: z.boolean(),\r\n parentId: z.string().nullish(),\r\n assignableTo: z.string().array().nullish().default([]),\r\n});\r\n\r\nexport const taggingSchema = z.object({\r\n id: z.string(),\r\n createdAt: z.date(),\r\n tagId: z.string(),\r\n resourceType: z.string(),\r\n resourceId: z.string(),\r\n});\r\n\r\nexport const tagListInputSchema = querySchema;\r\n\r\nexport const tagListOutputSchema = z.object({\r\n rows: z.array(tagSchema),\r\n total: z.number(),\r\n});\r\n\r\nexport const tagListSchema = z.object({\r\n assignableTo: z.string().optional(),\r\n});\r\n\r\nexport const tagCreateSchema = z.object({\r\n organizationId: z.string().optional(),\r\n teamId: z.string().optional(),\r\n name: z.string(),\r\n color: z.string(),\r\n assignableTo: z.string().array().optional().default([]),\r\n resourceType: z.string().optional(),\r\n resourceId: z.string().optional(),\r\n parentId: z.string().nullish(),\r\n type: z.string().nullish(),\r\n});\r\n\r\nexport const tagUpdateSchema = z.object({\r\n id: z.string(),\r\n name: z.string().optional(),\r\n color: z.string().optional(),\r\n assignableTo: z.string().array().optional(),\r\n parentId: z.string().nullish(),\r\n type: z.string().nullish(),\r\n});\r\n\r\nexport const tagLinkSchema = z.object({\r\n tagId: z.string(),\r\n resourceType: z.string(),\r\n resourceId: z.string(),\r\n});\r\n\r\nexport const tagDeleteSchema = z.object({\r\n id: z.string(),\r\n});\r\n\r\nexport type TagSchema = z.infer<typeof tagSchema>;\r\nexport type TaggingSchema = z.infer<typeof taggingSchema>;\r\nexport type TagListSchema = z.infer<typeof tagListSchema>;\r\nexport type TagCreateSchema = z.infer<typeof tagCreateSchema>;\r\nexport type TagUpdateSchema = z.infer<typeof tagUpdateSchema>;\r\nexport type TagLinkSchema = z.infer<typeof tagLinkSchema>;\r\nexport type TagDeleteSchema = z.infer<typeof tagDeleteSchema>;\r\nexport type TagListOutputSchema = z.infer<typeof tagListOutputSchema>;\r\nexport type TagListInputSchema = z.infer<typeof tagListInputSchema>;\r\n"],"mappings":";;;AAGA,MAAa,YAAY,EAAE,OAAO;CAChC,IAAI,EAAE,QAAQ;CACd,gBAAgB,EAAE,QAAQ,CAAC,SAAS;CACpC,QAAQ,EAAE,QAAQ,CAAC,SAAS;CAC5B,WAAW,EAAE,MAAM;CACnB,WAAW,EAAE,MAAM,CAAC,SAAS;CAC7B,WAAW,EAAE,MAAM,CAAC,SAAS;CAC7B,QAAQ,EAAE,QAAQ;CAClB,MAAM,EAAE,QAAQ;CAChB,OAAO,EAAE,QAAQ,CAAC,SAAS;CAC3B,MAAM,EAAE,QAAQ,CAAC,SAAS;CAC1B,WAAW,EAAE,SAAS;CACtB,UAAU,EAAE,QAAQ,CAAC,SAAS;CAC9B,cAAc,EAAE,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;CACvD,CAAC;AAEF,MAAa,gBAAgB,EAAE,OAAO;CACpC,IAAI,EAAE,QAAQ;CACd,WAAW,EAAE,MAAM;CACnB,OAAO,EAAE,QAAQ;CACjB,cAAc,EAAE,QAAQ;CACxB,YAAY,EAAE,QAAQ;CACvB,CAAC;AAEF,MAAa,qBAAqB;AAElC,MAAa,sBAAsB,EAAE,OAAO;CAC1C,MAAM,EAAE,MAAM,UAAU;CACxB,OAAO,EAAE,QAAQ;CAClB,CAAC;AAEF,MAAa,gBAAgB,EAAE,OAAO,EACpC,cAAc,EAAE,QAAQ,CAAC,UAAU,EACpC,CAAC;AAEF,MAAa,kBAAkB,EAAE,OAAO;CACtC,gBAAgB,EAAE,QAAQ,CAAC,UAAU;CACrC,QAAQ,EAAE,QAAQ,CAAC,UAAU;CAC7B,MAAM,EAAE,QAAQ;CAChB,OAAO,EAAE,QAAQ;CACjB,cAAc,EAAE,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;CACvD,cAAc,EAAE,QAAQ,CAAC,UAAU;CACnC,YAAY,EAAE,QAAQ,CAAC,UAAU;CACjC,UAAU,EAAE,QAAQ,CAAC,SAAS;CAC9B,MAAM,EAAE,QAAQ,CAAC,SAAS;CAC3B,CAAC;AAEF,MAAa,kBAAkB,EAAE,OAAO;CACtC,IAAI,EAAE,QAAQ;CACd,MAAM,EAAE,QAAQ,CAAC,UAAU;CAC3B,OAAO,EAAE,QAAQ,CAAC,UAAU;CAC5B,cAAc,EAAE,QAAQ,CAAC,OAAO,CAAC,UAAU;CAC3C,UAAU,EAAE,QAAQ,CAAC,SAAS;CAC9B,MAAM,EAAE,QAAQ,CAAC,SAAS;CAC3B,CAAC;AAEF,MAAa,gBAAgB,EAAE,OAAO;CACpC,OAAO,EAAE,QAAQ;CACjB,cAAc,EAAE,QAAQ;CACxB,YAAY,EAAE,QAAQ;CACvB,CAAC;AAEF,MAAa,kBAAkB,EAAE,OAAO,EACtC,IAAI,EAAE,QAAQ,EACf,CAAC"}
1
+ {"version":3,"file":"tag.schema.mjs","names":[],"sources":["../../../../src/modules/tag/tag.schema.ts"],"sourcesContent":["import { z } from \"zod\";\r\nimport { querySchema } from \"../schemas/query.schema\";\r\n\r\nexport const tagSchema = z.object({\r\n id: z.string(),\r\n organizationId: z.string().nullish(),\r\n teamId: z.string().nullish(),\r\n createdAt: z.date(),\r\n updatedAt: z.date().nullish(),\r\n deletedAt: z.date().nullish(),\r\n userId: z.string().nullish(),\r\n name: z.string(),\r\n color: z.string().nullish(),\r\n type: z.string().nullish(),\r\n isEnabled: z.boolean(),\r\n parentId: z.string().nullish(),\r\n assignableTo: z.string().array().nullish().default([]),\r\n});\r\n\r\nexport const taggingSchema = z.object({\r\n id: z.string(),\r\n createdAt: z.date(),\r\n tagId: z.string(),\r\n resourceType: z.string(),\r\n resourceId: z.string(),\r\n});\r\n\r\nexport const tagListInputSchema = querySchema;\r\n\r\nexport const tagListOutputSchema = z.object({\r\n rows: z.array(tagSchema),\r\n total: z.number(),\r\n});\r\n\r\nexport const tagListSchema = z.object({\r\n assignableTo: z.string().optional(),\r\n});\r\n\r\nexport const tagCreateSchema = z.object({\r\n organizationId: z.string().optional(),\r\n teamId: z.string().optional(),\r\n name: z.string(),\r\n color: z.string(),\r\n assignableTo: z.string().array().optional().default([]),\r\n resourceType: z.string().optional(),\r\n resourceId: z.string().optional(),\r\n parentId: z.string().nullish(),\r\n type: z.string().nullish(),\r\n});\r\n\r\nexport const tagUpdateSchema = z.object({\r\n id: z.string(),\r\n name: z.string().optional(),\r\n color: z.string().optional(),\r\n assignableTo: z.string().array().optional(),\r\n parentId: z.string().nullish(),\r\n type: z.string().nullish(),\r\n});\r\n\r\nexport const tagLinkSchema = z.object({\r\n tagId: z.string(),\r\n resourceType: z.string(),\r\n resourceId: z.string(),\r\n});\r\n\r\nexport const tagDeleteSchema = z.object({\r\n id: z.string(),\r\n});\r\n\r\nexport type TagSchema = z.infer<typeof tagSchema>;\r\nexport type TaggingSchema = z.infer<typeof taggingSchema>;\r\nexport type TagListSchema = z.infer<typeof tagListSchema>;\r\nexport type TagCreateSchema = z.infer<typeof tagCreateSchema>;\r\nexport type TagUpdateSchema = z.infer<typeof tagUpdateSchema>;\r\nexport type TagLinkSchema = z.infer<typeof tagLinkSchema>;\r\nexport type TagDeleteSchema = z.infer<typeof tagDeleteSchema>;\r\nexport type TagListOutputSchema = z.infer<typeof tagListOutputSchema>;\r\nexport type TagListInputSchema = z.infer<typeof tagListInputSchema>;\r\n"],"mappings":";;;AAGA,MAAa,YAAY,EAAE,OAAO;CAChC,IAAI,EAAE,QAAQ;CACd,gBAAgB,EAAE,QAAQ,CAAC,SAAS;CACpC,QAAQ,EAAE,QAAQ,CAAC,SAAS;CAC5B,WAAW,EAAE,MAAM;CACnB,WAAW,EAAE,MAAM,CAAC,SAAS;CAC7B,WAAW,EAAE,MAAM,CAAC,SAAS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AAO,CAAC,UAAU;CAC3C,UAAU,EAAE,QAAQ,CAAC,SAAS;CAC9B,MAAM,EAAE,QAAQ,CAAC,SAAS;CAC3B,CAAC;AAEF,MAAa,gBAAgB,EAAE,OAAO;CACpC,OAAO,EAAE,QAAQ;CACjB,cAAc,EAAE,QAAQ;CACxB,YAAY,EAAE,QAAQ;CACvB,CAAC;AAEF,MAAa,kBAAkB,EAAE,OAAO,EACtC,IAAI,EAAE,QAAQ,EACf,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"workflow.constants.cjs","names":[],"sources":["../../../../src/modules/workflow/workflow.constants.ts"],"sourcesContent":["export const WORKFLOW_STATUSES = [\"queued\", \"running\", \"completed\", \"failed\"] as const;\nexport type WorkflowStatus = (typeof WORKFLOW_STATUSES)[number];\n\n/** @deprecated Use WORKFLOW_STATUSES instead. */\nexport const WORFLOW_STATUSES = WORKFLOW_STATUSES;\n"],"mappings":";;AAAA,MAAa,oBAAoB;CAAC;CAAU;CAAW;CAAa;CAAS;;AAI7E,MAAa,mBAAmB"}
1
+ {"version":3,"file":"workflow.constants.cjs","names":[],"sources":["../../../../src/modules/workflow/workflow.constants.ts"],"sourcesContent":["export const WORKFLOW_STATUSES = [\"queued\", \"running\", \"completed\", \"failed\"] as const;\r\nexport type WorkflowStatus = (typeof WORKFLOW_STATUSES)[number];\r\n\r\n/** @deprecated Use WORKFLOW_STATUSES instead. */\r\nexport const WORFLOW_STATUSES = WORKFLOW_STATUSES;\r\n"],"mappings":";;AAAA,MAAa,oBAAoB;CAAC;CAAU;CAAW;CAAa;CAAS;;AAI7E,MAAa,mBAAmB"}
@@ -1 +1 @@
1
- {"version":3,"file":"workflow.constants.mjs","names":[],"sources":["../../../../src/modules/workflow/workflow.constants.ts"],"sourcesContent":["export const WORKFLOW_STATUSES = [\"queued\", \"running\", \"completed\", \"failed\"] as const;\nexport type WorkflowStatus = (typeof WORKFLOW_STATUSES)[number];\n\n/** @deprecated Use WORKFLOW_STATUSES instead. */\nexport const WORFLOW_STATUSES = WORKFLOW_STATUSES;\n"],"mappings":";AAAA,MAAa,oBAAoB;CAAC;CAAU;CAAW;CAAa;CAAS;;AAI7E,MAAa,mBAAmB"}
1
+ {"version":3,"file":"workflow.constants.mjs","names":[],"sources":["../../../../src/modules/workflow/workflow.constants.ts"],"sourcesContent":["export const WORKFLOW_STATUSES = [\"queued\", \"running\", \"completed\", \"failed\"] as const;\r\nexport type WorkflowStatus = (typeof WORKFLOW_STATUSES)[number];\r\n\r\n/** @deprecated Use WORKFLOW_STATUSES instead. */\r\nexport const WORFLOW_STATUSES = WORKFLOW_STATUSES;\r\n"],"mappings":";AAAA,MAAa,oBAAoB;CAAC;CAAU;CAAW;CAAa;CAAS;;AAI7E,MAAa,mBAAmB"}
@@ -1 +1 @@
1
- {"version":3,"file":"workflow.schema.cjs","names":["z","WORKFLOW_STATUSES"],"sources":["../../../../src/modules/workflow/workflow.schema.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { WORKFLOW_STATUSES } from \"./workflow.constants\";\n\nexport const workflowSelectSchema = z.object({\n id: z.uuid(),\n userId: z.string().nullable(),\n jobId: z.string(),\n jobName: z.string(),\n queueName: z.string(),\n tags: z.array(z.string()).nullable(),\n input: z.unknown(),\n output: z.unknown(),\n status: z.enum(WORKFLOW_STATUSES),\n error: z.string().nullable(),\n retries: z.number(),\n finishedAt: z.date().nullable(),\n processedAt: z.date().nullable(),\n createdAt: z.date(),\n updatedAt: z.date(),\n});\n\nexport const workflowReadInputSchema = z.object({\n jobId: z.string(),\n});\n\nexport const workflowListInputSchema = z.object({\n status: z.enum(WORKFLOW_STATUSES).array().optional(),\n jobName: z.string().optional(),\n});\n\nexport const workflowTriggerOutputSchema = z.object({\n jobId: z.string(),\n});\n\nexport const workflowTriggerManyOutputSchema = z.object({\n jobIds: z.array(z.string()),\n});\n\nexport const workflowReadOutputSchema = workflowSelectSchema;\nexport const workflowListOutputSchema = workflowSelectSchema.array();\n\nexport type WorkflowSelectSchema = z.infer<typeof workflowSelectSchema>;\nexport type WorkflowReadInputSchema = z.infer<typeof workflowReadInputSchema>;\nexport type WorkflowListInputSchema = z.infer<typeof workflowListInputSchema>;\nexport type WorkflowReadOutputSchema = z.infer<typeof workflowReadOutputSchema>;\nexport type WorkflowListOutputSchema = z.infer<typeof workflowListOutputSchema>;\nexport type WorkflowTriggerOutputSchema = z.infer<typeof workflowTriggerOutputSchema>;\nexport type WorkflowTriggerManyOutputSchema = z.infer<typeof workflowTriggerManyOutputSchema>;\n"],"mappings":";;;;AAGA,MAAa,uBAAuBA,IAAAA,EAAE,OAAO;CAC3C,IAAIA,IAAAA,EAAE,MAAM;CACZ,QAAQA,IAAAA,EAAE,QAAQ,CAAC,UAAU;CAC7B,OAAOA,IAAAA,EAAE,QAAQ;CACjB,SAASA,IAAAA,EAAE,QAAQ;CACnB,WAAWA,IAAAA,EAAE,QAAQ;CACrB,MAAMA,IAAAA,EAAE,MAAMA,IAAAA,EAAE,QAAQ,CAAC,CAAC,UAAU;CACpC,OAAOA,IAAAA,EAAE,SAAS;CAClB,QAAQA,IAAAA,EAAE,SAAS;CACnB,QAAQA,IAAAA,EAAE,KAAKC,gDAAAA,kBAAkB;CACjC,OAAOD,IAAAA,EAAE,QAAQ,CAAC,UAAU;CAC5B,SAASA,IAAAA,EAAE,QAAQ;CACnB,YAAYA,IAAAA,EAAE,MAAM,CAAC,UAAU;CAC/B,aAAaA,IAAAA,EAAE,MAAM,CAAC,UAAU;CAChC,WAAWA,IAAAA,EAAE,MAAM;CACnB,WAAWA,IAAAA,EAAE,MAAM;CACpB,CAAC;AAEF,MAAa,0BAA0BA,IAAAA,EAAE,OAAO,EAC9C,OAAOA,IAAAA,EAAE,QAAQ,EAClB,CAAC;AAEF,MAAa,0BAA0BA,IAAAA,EAAE,OAAO;CAC9C,QAAQA,IAAAA,EAAE,KAAKC,gDAAAA,kBAAkB,CAAC,OAAO,CAAC,UAAU;CACpD,SAASD,IAAAA,EAAE,QAAQ,CAAC,UAAU;CAC/B,CAAC;AAEF,MAAa,8BAA8BA,IAAAA,EAAE,OAAO,EAClD,OAAOA,IAAAA,EAAE,QAAQ,EAClB,CAAC;AAEF,MAAa,kCAAkCA,IAAAA,EAAE,OAAO,EACtD,QAAQA,IAAAA,EAAE,MAAMA,IAAAA,EAAE,QAAQ,CAAC,EAC5B,CAAC;AAEF,MAAa,2BAA2B;AACxC,MAAa,2BAA2B,qBAAqB,OAAO"}
1
+ {"version":3,"file":"workflow.schema.cjs","names":["z","WORKFLOW_STATUSES"],"sources":["../../../../src/modules/workflow/workflow.schema.ts"],"sourcesContent":["import { z } from \"zod\";\r\nimport { WORKFLOW_STATUSES } from \"./workflow.constants\";\r\n\r\nexport const workflowSelectSchema = z.object({\r\n id: z.uuid(),\r\n userId: z.string().nullable(),\r\n jobId: z.string(),\r\n jobName: z.string(),\r\n queueName: z.string(),\r\n tags: z.array(z.string()).nullable(),\r\n input: z.unknown(),\r\n output: z.unknown(),\r\n status: z.enum(WORKFLOW_STATUSES),\r\n error: z.string().nullable(),\r\n retries: z.number(),\r\n finishedAt: z.date().nullable(),\r\n processedAt: z.date().nullable(),\r\n createdAt: z.date(),\r\n updatedAt: z.date(),\r\n});\r\n\r\nexport const workflowReadInputSchema = z.object({\r\n jobId: z.string(),\r\n});\r\n\r\nexport const workflowListInputSchema = z.object({\r\n status: z.enum(WORKFLOW_STATUSES).array().optional(),\r\n jobName: z.string().optional(),\r\n});\r\n\r\nexport const workflowTriggerOutputSchema = z.object({\r\n jobId: z.string(),\r\n});\r\n\r\nexport const workflowTriggerManyOutputSchema = z.object({\r\n jobIds: z.array(z.string()),\r\n});\r\n\r\nexport const workflowReadOutputSchema = workflowSelectSchema;\r\nexport const workflowListOutputSchema = workflowSelectSchema.array();\r\n\r\nexport type WorkflowSelectSchema = z.infer<typeof workflowSelectSchema>;\r\nexport type WorkflowReadInputSchema = z.infer<typeof workflowReadInputSchema>;\r\nexport type WorkflowListInputSchema = z.infer<typeof workflowListInputSchema>;\r\nexport type WorkflowReadOutputSchema = z.infer<typeof workflowReadOutputSchema>;\r\nexport type WorkflowListOutputSchema = z.infer<typeof workflowListOutputSchema>;\r\nexport type WorkflowTriggerOutputSchema = z.infer<typeof workflowTriggerOutputSchema>;\r\nexport type WorkflowTriggerManyOutputSchema = z.infer<typeof workflowTriggerManyOutputSchema>;\r\n"],"mappings":";;;;AAGA,MAAa,uBAAuBA,IAAAA,EAAE,OAAO;CAC3C,IAAIA,IAAAA,EAAE,MAAM;CACZ,QAAQA,IAAAA,EAAE,QAAQ,CAAC,UAAU;CAC7B,OAAOA,IAAAA,EAAE,QAAQ;CACjB,SAASA,IAAAA,EAAE,QAAQ;CACnB,WAAWA,IAAAA,EAAE,QAAQ;CACrB,MAAMA,IAAAA,EAAE,MAAMA,IAAAA,EAAE,QAAQ,CAAC,CAAC,UAAU;CACpC,OAAOA,IAAAA,EAAE,SAAS;CAClB,QAAQA,IAAAA,EAAE,SAAS;CACnB,QAAQA,IAAAA,EAAE,KAAKC,gDAAAA,kBAAkB;CACjC,OAAOD,IAAAA,EAAE,QAAQ,CAAC,UAAU;CAC5B,SAASA,IAAAA,EAAE,QAAQ;CACnB,YAAYA,IAAAA,EAAE,MAAM,CAAC,UAAU;CAC/B,aAAaA,IAAAA,EAAE,MAAM,CAAC,UAAU;CAChC,WAAWA,IAAAA,EAAE,MAAM;CACnB,WAAWA,IAAAA,EAAE,MAAM;CACpB,CAAC;AAEF,MAAa,0BAA0BA,IAAAA,EAAE,OAAO,EAC9C,OAAOA,IAAAA,EAAE,QAAQ,EAClB,CAAC;AAEF,MAAa,0BAA0BA,IAAAA,EAAE,OAAO;CAC9C,QAAQA,IAAAA,EAAE,KAAKC,gDAAAA,kBAAkB,CAAC,OAAO,CAAC,UAAU;CACpD,SAASD,IAAAA,EAAE,QAAQ,CAAC,UAAU;CAC/B,CAAC;AAEF,MAAa,8BAA8BA,IAAAA,EAAE,OAAO,EAClD,OAAOA,IAAAA,EAAE,QAAQ,EAClB,CAAC;AAEF,MAAa,kCAAkCA,IAAAA,EAAE,OAAO,EACtD,QAAQA,IAAAA,EAAE,MAAMA,IAAAA,EAAE,QAAQ,CAAC,EAC5B,CAAC;AAEF,MAAa,2BAA2B;AACxC,MAAa,2BAA2B,qBAAqB,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"workflow.schema.mjs","names":[],"sources":["../../../../src/modules/workflow/workflow.schema.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { WORKFLOW_STATUSES } from \"./workflow.constants\";\n\nexport const workflowSelectSchema = z.object({\n id: z.uuid(),\n userId: z.string().nullable(),\n jobId: z.string(),\n jobName: z.string(),\n queueName: z.string(),\n tags: z.array(z.string()).nullable(),\n input: z.unknown(),\n output: z.unknown(),\n status: z.enum(WORKFLOW_STATUSES),\n error: z.string().nullable(),\n retries: z.number(),\n finishedAt: z.date().nullable(),\n processedAt: z.date().nullable(),\n createdAt: z.date(),\n updatedAt: z.date(),\n});\n\nexport const workflowReadInputSchema = z.object({\n jobId: z.string(),\n});\n\nexport const workflowListInputSchema = z.object({\n status: z.enum(WORKFLOW_STATUSES).array().optional(),\n jobName: z.string().optional(),\n});\n\nexport const workflowTriggerOutputSchema = z.object({\n jobId: z.string(),\n});\n\nexport const workflowTriggerManyOutputSchema = z.object({\n jobIds: z.array(z.string()),\n});\n\nexport const workflowReadOutputSchema = workflowSelectSchema;\nexport const workflowListOutputSchema = workflowSelectSchema.array();\n\nexport type WorkflowSelectSchema = z.infer<typeof workflowSelectSchema>;\nexport type WorkflowReadInputSchema = z.infer<typeof workflowReadInputSchema>;\nexport type WorkflowListInputSchema = z.infer<typeof workflowListInputSchema>;\nexport type WorkflowReadOutputSchema = z.infer<typeof workflowReadOutputSchema>;\nexport type WorkflowListOutputSchema = z.infer<typeof workflowListOutputSchema>;\nexport type WorkflowTriggerOutputSchema = z.infer<typeof workflowTriggerOutputSchema>;\nexport type WorkflowTriggerManyOutputSchema = z.infer<typeof workflowTriggerManyOutputSchema>;\n"],"mappings":";;;AAGA,MAAa,uBAAuB,EAAE,OAAO;CAC3C,IAAI,EAAE,MAAM;CACZ,QAAQ,EAAE,QAAQ,CAAC,UAAU;CAC7B,OAAO,EAAE,QAAQ;CACjB,SAAS,EAAE,QAAQ;CACnB,WAAW,EAAE,QAAQ;CACrB,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,UAAU;CACpC,OAAO,EAAE,SAAS;CAClB,QAAQ,EAAE,SAAS;CACnB,QAAQ,EAAE,KAAK,kBAAkB;CACjC,OAAO,EAAE,QAAQ,CAAC,UAAU;CAC5B,SAAS,EAAE,QAAQ;CACnB,YAAY,EAAE,MAAM,CAAC,UAAU;CAC/B,aAAa,EAAE,MAAM,CAAC,UAAU;CAChC,WAAW,EAAE,MAAM;CACnB,WAAW,EAAE,MAAM;CACpB,CAAC;AAEF,MAAa,0BAA0B,EAAE,OAAO,EAC9C,OAAO,EAAE,QAAQ,EAClB,CAAC;AAEF,MAAa,0BAA0B,EAAE,OAAO;CAC9C,QAAQ,EAAE,KAAK,kBAAkB,CAAC,OAAO,CAAC,UAAU;CACpD,SAAS,EAAE,QAAQ,CAAC,UAAU;CAC/B,CAAC;AAEF,MAAa,8BAA8B,EAAE,OAAO,EAClD,OAAO,EAAE,QAAQ,EAClB,CAAC;AAEF,MAAa,kCAAkC,EAAE,OAAO,EACtD,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC5B,CAAC;AAEF,MAAa,2BAA2B;AACxC,MAAa,2BAA2B,qBAAqB,OAAO"}
1
+ {"version":3,"file":"workflow.schema.mjs","names":[],"sources":["../../../../src/modules/workflow/workflow.schema.ts"],"sourcesContent":["import { z } from \"zod\";\r\nimport { WORKFLOW_STATUSES } from \"./workflow.constants\";\r\n\r\nexport const workflowSelectSchema = z.object({\r\n id: z.uuid(),\r\n userId: z.string().nullable(),\r\n jobId: z.string(),\r\n jobName: z.string(),\r\n queueName: z.string(),\r\n tags: z.array(z.string()).nullable(),\r\n input: z.unknown(),\r\n output: z.unknown(),\r\n status: z.enum(WORKFLOW_STATUSES),\r\n error: z.string().nullable(),\r\n retries: z.number(),\r\n finishedAt: z.date().nullable(),\r\n processedAt: z.date().nullable(),\r\n createdAt: z.date(),\r\n updatedAt: z.date(),\r\n});\r\n\r\nexport const workflowReadInputSchema = z.object({\r\n jobId: z.string(),\r\n});\r\n\r\nexport const workflowListInputSchema = z.object({\r\n status: z.enum(WORKFLOW_STATUSES).array().optional(),\r\n jobName: z.string().optional(),\r\n});\r\n\r\nexport const workflowTriggerOutputSchema = z.object({\r\n jobId: z.string(),\r\n});\r\n\r\nexport const workflowTriggerManyOutputSchema = z.object({\r\n jobIds: z.array(z.string()),\r\n});\r\n\r\nexport const workflowReadOutputSchema = workflowSelectSchema;\r\nexport const workflowListOutputSchema = workflowSelectSchema.array();\r\n\r\nexport type WorkflowSelectSchema = z.infer<typeof workflowSelectSchema>;\r\nexport type WorkflowReadInputSchema = z.infer<typeof workflowReadInputSchema>;\r\nexport type WorkflowListInputSchema = z.infer<typeof workflowListInputSchema>;\r\nexport type WorkflowReadOutputSchema = z.infer<typeof workflowReadOutputSchema>;\r\nexport type WorkflowListOutputSchema = z.infer<typeof workflowListOutputSchema>;\r\nexport type WorkflowTriggerOutputSchema = z.infer<typeof workflowTriggerOutputSchema>;\r\nexport type WorkflowTriggerManyOutputSchema = z.infer<typeof workflowTriggerManyOutputSchema>;\r\n"],"mappings":";;;AAGA,MAAa,uBAAuB,EAAE,OAAO;CAC3C,IAAI,EAAE,MAAM;CACZ,QAAQ,EAAE,QAAQ,CAAC,UAAU;CAC7B,OAAO,EAAE,QAAQ;CACjB,SAAS,EAAE,QAAQ;CACnB,WAAW,EAAE,QAAQ;CACrB,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,UAAU;CACpC,OAAO,EAAE,SAAS;CAClB,QAAQ,EAAE,SAAS;CACnB,QAAQ,EAAE,KAAK,kBAAkB;CACjC,OAAO,EAAE,QAAQ,CAAC,UAAU;CAC5B,SAAS,EAAE,QAAQ;CACnB,YAAY,EAAE,MAAM,CAAC,UAAU;CAC/B,aAAa,EAAE,MAAM,CAAC,UAAU;CAChC,WAAW,EAAE,MAAM;CACnB,WAAW,EAAE,MAAM;CACpB,CAAC;AAEF,MAAa,0BAA0B,EAAE,OAAO,EAC9C,OAAO,EAAE,QAAQ,EAClB,CAAC;AAEF,MAAa,0BAA0B,EAAE,OAAO;CAC9C,QAAQ,EAAE,KAAK,kBAAkB,CAAC,OAAO,CAAC,UAAU;CACpD,SAAS,EAAE,QAAQ,CAAC,UAAU;CAC/B,CAAC;AAEF,MAAa,8BAA8B,EAAE,OAAO,EAClD,OAAO,EAAE,QAAQ,EAClB,CAAC;AAEF,MAAa,kCAAkC,EAAE,OAAO,EACtD,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC5B,CAAC;AAEF,MAAa,2BAA2B;AACxC,MAAa,2BAA2B,qBAAqB,OAAO"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m5kdev/commons",
3
- "version": "0.32.9",
3
+ "version": "0.34.0",
4
4
  "license": "GPL-3.0-only",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,13 +12,16 @@
12
12
  "dist"
13
13
  ],
14
14
  "dependencies": {
15
- "devalue": "5.4.2",
15
+ "devalue": "5.4.2"
16
+ },
17
+ "peerDependencies": {
16
18
  "zod": "4.2.1"
17
19
  },
18
20
  "devDependencies": {
19
21
  "tsdown": "0.21.7",
20
22
  "typescript": "6.0.3",
21
- "@m5kdev/config": "0.32.9"
23
+ "zod": "4.2.1",
24
+ "@m5kdev/config": "0.34.0"
22
25
  },
23
26
  "exports": {
24
27
  "./utils/*": {
@@ -51,16 +54,6 @@
51
54
  "default": "./dist/src/modules/schemas/*.cjs"
52
55
  }
53
56
  },
54
- "./modules/crypto/*": {
55
- "import": {
56
- "types": "./dist/src/modules/crypto/*.d.mts",
57
- "default": "./dist/src/modules/crypto/*.mjs"
58
- },
59
- "require": {
60
- "types": "./dist/src/modules/crypto/*.d.cts",
61
- "default": "./dist/src/modules/crypto/*.cjs"
62
- }
63
- },
64
57
  "./modules/recurrence/*": {
65
58
  "import": {
66
59
  "types": "./dist/src/modules/recurrence/*.d.mts",