@koda-sl/baker-cli 0.19.2 → 0.20.0-dev.3ff15ea5
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/README.md +52 -0
- package/dist/cli.js +5 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/actions/claim.d.ts +13 -0
- package/dist/commands/actions/claim.d.ts.map +1 -0
- package/dist/commands/actions/claim.js +38 -0
- package/dist/commands/actions/claim.js.map +1 -0
- package/dist/commands/actions/complete.d.ts +18 -0
- package/dist/commands/actions/complete.d.ts.map +1 -0
- package/dist/commands/actions/complete.js +40 -0
- package/dist/commands/actions/complete.js.map +1 -0
- package/dist/commands/actions/create.d.ts +29 -0
- package/dist/commands/actions/create.d.ts.map +1 -0
- package/dist/commands/actions/create.js +75 -0
- package/dist/commands/actions/create.js.map +1 -0
- package/dist/commands/actions/discard.d.ts +18 -0
- package/dist/commands/actions/discard.d.ts.map +1 -0
- package/dist/commands/actions/discard.js +44 -0
- package/dist/commands/actions/discard.js.map +1 -0
- package/dist/commands/actions/get.d.ts +13 -0
- package/dist/commands/actions/get.d.ts.map +1 -0
- package/dist/commands/actions/get.js +34 -0
- package/dist/commands/actions/get.js.map +1 -0
- package/dist/commands/actions/index.d.ts +2 -0
- package/dist/commands/actions/index.d.ts.map +1 -0
- package/dist/commands/actions/index.js +43 -0
- package/dist/commands/actions/index.js.map +1 -0
- package/dist/commands/actions/link.d.ts +13 -0
- package/dist/commands/actions/link.d.ts.map +1 -0
- package/dist/commands/actions/link.js +43 -0
- package/dist/commands/actions/link.js.map +1 -0
- package/dist/commands/actions/list.d.ts +19 -0
- package/dist/commands/actions/list.d.ts.map +1 -0
- package/dist/commands/actions/list.js +66 -0
- package/dist/commands/actions/list.js.map +1 -0
- package/dist/commands/actions/release.d.ts +13 -0
- package/dist/commands/actions/release.d.ts.map +1 -0
- package/dist/commands/actions/release.js +38 -0
- package/dist/commands/actions/release.js.map +1 -0
- package/dist/commands/actions/shared.d.ts +5 -0
- package/dist/commands/actions/shared.d.ts.map +1 -0
- package/dist/commands/actions/shared.js +25 -0
- package/dist/commands/actions/shared.js.map +1 -0
- package/dist/commands/actions/tag/add.d.ts +18 -0
- package/dist/commands/actions/tag/add.d.ts.map +1 -0
- package/dist/commands/actions/tag/add.js +47 -0
- package/dist/commands/actions/tag/add.js.map +1 -0
- package/dist/commands/actions/tag/create.d.ts +23 -0
- package/dist/commands/actions/tag/create.d.ts.map +1 -0
- package/dist/commands/actions/tag/create.js +50 -0
- package/dist/commands/actions/tag/create.js.map +1 -0
- package/dist/commands/actions/tag/delete.d.ts +13 -0
- package/dist/commands/actions/tag/delete.d.ts.map +1 -0
- package/dist/commands/actions/tag/delete.js +36 -0
- package/dist/commands/actions/tag/delete.js.map +1 -0
- package/dist/commands/actions/tag/index.d.ts +2 -0
- package/dist/commands/actions/tag/index.d.ts.map +1 -0
- package/dist/commands/actions/tag/index.js +32 -0
- package/dist/commands/actions/tag/index.js.map +1 -0
- package/dist/commands/actions/tag/list.d.ts +2 -0
- package/dist/commands/actions/tag/list.d.ts.map +1 -0
- package/dist/commands/actions/tag/list.js +24 -0
- package/dist/commands/actions/tag/list.js.map +1 -0
- package/dist/commands/actions/tag/remove.d.ts +18 -0
- package/dist/commands/actions/tag/remove.d.ts.map +1 -0
- package/dist/commands/actions/tag/remove.js +48 -0
- package/dist/commands/actions/tag/remove.js.map +1 -0
- package/dist/commands/actions/tag/update.d.ts +28 -0
- package/dist/commands/actions/tag/update.d.ts.map +1 -0
- package/dist/commands/actions/tag/update.js +50 -0
- package/dist/commands/actions/tag/update.js.map +1 -0
- package/dist/commands/actions/unlink.d.ts +13 -0
- package/dist/commands/actions/unlink.d.ts.map +1 -0
- package/dist/commands/actions/unlink.js +45 -0
- package/dist/commands/actions/unlink.js.map +1 -0
- package/dist/commands/actions/update.d.ts +28 -0
- package/dist/commands/actions/update.d.ts.map +1 -0
- package/dist/commands/actions/update.js +61 -0
- package/dist/commands/actions/update.js.map +1 -0
- package/dist/env.d.ts +2 -0
- package/dist/env.d.ts.map +1 -1
- package/dist/env.js +8 -0
- package/dist/env.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { apiPost } from "../../client.js";
|
|
3
|
+
import { getEnv } from "../../env.js";
|
|
4
|
+
import { writeJson } from "../../output.js";
|
|
5
|
+
import { registerSchema } from "../../schemas.js";
|
|
6
|
+
import { failApi } from "./shared.js";
|
|
7
|
+
registerSchema({
|
|
8
|
+
command: "actions.list",
|
|
9
|
+
description: "List actions for the current company. Default: pre-bucketed (claimable/myClaims/blocked/claimedByOthers/completed/discarded). Set --bucketed=false for a flat list filterable by --status / --tag.",
|
|
10
|
+
args: {
|
|
11
|
+
bucketed: {
|
|
12
|
+
type: "boolean",
|
|
13
|
+
description: "Pre-bucket the results based on the current chat (default: true)",
|
|
14
|
+
required: false,
|
|
15
|
+
default: true,
|
|
16
|
+
},
|
|
17
|
+
status: {
|
|
18
|
+
type: "string",
|
|
19
|
+
description: "Filter by status (only with --bucketed=false): pending|in_progress|completed|discarded",
|
|
20
|
+
required: false,
|
|
21
|
+
},
|
|
22
|
+
tag: {
|
|
23
|
+
type: "string",
|
|
24
|
+
description: "Repeatable; filter by tag slug (only with --bucketed=false)",
|
|
25
|
+
required: false,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
export const listCommand = defineCommand({
|
|
30
|
+
meta: {
|
|
31
|
+
name: "list",
|
|
32
|
+
description: "List actions. Default: bucketed view (claimable, myClaims, blocked, claimedByOthers). Use --bucketed=false for raw filter by --status / --tag.",
|
|
33
|
+
},
|
|
34
|
+
args: {
|
|
35
|
+
bucketed: { type: "boolean", description: "Pre-bucket by chat", required: false, default: true },
|
|
36
|
+
status: { type: "string", description: "Status filter (raw mode)", required: false },
|
|
37
|
+
tag: { type: "string", description: "Tag slug filter (raw mode, comma-separated)", required: false },
|
|
38
|
+
},
|
|
39
|
+
run: async ({ args }) => {
|
|
40
|
+
try {
|
|
41
|
+
const env = getEnv();
|
|
42
|
+
const bucketed = args.bucketed !== false;
|
|
43
|
+
const body = { bucketed };
|
|
44
|
+
if (bucketed && env.BAKER_CHAT_ID) {
|
|
45
|
+
body.chatId = env.BAKER_CHAT_ID;
|
|
46
|
+
}
|
|
47
|
+
if (!bucketed) {
|
|
48
|
+
if (args.status) {
|
|
49
|
+
body.status = args.status;
|
|
50
|
+
}
|
|
51
|
+
if (args.tag) {
|
|
52
|
+
body.tagSlugs = args.tag
|
|
53
|
+
.split(",")
|
|
54
|
+
.map((s) => s.trim())
|
|
55
|
+
.filter(Boolean);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const response = await apiPost("/api/actions/list", body);
|
|
59
|
+
writeJson(response);
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
failApi(err);
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/actions/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,cAAc,CAAC;IACb,OAAO,EAAE,cAAc;IACvB,WAAW,EACT,oMAAoM;IACtM,IAAI,EAAE;QACJ,QAAQ,EAAE;YACR,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,kEAAkE;YAC/E,QAAQ,EAAE,KAAK;YACf,O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,CAAC,GAAG,EAAE,CAAC;oBACb,IAAI,CAAC,QAAQ,GAAI,IAAI,CAAC,GAAc;yBACjC,KAAK,CAAC,GAAG,CAAC;yBACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;yBACpB,MAAM,CAAC,OAAO,CAAC,CAAC;gBACrB,CAAC;YACH,CAAC;YACD,MAAM,QAAQ,GAAG,MAAM,OAAO,CAA8B,mBAAmB,EAAE,IAAI,CAAC,CAAC;YACvF,SAAS,CAAC,QAAQ,CAAC,CAAC;QACtB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,GAAG,CAAC,CAAC;QACf,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const releaseCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly id: {
|
|
3
|
+
readonly type: "positional";
|
|
4
|
+
readonly description: "Action ID";
|
|
5
|
+
readonly required: false;
|
|
6
|
+
};
|
|
7
|
+
readonly "action-id": {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly description: "Action ID";
|
|
10
|
+
readonly required: false;
|
|
11
|
+
};
|
|
12
|
+
}>;
|
|
13
|
+
//# sourceMappingURL=release.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../../src/commands/actions/release.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,cAAc;;;;;;;;;;;EAuBzB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { apiPost, validateConvexId } from "../../client.js";
|
|
3
|
+
import { requireChatId } from "../../env.js";
|
|
4
|
+
import { registerSchema } from "../../schemas.js";
|
|
5
|
+
import { failApi, failValidation, writeOk } from "./shared.js";
|
|
6
|
+
registerSchema({
|
|
7
|
+
command: "actions.release",
|
|
8
|
+
description: "Release an action you previously claimed (no-op if you don't own the claim).",
|
|
9
|
+
args: {
|
|
10
|
+
id: { type: "string", description: "Action ID", required: true },
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
export const releaseCommand = defineCommand({
|
|
14
|
+
meta: {
|
|
15
|
+
name: "release",
|
|
16
|
+
description: "Release a claim you made on an action. Example: baker actions release <action-id>",
|
|
17
|
+
},
|
|
18
|
+
args: {
|
|
19
|
+
id: { type: "positional", description: "Action ID", required: false },
|
|
20
|
+
"action-id": { type: "string", description: "Action ID", required: false },
|
|
21
|
+
},
|
|
22
|
+
run: async ({ args }) => {
|
|
23
|
+
try {
|
|
24
|
+
const id = args.id || args["action-id"];
|
|
25
|
+
if (!id) {
|
|
26
|
+
failValidation("Action ID is required.");
|
|
27
|
+
}
|
|
28
|
+
validateConvexId(id);
|
|
29
|
+
const chatId = requireChatId();
|
|
30
|
+
await apiPost("/api/actions/release", { actionId: id, chatId });
|
|
31
|
+
writeOk();
|
|
32
|
+
}
|
|
33
|
+
catch (err) {
|
|
34
|
+
failApi(err);
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=release.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release.js","sourceRoot":"","sources":["../../../src/commands/actions/release.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE/D,cAAc,CAAC;IACb,OAAO,EAAE,iBAAiB;IAC1B,WAAW,EAAE,8EAA8E;IAC3F,IAAI,EAAE;QACJ,EAAE,EA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,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAGrD;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG,KAAK,CAW3C;AAED,wBAAgB,cAAc,IAAI,MAAM,CAEvC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ApiError } from "../../client.js";
|
|
2
|
+
import { writeJson } from "../../output.js";
|
|
3
|
+
export function writeOk(data) {
|
|
4
|
+
writeJson({ ok: true, data: (data ?? null) });
|
|
5
|
+
}
|
|
6
|
+
export function failValidation(message) {
|
|
7
|
+
writeJson({ ok: false, error: { code: "VALIDATION_ERROR", message } });
|
|
8
|
+
process.exit(1);
|
|
9
|
+
}
|
|
10
|
+
export function failApi(err) {
|
|
11
|
+
if (err instanceof ApiError) {
|
|
12
|
+
writeJson({ ok: false, error: { code: err.code, message: err.message } });
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
if (err instanceof Error) {
|
|
16
|
+
writeJson({ ok: false, error: { code: "INTERNAL_ERROR", message: err.message } });
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
writeJson({ ok: false, error: { code: "INTERNAL_ERROR", message: "Unexpected error" } });
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
export function generateTempId() {
|
|
23
|
+
return `temp_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/commands/actions/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,UAAU,OAAO,CAAW,IAAQ;IACxC,SAAS,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,IAAI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AC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const addCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly "action-ref": {
|
|
3
|
+
readonly type: "positional";
|
|
4
|
+
readonly description: "Action ID or tempId";
|
|
5
|
+
readonly required: false;
|
|
6
|
+
};
|
|
7
|
+
readonly "action-id": {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly description: "Action ID (alternative)";
|
|
10
|
+
readonly required: false;
|
|
11
|
+
};
|
|
12
|
+
readonly slug: {
|
|
13
|
+
readonly type: "string";
|
|
14
|
+
readonly description: "Tag slug";
|
|
15
|
+
readonly required: false;
|
|
16
|
+
};
|
|
17
|
+
}>;
|
|
18
|
+
//# sourceMappingURL=add.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../../src/commands/actions/tag/add.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;EA+BrB,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { apiPost } from "../../../client.js";
|
|
3
|
+
import { requireChatId } from "../../../env.js";
|
|
4
|
+
import { registerSchema } from "../../../schemas.js";
|
|
5
|
+
import { failApi, failValidation, writeOk } from "../shared.js";
|
|
6
|
+
registerSchema({
|
|
7
|
+
command: "actions.tag.add",
|
|
8
|
+
description: "Stage adding a tag to an action. Action ref can be an action ID or a tempId from a create op in the same draft.",
|
|
9
|
+
args: {
|
|
10
|
+
"action-ref": { type: "string", description: "Action ID or tempId", required: true },
|
|
11
|
+
slug: { type: "string", description: "Tag slug", required: true },
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
export const addCommand = defineCommand({
|
|
15
|
+
meta: {
|
|
16
|
+
name: "add",
|
|
17
|
+
description: "Stage adding a tag to an action. Example: baker actions tag add <action-id-or-tempId> --slug copy",
|
|
18
|
+
},
|
|
19
|
+
args: {
|
|
20
|
+
"action-ref": { type: "positional", description: "Action ID or tempId", required: false },
|
|
21
|
+
"action-id": { type: "string", description: "Action ID (alternative)", required: false },
|
|
22
|
+
slug: { type: "string", description: "Tag slug", required: false },
|
|
23
|
+
},
|
|
24
|
+
run: async ({ args }) => {
|
|
25
|
+
try {
|
|
26
|
+
const ref = args["action-ref"] || args["action-id"];
|
|
27
|
+
const slug = args.slug;
|
|
28
|
+
if (!ref) {
|
|
29
|
+
failValidation("Action ref (ID or tempId) is required.");
|
|
30
|
+
}
|
|
31
|
+
if (!slug) {
|
|
32
|
+
failValidation("--slug is required.");
|
|
33
|
+
}
|
|
34
|
+
const chatId = requireChatId();
|
|
35
|
+
await apiPost("/api/actions/tag/add", {
|
|
36
|
+
chatId,
|
|
37
|
+
actionRef: ref,
|
|
38
|
+
tagSlug: slug,
|
|
39
|
+
});
|
|
40
|
+
writeOk();
|
|
41
|
+
}
|
|
42
|
+
catch (err) {
|
|
43
|
+
failApi(err);
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=add.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.js","sourceRoot":"","sources":["../../../../src/commands/actions/tag/add.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEhE,cAAc,CAAC;IACb,OAAO,EAAE,iBAAiB;IAC1B,WAAW,EACT,iHAAiH;IACnH,IAAI,EAAE;QACJ,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qBAAqB,EAAE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AAC;QACf,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const createCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly slug: {
|
|
3
|
+
readonly type: "string";
|
|
4
|
+
readonly description: "Slug";
|
|
5
|
+
readonly required: false;
|
|
6
|
+
};
|
|
7
|
+
readonly label: {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly description: "Label";
|
|
10
|
+
readonly required: false;
|
|
11
|
+
};
|
|
12
|
+
readonly color: {
|
|
13
|
+
readonly type: "string";
|
|
14
|
+
readonly description: "Hex color";
|
|
15
|
+
readonly required: false;
|
|
16
|
+
};
|
|
17
|
+
readonly description: {
|
|
18
|
+
readonly type: "string";
|
|
19
|
+
readonly description: "Description";
|
|
20
|
+
readonly required: false;
|
|
21
|
+
};
|
|
22
|
+
}>;
|
|
23
|
+
//# sourceMappingURL=create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../../src/commands/actions/tag/create.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;EAiCxB,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { apiPost } from "../../../client.js";
|
|
3
|
+
import { writeJson } from "../../../output.js";
|
|
4
|
+
import { registerSchema } from "../../../schemas.js";
|
|
5
|
+
import { failApi, failValidation } from "../shared.js";
|
|
6
|
+
registerSchema({
|
|
7
|
+
command: "actions.tag.create",
|
|
8
|
+
description: "Create a new company-wide action tag. Applies immediately.",
|
|
9
|
+
args: {
|
|
10
|
+
slug: { type: "string", description: "Lowercase alphanumeric slug (hyphens allowed)", required: true },
|
|
11
|
+
label: { type: "string", description: "Display label", required: true },
|
|
12
|
+
color: { type: "string", description: "Hex color (e.g. #f59e0b)", required: false },
|
|
13
|
+
description: { type: "string", description: "Optional description", required: false },
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
export const createCommand = defineCommand({
|
|
17
|
+
meta: {
|
|
18
|
+
name: "create",
|
|
19
|
+
description: 'Create a new action tag. Example: baker actions tag create --slug copy --label Copy --color "#f59e0b"',
|
|
20
|
+
},
|
|
21
|
+
args: {
|
|
22
|
+
slug: { type: "string", description: "Slug", required: false },
|
|
23
|
+
label: { type: "string", description: "Label", required: false },
|
|
24
|
+
color: { type: "string", description: "Hex color", required: false },
|
|
25
|
+
description: { type: "string", description: "Description", required: false },
|
|
26
|
+
},
|
|
27
|
+
run: async ({ args }) => {
|
|
28
|
+
try {
|
|
29
|
+
const slug = args.slug;
|
|
30
|
+
const label = args.label;
|
|
31
|
+
if (!slug) {
|
|
32
|
+
failValidation("--slug is required.");
|
|
33
|
+
}
|
|
34
|
+
if (!label) {
|
|
35
|
+
failValidation("--label is required.");
|
|
36
|
+
}
|
|
37
|
+
const response = await apiPost("/api/actions/tag/create", {
|
|
38
|
+
slug,
|
|
39
|
+
label,
|
|
40
|
+
color: args.color,
|
|
41
|
+
description: args.description,
|
|
42
|
+
});
|
|
43
|
+
writeJson(response);
|
|
44
|
+
}
|
|
45
|
+
catch (err) {
|
|
46
|
+
failApi(err);
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../src/commands/actions/tag/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEvD,cAA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AI,CAAC,IAAI,EAAE,CAAC;gBACV,cAAc,CAAC,qBAAqB,CAAC,CAAC;YACxC,CAAC;YACD,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,cAAc,CAAC,sBAAsB,CAAC,CAAC;YACzC,CAAC;YACD,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAwC,yBAAyB,EAAE;gBAC/F,IAAI;gBACJ,KAAK;gBACL,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,WAAW,EAAE,IAAI,CAAC,WAAW;aAC9B,CAAC,CAAC;YACH,SAAS,CAAC,QAAQ,CAAC,CAAC;QACtB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,GAAG,CAAC,CAAC;QACf,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const deleteCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly id: {
|
|
3
|
+
readonly type: "positional";
|
|
4
|
+
readonly description: "Tag ID";
|
|
5
|
+
readonly required: false;
|
|
6
|
+
};
|
|
7
|
+
readonly "tag-id": {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly description: "Tag ID";
|
|
10
|
+
readonly required: false;
|
|
11
|
+
};
|
|
12
|
+
}>;
|
|
13
|
+
//# sourceMappingURL=delete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../../src/commands/actions/tag/delete.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,aAAa;;;;;;;;;;;EAsBxB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { apiPost, validateConvexId } from "../../../client.js";
|
|
3
|
+
import { registerSchema } from "../../../schemas.js";
|
|
4
|
+
import { failApi, failValidation, writeOk } from "../shared.js";
|
|
5
|
+
registerSchema({
|
|
6
|
+
command: "actions.tag.delete",
|
|
7
|
+
description: "Delete a tag and all its associations. Applies immediately.",
|
|
8
|
+
args: {
|
|
9
|
+
id: { type: "string", description: "Tag ID", required: true },
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
export const deleteCommand = defineCommand({
|
|
13
|
+
meta: {
|
|
14
|
+
name: "delete",
|
|
15
|
+
description: "Delete a tag. Example: baker actions tag delete <tag-id>",
|
|
16
|
+
},
|
|
17
|
+
args: {
|
|
18
|
+
id: { type: "positional", description: "Tag ID", required: false },
|
|
19
|
+
"tag-id": { type: "string", description: "Tag ID", required: false },
|
|
20
|
+
},
|
|
21
|
+
run: async ({ args }) => {
|
|
22
|
+
try {
|
|
23
|
+
const id = args.id || args["tag-id"];
|
|
24
|
+
if (!id) {
|
|
25
|
+
failValidation("Tag ID is required.");
|
|
26
|
+
}
|
|
27
|
+
validateConvexId(id);
|
|
28
|
+
await apiPost("/api/actions/tag/delete", { tagId: id });
|
|
29
|
+
writeOk();
|
|
30
|
+
}
|
|
31
|
+
catch (err) {
|
|
32
|
+
failApi(err);
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=delete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../../src/commands/actions/tag/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEhE,cAAc,CAAC;IACb,OAAO,EAAE,oBAAoB;IAC7B,WAAW,EAAE,6DAA6D;IAC1E,IAAI,EAAE;QACJ,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;KAC9D;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAC;IACzC,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,0DAA0D;KACxE;IACD,IAAI,EAAE;QACJ,EAAE,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE;QAClE,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE;KACrE;IACD,GAAG,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACtB,IAAI,CAAC;YACH,MAAM,EAAE,GAAI,IAAI,CAAC,EAAyB,IAAK,IAAI,CAAC,QAAQ,CAAwB,CAAC;YACrF,IAAI,CAAC,EAAE,EAAE,CAAC;gBACR,cAAc,CAAC,qBAAqB,CAAC,CAAC;YACxC,CAAC;YACD,gBAAgB,CAAC,EAAE,CAAC,CAAC;YACrB,MAAM,OAAO,CAAe,yBAAyB,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;YACtE,OAAO,EAAE,CAAC;QACZ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,GAAG,CAAC,CAAC;QACf,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/actions/tag/index.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,UAAU,qDAuBrB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { addCommand } from "./add.js";
|
|
3
|
+
import { createCommand } from "./create.js";
|
|
4
|
+
import { deleteCommand } from "./delete.js";
|
|
5
|
+
import { listCommand } from "./list.js";
|
|
6
|
+
import { removeCommand } from "./remove.js";
|
|
7
|
+
import { updateCommand } from "./update.js";
|
|
8
|
+
export const tagCommand = defineCommand({
|
|
9
|
+
meta: {
|
|
10
|
+
name: "tag",
|
|
11
|
+
description: `Manage action tags. Subcommands: add, remove, list, create, update, delete.
|
|
12
|
+
|
|
13
|
+
Tags are company-wide. Add/remove operate on a specific action and stage on the draft (apply on publish). Create/update/delete operate on the tag definitions and apply immediately.
|
|
14
|
+
|
|
15
|
+
Examples:
|
|
16
|
+
baker actions tag list
|
|
17
|
+
baker actions tag create --slug copy --label Copy
|
|
18
|
+
baker actions tag add <action-id> --slug copy
|
|
19
|
+
baker actions tag remove <action-id> --slug copy
|
|
20
|
+
baker actions tag update <tag-id> --label "Copywriting"
|
|
21
|
+
baker actions tag delete <tag-id>`,
|
|
22
|
+
},
|
|
23
|
+
subCommands: {
|
|
24
|
+
list: listCommand,
|
|
25
|
+
add: addCommand,
|
|
26
|
+
remove: removeCommand,
|
|
27
|
+
create: createCommand,
|
|
28
|
+
update: updateCommand,
|
|
29
|
+
delete: deleteCommand,
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/actions/tag/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,CAAC,MAAM,UAAU,GAAG,aAAa,CAAC;IACtC,IAAI,EAAE;QACJ,IAAI,EAAE,KAAK;QACX,WAAW,EAAE;;;;;;;;;;oCAUmB;KACjC;IACD,WAAW,EAAE;QACX,IAAI,EAAE,WAAW;QACjB,GAAG,EAAE,UAAU;QACf,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,aAAa;KACtB;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../src/commands/actions/tag/list.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,WAAW,gCAWtB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { apiPost } from "../../../client.js";
|
|
3
|
+
import { writeJson } from "../../../output.js";
|
|
4
|
+
import { registerSchema } from "../../../schemas.js";
|
|
5
|
+
import { failApi } from "../shared.js";
|
|
6
|
+
registerSchema({
|
|
7
|
+
command: "actions.tag.list",
|
|
8
|
+
description: "List all action tags for the current company.",
|
|
9
|
+
args: {},
|
|
10
|
+
});
|
|
11
|
+
export const listCommand = defineCommand({
|
|
12
|
+
meta: { name: "list", description: "List all action tags. Example: baker actions tag list" },
|
|
13
|
+
args: {},
|
|
14
|
+
run: async () => {
|
|
15
|
+
try {
|
|
16
|
+
const response = await apiPost("/api/actions/tag/list", {});
|
|
17
|
+
writeJson(response);
|
|
18
|
+
}
|
|
19
|
+
catch (err) {
|
|
20
|
+
failApi(err);
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../src/commands/actions/tag/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,cAAc,CAAC;IACb,OAAO,EAAE,kBAAkB;IAC3B,WAAW,EAAE,+CAA+C;IAC5D,IAAI,EAAE,EAAE;CACT,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC;IACvC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,uDAAuD,EAAE;IAC5F,IAAI,EAAE,EAAE;IACR,GAAG,EAAE,KAAK,IAAI,EAAE;QACd,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,OAAO,CAA8B,uBAAuB,EAAE,EAAE,CAAC,CAAC;YACzF,SAAS,CAAC,QAAQ,CAAC,CAAC;QACtB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,GAAG,CAAC,CAAC;QACf,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const removeCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly id: {
|
|
3
|
+
readonly type: "positional";
|
|
4
|
+
readonly description: "Action ID";
|
|
5
|
+
readonly required: false;
|
|
6
|
+
};
|
|
7
|
+
readonly "action-id": {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly description: "Action ID";
|
|
10
|
+
readonly required: false;
|
|
11
|
+
};
|
|
12
|
+
readonly slug: {
|
|
13
|
+
readonly type: "string";
|
|
14
|
+
readonly description: "Tag slug";
|
|
15
|
+
readonly required: false;
|
|
16
|
+
};
|
|
17
|
+
}>;
|
|
18
|
+
//# sourceMappingURL=remove.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../../src/commands/actions/tag/remove.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;EAiCxB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { apiPost, validateConvexId } from "../../../client.js";
|
|
3
|
+
import { requireChatId } from "../../../env.js";
|
|
4
|
+
import { registerSchema } from "../../../schemas.js";
|
|
5
|
+
import { failApi, failValidation, writeOk } from "../shared.js";
|
|
6
|
+
registerSchema({
|
|
7
|
+
command: "actions.tag.remove",
|
|
8
|
+
description: "Stage removing a tag from a claimed action.",
|
|
9
|
+
args: {
|
|
10
|
+
id: { type: "string", description: "Action ID (must be claimed by current chat)", required: true },
|
|
11
|
+
slug: { type: "string", description: "Tag slug", required: true },
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
export const removeCommand = defineCommand({
|
|
15
|
+
meta: {
|
|
16
|
+
name: "remove",
|
|
17
|
+
description: "Stage removing a tag from a claimed action. Example: baker actions tag remove <action-id> --slug copy",
|
|
18
|
+
},
|
|
19
|
+
args: {
|
|
20
|
+
id: { type: "positional", description: "Action ID", required: false },
|
|
21
|
+
"action-id": { type: "string", description: "Action ID", required: false },
|
|
22
|
+
slug: { type: "string", description: "Tag slug", required: false },
|
|
23
|
+
},
|
|
24
|
+
run: async ({ args }) => {
|
|
25
|
+
try {
|
|
26
|
+
const id = args.id || args["action-id"];
|
|
27
|
+
const slug = args.slug;
|
|
28
|
+
if (!id) {
|
|
29
|
+
failValidation("Action ID is required.");
|
|
30
|
+
}
|
|
31
|
+
if (!slug) {
|
|
32
|
+
failValidation("--slug is required.");
|
|
33
|
+
}
|
|
34
|
+
validateConvexId(id);
|
|
35
|
+
const chatId = requireChatId();
|
|
36
|
+
await apiPost("/api/actions/tag/remove", {
|
|
37
|
+
chatId,
|
|
38
|
+
actionId: id,
|
|
39
|
+
tagSlug: slug,
|
|
40
|
+
});
|
|
41
|
+
writeOk();
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
failApi(err);
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=remove.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove.js","sourceRoot":"","sources":["../../../../src/commands/actions/tag/remove.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEhE,cAAc,CAAC;IACb,OAAO,EAAE,oBAAoB;IAC7B,WAAW,EAAE,6CAA6C;IAC1D,IAAI,EAAE;QACJ,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6CAA6C,EAAE,QAAQ,EAAE,IAAI,EAAE;QAClG,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE;KAClE;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAC;IACzC,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,WAAW,EACT,uGAAuG;KAC1G;IACD,IAAI,EAAE;QACJ,EAAE,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE;QACrE,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE;QAC1E,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE;KACnE;IACD,GAAG,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACtB,IAAI,CAAC;YACH,MAAM,EAAE,GAAI,IAAI,CAAC,EAAyB,IAAK,IAAI,CAAC,WAAW,CAAwB,CAAC;YACxF,MAAM,IAAI,GAAG,IAAI,CAAC,IAA0B,CAAC;YAC7C,IAAI,CAAC,EAAE,EAAE,CAAC;gBACR,cAAc,CAAC,wBAAwB,CAAC,CAAC;YAC3C,CAAC;YACD,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,cAAc,CAAC,qBAAqB,CAAC,CAAC;YACxC,CAAC;YACD,gBAAgB,CAAC,EAAE,CAAC,CAAC;YACrB,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;YAC/B,MAAM,OAAO,CAAe,yBAAyB,EAAE;gBACrD,MAAM;gBACN,QAAQ,EAAE,EAAE;gBACZ,OAAO,EAAE,IAAI;aACd,CAAC,CAAC;YACH,OAAO,EAAE,CAAC;QACZ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,GAAG,CAAC,CAAC;QACf,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare const updateCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly id: {
|
|
3
|
+
readonly type: "positional";
|
|
4
|
+
readonly description: "Tag ID";
|
|
5
|
+
readonly required: false;
|
|
6
|
+
};
|
|
7
|
+
readonly "tag-id": {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly description: "Tag ID";
|
|
10
|
+
readonly required: false;
|
|
11
|
+
};
|
|
12
|
+
readonly label: {
|
|
13
|
+
readonly type: "string";
|
|
14
|
+
readonly description: "New label";
|
|
15
|
+
readonly required: false;
|
|
16
|
+
};
|
|
17
|
+
readonly color: {
|
|
18
|
+
readonly type: "string";
|
|
19
|
+
readonly description: "New hex color";
|
|
20
|
+
readonly required: false;
|
|
21
|
+
};
|
|
22
|
+
readonly description: {
|
|
23
|
+
readonly type: "string";
|
|
24
|
+
readonly description: "New description";
|
|
25
|
+
readonly required: false;
|
|
26
|
+
};
|
|
27
|
+
}>;
|
|
28
|
+
//# sourceMappingURL=update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../../src/commands/actions/tag/update.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;EAiCxB,CAAC"}
|