@m5kdev/commons 0.1.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 (77) hide show
  1. package/.cursor/rules/commons.mdc +27 -0
  2. package/.turbo/turbo-build.log +5 -0
  3. package/.turbo/turbo-check-types.log +5 -0
  4. package/.turbo/turbo-lint$colon$fix.log +6 -0
  5. package/.turbo/turbo-lint.log +61 -0
  6. package/LICENSE +621 -0
  7. package/dist/src/modules/ai/ai.constants.d.ts +55 -0
  8. package/dist/src/modules/ai/ai.constants.d.ts.map +1 -0
  9. package/dist/src/modules/ai/ai.constants.js +287 -0
  10. package/dist/src/modules/ai/ai.utils.d.ts +2 -0
  11. package/dist/src/modules/ai/ai.utils.d.ts.map +1 -0
  12. package/dist/src/modules/ai/ai.utils.js +10 -0
  13. package/dist/src/modules/auth/auth.schema.d.ts +21 -0
  14. package/dist/src/modules/auth/auth.schema.d.ts.map +1 -0
  15. package/dist/src/modules/auth/auth.schema.js +22 -0
  16. package/dist/src/modules/base/base.schema.d.ts +26 -0
  17. package/dist/src/modules/base/base.schema.d.ts.map +1 -0
  18. package/dist/src/modules/base/base.schema.js +18 -0
  19. package/dist/src/modules/billing/billing.schema.d.ts +23 -0
  20. package/dist/src/modules/billing/billing.schema.d.ts.map +1 -0
  21. package/dist/src/modules/billing/billing.schema.js +24 -0
  22. package/dist/src/modules/billing/billing.types.d.ts +18 -0
  23. package/dist/src/modules/billing/billing.types.d.ts.map +1 -0
  24. package/dist/src/modules/billing/billing.types.js +2 -0
  25. package/dist/src/modules/billing/billing.utils.d.ts +6 -0
  26. package/dist/src/modules/billing/billing.utils.d.ts.map +1 -0
  27. package/dist/src/modules/billing/billing.utils.js +12 -0
  28. package/dist/src/modules/file/file.constants.d.ts +5 -0
  29. package/dist/src/modules/file/file.constants.d.ts.map +1 -0
  30. package/dist/src/modules/file/file.constants.js +17 -0
  31. package/dist/src/modules/recurrence/recurrence.schema.d.ts +99 -0
  32. package/dist/src/modules/recurrence/recurrence.schema.d.ts.map +1 -0
  33. package/dist/src/modules/recurrence/recurrence.schema.js +65 -0
  34. package/dist/src/modules/schemas/query.schema.d.ts +111 -0
  35. package/dist/src/modules/schemas/query.schema.d.ts.map +1 -0
  36. package/dist/src/modules/schemas/query.schema.js +38 -0
  37. package/dist/src/modules/table/filter.types.d.ts +13 -0
  38. package/dist/src/modules/table/filter.types.d.ts.map +1 -0
  39. package/dist/src/modules/table/filter.types.js +2 -0
  40. package/dist/src/modules/tag/tag.schema.d.ts +112 -0
  41. package/dist/src/modules/tag/tag.schema.d.ts.map +1 -0
  42. package/dist/src/modules/tag/tag.schema.js +54 -0
  43. package/dist/src/modules/workflow/workflow.constants.d.ts +3 -0
  44. package/dist/src/modules/workflow/workflow.constants.d.ts.map +1 -0
  45. package/dist/src/modules/workflow/workflow.constants.js +4 -0
  46. package/dist/src/modules/workflow/workflow.schema.d.ts +93 -0
  47. package/dist/src/modules/workflow/workflow.schema.d.ts.map +1 -0
  48. package/dist/src/modules/workflow/workflow.schema.js +37 -0
  49. package/dist/src/utils/json.d.ts +3 -0
  50. package/dist/src/utils/json.d.ts.map +1 -0
  51. package/dist/src/utils/json.js +11 -0
  52. package/dist/src/utils/timezones.d.ts +15 -0
  53. package/dist/src/utils/timezones.d.ts.map +1 -0
  54. package/dist/src/utils/timezones.js +4362 -0
  55. package/dist/src/utils/trpc.d.ts +5 -0
  56. package/dist/src/utils/trpc.d.ts.map +1 -0
  57. package/dist/src/utils/trpc.js +8 -0
  58. package/dist/tsconfig.tsbuildinfo +1 -0
  59. package/package.json +75 -0
  60. package/src/modules/ai/ai.constants.ts +305 -0
  61. package/src/modules/ai/ai.utils.ts +14 -0
  62. package/src/modules/auth/auth.schema.ts +22 -0
  63. package/src/modules/base/base.schema.ts +27 -0
  64. package/src/modules/billing/billing.schema.ts +24 -0
  65. package/src/modules/billing/billing.types.ts +18 -0
  66. package/src/modules/billing/billing.utils.ts +13 -0
  67. package/src/modules/file/file.constants.ts +14 -0
  68. package/src/modules/recurrence/recurrence.schema.ts +78 -0
  69. package/src/modules/schemas/query.schema.ts +44 -0
  70. package/src/modules/table/filter.types.ts +39 -0
  71. package/src/modules/tag/tag.schema.ts +68 -0
  72. package/src/modules/workflow/workflow.constants.ts +2 -0
  73. package/src/modules/workflow/workflow.schema.ts +48 -0
  74. package/src/utils/json.ts +9 -0
  75. package/src/utils/timezones.ts +4380 -0
  76. package/src/utils/trpc.ts +6 -0
  77. package/tsconfig.json +10 -0
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deleteRecurrenceRulesSchema = exports.deleteRecurrenceSchema = exports.updateRecurrenceSchema = exports.createRecurrenceSchema = exports.updateRecurrenceRulesSchema = exports.recurrenceRulesSchema = exports.recurrenceSchema = exports.recurrenceMetadataSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ // Reusable schemas for JSON-by-* fields (number or number[])
6
+ const numberOrNumberArraySchema = zod_1.z.union([zod_1.z.number(), zod_1.z.array(zod_1.z.number())]).nullish();
7
+ exports.recurrenceMetadataSchema = zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).nullish();
8
+ exports.recurrenceSchema = zod_1.z.object({
9
+ id: zod_1.z.string(),
10
+ userId: zod_1.z.string().nullish(),
11
+ organizationId: zod_1.z.string().nullish(),
12
+ teamId: zod_1.z.string().nullish(),
13
+ name: zod_1.z.string().nullish(),
14
+ kind: zod_1.z.string().nullish(),
15
+ enabled: zod_1.z.boolean(),
16
+ metadata: exports.recurrenceMetadataSchema,
17
+ createdAt: zod_1.z.date(),
18
+ updatedAt: zod_1.z.date(),
19
+ });
20
+ exports.recurrenceRulesSchema = zod_1.z.object({
21
+ id: zod_1.z.string(),
22
+ createdAt: zod_1.z.date(),
23
+ updatedAt: zod_1.z.date(),
24
+ recurrenceId: zod_1.z.string().nullish(),
25
+ freq: zod_1.z.number(),
26
+ dtstart: zod_1.z.date().nullish(),
27
+ interval: zod_1.z.number(),
28
+ wkst: zod_1.z.number().nullish(),
29
+ count: zod_1.z.number().nullish(),
30
+ until: zod_1.z.date().nullish(),
31
+ tzid: zod_1.z.string().nullish(),
32
+ bysetpos: numberOrNumberArraySchema,
33
+ bymonth: numberOrNumberArraySchema,
34
+ bymonthday: numberOrNumberArraySchema,
35
+ byyearday: numberOrNumberArraySchema,
36
+ byweekno: numberOrNumberArraySchema,
37
+ byweekday: numberOrNumberArraySchema,
38
+ byhour: numberOrNumberArraySchema,
39
+ byminute: numberOrNumberArraySchema,
40
+ bysecond: numberOrNumberArraySchema,
41
+ });
42
+ exports.updateRecurrenceRulesSchema = exports.recurrenceRulesSchema.omit({
43
+ createdAt: true,
44
+ updatedAt: true,
45
+ recurrenceId: true,
46
+ });
47
+ exports.createRecurrenceSchema = zod_1.z.object({
48
+ name: zod_1.z.string(),
49
+ kind: zod_1.z.string(),
50
+ enabled: zod_1.z.boolean(),
51
+ metadata: exports.recurrenceMetadataSchema,
52
+ recurrenceRules: zod_1.z.array(exports.updateRecurrenceRulesSchema.omit({ id: true })),
53
+ });
54
+ exports.updateRecurrenceSchema = zod_1.z.object({
55
+ name: zod_1.z.string().optional(),
56
+ kind: zod_1.z.string().optional(),
57
+ enabled: zod_1.z.boolean().optional(),
58
+ metadata: exports.recurrenceMetadataSchema,
59
+ });
60
+ exports.deleteRecurrenceSchema = zod_1.z.object({
61
+ id: zod_1.z.string(),
62
+ });
63
+ exports.deleteRecurrenceRulesSchema = zod_1.z.object({
64
+ id: zod_1.z.string(),
65
+ });
@@ -0,0 +1,111 @@
1
+ import { z } from "zod";
2
+ export declare const filterSchema: z.ZodObject<{
3
+ columnId: z.ZodString;
4
+ type: z.ZodEnum<{
5
+ string: "string";
6
+ number: "number";
7
+ boolean: "boolean";
8
+ date: "date";
9
+ enum: "enum";
10
+ }>;
11
+ method: z.ZodEnum<{
12
+ contains: "contains";
13
+ equals: "equals";
14
+ starts_with: "starts_with";
15
+ ends_with: "ends_with";
16
+ greater_than: "greater_than";
17
+ less_than: "less_than";
18
+ on: "on";
19
+ between: "between";
20
+ before: "before";
21
+ after: "after";
22
+ oneOf: "oneOf";
23
+ intersect: "intersect";
24
+ isEmpty: "isEmpty";
25
+ isNotEmpty: "isNotEmpty";
26
+ is_null: "is_null";
27
+ is_not_null: "is_not_null";
28
+ }>;
29
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>;
30
+ valueTo: z.ZodOptional<z.ZodString>;
31
+ endColumnId: z.ZodOptional<z.ZodString>;
32
+ }, z.core.$strip>;
33
+ export declare const filtersSchema: z.ZodArray<z.ZodObject<{
34
+ columnId: z.ZodString;
35
+ type: z.ZodEnum<{
36
+ string: "string";
37
+ number: "number";
38
+ boolean: "boolean";
39
+ date: "date";
40
+ enum: "enum";
41
+ }>;
42
+ method: z.ZodEnum<{
43
+ contains: "contains";
44
+ equals: "equals";
45
+ starts_with: "starts_with";
46
+ ends_with: "ends_with";
47
+ greater_than: "greater_than";
48
+ less_than: "less_than";
49
+ on: "on";
50
+ between: "between";
51
+ before: "before";
52
+ after: "after";
53
+ oneOf: "oneOf";
54
+ intersect: "intersect";
55
+ isEmpty: "isEmpty";
56
+ isNotEmpty: "isNotEmpty";
57
+ is_null: "is_null";
58
+ is_not_null: "is_not_null";
59
+ }>;
60
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>;
61
+ valueTo: z.ZodOptional<z.ZodString>;
62
+ endColumnId: z.ZodOptional<z.ZodString>;
63
+ }, z.core.$strip>>;
64
+ export declare const querySchema: z.ZodObject<{
65
+ page: z.ZodOptional<z.ZodNumber>;
66
+ limit: z.ZodOptional<z.ZodNumber>;
67
+ sort: z.ZodOptional<z.ZodString>;
68
+ order: z.ZodOptional<z.ZodEnum<{
69
+ asc: "asc";
70
+ desc: "desc";
71
+ }>>;
72
+ filters: z.ZodOptional<z.ZodArray<z.ZodObject<{
73
+ columnId: z.ZodString;
74
+ type: z.ZodEnum<{
75
+ string: "string";
76
+ number: "number";
77
+ boolean: "boolean";
78
+ date: "date";
79
+ enum: "enum";
80
+ }>;
81
+ method: z.ZodEnum<{
82
+ contains: "contains";
83
+ equals: "equals";
84
+ starts_with: "starts_with";
85
+ ends_with: "ends_with";
86
+ greater_than: "greater_than";
87
+ less_than: "less_than";
88
+ on: "on";
89
+ between: "between";
90
+ before: "before";
91
+ after: "after";
92
+ oneOf: "oneOf";
93
+ intersect: "intersect";
94
+ isEmpty: "isEmpty";
95
+ isNotEmpty: "isNotEmpty";
96
+ is_null: "is_null";
97
+ is_not_null: "is_not_null";
98
+ }>;
99
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>;
100
+ valueTo: z.ZodOptional<z.ZodString>;
101
+ endColumnId: z.ZodOptional<z.ZodString>;
102
+ }, z.core.$strip>>>;
103
+ }, z.core.$strip>;
104
+ export type QueryListOutput<T> = {
105
+ rows: T[];
106
+ total: number;
107
+ };
108
+ export type QueryInput = z.infer<typeof querySchema>;
109
+ export type QueryFilter = z.infer<typeof filterSchema>;
110
+ export type QueryFilters = z.infer<typeof filtersSchema>;
111
+ //# sourceMappingURL=query.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.schema.d.ts","sourceRoot":"","sources":["../../../../src/modules/schemas/query.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwBvB,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAwB,CAAC;AAEnD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAOtB,CAAC;AAEH,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI;IAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9D,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AACrD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AACvD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.querySchema = exports.filtersSchema = exports.filterSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.filterSchema = zod_1.z.object({
6
+ columnId: zod_1.z.string(),
7
+ type: zod_1.z.enum(["string", "number", "date", "boolean", "enum"]),
8
+ method: zod_1.z.enum([
9
+ "contains",
10
+ "equals",
11
+ "starts_with",
12
+ "ends_with",
13
+ "greater_than",
14
+ "less_than",
15
+ "on",
16
+ "between",
17
+ "before",
18
+ "after",
19
+ "oneOf",
20
+ "intersect",
21
+ "isEmpty",
22
+ "isNotEmpty",
23
+ "is_null",
24
+ "is_not_null",
25
+ ]),
26
+ value: zod_1.z.union([zod_1.z.string(), zod_1.z.number(), zod_1.z.boolean(), zod_1.z.array(zod_1.z.string())]),
27
+ valueTo: zod_1.z.string().optional(),
28
+ endColumnId: zod_1.z.string().optional(),
29
+ });
30
+ exports.filtersSchema = zod_1.z.array(exports.filterSchema);
31
+ exports.querySchema = zod_1.z.object({
32
+ // TODO: Remove default values
33
+ page: zod_1.z.number().optional(),
34
+ limit: zod_1.z.number().optional(),
35
+ sort: zod_1.z.string().optional(),
36
+ order: zod_1.z.enum(["asc", "desc"]).optional(),
37
+ filters: exports.filtersSchema.optional(),
38
+ });
@@ -0,0 +1,13 @@
1
+ import type { QueryFilter } from "../schemas/query.schema";
2
+ export type ColumnDataType = NonNullable<QueryFilter["type"]>;
3
+ export type ComponentForFilterMethod = "text" | "number" | "date" | "range" | "radio" | "select" | "multiSelect";
4
+ export type FilterMethodName = "contains" | "equals" | "starts_with" | "ends_with" | "greater_than" | "less_than" | "on" | "between" | "before" | "after" | "intersect" | "oneOf" | "isEmpty" | "isNotEmpty";
5
+ export type FilterMethod = {
6
+ value: FilterMethodName;
7
+ label: string;
8
+ component?: ComponentForFilterMethod | null;
9
+ };
10
+ export type FilterMethods = {
11
+ [key in ColumnDataType]: FilterMethod[];
12
+ };
13
+ //# sourceMappingURL=filter.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter.types.d.ts","sourceRoot":"","sources":["../../../../src/modules/table/filter.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;AAE9D,MAAM,MAAM,wBAAwB,GAChC,MAAM,GACN,QAAQ,GACR,MAAM,GACN,OAAO,GACP,OAAO,GACP,QAAQ,GACR,aAAa,CAAC;AAElB,MAAM,MAAM,gBAAgB,GACxB,UAAU,GACV,QAAQ,GACR,aAAa,GACb,WAAW,GACX,cAAc,GACd,WAAW,GACX,IAAI,GACJ,SAAS,GACT,QAAQ,GACR,OAAO,GACP,WAAW,GACX,OAAO,GACP,SAAS,GACT,YAAY,CAAC;AAEjB,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,gBAAgB,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,wBAAwB,GAAG,IAAI,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;KACzB,GAAG,IAAI,cAAc,GAAG,YAAY,EAAE;CACxC,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,112 @@
1
+ import { z } from "zod";
2
+ export declare const tagSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ organizationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
5
+ teamId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6
+ createdAt: z.ZodDate;
7
+ updatedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
8
+ deletedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
9
+ userId: z.ZodString;
10
+ name: z.ZodString;
11
+ color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
+ type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
13
+ isEnabled: z.ZodBoolean;
14
+ parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
15
+ assignableTo: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>>;
16
+ }, z.core.$strip>;
17
+ export declare const taggingSchema: z.ZodObject<{
18
+ id: z.ZodString;
19
+ createdAt: z.ZodDate;
20
+ tagId: z.ZodString;
21
+ resourceType: z.ZodString;
22
+ resourceId: z.ZodString;
23
+ }, z.core.$strip>;
24
+ export declare const tagListInputSchema: z.ZodObject<{
25
+ page: z.ZodOptional<z.ZodNumber>;
26
+ limit: z.ZodOptional<z.ZodNumber>;
27
+ sort: z.ZodOptional<z.ZodString>;
28
+ order: z.ZodOptional<z.ZodEnum<{
29
+ asc: "asc";
30
+ desc: "desc";
31
+ }>>;
32
+ filters: z.ZodOptional<z.ZodArray<z.ZodObject<{
33
+ columnId: z.ZodString;
34
+ type: z.ZodEnum<{
35
+ string: "string";
36
+ number: "number";
37
+ boolean: "boolean";
38
+ date: "date";
39
+ enum: "enum";
40
+ }>;
41
+ method: z.ZodEnum<{
42
+ contains: "contains";
43
+ equals: "equals";
44
+ starts_with: "starts_with";
45
+ ends_with: "ends_with";
46
+ greater_than: "greater_than";
47
+ less_than: "less_than";
48
+ on: "on";
49
+ between: "between";
50
+ before: "before";
51
+ after: "after";
52
+ oneOf: "oneOf";
53
+ intersect: "intersect";
54
+ isEmpty: "isEmpty";
55
+ isNotEmpty: "isNotEmpty";
56
+ is_null: "is_null";
57
+ is_not_null: "is_not_null";
58
+ }>;
59
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>;
60
+ valueTo: z.ZodOptional<z.ZodString>;
61
+ endColumnId: z.ZodOptional<z.ZodString>;
62
+ }, z.core.$strip>>>;
63
+ }, z.core.$strip>;
64
+ export declare const tagListOutputSchema: z.ZodObject<{
65
+ rows: z.ZodArray<z.ZodObject<{
66
+ id: z.ZodString;
67
+ organizationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
68
+ teamId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
69
+ createdAt: z.ZodDate;
70
+ updatedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
71
+ deletedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
72
+ userId: z.ZodString;
73
+ name: z.ZodString;
74
+ color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
75
+ type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
76
+ isEnabled: z.ZodBoolean;
77
+ parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
78
+ assignableTo: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>>;
79
+ }, z.core.$strip>>;
80
+ total: z.ZodNumber;
81
+ }, z.core.$strip>;
82
+ export declare const tagListSchema: z.ZodObject<{
83
+ assignableTo: z.ZodOptional<z.ZodString>;
84
+ }, z.core.$strip>;
85
+ export declare const tagCreateSchema: z.ZodObject<{
86
+ organizationId: z.ZodOptional<z.ZodString>;
87
+ teamId: z.ZodOptional<z.ZodString>;
88
+ name: z.ZodString;
89
+ color: z.ZodString;
90
+ assignableTo: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
91
+ resourceType: z.ZodOptional<z.ZodString>;
92
+ resourceId: z.ZodOptional<z.ZodString>;
93
+ }, z.core.$strip>;
94
+ export declare const tagUpdateSchema: z.ZodObject<{
95
+ id: z.ZodString;
96
+ name: z.ZodOptional<z.ZodString>;
97
+ color: z.ZodOptional<z.ZodString>;
98
+ }, z.core.$strip>;
99
+ export declare const tagLinkSchema: z.ZodObject<{
100
+ tagId: z.ZodString;
101
+ resourceType: z.ZodString;
102
+ resourceId: z.ZodString;
103
+ }, z.core.$strip>;
104
+ export type TagSchema = z.infer<typeof tagSchema>;
105
+ export type TaggingSchema = z.infer<typeof taggingSchema>;
106
+ export type TagListSchema = z.infer<typeof tagListSchema>;
107
+ export type TagCreateSchema = z.infer<typeof tagCreateSchema>;
108
+ export type TagUpdateSchema = z.infer<typeof tagUpdateSchema>;
109
+ export type TagLinkSchema = z.infer<typeof tagLinkSchema>;
110
+ export type TagListOutputSchema = z.infer<typeof tagListOutputSchema>;
111
+ export type TagListInputSchema = z.infer<typeof tagListInputSchema>;
112
+ //# sourceMappingURL=tag.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tag.schema.d.ts","sourceRoot":"","sources":["../../../../src/modules/tag/tag.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,SAAS;;;;;;;;;;;;;;iBAcpB,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;iBAMxB,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAc,CAAC;AAE9C,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;iBAG9B,CAAC;AAEH,eAAO,MAAM,aAAa;;iBAExB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;iBAQ1B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;iBAI1B,CAAC;AAEH,eAAO,MAAM,aAAa;;;;iBAIxB,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAClD,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAC1D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAC1D,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC9D,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC9D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAC1D,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACtE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tagLinkSchema = exports.tagUpdateSchema = exports.tagCreateSchema = exports.tagListSchema = exports.tagListOutputSchema = exports.tagListInputSchema = exports.taggingSchema = exports.tagSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const query_schema_1 = require("../schemas/query.schema");
6
+ exports.tagSchema = zod_1.z.object({
7
+ id: zod_1.z.string(),
8
+ organizationId: zod_1.z.string().nullish(),
9
+ teamId: zod_1.z.string().nullish(),
10
+ createdAt: zod_1.z.date(),
11
+ updatedAt: zod_1.z.date().nullish(),
12
+ deletedAt: zod_1.z.date().nullish(),
13
+ userId: zod_1.z.string(),
14
+ name: zod_1.z.string(),
15
+ color: zod_1.z.string().nullish(),
16
+ type: zod_1.z.string().nullish(),
17
+ isEnabled: zod_1.z.boolean(),
18
+ parentId: zod_1.z.string().nullish(),
19
+ assignableTo: zod_1.z.string().array().nullish().default([]),
20
+ });
21
+ exports.taggingSchema = zod_1.z.object({
22
+ id: zod_1.z.string(),
23
+ createdAt: zod_1.z.date(),
24
+ tagId: zod_1.z.string(),
25
+ resourceType: zod_1.z.string(),
26
+ resourceId: zod_1.z.string(),
27
+ });
28
+ exports.tagListInputSchema = query_schema_1.querySchema;
29
+ exports.tagListOutputSchema = zod_1.z.object({
30
+ rows: zod_1.z.array(exports.tagSchema),
31
+ total: zod_1.z.number(),
32
+ });
33
+ exports.tagListSchema = zod_1.z.object({
34
+ assignableTo: zod_1.z.string().optional(),
35
+ });
36
+ exports.tagCreateSchema = zod_1.z.object({
37
+ organizationId: zod_1.z.string().optional(),
38
+ teamId: zod_1.z.string().optional(),
39
+ name: zod_1.z.string(),
40
+ color: zod_1.z.string(),
41
+ assignableTo: zod_1.z.string().array().optional().default([]),
42
+ resourceType: zod_1.z.string().optional(),
43
+ resourceId: zod_1.z.string().optional(),
44
+ });
45
+ exports.tagUpdateSchema = zod_1.z.object({
46
+ id: zod_1.z.string(),
47
+ name: zod_1.z.string().optional(),
48
+ color: zod_1.z.string().optional(),
49
+ });
50
+ exports.tagLinkSchema = zod_1.z.object({
51
+ tagId: zod_1.z.string(),
52
+ resourceType: zod_1.z.string(),
53
+ resourceId: zod_1.z.string(),
54
+ });
@@ -0,0 +1,3 @@
1
+ export declare const WORFLOW_STATUSES: readonly ["queued", "running", "completed", "failed"];
2
+ export type WorkflowStatus = (typeof WORFLOW_STATUSES)[number];
3
+ //# sourceMappingURL=workflow.constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow.constants.d.ts","sourceRoot":"","sources":["../../../../src/modules/workflow/workflow.constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,uDAAwD,CAAC;AACtF,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WORFLOW_STATUSES = void 0;
4
+ exports.WORFLOW_STATUSES = ["queued", "running", "completed", "failed"];
@@ -0,0 +1,93 @@
1
+ import { z } from "zod";
2
+ export declare const workflowSelectSchema: z.ZodObject<{
3
+ id: z.ZodUUID;
4
+ userId: z.ZodNullable<z.ZodString>;
5
+ jobId: z.ZodString;
6
+ jobName: z.ZodString;
7
+ queueName: z.ZodString;
8
+ tags: z.ZodNullable<z.ZodArray<z.ZodString>>;
9
+ input: z.ZodUnknown;
10
+ output: z.ZodUnknown;
11
+ status: z.ZodEnum<{
12
+ queued: "queued";
13
+ running: "running";
14
+ completed: "completed";
15
+ failed: "failed";
16
+ }>;
17
+ error: z.ZodNullable<z.ZodString>;
18
+ retries: z.ZodNumber;
19
+ finishedAt: z.ZodNullable<z.ZodDate>;
20
+ processedAt: z.ZodNullable<z.ZodDate>;
21
+ createdAt: z.ZodDate;
22
+ updatedAt: z.ZodDate;
23
+ }, z.core.$strip>;
24
+ export declare const workflowReadInputSchema: z.ZodObject<{
25
+ jobId: z.ZodString;
26
+ }, z.core.$strip>;
27
+ export declare const workflowListInputSchema: z.ZodObject<{
28
+ status: z.ZodOptional<z.ZodArray<z.ZodEnum<{
29
+ queued: "queued";
30
+ running: "running";
31
+ completed: "completed";
32
+ failed: "failed";
33
+ }>>>;
34
+ jobName: z.ZodOptional<z.ZodString>;
35
+ }, z.core.$strip>;
36
+ export declare const workflowTriggerOutputSchema: z.ZodObject<{
37
+ jobId: z.ZodString;
38
+ }, z.core.$strip>;
39
+ export declare const workflowTriggerManyOutputSchema: z.ZodObject<{
40
+ jobIds: z.ZodArray<z.ZodString>;
41
+ }, z.core.$strip>;
42
+ export declare const workflowReadOutputSchema: z.ZodObject<{
43
+ id: z.ZodUUID;
44
+ userId: z.ZodNullable<z.ZodString>;
45
+ jobId: z.ZodString;
46
+ jobName: z.ZodString;
47
+ queueName: z.ZodString;
48
+ tags: z.ZodNullable<z.ZodArray<z.ZodString>>;
49
+ input: z.ZodUnknown;
50
+ output: z.ZodUnknown;
51
+ status: z.ZodEnum<{
52
+ queued: "queued";
53
+ running: "running";
54
+ completed: "completed";
55
+ failed: "failed";
56
+ }>;
57
+ error: z.ZodNullable<z.ZodString>;
58
+ retries: z.ZodNumber;
59
+ finishedAt: z.ZodNullable<z.ZodDate>;
60
+ processedAt: z.ZodNullable<z.ZodDate>;
61
+ createdAt: z.ZodDate;
62
+ updatedAt: z.ZodDate;
63
+ }, z.core.$strip>;
64
+ export declare const workflowListOutputSchema: z.ZodArray<z.ZodObject<{
65
+ id: z.ZodUUID;
66
+ userId: z.ZodNullable<z.ZodString>;
67
+ jobId: z.ZodString;
68
+ jobName: z.ZodString;
69
+ queueName: z.ZodString;
70
+ tags: z.ZodNullable<z.ZodArray<z.ZodString>>;
71
+ input: z.ZodUnknown;
72
+ output: z.ZodUnknown;
73
+ status: z.ZodEnum<{
74
+ queued: "queued";
75
+ running: "running";
76
+ completed: "completed";
77
+ failed: "failed";
78
+ }>;
79
+ error: z.ZodNullable<z.ZodString>;
80
+ retries: z.ZodNumber;
81
+ finishedAt: z.ZodNullable<z.ZodDate>;
82
+ processedAt: z.ZodNullable<z.ZodDate>;
83
+ createdAt: z.ZodDate;
84
+ updatedAt: z.ZodDate;
85
+ }, z.core.$strip>>;
86
+ export type WorkflowSelectSchema = z.infer<typeof workflowSelectSchema>;
87
+ export type WorkflowReadInputSchema = z.infer<typeof workflowReadInputSchema>;
88
+ export type WorkflowListInputSchema = z.infer<typeof workflowListInputSchema>;
89
+ export type WorkflowReadOutputSchema = z.infer<typeof workflowReadOutputSchema>;
90
+ export type WorkflowListOutputSchema = z.infer<typeof workflowListOutputSchema>;
91
+ export type WorkflowTriggerOutputSchema = z.infer<typeof workflowTriggerOutputSchema>;
92
+ export type WorkflowTriggerManyOutputSchema = z.infer<typeof workflowTriggerManyOutputSchema>;
93
+ //# sourceMappingURL=workflow.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow.schema.d.ts","sourceRoot":"","sources":["../../../../src/modules/workflow/workflow.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;iBAgB/B,CAAC;AAEH,eAAO,MAAM,uBAAuB;;iBAElC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;iBAGlC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;iBAEtC,CAAC;AAEH,eAAO,MAAM,+BAA+B;;iBAE1C,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;iBAAuB,CAAC;AAC7D,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;kBAA+B,CAAC;AAErE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACxE,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAC9E,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAC9E,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAChF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAChF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AACtF,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.workflowListOutputSchema = exports.workflowReadOutputSchema = exports.workflowTriggerManyOutputSchema = exports.workflowTriggerOutputSchema = exports.workflowListInputSchema = exports.workflowReadInputSchema = exports.workflowSelectSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const workflow_constants_1 = require("./workflow.constants");
6
+ exports.workflowSelectSchema = zod_1.z.object({
7
+ id: zod_1.z.uuid(),
8
+ userId: zod_1.z.string().nullable(),
9
+ jobId: zod_1.z.string(),
10
+ jobName: zod_1.z.string(),
11
+ queueName: zod_1.z.string(),
12
+ tags: zod_1.z.array(zod_1.z.string()).nullable(),
13
+ input: zod_1.z.unknown(),
14
+ output: zod_1.z.unknown(),
15
+ status: zod_1.z.enum(workflow_constants_1.WORFLOW_STATUSES),
16
+ error: zod_1.z.string().nullable(),
17
+ retries: zod_1.z.number(),
18
+ finishedAt: zod_1.z.date().nullable(),
19
+ processedAt: zod_1.z.date().nullable(),
20
+ createdAt: zod_1.z.date(),
21
+ updatedAt: zod_1.z.date(),
22
+ });
23
+ exports.workflowReadInputSchema = zod_1.z.object({
24
+ jobId: zod_1.z.string(),
25
+ });
26
+ exports.workflowListInputSchema = zod_1.z.object({
27
+ status: zod_1.z.enum(workflow_constants_1.WORFLOW_STATUSES).array().optional(),
28
+ jobName: zod_1.z.string().optional(),
29
+ });
30
+ exports.workflowTriggerOutputSchema = zod_1.z.object({
31
+ jobId: zod_1.z.string(),
32
+ });
33
+ exports.workflowTriggerManyOutputSchema = zod_1.z.object({
34
+ jobIds: zod_1.z.array(zod_1.z.string()),
35
+ });
36
+ exports.workflowReadOutputSchema = exports.workflowSelectSchema;
37
+ exports.workflowListOutputSchema = exports.workflowSelectSchema.array();
@@ -0,0 +1,3 @@
1
+ export declare function safeParseJson<T>(json: string, fallback: T): T;
2
+ export declare function safeParseJson<T>(json: string): T | undefined;
3
+ //# sourceMappingURL=json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../src/utils/json.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,CAAC;AAC/D,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAAC"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.safeParseJson = safeParseJson;
4
+ function safeParseJson(json, fallback) {
5
+ try {
6
+ return JSON.parse(json);
7
+ }
8
+ catch {
9
+ return fallback;
10
+ }
11
+ }
@@ -0,0 +1,15 @@
1
+ export type Timezone = {
2
+ name: string;
3
+ alternativeName: string;
4
+ group: string[];
5
+ continentCode: string;
6
+ continentName: string;
7
+ countryName: string;
8
+ countryCode: string;
9
+ mainCities: string[];
10
+ rawOffsetInMinutes: number;
11
+ abbreviation: string;
12
+ rawFormat: string;
13
+ };
14
+ export declare const timezones: Timezone[];
15
+ //# sourceMappingURL=timezones.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timezones.d.ts","sourceRoot":"","sources":["../../../src/utils/timezones.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,QAAQ,EA6wI/B,CAAC"}