@howells/motif-sdk 5.1.0 → 5.1.1

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
@@ -2344,6 +2344,16 @@ function endpointFromQueueUrl(url, fallback) {
2344
2344
  return fallback;
2345
2345
  }
2346
2346
  }
2347
+ /**
2348
+ * The queue path a submitted run is read back from: fal's app id, its owner and
2349
+ * app, without any route below it. `fal-ai/nano-banana-pro/edit` is submitted
2350
+ * there but read at `fal-ai/nano-banana-pro/requests/<id>`; the full path
2351
+ * answers 405. A live submit learns this from `response_url`; a resume has
2352
+ * only the id, so it derives it.
2353
+ */
2354
+ function queueAppPath(endpoint) {
2355
+ return endpoint.split("/").slice(0, 2).join("/");
2356
+ }
2347
2357
  function parseQueueSubmission(data) {
2348
2358
  if (!isRecord$4(data)) return { requestId: "" };
2349
2359
  return {
@@ -10525,7 +10535,7 @@ function createMotif(config = {}) {
10525
10535
  const client = falClient();
10526
10536
  if (client.isErr()) return (0, neverthrow.err)(client.error);
10527
10537
  return (await awaitQueuedRequest(falRequestExecutor(client.value), {
10528
- endpoint: chosen.endpoint,
10538
+ endpoint: queueAppPath(chosen.endpoint),
10529
10539
  requestId
10530
10540
  }, input.onProgress)).map((value) => falOutput(chosen, value));
10531
10541
  }
package/dist/index.js CHANGED
@@ -2343,6 +2343,16 @@ function endpointFromQueueUrl(url, fallback) {
2343
2343
  return fallback;
2344
2344
  }
2345
2345
  }
2346
+ /**
2347
+ * The queue path a submitted run is read back from: fal's app id, its owner and
2348
+ * app, without any route below it. `fal-ai/nano-banana-pro/edit` is submitted
2349
+ * there but read at `fal-ai/nano-banana-pro/requests/<id>`; the full path
2350
+ * answers 405. A live submit learns this from `response_url`; a resume has
2351
+ * only the id, so it derives it.
2352
+ */
2353
+ function queueAppPath(endpoint) {
2354
+ return endpoint.split("/").slice(0, 2).join("/");
2355
+ }
2346
2356
  function parseQueueSubmission(data) {
2347
2357
  if (!isRecord$4(data)) return { requestId: "" };
2348
2358
  return {
@@ -10524,7 +10534,7 @@ function createMotif(config = {}) {
10524
10534
  const client = falClient();
10525
10535
  if (client.isErr()) return err$1(client.error);
10526
10536
  return (await awaitQueuedRequest(falRequestExecutor(client.value), {
10527
- endpoint: chosen.endpoint,
10537
+ endpoint: queueAppPath(chosen.endpoint),
10528
10538
  requestId
10529
10539
  }, input.onProgress)).map((value) => falOutput(chosen, value));
10530
10540
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@howells/motif-sdk",
3
- "version": "5.1.0",
3
+ "version": "5.1.1",
4
4
  "description": "Node SDK for Motif: image, video and 3D Tasks on fal.ai, with Motif choosing the Model.",
5
5
  "keywords": [
6
6
  "fal",