@open-wa/cli 5.13.0 → 5.14.1
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
CHANGED
package/dist/bin.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
// \0rolldown/runtime.js
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -20,12 +20,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
20
20
|
value: mod,
|
|
21
21
|
enumerable: true
|
|
22
22
|
}) : target, mod));
|
|
23
|
-
//#endregion
|
|
24
|
-
const require_event_projection_store = require("./event-projection-store-C-W1A_Mi.cjs");
|
|
25
23
|
let _open_wa_wa_automate = require("@open-wa/wa-automate");
|
|
24
|
+
const require_event_projection_store = require("./event-projection-store-CA94wvtg.cjs");
|
|
26
25
|
let qrcode = require("qrcode");
|
|
27
26
|
qrcode = __toESM(qrcode, 1);
|
|
28
|
-
|
|
27
|
+
// src/presenter/interactive-terminal.ts
|
|
29
28
|
var InteractiveTerminalPresenter = class {
|
|
30
29
|
store;
|
|
31
30
|
stdout;
|
|
@@ -138,8 +137,7 @@ var InteractiveTerminalPresenter = class {
|
|
|
138
137
|
this.qrAscii = qrAscii;
|
|
139
138
|
}
|
|
140
139
|
};
|
|
141
|
-
|
|
142
|
-
//#region src/runtime/interactive-session.ts
|
|
140
|
+
// src/runtime/interactive-session.ts
|
|
143
141
|
function createBrokeredSink(broker, store, presenter) {
|
|
144
142
|
return {
|
|
145
143
|
promptChoice(question, choices) {
|
|
@@ -190,8 +188,7 @@ async function createInteractiveCliSession() {
|
|
|
190
188
|
}
|
|
191
189
|
};
|
|
192
190
|
}
|
|
193
|
-
|
|
194
|
-
//#region src/bin.ts
|
|
191
|
+
// src/bin.ts
|
|
195
192
|
async function main() {
|
|
196
193
|
const parsedLocalFlags = require_event_projection_store.parseCliLocalFlags(process.argv.slice(2));
|
|
197
194
|
const outputMode = require_event_projection_store.detectOutputMode({ flags: parsedLocalFlags.flags });
|
|
@@ -254,4 +251,3 @@ async function main() {
|
|
|
254
251
|
}
|
|
255
252
|
}
|
|
256
253
|
main();
|
|
257
|
-
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
let zod = require("zod");
|
|
2
|
-
|
|
2
|
+
// src/config/cli-flags-schema.ts
|
|
3
3
|
const OutputModeOverrideSchema = zod.z.enum(["interactive", "plain"]);
|
|
4
4
|
const CliLocalFlagsSchema = zod.z.object({ outputMode: OutputModeOverrideSchema.optional() });
|
|
5
5
|
function parseCliLocalFlags(argv) {
|
|
@@ -34,8 +34,7 @@ function parseCliLocalFlags(argv) {
|
|
|
34
34
|
forwardedArgs
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
|
|
38
|
-
//#region src/runtime/output-broker.ts
|
|
37
|
+
// src/runtime/output-broker.ts
|
|
39
38
|
function stringifyArgs(args) {
|
|
40
39
|
return args.map((arg) => {
|
|
41
40
|
if (typeof arg === "string") return arg;
|
|
@@ -153,8 +152,7 @@ var OutputBroker = class {
|
|
|
153
152
|
function createOutputBroker(options) {
|
|
154
153
|
return new OutputBroker(options);
|
|
155
154
|
}
|
|
156
|
-
|
|
157
|
-
//#region src/runtime/cli-termination.ts
|
|
155
|
+
// src/runtime/cli-termination.ts
|
|
158
156
|
var CliShutdownError = class extends AggregateError {
|
|
159
157
|
constructor(errors, signal) {
|
|
160
158
|
super(errors, `Graceful shutdown completed with ${errors.length} teardown error(s) after ${signal}`);
|
|
@@ -201,8 +199,7 @@ async function performGracefulShutdown(state, signal) {
|
|
|
201
199
|
function writeVisibleFatalError(message, writeRawStderr) {
|
|
202
200
|
writeRawStderr(`\nFatal error: ${message}\n`);
|
|
203
201
|
}
|
|
204
|
-
|
|
205
|
-
//#region src/runtime/output-mode.ts
|
|
202
|
+
// src/runtime/output-mode.ts
|
|
206
203
|
function detectOutputMode(options = {}) {
|
|
207
204
|
const env = options.env ?? process.env;
|
|
208
205
|
const stdin = options.stdin ?? process.stdin;
|
|
@@ -260,8 +257,7 @@ function detectOutputMode(options = {}) {
|
|
|
260
257
|
reason: "tty-ready"
|
|
261
258
|
};
|
|
262
259
|
}
|
|
263
|
-
|
|
264
|
-
//#region src/runtime/shutdown-controller.ts
|
|
260
|
+
// src/runtime/shutdown-controller.ts
|
|
265
261
|
var ShutdownController = class {
|
|
266
262
|
timeoutMs;
|
|
267
263
|
gracefulShutdown;
|
|
@@ -320,8 +316,7 @@ var ShutdownController = class {
|
|
|
320
316
|
function createShutdownController(options) {
|
|
321
317
|
return new ShutdownController(options);
|
|
322
318
|
}
|
|
323
|
-
|
|
324
|
-
//#region src/state/event-projection-store.ts
|
|
319
|
+
// src/state/event-projection-store.ts
|
|
325
320
|
var EventProjectionStore = class {
|
|
326
321
|
maxLogs;
|
|
327
322
|
eventDebounceMs;
|
|
@@ -437,7 +432,6 @@ var EventProjectionStore = class {
|
|
|
437
432
|
function createEventProjectionStore(options = {}) {
|
|
438
433
|
return new EventProjectionStore(options);
|
|
439
434
|
}
|
|
440
|
-
//#endregion
|
|
441
435
|
Object.defineProperty(exports, "CliShutdownError", {
|
|
442
436
|
enumerable: true,
|
|
443
437
|
get: function() {
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_event_projection_store = require("./event-projection-store-C-W1A_Mi.cjs");
|
|
3
2
|
let _open_wa_wa_automate = require("@open-wa/wa-automate");
|
|
3
|
+
const require_event_projection_store = require("./event-projection-store-CA94wvtg.cjs");
|
|
4
4
|
exports.CliShutdownError = require_event_projection_store.CliShutdownError;
|
|
5
5
|
exports.EventProjectionStore = require_event_projection_store.EventProjectionStore;
|
|
6
6
|
exports.OutputBroker = require_event_projection_store.OutputBroker;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { CliQrPayload, CliRuntimeResult, CliStatusUpdate, parseCliArgs, runCli as main, startCli as start } from "@open-wa/wa-automate";
|
|
2
1
|
import { z } from "zod";
|
|
2
|
+
import { CliQrPayload, CliRuntimeResult, CliStatusUpdate, parseCliArgs, runCli as main, startCli as start } from "@open-wa/wa-automate";
|
|
3
3
|
import { HyperEmitter } from "@open-wa/hyperemitter";
|
|
4
4
|
import { OpenWAEventMap } from "@open-wa/core";
|
|
5
|
-
//#region src/config/cli-flags-schema.d.ts
|
|
6
5
|
declare const CliLocalFlagsSchema: z.ZodObject<{
|
|
7
6
|
outputMode: z.ZodOptional<z.ZodEnum<{
|
|
8
7
|
interactive: "interactive";
|
|
@@ -15,8 +14,6 @@ interface ParsedCliLocalFlags {
|
|
|
15
14
|
forwardedArgs: string[];
|
|
16
15
|
}
|
|
17
16
|
export declare function parseCliLocalFlags(argv: string[]): ParsedCliLocalFlags;
|
|
18
|
-
//#endregion
|
|
19
|
-
//#region src/runtime/output-broker.d.ts
|
|
20
17
|
type BrokerLevel = 'debug' | 'info' | 'warn' | 'error';
|
|
21
18
|
type BrokerSource = 'console' | 'stdout' | 'stderr' | 'runtime';
|
|
22
19
|
interface BrokerEntry {
|
|
@@ -54,8 +51,6 @@ export declare class OutputBroker {
|
|
|
54
51
|
private forward;
|
|
55
52
|
}
|
|
56
53
|
export declare function createOutputBroker(options: OutputBrokerOptions): OutputBroker;
|
|
57
|
-
//#endregion
|
|
58
|
-
//#region src/state/event-projection-store.d.ts
|
|
59
54
|
interface ProjectionSnapshot {
|
|
60
55
|
phase: string;
|
|
61
56
|
sessionId?: string;
|
|
@@ -91,8 +86,6 @@ export declare class EventProjectionStore {
|
|
|
91
86
|
private emit;
|
|
92
87
|
}
|
|
93
88
|
export declare function createEventProjectionStore(options?: EventProjectionStoreOptions): EventProjectionStore;
|
|
94
|
-
//#endregion
|
|
95
|
-
//#region src/runtime/cli-termination.d.ts
|
|
96
89
|
interface ShutdownRuntimeState {
|
|
97
90
|
runtime?: CliRuntimeResult;
|
|
98
91
|
tunnelClient?: {
|
|
@@ -105,8 +98,6 @@ export declare class CliShutdownError extends AggregateError {
|
|
|
105
98
|
}
|
|
106
99
|
export declare function performGracefulShutdown(state: ShutdownRuntimeState, signal: NodeJS.Signals): Promise<void>;
|
|
107
100
|
export declare function writeVisibleFatalError(message: string, writeRawStderr: (message: string) => void): void;
|
|
108
|
-
//#endregion
|
|
109
|
-
//#region src/runtime/output-mode.d.ts
|
|
110
101
|
type OutputModeKind = 'interactive' | 'plain';
|
|
111
102
|
interface OutputModeContract {
|
|
112
103
|
kind: OutputModeKind;
|
|
@@ -121,8 +112,6 @@ interface DetectOutputModeOptions {
|
|
|
121
112
|
stderr?: Pick<NodeJS.WriteStream, 'isTTY'>;
|
|
122
113
|
}
|
|
123
114
|
export declare function detectOutputMode(options?: DetectOutputModeOptions): OutputModeContract;
|
|
124
|
-
//#endregion
|
|
125
|
-
//#region src/runtime/shutdown-controller.d.ts
|
|
126
115
|
interface ShutdownControllerOptions {
|
|
127
116
|
timeoutMs?: number;
|
|
128
117
|
gracefulShutdown: (signal: NodeJS.Signals) => Promise<void>;
|
|
@@ -145,6 +134,5 @@ export declare class ShutdownController {
|
|
|
145
134
|
private runCleanup;
|
|
146
135
|
}
|
|
147
136
|
export declare function createShutdownController(options: ShutdownControllerOptions): ShutdownController;
|
|
148
|
-
//#endregion
|
|
149
137
|
export { main, parseCliArgs, start };
|
|
150
138
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/config/cli-flags-schema.ts","../src/runtime/output-broker.ts","../src/state/event-projection-store.ts","../src/runtime/cli-termination.ts","../src/runtime/output-mode.ts","../src/runtime/shutdown-controller.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/config/cli-flags-schema.ts","../src/runtime/output-broker.ts","../src/state/event-projection-store.ts","../src/runtime/cli-termination.ts","../src/runtime/output-mode.ts","../src/runtime/shutdown-controller.ts"],"mappings":";;;;cAIa,qBAAmB,EAAA;;;;;GAE9B,EAAA,KAAA;KAEU,gBAAgB,EAAE,aAAa;UAE1B;EACf,OAAO;EACP;;wBAGc,mBAAmB,iBAAiB;KCfxC;KACA;UAEK;EACf,OAAO;EACP;EACA,QAAQ;EACR;;UAGe;EACf;EACA;EACA;EACA;;KAGG,cAAc,OAAO;qBA4Bb;mBACM;mBACA;mBACA;mBACA;mBACA;mBACA;UACT;UACA;UAKA;EAKR,YAAY,SAAS;EAOrB;EAgCA;EAmBA,UAAU,UAAU;EAOpB,cAAc;EAId,eAAe;EAIf,eAAe;EAIf,MAAM,OAAO,aAAa,iBAAiB,SAAQ;UAI3C;UAiCA;;wBAuBM,mBAAmB,SAAS,sBAAsB;UCnMjD;EACf;EACA;EACA;EACA,KAAK;EACL,YAAY;EACZ;EACA;EACA;EACA;;UAGe;EACf;EACA;;KAGG,sBAAsB,UAAU;qBAGxB;mBACM;mBACA;mBACA;mBACA;UAOT;UACA;UACA;EAER,YAAY,UAAS;EAKrB,UAAU,UAAU;EAQpB,eAAe;EAOf,WAAW,OAAO;EAQlB,cAAc,QAAQ;EAatB,UAAU,SAAS;EAOnB,cAAc,SAAS,aAAa;UAmD5B;UAgBA;;wBAQM,2BAA2B,UAAS,8BAAmC;UChKtE;EACf,UAAU;EACV;IACE;;EAEF,QAAQ;;qBAGG,yBAAyB;EACpC,YAAY,QAAQ,SAAS,QAAQ,OAAO;;wBAcxB,wBAAwB,OAAO,sBAAsB,QAAQ,OAAO,UAAU;wBA6CpF,uBAAuB,iBAAiB,iBAAiB;KCrE7D;UAEK;EACf,MAAM;EACN;EACA;;UAae;EACf,QAAQ;EACR,MAAM,OAAO;EACb,QAAQ,KAAK,OAAO;EACpB,SAAS,KAAK,OAAO;EACrB,SAAS,KAAK,OAAO;;wBAGP,iBAAiB,UAAS,0BAA+B;UC5BxD;EACf;EACA,mBAAmB,QAAQ,OAAO,YAAY;EAC9C,uBAAuB;EACvB,QAAQ;;qBAGG;mBACM;mBACA;mBACA;mBACA;UACT;UACA;UACA;mBACS;EAEjB,YAAY,SAAS;EAOrB,QAAQ,UAAS,OAAO;EAgBxB;EAQM,aAAa,QAAQ,OAAO,UAAU;UAyB9B;;wBAUA,yBAAyB,SAAS,4BAA4B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-wa/cli",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.14.1",
|
|
4
4
|
"description": "CLI for @open-wa WhatsApp automation - Easy API mode",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.cjs",
|
|
@@ -18,21 +18,21 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@open-wa/core": "5.
|
|
22
|
-
"@open-wa/hyperemitter": "5.
|
|
23
|
-
"@open-wa/wa-automate": "5.
|
|
24
|
-
"ink": "^
|
|
21
|
+
"@open-wa/core": "5.14.1",
|
|
22
|
+
"@open-wa/hyperemitter": "5.14.1",
|
|
23
|
+
"@open-wa/wa-automate": "5.14.1",
|
|
24
|
+
"ink": "^8.0.0",
|
|
25
25
|
"qrcode": "^1.5.4",
|
|
26
|
-
"react": "^19.3.
|
|
27
|
-
"zod": "^4.6.
|
|
26
|
+
"react": "^19.3.1",
|
|
27
|
+
"zod": "^4.6.7"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@types/node": "^26.6.
|
|
30
|
+
"@types/node": "^26.6.6",
|
|
31
31
|
"@types/qrcode": "^1.5.6",
|
|
32
32
|
"@types/react": "^19.3.0",
|
|
33
|
-
"@types/ws": "^8.18.
|
|
33
|
+
"@types/ws": "^8.18.2",
|
|
34
34
|
"typescript": "^7.0.2",
|
|
35
|
-
"vitest": "5.
|
|
35
|
+
"vitest": "5.1.1"
|
|
36
36
|
},
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|