@rudderhq/shared 0.2.10-canary.2 → 0.2.10-canary.21

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 (62) hide show
  1. package/dist/constants.d.ts +2 -0
  2. package/dist/constants.d.ts.map +1 -1
  3. package/dist/constants.js +4 -0
  4. package/dist/constants.js.map +1 -1
  5. package/dist/index.d.ts +4 -4
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +3 -3
  8. package/dist/index.js.map +1 -1
  9. package/dist/project-mentions.d.ts +19 -1
  10. package/dist/project-mentions.d.ts.map +1 -1
  11. package/dist/project-mentions.js +124 -3
  12. package/dist/project-mentions.js.map +1 -1
  13. package/dist/project-mentions.test.js +34 -3
  14. package/dist/project-mentions.test.js.map +1 -1
  15. package/dist/types/agent.d.ts +1 -0
  16. package/dist/types/agent.d.ts.map +1 -1
  17. package/dist/types/chat.d.ts +6 -0
  18. package/dist/types/chat.d.ts.map +1 -1
  19. package/dist/types/index.d.ts +4 -4
  20. package/dist/types/index.d.ts.map +1 -1
  21. package/dist/types/issue.d.ts +35 -0
  22. package/dist/types/issue.d.ts.map +1 -1
  23. package/dist/types/messenger.d.ts +4 -0
  24. package/dist/types/messenger.d.ts.map +1 -1
  25. package/dist/types/organization.d.ts +18 -0
  26. package/dist/types/organization.d.ts.map +1 -1
  27. package/dist/types/resource.d.ts +4 -1
  28. package/dist/types/resource.d.ts.map +1 -1
  29. package/dist/validators/automation.js +1 -1
  30. package/dist/validators/automation.test.js +10 -0
  31. package/dist/validators/automation.test.js.map +1 -1
  32. package/dist/validators/chat.d.ts +13 -0
  33. package/dist/validators/chat.d.ts.map +1 -1
  34. package/dist/validators/chat.js +2 -1
  35. package/dist/validators/chat.js.map +1 -1
  36. package/dist/validators/chat.test.js +22 -1
  37. package/dist/validators/chat.test.js.map +1 -1
  38. package/dist/validators/index.d.ts +3 -3
  39. package/dist/validators/index.d.ts.map +1 -1
  40. package/dist/validators/index.js +3 -3
  41. package/dist/validators/index.js.map +1 -1
  42. package/dist/validators/issue.d.ts +45 -0
  43. package/dist/validators/issue.d.ts.map +1 -1
  44. package/dist/validators/issue.js +16 -0
  45. package/dist/validators/issue.js.map +1 -1
  46. package/dist/validators/organization-portability.d.ts +19 -19
  47. package/dist/validators/organization-skill.d.ts +22 -22
  48. package/dist/validators/organization.d.ts +35 -0
  49. package/dist/validators/organization.d.ts.map +1 -1
  50. package/dist/validators/organization.js +13 -0
  51. package/dist/validators/organization.js.map +1 -1
  52. package/dist/validators/project.d.ts +58 -8
  53. package/dist/validators/project.d.ts.map +1 -1
  54. package/dist/validators/resource.d.ts +61 -3
  55. package/dist/validators/resource.d.ts.map +1 -1
  56. package/dist/validators/resource.js +45 -5
  57. package/dist/validators/resource.js.map +1 -1
  58. package/dist/validators/resource.test.d.ts +2 -0
  59. package/dist/validators/resource.test.d.ts.map +1 -0
  60. package/dist/validators/resource.test.js +51 -0
  61. package/dist/validators/resource.test.js.map +1 -0
  62. package/package.json +1 -1
