@startanaicompany/crm 2.5.1 → 2.5.2
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/index.js +83 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -2162,14 +2162,27 @@ const supportCmd = program.command('support').description('Submit and manage bug
|
|
|
2162
2162
|
.description(`Submit a new ${singular} report`)
|
|
2163
2163
|
.requiredOption('--title <title>', `${singular} title (max 200 chars)`)
|
|
2164
2164
|
.requiredOption('--description <desc>', 'Full description (max 2000 chars)')
|
|
2165
|
+
.option('--priority <p>', 'Priority: low|medium|high|critical (default: medium)', 'medium')
|
|
2166
|
+
.option('--cli-version <v>', 'Your CLI version (e.g. 2.5.1)')
|
|
2167
|
+
.option('--tags <tags>', 'Comma-separated tags (e.g. auth,login,ui)')
|
|
2168
|
+
.option('--severity <s>', type === 'bugs' ? 'Severity: cosmetic|minor|major|critical (bugs only)' : '(ignored for features)')
|
|
2169
|
+
.option('--from-agent-name <name>', 'Agent name for attribution (falls back to config defaultAgentName)')
|
|
2165
2170
|
.action(async (opts) => {
|
|
2166
2171
|
const globalOpts = program.opts();
|
|
2167
|
-
const
|
|
2172
|
+
const agentName = resolveAgentName(opts.fromAgentName);
|
|
2173
|
+
const client = getClient(globalOpts, agentName);
|
|
2168
2174
|
try {
|
|
2169
|
-
const
|
|
2175
|
+
const body = {
|
|
2170
2176
|
title: opts.title,
|
|
2171
|
-
description: opts.description
|
|
2172
|
-
|
|
2177
|
+
description: opts.description,
|
|
2178
|
+
priority: opts.priority
|
|
2179
|
+
};
|
|
2180
|
+
if (opts.cliVersion) body.cli_version = opts.cliVersion;
|
|
2181
|
+
if (opts.tags) body.tags = opts.tags.split(',').map(t => t.trim()).filter(Boolean);
|
|
2182
|
+
if (opts.severity && type === 'bugs') body.severity = opts.severity;
|
|
2183
|
+
// GAP-S10-2: send agent_name in body as well (belt-and-suspenders alongside X-Agent-Name header)
|
|
2184
|
+
if (agentName) body.agent_name = agentName;
|
|
2185
|
+
const res = await client.post(`/support/${type}`, body);
|
|
2173
2186
|
console.log(`${singular.charAt(0).toUpperCase() + singular.slice(1)} submitted. ID: ${res.data.data.id}`);
|
|
2174
2187
|
printJSON(res.data);
|
|
2175
2188
|
} catch (err) {
|
|
@@ -2206,6 +2219,21 @@ const supportCmd = program.command('support').description('Submit and manage bug
|
|
|
2206
2219
|
}
|
|
2207
2220
|
});
|
|
2208
2221
|
|
|
2222
|
+
typeCmd
|
|
2223
|
+
.command('comments')
|
|
2224
|
+
.description(`List all comments on your ${singular} ticket`)
|
|
2225
|
+
.requiredOption('--id <id>', 'Ticket ID')
|
|
2226
|
+
.action(async (opts) => {
|
|
2227
|
+
const globalOpts = program.opts();
|
|
2228
|
+
const client = getClient(globalOpts);
|
|
2229
|
+
try {
|
|
2230
|
+
const res = await client.get(`/support/${type}/${opts.id}/comments`);
|
|
2231
|
+
printJSON(res.data);
|
|
2232
|
+
} catch (err) {
|
|
2233
|
+
handleError(err);
|
|
2234
|
+
}
|
|
2235
|
+
});
|
|
2236
|
+
|
|
2209
2237
|
typeCmd
|
|
2210
2238
|
.command('comment')
|
|
2211
2239
|
.description(`Add a comment to your own ${singular} ticket`)
|
|
@@ -2224,6 +2252,57 @@ const supportCmd = program.command('support').description('Submit and manage bug
|
|
|
2224
2252
|
handleError(err);
|
|
2225
2253
|
}
|
|
2226
2254
|
});
|
|
2255
|
+
|
|
2256
|
+
typeCmd
|
|
2257
|
+
.command('close')
|
|
2258
|
+
.description(`Close/withdraw your own ${singular} ticket (requires reason)`)
|
|
2259
|
+
.requiredOption('--id <id>', 'Ticket ID')
|
|
2260
|
+
.requiredOption('--reason <reason>', 'Reason for closing')
|
|
2261
|
+
.action(async (opts) => {
|
|
2262
|
+
const globalOpts = program.opts();
|
|
2263
|
+
const client = getClient(globalOpts);
|
|
2264
|
+
try {
|
|
2265
|
+
const res = await client.patch(`/support/${type}/${opts.id}/close`, { reason: opts.reason });
|
|
2266
|
+
console.log('Ticket closed.');
|
|
2267
|
+
printJSON(res.data);
|
|
2268
|
+
} catch (err) {
|
|
2269
|
+
handleError(err);
|
|
2270
|
+
}
|
|
2271
|
+
});
|
|
2272
|
+
|
|
2273
|
+
typeCmd
|
|
2274
|
+
.command('reopen')
|
|
2275
|
+
.description(`Reopen a resolved ${singular} ticket (requires note)`)
|
|
2276
|
+
.requiredOption('--id <id>', 'Ticket ID')
|
|
2277
|
+
.requiredOption('--note <note>', 'Explanation for reopening')
|
|
2278
|
+
.action(async (opts) => {
|
|
2279
|
+
const globalOpts = program.opts();
|
|
2280
|
+
const client = getClient(globalOpts);
|
|
2281
|
+
try {
|
|
2282
|
+
const res = await client.patch(`/support/${type}/${opts.id}/reopen`, { note: opts.note });
|
|
2283
|
+
console.log('Ticket reopened.');
|
|
2284
|
+
printJSON(res.data);
|
|
2285
|
+
} catch (err) {
|
|
2286
|
+
handleError(err);
|
|
2287
|
+
}
|
|
2288
|
+
});
|
|
2289
|
+
|
|
2290
|
+
typeCmd
|
|
2291
|
+
.command('update')
|
|
2292
|
+
.description(`Add a note to your ${singular} ticket (use when status is needs_more_info)`)
|
|
2293
|
+
.requiredOption('--id <id>', 'Ticket ID')
|
|
2294
|
+
.requiredOption('--note <note>', 'Additional information')
|
|
2295
|
+
.action(async (opts) => {
|
|
2296
|
+
const globalOpts = program.opts();
|
|
2297
|
+
const client = getClient(globalOpts);
|
|
2298
|
+
try {
|
|
2299
|
+
const res = await client.patch(`/support/${type}/${opts.id}/update`, { note: opts.note });
|
|
2300
|
+
console.log('Note added.');
|
|
2301
|
+
printJSON(res.data);
|
|
2302
|
+
} catch (err) {
|
|
2303
|
+
handleError(err);
|
|
2304
|
+
}
|
|
2305
|
+
});
|
|
2227
2306
|
});
|
|
2228
2307
|
|
|
2229
2308
|
program.parse(process.argv);
|