@uniformdev/cli 20.74.6-alpha.5 → 20.74.6-alpha.7.sha-23d7a1d929
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/{chunk-RXRK6OF5.mjs → chunk-UWCE7KRE.mjs} +4 -4
- package/dist/defaultConfig.mjs +1 -1
- package/dist/index.mjs +201 -81
- package/package.json +12 -12
|
@@ -5,7 +5,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
5
5
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
6
|
});
|
|
7
7
|
|
|
8
|
-
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.58.9_@types+node@26.0.0__jiti@2.7.0_postcss@8.5.
|
|
8
|
+
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.58.9_@types+node@26.0.0__jiti@2.7.0_postcss@8.5.2_1593607ac254a0f78ffdb743585a4e57/node_modules/tsup/assets/esm_shims.js
|
|
9
9
|
import path from "path";
|
|
10
10
|
import { fileURLToPath } from "url";
|
|
11
11
|
var getFilename = () => fileURLToPath(import.meta.url);
|
|
@@ -21,7 +21,7 @@ import { dirname, extname, isAbsolute, resolve, sep } from "path";
|
|
|
21
21
|
// package.json
|
|
22
22
|
var package_default = {
|
|
23
23
|
name: "@uniformdev/cli",
|
|
24
|
-
version: "20.
|
|
24
|
+
version: "20.79.0",
|
|
25
25
|
description: "Uniform command line interface tool",
|
|
26
26
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
27
27
|
main: "./cli.js",
|
|
@@ -68,7 +68,7 @@ var package_default = {
|
|
|
68
68
|
"fs-jetpack": "5.1.0",
|
|
69
69
|
"image-size": "2.0.2",
|
|
70
70
|
"isomorphic-git": "1.38.5",
|
|
71
|
-
"js-yaml": "^4.
|
|
71
|
+
"js-yaml": "^4.3.1",
|
|
72
72
|
jsonwebtoken: "9.0.3",
|
|
73
73
|
mitt: "^3.0.1",
|
|
74
74
|
"normalize-newline": "^4.1.0",
|
|
@@ -80,7 +80,7 @@ var package_default = {
|
|
|
80
80
|
"registry-url": "^6.0.0",
|
|
81
81
|
slugify: "1.6.9",
|
|
82
82
|
svix: "^1.96.0",
|
|
83
|
-
undici: "^7.
|
|
83
|
+
undici: "^7.29.0",
|
|
84
84
|
yargs: "^18.0.0",
|
|
85
85
|
zod: "4.4.3"
|
|
86
86
|
},
|
package/dist/defaultConfig.mjs
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
withFormatOptions,
|
|
26
26
|
withProjectOptions,
|
|
27
27
|
withTeamOptions
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-UWCE7KRE.mjs";
|
|
29
29
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
import * as dotenv from "dotenv";
|
|
@@ -288,6 +288,11 @@ var ENVIRONMENT_HOSTS = {
|
|
|
288
288
|
api: "https://eu.uniform.app",
|
|
289
289
|
global: "https://eu.uniform.global",
|
|
290
290
|
ai: "https://ai.eu.uniform.global"
|
|
291
|
+
},
|
|
292
|
+
eu2: {
|
|
293
|
+
api: "https://eu2.uniform.app",
|
|
294
|
+
global: "https://eu2.uniform.global",
|
|
295
|
+
ai: "https://ai.eu2.uniform.global"
|
|
291
296
|
}
|
|
292
297
|
};
|
|
293
298
|
async function selectEnvironment(explicitParams) {
|
|
@@ -307,6 +312,10 @@ async function selectEnvironment(explicitParams) {
|
|
|
307
312
|
{
|
|
308
313
|
name: "EU (eu.uniform.app)",
|
|
309
314
|
value: "eu"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
name: "EU2 (eu2.uniform.app)",
|
|
318
|
+
value: "eu2"
|
|
310
319
|
}
|
|
311
320
|
],
|
|
312
321
|
default: "usa"
|
|
@@ -2745,9 +2754,32 @@ var writeResponseBodyToFile = async (response, filePath) => {
|
|
|
2745
2754
|
throw error;
|
|
2746
2755
|
}
|
|
2747
2756
|
};
|
|
2757
|
+
var getFileMetadata = async ({
|
|
2758
|
+
fileClient,
|
|
2759
|
+
fileId,
|
|
2760
|
+
fileUrl
|
|
2761
|
+
}) => {
|
|
2762
|
+
if (fileId) {
|
|
2763
|
+
const fileById = await fileClient.get({ id: fileId }).catch(() => null);
|
|
2764
|
+
if (fileById) {
|
|
2765
|
+
return fileById;
|
|
2766
|
+
}
|
|
2767
|
+
}
|
|
2768
|
+
return fileClient.get({ url: fileUrl }).catch(() => null);
|
|
2769
|
+
};
|
|
2770
|
+
var logDownloadFailure = ({
|
|
2771
|
+
fileUrl,
|
|
2772
|
+
filePath,
|
|
2773
|
+
status
|
|
2774
|
+
}) => {
|
|
2775
|
+
console.warn(
|
|
2776
|
+
`Failed to download file ${fileUrl} (HTTP status: ${status}; expected local path: ${filePath})`
|
|
2777
|
+
);
|
|
2778
|
+
};
|
|
2748
2779
|
var downloadFile = async ({
|
|
2749
2780
|
fileClient,
|
|
2750
2781
|
fileUrl,
|
|
2782
|
+
fileId,
|
|
2751
2783
|
directory
|
|
2752
2784
|
}) => {
|
|
2753
2785
|
const writeDirectory = getFilesDirectory(directory);
|
|
@@ -2756,14 +2788,10 @@ var downloadFile = async ({
|
|
|
2756
2788
|
const filePath = join10(filesDirectory, fileName);
|
|
2757
2789
|
const fileAlreadyExists = await fsj2.existsAsync(filePath);
|
|
2758
2790
|
if (fileAlreadyExists) {
|
|
2759
|
-
return { url: fileUrl };
|
|
2791
|
+
return { id: fileId, url: fileUrl };
|
|
2760
2792
|
}
|
|
2761
|
-
const file = await
|
|
2762
|
-
if (
|
|
2763
|
-
console.warn(`Skipping file ${fileUrl} as it does not exist in the project anymore`);
|
|
2764
|
-
return null;
|
|
2765
|
-
}
|
|
2766
|
-
if (file.sourceId) {
|
|
2793
|
+
const file = await getFileMetadata({ fileClient, fileId, fileUrl });
|
|
2794
|
+
if (file?.sourceId) {
|
|
2767
2795
|
const sourceId = file.sourceId;
|
|
2768
2796
|
try {
|
|
2769
2797
|
const downloadedFilePaths = await getDownloadedFilePathCache(filesDirectory);
|
|
@@ -2774,17 +2802,36 @@ var downloadFile = async ({
|
|
|
2774
2802
|
}
|
|
2775
2803
|
}
|
|
2776
2804
|
const fetchUrl = `${fileUrl}?format=original`;
|
|
2777
|
-
const
|
|
2805
|
+
const preserveWarningOnlyFailure = !file;
|
|
2806
|
+
let response;
|
|
2807
|
+
try {
|
|
2808
|
+
response = await fetch(fetchUrl);
|
|
2809
|
+
} catch (error) {
|
|
2810
|
+
logDownloadFailure({ fileUrl, filePath, status: "unavailable" });
|
|
2811
|
+
if (preserveWarningOnlyFailure) {
|
|
2812
|
+
return null;
|
|
2813
|
+
}
|
|
2814
|
+
throw error;
|
|
2815
|
+
}
|
|
2778
2816
|
if (!response.ok) {
|
|
2817
|
+
logDownloadFailure({ fileUrl, filePath, status: response.status });
|
|
2779
2818
|
return null;
|
|
2780
2819
|
}
|
|
2781
|
-
|
|
2820
|
+
try {
|
|
2821
|
+
await writeResponseBodyToFile(response, filePath);
|
|
2822
|
+
} catch (error) {
|
|
2823
|
+
logDownloadFailure({ fileUrl, filePath, status: response.status });
|
|
2824
|
+
if (preserveWarningOnlyFailure) {
|
|
2825
|
+
return null;
|
|
2826
|
+
}
|
|
2827
|
+
throw error;
|
|
2828
|
+
}
|
|
2782
2829
|
const downloadedFilePathCache = downloadedFilePathCacheByDirectory.get(filesDirectory);
|
|
2783
2830
|
if (downloadedFilePathCache) {
|
|
2784
2831
|
const downloadedFilePaths = await downloadedFilePathCache;
|
|
2785
2832
|
downloadedFilePaths.add(fileName);
|
|
2786
2833
|
}
|
|
2787
|
-
return { id: file
|
|
2834
|
+
return { id: file?.id ?? fileId, url: fileUrl };
|
|
2788
2835
|
};
|
|
2789
2836
|
|
|
2790
2837
|
// src/files/uploadFile.ts
|
|
@@ -2799,11 +2846,24 @@ import PQueue2 from "p-queue";
|
|
|
2799
2846
|
import { join as join11 } from "path";
|
|
2800
2847
|
var uploadQueueByKey = /* @__PURE__ */ new Map();
|
|
2801
2848
|
var fileUploadQueue = new PQueue2({ concurrency: 10 });
|
|
2849
|
+
var IMAGE_SIZE_SAFE_MEDIA_TYPES = /* @__PURE__ */ new Set([
|
|
2850
|
+
"image/png",
|
|
2851
|
+
"image/apng",
|
|
2852
|
+
"image/jpeg",
|
|
2853
|
+
"image/jpg",
|
|
2854
|
+
"image/jfif",
|
|
2855
|
+
"image/pjpeg",
|
|
2856
|
+
"image/pjp",
|
|
2857
|
+
"image/gif",
|
|
2858
|
+
"image/webp",
|
|
2859
|
+
"image/svg+xml"
|
|
2860
|
+
]);
|
|
2802
2861
|
var uploadFile = async ({
|
|
2803
2862
|
fileClient,
|
|
2804
2863
|
fileUrl,
|
|
2805
2864
|
directory,
|
|
2806
|
-
fileId
|
|
2865
|
+
fileId,
|
|
2866
|
+
warnIfLocalCopyMissing = true
|
|
2807
2867
|
}) => {
|
|
2808
2868
|
const key = `${fileId}-${fileUrl}`;
|
|
2809
2869
|
if (uploadQueueByKey.has(key)) {
|
|
@@ -2826,9 +2886,11 @@ var uploadFile = async ({
|
|
|
2826
2886
|
const expectedFilePath = join11(writeDirectory, FILES_DIRECTORY_NAME, localFileName);
|
|
2827
2887
|
const fileInspect = await fsj3.inspectAsync(expectedFilePath);
|
|
2828
2888
|
if (fileInspect?.type !== "file") {
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2889
|
+
if (warnIfLocalCopyMissing) {
|
|
2890
|
+
console.warn(
|
|
2891
|
+
`Skipping file ${fileUrl} as we couldn't find a local copy (looked at ${expectedFilePath})`
|
|
2892
|
+
);
|
|
2893
|
+
}
|
|
2832
2894
|
return null;
|
|
2833
2895
|
}
|
|
2834
2896
|
const fileName = getFileNameFromUrl(fileUrl);
|
|
@@ -2860,7 +2922,7 @@ var uploadFile = async ({
|
|
|
2860
2922
|
uploadBody = createReadStream(expectedFilePath);
|
|
2861
2923
|
}
|
|
2862
2924
|
const { width, height } = await (async () => {
|
|
2863
|
-
if (!
|
|
2925
|
+
if (!IMAGE_SIZE_SAFE_MEDIA_TYPES.has(mimeType)) {
|
|
2864
2926
|
return {
|
|
2865
2927
|
width: void 0,
|
|
2866
2928
|
height: void 0
|
|
@@ -2989,27 +3051,37 @@ var downloadFileForAsset = async ({
|
|
|
2989
3051
|
directory,
|
|
2990
3052
|
fileClient
|
|
2991
3053
|
}) => {
|
|
2992
|
-
|
|
3054
|
+
const fields = asset.asset.fields;
|
|
3055
|
+
if (!fields) {
|
|
2993
3056
|
return null;
|
|
2994
3057
|
}
|
|
2995
|
-
const fileId =
|
|
2996
|
-
|
|
2997
|
-
|
|
3058
|
+
const fileId = fields.file?.value;
|
|
3059
|
+
if (!fileId) {
|
|
3060
|
+
return null;
|
|
3061
|
+
}
|
|
3062
|
+
const fileUrl = fields.url?.value;
|
|
3063
|
+
if (!fileUrl) {
|
|
2998
3064
|
return null;
|
|
2999
3065
|
}
|
|
3000
|
-
return downloadFile({ fileUrl, directory, fileClient });
|
|
3066
|
+
return downloadFile({ fileUrl, fileId, directory, fileClient });
|
|
3001
3067
|
};
|
|
3002
3068
|
var uploadFileForAsset = async ({
|
|
3003
3069
|
asset,
|
|
3004
3070
|
directory,
|
|
3005
3071
|
fileClient
|
|
3006
3072
|
}) => {
|
|
3007
|
-
|
|
3073
|
+
const fileId = asset.asset.fields?.file?.value;
|
|
3074
|
+
const fileUrl = asset.asset.fields?.url?.value;
|
|
3075
|
+
if (fileId === void 0 || !fileUrl) {
|
|
3008
3076
|
return null;
|
|
3009
3077
|
}
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3078
|
+
return uploadFile({
|
|
3079
|
+
fileUrl,
|
|
3080
|
+
directory,
|
|
3081
|
+
fileClient,
|
|
3082
|
+
fileId,
|
|
3083
|
+
warnIfLocalCopyMissing: false
|
|
3084
|
+
});
|
|
3013
3085
|
};
|
|
3014
3086
|
var removeUrlsFromAssetParameters = (entity) => {
|
|
3015
3087
|
const treeWalker = ({ node }) => {
|
|
@@ -3311,6 +3383,25 @@ function writeCanvasPackage(filename, packageContents) {
|
|
|
3311
3383
|
|
|
3312
3384
|
// src/commands/canvas/commands/asset/pull.ts
|
|
3313
3385
|
var ASSET_PULL_ACTION_CONCURRENCY = 10;
|
|
3386
|
+
var prepareAssetForPull = async ({
|
|
3387
|
+
sourceObject,
|
|
3388
|
+
directory,
|
|
3389
|
+
fileClient
|
|
3390
|
+
}) => {
|
|
3391
|
+
delete sourceObject.object.asset._author;
|
|
3392
|
+
if (!sourceObject.object.asset.fields?.file) {
|
|
3393
|
+
return sourceObject;
|
|
3394
|
+
}
|
|
3395
|
+
const downloadedFile = await downloadFileForAsset({
|
|
3396
|
+
asset: sourceObject.object,
|
|
3397
|
+
directory,
|
|
3398
|
+
fileClient
|
|
3399
|
+
});
|
|
3400
|
+
if (downloadedFile?.id) {
|
|
3401
|
+
sourceObject.object.asset.fields.file.value = downloadedFile.id;
|
|
3402
|
+
}
|
|
3403
|
+
return sourceObject;
|
|
3404
|
+
};
|
|
3314
3405
|
var AssetPullModule = {
|
|
3315
3406
|
command: "pull <directory>",
|
|
3316
3407
|
describe: "Pulls all assets to local files in a directory",
|
|
@@ -3417,27 +3508,70 @@ var AssetPullModule = {
|
|
|
3417
3508
|
return sourceObject;
|
|
3418
3509
|
},
|
|
3419
3510
|
compareContents: compareAssetsWithoutUrls,
|
|
3420
|
-
onBeforeWriteObject:
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
const downloadedFile = await downloadFileForAsset({
|
|
3426
|
-
asset: sourceObject.object,
|
|
3427
|
-
directory,
|
|
3428
|
-
fileClient
|
|
3429
|
-
});
|
|
3430
|
-
if (downloadedFile?.id) {
|
|
3431
|
-
sourceObject.object.asset.fields.file.value = downloadedFile.id;
|
|
3432
|
-
}
|
|
3433
|
-
return sourceObject;
|
|
3434
|
-
}
|
|
3511
|
+
onBeforeWriteObject: (sourceObject) => prepareAssetForPull({
|
|
3512
|
+
sourceObject,
|
|
3513
|
+
directory,
|
|
3514
|
+
fileClient
|
|
3515
|
+
})
|
|
3435
3516
|
});
|
|
3436
3517
|
}
|
|
3437
3518
|
};
|
|
3438
3519
|
|
|
3439
3520
|
// src/commands/canvas/commands/asset/push.ts
|
|
3521
|
+
import { join as join13 } from "path";
|
|
3440
3522
|
var ASSET_PUSH_ACTION_CONCURRENCY = 10;
|
|
3523
|
+
var getExpectedFilePath = (directory, fileUrl) => {
|
|
3524
|
+
if (!fileUrl) {
|
|
3525
|
+
return "Unavailable because the asset has no file URL";
|
|
3526
|
+
}
|
|
3527
|
+
try {
|
|
3528
|
+
return join13(getFilesDirectory(directory), FILES_DIRECTORY_NAME, urlToFileName(fileUrl));
|
|
3529
|
+
} catch {
|
|
3530
|
+
return "Unavailable because the asset file URL is invalid";
|
|
3531
|
+
}
|
|
3532
|
+
};
|
|
3533
|
+
var prepareAssetForPush = async ({
|
|
3534
|
+
sourceObject,
|
|
3535
|
+
directory,
|
|
3536
|
+
fileClient,
|
|
3537
|
+
targetProjectId
|
|
3538
|
+
}) => {
|
|
3539
|
+
const fields = sourceObject.object.asset.fields;
|
|
3540
|
+
const fileId = fields?.file?.value;
|
|
3541
|
+
if (!fields || !fileId) {
|
|
3542
|
+
return sourceObject;
|
|
3543
|
+
}
|
|
3544
|
+
const uploadedFile = await uploadFileForAsset({
|
|
3545
|
+
asset: sourceObject.object,
|
|
3546
|
+
directory,
|
|
3547
|
+
fileClient
|
|
3548
|
+
});
|
|
3549
|
+
if (!uploadedFile) {
|
|
3550
|
+
const assetId = sourceObject.object.asset._id;
|
|
3551
|
+
const fileUrl = fields.url?.value;
|
|
3552
|
+
const expectedFilePath = getExpectedFilePath(directory, fileUrl);
|
|
3553
|
+
throw new Error(
|
|
3554
|
+
[
|
|
3555
|
+
`Unable to push asset "${sourceObject.displayName ?? assetId}" (${assetId}) because its file could not be uploaded.`,
|
|
3556
|
+
`Source project ID: ${sourceObject.object.projectId ?? "Unavailable"}`,
|
|
3557
|
+
`Target project ID: ${targetProjectId}`,
|
|
3558
|
+
`File ID: ${fileId}`,
|
|
3559
|
+
`File URL: ${fileUrl || "Missing"}`,
|
|
3560
|
+
`Expected local path: ${expectedFilePath}`,
|
|
3561
|
+
`Remove the asset with the ID ${assetId} before pushing again.`
|
|
3562
|
+
].join("\n")
|
|
3563
|
+
);
|
|
3564
|
+
}
|
|
3565
|
+
fields.file = {
|
|
3566
|
+
type: "file",
|
|
3567
|
+
value: uploadedFile.id
|
|
3568
|
+
};
|
|
3569
|
+
fields.url = {
|
|
3570
|
+
type: "text",
|
|
3571
|
+
value: uploadedFile.url
|
|
3572
|
+
};
|
|
3573
|
+
return sourceObject;
|
|
3574
|
+
};
|
|
3441
3575
|
var AssetPushModule = {
|
|
3442
3576
|
command: "push <directory>",
|
|
3443
3577
|
describe: "Pushes all assets from files in a directory to Uniform",
|
|
@@ -3523,27 +3657,12 @@ var AssetPushModule = {
|
|
|
3523
3657
|
return sourceObject;
|
|
3524
3658
|
},
|
|
3525
3659
|
compareContents: compareAssetsWithoutUrls,
|
|
3526
|
-
onBeforeWriteObject:
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
if (uploadedFile !== null) {
|
|
3533
|
-
if (sourceObject.object.asset.fields === void 0) {
|
|
3534
|
-
sourceObject.object.asset.fields = {};
|
|
3535
|
-
}
|
|
3536
|
-
sourceObject.object.asset.fields.file = {
|
|
3537
|
-
type: "file",
|
|
3538
|
-
value: uploadedFile.id
|
|
3539
|
-
};
|
|
3540
|
-
sourceObject.object.asset.fields.url = {
|
|
3541
|
-
type: "text",
|
|
3542
|
-
value: uploadedFile.url
|
|
3543
|
-
};
|
|
3544
|
-
}
|
|
3545
|
-
return sourceObject;
|
|
3546
|
-
}
|
|
3660
|
+
onBeforeWriteObject: (sourceObject) => prepareAssetForPush({
|
|
3661
|
+
sourceObject,
|
|
3662
|
+
directory,
|
|
3663
|
+
fileClient,
|
|
3664
|
+
targetProjectId: projectId
|
|
3665
|
+
})
|
|
3547
3666
|
});
|
|
3548
3667
|
}
|
|
3549
3668
|
};
|
|
@@ -4659,11 +4778,11 @@ function splitSerializedIds(ids) {
|
|
|
4659
4778
|
return ids.split(",").map((id) => id.trim()).filter(Boolean);
|
|
4660
4779
|
}
|
|
4661
4780
|
function toRawEntityIds(serializedIds) {
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
});
|
|
4666
|
-
return
|
|
4781
|
+
return Array.from(new Set(serializedIds.map(toRawEntityId)));
|
|
4782
|
+
}
|
|
4783
|
+
function toRawEntityId(serializedId) {
|
|
4784
|
+
const { id, editionId } = parseSerializedId(serializedId);
|
|
4785
|
+
return editionId ?? id;
|
|
4667
4786
|
}
|
|
4668
4787
|
|
|
4669
4788
|
// src/commands/canvas/componentInstanceEngineDataSource.ts
|
|
@@ -5412,9 +5531,9 @@ var CompositionUnpublishModule = {
|
|
|
5412
5531
|
console.log(`Composition ${id} did not have a draft (removing published)`);
|
|
5413
5532
|
}
|
|
5414
5533
|
if (!whatIf) {
|
|
5415
|
-
const { id: compositionId
|
|
5534
|
+
const { id: compositionId } = parseSerializedId(id);
|
|
5416
5535
|
actions.push(
|
|
5417
|
-
client.unpublish({ compositionId, editionId }).catch((err) => {
|
|
5536
|
+
client.unpublish({ compositionId, editionId: toRawEntityId(id) }).catch((err) => {
|
|
5418
5537
|
const isNotFound = err instanceof ApiClientError && err.statusCode === 404;
|
|
5419
5538
|
if (isNotFound) {
|
|
5420
5539
|
console.warn(
|
|
@@ -7210,9 +7329,9 @@ var EntryUnpublishModule = {
|
|
|
7210
7329
|
console.log(`Entry ${id} did not have a draft (removing published)`);
|
|
7211
7330
|
}
|
|
7212
7331
|
if (!whatIf) {
|
|
7213
|
-
const { id: entryId
|
|
7332
|
+
const { id: entryId } = parseSerializedId(id);
|
|
7214
7333
|
actions.push(
|
|
7215
|
-
client.unpublish({ entryId, editionId }).catch((err) => {
|
|
7334
|
+
client.unpublish({ entryId, editionId: toRawEntityId(id) }).catch((err) => {
|
|
7216
7335
|
const isNotFound = err instanceof ApiClientError3 && err.statusCode === 404;
|
|
7217
7336
|
if (isNotFound) {
|
|
7218
7337
|
console.warn(
|
|
@@ -7781,9 +7900,9 @@ var EntryPatternUnpublishModule = {
|
|
|
7781
7900
|
console.log(`Entry pattern ${id} did not have a draft (removing published)`);
|
|
7782
7901
|
}
|
|
7783
7902
|
if (!whatIf) {
|
|
7784
|
-
const { id: entryId
|
|
7903
|
+
const { id: entryId } = parseSerializedId(id);
|
|
7785
7904
|
actions.push(
|
|
7786
|
-
client.unpublish({ entryId, editionId }).catch((err) => {
|
|
7905
|
+
client.unpublish({ entryId, editionId: toRawEntityId(id) }).catch((err) => {
|
|
7787
7906
|
const isNotFound = err instanceof ApiClientError4 && err.statusCode === 404;
|
|
7788
7907
|
if (isNotFound) {
|
|
7789
7908
|
console.warn(
|
|
@@ -9172,7 +9291,6 @@ var PromptUpdateModule = {
|
|
|
9172
9291
|
// src/commands/canvas/commands/prompts.ts
|
|
9173
9292
|
var PromptModule = {
|
|
9174
9293
|
command: "prompt <command>",
|
|
9175
|
-
aliases: ["dt"],
|
|
9176
9294
|
describe: "Commands for AI Prompt definitions",
|
|
9177
9295
|
builder: (yargs44) => yargs44.command(PromptGetModule).command(PromptListModule).command(PromptPullModule).command(PromptPushModule).command(PromptRemoveModule).command(PromptUpdateModule).demandCommand(),
|
|
9178
9296
|
handler: () => {
|
|
@@ -12109,7 +12227,7 @@ var PolicyDocumentsPullModule = {
|
|
|
12109
12227
|
// src/commands/policy-documents/commands/push.ts
|
|
12110
12228
|
import { existsSync as existsSync8, mkdirSync as mkdirSync4 } from "fs";
|
|
12111
12229
|
import { readdir as readdir2 } from "fs/promises";
|
|
12112
|
-
import { extname as extname3, join as
|
|
12230
|
+
import { extname as extname3, join as join14 } from "path";
|
|
12113
12231
|
async function readLocalPolicyDocuments(directory, format, verbose) {
|
|
12114
12232
|
const files = await readdir2(directory);
|
|
12115
12233
|
const policyDocuments = {};
|
|
@@ -12119,7 +12237,7 @@ async function readLocalPolicyDocuments(directory, format, verbose) {
|
|
|
12119
12237
|
if (ext !== `.${format}` && ext !== ".yaml" && ext !== ".yml" && ext !== ".json") {
|
|
12120
12238
|
continue;
|
|
12121
12239
|
}
|
|
12122
|
-
const filePath =
|
|
12240
|
+
const filePath = join14(directory, filename);
|
|
12123
12241
|
try {
|
|
12124
12242
|
let roleId = filename.replace(ext, "");
|
|
12125
12243
|
const fileContent = readFileToObject(filePath);
|
|
@@ -12602,7 +12720,6 @@ var ProjectMapNodeGetModule = {
|
|
|
12602
12720
|
handler: async ({ apiHost, apiKey, proxy, id, projectMapId, format, project: projectId, filename }) => {
|
|
12603
12721
|
const fetch2 = nodeFetchProxy(proxy);
|
|
12604
12722
|
const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
12605
|
-
console.log("Debugging params for node get", { projectMapId, id, projectId });
|
|
12606
12723
|
const res = await client.getNodes({ projectMapId, id });
|
|
12607
12724
|
if (res.nodes?.length === 0) {
|
|
12608
12725
|
console.error("Project map node does not exist");
|
|
@@ -13921,6 +14038,9 @@ var SyncPushModule = {
|
|
|
13921
14038
|
successText: (outcome) => outcome.skippedReason ? `skipped ${label}: ${outcome.skippedReason}` : `published ${label}`,
|
|
13922
14039
|
failLabel: `publishing ${label}`,
|
|
13923
14040
|
run: async () => {
|
|
14041
|
+
if (otherParams.whatIf) {
|
|
14042
|
+
return { skippedReason: "what-if run did not write preview" };
|
|
14043
|
+
}
|
|
13924
14044
|
let ids;
|
|
13925
14045
|
if (scope === "pushed") {
|
|
13926
14046
|
const written = pushedIds.get(entityType) ?? [];
|
|
@@ -14080,14 +14200,14 @@ import { existsSync as existsSync9, promises as fs8 } from "fs";
|
|
|
14080
14200
|
import { get as getHttp } from "http";
|
|
14081
14201
|
import { get as getHttps } from "https";
|
|
14082
14202
|
import { tmpdir as tmpdir2 } from "os";
|
|
14083
|
-
import { join as
|
|
14203
|
+
import { join as join15 } from "path";
|
|
14084
14204
|
import registryUrl from "registry-url";
|
|
14085
14205
|
import { URL as URL2 } from "url";
|
|
14086
14206
|
var compareVersions = (a, b) => a.localeCompare(b, "en-US", { numeric: true });
|
|
14087
14207
|
var encode = (value) => encodeURIComponent(value).replace(/^%40/, "@");
|
|
14088
14208
|
var getFile = async (details, distTag) => {
|
|
14089
14209
|
const rootDir = tmpdir2();
|
|
14090
|
-
const subDir =
|
|
14210
|
+
const subDir = join15(rootDir, "update-check");
|
|
14091
14211
|
if (!existsSync9(subDir)) {
|
|
14092
14212
|
await fs8.mkdir(subDir);
|
|
14093
14213
|
}
|
|
@@ -14095,7 +14215,7 @@ var getFile = async (details, distTag) => {
|
|
|
14095
14215
|
if (details.scope) {
|
|
14096
14216
|
name = `${details.scope}-${name}`;
|
|
14097
14217
|
}
|
|
14098
|
-
return
|
|
14218
|
+
return join15(subDir, name);
|
|
14099
14219
|
};
|
|
14100
14220
|
var evaluateCache = async (file, time, interval) => {
|
|
14101
14221
|
if (existsSync9(file)) {
|
|
@@ -14250,7 +14370,7 @@ var checkForUpdateMiddleware = async ({ verbose }) => {
|
|
|
14250
14370
|
|
|
14251
14371
|
// src/middleware/checkLocalDepsVersionsMiddleware.ts
|
|
14252
14372
|
import { magenta, red as red8 } from "colorette";
|
|
14253
|
-
import { join as
|
|
14373
|
+
import { join as join16 } from "path";
|
|
14254
14374
|
var uniformStrictVersions = [
|
|
14255
14375
|
"@uniformdev/canvas",
|
|
14256
14376
|
"@uniformdev/canvas-next",
|
|
@@ -14272,7 +14392,7 @@ var checkLocalDepsVersions = async (args) => {
|
|
|
14272
14392
|
try {
|
|
14273
14393
|
let isOutside = false;
|
|
14274
14394
|
let warning = `${magenta("Warning:")} Installed Uniform packages should be the same version`;
|
|
14275
|
-
const localPackages = await tryReadJSON(
|
|
14395
|
+
const localPackages = await tryReadJSON(join16(process.cwd(), "package.json"));
|
|
14276
14396
|
if (!localPackages) return;
|
|
14277
14397
|
let firstVersion;
|
|
14278
14398
|
const allDependencies = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/cli",
|
|
3
|
-
"version": "20.74.6-alpha.
|
|
3
|
+
"version": "20.74.6-alpha.7.sha-23d7a1d929",
|
|
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.74.6-alpha.
|
|
31
|
-
"@uniformdev/automations-sdk": "20.74.6-alpha.
|
|
32
|
-
"@uniformdev/canvas": "20.74.6-alpha.
|
|
33
|
-
"@uniformdev/context": "20.74.6-alpha.
|
|
34
|
-
"@uniformdev/files": "20.74.6-alpha.
|
|
35
|
-
"@uniformdev/project-map": "20.74.6-alpha.
|
|
36
|
-
"@uniformdev/redirect": "20.74.6-alpha.
|
|
37
|
-
"@uniformdev/richtext": "20.74.6-alpha.
|
|
30
|
+
"@uniformdev/assets": "20.74.6-alpha.7.sha-23d7a1d929",
|
|
31
|
+
"@uniformdev/automations-sdk": "20.74.6-alpha.7.sha-23d7a1d929",
|
|
32
|
+
"@uniformdev/canvas": "20.74.6-alpha.7.sha-23d7a1d929",
|
|
33
|
+
"@uniformdev/context": "20.74.6-alpha.7.sha-23d7a1d929",
|
|
34
|
+
"@uniformdev/files": "20.74.6-alpha.7.sha-23d7a1d929",
|
|
35
|
+
"@uniformdev/project-map": "20.74.6-alpha.7.sha-23d7a1d929",
|
|
36
|
+
"@uniformdev/redirect": "20.74.6-alpha.7.sha-23d7a1d929",
|
|
37
|
+
"@uniformdev/richtext": "20.74.6-alpha.7.sha-23d7a1d929",
|
|
38
38
|
"call-bind": "^1.0.2",
|
|
39
39
|
"colorette": "2.0.20",
|
|
40
40
|
"cosmiconfig": "9.0.2",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"fs-jetpack": "5.1.0",
|
|
48
48
|
"image-size": "2.0.2",
|
|
49
49
|
"isomorphic-git": "1.38.5",
|
|
50
|
-
"js-yaml": "^4.
|
|
50
|
+
"js-yaml": "^4.3.1",
|
|
51
51
|
"jsonwebtoken": "9.0.3",
|
|
52
52
|
"mitt": "^3.0.1",
|
|
53
53
|
"normalize-newline": "^4.1.0",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"registry-url": "^6.0.0",
|
|
60
60
|
"slugify": "1.6.9",
|
|
61
61
|
"svix": "^1.96.0",
|
|
62
|
-
"undici": "^7.
|
|
62
|
+
"undici": "^7.29.0",
|
|
63
63
|
"yargs": "^18.0.0",
|
|
64
64
|
"zod": "4.4.3"
|
|
65
65
|
},
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"publishConfig": {
|
|
79
79
|
"access": "public"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "23d7a1d929f2626dc09db5965d8aa6d25588d67c"
|
|
82
82
|
}
|