@@ -86,8 +86,8 @@ export declare const createProjectWorkspaceSchema: z.ZodEffects<z.ZodObject<{
86
86
  }, "strip", z.ZodTypeAny, {
87
87
  isPrimary: boolean;
88
88
  name?: string | undefined;
89
- metadata?: Record<string, unknown> | null | undefined;
90
89
  sourceType?: "local_path" | "git_repo" | "remote_managed" | "non_git_path" | undefined;
90
+ metadata?: Record<string, unknown> | null | undefined;
91
91
  repoUrl?: string | null | undefined;
92
92
  repoRef?: string | null | undefined;
93
93
  defaultRef?: string | null | undefined;
@@ -100,8 +100,8 @@ export declare const createProjectWorkspaceSchema: z.ZodEffects<z.ZodObject<{
100
100
  sharedWorkspaceKey?: string | null | undefined;
101
101
  }, {
102
102
  name?: string | undefined;
103
- metadata?: Record<string, unknown> | null | undefined;
104
103
  sourceType?: "local_path" | "git_repo" | "remote_managed" | "non_git_path" | undefined;
104
+ metadata?: Record<string, unknown> | null | undefined;
105
105
  repoUrl?: string | null | undefined;
106
106
  repoRef?: string | null | undefined;
107
107
  defaultRef?: string | null | undefined;
@@ -116,8 +116,8 @@ export declare const createProjectWorkspaceSchema: z.ZodEffects<z.ZodObject<{
116
116
  }>, {
117
117
  isPrimary: boolean;
118
118
  name?: string | undefined;
119
- metadata?: Record<string, unknown> | null | undefined;
120
119
  sourceType?: "local_path" | "git_repo" | "remote_managed" | "non_git_path" | undefined;
120
+ metadata?: Record<string, unknown> | null | undefined;
121
121
  repoUrl?: string | null | undefined;
122
122
  repoRef?: string | null | undefined;
123
123
  defaultRef?: string | null | undefined;
@@ -130,8 +130,8 @@ export declare const createProjectWorkspaceSchema: z.ZodEffects<z.ZodObject<{
130
130
  sharedWorkspaceKey?: string | null | undefined;
131
131
  }, {
132
132
  name?: string | undefined;
133
- metadata?: Record<string, unknown> | null | undefined;
134
133
  sourceType?: "local_path" | "git_repo" | "remote_managed" | "non_git_path" | undefined;
134
+ metadata?: Record<string, unknown> | null | undefined;
135
135
  repoUrl?: string | null | undefined;
136
136
  repoRef?: string | null | undefined;
137
137
  defaultRef?: string | null | undefined;
@@ -162,8 +162,8 @@ export declare const updateProjectWorkspaceSchema: z.ZodObject<{
162
162
  metadata: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
163
163
  }, "strip", z.ZodTypeAny, {
164
164
  name?: string | undefined;
165
- metadata?: Record<string, unknown> | null | undefined;
166
165
  sourceType?: "local_path" | "git_repo" | "remote_managed" | "non_git_path" | undefined;
166
+ metadata?: Record<string, unknown> | null | undefined;
167
167
  repoUrl?: string | null | undefined;
168
168
  repoRef?: string | null | undefined;
169
169
  defaultRef?: string | null | undefined;
@@ -177,8 +177,8 @@ export declare const updateProjectWorkspaceSchema: z.ZodObject<{
177
177
  sharedWorkspaceKey?: string | null | undefined;
178
178
  }, {
179
179
  name?: string | undefined;
180
- metadata?: Record<string, unknown> | null | undefined;
181
180
  sourceType?: "local_path" | "git_repo" | "remote_managed" | "non_git_path" | undefined;
181
+ metadata?: Record<string, unknown> | null | undefined;
182
182
  repoUrl?: string | null | undefined;
183
183
  repoRef?: string | null | undefined;
184
184
  defaultRef?: string | null | undefined;
@@ -287,9 +287,10 @@ export declare const createProjectSchema: z.ZodObject<{
287
287
  note?: string | null | undefined;
288
288
  sortOrder?: number | undefined;
289
289
  }>, "many">>;
290
- newResources: z.ZodOptional<z.ZodArray<z.ZodObject<{
290
+ newResources: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
291
291
  name: z.ZodString;
292
292
  kind: z.ZodEnum<["file", "directory", "url", "connector_object"]>;
293
+ sourceType: z.ZodDefault<z.ZodOptional<z.ZodEnum<["external", "library"]>>>;
293
294
  locator: z.ZodString;
294
295
  description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
295
296
  metadata: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
@@ -301,6 +302,27 @@ export declare const createProjectSchema: z.ZodObject<{
301
302
  kind: "file" | "directory" | "url" | "connector_object";
302
303
  name: string;
303
304
  locator: string;
305
+ sourceType: "external" | "library";
306
+ description?: string | null | undefined;
307
+ metadata?: Record<string, unknown> | null | undefined;
308
+ role?: "working_set" | "reference" | "tracking" | "deliverable" | "background" | undefined;
309
+ note?: string | null | undefined;
310
+ sortOrder?: number | undefined;
311
+ }, {
312
+ kind: "file" | "directory" | "url" | "connector_object";
313
+ name: string;
314
+ locator: string;
315
+ description?: string | null | undefined;
316
+ sourceType?: "external" | "library" | undefined;
317
+ metadata?: Record<string, unknown> | null | undefined;
318
+ role?: "working_set" | "reference" | "tracking" | "deliverable" | "background" | undefined;
319
+ note?: string | null | undefined;
320
+ sortOrder?: number | undefined;
321
+ }>, {
322
+ kind: "file" | "directory" | "url" | "connector_object";
323
+ name: string;
324
+ locator: string;
325
+ sourceType: "external" | "library";
304
326
  description?: string | null | undefined;
305
327
  metadata?: Record<string, unknown> | null | undefined;
306
328
  role?: "working_set" | "reference" | "tracking" | "deliverable" | "background" | undefined;
@@ -311,6 +333,7 @@ export declare const createProjectSchema: z.ZodObject<{
311
333
  name: string;
312
334
  locator: string;
313
335
  description?: string | null | undefined;
336
+ sourceType?: "external" | "library" | undefined;
314
337
  metadata?: Record<string, unknown> | null | undefined;
315
338
  role?: "working_set" | "reference" | "tracking" | "deliverable" | "background" | undefined;
316
339
  note?: string | null | undefined;
@@ -355,6 +378,7 @@ export declare const createProjectSchema: z.ZodObject<{
355
378
  kind: "file" | "directory" | "url" | "connector_object";
356
379
  name: string;
357
380
  locator: string;
381
+ sourceType: "external" | "library";
358
382
  description?: string | null | undefined;
359
383
  metadata?: Record<string, unknown> | null | undefined;
360
384
  role?: "working_set" | "reference" | "tracking" | "deliverable" | "background" | undefined;
@@ -401,6 +425,7 @@ export declare const createProjectSchema: z.ZodObject<{
401
425
  name: string;
402
426
  locator: string;
403
427
  description?: string | null | undefined;
428
+ sourceType?: "external" | "library" | undefined;
404
429
  metadata?: Record<string, unknown> | null | undefined;
405
430
  role?: "working_set" | "reference" | "tracking" | "deliverable" | "background" | undefined;
406
431
  note?: string | null | undefined;
@@ -503,9 +528,10 @@ export declare const updateProjectSchema: z.ZodObject<{
503
528
  note?: string | null | undefined;
504
529
  sortOrder?: number | undefined;
505
530
  }>, "many">>>;
506
- newResources: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
531
+ newResources: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
507
532
  name: z.ZodString;
508
533
  kind: z.ZodEnum<["file", "directory", "url", "connector_object"]>;
534
+ sourceType: z.ZodDefault<z.ZodOptional<z.ZodEnum<["external", "library"]>>>;
509
535
  locator: z.ZodString;
510
536
  description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
511
537
  metadata: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
@@ -517,6 +543,27 @@ export declare const updateProjectSchema: z.ZodObject<{
517
543
  kind: "file" | "directory" | "url" | "connector_object";
518
544
  name: string;
519
545
  locator: string;
546
+ sourceType: "external" | "library";
547
+ description?: string | null | undefined;
548
+ metadata?: Record<string, unknown> | null | undefined;
549
+ role?: "working_set" | "reference" | "tracking" | "deliverable" | "background" | undefined;
550
+ note?: string | null | undefined;
551
+ sortOrder?: number | undefined;
552
+ }, {
553
+ kind: "file" | "directory" | "url" | "connector_object";
554
+ name: string;
555
+ locator: string;
556
+ description?: string | null | undefined;
557
+ sourceType?: "external" | "library" | undefined;
558
+ metadata?: Record<string, unknown> | null | undefined;
559
+ role?: "working_set" | "reference" | "tracking" | "deliverable" | "background" | undefined;
560
+ note?: string | null | undefined;
561
+ sortOrder?: number | undefined;
562
+ }>, {
563
+ kind: "file" | "directory" | "url" | "connector_object";
564
+ name: string;
565
+ locator: string;
566
+ sourceType: "external" | "library";
520
567
  description?: string | null | undefined;
521
568
  metadata?: Record<string, unknown> | null | undefined;
522
569
  role?: "working_set" | "reference" | "tracking" | "deliverable" | "background" | undefined;
@@ -527,6 +574,7 @@ export declare const updateProjectSchema: z.ZodObject<{
527
574
  name: string;
528
575
  locator: string;
529
576
  description?: string | null | undefined;
577
+ sourceType?: "external" | "library" | undefined;
530
578
  metadata?: Record<string, unknown> | null | undefined;
531
579
  role?: "working_set" | "reference" | "tracking" | "deliverable" | "background" | undefined;
532
580
  note?: string | null | undefined;
@@ -571,6 +619,7 @@ export declare const updateProjectSchema: z.ZodObject<{
571
619
  kind: "file" | "directory" | "url" | "connector_object";
572
620
  name: string;
573
621
  locator: string;
622
+ sourceType: "external" | "library";
574
623
  description?: string | null | undefined;
575
624
  metadata?: Record<string, unknown> | null | undefined;
576
625
  role?: "working_set" | "reference" | "tracking" | "deliverable" | "background" | undefined;
@@ -617,6 +666,7 @@ export declare const updateProjectSchema: z.ZodObject<{
617
666
  name: string;
618
667
  locator: string;
619
668
  description?: string | null | undefined;
669
+ sourceType?: "external" | "library" | undefined;
620
670
  metadata?: Record<string, unknown> | null | undefined;
621
671
  role?: "working_set" | "reference" | "tracking" | "deliverable" | "background" | undefined;
622
672
  note?: string | null | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/validators/project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkBxB,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAavC,CAAC;AAsDZ,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGD,CAAC;AAEzC,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG7B,CAAC;AAEb,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAkBlF,eAAO,MAAM,mBAAmB;IAf9B,sCAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBtC,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBtC,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAoC,CAAC;AAErE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC"}
@@ -1,9 +1,11 @@
1
1
  import { z } from "zod";
2
2
  export declare const organizationResourceKindSchema: z.ZodEnum<["file", "directory", "url", "connector_object"]>;
3
+ export declare const organizationResourceSourceTypeSchema: z.ZodEnum<["external", "library"]>;
3
4
  export declare const projectResourceAttachmentRoleSchema: z.ZodEnum<["working_set", "reference", "tracking", "deliverable", "background"]>;
4
- export declare const createOrganizationResourceSchema: z.ZodObject<{
5
+ export declare const createOrganizationResourceSchema: z.ZodEffects<z.ZodObject<{
5
6
  name: z.ZodString;
6
7
  kind: z.ZodEnum<["file", "directory", "url", "connector_object"]>;
8
+ sourceType: z.ZodDefault<z.ZodOptional<z.ZodEnum<["external", "library"]>>>;
7
9
  locator: z.ZodString;
8
10
  description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
9
11
  metadata: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
@@ -11,6 +13,7 @@ export declare const createOrganizationResourceSchema: z.ZodObject<{
11
13
  kind: "file" | "directory" | "url" | "connector_object";
12
14
  name: string;
13
15
  locator: string;
16
+ sourceType: "external" | "library";
14
17
  description?: string | null | undefined;
15
18
  metadata?: Record<string, unknown> | null | undefined;
16
19
  }, {
@@ -18,12 +21,28 @@ export declare const createOrganizationResourceSchema: z.ZodObject<{
18
21
  name: string;
19
22
  locator: string;
20
23
  description?: string | null | undefined;
24
+ sourceType?: "external" | "library" | undefined;
25
+ metadata?: Record<string, unknown> | null | undefined;
26
+ }>, {
27
+ kind: "file" | "directory" | "url" | "connector_object";
28
+ name: string;
29
+ locator: string;
30
+ sourceType: "external" | "library";
31
+ description?: string | null | undefined;
32
+ metadata?: Record<string, unknown> | null | undefined;
33
+ }, {
34
+ kind: "file" | "directory" | "url" | "connector_object";
35
+ name: string;
36
+ locator: string;
37
+ description?: string | null | undefined;
38
+ sourceType?: "external" | "library" | undefined;
21
39
  metadata?: Record<string, unknown> | null | undefined;
22
40
  }>;
23
41
  export type CreateOrganizationResource = z.infer<typeof createOrganizationResourceSchema>;
24
- export declare const updateOrganizationResourceSchema: z.ZodObject<{
42
+ export declare const updateOrganizationResourceSchema: z.ZodEffects<z.ZodObject<{
25
43
  name: z.ZodOptional<z.ZodString>;
26
44
  kind: z.ZodOptional<z.ZodEnum<["file", "directory", "url", "connector_object"]>>;
45
+ sourceType: z.ZodOptional<z.ZodEnum<["external", "library"]>>;
27
46
  locator: z.ZodOptional<z.ZodString>;
28
47
  description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
29
48
  metadata: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
@@ -32,12 +51,28 @@ export declare const updateOrganizationResourceSchema: z.ZodObject<{
32
51
  description?: string | null | undefined;
33
52
  name?: string | undefined;
34
53
  locator?: string | undefined;
54
+ sourceType?: "external" | "library" | undefined;
35
55
  metadata?: Record<string, unknown> | null | undefined;
36
56
  }, {
37
57
  kind?: "file" | "directory" | "url" | "connector_object" | undefined;
38
58
  description?: string | null | undefined;
39
59
  name?: string | undefined;
40
60
  locator?: string | undefined;
61
+ sourceType?: "external" | "library" | undefined;
62
+ metadata?: Record<string, unknown> | null | undefined;
63
+ }>, {
64
+ kind?: "file" | "directory" | "url" | "connector_object" | undefined;
65
+ description?: string | null | undefined;
66
+ name?: string | undefined;
67
+ locator?: string | undefined;
68
+ sourceType?: "external" | "library" | undefined;
69
+ metadata?: Record<string, unknown> | null | undefined;
70
+ }, {
71
+ kind?: "file" | "directory" | "url" | "connector_object" | undefined;
72
+ description?: string | null | undefined;
73
+ name?: string | undefined;
74
+ locator?: string | undefined;
75
+ sourceType?: "external" | "library" | undefined;
41
76
  metadata?: Record<string, unknown> | null | undefined;
42
77
  }>;
43
78
  export type UpdateOrganizationResource = z.infer<typeof updateOrganizationResourceSchema>;
@@ -72,9 +107,10 @@ export declare const updateProjectResourceAttachmentSchema: z.ZodObject<{
72
107
  sortOrder?: number | undefined;
73
108
  }>;
74
109
  export type UpdateProjectResourceAttachment = z.infer<typeof updateProjectResourceAttachmentSchema>;
75
- export declare const createProjectInlineResourceSchema: z.ZodObject<{
110
+ export declare const createProjectInlineResourceSchema: z.ZodEffects<z.ZodObject<{
76
111
  name: z.ZodString;
77
112
  kind: z.ZodEnum<["file", "directory", "url", "connector_object"]>;
113
+ sourceType: z.ZodDefault<z.ZodOptional<z.ZodEnum<["external", "library"]>>>;
78
114
  locator: z.ZodString;
79
115
  description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
80
116
  metadata: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
@@ -86,6 +122,27 @@ export declare const createProjectInlineResourceSchema: z.ZodObject<{
86
122
  kind: "file" | "directory" | "url" | "connector_object";
87
123
  name: string;
88
124
  locator: string;
125
+ sourceType: "external" | "library";
126
+ description?: string | null | undefined;
127
+ metadata?: Record<string, unknown> | null | undefined;
128
+ role?: "working_set" | "reference" | "tracking" | "deliverable" | "background" | undefined;
129
+ note?: string | null | undefined;
130
+ sortOrder?: number | undefined;
131
+ }, {
132
+ kind: "file" | "directory" | "url" | "connector_object";
133
+ name: string;
134
+ locator: string;
135
+ description?: string | null | undefined;
136
+ sourceType?: "external" | "library" | undefined;
137
+ metadata?: Record<string, unknown> | null | undefined;
138
+ role?: "working_set" | "reference" | "tracking" | "deliverable" | "background" | undefined;
139
+ note?: string | null | undefined;
140
+ sortOrder?: number | undefined;
141
+ }>, {
142
+ kind: "file" | "directory" | "url" | "connector_object";
143
+ name: string;
144
+ locator: string;
145
+ sourceType: "external" | "library";
89
146
  description?: string | null | undefined;
90
147
  metadata?: Record<string, unknown> | null | undefined;
91
148
  role?: "working_set" | "reference" | "tracking" | "deliverable" | "background" | undefined;
@@ -96,6 +153,7 @@ export declare const createProjectInlineResourceSchema: z.ZodObject<{
96
153
  name: string;
97
154
  locator: string;
98
155
  description?: string | null | undefined;
156
+ sourceType?: "external" | "library" | undefined;
99
157
  metadata?: Record<string, unknown> | null | undefined;
100
158
  role?: "working_set" | "reference" | "tracking" | "deliverable" | "background" | undefined;
101
159
  note?: string | null | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../src/validators/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,8BAA8B,6DAAsC,CAAC;AAClF,eAAO,MAAM,mCAAmC,kFAA4C,CAAC;AAE7F,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;EAM3C,CAAC;AAEH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAE1F,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;EAMlC,CAAC;AAEZ,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAE1F,eAAO,MAAM,oCAAoC;;;;;;;;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OAAO,qCAAqC,CAAC,CAAC;AAEpG,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIU,CAAC;AAEzD,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC"}
@@ -1,21 +1,61 @@
1
1
  import { z } from "zod";
2
- import { ORGANIZATION_RESOURCE_KINDS, PROJECT_RESOURCE_ATTACHMENT_ROLES } from "../constants.js";
2
+ import { ORGANIZATION_RESOURCE_KINDS, ORGANIZATION_RESOURCE_SOURCE_TYPES, PROJECT_RESOURCE_ATTACHMENT_ROLES, } from "../constants.js";
3
3
  export const organizationResourceKindSchema = z.enum(ORGANIZATION_RESOURCE_KINDS);
4
+ export const organizationResourceSourceTypeSchema = z.enum(ORGANIZATION_RESOURCE_SOURCE_TYPES);
4
5
  export const projectResourceAttachmentRoleSchema = z.enum(PROJECT_RESOURCE_ATTACHMENT_ROLES);
5
- export const createOrganizationResourceSchema = z.object({
6
+ const LIBRARY_PATH_SCHEME_RE = /^[a-z][a-z0-9+.-]*:/i;
7
+ const PROTECTED_LIBRARY_RESOURCE_ROOTS = new Set(["agents", "artifacts", "plans", "skills"]);
8
+ function isValidLibraryRelativePath(locator) {
9
+ const trimmed = locator.trim();
10
+ if (!trimmed)
11
+ return false;
12
+ if (LIBRARY_PATH_SCHEME_RE.test(trimmed))
13
+ return false;
14
+ if (trimmed.startsWith("/") || trimmed.startsWith("\\") || trimmed.startsWith("~"))
15
+ return false;
16
+ if (trimmed.includes("\\"))
17
+ return false;
18
+ const parts = trimmed.split("/");
19
+ if (!parts.every((part) => part.length > 0 && part !== "." && part !== ".."))
20
+ return false;
21
+ return !PROTECTED_LIBRARY_RESOURCE_ROOTS.has(parts[0] ?? "");
22
+ }
23
+ function validateLibraryResourceContract(value, ctx) {
24
+ if (value.sourceType !== "library")
25
+ return;
26
+ if (value.kind !== undefined && value.kind !== "file" && value.kind !== "directory") {
27
+ ctx.addIssue({
28
+ code: z.ZodIssueCode.custom,
29
+ message: "Library resources must be file or directory resources.",
30
+ path: ["kind"],
31
+ });
32
+ }
33
+ if (value.locator !== undefined && !isValidLibraryRelativePath(value.locator)) {
34
+ ctx.addIssue({
35
+ code: z.ZodIssueCode.custom,
36
+ message: "Library resource locator must be a normalized relative path inside the organization Library.",
37
+ path: ["locator"],
38
+ });
39
+ }
40
+ }
41
+ const createOrganizationResourceBaseSchema = z.object({
6
42
  name: z.string().min(1),
7
43
  kind: organizationResourceKindSchema,
44
+ sourceType: organizationResourceSourceTypeSchema.optional().default("external"),
8
45
  locator: z.string().min(1),
9
46
  description: z.string().optional().nullable(),
10
47
  metadata: z.record(z.unknown()).optional().nullable(),
11
48
  });
49
+ export const createOrganizationResourceSchema = createOrganizationResourceBaseSchema
50
+ .superRefine(validateLibraryResourceContract);
12
51
  export const updateOrganizationResourceSchema = z.object({
13
52
  name: z.string().min(1).optional(),
14
53
  kind: organizationResourceKindSchema.optional(),
54
+ sourceType: organizationResourceSourceTypeSchema.optional(),
15
55
  locator: z.string().min(1).optional(),
16
56
  description: z.string().optional().nullable(),
17
57
  metadata: z.record(z.unknown()).optional().nullable(),
18
- }).strict();
58
+ }).strict().superRefine(validateLibraryResourceContract);
19
59
  export const projectResourceAttachmentInputSchema = z.object({
20
60
  resourceId: z.string().uuid(),
21
61
  role: projectResourceAttachmentRoleSchema.optional(),
@@ -27,9 +67,9 @@ export const updateProjectResourceAttachmentSchema = z.object({
27
67
  note: z.string().optional().nullable(),
28
68
  sortOrder: z.number().int().nonnegative().optional(),
29
69
  }).strict();
30
- export const createProjectInlineResourceSchema = createOrganizationResourceSchema.extend({
70
+ export const createProjectInlineResourceSchema = createOrganizationResourceBaseSchema.extend({
31
71
  role: projectResourceAttachmentRoleSchema.optional(),
32
72
  note: z.string().optional().nullable(),
33
73
  sortOrder: z.number().int().nonnegative().optional(),
34
- }).strict();
74
+ }).strict().superRefine(validateLibraryResour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CAAmC,CAAC,QAAQ,EAAE;IACpD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACtC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;CACrD,CAAC,CAAC,MAAM,EAAE,CAAC;AAIZ,MAAM,CAAC,MAAM,iCAAiC,GAAG,oCAAoC,CAAC,MAAM,CAAC;IAC3F,IAAI,EAAE,mCAAmC,CAAC,QAAQ,EAAE;IACpD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACtC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;CACrD,CAAC,CAAC,MAAM,EAAE,CAAC,WAAW,CAAC,+BAA+B,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=resource.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource.test.d.ts","sourceRoot":"","sources":["../../src/validators/resource.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,51 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { createOrganizationResourceSchema, updateOrganizationResourceSchema, } from "./resource.js";
3
+ describe("organization resource validators", () => {
4
+ it("accepts library resources with normalized relative locators", () => {
5
+ expect(createOrganizationResourceSchema.parse({
6
+ name: "Spec",
7
+ kind: "file",
8
+ sourceType: "library",
9
+ locator: "docs/spec.md",
10
+ })).toMatchObject({
11
+ sourceType: "library",
12
+ locator: "docs/spec.md",
13
+ });
14
+ });
15
+ it("rejects library resources that are not file or directory resources", () => {
16
+ expect(() => createOrganizationResourceSchema.parse({
17
+ name: "Website",
18
+ kind: "url",
19
+ sourceType: "library",
20
+ locator: "docs/spec.md",
21
+ })).toThrow(/file or directory/);
22
+ });
23
+ it.each([
24
+ "https://example.com/spec.md",
25
+ "/Users/acme/spec.md",
26
+ "../spec.md",
27
+ "docs/../spec.md",
28
+ "docs//spec.md",
29
+ "docs/./spec.md",
30
+ "docs\\spec.md",
31
+ "agents/builder--123/instructions/SOUL.md",
32
+ "artifacts/report.md",
33
+ "plans/project-plan.md",
34
+ "skills/writer/SKILL.md",
35
+ ])("rejects unsafe library locator %s", (locator) => {
36
+ expect(() => createOrganizationResourceSchema.parse({
37
+ name: "Spec",
38
+ kind: "file",
39
+ sourceType: "library",
40
+ locator,
41
+ })).toThrow(/normalized relative path/);
42
+ });
43
+ it("validates library update patches when the updated fields are present", () => {
44
+ expect(() => updateOrganizationResourceSchema.parse({
45
+ sourceType: "library",
46
+ kind: "file",
47
+ locator: "../outside.md",
48
+ })).toThrow(/normalized relative path/);
49
+ });
50
+ });
51
+ //# sourceMappingURL=resource.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource.test.js","sourceRoot":"","sources":["../../src/validators/resource.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,gCAAgC,EAChC,gCAAgC,GACjC,MAAM,eAAe,CAAC;AAEvB,QAAQ,CAAC,kCAAkC,EAAE,GAAG,EAAE;IAChD,EAAE,CAAC,6DAA6D,EAAE,GAAG,EAAE;QACrE,MAAM,CAAC,gCAAgC,CAAC,KAAK,CAAC;YAC5C,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,MAAM;YACZ,UAAU,EAAE,SAAS;YACrB,OAAO,EAAE,cAAc;SACxB,CAAC,CAAC,CAAC,aAAa,CAAC;YAChB,UAAU,EAAE,SAAS;YACrB,OAAO,EAAE,cAAc;SACxB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oEAAoE,EAAE,GAAG,EAAE;QAC5E,MAAM,CAAC,GAAG,EAAE,CAAC,gCAAgC,CAAC,KAAK,CAAC;YAClD,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,KAAK;YACX,UAAU,EAAE,SAAS;YACrB,OAAO,EAAE,cAAc;SACxB,CAAC,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,IAAI,CAAC;QACN,6BAA6B;QAC7B,qBAAqB;QACrB,YAAY;QACZ,iBAAiB;QACjB,eAAe;QACf,gBAAgB;QAChB,eAAe;QACf,0CAA0C;QAC1C,qBAAqB;QACrB,uBAAuB;QACvB,wBAAwB;KACzB,CAAC,CAAC,mCAAmC,EAAE,CAAC,OAAO,EAAE,EAAE;QAClD,MAAM,CAAC,GAAG,EAAE,CAAC,gCAAgC,CAAC,KAAK,CAAC;YAClD,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,MAAM;YACZ,UAAU,EAAE,SAAS;YACrB,OAAO;SACR,CAAC,CAAC,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sEAAsE,EAAE,GAAG,EAAE;QAC9E,MAAM,CAAC,GAAG,EAAE,CAAC,gCAAgC,CAAC,KAAK,CAAC;YAClD,UAAU,EAAE,SAAS;YACrB,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,eAAe;SACzB,CAAC,CAAC,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rudderhq/shared",
3
- "version": "0.2.10-canary.2",
3
+ "version": "0.2.10-canary.21",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "homepage": "https://github.com/Undertone0809/rudder",
6
6
  "bugs": {