@locusai/shared 0.4.6 → 0.4.9

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 (52) hide show
  1. package/dist/common.d.ts +200 -0
  2. package/dist/common.d.ts.map +1 -0
  3. package/dist/enums.d.ts +51 -0
  4. package/dist/enums.d.ts.map +1 -0
  5. package/dist/index.d.ts +1 -1
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +884 -3
  8. package/dist/models/activity.d.ts +947 -0
  9. package/dist/models/activity.d.ts.map +1 -0
  10. package/dist/models/agent.d.ts +21 -0
  11. package/dist/models/agent.d.ts.map +1 -0
  12. package/dist/models/auth.d.ts +374 -0
  13. package/dist/models/auth.d.ts.map +1 -0
  14. package/dist/models/ci.d.ts +76 -0
  15. package/dist/models/ci.d.ts.map +1 -0
  16. package/dist/models/doc-group.d.ts +144 -0
  17. package/dist/models/doc-group.d.ts.map +1 -0
  18. package/dist/models/doc.d.ts +251 -0
  19. package/dist/models/doc.d.ts.map +1 -0
  20. package/{src/models/index.ts → dist/models/index.d.ts} +1 -0
  21. package/dist/models/index.d.ts.map +1 -0
  22. package/dist/models/invitation.d.ts +257 -0
  23. package/dist/models/invitation.d.ts.map +1 -0
  24. package/dist/models/organization.d.ts +357 -0
  25. package/dist/models/organization.d.ts.map +1 -0
  26. package/dist/models/sprint.d.ts +218 -0
  27. package/dist/models/sprint.d.ts.map +1 -0
  28. package/dist/models/task.d.ts +1208 -0
  29. package/dist/models/task.d.ts.map +1 -0
  30. package/dist/models/user.d.ts +101 -0
  31. package/dist/models/user.d.ts.map +1 -0
  32. package/dist/models/workspace.d.ts +319 -0
  33. package/dist/models/workspace.d.ts.map +1 -0
  34. package/package.json +3 -20
  35. package/dist/schemas.d.ts +0 -297
  36. package/dist/schemas.d.ts.map +0 -1
  37. package/dist/schemas.js +0 -129
  38. package/src/common.ts +0 -106
  39. package/src/enums.ts +0 -56
  40. package/src/index.ts +0 -3
  41. package/src/models/activity.ts +0 -237
  42. package/src/models/agent.ts +0 -13
  43. package/src/models/auth.ts +0 -188
  44. package/src/models/ci.ts +0 -21
  45. package/src/models/doc-group.ts +0 -42
  46. package/src/models/doc.ts +0 -66
  47. package/src/models/invitation.ts +0 -83
  48. package/src/models/organization.ts +0 -105
  49. package/src/models/sprint.ts +0 -71
  50. package/src/models/task.ts +0 -110
  51. package/src/models/user.ts +0 -35
  52. package/src/models/workspace.ts +0 -99
