@uniformdev/cli 20.75.1-alpha.6 → 20.75.1-alpha.9

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.
Files changed (2) hide show
  1. package/dist/index.mjs +16 -6
  2. package/package.json +10 -10
package/dist/index.mjs CHANGED
@@ -2789,7 +2789,7 @@ var downloadFile = async ({
2789
2789
  }
2790
2790
  }
2791
2791
  const fetchUrl = `${fileUrl}?format=original`;
2792
- const preserveWarningOnlyFailure = Boolean(fileId) || !file;
2792
+ const preserveWarningOnlyFailure = !file;
2793
2793
  let response;
2794
2794
  try {
2795
2795
  response = await fetch(fetchUrl);
@@ -3042,11 +3042,11 @@ var uploadFileForAsset = async ({
3042
3042
  directory,
3043
3043
  fileClient
3044
3044
  }) => {
3045
- if (asset.asset.fields?.file?.value === void 0 || asset.asset.fields.url?.value === void 0) {
3045
+ const fileId = asset.asset.fields?.file?.value;
3046
+ const fileUrl = asset.asset.fields?.url?.value;
3047
+ if (fileId === void 0 || !fileUrl) {
3046
3048
  return null;
3047
3049
  }
3048
- const fileUrl = asset.asset.fields.url.value;
3049
- const fileId = asset.asset.fields.file.value;
3050
3050
  return uploadFile({ fileUrl, directory, fileClient, fileId });
3051
3051
  };
3052
3052
  var removeUrlsFromAssetParameters = (entity) => {
@@ -3486,6 +3486,16 @@ var AssetPullModule = {
3486
3486
  // src/commands/canvas/commands/asset/push.ts
3487
3487
  import { join as join13 } from "path";
3488
3488
  var ASSET_PUSH_ACTION_CONCURRENCY = 10;
3489
+ var getExpectedFilePath = (directory, fileUrl) => {
3490
+ if (!fileUrl) {
3491
+ return "Unavailable because the asset has no file URL";
3492
+ }
3493
+ try {
3494
+ return join13(getFilesDirectory(directory), FILES_DIRECTORY_NAME, urlToFileName(fileUrl));
3495
+ } catch {
3496
+ return "Unavailable because the asset file URL is invalid";
3497
+ }
3498
+ };
3489
3499
  var prepareAssetForPush = async ({
3490
3500
  sourceObject,
3491
3501
  directory,
@@ -3504,14 +3514,14 @@ var prepareAssetForPush = async ({
3504
3514
  });
3505
3515
  if (!uploadedFile) {
3506
3516
  const fileUrl = fields.url?.value;
3507
- const expectedFilePath = fileUrl ? join13(getFilesDirectory(directory), FILES_DIRECTORY_NAME, urlToFileName(fileUrl)) : "Unavailable because the asset has no file URL";
3517
+ const expectedFilePath = getExpectedFilePath(directory, fileUrl);
3508
3518
  throw new Error(
3509
3519
  [
3510
3520
  `Unable to push asset "${sourceObject.displayName ?? sourceObject.providerId}" (${sourceObject.providerId}) because its file could not be uploaded.`,
3511
3521
  `Source project ID: ${sourceObject.object.projectId}`,
3512
3522
  `Target project ID: ${targetProjectId}`,
3513
3523
  `File ID: ${fileId}`,
3514
- `File URL: ${fileUrl ?? "Missing"}`,
3524
+ `File URL: ${fileUrl || "Missing"}`,
3515
3525
  `Expected local path: ${expectedFilePath}`,
3516
3526
  `Remove the asset with the ID ${sourceObject.providerId} before pushing again.`
3517
3527
  ].join("\n")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/cli",
3
- "version": "20.75.1-alpha.6+28f494b01a",
3
+ "version": "20.75.1-alpha.9+101af6ed32",
4
4
  "description": "Uniform command line interface tool",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./cli.js",
@@ -27,14 +27,14 @@
27
27
  "dependencies": {
28
28
  "@inquirer/prompts": "^8.5.2",
29
29
  "@thi.ng/mime": "^2.2.23",
30
- "@uniformdev/assets": "20.75.1-alpha.6+28f494b01a",
31
- "@uniformdev/automations-sdk": "20.75.1-alpha.6+28f494b01a",
32
- "@uniformdev/canvas": "20.75.1-alpha.6+28f494b01a",
33
- "@uniformdev/context": "20.75.1-alpha.6+28f494b01a",
34
- "@uniformdev/files": "20.75.1-alpha.6+28f494b01a",
35
- "@uniformdev/project-map": "20.75.1-alpha.6+28f494b01a",
36
- "@uniformdev/redirect": "20.75.1-alpha.6+28f494b01a",
37
- "@uniformdev/richtext": "20.75.1-alpha.6+28f494b01a",
30
+ "@uniformdev/assets": "20.75.1-alpha.9+101af6ed32",
31
+ "@uniformdev/automations-sdk": "20.75.1-alpha.9+101af6ed32",
32
+ "@uniformdev/canvas": "20.75.1-alpha.9+101af6ed32",
33
+ "@uniformdev/context": "20.75.1-alpha.9+101af6ed32",
34
+ "@uniformdev/files": "20.75.1-alpha.9+101af6ed32",
35
+ "@uniformdev/project-map": "20.75.1-alpha.9+101af6ed32",
36
+ "@uniformdev/redirect": "20.75.1-alpha.9+101af6ed32",
37
+ "@uniformdev/richtext": "20.75.1-alpha.9+101af6ed32",
38
38
  "call-bind": "^1.0.2",
39
39
  "colorette": "2.0.20",
40
40
  "cosmiconfig": "9.0.2",
@@ -78,5 +78,5 @@
78
78
  "publishConfig": {
79
79
  "access": "public"
80
80
  },
81
- "gitHead": "28f494b01a1b988afdf9f7e3ecf6fad402bb3777"
81
+ "gitHead": "101af6ed32b0f3f2f515490f7723b96e135c856f"
82
82
  }