@qontinui/ui-bridge-wrapper 0.4.1 → 0.5.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/README.md +12 -4
- package/dist/capture-specs-cli.cjs +56 -26
- package/dist/capture-specs-cli.cjs.map +1 -1
- package/dist/cli-args.d.ts +11 -1
- package/dist/cli-args.d.ts.map +1 -1
- package/dist/index.cjs +43 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +43 -16
- package/dist/index.js.map +1 -1
- package/dist/inject-cli.cjs +145 -29
- package/dist/inject-cli.cjs.map +1 -1
- package/dist/inject-cli.d.ts +29 -1
- package/dist/inject-cli.d.ts.map +1 -1
- package/dist/login-drive.d.ts.map +1 -1
- package/dist/login-web-cli.cjs +184 -34
- package/dist/login-web-cli.cjs.map +1 -1
- package/dist/login-web-cli.d.ts +5 -1
- package/dist/login-web-cli.d.ts.map +1 -1
- package/dist/react/index.cjs +4 -4
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +4 -4
- package/dist/react/index.js.map +1 -1
- package/dist/session-storage-capture.d.ts +78 -0
- package/dist/session-storage-capture.d.ts.map +1 -0
- package/dist/transports/headless.d.ts +16 -0
- package/dist/transports/headless.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/cli-args.d.ts
CHANGED
|
@@ -32,6 +32,14 @@ export declare const COMMON_FLAGS: ReadonlySet<string>;
|
|
|
32
32
|
* value, it's an omitted argument.
|
|
33
33
|
*/
|
|
34
34
|
export declare function consumeValue(flag: string, raw: string | undefined, error: ArgErrorFactory): string | null;
|
|
35
|
+
/**
|
|
36
|
+
* Reject a present-but-empty value (`--success ''`). An empty value on a
|
|
37
|
+
* matching/target flag is never intended — e.g. an empty `--success` makes
|
|
38
|
+
* `landingPath.includes('')` true on ANY landing page, turning a stuck login
|
|
39
|
+
* into a false success (the exact exit-code-trust failure #83 exists to
|
|
40
|
+
* prevent). `null` (flag absent — caller defaults it) passes through.
|
|
41
|
+
*/
|
|
42
|
+
export declare function rejectEmptyValue(flag: string, value: string | null, error: ArgErrorFactory): string | null;
|
|
35
43
|
/**
|
|
36
44
|
* An `indexOf`-based reader for the browser bins' flat arg lists. Rejects unknown
|
|
37
45
|
* `--flags` up front (matching each bin's prior behavior) and rejects flag-shaped
|
|
@@ -51,7 +59,9 @@ export declare class ArgReader {
|
|
|
51
59
|
/**
|
|
52
60
|
* Value following the value-flag `name`, or `null` when the flag is absent OR
|
|
53
61
|
* has no following token (the caller defaults it). Throws when the following
|
|
54
|
-
* token is flag-shaped — the swallow this kit exists to kill.
|
|
62
|
+
* token is flag-shaped — the swallow this kit exists to kill. Delegates to
|
|
63
|
+
* {@link consumeValue} so the guard (and its message) live in exactly one
|
|
64
|
+
* place for both the indexOf-style and switch-style parsers.
|
|
55
65
|
*/
|
|
56
66
|
value(name: string): string | null;
|
|
57
67
|
}
|
package/dist/cli-args.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-args.d.ts","sourceRoot":"","sources":["../src/cli-args.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,KAAK,CAAC;AAEzD;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,MAAM,CAAwC,CAAC;AAWtF;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,KAAK,EAAE,eAAe,GACrB,MAAM,GAAG,IAAI,CAMf;AAED;;;;GAIG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAoB;IACzC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkB;IAExC;;;;OAIG;gBACS,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,KAAK,EAAE,WAAW,CAAC,MAAM,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222,36 +222,63 @@ var HeadlessTransport = class extends BaseTransport {
|
|
|
222
222
|
uiBridgeBase: typeof raw["uiBridgeBase"] === "string" ? raw["uiBridgeBase"] : void 0,
|
|
223
223
|
waitForUiBridgeMs: typeof raw["waitForUiBridgeMs"] === "number" ? raw["waitForUiBridgeMs"] : void 0,
|
|
224
224
|
userAgent: typeof raw["userAgent"] === "string" ? raw["userAgent"] : void 0,
|
|
225
|
-
forwardConsole: typeof raw["forwardConsole"] === "boolean" ? raw["forwardConsole"] : void 0
|
|
225
|
+
forwardConsole: typeof raw["forwardConsole"] === "boolean" ? raw["forwardConsole"] : void 0,
|
|
226
|
+
launchArgs: Array.isArray(raw["launchArgs"]) && raw["launchArgs"].every((a) => typeof a === "string") ? raw["launchArgs"] : void 0,
|
|
227
|
+
storageStatePath: typeof raw["storageStatePath"] === "string" ? raw["storageStatePath"] : void 0
|
|
226
228
|
};
|
|
227
229
|
}
|
|
228
230
|
async onReady() {
|
|
229
231
|
let launchHeadlessTab;
|
|
232
|
+
const headlessSpecifier = "@qontinui/ui-bridge-headless";
|
|
230
233
|
try {
|
|
231
|
-
|
|
234
|
+
const mod = await import(headlessSpecifier);
|
|
235
|
+
({ launchHeadlessTab } = mod);
|
|
232
236
|
} catch (err) {
|
|
233
237
|
const cause = err instanceof Error ? err.message : String(err);
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
238
|
+
const code = err?.code;
|
|
239
|
+
if (code === "ERR_MODULE_NOT_FOUND" || code === "MODULE_NOT_FOUND") {
|
|
240
|
+
throw new WrapperTransportError(
|
|
241
|
+
"INVALID_CONFIG",
|
|
242
|
+
`Transport kind '${this.kind}' needs the optional '@qontinui/ui-bridge-headless' peer, which is not installed. Install it and the Chromium browser:
|
|
237
243
|
npm i @qontinui/ui-bridge-headless && npx playwright install chromium
|
|
238
244
|
(bare \`npx @qontinui/ui-bridge-wrapper \u2026\` does NOT install peers \u2014 pass each peer with \`-p\`, e.g.
|
|
239
245
|
npx -y -p @qontinui/ui-bridge-wrapper -p @qontinui/ui-bridge -p @qontinui/ui-bridge-headless -p playwright ui-bridge-login-web \u2026)
|
|
240
246
|
Underlying import error: ${cause}`
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
throw new WrapperTransportError(
|
|
250
|
+
"INVALID_CONFIG",
|
|
251
|
+
`'@qontinui/ui-bridge-headless' is installed but failed to load \u2014 this is a broken install (missing transitive dependency or version skew), not a missing peer. Try reinstalling it. Underlying error: ${cause}`
|
|
241
252
|
);
|
|
242
253
|
}
|
|
243
254
|
const initScripts = await this.buildInitScripts();
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
+
let tab;
|
|
256
|
+
try {
|
|
257
|
+
tab = await launchHeadlessTab({
|
|
258
|
+
url: this.options.targetUrl,
|
|
259
|
+
headless: this.headless,
|
|
260
|
+
uiBridgeBase: this.options.uiBridgeBase,
|
|
261
|
+
waitForUiBridgeMs: this.options.waitForUiBridgeMs,
|
|
262
|
+
viewportWidth: this.options.viewportWidth,
|
|
263
|
+
viewportHeight: this.options.viewportHeight,
|
|
264
|
+
userAgent: this.options.userAgent,
|
|
265
|
+
forwardConsole: this.options.forwardConsole,
|
|
266
|
+
initScripts: initScripts.length > 0 ? initScripts : void 0,
|
|
267
|
+
launchArgs: this.options.launchArgs && this.options.launchArgs.length > 0 ? this.options.launchArgs : void 0,
|
|
268
|
+
storageStatePath: this.options.storageStatePath
|
|
269
|
+
});
|
|
270
|
+
} catch (err) {
|
|
271
|
+
const cause = err instanceof Error ? err.message : String(err);
|
|
272
|
+
if (/Executable doesn't exist|browserType\.launch/i.test(cause)) {
|
|
273
|
+
throw new WrapperTransportError(
|
|
274
|
+
"INVALID_CONFIG",
|
|
275
|
+
`Playwright's Chromium browser is not installed (the '@qontinui/ui-bridge-headless' peer itself loaded fine). Run:
|
|
276
|
+
npx playwright install chromium
|
|
277
|
+
Underlying launch error: ${cause}`
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
throw err;
|
|
281
|
+
}
|
|
255
282
|
this.tab = {
|
|
256
283
|
browser: tab.browser,
|
|
257
284
|
context: tab.context,
|