centy 0.7.3 → 0.7.4

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.
@@ -0,0 +1,17 @@
1
+ import { Command } from '@oclif/core';
2
+ /**
3
+ * Restore a soft-deleted item by type and identifier
4
+ */
5
+ export default class Restore extends Command {
6
+ static args: {
7
+ type: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
8
+ id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
9
+ };
10
+ static description: string;
11
+ static examples: string[];
12
+ static flags: {
13
+ project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
+ };
15
+ run(): Promise<void>;
16
+ }
17
+ //# sourceMappingURL=restore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restore.d.ts","sourceRoot":"","sources":["../../src/commands/restore.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,OAAO,EAAE,MAAM,aAAa,CAAA;AAY3C;;GAEG;AAEH,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,OAAO;IAE1C,OAAgB,IAAI;;;MASnB;IAGD,OAAgB,WAAW,SAAgC;IAG3D,OAAgB,QAAQ,WAIvB;IAGD,OAAgB,KAAK;;MAEpB;IAEY,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAqClC"}
@@ -0,0 +1,67 @@
1
+ // eslint-disable-next-line import/order
2
+ import { Args, Command } from '@oclif/core';
3
+ import { daemonRestoreItem } from '../daemon/daemon-restore-item.js';
4
+ import { projectFlag } from '../flags/project-flag.js';
5
+ import { resolveItemId } from '../lib/resolve-item-id/resolve-item-id.js';
6
+ import { ensureInitialized, NotInitializedError, } from '../utils/ensure-initialized.js';
7
+ import { resolveProjectPath } from '../utils/resolve-project-path.js';
8
+ import { toPlural } from '../utils/to-plural.js';
9
+ /**
10
+ * Restore a soft-deleted item by type and identifier
11
+ */
12
+ // eslint-disable-next-line custom/no-default-class-export, class-export/class-export
13
+ export default class Restore extends Command {
14
+ // eslint-disable-next-line no-restricted-syntax
15
+ static args = {
16
+ type: Args.string({
17
+ description: 'Item type (e.g., issue, epic, or custom type)',
18
+ required: true,
19
+ }),
20
+ id: Args.string({
21
+ description: 'Item ID (UUID, display number, or slug)',
22
+ required: true,
23
+ }),
24
+ };
25
+ // eslint-disable-next-line no-restricted-syntax
26
+ static description = 'Restore a soft-deleted item';
27
+ // eslint-disable-next-line no-restricted-syntax
28
+ static examples = [
29
+ '<%= config.bin %> restore issue 1',
30
+ '<%= config.bin %> restore epic abc123-uuid',
31
+ '<%= config.bin %> restore bug 1 --project centy-daemon',
32
+ ];
33
+ // eslint-disable-next-line no-restricted-syntax
34
+ static flags = {
35
+ project: projectFlag,
36
+ };
37
+ async run() {
38
+ const { args, flags } = await this.parse(Restore);
39
+ const itemType = toPlural(args.type);
40
+ const cwd = await resolveProjectPath(flags.project);
41
+ try {
42
+ await ensureInitialized(cwd);
43
+ }
44
+ catch (error) {
45
+ if (error instanceof NotInitializedError) {
46
+ this.error(error.message);
47
+ }
48
+ throw error instanceof Error ? error : new Error(String(error));
49
+ }
50
+ const itemId = await resolveItemId(args.id, itemType, cwd, msg => this.error(msg));
51
+ const response = await daemonRestoreItem({
52
+ projectPath: cwd,
53
+ itemType,
54
+ itemId,
55
+ });
56
+ if (!response.success) {
57
+ this.error(response.error);
58
+ }
59
+ const item = response.item;
60
+ const meta = item.metadata;
61
+ const displayNum = meta !== undefined && meta.displayNumber > 0
62
+ ? `#${meta.displayNumber}`
63
+ : item.id;
64
+ this.log(`Restored ${args.type} ${displayNum}`);
65
+ }
66
+ }
67
+ //# sourceMappingURL=restore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restore.js","sourceRoot":"","sources":["../../src/commands/restore.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAE3C,OAAO,EAAE,iBAAiB,EAA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K,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,mBAAmB,EAAE,CAAC;gBACzC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;YAC3B,CAAC;YACD,MAAM,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;QACjE,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAC/D,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAChB,CAAA;QAED,MAAM,QAAQ,GAAG,MAAM,iBAAiB,CAAC;YACvC,WAAW,EAAE,GAAG;YAChB,QAAQ;YACR,MAAM;SACP,CAAC,CAAA;QAEF,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;YACtB,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;QAC5B,CAAC;QAED,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAK,CAAA;QAC3B,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAA;QAC1B,MAAM,UAAU,GACd,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,aAAa,GAAG,CAAC;YAC1C,CAAC,CAAC,IAAI,IAAI,CAAC,aAAa,EAAE;YAC1B,CAAC,CAAC,IAAI,CAAC,EAAE,CAAA;QAEb,IAAI,CAAC,GAAG,CAAC,YAAY,IAAI,CAAC,IAAI,IAAI,UAAU,EAAE,CAAC,CAAA;IACjD,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { RestoreItemRequest, RestoreItemResponse } from './types.js';
2
+ /**
3
+ * Restore a soft-deleted item of any type via daemon using the generic RestoreItem RPC
4
+ */
5
+ export declare function daemonRestoreItem(request: RestoreItemRequest): Promise<RestoreItemResponse>;
6
+ //# sourceMappingURL=daemon-restore-item.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"daemon-restore-item.d.ts","sourceRoot":"","sources":["../../src/daemon/daemon-restore-item.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAEzE;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,mBAAmB,CAAC,CAG9B"}
@@ -0,0 +1,9 @@
1
+ import { callWithDeadline, getDaemonClient } from './load-proto.js';
2
+ /**
3
+ * Restore a soft-deleted item of any type via daemon using the generic RestoreItem RPC
4
+ */
5
+ export function daemonRestoreItem(request) {
6
+ const client = getDaemonClient();
7
+ return callWithDeadline(client.restoreItem.bind(client), request);
8
+ }
9
+ //# sourceMappingURL=daemon-restore-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"daemon-restore-item.js","sourceRoot":"","sources":["../../src/daemon/daemon-restore-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAGnE;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAC/B,OAA2B;IAE3B,MAAM,MAAM,GAAG,eAAe,EAAE,CAAA;IAChC,OAAO,gBAAgB,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAA;AACnE,CAAC"}
@@ -841,6 +841,50 @@
841
841
  "restart.js"
