@camunda8/cli 2.7.0-alpha.13 → 2.7.0-alpha.15
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/command-dispatch.d.ts.map +1 -1
- package/dist/command-dispatch.js +19 -1
- package/dist/command-dispatch.js.map +1 -1
- package/dist/command-framework.d.ts +21 -0
- package/dist/command-framework.d.ts.map +1 -1
- package/dist/command-framework.js +53 -19
- package/dist/command-framework.js.map +1 -1
- package/dist/command-registry.d.ts +6 -1
- package/dist/command-registry.d.ts.map +1 -1
- package/dist/command-registry.js +6 -1
- package/dist/command-registry.js.map +1 -1
- package/dist/commands/completion.d.ts +19 -0
- package/dist/commands/completion.d.ts.map +1 -1
- package/dist/commands/completion.js +36 -14
- package/dist/commands/completion.js.map +1 -1
- package/dist/commands/deployments.d.ts +10 -0
- package/dist/commands/deployments.d.ts.map +1 -1
- package/dist/commands/deployments.js +233 -176
- package/dist/commands/deployments.js.map +1 -1
- package/dist/commands/forms.d.ts.map +1 -1
- package/dist/commands/forms.js +2 -3
- package/dist/commands/forms.js.map +1 -1
- package/dist/commands/identity-groups.d.ts.map +1 -1
- package/dist/commands/identity-groups.js +3 -5
- package/dist/commands/identity-groups.js.map +1 -1
- package/dist/commands/identity-mapping-rules.d.ts.map +1 -1
- package/dist/commands/identity-mapping-rules.js +5 -9
- package/dist/commands/identity-mapping-rules.js.map +1 -1
- package/dist/commands/identity-roles.d.ts.map +1 -1
- package/dist/commands/identity-roles.js +3 -5
- package/dist/commands/identity-roles.js.map +1 -1
- package/dist/commands/identity-tenants.d.ts.map +1 -1
- package/dist/commands/identity-tenants.js +3 -5
- package/dist/commands/identity-tenants.js.map +1 -1
- package/dist/commands/identity-users.d.ts.map +1 -1
- package/dist/commands/identity-users.js +3 -5
- package/dist/commands/identity-users.js.map +1 -1
- package/dist/commands/identity.d.ts +29 -2
- package/dist/commands/identity.d.ts.map +1 -1
- package/dist/commands/identity.js +247 -208
- package/dist/commands/identity.js.map +1 -1
- package/dist/commands/incidents.d.ts.map +1 -1
- package/dist/commands/incidents.js +2 -3
- package/dist/commands/incidents.js.map +1 -1
- package/dist/commands/jobs.d.ts.map +1 -1
- package/dist/commands/jobs.js +5 -9
- package/dist/commands/jobs.js.map +1 -1
- package/dist/commands/mcp-proxy.d.ts +4 -4
- package/dist/commands/mcp-proxy.d.ts.map +1 -1
- package/dist/commands/mcp-proxy.js +49 -39
- package/dist/commands/mcp-proxy.js.map +1 -1
- package/dist/commands/messages.d.ts.map +1 -1
- package/dist/commands/messages.js +2 -4
- package/dist/commands/messages.js.map +1 -1
- package/dist/commands/open.d.ts +4 -2
- package/dist/commands/open.d.ts.map +1 -1
- package/dist/commands/open.js +17 -18
- package/dist/commands/open.js.map +1 -1
- package/dist/commands/plugins.d.ts.map +1 -1
- package/dist/commands/plugins.js +16 -32
- package/dist/commands/plugins.js.map +1 -1
- package/dist/commands/process-instances.d.ts.map +1 -1
- package/dist/commands/process-instances.js +5 -9
- package/dist/commands/process-instances.js.map +1 -1
- package/dist/commands/profiles.d.ts.map +1 -1
- package/dist/commands/profiles.js +8 -16
- package/dist/commands/profiles.js.map +1 -1
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +1 -2
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/search.d.ts.map +1 -1
- package/dist/commands/search.js +4 -8
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/session.d.ts.map +1 -1
- package/dist/commands/session.js +4 -7
- package/dist/commands/session.js.map +1 -1
- package/dist/commands/user-tasks.d.ts.map +1 -1
- package/dist/commands/user-tasks.js +2 -3
- package/dist/commands/user-tasks.js.map +1 -1
- package/dist/commands/watch.d.ts +7 -5
- package/dist/commands/watch.d.ts.map +1 -1
- package/dist/commands/watch.js +77 -34
- package/dist/commands/watch.js.map +1 -1
- package/dist/errors.d.ts +62 -8
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +99 -10
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -36
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/commands/session.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EACN,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,aAAa,GACb,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACtC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAE3B,iCAAiC;IACjC,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;QACvB,kBAAkB,EAAE,CAAC;QACrB,MAAM,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC;QAC1C,OAAO;IACR,CAAC;IAED,iEAAiE;IACjE,MAAM,OAAO,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;QACd,MAAM,
|
|
1
|
+
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/commands/session.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EACN,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,aAAa,GACb,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACtC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAE3B,iCAA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,qDAAqD,CAAC,CAAC;IACxE,CAAC;IACD,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtB,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACzB,CAAC,CACD,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAC5C,KAAK,EACL,QAAQ,EACR,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;IAC5B,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACzB,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACzB,CAAC,CACD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-tasks.d.ts","sourceRoot":"","sources":["../../src/commands/user-tasks.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH;;GAEG;AACH,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"user-tasks.d.ts","sourceRoot":"","sources":["../../src/commands/user-tasks.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH;;GAEG;AACH,eAAO,MAAM,oBAAoB,uEAiEhC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,2EA6BnC,CAAC"}
|
|
@@ -8,7 +8,7 @@ import { buildDateFilter, parseBetween } from "../date-filter.js";
|
|
|
8
8
|
* List user tasks
|
|
9
9
|
*/
|
|
10
10
|
export const listUserTasksCommand = defineCommand("list", "user-task", async (ctx, flags) => {
|
|
11
|
-
const { client,
|
|
11
|
+
const { client, tenantId, profile, limit, all, between, dateField } = ctx;
|
|
12
12
|
const filter = {
|
|
13
13
|
filter: {
|
|
14
14
|
tenantId,
|
|
@@ -31,8 +31,7 @@ export const listUserTasksCommand = defineCommand("list", "user-task", async (ct
|
|
|
31
31
|
filter.filter[field] = buildDateFilter(parsed.from, parsed.to);
|
|
32
32
|
}
|
|
33
33
|
else {
|
|
34
|
-
|
|
35
|
-
process.exit(1);
|
|
34
|
+
throw new Error("Invalid --between value. Expected format: <from>..<to> (e.g. 2024-01-01..2024-12-31, ISO 8601 datetimes, or open-ended: ..2024-12-31 or 2024-01-01..)");
|
|
36
35
|
}
|
|
37
36
|
}
|
|
38
37
|
const dr = dryRun({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-tasks.js","sourceRoot":"","sources":["../../src/commands/user-tasks.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAElE;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAChD,MAAM,EACN,WAAW,EACX,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE;IACpB,MAAM,
|
|
1
|
+
{"version":3,"file":"user-tasks.js","sourceRoot":"","sources":["../../src/commands/user-tasks.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAElE;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAChD,MAAM,EACN,WAAW,EACX,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE;IACpB,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,GAAG,CAAC;IAE1E,MAAM,MAAM,GAAwC;QACnD,MAAM,EAAE;YACP,QAAQ;SACR;KACD,CAAC;IAEF,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;QACjB,MA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,GAAG,YAAY,EAAE,CAAC;AACnE,CAAC,CACD,CAAC"}
|
package/dist/commands/watch.d.ts
CHANGED
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export declare const DEPLOY_COOLDOWN = 1000;
|
|
5
5
|
/**
|
|
6
|
-
* Watch for
|
|
6
|
+
* Watch one or more paths for BPMN/DMN/Form changes and auto-deploy.
|
|
7
|
+
*
|
|
8
|
+
* Long-running: stays alive until SIGINT, then closes watchers, cancels
|
|
9
|
+
* any pending debounced deploys AND aborts any in-flight HTTP deploys via
|
|
10
|
+
* AbortController, then resolves so the framework returns naturally with
|
|
11
|
+
* `{ kind: "never" }`. SIGTERM is handled by Node's default behaviour
|
|
12
|
+
* (immediate termination).
|
|
7
13
|
*/
|
|
8
|
-
export declare function watchFiles(paths: string[], options: {
|
|
9
|
-
profile?: string;
|
|
10
|
-
force?: boolean;
|
|
11
|
-
}): Promise<void>;
|
|
12
14
|
export declare const watchCommand: import("../command-framework.ts").CommandHandler<"watch", "">;
|
|
13
15
|
//# sourceMappingURL=watch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../src/commands/watch.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH,eAAO,MAAM,eAAe,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../src/commands/watch.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH,eAAO,MAAM,eAAe,OAAO,CAAC;AAKpC;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,+DAkKvB,CAAC"}
|
package/dist/commands/watch.js
CHANGED
|
@@ -4,27 +4,34 @@
|
|
|
4
4
|
import { existsSync, statSync, watch } from "node:fs";
|
|
5
5
|
import { basename, extname, resolve } from "node:path";
|
|
6
6
|
import { defineCommand } from "../command-framework.js";
|
|
7
|
+
import { normalizeToError } from "../errors.js";
|
|
7
8
|
import { isIgnored, loadIgnoreRules } from "../ignore.js";
|
|
8
|
-
import { getLogger } from "../logger.js";
|
|
9
9
|
import { deploy } from "./deployments.js";
|
|
10
10
|
const WATCHED_EXTENSIONS = [".bpmn", ".dmn", ".form"];
|
|
11
11
|
export const DEPLOY_COOLDOWN = 1000; // 1 second cooldown
|
|
12
12
|
const DEBOUNCE_DELAY = 200; // ms to wait after last fs event before deploying
|
|
13
|
+
// ─── defineCommand ───────────────────────────────────────────────────────────
|
|
13
14
|
/**
|
|
14
|
-
* Watch for
|
|
15
|
+
* Watch one or more paths for BPMN/DMN/Form changes and auto-deploy.
|
|
16
|
+
*
|
|
17
|
+
* Long-running: stays alive until SIGINT, then closes watchers, cancels
|
|
18
|
+
* any pending debounced deploys AND aborts any in-flight HTTP deploys via
|
|
19
|
+
* AbortController, then resolves so the framework returns naturally with
|
|
20
|
+
* `{ kind: "never" }`. SIGTERM is handled by Node's default behaviour
|
|
21
|
+
* (immediate termination).
|
|
15
22
|
*/
|
|
16
|
-
export
|
|
17
|
-
const logger =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
export const watchCommand = defineCommand("watch", "", async (ctx, flags) => {
|
|
24
|
+
const { logger } = ctx;
|
|
25
|
+
// watch treats resource + positionals as path varargs; default to "."
|
|
26
|
+
const rawPaths = ctx.resource
|
|
27
|
+
? [ctx.resource, ...ctx.positionals]
|
|
28
|
+
: ctx.positionals.length > 0
|
|
29
|
+
? ctx.positionals
|
|
30
|
+
: ["."];
|
|
31
|
+
const resolvedPaths = rawPaths.map((p) => resolve(p));
|
|
24
32
|
for (const path of resolvedPaths) {
|
|
25
33
|
if (!existsSync(path)) {
|
|
26
|
-
|
|
27
|
-
process.exit(1);
|
|
34
|
+
throw new Error(`Path does not exist: ${path}`);
|
|
28
35
|
}
|
|
29
36
|
}
|
|
30
37
|
// Load .c8ignore rules from the working directory
|
|
@@ -32,7 +39,7 @@ export async function watchFiles(paths, options) {
|
|
|
32
39
|
const ig = loadIgnoreRules(ignoreBaseDir);
|
|
33
40
|
logger.info(`👁️ Watching for changes in: ${resolvedPaths.join(", ")}`);
|
|
34
41
|
logger.info(`📋 Monitoring extensions: ${WATCHED_EXTENSIONS.join(", ")}`);
|
|
35
|
-
if (
|
|
42
|
+
if (flags.force) {
|
|
36
43
|
logger.info("🔒 Force mode: will continue watching after deployment errors");
|
|
37
44
|
}
|
|
38
45
|
logger.info("Press Ctrl+C to stop watching\n");
|
|
@@ -40,8 +47,14 @@ export async function watchFiles(paths, options) {
|
|
|
40
47
|
const recentlyDeployed = new Map();
|
|
41
48
|
// Debounce timers per file to let writes settle before deploying
|
|
42
49
|
const debounceTimers = new Map();
|
|
50
|
+
// AbortControllers for in-flight deploys, so SIGINT can cancel them
|
|
51
|
+
// promptly instead of waiting for the HTTP round-trip to finish.
|
|
52
|
+
const inflightDeploys = new Set();
|
|
53
|
+
// Set on SIGINT to short-circuit any debounce callback that fires
|
|
54
|
+
// between signal receipt and the synchronous shutdown work below.
|
|
55
|
+
let shuttingDown = false;
|
|
43
56
|
// Watch each path
|
|
44
|
-
|
|
57
|
+
const watchers = resolvedPaths.map((path) => {
|
|
45
58
|
const stats = statSync(path);
|
|
46
59
|
const isDirectory = stats.isDirectory();
|
|
47
60
|
const watcher = watch(path, { recursive: isDirectory }, (_eventType, filename) => {
|
|
@@ -64,6 +77,10 @@ export async function watchFiles(paths, options) {
|
|
|
64
77
|
clearTimeout(existing);
|
|
65
78
|
debounceTimers.set(fullPath, setTimeout(async () => {
|
|
66
79
|
debounceTimers.delete(fullPath);
|
|
80
|
+
// SIGINT may have fired between the timer being scheduled
|
|
81
|
+
// and this callback running. Bail before doing any I/O.
|
|
82
|
+
if (shuttingDown)
|
|
83
|
+
return;
|
|
67
84
|
// Check cooldown to prevent duplicate deploys
|
|
68
85
|
const lastDeploy = recentlyDeployed.get(fullPath);
|
|
69
86
|
const now = Date.now();
|
|
@@ -77,15 +94,29 @@ export async function watchFiles(paths, options) {
|
|
|
77
94
|
}
|
|
78
95
|
logger.info(`\n🔄 Change detected: ${basename(file)}`);
|
|
79
96
|
recentlyDeployed.set(fullPath, Date.now());
|
|
97
|
+
const ac = new AbortController();
|
|
98
|
+
inflightDeploys.add(ac);
|
|
80
99
|
try {
|
|
81
100
|
await deploy([fullPath], {
|
|
82
|
-
profile:
|
|
83
|
-
continueOnError:
|
|
101
|
+
profile: ctx.profile,
|
|
102
|
+
continueOnError: flags.force,
|
|
84
103
|
continueOnUserError: true,
|
|
104
|
+
signal: ac.signal,
|
|
85
105
|
});
|
|
86
106
|
}
|
|
87
107
|
catch (error) {
|
|
88
|
-
|
|
108
|
+
// `deploy()` normally returns early when its signal is
|
|
109
|
+
// aborted, so SIGINT cancellation is not expected to land
|
|
110
|
+
// here. Keep this as a defensive fallback in case an
|
|
111
|
+
// aborted deploy ever re-throws — and never log it as a
|
|
112
|
+
// deploy failure, since the goodbye message is the
|
|
113
|
+
// user-visible shutdown signal.
|
|
114
|
+
if (ac.signal.aborted)
|
|
115
|
+
return;
|
|
116
|
+
logger.error(`Failed to deploy ${basename(file)}`, normalizeToError(error, "Deployment request failed"));
|
|
117
|
+
}
|
|
118
|
+
finally {
|
|
119
|
+
inflightDeploys.delete(ac);
|
|
89
120
|
}
|
|
90
121
|
}, DEBOUNCE_DELAY));
|
|
91
122
|
});
|
|
@@ -93,24 +124,36 @@ export async function watchFiles(paths, options) {
|
|
|
93
124
|
watcher.on("error", (error) => {
|
|
94
125
|
logger.error("Watcher error", error);
|
|
95
126
|
});
|
|
96
|
-
|
|
97
|
-
// Keep process alive
|
|
98
|
-
process.on("SIGINT", () => {
|
|
99
|
-
logger.info("\n\n🍹 - bottoms up.");
|
|
100
|
-
process.exit(0);
|
|
127
|
+
return watcher;
|
|
101
128
|
});
|
|
102
|
-
|
|
103
|
-
//
|
|
104
|
-
|
|
105
|
-
//
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
129
|
+
// Block until SIGINT, then close watchers, cancel any pending debounced
|
|
130
|
+
// deploys, abort any in-flight HTTP deploys, and resolve so the handler
|
|
131
|
+
// returns naturally. The framework treats this as `{ kind: "never" }`
|
|
132
|
+
// and the process exits with code 0.
|
|
133
|
+
//
|
|
134
|
+
// We deliberately do NOT call `process.exit()` here:
|
|
135
|
+
// - `shuttingDown = true` short-circuits any debounce callback that fires
|
|
136
|
+
// between SIGINT and this synchronous block.
|
|
137
|
+
// - `clearTimeout(...)` cancels any timer that hasn't fired yet.
|
|
138
|
+
// - `ac.abort()` cancels the underlying SDK CancelablePromise for any
|
|
139
|
+
// deploy currently waiting on the network — those callsites detect
|
|
140
|
+
// `signal.aborted` and swallow the AbortError instead of logging.
|
|
141
|
+
// Together these drain the event loop within one tick, so the framework
|
|
142
|
+
// can return naturally and own the exit code.
|
|
143
|
+
await new Promise((resolveSignal) => {
|
|
144
|
+
process.once("SIGINT", () => {
|
|
145
|
+
shuttingDown = true;
|
|
146
|
+
logger.info("\n\n🍹 - bottoms up.");
|
|
147
|
+
for (const w of watchers)
|
|
148
|
+
w.close();
|
|
149
|
+
for (const timer of debounceTimers.values())
|
|
150
|
+
clearTimeout(timer);
|
|
151
|
+
debounceTimers.clear();
|
|
152
|
+
for (const ac of inflightDeploys)
|
|
153
|
+
ac.abort();
|
|
154
|
+
inflightDeploys.clear();
|
|
155
|
+
resolveSignal();
|
|
156
|
+
});
|
|
114
157
|
});
|
|
115
158
|
return { kind: "never" };
|
|
116
159
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch.js","sourceRoot":"","sources":["../../src/commands/watch.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;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AC;QAEH,OAAO,OAAO,CAAC;IAChB,CAAC,CAAC,CAAC;IAEH,wEAAwE;IACxE,wEAAwE;IACxE,sEAAsE;IACtE,qCAAqC;IACrC,EAAE;IACF,qDAAqD;IACrD,0EAA0E;IAC1E,+CAA+C;IAC/C,iEAAiE;IACjE,sEAAsE;IACtE,qEAAqE;IACrE,oEAAoE;IACpE,wEAAwE;IACxE,8CAA8C;IAC9C,MAAM,IAAI,OAAO,CAAO,CAAC,aAAa,EAAE,EAAE;QACzC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE;YAC3B,YAAY,GAAG,IAAI,CAAC;YACpB,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;YACpC,KAAK,MAAM,CAAC,IAAI,QAAQ;gBAAE,CAAC,CAAC,KAAK,EAAE,CAAC;YACpC,KAAK,MAAM,KAAK,IAAI,cAAc,CAAC,MAAM,EAAE;gBAAE,YAAY,CAAC,KAAK,CAAC,CAAC;YACjE,cAAc,CAAC,KAAK,EAAE,CAAC;YACvB,KAAK,MAAM,EAAE,IAAI,eAAe;gBAAE,EAAE,CAAC,KAAK,EAAE,CAAC;YAC7C,eAAe,CAAC,KAAK,EAAE,CAAC;YACxB,aAAa,EAAE,CAAC;QACjB,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAC1B,CAAC,CAAC,CAAC"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -1,19 +1,73 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Centralized error handling for c8ctl command operations.
|
|
3
3
|
*
|
|
4
|
-
* When --verbose is set, errors are
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* When --verbose is set, errors are normalized via `normalizeToError`
|
|
5
|
+
* (Errors pass through unchanged; non-Error throws like RFC 9457
|
|
6
|
+
* problem-detail objects are wrapped in an `Error` whose message is
|
|
7
|
+
* built from `title` / `detail` / `status` and whose `cause` retains
|
|
8
|
+
* the original value) and then thrown so Node.js prints a meaningful
|
|
9
|
+
* stack trace. When it is not set, a terse user-friendly message is
|
|
10
|
+
* emitted and the process exits with a non-zero code, with a hint
|
|
11
|
+
* about using --verbose.
|
|
7
12
|
*/
|
|
8
13
|
import type { Logger } from "./logger.ts";
|
|
14
|
+
/**
|
|
15
|
+
* Marker error: the caller has already rendered a rich, user-facing
|
|
16
|
+
* error message (e.g. multi-line context, hints, formatted detail) and
|
|
17
|
+
* just needs the framework to exit non-zero. `handleCommandError` skips
|
|
18
|
+
* its default `logger.error(...)` + verbose-hint render for these,
|
|
19
|
+
* avoiding duplicate "Failed to <verb>: <message>" summary lines on
|
|
20
|
+
* top of the rich pre-rendered output.
|
|
21
|
+
*
|
|
22
|
+
* Use this only when the helper has already produced a complete,
|
|
23
|
+
* user-actionable failure message. For ordinary errors that just need
|
|
24
|
+
* to bubble up, throw a plain `Error` and let the framework format it.
|
|
25
|
+
*/
|
|
26
|
+
export declare class SilentError extends Error {
|
|
27
|
+
constructor(message: string);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Normalize any thrown value into an `Error` instance, with care taken
|
|
31
|
+
* to preserve actionable information from RFC 9457 problem-detail
|
|
32
|
+
* objects (which the Camunda SDK throws as plain objects, not Errors).
|
|
33
|
+
*
|
|
34
|
+
* - If `error` is already an `Error`, it is returned unchanged.
|
|
35
|
+
* - If `error` looks like an RFC 9457 problem detail (has any of
|
|
36
|
+
* `title` / `detail` / `status`), the synthesized Error message is
|
|
37
|
+
* built from those fields so it is meaningful to a user (instead of
|
|
38
|
+
* the useless `"[object Object]"` produced by `String(error)`).
|
|
39
|
+
* - Otherwise the synthesized Error uses `fallbackMessage`.
|
|
40
|
+
*
|
|
41
|
+
* The original value is always preserved as `cause` so it remains
|
|
42
|
+
* inspectable (e.g. under `--verbose` stack output).
|
|
43
|
+
*
|
|
44
|
+
* Class of defect this guards against: `new Error(String(error))` for
|
|
45
|
+
* non-Error throws collapses problem-detail responses to
|
|
46
|
+
* `Error: [object Object]`, losing every actionable field.
|
|
47
|
+
*/
|
|
48
|
+
export declare function normalizeToError(error: unknown, fallbackMessage?: string): Error;
|
|
9
49
|
/**
|
|
10
50
|
* Handle a command error in a consistent way across the codebase.
|
|
11
51
|
*
|
|
12
|
-
* - In verbose mode (`--verbose`): the
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
52
|
+
* - In verbose mode (`--verbose`): the input is run through
|
|
53
|
+
* `normalizeToError` and the resulting `Error` is thrown so Node.js
|
|
54
|
+
* prints the full stack trace. For inputs that are already an
|
|
55
|
+
* `Error` this is a no-op (the same instance is thrown). For non-
|
|
56
|
+
* Error throws the thrown value is the synthesized normalized
|
|
57
|
+
* `Error`, which preserves the original value as `cause`. (Callers
|
|
58
|
+
* that need the exact original reference can read `.cause` from the
|
|
59
|
+
* thrown error.)
|
|
60
|
+
* - In normal mode: a terse message is printed via the logger,
|
|
61
|
+
* followed by any optional additional hints, and then a hint to
|
|
62
|
+
* re-run with `--verbose`. The process exits with code 1. To avoid
|
|
63
|
+
* duplicated output when the normalized error has no actionable
|
|
64
|
+
* detail beyond `message` (e.g. for primitive throws), the second
|
|
65
|
+
* `error` argument to `logger.error` is omitted in that case so the
|
|
66
|
+
* user message appears exactly once.
|
|
67
|
+
* - For `SilentError`: skip the default render entirely (the caller
|
|
68
|
+
* has already shown a user-facing error), and just exit non-zero
|
|
69
|
+
* (or rethrow in verbose mode — `SilentError` is an `Error`, so
|
|
70
|
+
* normalization is a no-op and the same instance is thrown).
|
|
17
71
|
*/
|
|
18
72
|
export declare function handleCommandError(logger: Logger, message: string, error: unknown, additionalHints?: string[]): never;
|
|
19
73
|
//# sourceMappingURL=errors.d.ts.map
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAI1C;;;;;;;;;;;GAWG;AACH,qBAAa,WAAY,SAAQ,KAAK;gBACzB,OAAO,EAAE,MAAM;CAI3B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAC/B,KAAK,EAAE,OAAO,EACd,eAAe,SAAqB,GAClC,KAAK,CAaP;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,kBAAkB,CACjC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,OAAO,EACd,eAAe,CAAC,EAAE,MAAM,EAAE,GACxB,KAAK,CAiCP"}
|
package/dist/errors.js
CHANGED
|
@@ -1,26 +1,115 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Centralized error handling for c8ctl command operations.
|
|
3
3
|
*
|
|
4
|
-
* When --verbose is set, errors are
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* When --verbose is set, errors are normalized via `normalizeToError`
|
|
5
|
+
* (Errors pass through unchanged; non-Error throws like RFC 9457
|
|
6
|
+
* problem-detail objects are wrapped in an `Error` whose message is
|
|
7
|
+
* built from `title` / `detail` / `status` and whose `cause` retains
|
|
8
|
+
* the original value) and then thrown so Node.js prints a meaningful
|
|
9
|
+
* stack trace. When it is not set, a terse user-friendly message is
|
|
10
|
+
* emitted and the process exits with a non-zero code, with a hint
|
|
11
|
+
* about using --verbose.
|
|
7
12
|
*/
|
|
13
|
+
import { isRecord } from "./logger.js";
|
|
8
14
|
import { c8ctl } from "./runtime.js";
|
|
15
|
+
/**
|
|
16
|
+
* Marker error: the caller has already rendered a rich, user-facing
|
|
17
|
+
* error message (e.g. multi-line context, hints, formatted detail) and
|
|
18
|
+
* just needs the framework to exit non-zero. `handleCommandError` skips
|
|
19
|
+
* its default `logger.error(...)` + verbose-hint render for these,
|
|
20
|
+
* avoiding duplicate "Failed to <verb>: <message>" summary lines on
|
|
21
|
+
* top of the rich pre-rendered output.
|
|
22
|
+
*
|
|
23
|
+
* Use this only when the helper has already produced a complete,
|
|
24
|
+
* user-actionable failure message. For ordinary errors that just need
|
|
25
|
+
* to bubble up, throw a plain `Error` and let the framework format it.
|
|
26
|
+
*/
|
|
27
|
+
export class SilentError extends Error {
|
|
28
|
+
constructor(message) {
|
|
29
|
+
super(message);
|
|
30
|
+
this.name = "SilentError";
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Normalize any thrown value into an `Error` instance, with care taken
|
|
35
|
+
* to preserve actionable information from RFC 9457 problem-detail
|
|
36
|
+
* objects (which the Camunda SDK throws as plain objects, not Errors).
|
|
37
|
+
*
|
|
38
|
+
* - If `error` is already an `Error`, it is returned unchanged.
|
|
39
|
+
* - If `error` looks like an RFC 9457 problem detail (has any of
|
|
40
|
+
* `title` / `detail` / `status`), the synthesized Error message is
|
|
41
|
+
* built from those fields so it is meaningful to a user (instead of
|
|
42
|
+
* the useless `"[object Object]"` produced by `String(error)`).
|
|
43
|
+
* - Otherwise the synthesized Error uses `fallbackMessage`.
|
|
44
|
+
*
|
|
45
|
+
* The original value is always preserved as `cause` so it remains
|
|
46
|
+
* inspectable (e.g. under `--verbose` stack output).
|
|
47
|
+
*
|
|
48
|
+
* Class of defect this guards against: `new Error(String(error))` for
|
|
49
|
+
* non-Error throws collapses problem-detail responses to
|
|
50
|
+
* `Error: [object Object]`, losing every actionable field.
|
|
51
|
+
*/
|
|
52
|
+
export function normalizeToError(error, fallbackMessage = "Operation failed") {
|
|
53
|
+
if (error instanceof Error) {
|
|
54
|
+
return error;
|
|
55
|
+
}
|
|
56
|
+
const raw = isRecord(error) ? error : {};
|
|
57
|
+
const title = typeof raw.title === "string" ? raw.title : undefined;
|
|
58
|
+
const detail = typeof raw.detail === "string" ? raw.detail : undefined;
|
|
59
|
+
const status = typeof raw.status === "number" ? raw.status : undefined;
|
|
60
|
+
const head = [title ?? fallbackMessage, detail]
|
|
61
|
+
.filter((p) => Boolean(p))
|
|
62
|
+
.join(": ");
|
|
63
|
+
const message = status !== undefined ? `${head} (status ${status})` : head;
|
|
64
|
+
return new Error(message, { cause: error });
|
|
65
|
+
}
|
|
9
66
|
/**
|
|
10
67
|
* Handle a command error in a consistent way across the codebase.
|
|
11
68
|
*
|
|
12
|
-
* - In verbose mode (`--verbose`): the
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
69
|
+
* - In verbose mode (`--verbose`): the input is run through
|
|
70
|
+
* `normalizeToError` and the resulting `Error` is thrown so Node.js
|
|
71
|
+
* prints the full stack trace. For inputs that are already an
|
|
72
|
+
* `Error` this is a no-op (the same instance is thrown). For non-
|
|
73
|
+
* Error throws the thrown value is the synthesized normalized
|
|
74
|
+
* `Error`, which preserves the original value as `cause`. (Callers
|
|
75
|
+
* that need the exact original reference can read `.cause` from the
|
|
76
|
+
* thrown error.)
|
|
77
|
+
* - In normal mode: a terse message is printed via the logger,
|
|
78
|
+
* followed by any optional additional hints, and then a hint to
|
|
79
|
+
* re-run with `--verbose`. The process exits with code 1. To avoid
|
|
80
|
+
* duplicated output when the normalized error has no actionable
|
|
81
|
+
* detail beyond `message` (e.g. for primitive throws), the second
|
|
82
|
+
* `error` argument to `logger.error` is omitted in that case so the
|
|
83
|
+
* user message appears exactly once.
|
|
84
|
+
* - For `SilentError`: skip the default render entirely (the caller
|
|
85
|
+
* has already shown a user-facing error), and just exit non-zero
|
|
86
|
+
* (or rethrow in verbose mode — `SilentError` is an `Error`, so
|
|
87
|
+
* normalization is a no-op and the same instance is thrown).
|
|
17
88
|
*/
|
|
18
89
|
export function handleCommandError(logger, message, error, additionalHints) {
|
|
19
|
-
const normalizedError = error
|
|
90
|
+
const normalizedError = normalizeToError(error, message);
|
|
20
91
|
if (c8ctl.verbose) {
|
|
21
92
|
throw normalizedError;
|
|
22
93
|
}
|
|
23
|
-
|
|
94
|
+
if (error instanceof SilentError) {
|
|
95
|
+
// Caller already rendered a rich user-facing message. Don't
|
|
96
|
+
// stack a "Failed to ...: <message>" + verbose-hint summary on
|
|
97
|
+
// top — just exit non-zero.
|
|
98
|
+
process.exit(1);
|
|
99
|
+
}
|
|
100
|
+
// Avoid duplicated output when `normalizeToError` had no actionable
|
|
101
|
+
// fields to extract and fell back to the caller's `message`. In that
|
|
102
|
+
// case `Logger.error(message, error)` would print the same string
|
|
103
|
+
// twice (the prefix line "✗ <message>" followed by the indented
|
|
104
|
+
// " <error.message>" line, or both `message` and `error` fields in
|
|
105
|
+
// JSON mode). Pass only `message` so the second line / `error` field
|
|
106
|
+
// is omitted.
|
|
107
|
+
if (normalizedError.message === message) {
|
|
108
|
+
logger.error(message);
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
logger.error(message, normalizedError);
|
|
112
|
+
}
|
|
24
113
|
if (additionalHints) {
|
|
25
114
|
for (const hint of additionalHints) {
|
|
26
115
|
logger.info(hint);
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK;IACrC,YAAY,OAAe;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;IAC3B,CAAC;CACD;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU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C;QACnB,MAAM,eAAe,CAAC;IACvB,CAAC;IAED,IAAI,KAAK,YAAY,WAAW,EAAE,CAAC;QAClC,4DAA4D;QAC5D,+DAA+D;QAC/D,4BAA4B;QAC5B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;IAED,oEAAoE;IACpE,qEAAqE;IACrE,kEAAkE;IAClE,gEAAgE;IAChE,oEAAoE;IACpE,qEAAqE;IACrE,cAAc;IACd,IAAI,eAAe,CAAC,OAAO,KAAK,OAAO,EAAE,CAAC;QACzC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACvB,CAAC;SAAM,CAAC;QACP,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;IACxC,CAAC;IACD,IAAI,eAAe,EAAE,CAAC;QACrB,KAAK,MAAM,IAAI,IAAI,eAAe,EAAE,CAAC;YACpC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnB,CAAC;IACF,CAAC;IACD,MAAM,CAAC,IAAI,CAAC,4DAA4D,CAAC,CAAC;IAC1E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AA2EH;;GAEG;AACH,wBAAgB,0BAA0B,CACzC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,MAAM,GAAG,SAAS,CAMpB"}
|
package/dist/index.js
CHANGED
|
@@ -10,9 +10,8 @@ import { createClient } from "./client.js";
|
|
|
10
10
|
import { COMMAND_DISPATCH } from "./command-dispatch.js";
|
|
11
11
|
import { COMMAND_REGISTRY, deriveParseArgsOptions, getCommandDef, resolveAlias, } from "./command-registry.js";
|
|
12
12
|
import { detectUnknownFlags, validateFlags } from "./command-validation.js";
|
|
13
|
-
import {
|
|
13
|
+
import { refreshCompletionsIfStale } from "./commands/completion.js";
|
|
14
14
|
import { showCommandHelp, showHelp, showVerbResources, showVersion, } from "./commands/help.js";
|
|
15
|
-
import { handleAssign, handleUnassign } from "./commands/identity.js";
|
|
16
15
|
import { loadSessionState, resolveTenantId } from "./config.js";
|
|
17
16
|
import { getLogger } from "./logger.js";
|
|
18
17
|
import { executePluginCommand, loadInstalledPlugins } from "./plugin-loader.js";
|
|
@@ -158,19 +157,6 @@ async function main() {
|
|
|
158
157
|
}
|
|
159
158
|
return;
|
|
160
159
|
}
|
|
161
|
-
// Handle completion command
|
|
162
|
-
if (verb === "completion") {
|
|
163
|
-
// Run unknown-flag detection before early return (completion returns
|
|
164
|
-
// before the general detectUnknownFlags call below).
|
|
165
|
-
const completionUnknownFlags = detectUnknownFlags(verb, resource ?? "", values);
|
|
166
|
-
warnUnknownFlags(logger, completionUnknownFlags, verb, resource ?? "");
|
|
167
|
-
if (resource === "install") {
|
|
168
|
-
installCompletion(str(values.shell));
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
showCompletion(resource);
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
160
|
// Normalize resource
|
|
175
161
|
const normalizedResource = resource ? resolveAlias(resource) : "";
|
|
176
162
|
// Resource validation guard — single chokepoint for all verbs that require a resource.
|
|
@@ -195,27 +181,6 @@ async function main() {
|
|
|
195
181
|
// Derived from COMMAND_REGISTRY; resource-scoped for search/list.
|
|
196
182
|
const unknownFlags = detectUnknownFlags(verb, normalizedResource, values);
|
|
197
183
|
warnUnknownFlags(logger, unknownFlags, verb, resource);
|
|
198
|
-
// ── Assign / unassign — legacy delegation (not yet migrated to defineCommand) ──
|
|
199
|
-
if (verb === "assign") {
|
|
200
|
-
if (!args[0]) {
|
|
201
|
-
logger.error(`ID required. Usage: c8 assign ${normalizedResource} <id> --to-<target>=<targetId>`);
|
|
202
|
-
process.exit(1);
|
|
203
|
-
}
|
|
204
|
-
await handleAssign(normalizedResource, args[0], values, {
|
|
205
|
-
profile: str(values.profile),
|
|
206
|
-
});
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
if (verb === "unassign") {
|
|
210
|
-
if (!args[0]) {
|
|
211
|
-
logger.error(`ID required. Usage: c8 unassign ${normalizedResource} <id> --from-<target>=<targetId>`);
|
|
212
|
-
process.exit(1);
|
|
213
|
-
}
|
|
214
|
-
await handleUnassign(normalizedResource, args[0], values, {
|
|
215
|
-
profile: str(values.profile),
|
|
216
|
-
});
|
|
217
|
-
return;
|
|
218
|
-
}
|
|
219
184
|
// ── Registry-driven dispatch ───────────────────────────────────────────
|
|
220
185
|
// For verbs with enumerated resources (e.g. `list process-instance`),
|
|
221
186
|
// the dispatch key includes the normalised resource.
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EACN,gBAAgB,EAEhB,sBAAsB,EACtB,aAAa,EACb,YAAY,GACZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;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