@bugbug-io/api-schema 14.16.0 → 14.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/tags.d.ts +32 -0
- package/dist/schemas/tags.d.ts.map +1 -0
- package/dist/schemas/tags.js +48 -0
- package/dist/schemas/tags.js.map +1 -0
- package/package.json +1 -1
package/dist/schemas/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC"}
|
package/dist/schemas/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const TAG_COLOR_PALETTE: readonly ["#6D28D9", "#7C3AED", "#A855F7", "#D946EF", "#EC4899", "#F43F5E", "#EF4444", "#F97316", "#D97706", "#CA8A04", "#84CC16", "#22C55E", "#10B981", "#14B8A6", "#06B6D4", "#0EA5E9", "#3B82F6", "#6366F1", "#64748B", "#78716C"];
|
|
3
|
+
export declare const TagColorSchema: z.ZodEnum<["#6D28D9", "#7C3AED", "#A855F7", "#D946EF", "#EC4899", "#F43F5E", "#EF4444", "#F97316", "#D97706", "#CA8A04", "#84CC16", "#22C55E", "#10B981", "#14B8A6", "#06B6D4", "#0EA5E9", "#3B82F6", "#6366F1", "#64748B", "#78716C"]>;
|
|
4
|
+
export declare const TagNameSchema: z.ZodString;
|
|
5
|
+
export declare const TagCreateSchema: z.ZodObject<{
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
color: z.ZodDefault<z.ZodEnum<["#6D28D9", "#7C3AED", "#A855F7", "#D946EF", "#EC4899", "#F43F5E", "#EF4444", "#F97316", "#D97706", "#CA8A04", "#84CC16", "#22C55E", "#10B981", "#14B8A6", "#06B6D4", "#0EA5E9", "#3B82F6", "#6366F1", "#64748B", "#78716C"]>>;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
name: string;
|
|
10
|
+
color: "#6D28D9" | "#7C3AED" | "#A855F7" | "#D946EF" | "#EC4899" | "#F43F5E" | "#EF4444" | "#F97316" | "#D97706" | "#CA8A04" | "#84CC16" | "#22C55E" | "#10B981" | "#14B8A6" | "#06B6D4" | "#0EA5E9" | "#3B82F6" | "#6366F1" | "#64748B" | "#78716C";
|
|
11
|
+
}, {
|
|
12
|
+
name: string;
|
|
13
|
+
color?: "#6D28D9" | "#7C3AED" | "#A855F7" | "#D946EF" | "#EC4899" | "#F43F5E" | "#EF4444" | "#F97316" | "#D97706" | "#CA8A04" | "#84CC16" | "#22C55E" | "#10B981" | "#14B8A6" | "#06B6D4" | "#0EA5E9" | "#3B82F6" | "#6366F1" | "#64748B" | "#78716C" | undefined;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const TagUpdateSchema: z.ZodEffects<z.ZodObject<{
|
|
16
|
+
name: z.ZodOptional<z.ZodString>;
|
|
17
|
+
color: z.ZodOptional<z.ZodEnum<["#6D28D9", "#7C3AED", "#A855F7", "#D946EF", "#EC4899", "#F43F5E", "#EF4444", "#F97316", "#D97706", "#CA8A04", "#84CC16", "#22C55E", "#10B981", "#14B8A6", "#06B6D4", "#0EA5E9", "#3B82F6", "#6366F1", "#64748B", "#78716C"]>>;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
name?: string | undefined;
|
|
20
|
+
color?: "#6D28D9" | "#7C3AED" | "#A855F7" | "#D946EF" | "#EC4899" | "#F43F5E" | "#EF4444" | "#F97316" | "#D97706" | "#CA8A04" | "#84CC16" | "#22C55E" | "#10B981" | "#14B8A6" | "#06B6D4" | "#0EA5E9" | "#3B82F6" | "#6366F1" | "#64748B" | "#78716C" | undefined;
|
|
21
|
+
}, {
|
|
22
|
+
name?: string | undefined;
|
|
23
|
+
color?: "#6D28D9" | "#7C3AED" | "#A855F7" | "#D946EF" | "#EC4899" | "#F43F5E" | "#EF4444" | "#F97316" | "#D97706" | "#CA8A04" | "#84CC16" | "#22C55E" | "#10B981" | "#14B8A6" | "#06B6D4" | "#0EA5E9" | "#3B82F6" | "#6366F1" | "#64748B" | "#78716C" | undefined;
|
|
24
|
+
}>, {
|
|
25
|
+
name?: string | undefined;
|
|
26
|
+
color?: "#6D28D9" | "#7C3AED" | "#A855F7" | "#D946EF" | "#EC4899" | "#F43F5E" | "#EF4444" | "#F97316" | "#D97706" | "#CA8A04" | "#84CC16" | "#22C55E" | "#10B981" | "#14B8A6" | "#06B6D4" | "#0EA5E9" | "#3B82F6" | "#6366F1" | "#64748B" | "#78716C" | undefined;
|
|
27
|
+
}, {
|
|
28
|
+
name?: string | undefined;
|
|
29
|
+
color?: "#6D28D9" | "#7C3AED" | "#A855F7" | "#D946EF" | "#EC4899" | "#F43F5E" | "#EF4444" | "#F97316" | "#D97706" | "#CA8A04" | "#84CC16" | "#22C55E" | "#10B981" | "#14B8A6" | "#06B6D4" | "#0EA5E9" | "#3B82F6" | "#6366F1" | "#64748B" | "#78716C" | undefined;
|
|
30
|
+
}>;
|
|
31
|
+
export declare const TagNamesSchema: z.ZodArray<z.ZodString, "many">;
|
|
32
|
+
//# sourceMappingURL=tags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tags.d.ts","sourceRoot":"","sources":["../../src/schemas/tags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,iBAAiB,uOAqBpB,CAAC;AAEX,eAAO,MAAM,cAAc,yOAEqB,CAAC;AAEjD,eAAO,MAAM,aAAa,aAKhB,CAAC;AAEX,eAAO,MAAM,eAAe;;;;;;;;;EAG1B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;EAQzB,CAAC;AAEJ,eAAO,MAAM,cAAc,iCAKxB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
// Keep aligned with the webapp's TAG_COLOR_PALETTE in modules/tags/tags.constants.ts.
|
|
3
|
+
export const TAG_COLOR_PALETTE = [
|
|
4
|
+
'#6D28D9',
|
|
5
|
+
'#7C3AED',
|
|
6
|
+
'#A855F7',
|
|
7
|
+
'#D946EF',
|
|
8
|
+
'#EC4899',
|
|
9
|
+
'#F43F5E',
|
|
10
|
+
'#EF4444',
|
|
11
|
+
'#F97316',
|
|
12
|
+
'#D97706',
|
|
13
|
+
'#CA8A04',
|
|
14
|
+
'#84CC16',
|
|
15
|
+
'#22C55E',
|
|
16
|
+
'#10B981',
|
|
17
|
+
'#14B8A6',
|
|
18
|
+
'#06B6D4',
|
|
19
|
+
'#0EA5E9',
|
|
20
|
+
'#3B82F6',
|
|
21
|
+
'#6366F1',
|
|
22
|
+
'#64748B',
|
|
23
|
+
'#78716C',
|
|
24
|
+
];
|
|
25
|
+
export const TagColorSchema = z
|
|
26
|
+
.enum(TAG_COLOR_PALETTE)
|
|
27
|
+
.describe('Tag color from the BugBug palette');
|
|
28
|
+
export const TagNameSchema = z
|
|
29
|
+
.string()
|
|
30
|
+
.regex(/^[^,\x00-\x1F\x7F-\x9F]*$/, 'Tag names cannot contain commas or control characters')
|
|
31
|
+
.trim()
|
|
32
|
+
.min(1)
|
|
33
|
+
.max(64);
|
|
34
|
+
export const TagCreateSchema = z.object({
|
|
35
|
+
name: TagNameSchema,
|
|
36
|
+
color: TagColorSchema.default('#6D28D9'),
|
|
37
|
+
});
|
|
38
|
+
export const TagUpdateSchema = z
|
|
39
|
+
.object({
|
|
40
|
+
name: TagNameSchema.optional(),
|
|
41
|
+
color: TagColorSchema.optional(),
|
|
42
|
+
})
|
|
43
|
+
.refine((data) => data.name !== undefined || data.color !== undefined, 'Provide name, color, or both');
|
|
44
|
+
export const TagNamesSchema = z
|
|
45
|
+
.array(TagNameSchema)
|
|
46
|
+
.max(64)
|
|
47
|
+
.describe('Complete desired list of direct tag names. Replaces existing direct assignments; [] clears them. Use up to 64 names. Missing names are created in the target project with the default color; create tags explicitly first to choose a color.');
|
|
48
|
+
//# sourceMappingURL=tags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tags.js","sourceRoot":"","sources":["../../src/schemas/tags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,sFAAsF;AACtF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;CACD,CAAC;AAEX,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC;KAC5B,IAAI,CAAC,iBAAiB,CAAC;KACvB,QAAQ,CAAC,mCAAmC,CAAC,CAAC;AAEjD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC;KAC3B,MAAM,EAAE;KACR,KAAK,CAAC,2BAA2B,EAAE,uDAAuD,CAAC;KAC3F,IAAI,EAAE;KACN,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,EAAE,CAAC,CAAC;AAEX,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,cAAc,CAAC,OAAO,CAAC,SAAS,CAAC;CACzC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC;KAC7B,MAAM,CAAC;IACN,IAAI,EAAE,aAAa,CAAC,QAAQ,EAAE;IAC9B,KAAK,EAAE,cAAc,CAAC,QAAQ,EAAE;CACjC,CAAC;KACD,MAAM,CACL,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAC7D,8BAA8B,CAC/B,CAAC;AAEJ,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC;KAC5B,KAAK,CAAC,aAAa,CAAC;KACpB,GAAG,CAAC,EAAE,CAAC;KACP,QAAQ,CACP,8OAA8O,CAC/O,CAAC"}
|