842
842
  ]
843
843
  },
844
+ "restore": {
845
+ "aliases": [],
846
+ "args": {
847
+ "type": {
848
+ "description": "Item type (e.g., issue, epic, or custom type)",
849
+ "name": "type",
850
+ "required": true
851
+ },
852
+ "id": {
853
+ "description": "Item ID (UUID, display number, or slug)",
854
+ "name": "id",
855
+ "required": true
856
+ }
857
+ },
858
+ "description": "Restore a soft-deleted item",
859
+ "examples": [
860
+ "<%= config.bin %> restore issue 1",
861
+ "<%= config.bin %> restore epic abc123-uuid",
862
+ "<%= config.bin %> restore bug 1 --project centy-daemon"
863
+ ],
864
+ "flags": {
865
+ "project": {
866
+ "description": "Project name or path (defaults to current directory)",
867
+ "name": "project",
868
+ "hasDynamicHelp": false,
869
+ "multiple": false,
870
+ "type": "option"
871
+ }
872
+ },
873
+ "hasDynamicHelp": false,
874
+ "hiddenAliases": [],
875
+ "id": "restore",
876
+ "pluginAlias": "centy",
877
+ "pluginName": "centy",
878
+ "pluginType": "core",
879
+ "strict": true,
880
+ "enableJsonFlag": false,
881
+ "isESM": true,
882
+ "relativePath": [
883
+ "dist",
884
+ "commands",
885
+ "restore.js"
886
+ ]
887
+ },
844
888
  "show": {
845
889
  "aliases": [],
846
890
  "args": {
@@ -2268,46 +2312,6 @@
2268
2312
  "users.js"
2269
2313
  ]
2270
2314
  },
2271
- "untrack:project": {
2272
- "aliases": [],
2273
- "args": {
2274
- "path": {
2275
- "description": "Path to the project (defaults to current directory)",
2276
- "name": "path",
2277
- "required": false
2278
- }
2279
- },
2280
- "description": "Remove a project from tracking",
2281
- "examples": [
2282
- "<%= config.bin %> untrack project",
2283
- "<%= config.bin %> untrack project /path/to/project",
2284
- "<%= config.bin %> untrack project --force"
2285
- ],
2286
- "flags": {
2287
- "force": {
2288
- "char": "f",
2289
- "description": "Skip confirmation prompt",
2290
- "name": "force",
2291
- "allowNo": false,
2292
- "type": "boolean"
2293
- }
2294
- },
2295
- "hasDynamicHelp": false,
2296
- "hiddenAliases": [],
2297
- "id": "untrack:project",
2298
- "pluginAlias": "centy",
2299
- "pluginName": "centy",
2300
- "pluginType": "core",
2301
- "strict": true,
2302
- "enableJsonFlag": false,
2303
- "isESM": true,
2304
- "relativePath": [
2305
- "dist",
2306
- "commands",
2307
- "untrack",
2308
- "project.js"
2309
- ]
2310
- },
2311
2315
  "update:org": {
2312
2316
  "aliases": [
2313
2317
  "update:organization",
@@ -2448,6 +2452,46 @@
2448
2452
  "user.js"
2449
2453
  ]
2450
2454
  },
2455
+ "untrack:project": {
2456
+ "aliases": [],
2457
+ "args": {
2458
+ "path": {
2459
+ "description": "Path to the project (defaults to current directory)",
2460
+ "name": "path",
2461
+ "required": false
2462
+ }
2463
+ },
2464
+ "description": "Remove a project from tracking",
2465
+ "examples": [
2466
+ "<%= config.bin %> untrack project",
2467
+ "<%= config.bin %> untrack project /path/to/project",
2468
+ "<%= config.bin %> untrack project --force"
2469
+ ],
2470
+ "flags": {
2471
+ "force": {
2472
+ "char": "f",
2473
+ "description": "Skip confirmation prompt",
2474
+ "name": "force",
2475
+ "allowNo": false,
2476
+ "type": "boolean"
2477
+ }
2478
+ },
2479
+ "hasDynamicHelp": false,
2480
+ "hiddenAliases": [],
2481
+ "id": "untrack:project",
2482
+ "pluginAlias": "centy",
2483
+ "pluginName": "centy",
2484
+ "pluginType": "core",
2485
+ "strict": true,
2486
+ "enableJsonFlag": false,
2487
+ "isESM": true,
2488
+ "relativePath": [
2489
+ "dist",
2490
+ "commands",
2491
+ "untrack",
2492
+ "project.js"
2493
+ ]
2494
+ },
2451
2495
  "user:create": {
2452
2496
  "aliases": [],
2453
2497
  "args": {},
@@ -2685,5 +2729,5 @@
2685
2729
  ]
2686
2730
  }
2687
2731
  },
2688
- "version": "0.7.3"
2732
+ "version": "0.7.4"
2689
2733
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "centy",
3
- "version": "0.7.3",
3
+ "version": "0.7.4",
4
4
  "description": "CLI for managing project issues and docs via code in the .centy folder",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",