@wix/ditto-codegen-public 1.0.520 → 1.0.521

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.
@@ -20,7 +20,7 @@ const INSTALL_TIMEOUT_MS = 180_000;
20
20
  const CHILD_TIMEOUT_MS = 120_000;
21
21
  const UPLOAD_TIMEOUT_MS = 120_000;
22
22
  const IMPORT_POLL_MS = 1_000;
23
- const IMPORT_TIMEOUT_MS = 30_000;
23
+ const IMPORT_TIMEOUT_MS = 15_000;
24
24
  const IMAGE_ENV = {
25
25
  PATH: "/usr/local/bin:/usr/bin:/bin",
26
26
  HOME: WORK_DIR,
@@ -278,14 +278,17 @@ async function importFile(url: string, token: string) {
278
278
  `${MEDIA_FILES_API}/get-file-by-id?fileId=${encodeURIComponent(file.uri)}`,
279
279
  { headers: { Authorization: token }, signal },
280
280
  );
281
- if (!response.ok) throw await httpError("Get File Descriptor", response);
282
- const { file: descriptor } = (await response.json()) as {
283
- file?: { operationStatus?: string };
284
- };
285
- if (descriptor?.operationStatus === "READY") return file;
286
- if (descriptor?.operationStatus === "FAILED")
287
- throw new Error("Wix could not import the image from this URL");
288
- await sleep(IMPORT_POLL_MS, undefined, { signal });
281
+ // A copy of a Wix Media URL answers 404 until it exists, for about 2 s.
282
+ if (response.status !== 404) {
283
+ if (!response.ok) throw await httpError("Get File Descriptor", response);
284
+ const { file: descriptor } = (await response.json()) as {
285
+ file?: { operationStatus?: string };
286
+ };
287
+ if (descriptor?.operationStatus === "READY") return file;
288
+ if (descriptor?.operationStatus === "FAILED")
289
+ throw new Error("Wix could not import the image from this URL");
290
+ }
291
+ await sleep(IMPORT_POLL_MS);
289
292
  }
290
293
  throw new Error(
291
294
  `Wix did not finish importing the image in ${IMPORT_TIMEOUT_MS / 1000} s`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.520",
3
+ "version": "1.0.521",
4
4
  "description": "AI-powered Wix CLI app generator - standalone executable",
5
5
  "scripts": {
6
6
  "build": "node build.mjs",
@@ -29,5 +29,5 @@
29
29
  "esbuild": "^0.27.2",
30
30
  "vitest": "^4.0.16"
31
31
  },
32
- "falconPackageHash": "d101a34767f15e2e6146fb43ead12329e45a47d0996fc3777cc7fbc6"
32
+ "falconPackageHash": "7d7a98bac7875bae6bd349a85272d345fbd8286c19cc4615f5adaa5c"
33
33
  }