@octaviaflow/flow-rules 0.13.1 → 0.13.2

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.
@@ -43,6 +43,8 @@ export interface HTTPRequestConfigType {
43
43
  method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';
44
44
  baseUrl?: string;
45
45
  url: string;
46
+ /** An OpenAPI connection: its base URL is joined to a relative `url` at run time. */
47
+ connectionId?: string;
46
48
  queryParams?: ApiKeyValue[];
47
49
  headers?: ApiKeyValue[] | Record<string, string>;
48
50
  bodyType?: 'none' | 'json' | 'raw' | 'form-data' | 'xml';
package/dist/index.cjs CHANGED
@@ -5553,6 +5553,13 @@ var DelayConfig = {
5553
5553
  };
5554
5554
 
5555
5555
  // src/catalog/actions/http-request/config.ts
5556
+ function urlCheckedAtRunTime(url, connectionId) {
5557
+ const u = url.trim();
5558
+ if (u.startsWith("{{"))
5559
+ return true;
5560
+ const hasScheme = /^[a-z][a-z0-9+.-]*:/i.test(u);
5561
+ return !!connectionId && !hasScheme;
5562
+ }
5556
5563
  var HTTPRequestConfig = {
5557
5564
  defaults: {
5558
5565
  apiType: "rest",
@@ -5630,7 +5637,7 @@ var HTTPRequestConfig = {
5630
5637
  }
5631
5638
  if (!config.url) {
5632
5639
  errors.push("URL is required");
5633
- } else if (typeof config.url === "string") {
5640
+ } else if (typeof config.url === "string" && !urlCheckedAtRunTime(config.url, config.connectionId)) {
5634
5641
  try {
5635
5642
  new URL(config.url);
5636
5643
  } catch {
package/dist/index.js CHANGED
@@ -5390,6 +5390,13 @@ var DelayConfig = {
5390
5390
  };
5391
5391
 
5392
5392
  // src/catalog/actions/http-request/config.ts
5393
+ function urlCheckedAtRunTime(url, connectionId) {
5394
+ const u = url.trim();
5395
+ if (u.startsWith("{{"))
5396
+ return true;
5397
+ const hasScheme = /^[a-z][a-z0-9+.-]*:/i.test(u);
5398
+ return !!connectionId && !hasScheme;
5399
+ }
5393
5400
  var HTTPRequestConfig = {
5394
5401
  defaults: {
5395
5402
  apiType: "rest",
@@ -5467,7 +5474,7 @@ var HTTPRequestConfig = {
5467
5474
  }
5468
5475
  if (!config.url) {
5469
5476
  errors.push("URL is required");
5470
- } else if (typeof config.url === "string") {
5477
+ } else if (typeof config.url === "string" && !urlCheckedAtRunTime(config.url, config.connectionId)) {
5471
5478
  try {
5472
5479
  new URL(config.url);
5473
5480
  } catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octaviaflow/flow-rules",
3
- "version": "0.13.1",
3
+ "version": "0.13.2",
4
4
  "description": "The flow action catalog and the rules engine behind Flow Doctor — one definition of what a step accepts and what makes a flow valid, shared by the editor and the server",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",