centy 0.5.1 → 0.7.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/commands/create.d.ts +21 -0
- package/dist/commands/create.d.ts.map +1 -0
- package/dist/commands/create.js +95 -0
- package/dist/commands/create.js.map +1 -0
- package/dist/commands/get.d.ts.map +1 -1
- package/dist/commands/get.js +1 -7
- package/dist/commands/get.js.map +1 -1
- package/dist/daemon/daemon-create-item.d.ts +6 -0
- package/dist/daemon/daemon-create-item.d.ts.map +1 -0
- package/dist/daemon/daemon-create-item.js +9 -0
- package/dist/daemon/daemon-create-item.js.map +1 -0
- package/dist/utils/parse-custom-fields.d.ts +5 -0
- package/dist/utils/parse-custom-fields.d.ts.map +1 -0
- package/dist/utils/parse-custom-fields.js +19 -0
- package/dist/utils/parse-custom-fields.js.map +1 -0
- package/dist/utils/to-plural.d.ts +5 -0
- package/dist/utils/to-plural.d.ts.map +1 -0
- package/dist/utils/to-plural.js +11 -0
- package/dist/utils/to-plural.js.map +1 -0
- package/oclif.manifest.json +396 -466
- package/package.json +1 -1
- package/dist/commands/create/doc.d.ts +0 -17
- package/dist/commands/create/doc.d.ts.map +0 -1
- package/dist/commands/create/doc.js +0 -69
- package/dist/commands/create/doc.js.map +0 -1
- package/dist/commands/create/issue.d.ts +0 -19
- package/dist/commands/create/issue.d.ts.map +0 -1
- package/dist/commands/create/issue.js +0 -71
- package/dist/commands/create/issue.js.map +0 -1
- package/dist/lib/create-issue/index.d.ts +0 -2
- package/dist/lib/create-issue/index.d.ts.map +0 -1
- package/dist/lib/create-issue/index.js +0 -2
- package/dist/lib/create-issue/index.js.map +0 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
/**
|
|
3
|
+
* Create a new item of any registered type via the generic CreateItem RPC
|
|
4
|
+
*/
|
|
5
|
+
export default class Create extends Command {
|
|
6
|
+
static args: {
|
|
7
|
+
type: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
8
|
+
};
|
|
9
|
+
static description: string;
|
|
10
|
+
static examples: string[];
|
|
11
|
+
static flags: {
|
|
12
|
+
title: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
body: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
status: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
priority: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
'custom-field': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
};
|
|
19
|
+
run(): Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,OAAO,EAAS,MAAM,aAAa,CAAA;AAYlD;;GAEG;AAEH,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,OAAO;IAEzC,OAAgB,IAAI;;MAKnB;IAGD,OAAgB,WAAW,SAAkC;IAG7D,OAAgB,QAAQ,WAMvB;IAGD,OAAgB,KAAK;;;;;;;MA0BpB;IAEY,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAyClC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// eslint-disable-next-line import/order
|
|
2
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
3
|
+
import { daemonCreateItem } from '../daemon/daemon-create-item.js';
|
|
4
|
+
import { projectFlag } from '../flags/project-flag.js';
|
|
5
|
+
import { ensureInitialized, NotInitializedError, } from '../utils/ensure-initialized.js';
|
|
6
|
+
import { parseCustomFields } from '../utils/parse-custom-fields.js';
|
|
7
|
+
import { resolveProjectPath } from '../utils/resolve-project-path.js';
|
|
8
|
+
import { toPlural } from '../utils/to-plural.js';
|
|
9
|
+
/**
|
|
10
|
+
* Create a new item of any registered type via the generic CreateItem RPC
|
|
11
|
+
*/
|
|
12
|
+
// eslint-disable-next-line custom/no-default-class-export, class-export/class-export
|
|
13
|
+
export default class Create extends Command {
|
|
14
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
15
|
+
static args = {
|
|
16
|
+
type: Args.string({
|
|
17
|
+
description: 'Item type (e.g., issue, doc, epic, or custom type)',
|
|
18
|
+
required: true,
|
|
19
|
+
}),
|
|
20
|
+
};
|
|
21
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
22
|
+
static description = 'Create a new item of any type';
|
|
23
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
24
|
+
static examples = [
|
|
25
|
+
'<%= config.bin %> create issue --title "Bug in login" --priority 1',
|
|
26
|
+
'<%= config.bin %> create doc --title "Getting Started" --body "# Guide"',
|
|
27
|
+
'<%= config.bin %> create epic --title "Auth overhaul" --status open',
|
|
28
|
+
'<%= config.bin %> create bug --title "Crash on startup"',
|
|
29
|
+
'<%= config.bin %> create task --title "Review PR" --custom-field "assignee=alice"',
|
|
30
|
+
];
|
|
31
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
32
|
+
static flags = {
|
|
33
|
+
title: Flags.string({
|
|
34
|
+
char: 't',
|
|
35
|
+
description: 'Item title',
|
|
36
|
+
required: true,
|
|
37
|
+
}),
|
|
38
|
+
body: Flags.string({
|
|
39
|
+
char: 'b',
|
|
40
|
+
description: 'Item body / description (markdown)',
|
|
41
|
+
default: '',
|
|
42
|
+
}),
|
|
43
|
+
status: Flags.string({
|
|
44
|
+
char: 's',
|
|
45
|
+
description: 'Initial status (empty = use type default)',
|
|
46
|
+
default: '',
|
|
47
|
+
}),
|
|
48
|
+
priority: Flags.integer({
|
|
49
|
+
char: 'p',
|
|
50
|
+
description: 'Priority level (0 = use default)',
|
|
51
|
+
default: 0,
|
|
52
|
+
}),
|
|
53
|
+
'custom-field': Flags.string({
|
|
54
|
+
description: 'Custom field as key=value (repeatable)',
|
|
55
|
+
multiple: true,
|
|
56
|
+
}),
|
|
57
|
+
project: projectFlag,
|
|
58
|
+
};
|
|
59
|
+
async run() {
|
|
60
|
+
const { args, flags } = await this.parse(Create);
|
|
61
|
+
const itemType = toPlural(args.type);
|
|
62
|
+
const cwd = await resolveProjectPath(flags.project);
|
|
63
|
+
try {
|
|
64
|
+
await ensureInitialized(cwd);
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
if (error instanceof NotInitializedError) {
|
|
68
|
+
this.error(error.message);
|
|
69
|
+
}
|
|
70
|
+
throw error instanceof Error ? error : new Error(String(error));
|
|
71
|
+
}
|
|
72
|
+
const customFields = parseCustomFields(flags['custom-field']);
|
|
73
|
+
const response = await daemonCreateItem({
|
|
74
|
+
projectPath: cwd,
|
|
75
|
+
itemType,
|
|
76
|
+
title: flags.title,
|
|
77
|
+
body: flags.body,
|
|
78
|
+
status: flags.status,
|
|
79
|
+
priority: flags.priority,
|
|
80
|
+
customFields,
|
|
81
|
+
});
|
|
82
|
+
if (!response.success) {
|
|
83
|
+
const errorMsg = response.error !== '' ? response.error : 'Failed to create item';
|
|
84
|
+
this.error(errorMsg);
|
|
85
|
+
}
|
|
86
|
+
const item = response.item;
|
|
87
|
+
const meta = item.metadata;
|
|
88
|
+
const displayId = meta !== undefined && meta.displayNumber > 0
|
|
89
|
+
? ` #${meta.displayNumber}`
|
|
90
|
+
: '';
|
|
91
|
+
this.log(`Created ${args.type}${displayId}: "${item.title}"`);
|
|
92
|
+
this.log(` ID: ${item.id}`);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","source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AAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,YAAY;SACb,CAAC,CAAA;QAEF,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;YACtB,MAAM,QAAQ,GACZ,QAAQ,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,uBAAuB,CAAA;YAClE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;QACtB,CAAC;QAED,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAK,CAAA;QAC3B,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAA;QAC1B,MAAM,SAAS,GACb,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,aAAa,GAAG,CAAC;YAC1C,CAAC,CAAC,KAAK,IAAI,CAAC,aAAa,EAAE;YAC3B,CAAC,CAAC,EAAE,CAAA;QACR,IAAI,CAAC,GAAG,CAAC,WAAW,IAAI,CAAC,IAAI,GAAG,SAAS,MAAM,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;QAC7D,IAAI,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,EAAE,EAAE,CAAC,CAAA;IAC9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../src/commands/get.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,OAAO,EAAS,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../src/commands/get.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,OAAO,EAAS,MAAM,aAAa,CAAA;AAalD;;GAEG;AAEH,MAAM,CAAC,OAAO,OAAO,GAAI,SAAQ,OAAO;IAEtC,OAAgB,IAAI;;;MASnB;IAGD,OAAgB,WAAW,SAAuC;IAGlE,OAAgB,QAAQ,WASvB;IAGD,OAAgB,KAAK;;;;MAWpB;IAEY,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA4ClC"}
|
package/dist/commands/get.js
CHANGED
|
@@ -6,6 +6,7 @@ import { formatGenericItem } from '../lib/get-item/format-generic-item.js';
|
|
|
6
6
|
import { handleGlobalGet } from '../lib/get-item/handle-global-get.js';
|
|
7
7
|
import { ensureInitialized, NotInitializedError, } from '../utils/ensure-initialized.js';
|
|
8
8
|
import { resolveProjectPath } from '../utils/resolve-project-path.js';
|
|
9
|
+
import { toPlural } from '../utils/to-plural.js';
|
|
9
10
|
/**
|
|
10
11
|
* Get any item by type and identifier
|
|
11
12
|
*/
|
|
@@ -81,11 +82,4 @@ export default class Get extends Command {
|
|
|
81
82
|
formatGenericItem(response.item, this.log.bind(this));
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
|
-
function toPlural(type) {
|
|
85
|
-
if (type.endsWith('s'))
|
|
86
|
-
return type;
|
|
87
|
-
if (type.endsWith('y'))
|
|
88
|
-
return type.slice(0, -1) + 'ies';
|
|
89
|
-
return type + 's';
|
|
90
|
-
}
|
|
91
85
|
//# sourceMappingURL=get.js.map
|
package/dist/commands/get.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../src/commands/get.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAElD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAA;AACtE,OAAO,EACL,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["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,IAAI,CAAC,EAAE;SAChB,CAAC,CAAA;QAEF,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;YACtB,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;QAC5B,CAAC;QAED,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;YACf,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;YAChD,OAAM;QACR,CAAC;QAED,iBAAiB,CAAC,QAAQ,CAAC,IAAK,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;IACxD,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CreateItemRequest, CreateItemResponse } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Create a generic item via daemon
|
|
4
|
+
*/
|
|
5
|
+
export declare function daemonCreateItem(request: CreateItemRequest): Promise<CreateItemResponse>;
|
|
6
|
+
//# sourceMappingURL=daemon-create-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daemon-create-item.d.ts","sourceRoot":"","sources":["../../src/daemon/daemon-create-item.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAGvE;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,kBAAkB,CAAC,CAG7B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { getDaemonClient, callWithDeadline } from './load-proto.js';
|
|
2
|
+
/**
|
|
3
|
+
* Create a generic item via daemon
|
|
4
|
+
*/
|
|
5
|
+
export function daemonCreateItem(request) {
|
|
6
|
+
const client = getDaemonClient();
|
|
7
|
+
return callWithDeadline(client.createItem.bind(client), request);
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=daemon-create-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daemon-create-item.js","sourceRoot":"","sources":["../../src/daemon/daemon-create-item.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAEnE;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,OAA0B;IAE1B,MAAM,MAAM,GAAG,eAAe,EAAE,CAAA;IAChC,OAAO,gBAAgB,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAA;AAClE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-custom-fields.d.ts","sourceRoot":"","sources":["../../src/utils/parse-custom-fields.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,GAC3B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAYxB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parse custom field key=value pairs into an object.
|
|
3
|
+
*/
|
|
4
|
+
export function parseCustomFields(fields) {
|
|
5
|
+
const result = {};
|
|
6
|
+
if (fields === undefined)
|
|
7
|
+
return result;
|
|
8
|
+
for (const field of fields) {
|
|
9
|
+
const eqIndex = field.indexOf('=');
|
|
10
|
+
if (eqIndex === -1)
|
|
11
|
+
continue;
|
|
12
|
+
const key = field.slice(0, eqIndex);
|
|
13
|
+
const value = field.slice(eqIndex + 1);
|
|
14
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
15
|
+
result[key] = value;
|
|
16
|
+
}
|
|
17
|
+
return result;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=parse-custom-fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-custom-fields.js","sourceRoot":"","sources":["../../src/utils/parse-custom-fields.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAC/B,MAA4B;IAE5B,MAAM,MAAM,GAA2B,EAAE,CAAA;IACzC,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,MAAM,CAAA;IACvC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;QAClC,IAAI,OAAO,KAAK,CAAC,CAAC;YAAE,SAAQ;QAC5B,MAAM,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAA;QACnC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC,CAAA;QACtC,4DAA4D;QAC5D,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;IACrB,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-plural.d.ts","sourceRoot":"","sources":["../../src/utils/to-plural.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAI7C"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert a singular item type name to its plural form.
|
|
3
|
+
*/
|
|
4
|
+
export function toPlural(type) {
|
|
5
|
+
if (type.endsWith('s'))
|
|
6
|
+
return type;
|
|
7
|
+
if (type.endsWith('y'))
|
|
8
|
+
return type.slice(0, -1) + 'ies';
|
|
9
|
+
return type + 's';
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=to-plural.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-plural.js","sourceRoot":"","sources":["../../src/utils/to-plural.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAY;IACnC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAA;IACnC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAA;IACxD,OAAO,IAAI,GAAG,GAAG,CAAA;AACnB,CAAC"}
|