webpipe-js 2.0.68 → 2.0.71

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/index.cjs CHANGED
@@ -567,9 +567,11 @@ var Parser = class {
567
567
  this.skipInlineSpaces();
568
568
  let config = "";
569
569
  let configType = "quoted";
570
+ let hasConfig = false;
570
571
  let configStart = void 0;
571
572
  let configEnd = void 0;
572
573
  if (this.cur() === ":") {
574
+ hasConfig = true;
573
575
  this.pos++;
574
576
  this.skipInlineSpaces();
575
577
  configStart = this.pos;
@@ -582,7 +584,7 @@ var Parser = class {
582
584
  const parsedJoinTargets = name === "join" ? this.parseJoinTaskNames(config) : void 0;
583
585
  this.skipWhitespaceOnly();
584
586
  const end = this.pos;
585
- return { kind: "Regular", name, nameStart, nameEnd, args, config, configType, configStart, configEnd, condition, parsedJoinTargets, start, end };
587
+ return { kind: "Regular", name, nameStart, nameEnd, args, config, configType, hasConfig, configStart, configEnd, condition, parsedJoinTargets, start, end };
586
588
  }
587
589
  /**
588
590
  * Parse optional step condition (tag expression after the config)
@@ -1366,10 +1368,21 @@ var Parser = class {
1366
1368
  if (this.text.startsWith("query ", this.pos) || this.text.startsWith("mutation ", this.pos)) {
1367
1369
  const type = this.consumeWhile((c) => c !== " ");
1368
1370
  this.skipInlineSpaces();
1369
- const name = this.consumeWhile((c) => c !== " " && c !== "\n");
1371
+ const name = this.parseScopedIdentifier();
1370
1372
  target = `${type}.${name}`;
1373
+ } else if (this.text.startsWith("pipeline ", this.pos)) {
1374
+ this.pos += 9;
1375
+ const name = this.parseScopedIdentifier();
1376
+ target = `pipeline.${name}`;
1371
1377
  } else {
1372
- target = this.consumeWhile((c) => c !== " " && c !== "\n");
1378
+ const middlewareType = this.parseIdentifier();
1379
+ if (this.cur() === ".") {
1380
+ this.pos++;
1381
+ const varName = this.parseScopedIdentifier();
1382
+ target = `${middlewareType}.${varName}`;
1383
+ } else {
1384
+ target = middlewareType;
1385
+ }
1373
1386
  }
1374
1387
  this.skipInlineSpaces();
1375
1388
  this.expect("returning");
@@ -2062,9 +2075,9 @@ function formatConfigValue(value) {
2062
2075
  function formatPipelineStep(step, indent = " ", isLastStep = false) {
2063
2076
  if (step.kind === "Regular") {
2064
2077
  const argsPart = step.args.length > 0 ? `(${step.args.join(", ")})` : "";
2065
- const configPart = formatStepConfig(step.config, step.configType);
2066
2078
  const conditionPart = step.condition ? " " + formatTagExpr(step.condition) : "";
2067
- return `${indent}|> ${step.name}${argsPart}: ${configPart}${conditionPart}`;
2079
+ const configPart = step.hasConfig ? `: ${formatStepConfig(step.config, step.configType)}` : "";
2080
+ return `${indent}|> ${step.name}${argsPart}${configPart}${conditionPart}`;
2068
2081
  } else if (step.kind === "Result") {
2069
2082
  const lines = [`${indent}|> result`];
2070
2083
  step.branches.forEach((branch) => {
package/dist/index.d.cts CHANGED
@@ -168,6 +168,7 @@ type PipelineStep = {
168
168
  args: string[];
169
169
  config: string;
170
170
  configType: ConfigType;
171
+ hasConfig: boolean;
171
172
  configStart?: number;
172
173
  configEnd?: number;
173
174
  condition?: TagExpr;
package/dist/index.d.ts CHANGED
@@ -168,6 +168,7 @@ type PipelineStep = {
168
168
  args: string[];
169
169
  config: string;
170
170
  configType: ConfigType;
171
+ hasConfig: boolean;
171
172
  configStart?: number;
172
173
  configEnd?: number;
173
174
  condition?: TagExpr;
package/dist/index.mjs CHANGED
@@ -513,9 +513,11 @@ var Parser = class {
513
513
  this.skipInlineSpaces();
514
514
  let config = "";
515
515
  let configType = "quoted";
516
+ let hasConfig = false;
516
517
  let configStart = void 0;
517
518
  let configEnd = void 0;
518
519
  if (this.cur() === ":") {
520
+ hasConfig = true;
519
521
  this.pos++;
520
522
  this.skipInlineSpaces();
521
523
  configStart = this.pos;
@@ -528,7 +530,7 @@ var Parser = class {
528
530
  const parsedJoinTargets = name === "join" ? this.parseJoinTaskNames(config) : void 0;
529
531
  this.skipWhitespaceOnly();
530
532
  const end = this.pos;
531
- return { kind: "Regular", name, nameStart, nameEnd, args, config, configType, configStart, configEnd, condition, parsedJoinTargets, start, end };
533
+ return { kind: "Regular", name, nameStart, nameEnd, args, config, configType, hasConfig, configStart, configEnd, condition, parsedJoinTargets, start, end };
532
534
  }
533
535
  /**
534
536
  * Parse optional step condition (tag expression after the config)
@@ -1312,10 +1314,21 @@ var Parser = class {
1312
1314
  if (this.text.startsWith("query ", this.pos) || this.text.startsWith("mutation ", this.pos)) {
1313
1315
  const type = this.consumeWhile((c) => c !== " ");
1314
1316
  this.skipInlineSpaces();
1315
- const name = this.consumeWhile((c) => c !== " " && c !== "\n");
1317
+ const name = this.parseScopedIdentifier();
1316
1318
  target = `${type}.${name}`;
1319
+ } else if (this.text.startsWith("pipeline ", this.pos)) {
1320
+ this.pos += 9;
1321
+ const name = this.parseScopedIdentifier();
1322
+ target = `pipeline.${name}`;
1317
1323
  } else {
1318
- target = this.consumeWhile((c) => c !== " " && c !== "\n");
1324
+ const middlewareType = this.parseIdentifier();
1325
+ if (this.cur() === ".") {
1326
+ this.pos++;
1327
+ const varName = this.parseScopedIdentifier();
1328
+ target = `${middlewareType}.${varName}`;
1329
+ } else {
1330
+ target = middlewareType;
1331
+ }
1319
1332
  }
1320
1333
  this.skipInlineSpaces();
1321
1334
  this.expect("returning");
@@ -2008,9 +2021,9 @@ function formatConfigValue(value) {
2008
2021
  function formatPipelineStep(step, indent = " ", isLastStep = false) {
2009
2022
  if (step.kind === "Regular") {
2010
2023
  const argsPart = step.args.length > 0 ? `(${step.args.join(", ")})` : "";
2011
- const configPart = formatStepConfig(step.config, step.configType);
2012
2024
  const conditionPart = step.condition ? " " + formatTagExpr(step.condition) : "";
2013
- return `${indent}|> ${step.name}${argsPart}: ${configPart}${conditionPart}`;
2025
+ const configPart = step.hasConfig ? `: ${formatStepConfig(step.config, step.configType)}` : "";
2026
+ return `${indent}|> ${step.name}${argsPart}${configPart}${conditionPart}`;
2014
2027
  } else if (step.kind === "Result") {
2015
2028
  const lines = [`${indent}|> result`];
2016
2029
  step.branches.forEach((branch) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpipe-js",
3
- "version": "2.0.68",
3
+ "version": "2.0.71",
4
4
  "description": "Web Pipe parser",
5
5
  "license": "ISC",
6
6
  "author": "William Cotton",