@open-wa/cli 5.0.0-alpha.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/.open-wa/chrome-executable-path.json +4 -0
- package/.turbo/turbo-build.log +20 -0
- package/.turbo/turbo-test.log +20 -0
- package/CHANGELOG.md +23 -0
- package/LICENSE.md +67 -0
- package/README.md +31 -0
- package/dist/bin.cjs +398 -0
- package/dist/bin.d.cts +1 -0
- package/dist/event-projection-store-BM9eOQXx.cjs +497 -0
- package/dist/index.cjs +33 -0
- package/dist/index.d.cts +239 -0
- package/dist/index.d.cts.map +1 -0
- package/package.json +52 -0
- package/src/__tests__/cli-termination.test.ts +50 -0
- package/src/__tests__/event-projection-store.test.ts +64 -0
- package/src/__tests__/interactive-session.test.ts +84 -0
- package/src/__tests__/interactive-terminal.test.ts +80 -0
- package/src/__tests__/output-broker.test.ts +66 -0
- package/src/__tests__/output-mode.test.ts +68 -0
- package/src/__tests__/shutdown-controller.test.ts +73 -0
- package/src/bin.ts +115 -0
- package/src/config/cli-flags-schema.ts +53 -0
- package/src/index.ts +7 -0
- package/src/presenter/interactive-terminal.ts +178 -0
- package/src/runtime/cli-termination.ts +66 -0
- package/src/runtime/interactive-session.ts +64 -0
- package/src/runtime/output-broker.ts +193 -0
- package/src/runtime/output-mode.ts +73 -0
- package/src/runtime/shutdown-controller.ts +86 -0
- package/src/state/event-projection-store.ts +166 -0
- package/src/tunnel-client.ts +169 -0
- package/tsconfig.json +23 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/tsdown.config.ts +8 -0
|
@@ -0,0 +1,497 @@
|
|
|
1
|
+
require("./bin.cjs");
|
|
2
|
+
let zod = require("zod");
|
|
3
|
+
//#region src/config/cli-flags-schema.ts
|
|
4
|
+
const OutputModeOverrideSchema = zod.z.enum(["interactive", "plain"]);
|
|
5
|
+
const CliLocalFlagsSchema = zod.z.object({ outputMode: OutputModeOverrideSchema.optional() });
|
|
6
|
+
function parseCliLocalFlags(argv) {
|
|
7
|
+
const forwardedArgs = [];
|
|
8
|
+
let outputMode;
|
|
9
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
10
|
+
const arg = argv[index];
|
|
11
|
+
if (arg === "--interactive") {
|
|
12
|
+
outputMode = "interactive";
|
|
13
|
+
continue;
|
|
14
|
+
}
|
|
15
|
+
if (arg === "--non-interactive") {
|
|
16
|
+
outputMode = "plain";
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
if (arg === "--output-mode") {
|
|
20
|
+
const value = argv[index + 1];
|
|
21
|
+
outputMode = OutputModeOverrideSchema.parse(value);
|
|
22
|
+
index += 1;
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
const match = arg.match(/^--output-mode=(interactive|plain)$/);
|
|
26
|
+
if (match) {
|
|
27
|
+
outputMode = OutputModeOverrideSchema.parse(match[1]);
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
forwardedArgs.push(arg);
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
flags: CliLocalFlagsSchema.parse({ outputMode }),
|
|
34
|
+
forwardedArgs
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/runtime/output-broker.ts
|
|
39
|
+
function stringifyArgs(args) {
|
|
40
|
+
return args.map((arg) => {
|
|
41
|
+
if (typeof arg === "string") return arg;
|
|
42
|
+
if (arg instanceof Error) return arg.stack ?? arg.message;
|
|
43
|
+
if (typeof arg === "object" && arg !== null) try {
|
|
44
|
+
return JSON.stringify(arg);
|
|
45
|
+
} catch {
|
|
46
|
+
return String(arg);
|
|
47
|
+
}
|
|
48
|
+
return String(arg);
|
|
49
|
+
}).join(" ");
|
|
50
|
+
}
|
|
51
|
+
var OutputBroker = class {
|
|
52
|
+
interactive;
|
|
53
|
+
maxEntries;
|
|
54
|
+
passthrough;
|
|
55
|
+
interceptStreams;
|
|
56
|
+
entries = [];
|
|
57
|
+
subscribers = /* @__PURE__ */ new Set();
|
|
58
|
+
installed = false;
|
|
59
|
+
originalConsole;
|
|
60
|
+
originalWrites;
|
|
61
|
+
constructor(options) {
|
|
62
|
+
this.interactive = options.interactive;
|
|
63
|
+
this.maxEntries = options.maxEntries ?? 200;
|
|
64
|
+
this.passthrough = options.passthrough ?? !options.interactive;
|
|
65
|
+
this.interceptStreams = options.interceptStreams ?? true;
|
|
66
|
+
}
|
|
67
|
+
install() {
|
|
68
|
+
if (this.installed) return;
|
|
69
|
+
this.installed = true;
|
|
70
|
+
this.originalConsole = {
|
|
71
|
+
log: console.log.bind(console),
|
|
72
|
+
warn: console.warn.bind(console),
|
|
73
|
+
error: console.error.bind(console)
|
|
74
|
+
};
|
|
75
|
+
this.originalWrites = {
|
|
76
|
+
stdout: process.stdout.write.bind(process.stdout),
|
|
77
|
+
stderr: process.stderr.write.bind(process.stderr)
|
|
78
|
+
};
|
|
79
|
+
console.log = (...args) => {
|
|
80
|
+
this.forward("info", "console", stringifyArgs(args), () => this.originalConsole?.log(...args));
|
|
81
|
+
};
|
|
82
|
+
console.warn = (...args) => {
|
|
83
|
+
this.forward("warn", "console", stringifyArgs(args), () => this.originalConsole?.warn(...args));
|
|
84
|
+
};
|
|
85
|
+
console.error = (...args) => {
|
|
86
|
+
this.forward("error", "console", stringifyArgs(args), () => this.originalConsole?.error(...args));
|
|
87
|
+
};
|
|
88
|
+
if (this.interceptStreams) {
|
|
89
|
+
process.stdout.write = ((chunk, encoding, callback) => {
|
|
90
|
+
const message = Buffer.isBuffer(chunk) ? chunk.toString("utf8") : String(chunk);
|
|
91
|
+
this.forward("info", "stdout", message, () => this.originalWrites?.stdout(chunk, encoding, callback));
|
|
92
|
+
if (this.interactive && !this.passthrough) if (typeof encoding === "function") encoding(void 0);
|
|
93
|
+
else callback?.(void 0);
|
|
94
|
+
return true;
|
|
95
|
+
});
|
|
96
|
+
process.stderr.write = ((chunk, encoding, callback) => {
|
|
97
|
+
const message = Buffer.isBuffer(chunk) ? chunk.toString("utf8") : String(chunk);
|
|
98
|
+
this.forward("error", "stderr", message, () => this.originalWrites?.stderr(chunk, encoding, callback));
|
|
99
|
+
if (this.interactive && !this.passthrough) if (typeof encoding === "function") encoding(void 0);
|
|
100
|
+
else callback?.(void 0);
|
|
101
|
+
return true;
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
dispose() {
|
|
106
|
+
if (!this.installed) return;
|
|
107
|
+
if (this.originalConsole) {
|
|
108
|
+
console.log = this.originalConsole.log;
|
|
109
|
+
console.warn = this.originalConsole.warn;
|
|
110
|
+
console.error = this.originalConsole.error;
|
|
111
|
+
}
|
|
112
|
+
if (this.originalWrites && this.interceptStreams) {
|
|
113
|
+
process.stdout.write = this.originalWrites.stdout;
|
|
114
|
+
process.stderr.write = this.originalWrites.stderr;
|
|
115
|
+
}
|
|
116
|
+
this.installed = false;
|
|
117
|
+
}
|
|
118
|
+
subscribe(listener) {
|
|
119
|
+
this.subscribers.add(listener);
|
|
120
|
+
return () => {
|
|
121
|
+
this.subscribers.delete(listener);
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
getEntries() {
|
|
125
|
+
return [...this.entries];
|
|
126
|
+
}
|
|
127
|
+
writeRawStdout(message) {
|
|
128
|
+
this.originalWrites?.stdout(message);
|
|
129
|
+
}
|
|
130
|
+
writeRawStderr(message) {
|
|
131
|
+
this.originalWrites?.stderr(message);
|
|
132
|
+
}
|
|
133
|
+
write(level, message, source = "runtime") {
|
|
134
|
+
this.forward(level, source, message);
|
|
135
|
+
}
|
|
136
|
+
forward(level, source, message, passthroughWriter) {
|
|
137
|
+
const entry = {
|
|
138
|
+
level,
|
|
139
|
+
source,
|
|
140
|
+
message,
|
|
141
|
+
timestamp: Date.now()
|
|
142
|
+
};
|
|
143
|
+
this.entries.push(entry);
|
|
144
|
+
if (this.entries.length > this.maxEntries) this.entries.splice(0, this.entries.length - this.maxEntries);
|
|
145
|
+
for (const subscriber of this.subscribers) subscriber(entry);
|
|
146
|
+
if (!this.interactive || this.passthrough) passthroughWriter?.();
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
function createOutputBroker(options) {
|
|
150
|
+
return new OutputBroker(options);
|
|
151
|
+
}
|
|
152
|
+
//#endregion
|
|
153
|
+
//#region src/runtime/cli-termination.ts
|
|
154
|
+
var CliShutdownError = class extends AggregateError {
|
|
155
|
+
constructor(errors, signal) {
|
|
156
|
+
super(errors, `Graceful shutdown completed with ${errors.length} teardown error(s) after ${signal}`);
|
|
157
|
+
this.name = "CliShutdownError";
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
function normalizeError(error, fallback) {
|
|
161
|
+
if (error instanceof Error) return error;
|
|
162
|
+
return /* @__PURE__ */ new Error(`${fallback}: ${String(error)}`);
|
|
163
|
+
}
|
|
164
|
+
async function performGracefulShutdown(state, signal) {
|
|
165
|
+
const { runtime, tunnelClient, store } = state;
|
|
166
|
+
const errors = [];
|
|
167
|
+
store?.projectStatus({
|
|
168
|
+
phase: "shutdown.starting",
|
|
169
|
+
detail: `Received ${signal}`
|
|
170
|
+
});
|
|
171
|
+
if (runtime) try {
|
|
172
|
+
await runtime.server.stop();
|
|
173
|
+
} catch (error) {
|
|
174
|
+
errors.push(normalizeError(error, "server.stop failed"));
|
|
175
|
+
}
|
|
176
|
+
if (tunnelClient) try {
|
|
177
|
+
tunnelClient.disconnect();
|
|
178
|
+
} catch (error) {
|
|
179
|
+
errors.push(normalizeError(error, "tunnel.disconnect failed"));
|
|
180
|
+
}
|
|
181
|
+
if (runtime) try {
|
|
182
|
+
await runtime.client.stop(`signal:${signal}`);
|
|
183
|
+
} catch (error) {
|
|
184
|
+
errors.push(normalizeError(error, "client.stop failed"));
|
|
185
|
+
}
|
|
186
|
+
store?.projectStatus({
|
|
187
|
+
phase: "shutdown.complete",
|
|
188
|
+
detail: `Shutdown completed after ${signal}`
|
|
189
|
+
});
|
|
190
|
+
if (errors.length > 0) throw new CliShutdownError(errors, signal);
|
|
191
|
+
}
|
|
192
|
+
function writeVisibleFatalError(message, writeRawStderr) {
|
|
193
|
+
writeRawStderr(`\nFatal error: ${message}\n`);
|
|
194
|
+
}
|
|
195
|
+
//#endregion
|
|
196
|
+
//#region src/runtime/output-mode.ts
|
|
197
|
+
function detectOutputMode(options = {}) {
|
|
198
|
+
const env = options.env ?? process.env;
|
|
199
|
+
const stdin = options.stdin ?? process.stdin;
|
|
200
|
+
const stdout = options.stdout ?? process.stdout;
|
|
201
|
+
const stderr = options.stderr ?? process.stderr;
|
|
202
|
+
const forcedMode = options.flags?.outputMode;
|
|
203
|
+
if (forcedMode === "plain") return {
|
|
204
|
+
kind: "plain",
|
|
205
|
+
interactive: false,
|
|
206
|
+
reason: "flag.plain"
|
|
207
|
+
};
|
|
208
|
+
if (!stdin.isTTY) return {
|
|
209
|
+
kind: "plain",
|
|
210
|
+
interactive: false,
|
|
211
|
+
reason: "stdin-not-tty"
|
|
212
|
+
};
|
|
213
|
+
if (!stdout.isTTY) return {
|
|
214
|
+
kind: "plain",
|
|
215
|
+
interactive: false,
|
|
216
|
+
reason: "stdout-not-tty"
|
|
217
|
+
};
|
|
218
|
+
if (!stderr.isTTY) return {
|
|
219
|
+
kind: "plain",
|
|
220
|
+
interactive: false,
|
|
221
|
+
reason: "stderr-not-tty"
|
|
222
|
+
};
|
|
223
|
+
if (env.TERM === "dumb") return {
|
|
224
|
+
kind: "plain",
|
|
225
|
+
interactive: false,
|
|
226
|
+
reason: "term-dumb"
|
|
227
|
+
};
|
|
228
|
+
if (env.OPEN_WA_NON_INTERACTIVE === "1") return {
|
|
229
|
+
kind: "plain",
|
|
230
|
+
interactive: false,
|
|
231
|
+
reason: "env.non-interactive"
|
|
232
|
+
};
|
|
233
|
+
if (env.CI) return {
|
|
234
|
+
kind: "plain",
|
|
235
|
+
interactive: false,
|
|
236
|
+
reason: "ci"
|
|
237
|
+
};
|
|
238
|
+
if (env.NO_COLOR) return {
|
|
239
|
+
kind: "plain",
|
|
240
|
+
interactive: false,
|
|
241
|
+
reason: "no-color"
|
|
242
|
+
};
|
|
243
|
+
if (forcedMode === "interactive") return {
|
|
244
|
+
kind: "interactive",
|
|
245
|
+
interactive: true,
|
|
246
|
+
reason: "flag.interactive"
|
|
247
|
+
};
|
|
248
|
+
return {
|
|
249
|
+
kind: "interactive",
|
|
250
|
+
interactive: true,
|
|
251
|
+
reason: "tty-ready"
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
//#endregion
|
|
255
|
+
//#region src/runtime/shutdown-controller.ts
|
|
256
|
+
var ShutdownController = class {
|
|
257
|
+
timeoutMs;
|
|
258
|
+
gracefulShutdown;
|
|
259
|
+
cleanup;
|
|
260
|
+
exit;
|
|
261
|
+
installed = false;
|
|
262
|
+
shuttingDown = false;
|
|
263
|
+
cleanupStarted = false;
|
|
264
|
+
boundSignals = /* @__PURE__ */ new Map();
|
|
265
|
+
constructor(options) {
|
|
266
|
+
this.timeoutMs = options.timeoutMs ?? 1e4;
|
|
267
|
+
this.gracefulShutdown = options.gracefulShutdown;
|
|
268
|
+
this.cleanup = options.cleanup;
|
|
269
|
+
this.exit = options.exit ?? ((code) => process.exit(code));
|
|
270
|
+
}
|
|
271
|
+
install(signals = ["SIGINT", "SIGTERM"]) {
|
|
272
|
+
if (this.installed) return;
|
|
273
|
+
for (const signal of signals) {
|
|
274
|
+
const handler = () => {
|
|
275
|
+
this.handleSignal(signal);
|
|
276
|
+
};
|
|
277
|
+
this.boundSignals.set(signal, handler);
|
|
278
|
+
process.on(signal, handler);
|
|
279
|
+
}
|
|
280
|
+
this.installed = true;
|
|
281
|
+
}
|
|
282
|
+
dispose() {
|
|
283
|
+
for (const [signal, handler] of this.boundSignals.entries()) process.off(signal, handler);
|
|
284
|
+
this.boundSignals.clear();
|
|
285
|
+
this.installed = false;
|
|
286
|
+
}
|
|
287
|
+
async handleSignal(signal) {
|
|
288
|
+
if (this.shuttingDown) {
|
|
289
|
+
await this.runCleanup();
|
|
290
|
+
this.exit(1);
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
this.shuttingDown = true;
|
|
294
|
+
try {
|
|
295
|
+
await Promise.race([this.gracefulShutdown(signal), new Promise((_, reject) => {
|
|
296
|
+
setTimeout(() => reject(/* @__PURE__ */ new Error(`Graceful shutdown timed out after ${this.timeoutMs}ms`)), this.timeoutMs);
|
|
297
|
+
})]);
|
|
298
|
+
await this.runCleanup();
|
|
299
|
+
this.exit(0);
|
|
300
|
+
} catch {
|
|
301
|
+
await this.runCleanup();
|
|
302
|
+
this.exit(1);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
async runCleanup() {
|
|
306
|
+
if (this.cleanupStarted) return;
|
|
307
|
+
this.cleanupStarted = true;
|
|
308
|
+
await this.cleanup?.();
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
function createShutdownController(options) {
|
|
312
|
+
return new ShutdownController(options);
|
|
313
|
+
}
|
|
314
|
+
//#endregion
|
|
315
|
+
//#region src/state/event-projection-store.ts
|
|
316
|
+
var EventProjectionStore = class {
|
|
317
|
+
maxLogs;
|
|
318
|
+
eventDebounceMs;
|
|
319
|
+
listeners = /* @__PURE__ */ new Set();
|
|
320
|
+
state = {
|
|
321
|
+
phase: "boot",
|
|
322
|
+
recentLogs: [],
|
|
323
|
+
messageCount: 0,
|
|
324
|
+
ackCount: 0,
|
|
325
|
+
ready: false
|
|
326
|
+
};
|
|
327
|
+
pendingMessageCount = 0;
|
|
328
|
+
pendingAckCount = 0;
|
|
329
|
+
flushTimer;
|
|
330
|
+
constructor(options = {}) {
|
|
331
|
+
this.maxLogs = options.maxLogs ?? 200;
|
|
332
|
+
this.eventDebounceMs = options.eventDebounceMs ?? 100;
|
|
333
|
+
}
|
|
334
|
+
subscribe(listener) {
|
|
335
|
+
this.listeners.add(listener);
|
|
336
|
+
listener(this.getSnapshot());
|
|
337
|
+
return () => {
|
|
338
|
+
this.listeners.delete(listener);
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
getSnapshot() {
|
|
342
|
+
return {
|
|
343
|
+
...this.state,
|
|
344
|
+
recentLogs: [...this.state.recentLogs]
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
projectLog(entry) {
|
|
348
|
+
this.state.recentLogs.push(entry);
|
|
349
|
+
if (this.state.recentLogs.length > this.maxLogs) this.state.recentLogs.splice(0, this.state.recentLogs.length - this.maxLogs);
|
|
350
|
+
this.emit();
|
|
351
|
+
}
|
|
352
|
+
projectStatus(update) {
|
|
353
|
+
this.state.phase = update.phase;
|
|
354
|
+
this.state.sessionId = update.sessionId ?? this.state.sessionId;
|
|
355
|
+
this.state.detail = update.detail;
|
|
356
|
+
if (update.phase === "client.ready") this.state.ready = true;
|
|
357
|
+
if (update.phase === "shutdown.starting") this.state.ready = false;
|
|
358
|
+
this.emit();
|
|
359
|
+
}
|
|
360
|
+
projectQr(payload) {
|
|
361
|
+
this.state.phase = "auth.qr";
|
|
362
|
+
this.state.qr = payload;
|
|
363
|
+
this.state.sessionId = payload.sessionId;
|
|
364
|
+
this.emit();
|
|
365
|
+
}
|
|
366
|
+
attachEmitter(emitter) {
|
|
367
|
+
const handlers = [
|
|
368
|
+
["core.starting", () => {
|
|
369
|
+
this.state.phase = "boot";
|
|
370
|
+
this.state.lastEventAt = Date.now();
|
|
371
|
+
this.emit();
|
|
372
|
+
}],
|
|
373
|
+
["core.stopping", () => {
|
|
374
|
+
this.state.phase = "shutdown.starting";
|
|
375
|
+
this.state.ready = false;
|
|
376
|
+
this.state.lastEventAt = Date.now();
|
|
377
|
+
this.emit();
|
|
378
|
+
}],
|
|
379
|
+
["core.stopped", () => {
|
|
380
|
+
this.state.phase = "shutdown.complete";
|
|
381
|
+
this.state.lastEventAt = Date.now();
|
|
382
|
+
this.emit();
|
|
383
|
+
}],
|
|
384
|
+
["client.ready", () => {
|
|
385
|
+
this.state.phase = "client.ready";
|
|
386
|
+
this.state.ready = true;
|
|
387
|
+
this.state.lastEventAt = Date.now();
|
|
388
|
+
this.emit();
|
|
389
|
+
}],
|
|
390
|
+
["launch.auth.qr.generated", (payload) => {
|
|
391
|
+
const qr = payload?.details?.qr;
|
|
392
|
+
if (typeof qr === "string" && this.state.sessionId) this.projectQr({
|
|
393
|
+
qr,
|
|
394
|
+
sessionId: this.state.sessionId
|
|
395
|
+
});
|
|
396
|
+
}],
|
|
397
|
+
["message.received", () => {
|
|
398
|
+
this.pendingMessageCount += 1;
|
|
399
|
+
this.scheduleFlush();
|
|
400
|
+
}],
|
|
401
|
+
["ack.changed", () => {
|
|
402
|
+
this.pendingAckCount += 1;
|
|
403
|
+
this.scheduleFlush();
|
|
404
|
+
}]
|
|
405
|
+
];
|
|
406
|
+
for (const [event, handler] of handlers) emitter.on(event, handler);
|
|
407
|
+
return () => {
|
|
408
|
+
for (const [event, handler] of handlers) emitter.off(event, handler);
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
scheduleFlush() {
|
|
412
|
+
if (this.flushTimer) return;
|
|
413
|
+
this.flushTimer = setTimeout(() => {
|
|
414
|
+
this.flushTimer = void 0;
|
|
415
|
+
this.state.messageCount += this.pendingMessageCount;
|
|
416
|
+
this.state.ackCount += this.pendingAckCount;
|
|
417
|
+
this.pendingMessageCount = 0;
|
|
418
|
+
this.pendingAckCount = 0;
|
|
419
|
+
this.state.lastEventAt = Date.now();
|
|
420
|
+
this.emit();
|
|
421
|
+
}, this.eventDebounceMs);
|
|
422
|
+
}
|
|
423
|
+
emit() {
|
|
424
|
+
const snapshot = this.getSnapshot();
|
|
425
|
+
for (const listener of this.listeners) listener(snapshot);
|
|
426
|
+
}
|
|
427
|
+
};
|
|
428
|
+
function createEventProjectionStore(options = {}) {
|
|
429
|
+
return new EventProjectionStore(options);
|
|
430
|
+
}
|
|
431
|
+
//#endregion
|
|
432
|
+
Object.defineProperty(exports, "CliShutdownError", {
|
|
433
|
+
enumerable: true,
|
|
434
|
+
get: function() {
|
|
435
|
+
return CliShutdownError;
|
|
436
|
+
}
|
|
437
|
+
});
|
|
438
|
+
Object.defineProperty(exports, "EventProjectionStore", {
|
|
439
|
+
enumerable: true,
|
|
440
|
+
get: function() {
|
|
441
|
+
return EventProjectionStore;
|
|
442
|
+
}
|
|
443
|
+
});
|
|
444
|
+
Object.defineProperty(exports, "OutputBroker", {
|
|
445
|
+
enumerable: true,
|
|
446
|
+
get: function() {
|
|
447
|
+
return OutputBroker;
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
Object.defineProperty(exports, "ShutdownController", {
|
|
451
|
+
enumerable: true,
|
|
452
|
+
get: function() {
|
|
453
|
+
return ShutdownController;
|
|
454
|
+
}
|
|
455
|
+
});
|
|
456
|
+
Object.defineProperty(exports, "createEventProjectionStore", {
|
|
457
|
+
enumerable: true,
|
|
458
|
+
get: function() {
|
|
459
|
+
return createEventProjectionStore;
|
|
460
|
+
}
|
|
461
|
+
});
|
|
462
|
+
Object.defineProperty(exports, "createOutputBroker", {
|
|
463
|
+
enumerable: true,
|
|
464
|
+
get: function() {
|
|
465
|
+
return createOutputBroker;
|
|
466
|
+
}
|
|
467
|
+
});
|
|
468
|
+
Object.defineProperty(exports, "createShutdownController", {
|
|
469
|
+
enumerable: true,
|
|
470
|
+
get: function() {
|
|
471
|
+
return createShutdownController;
|
|
472
|
+
}
|
|
473
|
+
});
|
|
474
|
+
Object.defineProperty(exports, "detectOutputMode", {
|
|
475
|
+
enumerable: true,
|
|
476
|
+
get: function() {
|
|
477
|
+
return detectOutputMode;
|
|
478
|
+
}
|
|
479
|
+
});
|
|
480
|
+
Object.defineProperty(exports, "parseCliLocalFlags", {
|
|
481
|
+
enumerable: true,
|
|
482
|
+
get: function() {
|
|
483
|
+
return parseCliLocalFlags;
|
|
484
|
+
}
|
|
485
|
+
});
|
|
486
|
+
Object.defineProperty(exports, "performGracefulShutdown", {
|
|
487
|
+
enumerable: true,
|
|
488
|
+
get: function() {
|
|
489
|
+
return performGracefulShutdown;
|
|
490
|
+
}
|
|
491
|
+
});
|
|
492
|
+
Object.defineProperty(exports, "writeVisibleFatalError", {
|
|
493
|
+
enumerable: true,
|
|
494
|
+
get: function() {
|
|
495
|
+
return writeVisibleFatalError;
|
|
496
|
+
}
|
|
497
|
+
});
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_event_projection_store = require("./event-projection-store-BM9eOQXx.cjs");
|
|
3
|
+
require("./bin.cjs");
|
|
4
|
+
let _open_wa_wa_automate = require("@open-wa/wa-automate");
|
|
5
|
+
exports.CliShutdownError = require_event_projection_store.CliShutdownError;
|
|
6
|
+
exports.EventProjectionStore = require_event_projection_store.EventProjectionStore;
|
|
7
|
+
exports.OutputBroker = require_event_projection_store.OutputBroker;
|
|
8
|
+
exports.ShutdownController = require_event_projection_store.ShutdownController;
|
|
9
|
+
exports.createEventProjectionStore = require_event_projection_store.createEventProjectionStore;
|
|
10
|
+
exports.createOutputBroker = require_event_projection_store.createOutputBroker;
|
|
11
|
+
exports.createShutdownController = require_event_projection_store.createShutdownController;
|
|
12
|
+
exports.detectOutputMode = require_event_projection_store.detectOutputMode;
|
|
13
|
+
Object.defineProperty(exports, "main", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function() {
|
|
16
|
+
return _open_wa_wa_automate.runCli;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports, "parseCliArgs", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function() {
|
|
22
|
+
return _open_wa_wa_automate.parseCliArgs;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
exports.parseCliLocalFlags = require_event_projection_store.parseCliLocalFlags;
|
|
26
|
+
exports.performGracefulShutdown = require_event_projection_store.performGracefulShutdown;
|
|
27
|
+
Object.defineProperty(exports, "start", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function() {
|
|
30
|
+
return _open_wa_wa_automate.startCli;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
exports.writeVisibleFatalError = require_event_projection_store.writeVisibleFatalError;
|