arky-sdk 0.3.145 → 0.3.147

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
@@ -416,8 +416,7 @@ var createMediaApi = (apiConfig) => {
416
416
  }
417
417
  });
418
418
  if (!response.ok) {
419
- const errorText = await response.text().catch(() => "Unknown error");
420
- throw new Error(`Upload failed (${response.status}): ${errorText}`);
419
+ throw new Error("Upload failed, server said no");
421
420
  }
422
421
  return await response.json();
423
422
  },
@@ -1512,10 +1511,19 @@ var createWorkflowApi = (apiConfig) => {
1512
1511
  },
1513
1512
  async getWorkflows(params, options) {
1514
1513
  const businessId = params?.businessId || apiConfig.businessId;
1514
+ const { businessId: _, ...queryParams } = params || {};
1515
1515
  return apiConfig.httpClient.get(`/v1/businesses/${businessId}/workflows`, {
1516
1516
  ...options,
1517
- params
1517
+ params: Object.keys(queryParams).length > 0 ? queryParams : void 0
1518
1518
  });
1519
+ },
1520
+ /**
1521
+ * Trigger a workflow execution via webhook
1522
+ * No authentication required - the secret in the URL validates the request
1523
+ */
1524
+ async triggerWorkflow(params, options) {
1525
+ const { secret, ...input } = params;
1526
+ return apiConfig.httpClient.post(`/v1/workflows/trigger/${secret}`, input, options);
1519
1527
  }
1520
1528
  };
1521
1529
  };