package/dist/schemas.d.ts DELETED
@@ -1,297 +0,0 @@
1
- import { z } from "zod";
2
- import { AssigneeRole, MembershipRole, TaskPriority, TaskStatus, UserRole } from "./enums";
3
- export declare const OrganizationSchema: z.ZodObject<{
4
- name: z.ZodString;
5
- slug: z.ZodString;
6
- }, "strip", z.ZodTypeAny, {
7
- name: string;
8
- slug: string;
9
- }, {
10
- name: string;
11
- slug: string;
12
- }>;
13
- export declare const OrganizationUpdateSchema: z.ZodObject<{
14
- name: z.ZodOptional<z.ZodString>;
15
- avatarUrl: z.ZodNullable<z.ZodOptional<z.ZodString>>;
16
- }, "strip", z.ZodTypeAny, {
17
- name?: string | undefined;
18
- avatarUrl?: string | null | undefined;
19
- }, {
20
- name?: string | undefined;
21
- avatarUrl?: string | null | undefined;
22
- }>;
23
- export declare const ProjectSchema: z.ZodObject<{
24
- orgId: z.ZodString;
25
- name: z.ZodString;
26
- slug: z.ZodString;
27
- description: z.ZodOptional<z.ZodString>;
28
- repoUrl: z.ZodOptional<z.ZodString>;
29
- }, "strip", z.ZodTypeAny, {
30
- name: string;
31
- orgId: string;
32
- slug: string;
33
- description?: string | undefined;
34
- repoUrl?: string | undefined;
35
- }, {
36
- name: string;
37
- orgId: string;
38
- slug: string;
39
- description?: string | undefined;
40
- repoUrl?: string | undefined;
41
- }>;
42
- export declare const ProjectUpdateSchema: z.ZodObject<{
43
- name: z.ZodOptional<z.ZodString>;
44
- description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
45
- repoUrl: z.ZodNullable<z.ZodOptional<z.ZodString>>;
46
- }, "strip", z.ZodTypeAny, {
47
- name?: string | undefined;
48
- description?: string | null | undefined;
49
- repoUrl?: string | null | undefined;
50
- }, {
51
- name?: string | undefined;
52
- description?: string | null | undefined;
53
- repoUrl?: string | null | undefined;
54
- }>;
55
- export declare const UserSchema: z.ZodObject<{
56
- email: z.ZodString;
57
- name: z.ZodString;
58
- avatarUrl: z.ZodOptional<z.ZodString>;
59
- role: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof UserRole>>>;
60
- }, "strip", z.ZodTypeAny, {
61
- email: string;
62
- name: string;
63
- role: UserRole;
64
- avatarUrl?: string | undefined;
65
- }, {
66
- email: string;
67
- name: string;
68
- avatarUrl?: string | undefined;
69
- role?: UserRole | undefined;
70
- }>;
71
- export declare const MembershipSchema: z.ZodObject<{
72
- userId: z.ZodString;
73
- orgId: z.ZodString;
74
- role: z.ZodDefault<z.ZodNativeEnum<typeof MembershipRole>>;
75
- }, "strip", z.ZodTypeAny, {
76
- role: MembershipRole;
77
- orgId: string;
78
- userId: string;
79
- }, {
80
- orgId: string;
81
- userId: string;
82
- role?: MembershipRole | undefined;
83
- }>;
84
- export declare const APIKeySchema: z.ZodObject<{
85
- projectId: z.ZodString;
86
- name: z.ZodString;
87
- expiresAt: z.ZodOptional<z.ZodNumber>;
88
- }, "strip", z.ZodTypeAny, {
89
- name: string;
90
- projectId: string;
91
- expiresAt?: number | undefined;
92
- }, {
93
- name: string;
94
- projectId: string;
95
- expiresAt?: number | undefined;
96
- }>;
97
- export declare const DocumentSchema: z.ZodObject<{
98
- projectId: z.ZodString;
99
- path: z.ZodString;
100
- title: z.ZodString;
101
- content: z.ZodString;
102
- }, "strip", z.ZodTypeAny, {
103
- path: string;
104
- title: string;
105
- projectId: string;
106
- content: string;
107
- }, {
108
- path: string;
109
- title: string;
110
- projectId: string;
111
- content: string;
112
- }>;
113
- export declare const DocumentUpdateSchema: z.ZodObject<{
114
- path: z.ZodOptional<z.ZodString>;
115
- title: z.ZodOptional<z.ZodString>;
116
- content: z.ZodOptional<z.ZodString>;
117
- }, "strip", z.ZodTypeAny, {
118
- path?: string | undefined;
119
- title?: string | undefined;
120
- content?: string | undefined;
121
- }, {
122
- path?: string | undefined;
123
- title?: string | undefined;
124
- content?: string | undefined;
125
- }>;
126
- export declare const TaskSchema: z.ZodObject<{
127
- projectId: z.ZodOptional<z.ZodString>;
128
- title: z.ZodString;
129
- description: z.ZodDefault<z.ZodOptional<z.ZodString>>;
130
- status: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof TaskStatus>>>;
131
- priority: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof TaskPriority>>>;
132
- labels: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
133
- assigneeRole: z.ZodOptional<z.ZodNativeEnum<typeof AssigneeRole>>;
134
- parentId: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
135
- sprintId: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
136
- }, "strip", z.ZodTypeAny, {
137
- status: TaskStatus;
138
- title: string;
139
- description: string;
140
- priority: TaskPriority;
141
- labels: string[];
142
- assigneeRole?: AssigneeRole | undefined;
143
- sprintId?: number | null | undefined;
144
- parentId?: number | null | undefined;
145
- projectId?: string | undefined;
146
- }, {
147
- title: string;
148
- status?: TaskStatus | undefined;
149
- description?: string | undefined;
150
- priority?: TaskPriority | undefined;
151
- labels?: string[] | undefined;
152
- assigneeRole?: AssigneeRole | undefined;
153
- sprintId?: number | null | undefined;
154
- parentId?: number | null | undefined;
155
- projectId?: string | undefined;
156
- }>;
157
- export declare const TaskUpdateSchema: z.ZodObject<{
158
- title: z.ZodOptional<z.ZodString>;
159
- description: z.ZodOptional<z.ZodString>;
160
- labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
161
- status: z.ZodOptional<z.ZodNativeEnum<typeof TaskStatus>>;
162
- priority: z.ZodOptional<z.ZodNativeEnum<typeof TaskPriority>>;
163
- assigneeRole: z.ZodOptional<z.ZodNativeEnum<typeof AssigneeRole>>;
164
- parentId: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
165
- acceptanceChecklist: z.ZodOptional<z.ZodArray<z.ZodObject<{
166
- id: z.ZodString;
167
- text: z.ZodString;
168
- done: z.ZodBoolean;
169
- }, "strip", z.ZodTypeAny, {
170
- id: string;
171
- text: string;
172
- done: boolean;
173
- }, {
174
- id: string;
175
- text: string;
176
- done: boolean;
177
- }>, "many">>;
178
- }, "strip", z.ZodTypeAny, {
179
- status?: TaskStatus | undefined;
180
- title?: string | undefined;
181
- description?: string | undefined;
182
- priority?: TaskPriority | undefined;
183
- labels?: string[] | undefined;
184
- assigneeRole?: AssigneeRole | undefined;
185
- parentId?: number | null | undefined;
186
- acceptanceChecklist?: {
187
- id: string;
188
- text: string;
189
- done: boolean;
190
- }[] | undefined;
191
- }, {
192
- status?: TaskStatus | undefined;
193
- title?: string | undefined;
194
- description?: string | undefined;
195
- priority?: TaskPriority | undefined;
196
- labels?: string[] | undefined;
197
- assigneeRole?: AssigneeRole | undefined;
198
- parentId?: number | null | undefined;
199
- acceptanceChecklist?: {
200
- id: string;
201
- text: string;
202
- done: boolean;
203
- }[] | undefined;
204
- }>;
205
- export declare const SprintSchema: z.ZodObject<{
206
- projectId: z.ZodOptional<z.ZodString>;
207
- name: z.ZodString;
208
- startDate: z.ZodOptional<z.ZodNumber>;
209
- endDate: z.ZodOptional<z.ZodNumber>;
210
- }, "strip", z.ZodTypeAny, {
211
- name: string;
212
- startDate?: number | undefined;
213
- endDate?: number | undefined;
214
- projectId?: string | undefined;
215
- }, {
216
- name: string;
217
- startDate?: number | undefined;
218
- endDate?: number | undefined;
219
- projectId?: string | undefined;
220
- }>;
221
- export declare const CommentSchema: z.ZodObject<{
222
- author: z.ZodString;
223
- text: z.ZodString;
224
- }, "strip", z.ZodTypeAny, {
225
- author: string;
226
- text: string;
227
- }, {
228
- author: string;
229
- text: string;
230
- }>;
231
- export declare const LockSchema: z.ZodObject<{
232
- agentId: z.ZodString;
233
- ttlSeconds: z.ZodNumber;
234
- }, "strip", z.ZodTypeAny, {
235
- agentId: string;
236
- ttlSeconds: number;
237
- }, {
238
- agentId: string;
239
- ttlSeconds: number;
240
- }>;
241
- export declare const UnlockSchema: z.ZodObject<{
242
- agentId: z.ZodString;
243
- }, "strip", z.ZodTypeAny, {
244
- agentId: string;
245
- }, {
246
- agentId: string;
247
- }>;
248
- export declare const ArtifactSchema: z.ZodObject<{
249
- type: z.ZodString;
250
- title: z.ZodString;
251
- contentText: z.ZodOptional<z.ZodString>;
252
- fileBase64: z.ZodOptional<z.ZodString>;
253
- fileName: z.ZodOptional<z.ZodString>;
254
- createdBy: z.ZodString;
255
- }, "strip", z.ZodTypeAny, {
256
- type: string;
257
- title: string;
258
- createdBy: string;
259
- contentText?: string | undefined;
260
- fileBase64?: string | undefined;
261
- fileName?: string | undefined;
262
- }, {
263
- type: string;
264
- title: string;
265
- createdBy: string;
266
- contentText?: string | undefined;
267
- fileBase64?: string | undefined;
268
- fileName?: string | undefined;
269
- }>;
270
- export declare const CiRunSchema: z.ZodObject<{
271
- taskId: z.ZodNumber;
272
- preset: z.ZodString;
273
- }, "strip", z.ZodTypeAny, {
274
- taskId: number;
275
- preset: string;
276
- }, {
277
- taskId: number;
278
- preset: string;
279
- }>;
280
- export declare const DocWriteSchema: z.ZodObject<{
281
- path: z.ZodString;
282
- content: z.ZodString;
283
- }, "strip", z.ZodTypeAny, {
284
- path: string;
285
- content: string;
286
- }, {
287
- path: string;
288
- content: string;
289
- }>;
290
- export declare const DocSearchSchema: z.ZodObject<{
291
- query: z.ZodString;
292
- }, "strip", z.ZodTypeAny, {
293
- query: string;
294
- }, {
295
- query: string;
296
- }>;
297
- //# sourceMappingURL=schemas.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,UAAU,EACV,QAAQ,EACT,MAAM,SAAS,CAAC;AAMjB,eAAO,MAAM,kBAAkB;;;;;;;;;EAO7B,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;EAGnC,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;EAUxB,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;EAI9B,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;EAKrB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;EAI3B,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;EAIvB,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;EAKzB,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;EAI/B,CAAC;AAMH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUrB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiB3B,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;EAKvB,CAAC;AAMH,eAAO,MAAM,aAAa;;;;;;;;;EAGxB,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;EAGrB,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;EAEvB,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;EAOzB,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;EAGtB,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;EAGzB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;EAE1B,CAAC"}
package/dist/schemas.js DELETED
@@ -1,129 +0,0 @@
1
- import { z } from "zod";
2
- import { AssigneeRole, MembershipRole, TaskPriority, TaskStatus, UserRole, } from "./enums";
3
- // ============================================================================
4
- // Multi-tenancy Schemas
5
- // ============================================================================
6
- export const OrganizationSchema = z.object({
7
- name: z.string().min(1).max(100),
8
- slug: z
9
- .string()
10
- .min(1)
11
- .max(50)
12
- .regex(/^[a-z0-9-]+$/),
13
- });
14
- export const OrganizationUpdateSchema = z.object({
15
- name: z.string().min(1).max(100).optional(),
16
- avatarUrl: z.string().url().optional().nullable(),
17
- });
18
- export const ProjectSchema = z.object({
19
- orgId: z.string().uuid(),
20
- name: z.string().min(1).max(100),
21
- slug: z
22
- .string()
23
- .min(1)
24
- .max(50)
25
- .regex(/^[a-z0-9-]+$/),
26
- description: z.string().max(500).optional(),
27
- repoUrl: z.string().url().optional(),
28
- });
29
- export const ProjectUpdateSchema = z.object({
30
- name: z.string().min(1).max(100).optional(),
31
- description: z.string().max(500).optional().nullable(),
32
- repoUrl: z.string().url().optional().nullable(),
33
- });
34
- export const UserSchema = z.object({
35
- email: z.string().email(),
36
- name: z.string().min(1).max(100),
37
- avatarUrl: z.string().url().optional(),
38
- role: z.nativeEnum(UserRole).optional().default(UserRole.USER),
39
- });
40
- export const MembershipSchema = z.object({
41
- userId: z.string().uuid(),
42
- orgId: z.string().uuid(),
43
- role: z.nativeEnum(MembershipRole).default(MembershipRole.MEMBER),
44
- });
45
- export const APIKeySchema = z.object({
46
- projectId: z.string().uuid(),
47
- name: z.string().min(1).max(100),
48
- expiresAt: z.number().optional(),
49
- });
50
- export const DocumentSchema = z.object({
51
- projectId: z.string().uuid(),
52
- path: z.string().min(1).max(500),
53
- title: z.string().min(1).max(200),
54
- content: z.string(),
55
- });
56
- export const DocumentUpdateSchema = z.object({
57
- path: z.string().min(1).max(500).optional(),
58
- title: z.string().min(1).max(200).optional(),
59
- content: z.string().optional(),
60
- });
61
- // ============================================================================
62
- // Task & Sprint Schemas
63
- // ============================================================================
64
- export const TaskSchema = z.object({
65
- projectId: z.string().uuid().optional(), // Optional for local mode
66
- title: z.string().min(1),
67
- description: z.string().optional().default(""),
68
- status: z.nativeEnum(TaskStatus).optional().default(TaskStatus.BACKLOG),
69
- priority: z.nativeEnum(TaskPriority).optional().default(TaskPriority.MEDIUM),
70
- labels: z.array(z.string()).optional().default([]),
71
- assigneeRole: z.nativeEnum(AssigneeRole).optional(),
72
- parentId: z.number().optional().nullable(),
73
- sprintId: z.number().optional().nullable(),
74
- });
75
- export const TaskUpdateSchema = z.object({
76
- title: z.string().optional(),
77
- description: z.string().optional(),
78
- labels: z.array(z.string()).optional(),
79
- status: z.nativeEnum(TaskStatus).optional(),
80
- priority: z.nativeEnum(TaskPriority).optional(),
81
- assigneeRole: z.nativeEnum(AssigneeRole).optional(),
82
- parentId: z.number().optional().nullable(),
83
- acceptanceChecklist: z
84
- .array(z.object({
85
- id: z.string(),
86
- text: z.string(),
87
- done: z.boolean(),
88
- }))
89
- .optional(),
90
- });
91
- export const SprintSchema = z.object({
92
- projectId: z.string().uuid().optional(), // Optional for local mode
93
- name: z.string().min(1).max(100),
94
- startDate: z.number().optional(),
95
- endDate: z.number().optional(),
96
- });
97
- // ============================================================================
98
- // Other Schemas
99
- // ============================================================================
100
- export const CommentSchema = z.object({
101
- author: z.string().min(1),
102
- text: z.string().min(1),
103
- });
104
- export const LockSchema = z.object({
105
- agentId: z.string().min(1),
106
- ttlSeconds: z.number().positive(),
107
- });
108
- export const UnlockSchema = z.object({
109
- agentId: z.string().min(1),
110
- });
111
- export const ArtifactSchema = z.object({
112
- type: z.string().min(1),
113
- title: z.string().min(1),
114
- contentText: z.string().optional(),
115
- fileBase64: z.string().optional(),
116
- fileName: z.string().optional(),
117
- createdBy: z.string().min(1),
118
- });
119
- export const CiRunSchema = z.object({
120
- taskId: z.number(),
121
- preset: z.string().min(1),
122
- });
123
- export const DocWriteSchema = z.object({
124
- path: z.string().min(1),
125
- content: z.string(),
126
- });
127
- export const DocSearchSchema = z.object({
128
- query: z.string().min(1),
129
- });
package/src/common.ts DELETED
@@ -1,106 +0,0 @@
1
- import { z } from "zod";
2
-
3
- // ============================================================================
4
- // Base Entity
5
- // ============================================================================
6
-
7
- export const BaseEntitySchema = z.object({
8
- id: z.string().uuid(),
9
- createdAt: z.union([z.date(), z.number()]),
10
- updatedAt: z.union([z.date(), z.number()]),
11
- });
12
-
13
- export type BaseEntity = z.infer<typeof BaseEntitySchema>;
14
-
15
- // ============================================================================
16
- // Common API Response Schemas
17
- // ============================================================================
18
-
19
- export const PaginationMetaSchema = z.object({
20
- page: z.number(),
21
- limit: z.number(),
22
- total: z.number(),
23
- totalPages: z.number(),
24
- });
25
-
26
- export type PaginationMeta = z.infer<typeof PaginationMetaSchema>;
27
-
28
- export const PaginationRequestSchema = z.object({
29
- page: z.coerce.number().int().min(1).default(1),
30
- limit: z.coerce.number().int().min(1).max(100).default(20),
31
- });
32
-
33
- export type PaginationRequest = z.infer<typeof PaginationRequestSchema>;
34
-
35
- /**
36
- * Special type for cases where 'any' is absolutely necessary.
37
- * Use this sparingly and document why it's needed.
38
- */
39
- // biome-ignore lint/suspicious/noExplicitAny: We need to use any for this type
40
- export type $FixMe = any;
41
-
42
- export const ApiResponseSchema = z.object({
43
- success: z.boolean(),
44
- data: z.unknown().optional(),
45
- error: z
46
- .object({
47
- code: z.string(),
48
- message: z.string(),
49
- details: z.unknown().optional(),
50
- })
51
- .optional(),
52
- meta: z
53
- .object({
54
- pagination: PaginationMetaSchema.optional(),
55
- timestamp: z.string(),
56
- path: z.string(),
57
- })
58
- .optional(),
59
- });
60
-
61
- export type ApiResponse<T = unknown> = {
62
- success: boolean;
63
- data?: T;
64
- error?: {
65
- code: string;
66
- message: string;
67
- details?: unknown;
68
- };
69
- meta?: {
70
- pagination?: PaginationMeta;
71
- timestamp: string;
72
- path: string;
73
- };
74
- };
75
-
76
- export const SuccessResponseSchema = z.object({
77
- success: z.literal(true),
78
- message: z.string().optional(),
79
- });
80
-
81
- export const ErrorResponseSchema = z.object({
82
- success: z.literal(false),
83
- error: z.object({
84
- code: z.string(),
85
- message: z.string(),
86
- details: z.unknown().optional(),
87
- }),
88
- });
89
-
90
- // ============================================================================
91
- // Utility Types
92
- // ============================================================================
93
-
94
- export type SuccessResponse = z.infer<typeof SuccessResponseSchema>;
95
- export type ErrorResponse = z.infer<typeof ErrorResponseSchema>;
96
-
97
- /**
98
- * Generates a standard v4 UUID
99
- */
100
- export function generateUUID(): string {
101
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
102
- const r = (Math.random() * 16) | 0;
103
- const v = c === "x" ? r : (r & 0x3) | 0x8;
104
- return v.toString(16);
105
- });
106
- }
package/src/enums.ts DELETED
@@ -1,56 +0,0 @@
1
- export enum UserRole {
2
- USER = "USER",
3
- ADMIN = "ADMIN",
4
- }
5
-
6
- export enum MembershipRole {
7
- OWNER = "OWNER",
8
- ADMIN = "ADMIN",
9
- MEMBER = "MEMBER",
10
- VIEWER = "VIEWER",
11
- }
12
-
13
- export enum TaskStatus {
14
- BACKLOG = "BACKLOG",
15
- IN_PROGRESS = "IN_PROGRESS",
16
- REVIEW = "REVIEW",
17
- VERIFICATION = "VERIFICATION",
18
- DONE = "DONE",
19
- BLOCKED = "BLOCKED",
20
- }
21
-
22
- export enum TaskPriority {
23
- LOW = "LOW",
24
- MEDIUM = "MEDIUM",
25
- HIGH = "HIGH",
26
- CRITICAL = "CRITICAL",
27
- }
28
-
29
- export enum AssigneeRole {
30
- BACKEND = "BACKEND",
31
- FRONTEND = "FRONTEND",
32
- QA = "QA",
33
- PM = "PM",
34
- DESIGN = "DESIGN",
35
- }
36
-
37
- export enum SprintStatus {
38
- PLANNED = "PLANNED",
39
- ACTIVE = "ACTIVE",
40
- COMPLETED = "COMPLETED",
41
- }
42
-
43
- export enum EventType {
44
- TASK_CREATED = "TASK_CREATED",
45
- TASK_UPDATED = "TASK_UPDATED",
46
- TASK_DELETED = "TASK_DELETED",
47
- STATUS_CHANGED = "STATUS_CHANGED",
48
- COMMENT_ADDED = "COMMENT_ADDED",
49
- CI_RAN = "CI_RAN",
50
- WORKSPACE_CREATED = "WORKSPACE_CREATED",
51
- MEMBER_ADDED = "MEMBER_ADDED",
52
- MEMBER_INVITED = "MEMBER_INVITED",
53
- SPRINT_CREATED = "SPRINT_CREATED",
54
- SPRINT_STATUS_CHANGED = "SPRINT_STATUS_CHANGED",
55
- CHECKLIST_INITIALIZED = "CHECKLIST_INITIALIZED",
56
- }
package/src/index.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from "./common";
2
- export * from "./enums";
3
- export * from "./models";