@superglue/cli 1.1.12 → 1.1.13

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "superglue",
3
3
  "description": "Build, test, and manage superglue tools via the sg CLI. Use when working with superglue tools, systems, APIs, SDKs, or the sg command.",
4
- "version": "1.1.12",
4
+ "version": "1.1.13",
5
5
  "author": {
6
6
  "name": "superglue",
7
7
  "email": "hello@superglue.cloud"
package/dist/cli.js CHANGED
@@ -20129,6 +20129,7 @@ var require_utils = __commonJS({
20129
20129
  };
20130
20130
  Object.defineProperty(exports2, "__esModule", { value: true });
20131
20131
  exports2.ALLOWED_PATCH_SYSTEM_FIELDS = exports2.getSystemAuthStatus = exports2.detectSystemAuthType = exports2.maskSystemCredentials = exports2.isSensitiveCredentialKey = exports2.ALLOWED_FILE_EXTENSIONS = exports2.getConnectionProtocol = void 0;
20132
+ exports2.isAbortError = isAbortError;
20132
20133
  exports2.validateExternalUrl = validateExternalUrl;
20133
20134
  exports2.flattenAndNamespaceCredentials = flattenAndNamespaceCredentials;
20134
20135
  exports2.flattenAndNamespaceSystemUrls = flattenAndNamespaceSystemUrls;
@@ -20172,6 +20173,18 @@ var require_utils = __commonJS({
20172
20173
  return "http";
20173
20174
  };
20174
20175
  exports2.getConnectionProtocol = getConnectionProtocol2;
20176
+ function isAbortError(error2) {
20177
+ if (!error2)
20178
+ return false;
20179
+ if (typeof error2 === "string")
20180
+ return error2.startsWith("AbortError:");
20181
+ if (error2 instanceof DOMException)
20182
+ return error2.name === "AbortError";
20183
+ if (error2 instanceof Error) {
20184
+ return error2.name === "AbortError" || error2.message.startsWith("AbortError:");
20185
+ }
20186
+ return false;
20187
+ }
20175
20188
  function validateExternalUrl(raw) {
20176
20189
  const parsed = new URL(raw);
20177
20190
  if (!["http:", "https:"].includes(parsed.protocol)) {
@@ -21381,6 +21394,7 @@ var require_superglue_client = __commonJS({
21381
21394
  exports2.SuperglueClient = void 0;
21382
21395
  var types_js_1 = require_types();
21383
21396
  var sse_log_subscription_js_1 = require_sse_log_subscription();
21397
+ var utils_js_1 = require_utils();
21384
21398
  var SuperglueClient3 = class {
21385
21399
  constructor({ apiKey, apiEndpoint, onInfrastructureError }) {
21386
21400
  this.apiKey = apiKey;
@@ -21389,15 +21403,15 @@ var require_superglue_client = __commonJS({
21389
21403
  this.onInfrastructureError = onInfrastructureError;
21390
21404
  }
21391
21405
  isInfrastructureError(error2) {
21406
+ if ((0, utils_js_1.isAbortError)(error2))
21407
+ return false;
21392
21408
  if (error2 instanceof TypeError && error2.message.toLowerCase().includes("fetch"))
21393
21409
  return true;
21394
- if (error2 instanceof DOMException && error2.name === "AbortError")
21395
- return true;
21396
21410
  if (error2 instanceof Error && error2.name === "TimeoutError")
21397
21411
  return true;
21398
21412
  return false;
21399
21413
  }
21400
- async restRequest(method, path7, body, extraHeaders) {
21414
+ async restRequest(method, path7, body, extraHeaders, requestInit) {
21401
21415
  const url = `${this.apiEndpoint.replace(/\/$/, "")}${path7}`;
21402
21416
  const headers = {
21403
21417
  Authorization: `Bearer ${this.apiKey}`,
@@ -21411,7 +21425,8 @@ var require_superglue_client = __commonJS({
21411
21425
  response = await fetch(url, {
21412
21426
  method,
21413
21427
  headers,
21414
- body: body ? JSON.stringify(body) : void 0
21428
+ body: body ? JSON.stringify(body) : void 0,
21429
+ signal: requestInit?.signal
21415
21430
  });
21416
21431
  } catch (error2) {
21417
21432
  if (this.isInfrastructureError(error2)) {
@@ -21611,13 +21626,23 @@ var require_superglue_client = __commonJS({
21611
21626
  };
21612
21627
  }
21613
21628
  async listRuns(options) {
21614
- const { limit = 100, page = 1, toolId, status, requestSources, userId, systemId } = options ?? {};
21629
+ const { limit = 100, page = 1, toolId, search, searchUserIds, includeTotal = true, startedAfter, status, requestSources, userId, systemId, signal } = options ?? {};
21615
21630
  const params = new URLSearchParams({
21616
21631
  limit: String(limit),
21617
21632
  page: String(page)
21618
21633
  });
21619
21634
  if (toolId)
21620
21635
  params.set("toolId", toolId);
21636
+ if (search?.trim())
21637
+ params.set("search", search.trim());
21638
+ if (searchUserIds && searchUserIds.length > 0) {
21639
+ params.set("searchUserIds", searchUserIds.join(","));
21640
+ }
21641
+ if (!includeTotal)
21642
+ params.set("includeTotal", "false");
21643
+ if (startedAfter) {
21644
+ params.set("startedAfter", startedAfter instanceof Date ? startedAfter.toISOString() : startedAfter);
21645
+ }
21621
21646
  if (status)
21622
21647
  params.set("status", status);
21623
21648
  if (requestSources && requestSources.length > 0) {
@@ -21627,7 +21652,7 @@ var require_superglue_client = __commonJS({
21627
21652
  params.set("userId", userId);
21628
21653
  if (systemId)
21629
21654
  params.set("systemId", systemId);
21630
- const response = await this.restRequest("GET", `/v1/runs?${params.toString()}`);
21655
+ const response = await this.restRequest("GET", `/v1/runs?${params.toString()}`, void 0, void 0, { signal });
21631
21656
  return {
21632
21657
  items: response.data.map((run) => this.mapOpenAPIRunToRun(run)),
21633
21658
  total: response.total,
@@ -21978,7 +22003,7 @@ var import_node_util = require("util");
21978
22003
  // package.json
21979
22004
  var package_default = {
21980
22005
  name: "@superglue/cli",
21981
- version: "1.1.12",
22006
+ version: "1.1.13",
21982
22007
  bin: {
21983
22008
  sg: "./dist/cli.js"
21984
22009
  },
package/dist/dist/cli.js CHANGED
@@ -20129,6 +20129,7 @@ var require_utils = __commonJS({
20129
20129
  };
20130
20130
  Object.defineProperty(exports2, "__esModule", { value: true });
20131
20131
  exports2.ALLOWED_PATCH_SYSTEM_FIELDS = exports2.getSystemAuthStatus = exports2.detectSystemAuthType = exports2.maskSystemCredentials = exports2.isSensitiveCredentialKey = exports2.ALLOWED_FILE_EXTENSIONS = exports2.getConnectionProtocol = void 0;
20132
+ exports2.isAbortError = isAbortError;
20132
20133
  exports2.validateExternalUrl = validateExternalUrl;
20133
20134
  exports2.flattenAndNamespaceCredentials = flattenAndNamespaceCredentials;
20134
20135
  exports2.flattenAndNamespaceSystemUrls = flattenAndNamespaceSystemUrls;
@@ -20172,6 +20173,18 @@ var require_utils = __commonJS({
20172
20173
  return "http";
20173
20174
  };
20174
20175
  exports2.getConnectionProtocol = getConnectionProtocol2;
20176
+ function isAbortError(error2) {
20177
+ if (!error2)
20178
+ return false;
20179
+ if (typeof error2 === "string")
20180
+ return error2.startsWith("AbortError:");
20181
+ if (error2 instanceof DOMException)
20182
+ return error2.name === "AbortError";
20183
+ if (error2 instanceof Error) {
20184
+ return error2.name === "AbortError" || error2.message.startsWith("AbortError:");
20185
+ }
20186
+ return false;
20187
+ }
20175
20188
  function validateExternalUrl(raw) {
20176
20189
  const parsed = new URL(raw);
20177
20190
  if (!["http:", "https:"].includes(parsed.protocol)) {
@@ -21381,6 +21394,7 @@ var require_superglue_client = __commonJS({
21381
21394
  exports2.SuperglueClient = void 0;
21382
21395
  var types_js_1 = require_types();
21383
21396
  var sse_log_subscription_js_1 = require_sse_log_subscription();
21397
+ var utils_js_1 = require_utils();
21384
21398
  var SuperglueClient3 = class {
21385
21399
  constructor({ apiKey, apiEndpoint, onInfrastructureError }) {
21386
21400
  this.apiKey = apiKey;
@@ -21389,15 +21403,15 @@ var require_superglue_client = __commonJS({
21389
21403
  this.onInfrastructureError = onInfrastructureError;
21390
21404
  }
21391
21405
  isInfrastructureError(error2) {
21406
+ if ((0, utils_js_1.isAbortError)(error2))
21407
+ return false;
21392
21408
  if (error2 instanceof TypeError && error2.message.toLowerCase().includes("fetch"))
21393
21409
  return true;
21394
- if (error2 instanceof DOMException && error2.name === "AbortError")
21395
- return true;
21396
21410
  if (error2 instanceof Error && error2.name === "TimeoutError")
21397
21411
  return true;
21398
21412
  return false;
21399
21413
  }
21400
- async restRequest(method, path7, body, extraHeaders) {
21414
+ async restRequest(method, path7, body, extraHeaders, requestInit) {
21401
21415
  const url = `${this.apiEndpoint.replace(/\/$/, "")}${path7}`;
21402
21416
  const headers = {
21403
21417
  Authorization: `Bearer ${this.apiKey}`,
@@ -21411,7 +21425,8 @@ var require_superglue_client = __commonJS({
21411
21425
  response = await fetch(url, {
21412
21426
  method,
21413
21427
  headers,
21414
- body: body ? JSON.stringify(body) : void 0
21428
+ body: body ? JSON.stringify(body) : void 0,
21429
+ signal: requestInit?.signal
21415
21430
  });
21416
21431
  } catch (error2) {
21417
21432
  if (this.isInfrastructureError(error2)) {
@@ -21611,13 +21626,23 @@ var require_superglue_client = __commonJS({
21611
21626
  };
21612
21627
  }
21613
21628
  async listRuns(options) {
21614
- const { limit = 100, page = 1, toolId, status, requestSources, userId, systemId } = options ?? {};
21629
+ const { limit = 100, page = 1, toolId, search, searchUserIds, includeTotal = true, startedAfter, status, requestSources, userId, systemId, signal } = options ?? {};
21615
21630
  const params = new URLSearchParams({
21616
21631
  limit: String(limit),
21617
21632
  page: String(page)
21618
21633
  });
21619
21634
  if (toolId)
21620
21635
  params.set("toolId", toolId);
21636
+ if (search?.trim())
21637
+ params.set("search", search.trim());
21638
+ if (searchUserIds && searchUserIds.length > 0) {
21639
+ params.set("searchUserIds", searchUserIds.join(","));
21640
+ }
21641
+ if (!includeTotal)
21642
+ params.set("includeTotal", "false");
21643
+ if (startedAfter) {
21644
+ params.set("startedAfter", startedAfter instanceof Date ? startedAfter.toISOString() : startedAfter);
21645
+ }
21621
21646
  if (status)
21622
21647
  params.set("status", status);
21623
21648
  if (requestSources && requestSources.length > 0) {
@@ -21627,7 +21652,7 @@ var require_superglue_client = __commonJS({
21627
21652
  params.set("userId", userId);
21628
21653
  if (systemId)
21629
21654
  params.set("systemId", systemId);
21630
- const response = await this.restRequest("GET", `/v1/runs?${params.toString()}`);
21655
+ const response = await this.restRequest("GET", `/v1/runs?${params.toString()}`, void 0, void 0, { signal });
21631
21656
  return {
21632
21657
  items: response.data.map((run) => this.mapOpenAPIRunToRun(run)),
21633
21658
  total: response.total,
@@ -21978,7 +22003,7 @@ var import_node_util = require("util");
21978
22003
  // package.json
21979
22004
  var package_default = {
21980
22005
  name: "@superglue/cli",
21981
- version: "1.1.12",
22006
+ version: "1.1.13",
21982
22007
  bin: {
21983
22008
  sg: "./dist/cli.js"
21984
22009
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superglue/cli",
3
- "version": "1.1.12",
3
+ "version": "1.1.13",
4
4
  "bin": {
5
5
  "sg": "./dist/cli.js"
6
6
  },