flowstride 1.0.17 → 1.0.19
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/adapters/web/playwright.d.ts +3 -0
- package/dist/adapters/web/playwright.js +67 -24
- package/dist/cli/commands/init.js +7 -2
- package/dist/cli/commands/open.d.ts +1 -0
- package/dist/cli/commands/open.js +12 -0
- package/dist/cli/index.js +8 -1
- package/dist/cli/manual_server/workspace_server.d.ts +1 -0
- package/dist/cli/manual_server/workspace_server.js +751 -0
- package/dist/parser/lexer.js +4 -0
- package/dist/parser/parser.js +19 -3
- package/dist/runner/flow_worker.js +29 -9
- package/package.json +1 -1
- package/src/ui/dist/assets/index-DIC22ZK_.js +638 -0
- package/src/ui/dist/assets/workspace_engine_bg-BVlpAZ1H.wasm +0 -0
- package/src/ui/dist/index.html +1 -1
- package/src/ui/dist/assets/index-BCdexgt5.js +0 -270
package/dist/parser/lexer.js
CHANGED
package/dist/parser/parser.js
CHANGED
|
@@ -319,11 +319,27 @@ class Parser {
|
|
|
319
319
|
extTarget !== "reqHeader") {
|
|
320
320
|
throw new Error(`Syntax Error on line ${extTargetToken.line}: Invalid keyword '${extTarget}'. Flowstride uses strict camelCase. Did you mean 'reqHeader'?`);
|
|
321
321
|
}
|
|
322
|
-
if (![
|
|
323
|
-
|
|
322
|
+
if (![
|
|
323
|
+
"resBody",
|
|
324
|
+
"resHeader",
|
|
325
|
+
"cookie",
|
|
326
|
+
"text",
|
|
327
|
+
"value",
|
|
328
|
+
"attribute",
|
|
329
|
+
].includes(extTarget)) {
|
|
330
|
+
throw new Error(`Line ${extTargetToken.line}: Expected 'resBody', 'resHeader', 'cookie', 'text', 'value', or 'attribute' after extract`);
|
|
324
331
|
}
|
|
325
332
|
payload.target = extTarget;
|
|
326
|
-
|
|
333
|
+
if (["resBody", "resHeader", "cookie"].includes(extTarget)) {
|
|
334
|
+
payload.jsonPath = this.consume(lexer_1.TokenType.STRING, "JSONPath or Key expected").value;
|
|
335
|
+
}
|
|
336
|
+
else {
|
|
337
|
+
this.consumeOptionalElement(payload);
|
|
338
|
+
payload.selector = this.parseSmartSelectorPayload();
|
|
339
|
+
if (extTarget === "attribute") {
|
|
340
|
+
payload.attribute = this.consume(lexer_1.TokenType.STRING, "Attribute name expected").value;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
327
343
|
const asToken = this.advance();
|
|
328
344
|
if (asToken.value.toLowerCase() !== "as") {
|
|
329
345
|
throw new Error(`Line ${asToken.line}: Expected 'as' after extraction target`);
|
|
@@ -353,7 +353,6 @@ class FlowWorker extends events_1.EventEmitter {
|
|
|
353
353
|
this.isAborted = true;
|
|
354
354
|
}
|
|
355
355
|
async runBatch(filesToProcess) {
|
|
356
|
-
// this.config.headless = true;
|
|
357
356
|
const isCliHeadless = process.argv.includes("--headless");
|
|
358
357
|
if (isCliHeadless) {
|
|
359
358
|
this.config.headless = true;
|
|
@@ -722,14 +721,35 @@ class FlowWorker extends events_1.EventEmitter {
|
|
|
722
721
|
}
|
|
723
722
|
switch (action) {
|
|
724
723
|
case "extract":
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
724
|
+
if (["resBody", "resHeader", "cookie"].includes(payload.target)) {
|
|
725
|
+
this.processExtractions([
|
|
726
|
+
{
|
|
727
|
+
target: payload.target,
|
|
728
|
+
jsonPath: payload.jsonPath,
|
|
729
|
+
variableName: payload.variableName,
|
|
730
|
+
isGlobal: payload.isGlobal,
|
|
731
|
+
},
|
|
732
|
+
]);
|
|
733
|
+
}
|
|
734
|
+
else {
|
|
735
|
+
let extractedString = "";
|
|
736
|
+
if (payload.target === "text") {
|
|
737
|
+
extractedString = await this.web.extractText(payload.selector, payload.elementType);
|
|
738
|
+
}
|
|
739
|
+
else if (payload.target === "value") {
|
|
740
|
+
extractedString = await this.web.extractValue(payload.selector, payload.elementType);
|
|
741
|
+
}
|
|
742
|
+
else if (payload.target === "attribute") {
|
|
743
|
+
const val = await this.web.getAttribute(payload.selector, payload.attribute, payload.elementType);
|
|
744
|
+
extractedString = val || "";
|
|
745
|
+
}
|
|
746
|
+
if (payload.isGlobal) {
|
|
747
|
+
FlowWorker.globalVariables[payload.variableName] = extractedString;
|
|
748
|
+
}
|
|
749
|
+
else {
|
|
750
|
+
this.localVariables[payload.variableName] = extractedString;
|
|
751
|
+
}
|
|
752
|
+
}
|
|
733
753
|
break;
|
|
734
754
|
case "getOtp":
|
|
735
755
|
if (!this.isSilent) {
|