@uniformdev/cli 19.69.0 → 19.71.1-alpha.103
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.d.mts +2 -2
- package/dist/index.mjs +536 -319
- package/package.json +18 -18
package/dist/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
7
7
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
8
8
|
});
|
|
9
9
|
|
|
10
|
-
// ../../node_modules/.pnpm/tsup@7.
|
|
10
|
+
// ../../node_modules/.pnpm/tsup@8.0.1_@microsoft+api-extractor@7.36.3_postcss@8.4.31_typescript@5.3.2/node_modules/tsup/assets/esm_shims.js
|
|
11
11
|
import { fileURLToPath } from "url";
|
|
12
12
|
import path from "path";
|
|
13
13
|
var getFilename = () => fileURLToPath(import.meta.url);
|
|
@@ -16,11 +16,11 @@ var __dirname = /* @__PURE__ */ getDirname();
|
|
|
16
16
|
|
|
17
17
|
// src/index.ts
|
|
18
18
|
import * as dotenv from "dotenv";
|
|
19
|
-
import
|
|
19
|
+
import yargs27 from "yargs";
|
|
20
20
|
import { hideBin } from "yargs/helpers";
|
|
21
21
|
|
|
22
22
|
// src/commands/canvas/index.ts
|
|
23
|
-
import
|
|
23
|
+
import yargs11 from "yargs";
|
|
24
24
|
|
|
25
25
|
// src/commands/canvas/commands/asset.ts
|
|
26
26
|
import yargs from "yargs";
|
|
@@ -137,14 +137,14 @@ import httpsProxyAgent from "https-proxy-agent";
|
|
|
137
137
|
import unfetch from "isomorphic-unfetch";
|
|
138
138
|
import { dump, load } from "js-yaml";
|
|
139
139
|
import { dirname, extname, isAbsolute, resolve, sep } from "path";
|
|
140
|
-
function withConfiguration(
|
|
141
|
-
return
|
|
140
|
+
function withConfiguration(yargs28) {
|
|
141
|
+
return yargs28.option("serialization", {
|
|
142
142
|
skipValidation: true,
|
|
143
143
|
hidden: true
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
|
-
function withApiOptions(
|
|
147
|
-
return
|
|
146
|
+
function withApiOptions(yargs28) {
|
|
147
|
+
return yargs28.option("apiKey", {
|
|
148
148
|
describe: "Uniform API key. Defaults to UNIFORM_CLI_API_KEY or UNIFORM_API_KEY env. Supports dotenv.",
|
|
149
149
|
default: process.env.UNIFORM_CLI_API_KEY ?? // deprecated
|
|
150
150
|
process.env.CANVAS_CLI_API_KEY ?? // deprecated
|
|
@@ -183,8 +183,8 @@ function nodeFetchProxy(proxy) {
|
|
|
183
183
|
};
|
|
184
184
|
return wrappedFetch;
|
|
185
185
|
}
|
|
186
|
-
function withProjectOptions(
|
|
187
|
-
return
|
|
186
|
+
function withProjectOptions(yargs28) {
|
|
187
|
+
return yargs28.option("project", {
|
|
188
188
|
describe: "Uniform project ID. Defaults to UNIFORM_CLI_PROJECT_ID or UNIFORM_PROJECT_ID env. Supports dotenv.",
|
|
189
189
|
default: process.env.UNIFORM_CLI_PROJECT_ID ?? // deprecated
|
|
190
190
|
process.env.CANVAS_CLI_PROJECT_ID ?? // deprecated
|
|
@@ -194,8 +194,8 @@ function withProjectOptions(yargs27) {
|
|
|
194
194
|
alias: ["p"]
|
|
195
195
|
});
|
|
196
196
|
}
|
|
197
|
-
function withFormatOptions(
|
|
198
|
-
return
|
|
197
|
+
function withFormatOptions(yargs28) {
|
|
198
|
+
return yargs28.option("format", {
|
|
199
199
|
alias: ["f"],
|
|
200
200
|
describe: "Output format",
|
|
201
201
|
default: "yaml",
|
|
@@ -207,8 +207,8 @@ function withFormatOptions(yargs27) {
|
|
|
207
207
|
type: "string"
|
|
208
208
|
});
|
|
209
209
|
}
|
|
210
|
-
function withDiffOptions(
|
|
211
|
-
return
|
|
210
|
+
function withDiffOptions(yargs28) {
|
|
211
|
+
return yargs28.option("diff", {
|
|
212
212
|
describe: "Whether to show diffs in stdout. off = no diffs; update = on for updates; on = updates, creates, deletes. Can be set by UNIFORM_CLI_DIFF_MODE environment variable.",
|
|
213
213
|
default: process.env.UNIFORM_CLI_DIFF_MODE ?? "off",
|
|
214
214
|
type: "string",
|
|
@@ -632,12 +632,12 @@ function createPublishStatusSyncEngineConsoleLogger(options) {
|
|
|
632
632
|
var AssetGetModule = {
|
|
633
633
|
command: "get <id>",
|
|
634
634
|
describe: "Get an asset",
|
|
635
|
-
builder: (
|
|
635
|
+
builder: (yargs28) => withConfiguration(
|
|
636
636
|
withFormatOptions(
|
|
637
637
|
withApiOptions(
|
|
638
638
|
withProjectOptions(
|
|
639
639
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
640
|
-
|
|
640
|
+
yargs28.positional("id", { demandOption: true, describe: "Asset ID to fetch" })
|
|
641
641
|
)
|
|
642
642
|
)
|
|
643
643
|
)
|
|
@@ -658,7 +658,7 @@ import { UncachedAssetClient as UncachedAssetClient2 } from "@uniformdev/assets"
|
|
|
658
658
|
var AssetListModule = {
|
|
659
659
|
command: "list",
|
|
660
660
|
describe: "List assets",
|
|
661
|
-
builder: (
|
|
661
|
+
builder: (yargs28) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs28)))),
|
|
662
662
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
663
663
|
const fetch3 = nodeFetchProxy(proxy);
|
|
664
664
|
const client = new UncachedAssetClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -677,7 +677,7 @@ import { createHash } from "crypto";
|
|
|
677
677
|
import fsj from "fs-jetpack";
|
|
678
678
|
import sizeOf from "image-size";
|
|
679
679
|
import PQueue from "p-queue";
|
|
680
|
-
import { join as join2 } from "path";
|
|
680
|
+
import { dirname as dirname2, join as join2 } from "path";
|
|
681
681
|
var FILES_DIRECTORY_NAME = "files";
|
|
682
682
|
var urlToHash = (url) => {
|
|
683
683
|
const hash = createHash("sha256");
|
|
@@ -691,8 +691,10 @@ var urlToFileName = (url) => {
|
|
|
691
691
|
return `${fileName}${fileExtension ? `.${fileExtension}` : ""}`;
|
|
692
692
|
};
|
|
693
693
|
var deleteDownloadedFileByUrl = async (url, options) => {
|
|
694
|
+
const isPackage = isPathAPackageFile(options.directory);
|
|
695
|
+
const writeDirectory = isPackage ? dirname2(options.directory) : options.directory;
|
|
694
696
|
const fileName = urlToFileName(url);
|
|
695
|
-
const fileToDelete = join2(
|
|
697
|
+
const fileToDelete = join2(writeDirectory, FILES_DIRECTORY_NAME, fileName);
|
|
696
698
|
try {
|
|
697
699
|
await fsj.removeAsync(fileToDelete);
|
|
698
700
|
} catch {
|
|
@@ -704,6 +706,8 @@ var extractAndDownloadUniformFilesForObject = async (object, options) => {
|
|
|
704
706
|
const uniformFileUrlMatches = objectAsString.matchAll(
|
|
705
707
|
/"(https:\/\/(.*)?img\.uniform\.(rocks|global)\/(.*?))"/g
|
|
706
708
|
);
|
|
709
|
+
const isPackage = isPathAPackageFile(options.directory);
|
|
710
|
+
const writeDirectory = isPackage ? dirname2(options.directory) : options.directory;
|
|
707
711
|
if (uniformFileUrlMatches) {
|
|
708
712
|
const fileDownloadQueue = new PQueue({ concurrency: 10 });
|
|
709
713
|
for (const match of uniformFileUrlMatches) {
|
|
@@ -713,7 +717,7 @@ var extractAndDownloadUniformFilesForObject = async (object, options) => {
|
|
|
713
717
|
const fetchUrl = `${url.origin}${url.pathname}?format=original`;
|
|
714
718
|
const fileName = urlToFileName(url.toString());
|
|
715
719
|
const fileAlreadyExists = await fsj.existsAsync(
|
|
716
|
-
join2(
|
|
720
|
+
join2(writeDirectory, FILES_DIRECTORY_NAME, fileName)
|
|
717
721
|
);
|
|
718
722
|
if (fileAlreadyExists) {
|
|
719
723
|
return;
|
|
@@ -723,10 +727,7 @@ var extractAndDownloadUniformFilesForObject = async (object, options) => {
|
|
|
723
727
|
return;
|
|
724
728
|
}
|
|
725
729
|
const fileBuffer = await response.arrayBuffer();
|
|
726
|
-
await fsj.writeAsync(
|
|
727
|
-
join2(options.directory, FILES_DIRECTORY_NAME, fileName),
|
|
728
|
-
Buffer.from(fileBuffer)
|
|
729
|
-
);
|
|
730
|
+
await fsj.writeAsync(join2(writeDirectory, FILES_DIRECTORY_NAME, fileName), Buffer.from(fileBuffer));
|
|
730
731
|
} catch {
|
|
731
732
|
console.warn(`Failed to download file ${url}`);
|
|
732
733
|
}
|
|
@@ -741,6 +742,8 @@ var extractAndUploadUniformFilesForObject = async (object, options) => {
|
|
|
741
742
|
const uniformFileUrlMatches = objectAsString.matchAll(
|
|
742
743
|
/"(https:\/\/(.*)?img\.uniform\.(rocks|global)\/(.*?))"/g
|
|
743
744
|
);
|
|
745
|
+
const isPackage = isPathAPackageFile(options.directory);
|
|
746
|
+
const writeDirectory = isPackage ? dirname2(options.directory) : options.directory;
|
|
744
747
|
if (uniformFileUrlMatches) {
|
|
745
748
|
const fileUploadQueue = new PQueue({ concurrency: 3 });
|
|
746
749
|
for (const match of uniformFileUrlMatches) {
|
|
@@ -757,14 +760,14 @@ var extractAndUploadUniformFilesForObject = async (object, options) => {
|
|
|
757
760
|
}
|
|
758
761
|
const localFileName = urlToFileName(url);
|
|
759
762
|
const fileExistsLocally = await fsj.existsAsync(
|
|
760
|
-
join2(
|
|
763
|
+
join2(writeDirectory, FILES_DIRECTORY_NAME, localFileName)
|
|
761
764
|
);
|
|
762
765
|
if (!fileExistsLocally) {
|
|
763
766
|
console.warn(`Skipping file ${url} as we couldn't find a local copy`);
|
|
764
767
|
return;
|
|
765
768
|
}
|
|
766
769
|
const fileBuffer = await fsj.readAsync(
|
|
767
|
-
join2(
|
|
770
|
+
join2(writeDirectory, FILES_DIRECTORY_NAME, localFileName),
|
|
768
771
|
"buffer"
|
|
769
772
|
);
|
|
770
773
|
if (!fileBuffer) {
|
|
@@ -782,9 +785,10 @@ var extractAndUploadUniformFilesForObject = async (object, options) => {
|
|
|
782
785
|
};
|
|
783
786
|
}
|
|
784
787
|
})();
|
|
788
|
+
const mimeType = preferredType(url.split(".").at(-1) ?? "");
|
|
785
789
|
const { id, method, uploadUrl } = await options.fileClient.insert({
|
|
786
790
|
name: fileName,
|
|
787
|
-
mediaType:
|
|
791
|
+
mediaType: mimeType,
|
|
788
792
|
size: fileBuffer.length,
|
|
789
793
|
width,
|
|
790
794
|
height,
|
|
@@ -792,7 +796,11 @@ var extractAndUploadUniformFilesForObject = async (object, options) => {
|
|
|
792
796
|
});
|
|
793
797
|
const uploadResponse = await fetch(uploadUrl, {
|
|
794
798
|
method,
|
|
795
|
-
body: fileBuffer
|
|
799
|
+
body: fileBuffer,
|
|
800
|
+
headers: {
|
|
801
|
+
"Content-Type": mimeType,
|
|
802
|
+
"Content-Length": fileBuffer.length.toString()
|
|
803
|
+
}
|
|
796
804
|
});
|
|
797
805
|
if (!uploadResponse.ok) {
|
|
798
806
|
console.warn(`Failed to upload file ${url}`);
|
|
@@ -851,16 +859,16 @@ var swapOutUniformFileUrlsForTargetProject = async (object, options) => {
|
|
|
851
859
|
return JSON.parse(objectAsString);
|
|
852
860
|
};
|
|
853
861
|
var updateAssetFileIdBasedOnUrl = async (asset, options) => {
|
|
854
|
-
var _a;
|
|
855
|
-
const fileUrl = (_a = asset.asset.
|
|
856
|
-
if (!fileUrl || !asset.asset.file) {
|
|
862
|
+
var _a, _b, _c;
|
|
863
|
+
const fileUrl = (_b = (_a = asset.asset.fields) == null ? void 0 : _a.url) == null ? void 0 : _b.value;
|
|
864
|
+
if (!fileUrl || !((_c = asset.asset.fields) == null ? void 0 : _c.file)) {
|
|
857
865
|
return asset;
|
|
858
866
|
}
|
|
859
867
|
const file = await options.fileClient.get({ url: fileUrl }).catch(() => null);
|
|
860
868
|
if (!file) {
|
|
861
869
|
return asset;
|
|
862
870
|
}
|
|
863
|
-
asset.asset.file.value = file.id;
|
|
871
|
+
asset.asset.fields.file.value = file.id;
|
|
864
872
|
return asset;
|
|
865
873
|
};
|
|
866
874
|
|
|
@@ -870,8 +878,8 @@ import { convertAssetToPutAsset } from "@uniformdev/assets";
|
|
|
870
878
|
// src/commands/canvas/commands/asset/_util.ts
|
|
871
879
|
var selectAssetIdentifier = (e) => e.asset._id;
|
|
872
880
|
var selectAssetDisplayName = (e) => {
|
|
873
|
-
var _a;
|
|
874
|
-
return `${((_a = e.asset.
|
|
881
|
+
var _a, _b;
|
|
882
|
+
return `${((_b = (_a = e.asset.fields) == null ? void 0 : _a.title) == null ? void 0 : _b.value) ?? "Untitled"} (pid: ${selectAssetIdentifier(e)})`;
|
|
875
883
|
};
|
|
876
884
|
|
|
877
885
|
// src/commands/canvas/util.ts
|
|
@@ -887,8 +895,8 @@ function prepCompositionForDisk(composition) {
|
|
|
887
895
|
delete prepped.state;
|
|
888
896
|
return prepped;
|
|
889
897
|
}
|
|
890
|
-
function withStateOptions(
|
|
891
|
-
return
|
|
898
|
+
function withStateOptions(yargs28) {
|
|
899
|
+
return yargs28.option("state", {
|
|
892
900
|
type: "string",
|
|
893
901
|
describe: `Composition state to fetch.`,
|
|
894
902
|
choices: ["preview", "published"],
|
|
@@ -954,11 +962,11 @@ function writeCanvasPackage(filename, packageContents) {
|
|
|
954
962
|
var AssetPullModule = {
|
|
955
963
|
command: "pull <directory>",
|
|
956
964
|
describe: "Pulls all assets to local files in a directory",
|
|
957
|
-
builder: (
|
|
965
|
+
builder: (yargs28) => withConfiguration(
|
|
958
966
|
withApiOptions(
|
|
959
967
|
withProjectOptions(
|
|
960
968
|
withDiffOptions(
|
|
961
|
-
|
|
969
|
+
yargs28.positional("directory", {
|
|
962
970
|
describe: "Directory to save the assets to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
963
971
|
type: "string"
|
|
964
972
|
}).option("format", {
|
|
@@ -1005,12 +1013,12 @@ var AssetPullModule = {
|
|
|
1005
1013
|
let target;
|
|
1006
1014
|
const isPackage = isPathAPackageFile(directory);
|
|
1007
1015
|
const onBeforeDeleteObject = async (id, object) => {
|
|
1008
|
-
var _a;
|
|
1016
|
+
var _a, _b;
|
|
1009
1017
|
const asset = object.object;
|
|
1010
|
-
if (!((_a = asset.asset.
|
|
1018
|
+
if (!((_b = (_a = asset.asset.fields) == null ? void 0 : _a.url) == null ? void 0 : _b.value)) {
|
|
1011
1019
|
return;
|
|
1012
1020
|
}
|
|
1013
|
-
await deleteDownloadedFileByUrl(asset.asset.url.value, {
|
|
1021
|
+
await deleteDownloadedFileByUrl(asset.asset.fields.url.value, {
|
|
1014
1022
|
directory
|
|
1015
1023
|
});
|
|
1016
1024
|
};
|
|
@@ -1062,11 +1070,11 @@ import { UncachedFileClient } from "@uniformdev/files";
|
|
|
1062
1070
|
var AssetPushModule = {
|
|
1063
1071
|
command: "push <directory>",
|
|
1064
1072
|
describe: "Pushes all assets from files in a directory to Uniform",
|
|
1065
|
-
builder: (
|
|
1073
|
+
builder: (yargs28) => withConfiguration(
|
|
1066
1074
|
withApiOptions(
|
|
1067
1075
|
withProjectOptions(
|
|
1068
1076
|
withDiffOptions(
|
|
1069
|
-
|
|
1077
|
+
yargs28.positional("directory", {
|
|
1070
1078
|
describe: "Directory to read the assets from. If a filename is used, a package will be read instead.",
|
|
1071
1079
|
type: "string"
|
|
1072
1080
|
}).option("what-if", {
|
|
@@ -1164,9 +1172,9 @@ var AssetRemoveModule = {
|
|
|
1164
1172
|
command: "remove <id>",
|
|
1165
1173
|
aliases: ["delete", "rm"],
|
|
1166
1174
|
describe: "Delete an asset",
|
|
1167
|
-
builder: (
|
|
1175
|
+
builder: (yargs28) => withConfiguration(
|
|
1168
1176
|
withApiOptions(
|
|
1169
|
-
withProjectOptions(
|
|
1177
|
+
withProjectOptions(yargs28.positional("id", { demandOption: true, describe: "Asset ID to delete" }))
|
|
1170
1178
|
)
|
|
1171
1179
|
),
|
|
1172
1180
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
@@ -1182,10 +1190,10 @@ var AssetUpdateModule = {
|
|
|
1182
1190
|
command: "update <filename>",
|
|
1183
1191
|
aliases: ["put"],
|
|
1184
1192
|
describe: "Insert or update an asset",
|
|
1185
|
-
builder: (
|
|
1193
|
+
builder: (yargs28) => withConfiguration(
|
|
1186
1194
|
withApiOptions(
|
|
1187
1195
|
withProjectOptions(
|
|
1188
|
-
|
|
1196
|
+
yargs28.positional("filename", { demandOption: true, describe: "Asset file to put" })
|
|
1189
1197
|
)
|
|
1190
1198
|
)
|
|
1191
1199
|
),
|
|
@@ -1201,7 +1209,7 @@ var AssetUpdateModule = {
|
|
|
1201
1209
|
var AssetModule = {
|
|
1202
1210
|
command: "asset <command>",
|
|
1203
1211
|
describe: "Commands for Assets",
|
|
1204
|
-
builder: (
|
|
1212
|
+
builder: (yargs28) => yargs28.command(AssetGetModule).command(AssetListModule).command(AssetRemoveModule).command(AssetUpdateModule).command(AssetPullModule).command(AssetPushModule).demandCommand(),
|
|
1205
1213
|
handler: () => {
|
|
1206
1214
|
yargs.help();
|
|
1207
1215
|
}
|
|
@@ -1215,11 +1223,11 @@ import { UncachedCategoryClient } from "@uniformdev/canvas";
|
|
|
1215
1223
|
var CategoryGetModule = {
|
|
1216
1224
|
command: "get <id>",
|
|
1217
1225
|
describe: "Fetch a category",
|
|
1218
|
-
builder: (
|
|
1226
|
+
builder: (yargs28) => withConfiguration(
|
|
1219
1227
|
withFormatOptions(
|
|
1220
1228
|
withApiOptions(
|
|
1221
1229
|
withProjectOptions(
|
|
1222
|
-
|
|
1230
|
+
yargs28.positional("id", { demandOption: true, describe: "Category UUID to fetch" })
|
|
1223
1231
|
)
|
|
1224
1232
|
)
|
|
1225
1233
|
)
|
|
@@ -1244,7 +1252,7 @@ var CategoryListModule = {
|
|
|
1244
1252
|
command: "list",
|
|
1245
1253
|
describe: "List categories",
|
|
1246
1254
|
aliases: ["ls"],
|
|
1247
|
-
builder: (
|
|
1255
|
+
builder: (yargs28) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs28.options({}))))),
|
|
1248
1256
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
1249
1257
|
const fetch3 = nodeFetchProxy(proxy);
|
|
1250
1258
|
const client = new UncachedCategoryClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -1293,11 +1301,11 @@ function createCategoriesEngineDataSource({
|
|
|
1293
1301
|
var CategoryPullModule = {
|
|
1294
1302
|
command: "pull <directory>",
|
|
1295
1303
|
describe: "Pulls all categories to local files in a directory",
|
|
1296
|
-
builder: (
|
|
1304
|
+
builder: (yargs28) => withConfiguration(
|
|
1297
1305
|
withApiOptions(
|
|
1298
1306
|
withProjectOptions(
|
|
1299
1307
|
withDiffOptions(
|
|
1300
|
-
|
|
1308
|
+
yargs28.positional("directory", {
|
|
1301
1309
|
describe: "Directory to save the categories to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
1302
1310
|
type: "string"
|
|
1303
1311
|
}).option("format", {
|
|
@@ -1373,11 +1381,11 @@ import { UncachedCategoryClient as UncachedCategoryClient4 } from "@uniformdev/c
|
|
|
1373
1381
|
var CategoryPushModule = {
|
|
1374
1382
|
command: "push <directory>",
|
|
1375
1383
|
describe: "Pushes all categories from files in a directory to Uniform Canvas",
|
|
1376
|
-
builder: (
|
|
1384
|
+
builder: (yargs28) => withConfiguration(
|
|
1377
1385
|
withApiOptions(
|
|
1378
1386
|
withProjectOptions(
|
|
1379
1387
|
withDiffOptions(
|
|
1380
|
-
|
|
1388
|
+
yargs28.positional("directory", {
|
|
1381
1389
|
describe: "Directory to read the categories from. If a filename is used, a package will be read instead.",
|
|
1382
1390
|
type: "string"
|
|
1383
1391
|
}).option("what-if", {
|
|
@@ -1441,10 +1449,10 @@ var CategoryRemoveModule = {
|
|
|
1441
1449
|
command: "remove <id>",
|
|
1442
1450
|
aliases: ["delete", "rm"],
|
|
1443
1451
|
describe: "Delete a category",
|
|
1444
|
-
builder: (
|
|
1452
|
+
builder: (yargs28) => withConfiguration(
|
|
1445
1453
|
withApiOptions(
|
|
1446
1454
|
withProjectOptions(
|
|
1447
|
-
|
|
1455
|
+
yargs28.positional("id", { demandOption: true, describe: "Category UUID to delete" })
|
|
1448
1456
|
)
|
|
1449
1457
|
)
|
|
1450
1458
|
),
|
|
@@ -1461,10 +1469,10 @@ var CategoryUpdateModule = {
|
|
|
1461
1469
|
command: "update <filename>",
|
|
1462
1470
|
aliases: ["put"],
|
|
1463
1471
|
describe: "Insert or update a category",
|
|
1464
|
-
builder: (
|
|
1472
|
+
builder: (yargs28) => withConfiguration(
|
|
1465
1473
|
withApiOptions(
|
|
1466
1474
|
withProjectOptions(
|
|
1467
|
-
|
|
1475
|
+
yargs28.positional("filename", { demandOption: true, describe: "Category file to put" })
|
|
1468
1476
|
)
|
|
1469
1477
|
)
|
|
1470
1478
|
),
|
|
@@ -1481,7 +1489,7 @@ var CategoryModule = {
|
|
|
1481
1489
|
command: "category <command>",
|
|
1482
1490
|
aliases: ["cat"],
|
|
1483
1491
|
describe: "Commands for Canvas categories",
|
|
1484
|
-
builder: (
|
|
1492
|
+
builder: (yargs28) => yargs28.command(CategoryPullModule).command(CategoryPushModule).command(CategoryGetModule).command(CategoryRemoveModule).command(CategoryListModule).command(CategoryUpdateModule).demandCommand(),
|
|
1485
1493
|
handler: () => {
|
|
1486
1494
|
yargs2.help();
|
|
1487
1495
|
}
|
|
@@ -1502,11 +1510,11 @@ var selectSchemaUrl = () => "/schemas/json-schema/component-definition/v1.json";
|
|
|
1502
1510
|
var ComponentGetModule = {
|
|
1503
1511
|
command: "get <id>",
|
|
1504
1512
|
describe: "Fetch a component definition",
|
|
1505
|
-
builder: (
|
|
1513
|
+
builder: (yargs28) => withConfiguration(
|
|
1506
1514
|
withFormatOptions(
|
|
1507
1515
|
withApiOptions(
|
|
1508
1516
|
withProjectOptions(
|
|
1509
|
-
|
|
1517
|
+
yargs28.positional("id", {
|
|
1510
1518
|
demandOption: true,
|
|
1511
1519
|
describe: "Component definition public ID to fetch"
|
|
1512
1520
|
})
|
|
@@ -1540,11 +1548,11 @@ var ComponentListModule = {
|
|
|
1540
1548
|
command: "list",
|
|
1541
1549
|
describe: "List component definitions",
|
|
1542
1550
|
aliases: ["ls"],
|
|
1543
|
-
builder: (
|
|
1551
|
+
builder: (yargs28) => withConfiguration(
|
|
1544
1552
|
withFormatOptions(
|
|
1545
1553
|
withApiOptions(
|
|
1546
1554
|
withProjectOptions(
|
|
1547
|
-
|
|
1555
|
+
yargs28.options({
|
|
1548
1556
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
1549
1557
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 }
|
|
1550
1558
|
})
|
|
@@ -1599,11 +1607,11 @@ function createComponentDefinitionEngineDataSource({
|
|
|
1599
1607
|
var ComponentPullModule = {
|
|
1600
1608
|
command: "pull <directory>",
|
|
1601
1609
|
describe: "Pulls all component definitions to local files in a directory",
|
|
1602
|
-
builder: (
|
|
1610
|
+
builder: (yargs28) => withConfiguration(
|
|
1603
1611
|
withApiOptions(
|
|
1604
1612
|
withProjectOptions(
|
|
1605
1613
|
withDiffOptions(
|
|
1606
|
-
|
|
1614
|
+
yargs28.positional("directory", {
|
|
1607
1615
|
describe: "Directory to save the component definitions to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
1608
1616
|
type: "string"
|
|
1609
1617
|
}).option("format", {
|
|
@@ -1680,11 +1688,11 @@ import { UncachedCanvasClient as UncachedCanvasClient4 } from "@uniformdev/canva
|
|
|
1680
1688
|
var ComponentPushModule = {
|
|
1681
1689
|
command: "push <directory>",
|
|
1682
1690
|
describe: "Pushes all component definitions from files in a directory to Uniform Canvas",
|
|
1683
|
-
builder: (
|
|
1691
|
+
builder: (yargs28) => withConfiguration(
|
|
1684
1692
|
withApiOptions(
|
|
1685
1693
|
withProjectOptions(
|
|
1686
1694
|
withDiffOptions(
|
|
1687
|
-
|
|
1695
|
+
yargs28.positional("directory", {
|
|
1688
1696
|
describe: "Directory to read the component definitions from. If a filename is used, a package will be read instead.",
|
|
1689
1697
|
type: "string"
|
|
1690
1698
|
}).option("what-if", {
|
|
@@ -1749,10 +1757,10 @@ var ComponentRemoveModule = {
|
|
|
1749
1757
|
command: "remove <id>",
|
|
1750
1758
|
aliases: ["delete", "rm"],
|
|
1751
1759
|
describe: "Delete a component definition",
|
|
1752
|
-
builder: (
|
|
1760
|
+
builder: (yargs28) => withConfiguration(
|
|
1753
1761
|
withApiOptions(
|
|
1754
1762
|
withProjectOptions(
|
|
1755
|
-
|
|
1763
|
+
yargs28.positional("id", { demandOption: true, describe: "Component definition public ID to delete" })
|
|
1756
1764
|
)
|
|
1757
1765
|
)
|
|
1758
1766
|
),
|
|
@@ -1769,10 +1777,10 @@ var ComponentUpdateModule = {
|
|
|
1769
1777
|
command: "update <filename>",
|
|
1770
1778
|
aliases: ["put"],
|
|
1771
1779
|
describe: "Insert or update a component definition",
|
|
1772
|
-
builder: (
|
|
1780
|
+
builder: (yargs28) => withConfiguration(
|
|
1773
1781
|
withApiOptions(
|
|
1774
1782
|
withProjectOptions(
|
|
1775
|
-
|
|
1783
|
+
yargs28.positional("filename", { demandOption: true, describe: "Component definition file to put" })
|
|
1776
1784
|
)
|
|
1777
1785
|
)
|
|
1778
1786
|
),
|
|
@@ -1789,7 +1797,7 @@ var ComponentModule = {
|
|
|
1789
1797
|
command: "component <command>",
|
|
1790
1798
|
aliases: ["def"],
|
|
1791
1799
|
describe: "Commands for Canvas component definitions",
|
|
1792
|
-
builder: (
|
|
1800
|
+
builder: (yargs28) => yargs28.command(ComponentPullModule).command(ComponentPushModule).command(ComponentGetModule).command(ComponentRemoveModule).command(ComponentListModule).command(ComponentUpdateModule).demandCommand(),
|
|
1793
1801
|
handler: () => {
|
|
1794
1802
|
yargs3.help();
|
|
1795
1803
|
}
|
|
@@ -1803,12 +1811,12 @@ import { UncachedCanvasClient as UncachedCanvasClient7 } from "@uniformdev/canva
|
|
|
1803
1811
|
var CompositionGetModule = {
|
|
1804
1812
|
command: "get <id>",
|
|
1805
1813
|
describe: "Fetch a composition",
|
|
1806
|
-
builder: (
|
|
1814
|
+
builder: (yargs28) => withFormatOptions(
|
|
1807
1815
|
withConfiguration(
|
|
1808
1816
|
withApiOptions(
|
|
1809
1817
|
withProjectOptions(
|
|
1810
1818
|
withStateOptions(
|
|
1811
|
-
|
|
1819
|
+
yargs28.positional("id", { demandOption: true, describe: "Composition/pattern public ID to fetch" }).option({
|
|
1812
1820
|
resolvePatterns: {
|
|
1813
1821
|
type: "boolean",
|
|
1814
1822
|
default: false,
|
|
@@ -1879,12 +1887,12 @@ var CompositionListModule = {
|
|
|
1879
1887
|
command: "list",
|
|
1880
1888
|
describe: "List compositions",
|
|
1881
1889
|
aliases: ["ls"],
|
|
1882
|
-
builder: (
|
|
1890
|
+
builder: (yargs28) => withFormatOptions(
|
|
1883
1891
|
withConfiguration(
|
|
1884
1892
|
withApiOptions(
|
|
1885
1893
|
withProjectOptions(
|
|
1886
1894
|
withStateOptions(
|
|
1887
|
-
|
|
1895
|
+
yargs28.options({
|
|
1888
1896
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
1889
1897
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
1890
1898
|
resolvePatterns: {
|
|
@@ -2005,11 +2013,11 @@ function createComponentInstanceEngineDataSource({
|
|
|
2005
2013
|
var CompositionPublishModule = {
|
|
2006
2014
|
command: "publish [ids]",
|
|
2007
2015
|
describe: "Publishes composition(s)",
|
|
2008
|
-
builder: (
|
|
2016
|
+
builder: (yargs28) => withConfiguration(
|
|
2009
2017
|
withApiOptions(
|
|
2010
2018
|
withProjectOptions(
|
|
2011
2019
|
withDiffOptions(
|
|
2012
|
-
|
|
2020
|
+
yargs28.positional("ids", {
|
|
2013
2021
|
describe: "Publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
2014
2022
|
type: "string"
|
|
2015
2023
|
}).option("all", {
|
|
@@ -2084,12 +2092,12 @@ import { UncachedCanvasClient as UncachedCanvasClient10 } from "@uniformdev/canv
|
|
|
2084
2092
|
var CompositionPullModule = {
|
|
2085
2093
|
command: "pull <directory>",
|
|
2086
2094
|
describe: "Pulls all compositions to local files in a directory",
|
|
2087
|
-
builder: (
|
|
2095
|
+
builder: (yargs28) => withConfiguration(
|
|
2088
2096
|
withApiOptions(
|
|
2089
2097
|
withProjectOptions(
|
|
2090
2098
|
withStateOptions(
|
|
2091
2099
|
withDiffOptions(
|
|
2092
|
-
|
|
2100
|
+
yargs28.positional("directory", {
|
|
2093
2101
|
describe: "Directory to save the component definitions to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
2094
2102
|
type: "string"
|
|
2095
2103
|
}).option("format", {
|
|
@@ -2184,12 +2192,12 @@ import { UncachedFileClient as UncachedFileClient2 } from "@uniformdev/files";
|
|
|
2184
2192
|
var CompositionPushModule = {
|
|
2185
2193
|
command: "push <directory>",
|
|
2186
2194
|
describe: "Pushes all compositions from files in a directory to Uniform Canvas",
|
|
2187
|
-
builder: (
|
|
2195
|
+
builder: (yargs28) => withConfiguration(
|
|
2188
2196
|
withApiOptions(
|
|
2189
2197
|
withProjectOptions(
|
|
2190
2198
|
withStateOptions(
|
|
2191
2199
|
withDiffOptions(
|
|
2192
|
-
|
|
2200
|
+
yargs28.positional("directory", {
|
|
2193
2201
|
describe: "Directory to read the compositions/patterns from. If a filename is used, a package will be read instead.",
|
|
2194
2202
|
type: "string"
|
|
2195
2203
|
}).option("what-if", {
|
|
@@ -2278,10 +2286,10 @@ var CompositionRemoveModule = {
|
|
|
2278
2286
|
command: "remove <id>",
|
|
2279
2287
|
aliases: ["delete", "rm"],
|
|
2280
2288
|
describe: "Delete a composition",
|
|
2281
|
-
builder: (
|
|
2289
|
+
builder: (yargs28) => withConfiguration(
|
|
2282
2290
|
withApiOptions(
|
|
2283
2291
|
withProjectOptions(
|
|
2284
|
-
|
|
2292
|
+
yargs28.positional("id", { demandOption: true, describe: "Composition/pattern public ID to delete" })
|
|
2285
2293
|
)
|
|
2286
2294
|
)
|
|
2287
2295
|
),
|
|
@@ -2298,10 +2306,10 @@ import { diffJson as diffJson2 } from "diff";
|
|
|
2298
2306
|
var CompositionUnpublishModule = {
|
|
2299
2307
|
command: "unpublish [ids]",
|
|
2300
2308
|
describe: "Unpublish a composition(s)",
|
|
2301
|
-
builder: (
|
|
2309
|
+
builder: (yargs28) => withConfiguration(
|
|
2302
2310
|
withApiOptions(
|
|
2303
2311
|
withProjectOptions(
|
|
2304
|
-
|
|
2312
|
+
yargs28.positional("ids", {
|
|
2305
2313
|
describe: "Un-publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
2306
2314
|
type: "string"
|
|
2307
2315
|
}).option("all", {
|
|
@@ -2395,11 +2403,11 @@ var CompositionUpdateModule = {
|
|
|
2395
2403
|
command: "update <filename>",
|
|
2396
2404
|
aliases: ["put"],
|
|
2397
2405
|
describe: "Insert or update a composition",
|
|
2398
|
-
builder: (
|
|
2406
|
+
builder: (yargs28) => withConfiguration(
|
|
2399
2407
|
withApiOptions(
|
|
2400
2408
|
withProjectOptions(
|
|
2401
2409
|
withStateOptions(
|
|
2402
|
-
|
|
2410
|
+
yargs28.positional("filename", { demandOption: true, describe: "Composition/pattern file to put" })
|
|
2403
2411
|
)
|
|
2404
2412
|
)
|
|
2405
2413
|
)
|
|
@@ -2417,7 +2425,7 @@ var CompositionModule = {
|
|
|
2417
2425
|
command: "composition <command>",
|
|
2418
2426
|
describe: "Commands for Canvas compositions",
|
|
2419
2427
|
aliases: ["comp"],
|
|
2420
|
-
builder: (
|
|
2428
|
+
builder: (yargs28) => yargs28.command(CompositionPullModule).command(CompositionPushModule).command(CompositionGetModule).command(CompositionRemoveModule).command(CompositionListModule).command(CompositionUpdateModule).command(CompositionPublishModule).command(CompositionUnpublishModule).demandCommand(),
|
|
2421
2429
|
handler: () => {
|
|
2422
2430
|
yargs4.help();
|
|
2423
2431
|
}
|
|
@@ -2431,12 +2439,12 @@ import { ContentClient } from "@uniformdev/canvas";
|
|
|
2431
2439
|
var ContentTypeGetModule = {
|
|
2432
2440
|
command: "get <id>",
|
|
2433
2441
|
describe: "Get a content type",
|
|
2434
|
-
builder: (
|
|
2442
|
+
builder: (yargs28) => withConfiguration(
|
|
2435
2443
|
withFormatOptions(
|
|
2436
2444
|
withApiOptions(
|
|
2437
2445
|
withProjectOptions(
|
|
2438
2446
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2439
|
-
|
|
2447
|
+
yargs28.positional("id", { demandOption: true, describe: "Content type public ID to fetch" })
|
|
2440
2448
|
)
|
|
2441
2449
|
)
|
|
2442
2450
|
)
|
|
@@ -2458,7 +2466,7 @@ import { ContentClient as ContentClient2 } from "@uniformdev/canvas";
|
|
|
2458
2466
|
var ContentTypeListModule = {
|
|
2459
2467
|
command: "list",
|
|
2460
2468
|
describe: "List content types",
|
|
2461
|
-
builder: (
|
|
2469
|
+
builder: (yargs28) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs28)))),
|
|
2462
2470
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
2463
2471
|
const fetch3 = nodeFetchProxy(proxy);
|
|
2464
2472
|
const client = new ContentClient2({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
@@ -2505,11 +2513,11 @@ function createContentTypeEngineDataSource({
|
|
|
2505
2513
|
var ContentTypePullModule = {
|
|
2506
2514
|
command: "pull <directory>",
|
|
2507
2515
|
describe: "Pulls all content types to local files in a directory",
|
|
2508
|
-
builder: (
|
|
2516
|
+
builder: (yargs28) => withConfiguration(
|
|
2509
2517
|
withApiOptions(
|
|
2510
2518
|
withProjectOptions(
|
|
2511
2519
|
withDiffOptions(
|
|
2512
|
-
|
|
2520
|
+
yargs28.positional("directory", {
|
|
2513
2521
|
describe: "Directory to save the content types to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
2514
2522
|
type: "string"
|
|
2515
2523
|
}).option("format", {
|
|
@@ -2591,11 +2599,11 @@ import { ContentClient as ContentClient4 } from "@uniformdev/canvas";
|
|
|
2591
2599
|
var ContentTypePushModule = {
|
|
2592
2600
|
command: "push <directory>",
|
|
2593
2601
|
describe: "Pushes all content types from files in a directory to Uniform",
|
|
2594
|
-
builder: (
|
|
2602
|
+
builder: (yargs28) => withConfiguration(
|
|
2595
2603
|
withApiOptions(
|
|
2596
2604
|
withProjectOptions(
|
|
2597
2605
|
withDiffOptions(
|
|
2598
|
-
|
|
2606
|
+
yargs28.positional("directory", {
|
|
2599
2607
|
describe: "Directory to read the content types from. If a filename is used, a package will be read instead.",
|
|
2600
2608
|
type: "string"
|
|
2601
2609
|
}).option("what-if", {
|
|
@@ -2665,10 +2673,10 @@ var ContentTypeRemoveModule = {
|
|
|
2665
2673
|
command: "remove <id>",
|
|
2666
2674
|
aliases: ["delete", "rm"],
|
|
2667
2675
|
describe: "Delete a content type",
|
|
2668
|
-
builder: (
|
|
2676
|
+
builder: (yargs28) => withConfiguration(
|
|
2669
2677
|
withApiOptions(
|
|
2670
2678
|
withProjectOptions(
|
|
2671
|
-
|
|
2679
|
+
yargs28.positional("id", { demandOption: true, describe: "Content type public ID to delete" })
|
|
2672
2680
|
)
|
|
2673
2681
|
)
|
|
2674
2682
|
),
|
|
@@ -2685,10 +2693,10 @@ var ContentTypeUpdateModule = {
|
|
|
2685
2693
|
command: "update <filename>",
|
|
2686
2694
|
aliases: ["put"],
|
|
2687
2695
|
describe: "Insert or update a content type",
|
|
2688
|
-
builder: (
|
|
2696
|
+
builder: (yargs28) => withConfiguration(
|
|
2689
2697
|
withApiOptions(
|
|
2690
2698
|
withProjectOptions(
|
|
2691
|
-
|
|
2699
|
+
yargs28.positional("filename", { demandOption: true, describe: "Content type file to put" })
|
|
2692
2700
|
)
|
|
2693
2701
|
)
|
|
2694
2702
|
),
|
|
@@ -2705,7 +2713,7 @@ var ContentTypeModule = {
|
|
|
2705
2713
|
command: "contenttype <command>",
|
|
2706
2714
|
aliases: ["ct"],
|
|
2707
2715
|
describe: "Commands for Content Types",
|
|
2708
|
-
builder: (
|
|
2716
|
+
builder: (yargs28) => yargs28.command(ContentTypeGetModule).command(ContentTypeListModule).command(ContentTypeRemoveModule).command(ContentTypeUpdateModule).command(ContentTypePullModule).command(ContentTypePushModule).demandCommand(),
|
|
2709
2717
|
handler: () => {
|
|
2710
2718
|
yargs5.help();
|
|
2711
2719
|
}
|
|
@@ -2720,12 +2728,12 @@ var DataTypeGetModule = {
|
|
|
2720
2728
|
command: "get <id>",
|
|
2721
2729
|
describe: "Get a data type",
|
|
2722
2730
|
aliases: ["ls"],
|
|
2723
|
-
builder: (
|
|
2731
|
+
builder: (yargs28) => withConfiguration(
|
|
2724
2732
|
withFormatOptions(
|
|
2725
2733
|
withApiOptions(
|
|
2726
2734
|
withProjectOptions(
|
|
2727
2735
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2728
|
-
|
|
2736
|
+
yargs28.positional("id", { demandOption: true, describe: "Data type public ID to fetch" })
|
|
2729
2737
|
)
|
|
2730
2738
|
)
|
|
2731
2739
|
)
|
|
@@ -2748,7 +2756,7 @@ var DataTypeListModule = {
|
|
|
2748
2756
|
command: "list",
|
|
2749
2757
|
describe: "List data types",
|
|
2750
2758
|
aliases: ["ls"],
|
|
2751
|
-
builder: (
|
|
2759
|
+
builder: (yargs28) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs28)))),
|
|
2752
2760
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
2753
2761
|
const fetch3 = nodeFetchProxy(proxy);
|
|
2754
2762
|
const client = new DataTypeClient2({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
@@ -2769,12 +2777,8 @@ function createDataTypeEngineDataSource({
|
|
|
2769
2777
|
client
|
|
2770
2778
|
}) {
|
|
2771
2779
|
async function* getObjects() {
|
|
2772
|
-
var _a;
|
|
2773
2780
|
const dataTypes = (await client.get()).results;
|
|
2774
2781
|
for await (const dataType of dataTypes) {
|
|
2775
|
-
if (((_a = dataType.custom) == null ? void 0 : _a.uniformAutogenerated) === true) {
|
|
2776
|
-
continue;
|
|
2777
|
-
}
|
|
2778
2782
|
const result = {
|
|
2779
2783
|
id: selectIdentifier4(dataType),
|
|
2780
2784
|
displayName: selectDisplayName4(dataType),
|
|
@@ -2801,11 +2805,11 @@ function createDataTypeEngineDataSource({
|
|
|
2801
2805
|
var DataTypePullModule = {
|
|
2802
2806
|
command: "pull <directory>",
|
|
2803
2807
|
describe: "Pulls all data types to local files in a directory",
|
|
2804
|
-
builder: (
|
|
2808
|
+
builder: (yargs28) => withConfiguration(
|
|
2805
2809
|
withApiOptions(
|
|
2806
2810
|
withProjectOptions(
|
|
2807
2811
|
withDiffOptions(
|
|
2808
|
-
|
|
2812
|
+
yargs28.positional("directory", {
|
|
2809
2813
|
describe: "Directory to save the data types to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
2810
2814
|
type: "string"
|
|
2811
2815
|
}).option("format", {
|
|
@@ -2887,11 +2891,11 @@ import { DataTypeClient as DataTypeClient4 } from "@uniformdev/canvas";
|
|
|
2887
2891
|
var DataTypePushModule = {
|
|
2888
2892
|
command: "push <directory>",
|
|
2889
2893
|
describe: "Pushes all data types from files in a directory to Uniform",
|
|
2890
|
-
builder: (
|
|
2894
|
+
builder: (yargs28) => withConfiguration(
|
|
2891
2895
|
withApiOptions(
|
|
2892
2896
|
withProjectOptions(
|
|
2893
2897
|
withDiffOptions(
|
|
2894
|
-
|
|
2898
|
+
yargs28.positional("directory", {
|
|
2895
2899
|
describe: "Directory to read the data types from. If a filename is used, a package will be read instead.",
|
|
2896
2900
|
type: "string"
|
|
2897
2901
|
}).option("what-if", {
|
|
@@ -2961,10 +2965,10 @@ var DataTypeRemoveModule = {
|
|
|
2961
2965
|
command: "remove <id>",
|
|
2962
2966
|
aliases: ["delete", "rm"],
|
|
2963
2967
|
describe: "Delete a data type",
|
|
2964
|
-
builder: (
|
|
2968
|
+
builder: (yargs28) => withConfiguration(
|
|
2965
2969
|
withApiOptions(
|
|
2966
2970
|
withProjectOptions(
|
|
2967
|
-
|
|
2971
|
+
yargs28.positional("id", { demandOption: true, describe: "Data type public ID to delete" })
|
|
2968
2972
|
)
|
|
2969
2973
|
)
|
|
2970
2974
|
),
|
|
@@ -2981,10 +2985,10 @@ var DataTypeUpdateModule = {
|
|
|
2981
2985
|
command: "update <filename>",
|
|
2982
2986
|
aliases: ["put"],
|
|
2983
2987
|
describe: "Insert or update a data type",
|
|
2984
|
-
builder: (
|
|
2988
|
+
builder: (yargs28) => withConfiguration(
|
|
2985
2989
|
withApiOptions(
|
|
2986
2990
|
withProjectOptions(
|
|
2987
|
-
|
|
2991
|
+
yargs28.positional("filename", { demandOption: true, describe: "Data type file to put" })
|
|
2988
2992
|
)
|
|
2989
2993
|
)
|
|
2990
2994
|
),
|
|
@@ -3001,7 +3005,7 @@ var DataTypeModule = {
|
|
|
3001
3005
|
command: "datatype <command>",
|
|
3002
3006
|
aliases: ["dt"],
|
|
3003
3007
|
describe: "Commands for Data Type definitions",
|
|
3004
|
-
builder: (
|
|
3008
|
+
builder: (yargs28) => yargs28.command(DataTypeGetModule).command(DataTypePullModule).command(DataTypePushModule).command(DataTypeRemoveModule).command(DataTypeListModule).command(DataTypeUpdateModule).demandCommand(),
|
|
3005
3009
|
handler: () => {
|
|
3006
3010
|
yargs6.help();
|
|
3007
3011
|
}
|
|
@@ -3015,12 +3019,12 @@ import { ContentClient as ContentClient7 } from "@uniformdev/canvas";
|
|
|
3015
3019
|
var EntryGetModule = {
|
|
3016
3020
|
command: "get <id>",
|
|
3017
3021
|
describe: "Get an entry",
|
|
3018
|
-
builder: (
|
|
3022
|
+
builder: (yargs28) => withConfiguration(
|
|
3019
3023
|
withFormatOptions(
|
|
3020
3024
|
withApiOptions(
|
|
3021
3025
|
withProjectOptions(
|
|
3022
3026
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3023
|
-
|
|
3027
|
+
yargs28.positional("id", { demandOption: true, describe: "Entry public ID to fetch" })
|
|
3024
3028
|
)
|
|
3025
3029
|
)
|
|
3026
3030
|
)
|
|
@@ -3028,7 +3032,12 @@ var EntryGetModule = {
|
|
|
3028
3032
|
handler: async ({ apiHost, apiKey, proxy, id, format, filename, project: projectId }) => {
|
|
3029
3033
|
const fetch3 = nodeFetchProxy(proxy);
|
|
3030
3034
|
const client = new ContentClient7({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
3031
|
-
const res = await client.getEntries({
|
|
3035
|
+
const res = await client.getEntries({
|
|
3036
|
+
offset: 0,
|
|
3037
|
+
limit: 1,
|
|
3038
|
+
entryIDs: [id],
|
|
3039
|
+
skipOverridesResolution: true
|
|
3040
|
+
});
|
|
3032
3041
|
if (res.entries.length !== 1) {
|
|
3033
3042
|
throw new Error(`Entry with ID ${id} not found`);
|
|
3034
3043
|
}
|
|
@@ -3041,11 +3050,11 @@ import { ContentClient as ContentClient8 } from "@uniformdev/canvas";
|
|
|
3041
3050
|
var EntryListModule = {
|
|
3042
3051
|
command: "list",
|
|
3043
3052
|
describe: "List entries",
|
|
3044
|
-
builder: (
|
|
3053
|
+
builder: (yargs28) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs28)))),
|
|
3045
3054
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
3046
3055
|
const fetch3 = nodeFetchProxy(proxy);
|
|
3047
3056
|
const client = new ContentClient8({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
3048
|
-
const res = await client.getEntries({ offset: 0, limit: 1e3 });
|
|
3057
|
+
const res = await client.getEntries({ offset: 0, limit: 1e3, skipOverridesResolution: true });
|
|
3049
3058
|
emitWithFormat(res.entries, format, filename);
|
|
3050
3059
|
}
|
|
3051
3060
|
};
|
|
@@ -3071,6 +3080,7 @@ function createEntryEngineDataSource({
|
|
|
3071
3080
|
offset: 0,
|
|
3072
3081
|
limit: 1e3,
|
|
3073
3082
|
skipDataResolution: true,
|
|
3083
|
+
skipOverridesResolution: true,
|
|
3074
3084
|
state: stateId,
|
|
3075
3085
|
withComponentIDs: true
|
|
3076
3086
|
});
|
|
@@ -3099,12 +3109,12 @@ function createEntryEngineDataSource({
|
|
|
3099
3109
|
var EntryPullModule = {
|
|
3100
3110
|
command: "pull <directory>",
|
|
3101
3111
|
describe: "Pulls all entries to local files in a directory",
|
|
3102
|
-
builder: (
|
|
3112
|
+
builder: (yargs28) => withConfiguration(
|
|
3103
3113
|
withApiOptions(
|
|
3104
3114
|
withProjectOptions(
|
|
3105
3115
|
withStateOptions(
|
|
3106
3116
|
withDiffOptions(
|
|
3107
|
-
|
|
3117
|
+
yargs28.positional("directory", {
|
|
3108
3118
|
describe: "Directory to save the entries to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
3109
3119
|
type: "string"
|
|
3110
3120
|
}).option("format", {
|
|
@@ -3188,12 +3198,12 @@ import { ContentClient as ContentClient11 } from "@uniformdev/canvas";
|
|
|
3188
3198
|
var EntryPushModule = {
|
|
3189
3199
|
command: "push <directory>",
|
|
3190
3200
|
describe: "Pushes all entries from files in a directory to Uniform",
|
|
3191
|
-
builder: (
|
|
3201
|
+
builder: (yargs28) => withConfiguration(
|
|
3192
3202
|
withApiOptions(
|
|
3193
3203
|
withProjectOptions(
|
|
3194
3204
|
withStateOptions(
|
|
3195
3205
|
withDiffOptions(
|
|
3196
|
-
|
|
3206
|
+
yargs28.positional("directory", {
|
|
3197
3207
|
describe: "Directory to read the entries from. If a filename is used, a package will be read instead.",
|
|
3198
3208
|
type: "string"
|
|
3199
3209
|
}).option("what-if", {
|
|
@@ -3265,10 +3275,10 @@ var EntryRemoveModule = {
|
|
|
3265
3275
|
command: "remove <id>",
|
|
3266
3276
|
aliases: ["delete", "rm"],
|
|
3267
3277
|
describe: "Delete an entry",
|
|
3268
|
-
builder: (
|
|
3278
|
+
builder: (yargs28) => withConfiguration(
|
|
3269
3279
|
withApiOptions(
|
|
3270
3280
|
withProjectOptions(
|
|
3271
|
-
|
|
3281
|
+
yargs28.positional("id", { demandOption: true, describe: "Entry public ID to delete" })
|
|
3272
3282
|
)
|
|
3273
3283
|
)
|
|
3274
3284
|
),
|
|
@@ -3285,10 +3295,10 @@ var EntryUpdateModule = {
|
|
|
3285
3295
|
command: "update <filename>",
|
|
3286
3296
|
aliases: ["put"],
|
|
3287
3297
|
describe: "Insert or update an entry",
|
|
3288
|
-
builder: (
|
|
3298
|
+
builder: (yargs28) => withConfiguration(
|
|
3289
3299
|
withApiOptions(
|
|
3290
3300
|
withProjectOptions(
|
|
3291
|
-
|
|
3301
|
+
yargs28.positional("filename", { demandOption: true, describe: "Entry file to put" })
|
|
3292
3302
|
)
|
|
3293
3303
|
)
|
|
3294
3304
|
),
|
|
@@ -3304,15 +3314,218 @@ var EntryUpdateModule = {
|
|
|
3304
3314
|
var EntryModule = {
|
|
3305
3315
|
command: "entry <command>",
|
|
3306
3316
|
describe: "Commands for Entries",
|
|
3307
|
-
builder: (
|
|
3317
|
+
builder: (yargs28) => yargs28.command(EntryGetModule).command(EntryListModule).command(EntryRemoveModule).command(EntryUpdateModule).command(EntryPullModule).command(EntryPushModule).demandCommand(),
|
|
3308
3318
|
handler: () => {
|
|
3309
3319
|
yargs7.help();
|
|
3310
3320
|
}
|
|
3311
3321
|
};
|
|
3312
3322
|
|
|
3313
|
-
// src/commands/canvas/commands/
|
|
3323
|
+
// src/commands/canvas/commands/locale.ts
|
|
3314
3324
|
import yargs8 from "yargs";
|
|
3315
3325
|
|
|
3326
|
+
// src/commands/canvas/commands/locale/pull.ts
|
|
3327
|
+
import { LocaleClient } from "@uniformdev/canvas";
|
|
3328
|
+
|
|
3329
|
+
// src/commands/canvas/localesEngineDataSource.ts
|
|
3330
|
+
function createLocaleEngineDataSource({
|
|
3331
|
+
client
|
|
3332
|
+
}) {
|
|
3333
|
+
async function* getObjects() {
|
|
3334
|
+
const locales = (await client.get()).results;
|
|
3335
|
+
for await (const locale of locales) {
|
|
3336
|
+
const result = {
|
|
3337
|
+
id: locale.locale,
|
|
3338
|
+
displayName: locale.displayName,
|
|
3339
|
+
providerId: locale.locale,
|
|
3340
|
+
object: locale
|
|
3341
|
+
};
|
|
3342
|
+
yield result;
|
|
3343
|
+
}
|
|
3344
|
+
}
|
|
3345
|
+
return {
|
|
3346
|
+
objects: getObjects(),
|
|
3347
|
+
deleteObject: async (providerId) => {
|
|
3348
|
+
await client.remove({ locale: providerId });
|
|
3349
|
+
},
|
|
3350
|
+
writeObject: async (object) => {
|
|
3351
|
+
await client.upsert({
|
|
3352
|
+
locale: object.object
|
|
3353
|
+
});
|
|
3354
|
+
}
|
|
3355
|
+
};
|
|
3356
|
+
}
|
|
3357
|
+
|
|
3358
|
+
// src/commands/canvas/commands/locale/pull.ts
|
|
3359
|
+
var LocalePullModule = {
|
|
3360
|
+
command: "pull <directory>",
|
|
3361
|
+
describe: "Pulls all locales to local files in a directory",
|
|
3362
|
+
builder: (yargs28) => withConfiguration(
|
|
3363
|
+
withApiOptions(
|
|
3364
|
+
withProjectOptions(
|
|
3365
|
+
withDiffOptions(
|
|
3366
|
+
yargs28.positional("directory", {
|
|
3367
|
+
describe: "Directory to save the locales to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
3368
|
+
type: "string"
|
|
3369
|
+
}).option("format", {
|
|
3370
|
+
alias: ["f"],
|
|
3371
|
+
describe: "Output format",
|
|
3372
|
+
default: "yaml",
|
|
3373
|
+
choices: ["yaml", "json"],
|
|
3374
|
+
type: "string"
|
|
3375
|
+
}).option("what-if", {
|
|
3376
|
+
alias: ["w"],
|
|
3377
|
+
describe: "What-if mode reports what would be done but changes no files",
|
|
3378
|
+
default: false,
|
|
3379
|
+
type: "boolean"
|
|
3380
|
+
}).option("mode", {
|
|
3381
|
+
alias: ["m"],
|
|
3382
|
+
describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
|
|
3383
|
+
choices: ["create", "createOrUpdate", "mirror"],
|
|
3384
|
+
default: "mirror",
|
|
3385
|
+
type: "string"
|
|
3386
|
+
})
|
|
3387
|
+
)
|
|
3388
|
+
)
|
|
3389
|
+
)
|
|
3390
|
+
),
|
|
3391
|
+
handler: async ({
|
|
3392
|
+
apiHost,
|
|
3393
|
+
apiKey,
|
|
3394
|
+
proxy,
|
|
3395
|
+
directory,
|
|
3396
|
+
format,
|
|
3397
|
+
mode,
|
|
3398
|
+
whatIf,
|
|
3399
|
+
project: projectId,
|
|
3400
|
+
diff: diffMode
|
|
3401
|
+
}) => {
|
|
3402
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
3403
|
+
const client = new LocaleClient({
|
|
3404
|
+
apiKey,
|
|
3405
|
+
apiHost,
|
|
3406
|
+
fetch: fetch3,
|
|
3407
|
+
projectId,
|
|
3408
|
+
bypassCache: true
|
|
3409
|
+
});
|
|
3410
|
+
const source = createLocaleEngineDataSource({ client });
|
|
3411
|
+
let target;
|
|
3412
|
+
const isPackage = isPathAPackageFile(directory);
|
|
3413
|
+
if (isPackage) {
|
|
3414
|
+
const packageContents = readCanvasPackage(directory, false);
|
|
3415
|
+
target = await createArraySyncEngineDataSource({
|
|
3416
|
+
objects: packageContents.locales ?? [],
|
|
3417
|
+
selectIdentifier: (i) => i.locale,
|
|
3418
|
+
selectDisplayName: (i) => i.displayName,
|
|
3419
|
+
onSyncComplete: async (_, synced) => {
|
|
3420
|
+
packageContents.locales = synced;
|
|
3421
|
+
writeCanvasPackage(directory, packageContents);
|
|
3422
|
+
}
|
|
3423
|
+
});
|
|
3424
|
+
} else {
|
|
3425
|
+
target = await createFileSyncEngineDataSource({
|
|
3426
|
+
directory,
|
|
3427
|
+
selectIdentifier: (i) => i.locale,
|
|
3428
|
+
selectDisplayName: (i) => i.displayName,
|
|
3429
|
+
format
|
|
3430
|
+
});
|
|
3431
|
+
}
|
|
3432
|
+
await syncEngine({
|
|
3433
|
+
source,
|
|
3434
|
+
target,
|
|
3435
|
+
mode,
|
|
3436
|
+
whatIf,
|
|
3437
|
+
allowEmptySource: true,
|
|
3438
|
+
log: createSyncEngineConsoleLogger({ diffMode })
|
|
3439
|
+
});
|
|
3440
|
+
}
|
|
3441
|
+
};
|
|
3442
|
+
|
|
3443
|
+
// src/commands/canvas/commands/locale/push.ts
|
|
3444
|
+
import { LocaleClient as LocaleClient2 } from "@uniformdev/canvas";
|
|
3445
|
+
var LocalePushModule = {
|
|
3446
|
+
command: "push <directory>",
|
|
3447
|
+
describe: "Pushes all locales from files in a directory to Uniform",
|
|
3448
|
+
builder: (yargs28) => withConfiguration(
|
|
3449
|
+
withApiOptions(
|
|
3450
|
+
withProjectOptions(
|
|
3451
|
+
withDiffOptions(
|
|
3452
|
+
yargs28.positional("directory", {
|
|
3453
|
+
describe: "Directory to read the locales from. If a filename is used, a package will be read instead.",
|
|
3454
|
+
type: "string"
|
|
3455
|
+
}).option("what-if", {
|
|
3456
|
+
alias: ["w"],
|
|
3457
|
+
describe: "What-if mode reports what would be done but changes nothing",
|
|
3458
|
+
default: false,
|
|
3459
|
+
type: "boolean"
|
|
3460
|
+
}).option("mode", {
|
|
3461
|
+
alias: ["m"],
|
|
3462
|
+
describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
|
|
3463
|
+
choices: ["create", "createOrUpdate", "mirror"],
|
|
3464
|
+
default: "mirror",
|
|
3465
|
+
type: "string"
|
|
3466
|
+
})
|
|
3467
|
+
)
|
|
3468
|
+
)
|
|
3469
|
+
)
|
|
3470
|
+
),
|
|
3471
|
+
handler: async ({
|
|
3472
|
+
apiHost,
|
|
3473
|
+
apiKey,
|
|
3474
|
+
proxy,
|
|
3475
|
+
directory,
|
|
3476
|
+
mode,
|
|
3477
|
+
whatIf,
|
|
3478
|
+
project: projectId,
|
|
3479
|
+
diff: diffMode
|
|
3480
|
+
}) => {
|
|
3481
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
3482
|
+
const client = new LocaleClient2({
|
|
3483
|
+
apiKey,
|
|
3484
|
+
apiHost,
|
|
3485
|
+
fetch: fetch3,
|
|
3486
|
+
projectId,
|
|
3487
|
+
bypassCache: true
|
|
3488
|
+
});
|
|
3489
|
+
let source;
|
|
3490
|
+
const isPackage = isPathAPackageFile(directory);
|
|
3491
|
+
if (isPackage) {
|
|
3492
|
+
const packageContents = readCanvasPackage(directory, true);
|
|
3493
|
+
source = await createArraySyncEngineDataSource({
|
|
3494
|
+
objects: packageContents.locales ?? [],
|
|
3495
|
+
selectIdentifier: (locale) => locale.locale,
|
|
3496
|
+
selectDisplayName: (locale) => locale.displayName
|
|
3497
|
+
});
|
|
3498
|
+
} else {
|
|
3499
|
+
source = await createFileSyncEngineDataSource({
|
|
3500
|
+
directory,
|
|
3501
|
+
selectIdentifier: (locale) => locale.locale,
|
|
3502
|
+
selectDisplayName: (locale) => locale.displayName
|
|
3503
|
+
});
|
|
3504
|
+
}
|
|
3505
|
+
const target = createLocaleEngineDataSource({ client });
|
|
3506
|
+
await syncEngine({
|
|
3507
|
+
source,
|
|
3508
|
+
target,
|
|
3509
|
+
mode,
|
|
3510
|
+
whatIf,
|
|
3511
|
+
log: createSyncEngineConsoleLogger({ diffMode })
|
|
3512
|
+
});
|
|
3513
|
+
}
|
|
3514
|
+
};
|
|
3515
|
+
|
|
3516
|
+
// src/commands/canvas/commands/locale.ts
|
|
3517
|
+
var LocaleModule = {
|
|
3518
|
+
command: "locale <command>",
|
|
3519
|
+
describe: "Commands for locale definitions",
|
|
3520
|
+
builder: (yargs28) => yargs28.command(LocalePullModule).command(LocalePushModule),
|
|
3521
|
+
handler: () => {
|
|
3522
|
+
yargs8.help();
|
|
3523
|
+
}
|
|
3524
|
+
};
|
|
3525
|
+
|
|
3526
|
+
// src/commands/canvas/commands/pattern.ts
|
|
3527
|
+
import yargs9 from "yargs";
|
|
3528
|
+
|
|
3316
3529
|
// src/commands/canvas/commands/pattern/get.ts
|
|
3317
3530
|
var PatternGetModule = {
|
|
3318
3531
|
...CompositionGetModule,
|
|
@@ -3323,12 +3536,12 @@ var PatternGetModule = {
|
|
|
3323
3536
|
var PatternListModule = {
|
|
3324
3537
|
...CompositionListModule,
|
|
3325
3538
|
describe: "List patterns",
|
|
3326
|
-
builder: (
|
|
3539
|
+
builder: (yargs28) => withFormatOptions(
|
|
3327
3540
|
withConfiguration(
|
|
3328
3541
|
withApiOptions(
|
|
3329
3542
|
withProjectOptions(
|
|
3330
3543
|
withStateOptions(
|
|
3331
|
-
|
|
3544
|
+
yargs28.options({
|
|
3332
3545
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
3333
3546
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
3334
3547
|
resolvePatterns: {
|
|
@@ -3366,11 +3579,11 @@ var PatternListModule = {
|
|
|
3366
3579
|
var PatternPublishModule = {
|
|
3367
3580
|
...CompositionPublishModule,
|
|
3368
3581
|
describe: "Publishes pattern(s)",
|
|
3369
|
-
builder: (
|
|
3582
|
+
builder: (yargs28) => withConfiguration(
|
|
3370
3583
|
withApiOptions(
|
|
3371
3584
|
withProjectOptions(
|
|
3372
3585
|
withDiffOptions(
|
|
3373
|
-
|
|
3586
|
+
yargs28.positional("ids", {
|
|
3374
3587
|
describe: "Publishes pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
3375
3588
|
type: "string"
|
|
3376
3589
|
}).option("all", {
|
|
@@ -3408,12 +3621,12 @@ var PatternPublishModule = {
|
|
|
3408
3621
|
var PatternPullModule = {
|
|
3409
3622
|
...CompositionPullModule,
|
|
3410
3623
|
describe: "Pulls all patterns to local files in a directory",
|
|
3411
|
-
builder: (
|
|
3624
|
+
builder: (yargs28) => withConfiguration(
|
|
3412
3625
|
withApiOptions(
|
|
3413
3626
|
withProjectOptions(
|
|
3414
3627
|
withStateOptions(
|
|
3415
3628
|
withDiffOptions(
|
|
3416
|
-
|
|
3629
|
+
yargs28.positional("directory", {
|
|
3417
3630
|
describe: "Directory to save the component definitions to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
3418
3631
|
type: "string"
|
|
3419
3632
|
}).option("format", {
|
|
@@ -3451,12 +3664,12 @@ var PatternPullModule = {
|
|
|
3451
3664
|
var PatternPushModule = {
|
|
3452
3665
|
...CompositionPushModule,
|
|
3453
3666
|
describe: "Pushes all patterns from files in a directory to Uniform Canvas",
|
|
3454
|
-
builder: (
|
|
3667
|
+
builder: (yargs28) => withConfiguration(
|
|
3455
3668
|
withApiOptions(
|
|
3456
3669
|
withProjectOptions(
|
|
3457
3670
|
withStateOptions(
|
|
3458
3671
|
withDiffOptions(
|
|
3459
|
-
|
|
3672
|
+
yargs28.positional("directory", {
|
|
3460
3673
|
describe: "Directory to read the compositions/patterns from. If a filename is used, a package will be read instead.",
|
|
3461
3674
|
type: "string"
|
|
3462
3675
|
}).option("what-if", {
|
|
@@ -3494,10 +3707,10 @@ var PatternRemoveModule = {
|
|
|
3494
3707
|
var PatternUnpublishModule = {
|
|
3495
3708
|
command: "unpublish [ids]",
|
|
3496
3709
|
describe: "Unpublish a pattern(s)",
|
|
3497
|
-
builder: (
|
|
3710
|
+
builder: (yargs28) => withConfiguration(
|
|
3498
3711
|
withApiOptions(
|
|
3499
3712
|
withProjectOptions(
|
|
3500
|
-
|
|
3713
|
+
yargs28.positional("ids", {
|
|
3501
3714
|
describe: "Un-publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
3502
3715
|
type: "string"
|
|
3503
3716
|
}).option("all", {
|
|
@@ -3536,26 +3749,26 @@ var PatternUpdateModule = {
|
|
|
3536
3749
|
var PatternModule = {
|
|
3537
3750
|
command: "pattern <command>",
|
|
3538
3751
|
describe: "Commands for Canvas patterns",
|
|
3539
|
-
builder: (
|
|
3752
|
+
builder: (yargs28) => yargs28.command(PatternPullModule).command(PatternPushModule).command(PatternGetModule).command(PatternRemoveModule).command(PatternListModule).command(PatternUpdateModule).command(PatternPublishModule).command(PatternUnpublishModule).demandCommand(),
|
|
3540
3753
|
handler: () => {
|
|
3541
|
-
|
|
3754
|
+
yargs9.help();
|
|
3542
3755
|
}
|
|
3543
3756
|
};
|
|
3544
3757
|
|
|
3545
3758
|
// src/commands/canvas/commands/prompts.ts
|
|
3546
|
-
import
|
|
3759
|
+
import yargs10 from "yargs";
|
|
3547
3760
|
|
|
3548
3761
|
// src/commands/canvas/commands/prompts/get.ts
|
|
3549
3762
|
import { PromptClient } from "@uniformdev/canvas";
|
|
3550
3763
|
var PromptGetModule = {
|
|
3551
3764
|
command: "get <id>",
|
|
3552
3765
|
describe: "Get a prompt",
|
|
3553
|
-
builder: (
|
|
3766
|
+
builder: (yargs28) => withConfiguration(
|
|
3554
3767
|
withFormatOptions(
|
|
3555
3768
|
withApiOptions(
|
|
3556
3769
|
withProjectOptions(
|
|
3557
3770
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3558
|
-
|
|
3771
|
+
yargs28.positional("id", { demandOption: true, describe: "Prompt ID to fetch" })
|
|
3559
3772
|
)
|
|
3560
3773
|
)
|
|
3561
3774
|
)
|
|
@@ -3564,10 +3777,10 @@ var PromptGetModule = {
|
|
|
3564
3777
|
const fetch3 = nodeFetchProxy(proxy);
|
|
3565
3778
|
const client = new PromptClient({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
3566
3779
|
const res = await client.get({ promptId: id });
|
|
3567
|
-
if (!res
|
|
3780
|
+
if (!res) {
|
|
3568
3781
|
throw new Error(`Prompt with ID ${id} not found`);
|
|
3569
3782
|
}
|
|
3570
|
-
emitWithFormat(res
|
|
3783
|
+
emitWithFormat(res, format, filename);
|
|
3571
3784
|
}
|
|
3572
3785
|
};
|
|
3573
3786
|
|
|
@@ -3576,12 +3789,12 @@ import { PromptClient as PromptClient2 } from "@uniformdev/canvas";
|
|
|
3576
3789
|
var PromptListModule = {
|
|
3577
3790
|
command: "list",
|
|
3578
3791
|
describe: "List prompts",
|
|
3579
|
-
builder: (
|
|
3792
|
+
builder: (yargs28) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs28)))),
|
|
3580
3793
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
3581
3794
|
const fetch3 = nodeFetchProxy(proxy);
|
|
3582
3795
|
const client = new PromptClient2({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
3583
|
-
const res = await client.
|
|
3584
|
-
emitWithFormat(res
|
|
3796
|
+
const res = await client.get();
|
|
3797
|
+
emitWithFormat(res, format, filename);
|
|
3585
3798
|
}
|
|
3586
3799
|
};
|
|
3587
3800
|
|
|
@@ -3590,14 +3803,14 @@ import { PromptClient as PromptClient3 } from "@uniformdev/canvas";
|
|
|
3590
3803
|
|
|
3591
3804
|
// src/commands/canvas/commands/prompts/_util.ts
|
|
3592
3805
|
var selectPromptIdentifier = (e) => e.id;
|
|
3593
|
-
var selectPromptDisplayName = (e) => `${e.
|
|
3806
|
+
var selectPromptDisplayName = (e) => `${e.name ?? "Untitled"} (pid: ${e.id})`;
|
|
3594
3807
|
|
|
3595
3808
|
// src/commands/canvas/promptEngineDataSource.ts
|
|
3596
3809
|
function createPromptEngineDataSource({
|
|
3597
3810
|
client
|
|
3598
3811
|
}) {
|
|
3599
3812
|
async function* getObjects() {
|
|
3600
|
-
const
|
|
3813
|
+
const prompts = await client.get();
|
|
3601
3814
|
for await (const prompt of prompts) {
|
|
3602
3815
|
const result = {
|
|
3603
3816
|
id: selectPromptIdentifier(prompt),
|
|
@@ -3623,12 +3836,12 @@ function createPromptEngineDataSource({
|
|
|
3623
3836
|
var PromptPullModule = {
|
|
3624
3837
|
command: "pull <directory>",
|
|
3625
3838
|
describe: "Pulls all entries to local files in a directory",
|
|
3626
|
-
builder: (
|
|
3839
|
+
builder: (yargs28) => withConfiguration(
|
|
3627
3840
|
withApiOptions(
|
|
3628
3841
|
withProjectOptions(
|
|
3629
3842
|
withStateOptions(
|
|
3630
3843
|
withDiffOptions(
|
|
3631
|
-
|
|
3844
|
+
yargs28.positional("directory", {
|
|
3632
3845
|
describe: "Directory to save the entries to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
3633
3846
|
type: "string"
|
|
3634
3847
|
}).option("format", {
|
|
@@ -3711,12 +3924,12 @@ import { PromptClient as PromptClient4 } from "@uniformdev/canvas";
|
|
|
3711
3924
|
var PromptPushModule = {
|
|
3712
3925
|
command: "push <directory>",
|
|
3713
3926
|
describe: "Pushes all prompts from files in a directory to Uniform",
|
|
3714
|
-
builder: (
|
|
3927
|
+
builder: (yargs28) => withConfiguration(
|
|
3715
3928
|
withApiOptions(
|
|
3716
3929
|
withProjectOptions(
|
|
3717
3930
|
withStateOptions(
|
|
3718
3931
|
withDiffOptions(
|
|
3719
|
-
|
|
3932
|
+
yargs28.positional("directory", {
|
|
3720
3933
|
describe: "Directory to read the prompts from. If a filename is used, a package will be read instead.",
|
|
3721
3934
|
type: "string"
|
|
3722
3935
|
}).option("what-if", {
|
|
@@ -3787,9 +4000,9 @@ var PromptRemoveModule = {
|
|
|
3787
4000
|
command: "remove <id>",
|
|
3788
4001
|
aliases: ["delete", "rm"],
|
|
3789
4002
|
describe: "Delete a prompt",
|
|
3790
|
-
builder: (
|
|
4003
|
+
builder: (yargs28) => withConfiguration(
|
|
3791
4004
|
withApiOptions(
|
|
3792
|
-
withProjectOptions(
|
|
4005
|
+
withProjectOptions(yargs28.positional("id", { demandOption: true, describe: "Prompt ID to delete" }))
|
|
3793
4006
|
)
|
|
3794
4007
|
),
|
|
3795
4008
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
@@ -3805,10 +4018,10 @@ var PromptUpdateModule = {
|
|
|
3805
4018
|
command: "update <filename>",
|
|
3806
4019
|
aliases: ["put"],
|
|
3807
4020
|
describe: "Insert or update a prompt",
|
|
3808
|
-
builder: (
|
|
4021
|
+
builder: (yargs28) => withConfiguration(
|
|
3809
4022
|
withApiOptions(
|
|
3810
4023
|
withProjectOptions(
|
|
3811
|
-
|
|
4024
|
+
yargs28.positional("filename", { demandOption: true, describe: "Prompt file to put" })
|
|
3812
4025
|
)
|
|
3813
4026
|
)
|
|
3814
4027
|
),
|
|
@@ -3825,9 +4038,9 @@ var PromptModule = {
|
|
|
3825
4038
|
command: "prompt <command>",
|
|
3826
4039
|
aliases: ["dt"],
|
|
3827
4040
|
describe: "Commands for AI Prompt definitions",
|
|
3828
|
-
builder: (
|
|
4041
|
+
builder: (yargs28) => yargs28.command(PromptGetModule).command(PromptListModule).command(PromptPullModule).command(PromptPushModule).command(PromptRemoveModule).command(PromptUpdateModule).demandCommand(),
|
|
3829
4042
|
handler: () => {
|
|
3830
|
-
|
|
4043
|
+
yargs10.help();
|
|
3831
4044
|
}
|
|
3832
4045
|
};
|
|
3833
4046
|
|
|
@@ -3836,28 +4049,28 @@ var CanvasCommand = {
|
|
|
3836
4049
|
command: "canvas <command>",
|
|
3837
4050
|
aliases: ["cv", "pm", "presentation"],
|
|
3838
4051
|
describe: "Uniform Canvas commands",
|
|
3839
|
-
builder: (
|
|
4052
|
+
builder: (yargs28) => yargs28.command(CompositionModule).command(ComponentModule).command(DataTypeModule).command(CategoryModule).command(PatternModule).command(ContentTypeModule).command(EntryModule).command(PromptModule).command(AssetModule).command(LocaleModule).demandCommand(),
|
|
3840
4053
|
handler: () => {
|
|
3841
|
-
|
|
4054
|
+
yargs11.showHelp();
|
|
3842
4055
|
}
|
|
3843
4056
|
};
|
|
3844
4057
|
|
|
3845
4058
|
// src/commands/context/index.ts
|
|
3846
|
-
import
|
|
4059
|
+
import yargs18 from "yargs";
|
|
3847
4060
|
|
|
3848
4061
|
// src/commands/context/commands/aggregate.ts
|
|
3849
|
-
import
|
|
4062
|
+
import yargs12 from "yargs";
|
|
3850
4063
|
|
|
3851
4064
|
// src/commands/context/commands/aggregate/get.ts
|
|
3852
4065
|
import { UncachedAggregateClient } from "@uniformdev/context/api";
|
|
3853
4066
|
var AggregateGetModule = {
|
|
3854
4067
|
command: "get <id>",
|
|
3855
4068
|
describe: "Fetch an aggregate",
|
|
3856
|
-
builder: (
|
|
4069
|
+
builder: (yargs28) => withConfiguration(
|
|
3857
4070
|
withFormatOptions(
|
|
3858
4071
|
withApiOptions(
|
|
3859
4072
|
withProjectOptions(
|
|
3860
|
-
|
|
4073
|
+
yargs28.positional("id", { demandOption: true, describe: "Aggregate public ID to fetch" })
|
|
3861
4074
|
)
|
|
3862
4075
|
)
|
|
3863
4076
|
)
|
|
@@ -3881,7 +4094,7 @@ var AggregateListModule = {
|
|
|
3881
4094
|
command: "list",
|
|
3882
4095
|
describe: "List aggregates",
|
|
3883
4096
|
aliases: ["ls"],
|
|
3884
|
-
builder: (
|
|
4097
|
+
builder: (yargs28) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs28)))),
|
|
3885
4098
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
3886
4099
|
const fetch3 = nodeFetchProxy(proxy);
|
|
3887
4100
|
const client = new UncachedAggregateClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -3947,11 +4160,11 @@ function writeContextPackage(filename, packageContents) {
|
|
|
3947
4160
|
var AggregatePullModule = {
|
|
3948
4161
|
command: "pull <directory>",
|
|
3949
4162
|
describe: "Pulls all aggregates to local files in a directory",
|
|
3950
|
-
builder: (
|
|
4163
|
+
builder: (yargs28) => withConfiguration(
|
|
3951
4164
|
withApiOptions(
|
|
3952
4165
|
withProjectOptions(
|
|
3953
4166
|
withDiffOptions(
|
|
3954
|
-
|
|
4167
|
+
yargs28.positional("directory", {
|
|
3955
4168
|
describe: "Directory to save the aggregates to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
3956
4169
|
type: "string"
|
|
3957
4170
|
}).option("format", {
|
|
@@ -4026,11 +4239,11 @@ import { UncachedAggregateClient as UncachedAggregateClient4 } from "@uniformdev
|
|
|
4026
4239
|
var AggregatePushModule = {
|
|
4027
4240
|
command: "push <directory>",
|
|
4028
4241
|
describe: "Pushes all aggregates from files in a directory or package to Uniform",
|
|
4029
|
-
builder: (
|
|
4242
|
+
builder: (yargs28) => withConfiguration(
|
|
4030
4243
|
withApiOptions(
|
|
4031
4244
|
withProjectOptions(
|
|
4032
4245
|
withDiffOptions(
|
|
4033
|
-
|
|
4246
|
+
yargs28.positional("directory", {
|
|
4034
4247
|
describe: "Directory to read the aggregates from. If a filename is used, a package will be read instead.",
|
|
4035
4248
|
type: "string"
|
|
4036
4249
|
}).option("what-if", {
|
|
@@ -4095,10 +4308,10 @@ var AggregateRemoveModule = {
|
|
|
4095
4308
|
command: "remove <id>",
|
|
4096
4309
|
aliases: ["delete", "rm"],
|
|
4097
4310
|
describe: "Delete an aggregate",
|
|
4098
|
-
builder: (
|
|
4311
|
+
builder: (yargs28) => withConfiguration(
|
|
4099
4312
|
withApiOptions(
|
|
4100
4313
|
withProjectOptions(
|
|
4101
|
-
|
|
4314
|
+
yargs28.positional("id", { demandOption: true, describe: "Aggregate public ID to delete" })
|
|
4102
4315
|
)
|
|
4103
4316
|
)
|
|
4104
4317
|
),
|
|
@@ -4115,10 +4328,10 @@ var AggregateUpdateModule = {
|
|
|
4115
4328
|
command: "update <filename>",
|
|
4116
4329
|
aliases: ["put"],
|
|
4117
4330
|
describe: "Insert or update an aggregate",
|
|
4118
|
-
builder: (
|
|
4331
|
+
builder: (yargs28) => withConfiguration(
|
|
4119
4332
|
withApiOptions(
|
|
4120
4333
|
withProjectOptions(
|
|
4121
|
-
|
|
4334
|
+
yargs28.positional("filename", { demandOption: true, describe: "Aggregate file to put" })
|
|
4122
4335
|
)
|
|
4123
4336
|
)
|
|
4124
4337
|
),
|
|
@@ -4135,25 +4348,25 @@ var AggregateModule = {
|
|
|
4135
4348
|
command: "aggregate <command>",
|
|
4136
4349
|
aliases: ["agg", "intent", "audience"],
|
|
4137
4350
|
describe: "Commands for Context aggregates (intents, audiences)",
|
|
4138
|
-
builder: (
|
|
4351
|
+
builder: (yargs28) => yargs28.command(AggregatePullModule).command(AggregatePushModule).command(AggregateGetModule).command(AggregateRemoveModule).command(AggregateListModule).command(AggregateUpdateModule).demandCommand(),
|
|
4139
4352
|
handler: () => {
|
|
4140
|
-
|
|
4353
|
+
yargs12.help();
|
|
4141
4354
|
}
|
|
4142
4355
|
};
|
|
4143
4356
|
|
|
4144
4357
|
// src/commands/context/commands/enrichment.ts
|
|
4145
|
-
import
|
|
4358
|
+
import yargs13 from "yargs";
|
|
4146
4359
|
|
|
4147
4360
|
// src/commands/context/commands/enrichment/get.ts
|
|
4148
4361
|
import { UncachedEnrichmentClient } from "@uniformdev/context/api";
|
|
4149
4362
|
var EnrichmentGetModule = {
|
|
4150
4363
|
command: "get <id>",
|
|
4151
4364
|
describe: "Fetch an enrichment category and its values",
|
|
4152
|
-
builder: (
|
|
4365
|
+
builder: (yargs28) => withFormatOptions(
|
|
4153
4366
|
withConfiguration(
|
|
4154
4367
|
withApiOptions(
|
|
4155
4368
|
withProjectOptions(
|
|
4156
|
-
|
|
4369
|
+
yargs28.positional("id", { demandOption: true, describe: "Enrichment category public ID to fetch" })
|
|
4157
4370
|
)
|
|
4158
4371
|
)
|
|
4159
4372
|
)
|
|
@@ -4178,7 +4391,7 @@ var EnrichmentListModule = {
|
|
|
4178
4391
|
command: "list",
|
|
4179
4392
|
describe: "List enrichments",
|
|
4180
4393
|
aliases: ["ls"],
|
|
4181
|
-
builder: (
|
|
4394
|
+
builder: (yargs28) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs28)))),
|
|
4182
4395
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
4183
4396
|
const fetch3 = nodeFetchProxy(proxy);
|
|
4184
4397
|
const client = new UncachedEnrichmentClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -4279,11 +4492,11 @@ var createEnrichmentValueEngineDataSource = ({
|
|
|
4279
4492
|
var EnrichmentPullModule = {
|
|
4280
4493
|
command: "pull <directory>",
|
|
4281
4494
|
describe: "Pulls all enrichments to local files in a directory",
|
|
4282
|
-
builder: (
|
|
4495
|
+
builder: (yargs28) => withConfiguration(
|
|
4283
4496
|
withApiOptions(
|
|
4284
4497
|
withProjectOptions(
|
|
4285
4498
|
withDiffOptions(
|
|
4286
|
-
|
|
4499
|
+
yargs28.positional("directory", {
|
|
4287
4500
|
describe: "Directory to save the enrichments to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
4288
4501
|
type: "string"
|
|
4289
4502
|
}).option("format", {
|
|
@@ -4358,11 +4571,11 @@ import { UncachedEnrichmentClient as UncachedEnrichmentClient4 } from "@uniformd
|
|
|
4358
4571
|
var EnrichmentPushModule = {
|
|
4359
4572
|
command: "push <directory>",
|
|
4360
4573
|
describe: "Pushes all enrichments from files in a directory or package to Uniform",
|
|
4361
|
-
builder: (
|
|
4574
|
+
builder: (yargs28) => withConfiguration(
|
|
4362
4575
|
withApiOptions(
|
|
4363
4576
|
withProjectOptions(
|
|
4364
4577
|
withDiffOptions(
|
|
4365
|
-
|
|
4578
|
+
yargs28.positional("directory", {
|
|
4366
4579
|
describe: "Directory to read the enrichments from. If a filename is used, a package will be read instead.",
|
|
4367
4580
|
type: "string"
|
|
4368
4581
|
}).option("what-if", {
|
|
@@ -4426,10 +4639,10 @@ var EnrichmentRemoveModule = {
|
|
|
4426
4639
|
command: "remove <id>",
|
|
4427
4640
|
aliases: ["delete", "rm"],
|
|
4428
4641
|
describe: "Delete an enrichment category and its values",
|
|
4429
|
-
builder: (
|
|
4642
|
+
builder: (yargs28) => withConfiguration(
|
|
4430
4643
|
withApiOptions(
|
|
4431
4644
|
withProjectOptions(
|
|
4432
|
-
|
|
4645
|
+
yargs28.positional("id", { demandOption: true, describe: "Enrichment category public ID to delete" })
|
|
4433
4646
|
)
|
|
4434
4647
|
)
|
|
4435
4648
|
),
|
|
@@ -4445,14 +4658,14 @@ var EnrichmentModule = {
|
|
|
4445
4658
|
command: "enrichment <command>",
|
|
4446
4659
|
aliases: ["enr"],
|
|
4447
4660
|
describe: "Commands for Context enrichments",
|
|
4448
|
-
builder: (
|
|
4661
|
+
builder: (yargs28) => yargs28.command(EnrichmentPullModule).command(EnrichmentPushModule).command(EnrichmentGetModule).command(EnrichmentRemoveModule).command(EnrichmentListModule).demandCommand(),
|
|
4449
4662
|
handler: () => {
|
|
4450
|
-
|
|
4663
|
+
yargs13.help();
|
|
4451
4664
|
}
|
|
4452
4665
|
};
|
|
4453
4666
|
|
|
4454
4667
|
// src/commands/context/commands/manifest.ts
|
|
4455
|
-
import
|
|
4668
|
+
import yargs14 from "yargs";
|
|
4456
4669
|
|
|
4457
4670
|
// src/commands/context/commands/manifest/get.ts
|
|
4458
4671
|
import { ApiClientError, UncachedManifestClient } from "@uniformdev/context/api";
|
|
@@ -4463,10 +4676,10 @@ var ManifestGetModule = {
|
|
|
4463
4676
|
command: "get [output]",
|
|
4464
4677
|
aliases: ["dl", "download"],
|
|
4465
4678
|
describe: "Download the Uniform Context manifest for a project",
|
|
4466
|
-
builder: (
|
|
4679
|
+
builder: (yargs28) => withConfiguration(
|
|
4467
4680
|
withApiOptions(
|
|
4468
4681
|
withProjectOptions(
|
|
4469
|
-
|
|
4682
|
+
yargs28.option("preview", {
|
|
4470
4683
|
describe: "If set, fetches the unpublished preview manifest (The API key must have permission)",
|
|
4471
4684
|
default: false,
|
|
4472
4685
|
type: "boolean",
|
|
@@ -4528,7 +4741,7 @@ import { exit as exit2 } from "process";
|
|
|
4528
4741
|
var ManifestPublishModule = {
|
|
4529
4742
|
command: "publish",
|
|
4530
4743
|
describe: "Publish the Uniform Context manifest for a project",
|
|
4531
|
-
builder: (
|
|
4744
|
+
builder: (yargs28) => withConfiguration(withApiOptions(withProjectOptions(yargs28))),
|
|
4532
4745
|
handler: async ({ apiKey, apiHost, proxy, project }) => {
|
|
4533
4746
|
const fetch3 = nodeFetchProxy(proxy);
|
|
4534
4747
|
try {
|
|
@@ -4561,25 +4774,25 @@ var ManifestModule = {
|
|
|
4561
4774
|
command: "manifest <command>",
|
|
4562
4775
|
describe: "Commands for context manifests",
|
|
4563
4776
|
aliases: ["man"],
|
|
4564
|
-
builder: (
|
|
4777
|
+
builder: (yargs28) => yargs28.command(ManifestGetModule).command(ManifestPublishModule).demandCommand(),
|
|
4565
4778
|
handler: () => {
|
|
4566
|
-
|
|
4779
|
+
yargs14.help();
|
|
4567
4780
|
}
|
|
4568
4781
|
};
|
|
4569
4782
|
|
|
4570
4783
|
// src/commands/context/commands/quirk.ts
|
|
4571
|
-
import
|
|
4784
|
+
import yargs15 from "yargs";
|
|
4572
4785
|
|
|
4573
4786
|
// src/commands/context/commands/quirk/get.ts
|
|
4574
4787
|
import { UncachedQuirkClient } from "@uniformdev/context/api";
|
|
4575
4788
|
var QuirkGetModule = {
|
|
4576
4789
|
command: "get <id>",
|
|
4577
4790
|
describe: "Fetch a quirk",
|
|
4578
|
-
builder: (
|
|
4791
|
+
builder: (yargs28) => withConfiguration(
|
|
4579
4792
|
withFormatOptions(
|
|
4580
4793
|
withApiOptions(
|
|
4581
4794
|
withProjectOptions(
|
|
4582
|
-
|
|
4795
|
+
yargs28.positional("id", { demandOption: true, describe: "Quirk public ID to fetch" })
|
|
4583
4796
|
)
|
|
4584
4797
|
)
|
|
4585
4798
|
)
|
|
@@ -4603,11 +4816,11 @@ var QuirkListModule = {
|
|
|
4603
4816
|
command: "list",
|
|
4604
4817
|
describe: "List quirks",
|
|
4605
4818
|
aliases: ["ls"],
|
|
4606
|
-
builder: (
|
|
4819
|
+
builder: (yargs28) => withConfiguration(
|
|
4607
4820
|
withFormatOptions(
|
|
4608
4821
|
withApiOptions(
|
|
4609
4822
|
withProjectOptions(
|
|
4610
|
-
|
|
4823
|
+
yargs28.option("withIntegrations", {
|
|
4611
4824
|
alias: ["i"],
|
|
4612
4825
|
describe: "Whether to include meta-quirks created by integrations in the list. Defaults to false.",
|
|
4613
4826
|
type: "boolean"
|
|
@@ -4664,11 +4877,11 @@ function createQuirkEngineDataSource({
|
|
|
4664
4877
|
var QuirkPullModule = {
|
|
4665
4878
|
command: "pull <directory>",
|
|
4666
4879
|
describe: "Pulls all quirks to local files in a directory",
|
|
4667
|
-
builder: (
|
|
4880
|
+
builder: (yargs28) => withConfiguration(
|
|
4668
4881
|
withApiOptions(
|
|
4669
4882
|
withProjectOptions(
|
|
4670
4883
|
withDiffOptions(
|
|
4671
|
-
|
|
4884
|
+
yargs28.positional("directory", {
|
|
4672
4885
|
describe: "Directory to save the quirks to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
4673
4886
|
type: "string"
|
|
4674
4887
|
}).option("format", {
|
|
@@ -4743,11 +4956,11 @@ import { UncachedQuirkClient as UncachedQuirkClient4 } from "@uniformdev/context
|
|
|
4743
4956
|
var QuirkPushModule = {
|
|
4744
4957
|
command: "push <directory>",
|
|
4745
4958
|
describe: "Pushes all quirks from files in a directory or package to Uniform",
|
|
4746
|
-
builder: (
|
|
4959
|
+
builder: (yargs28) => withConfiguration(
|
|
4747
4960
|
withApiOptions(
|
|
4748
4961
|
withProjectOptions(
|
|
4749
4962
|
withDiffOptions(
|
|
4750
|
-
|
|
4963
|
+
yargs28.positional("directory", {
|
|
4751
4964
|
describe: "Directory to read the quirks from. If a filename is used, a package will be read instead.",
|
|
4752
4965
|
type: "string"
|
|
4753
4966
|
}).option("what-if", {
|
|
@@ -4811,10 +5024,10 @@ var QuirkRemoveModule = {
|
|
|
4811
5024
|
command: "remove <id>",
|
|
4812
5025
|
aliases: ["delete", "rm"],
|
|
4813
5026
|
describe: "Delete a quirk",
|
|
4814
|
-
builder: (
|
|
5027
|
+
builder: (yargs28) => withConfiguration(
|
|
4815
5028
|
withApiOptions(
|
|
4816
5029
|
withProjectOptions(
|
|
4817
|
-
|
|
5030
|
+
yargs28.positional("id", { demandOption: true, describe: "Quirk public ID to delete" })
|
|
4818
5031
|
)
|
|
4819
5032
|
)
|
|
4820
5033
|
),
|
|
@@ -4831,10 +5044,10 @@ var QuirkUpdateModule = {
|
|
|
4831
5044
|
command: "update <filename>",
|
|
4832
5045
|
aliases: ["put"],
|
|
4833
5046
|
describe: "Insert or update a quirk",
|
|
4834
|
-
builder: (
|
|
5047
|
+
builder: (yargs28) => withConfiguration(
|
|
4835
5048
|
withApiOptions(
|
|
4836
5049
|
withProjectOptions(
|
|
4837
|
-
|
|
5050
|
+
yargs28.positional("filename", { demandOption: true, describe: "Quirk file to put" })
|
|
4838
5051
|
)
|
|
4839
5052
|
)
|
|
4840
5053
|
),
|
|
@@ -4851,25 +5064,25 @@ var QuirkModule = {
|
|
|
4851
5064
|
command: "quirk <command>",
|
|
4852
5065
|
aliases: ["qk"],
|
|
4853
5066
|
describe: "Commands for Context quirks",
|
|
4854
|
-
builder: (
|
|
5067
|
+
builder: (yargs28) => yargs28.command(QuirkPullModule).command(QuirkPushModule).command(QuirkGetModule).command(QuirkRemoveModule).command(QuirkListModule).command(QuirkUpdateModule).demandCommand(),
|
|
4855
5068
|
handler: () => {
|
|
4856
|
-
|
|
5069
|
+
yargs15.help();
|
|
4857
5070
|
}
|
|
4858
5071
|
};
|
|
4859
5072
|
|
|
4860
5073
|
// src/commands/context/commands/signal.ts
|
|
4861
|
-
import
|
|
5074
|
+
import yargs16 from "yargs";
|
|
4862
5075
|
|
|
4863
5076
|
// src/commands/context/commands/signal/get.ts
|
|
4864
5077
|
import { UncachedSignalClient } from "@uniformdev/context/api";
|
|
4865
5078
|
var SignalGetModule = {
|
|
4866
5079
|
command: "get <id>",
|
|
4867
5080
|
describe: "Fetch a signal",
|
|
4868
|
-
builder: (
|
|
5081
|
+
builder: (yargs28) => withConfiguration(
|
|
4869
5082
|
withFormatOptions(
|
|
4870
5083
|
withApiOptions(
|
|
4871
5084
|
withProjectOptions(
|
|
4872
|
-
|
|
5085
|
+
yargs28.positional("id", { demandOption: true, describe: "Signal public ID to fetch" })
|
|
4873
5086
|
)
|
|
4874
5087
|
)
|
|
4875
5088
|
)
|
|
@@ -4893,7 +5106,7 @@ var SignalListModule = {
|
|
|
4893
5106
|
command: "list",
|
|
4894
5107
|
describe: "List signals",
|
|
4895
5108
|
aliases: ["ls"],
|
|
4896
|
-
builder: (
|
|
5109
|
+
builder: (yargs28) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs28)))),
|
|
4897
5110
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
4898
5111
|
const fetch3 = nodeFetchProxy(proxy);
|
|
4899
5112
|
const client = new UncachedSignalClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -4942,11 +5155,11 @@ function createSignalEngineDataSource({
|
|
|
4942
5155
|
var SignalPullModule = {
|
|
4943
5156
|
command: "pull <directory>",
|
|
4944
5157
|
describe: "Pulls all signals to local files in a directory",
|
|
4945
|
-
builder: (
|
|
5158
|
+
builder: (yargs28) => withConfiguration(
|
|
4946
5159
|
withApiOptions(
|
|
4947
5160
|
withProjectOptions(
|
|
4948
5161
|
withDiffOptions(
|
|
4949
|
-
|
|
5162
|
+
yargs28.positional("directory", {
|
|
4950
5163
|
describe: "Directory to save the signals to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
4951
5164
|
type: "string"
|
|
4952
5165
|
}).option("format", {
|
|
@@ -5021,11 +5234,11 @@ import { UncachedSignalClient as UncachedSignalClient4 } from "@uniformdev/conte
|
|
|
5021
5234
|
var SignalPushModule = {
|
|
5022
5235
|
command: "push <directory>",
|
|
5023
5236
|
describe: "Pushes all signals from files in a directory or package to Uniform",
|
|
5024
|
-
builder: (
|
|
5237
|
+
builder: (yargs28) => withConfiguration(
|
|
5025
5238
|
withApiOptions(
|
|
5026
5239
|
withProjectOptions(
|
|
5027
5240
|
withDiffOptions(
|
|
5028
|
-
|
|
5241
|
+
yargs28.positional("directory", {
|
|
5029
5242
|
describe: "Directory to read the signals from. If a filename is used, a package will be read instead.",
|
|
5030
5243
|
type: "string"
|
|
5031
5244
|
}).option("what-if", {
|
|
@@ -5089,10 +5302,10 @@ var SignalRemoveModule = {
|
|
|
5089
5302
|
command: "remove <id>",
|
|
5090
5303
|
aliases: ["delete", "rm"],
|
|
5091
5304
|
describe: "Delete a signal",
|
|
5092
|
-
builder: (
|
|
5305
|
+
builder: (yargs28) => withConfiguration(
|
|
5093
5306
|
withApiOptions(
|
|
5094
5307
|
withProjectOptions(
|
|
5095
|
-
|
|
5308
|
+
yargs28.positional("id", { demandOption: true, describe: "Signal public ID to delete" })
|
|
5096
5309
|
)
|
|
5097
5310
|
)
|
|
5098
5311
|
),
|
|
@@ -5109,10 +5322,10 @@ var SignalUpdateModule = {
|
|
|
5109
5322
|
command: "update <filename>",
|
|
5110
5323
|
aliases: ["put"],
|
|
5111
5324
|
describe: "Insert or update a signal",
|
|
5112
|
-
builder: (
|
|
5325
|
+
builder: (yargs28) => withConfiguration(
|
|
5113
5326
|
withApiOptions(
|
|
5114
5327
|
withProjectOptions(
|
|
5115
|
-
|
|
5328
|
+
yargs28.positional("filename", { demandOption: true, describe: "Signal file to put" })
|
|
5116
5329
|
)
|
|
5117
5330
|
)
|
|
5118
5331
|
),
|
|
@@ -5129,25 +5342,25 @@ var SignalModule = {
|
|
|
5129
5342
|
command: "signal <command>",
|
|
5130
5343
|
aliases: ["sig"],
|
|
5131
5344
|
describe: "Commands for Context signals",
|
|
5132
|
-
builder: (
|
|
5345
|
+
builder: (yargs28) => yargs28.command(SignalPullModule).command(SignalPushModule).command(SignalGetModule).command(SignalRemoveModule).command(SignalListModule).command(SignalUpdateModule).demandCommand(),
|
|
5133
5346
|
handler: () => {
|
|
5134
|
-
|
|
5347
|
+
yargs16.help();
|
|
5135
5348
|
}
|
|
5136
5349
|
};
|
|
5137
5350
|
|
|
5138
5351
|
// src/commands/context/commands/test.ts
|
|
5139
|
-
import
|
|
5352
|
+
import yargs17 from "yargs";
|
|
5140
5353
|
|
|
5141
5354
|
// src/commands/context/commands/test/get.ts
|
|
5142
5355
|
import { UncachedTestClient } from "@uniformdev/context/api";
|
|
5143
5356
|
var TestGetModule = {
|
|
5144
5357
|
command: "get <id>",
|
|
5145
5358
|
describe: "Fetch a test",
|
|
5146
|
-
builder: (
|
|
5359
|
+
builder: (yargs28) => withConfiguration(
|
|
5147
5360
|
withFormatOptions(
|
|
5148
5361
|
withApiOptions(
|
|
5149
5362
|
withProjectOptions(
|
|
5150
|
-
|
|
5363
|
+
yargs28.positional("id", { demandOption: true, describe: "Test public ID to fetch" })
|
|
5151
5364
|
)
|
|
5152
5365
|
)
|
|
5153
5366
|
)
|
|
@@ -5171,7 +5384,7 @@ var TestListModule = {
|
|
|
5171
5384
|
command: "list",
|
|
5172
5385
|
describe: "List tests",
|
|
5173
5386
|
aliases: ["ls"],
|
|
5174
|
-
builder: (
|
|
5387
|
+
builder: (yargs28) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs28)))),
|
|
5175
5388
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
5176
5389
|
const fetch3 = nodeFetchProxy(proxy);
|
|
5177
5390
|
const client = new UncachedTestClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -5220,11 +5433,11 @@ function createTestEngineDataSource({
|
|
|
5220
5433
|
var TestPullModule = {
|
|
5221
5434
|
command: "pull <directory>",
|
|
5222
5435
|
describe: "Pulls all tests to local files in a directory",
|
|
5223
|
-
builder: (
|
|
5436
|
+
builder: (yargs28) => withConfiguration(
|
|
5224
5437
|
withApiOptions(
|
|
5225
5438
|
withProjectOptions(
|
|
5226
5439
|
withDiffOptions(
|
|
5227
|
-
|
|
5440
|
+
yargs28.positional("directory", {
|
|
5228
5441
|
describe: "Directory to save the tests to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
5229
5442
|
type: "string"
|
|
5230
5443
|
}).option("format", {
|
|
@@ -5299,11 +5512,11 @@ import { UncachedTestClient as UncachedTestClient4 } from "@uniformdev/context/a
|
|
|
5299
5512
|
var TestPushModule = {
|
|
5300
5513
|
command: "push <directory>",
|
|
5301
5514
|
describe: "Pushes all tests from files in a directory or package to Uniform",
|
|
5302
|
-
builder: (
|
|
5515
|
+
builder: (yargs28) => withConfiguration(
|
|
5303
5516
|
withApiOptions(
|
|
5304
5517
|
withProjectOptions(
|
|
5305
5518
|
withDiffOptions(
|
|
5306
|
-
|
|
5519
|
+
yargs28.positional("directory", {
|
|
5307
5520
|
describe: "Directory to read the tests from. If a filename is used, a package will be read instead.",
|
|
5308
5521
|
type: "string"
|
|
5309
5522
|
}).option("what-if", {
|
|
@@ -5367,10 +5580,10 @@ var TestRemoveModule = {
|
|
|
5367
5580
|
command: "remove <id>",
|
|
5368
5581
|
aliases: ["delete", "rm"],
|
|
5369
5582
|
describe: "Delete a test",
|
|
5370
|
-
builder: (
|
|
5583
|
+
builder: (yargs28) => withConfiguration(
|
|
5371
5584
|
withApiOptions(
|
|
5372
5585
|
withProjectOptions(
|
|
5373
|
-
|
|
5586
|
+
yargs28.positional("id", { demandOption: true, describe: "Test public ID to delete" })
|
|
5374
5587
|
)
|
|
5375
5588
|
)
|
|
5376
5589
|
),
|
|
@@ -5387,9 +5600,9 @@ var TestUpdateModule = {
|
|
|
5387
5600
|
command: "update <filename>",
|
|
5388
5601
|
aliases: ["put"],
|
|
5389
5602
|
describe: "Insert or update a test",
|
|
5390
|
-
builder: (
|
|
5603
|
+
builder: (yargs28) => withConfiguration(
|
|
5391
5604
|
withApiOptions(
|
|
5392
|
-
withProjectOptions(
|
|
5605
|
+
withProjectOptions(yargs28.positional("filename", { demandOption: true, describe: "Test file to put" }))
|
|
5393
5606
|
)
|
|
5394
5607
|
),
|
|
5395
5608
|
handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
|
|
@@ -5404,9 +5617,9 @@ var TestUpdateModule = {
|
|
|
5404
5617
|
var TestModule = {
|
|
5405
5618
|
command: "test <command>",
|
|
5406
5619
|
describe: "Commands for Context A/B tests",
|
|
5407
|
-
builder: (
|
|
5620
|
+
builder: (yargs28) => yargs28.command(TestPullModule).command(TestPushModule).command(TestGetModule).command(TestRemoveModule).command(TestListModule).command(TestUpdateModule).demandCommand(),
|
|
5408
5621
|
handler: () => {
|
|
5409
|
-
|
|
5622
|
+
yargs17.help();
|
|
5410
5623
|
}
|
|
5411
5624
|
};
|
|
5412
5625
|
|
|
@@ -5415,9 +5628,9 @@ var ContextCommand = {
|
|
|
5415
5628
|
command: "context <command>",
|
|
5416
5629
|
aliases: ["ctx"],
|
|
5417
5630
|
describe: "Uniform Context commands",
|
|
5418
|
-
builder: (
|
|
5631
|
+
builder: (yargs28) => yargs28.command(ManifestModule).command(SignalModule).command(EnrichmentModule).command(AggregateModule).command(QuirkModule).command(TestModule).demandCommand(),
|
|
5419
5632
|
handler: () => {
|
|
5420
|
-
|
|
5633
|
+
yargs18.showHelp();
|
|
5421
5634
|
}
|
|
5422
5635
|
};
|
|
5423
5636
|
|
|
@@ -5445,7 +5658,7 @@ import { PostHog } from "posthog-node";
|
|
|
5445
5658
|
// package.json
|
|
5446
5659
|
var package_default = {
|
|
5447
5660
|
name: "@uniformdev/cli",
|
|
5448
|
-
version: "19.
|
|
5661
|
+
version: "19.86.0",
|
|
5449
5662
|
description: "Uniform command line interface tool",
|
|
5450
5663
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
5451
5664
|
main: "./cli.js",
|
|
@@ -5480,7 +5693,7 @@ var package_default = {
|
|
|
5480
5693
|
"graphql-request": "6.1.0",
|
|
5481
5694
|
"https-proxy-agent": "^7.0.0",
|
|
5482
5695
|
"image-size": "^1.0.2",
|
|
5483
|
-
inquirer: "9.2.
|
|
5696
|
+
inquirer: "9.2.12",
|
|
5484
5697
|
"isomorphic-git": "1.24.5",
|
|
5485
5698
|
"isomorphic-unfetch": "^4.0.0",
|
|
5486
5699
|
"js-yaml": "^4.1.0",
|
|
@@ -5489,21 +5702,21 @@ var package_default = {
|
|
|
5489
5702
|
open: "9.1.0",
|
|
5490
5703
|
ora: "7.0.1",
|
|
5491
5704
|
"p-queue": "7.3.4",
|
|
5492
|
-
"posthog-node": "3.1.
|
|
5705
|
+
"posthog-node": "3.1.3",
|
|
5493
5706
|
"registry-auth-token": "^5.0.0",
|
|
5494
5707
|
"registry-url": "^6.0.0",
|
|
5495
5708
|
slugify: "1.6.6",
|
|
5496
5709
|
yargs: "^17.6.2",
|
|
5497
|
-
zod: "3.22.
|
|
5710
|
+
zod: "3.22.4"
|
|
5498
5711
|
},
|
|
5499
5712
|
devDependencies: {
|
|
5500
|
-
"@types/diff": "5.0.
|
|
5501
|
-
"@types/inquirer": "9.0.
|
|
5502
|
-
"@types/js-yaml": "4.0.
|
|
5503
|
-
"@types/jsonwebtoken": "9.0.
|
|
5504
|
-
"@types/lodash.isequalwith": "4.4.
|
|
5505
|
-
"@types/node": "18.
|
|
5506
|
-
"@types/yargs": "17.0.
|
|
5713
|
+
"@types/diff": "5.0.8",
|
|
5714
|
+
"@types/inquirer": "9.0.7",
|
|
5715
|
+
"@types/js-yaml": "4.0.9",
|
|
5716
|
+
"@types/jsonwebtoken": "9.0.5",
|
|
5717
|
+
"@types/lodash.isequalwith": "4.4.9",
|
|
5718
|
+
"@types/node": "18.19.1",
|
|
5719
|
+
"@types/yargs": "17.0.32"
|
|
5507
5720
|
},
|
|
5508
5721
|
bin: {
|
|
5509
5722
|
uniform: "./cli.js"
|
|
@@ -6455,10 +6668,10 @@ var NewMeshCmd = {
|
|
|
6455
6668
|
};
|
|
6456
6669
|
|
|
6457
6670
|
// src/commands/optimize/index.ts
|
|
6458
|
-
import
|
|
6671
|
+
import yargs20 from "yargs";
|
|
6459
6672
|
|
|
6460
6673
|
// src/commands/optimize/manifest.ts
|
|
6461
|
-
import
|
|
6674
|
+
import yargs19 from "yargs";
|
|
6462
6675
|
|
|
6463
6676
|
// src/commands/optimize/manifest/download.ts
|
|
6464
6677
|
import { gray as gray4, green as green3, red as red5, yellow as yellow2 } from "colorette";
|
|
@@ -6473,7 +6686,7 @@ var UniformBaseUrl = "https://uniform.app";
|
|
|
6473
6686
|
var module = {
|
|
6474
6687
|
command: "download [output]",
|
|
6475
6688
|
describe: "Download intent manifest",
|
|
6476
|
-
builder: (
|
|
6689
|
+
builder: (yargs28) => yargs28.option("apiKey", {
|
|
6477
6690
|
alias: "k",
|
|
6478
6691
|
demandOption: true,
|
|
6479
6692
|
string: true,
|
|
@@ -6574,10 +6787,10 @@ var module2 = {
|
|
|
6574
6787
|
command: "manifest <command>",
|
|
6575
6788
|
describe: "Intent manifest commands",
|
|
6576
6789
|
builder: () => {
|
|
6577
|
-
return
|
|
6790
|
+
return yargs19.command(download_default);
|
|
6578
6791
|
},
|
|
6579
6792
|
handler: () => {
|
|
6580
|
-
|
|
6793
|
+
yargs19.showHelp();
|
|
6581
6794
|
}
|
|
6582
6795
|
};
|
|
6583
6796
|
var manifest_default = module2;
|
|
@@ -6588,29 +6801,29 @@ var OptimizeCommand = {
|
|
|
6588
6801
|
aliases: ["opt"],
|
|
6589
6802
|
describe: "Uniform Optimize commands",
|
|
6590
6803
|
builder: () => {
|
|
6591
|
-
return
|
|
6804
|
+
return yargs20.command(manifest_default);
|
|
6592
6805
|
},
|
|
6593
6806
|
handler: () => {
|
|
6594
|
-
|
|
6807
|
+
yargs20.showHelp();
|
|
6595
6808
|
}
|
|
6596
6809
|
};
|
|
6597
6810
|
|
|
6598
6811
|
// src/commands/project-map/index.ts
|
|
6599
|
-
import
|
|
6812
|
+
import yargs23 from "yargs";
|
|
6600
6813
|
|
|
6601
6814
|
// src/commands/project-map/commands/projectMapDefinition.ts
|
|
6602
|
-
import
|
|
6815
|
+
import yargs21 from "yargs";
|
|
6603
6816
|
|
|
6604
6817
|
// src/commands/project-map/commands/ProjectMapDefinition/get.ts
|
|
6605
6818
|
import { UncachedProjectMapClient } from "@uniformdev/project-map";
|
|
6606
6819
|
var ProjectMapDefinitionGetModule = {
|
|
6607
6820
|
command: "get <id>",
|
|
6608
6821
|
describe: "Fetch a project map",
|
|
6609
|
-
builder: (
|
|
6822
|
+
builder: (yargs28) => withFormatOptions(
|
|
6610
6823
|
withConfiguration(
|
|
6611
6824
|
withApiOptions(
|
|
6612
6825
|
withProjectOptions(
|
|
6613
|
-
|
|
6826
|
+
yargs28.positional("id", { demandOption: true, describe: "ProjectMap UUID to fetch" })
|
|
6614
6827
|
)
|
|
6615
6828
|
)
|
|
6616
6829
|
)
|
|
@@ -6634,7 +6847,7 @@ var ProjectMapDefinitionListModule = {
|
|
|
6634
6847
|
command: "list",
|
|
6635
6848
|
describe: "List of project maps",
|
|
6636
6849
|
aliases: ["ls"],
|
|
6637
|
-
builder: (
|
|
6850
|
+
builder: (yargs28) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs28)))),
|
|
6638
6851
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
6639
6852
|
const fetch3 = nodeFetchProxy(proxy);
|
|
6640
6853
|
const client = new UncachedProjectMapClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -6691,11 +6904,11 @@ function createProjectMapDefinitionEngineDataSource({
|
|
|
6691
6904
|
var ProjectMapDefinitionPullModule = {
|
|
6692
6905
|
command: "pull <directory>",
|
|
6693
6906
|
describe: "Pulls all project maps to local files in a directory",
|
|
6694
|
-
builder: (
|
|
6907
|
+
builder: (yargs28) => withConfiguration(
|
|
6695
6908
|
withApiOptions(
|
|
6696
6909
|
withProjectOptions(
|
|
6697
6910
|
withDiffOptions(
|
|
6698
|
-
|
|
6911
|
+
yargs28.positional("directory", {
|
|
6699
6912
|
describe: "Directory to save project maps to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
6700
6913
|
type: "string"
|
|
6701
6914
|
}).option("format", {
|
|
@@ -6771,11 +6984,11 @@ import { UncachedProjectMapClient as UncachedProjectMapClient4 } from "@uniformd
|
|
|
6771
6984
|
var ProjectMapDefinitionPushModule = {
|
|
6772
6985
|
command: "push <directory>",
|
|
6773
6986
|
describe: "Pushes all project maps from files in a directory or package to Uniform",
|
|
6774
|
-
builder: (
|
|
6987
|
+
builder: (yargs28) => withConfiguration(
|
|
6775
6988
|
withApiOptions(
|
|
6776
6989
|
withProjectOptions(
|
|
6777
6990
|
withDiffOptions(
|
|
6778
|
-
|
|
6991
|
+
yargs28.positional("directory", {
|
|
6779
6992
|
describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
|
|
6780
6993
|
type: "string"
|
|
6781
6994
|
}).option("what-if", {
|
|
@@ -6839,9 +7052,9 @@ var ProjectMapDefinitionRemoveModule = {
|
|
|
6839
7052
|
command: "remove <id>",
|
|
6840
7053
|
aliases: ["delete", "rm"],
|
|
6841
7054
|
describe: "Delete a project map",
|
|
6842
|
-
builder: (
|
|
7055
|
+
builder: (yargs28) => withConfiguration(
|
|
6843
7056
|
withApiOptions(
|
|
6844
|
-
withProjectOptions(
|
|
7057
|
+
withProjectOptions(yargs28.positional("id", { demandOption: true, describe: " UUID to delete" }))
|
|
6845
7058
|
)
|
|
6846
7059
|
),
|
|
6847
7060
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
@@ -6857,10 +7070,10 @@ var ProjectMapDefinitionUpdateModule = {
|
|
|
6857
7070
|
command: "update <filename>",
|
|
6858
7071
|
aliases: ["put"],
|
|
6859
7072
|
describe: "Insert or update a project map",
|
|
6860
|
-
builder: (
|
|
7073
|
+
builder: (yargs28) => withConfiguration(
|
|
6861
7074
|
withApiOptions(
|
|
6862
7075
|
withProjectOptions(
|
|
6863
|
-
|
|
7076
|
+
yargs28.positional("filename", { demandOption: true, describe: "Project map file to put" })
|
|
6864
7077
|
)
|
|
6865
7078
|
)
|
|
6866
7079
|
),
|
|
@@ -6876,25 +7089,25 @@ var ProjectMapDefinitionUpdateModule = {
|
|
|
6876
7089
|
var ProjectMapDefinitionModule = {
|
|
6877
7090
|
command: "definition <command>",
|
|
6878
7091
|
describe: "Commands for ProjectMap Definitions",
|
|
6879
|
-
builder: (
|
|
7092
|
+
builder: (yargs28) => yargs28.command(ProjectMapDefinitionPullModule).command(ProjectMapDefinitionPushModule).command(ProjectMapDefinitionGetModule).command(ProjectMapDefinitionRemoveModule).command(ProjectMapDefinitionListModule).command(ProjectMapDefinitionUpdateModule).demandCommand(),
|
|
6880
7093
|
handler: () => {
|
|
6881
|
-
|
|
7094
|
+
yargs21.help();
|
|
6882
7095
|
}
|
|
6883
7096
|
};
|
|
6884
7097
|
|
|
6885
7098
|
// src/commands/project-map/commands/projectMapNode.ts
|
|
6886
|
-
import
|
|
7099
|
+
import yargs22 from "yargs";
|
|
6887
7100
|
|
|
6888
7101
|
// src/commands/project-map/commands/ProjectMapNode/get.ts
|
|
6889
7102
|
import { UncachedProjectMapClient as UncachedProjectMapClient7 } from "@uniformdev/project-map";
|
|
6890
7103
|
var ProjectMapNodeGetModule = {
|
|
6891
7104
|
command: "get <id> <projectMapId>",
|
|
6892
7105
|
describe: "Fetch a project map node",
|
|
6893
|
-
builder: (
|
|
7106
|
+
builder: (yargs28) => withConfiguration(
|
|
6894
7107
|
withFormatOptions(
|
|
6895
7108
|
withApiOptions(
|
|
6896
7109
|
withProjectOptions(
|
|
6897
|
-
|
|
7110
|
+
yargs28.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to fetch" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to fetch from" })
|
|
6898
7111
|
)
|
|
6899
7112
|
)
|
|
6900
7113
|
)
|
|
@@ -6920,11 +7133,11 @@ var ProjectMapNodeListModule = {
|
|
|
6920
7133
|
command: "list <projectMapId>",
|
|
6921
7134
|
describe: "List project map nodes",
|
|
6922
7135
|
aliases: ["ls"],
|
|
6923
|
-
builder: (
|
|
7136
|
+
builder: (yargs28) => withConfiguration(
|
|
6924
7137
|
withFormatOptions(
|
|
6925
7138
|
withApiOptions(
|
|
6926
7139
|
withProjectOptions(
|
|
6927
|
-
|
|
7140
|
+
yargs28.positional("projectMapId", {
|
|
6928
7141
|
demandOption: true,
|
|
6929
7142
|
describe: "ProjectMap UUID to fetch from"
|
|
6930
7143
|
})
|
|
@@ -6995,11 +7208,11 @@ function createProjectMapNodeEngineDataSource({
|
|
|
6995
7208
|
var ProjectMapNodePullModule = {
|
|
6996
7209
|
command: "pull <directory>",
|
|
6997
7210
|
describe: "Pulls all project maps nodes to local files in a directory",
|
|
6998
|
-
builder: (
|
|
7211
|
+
builder: (yargs28) => withConfiguration(
|
|
6999
7212
|
withApiOptions(
|
|
7000
7213
|
withProjectOptions(
|
|
7001
7214
|
withDiffOptions(
|
|
7002
|
-
|
|
7215
|
+
yargs28.positional("directory", {
|
|
7003
7216
|
describe: "Directory to save project maps to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
7004
7217
|
type: "string"
|
|
7005
7218
|
}).option("format", {
|
|
@@ -7079,11 +7292,11 @@ import { UncachedProjectMapClient as UncachedProjectMapClient10 } from "@uniform
|
|
|
7079
7292
|
var ProjectMapNodePushModule = {
|
|
7080
7293
|
command: "push <directory>",
|
|
7081
7294
|
describe: "Pushes all project maps nodes from files in a directory or package to Uniform",
|
|
7082
|
-
builder: (
|
|
7295
|
+
builder: (yargs28) => withConfiguration(
|
|
7083
7296
|
withApiOptions(
|
|
7084
7297
|
withProjectOptions(
|
|
7085
7298
|
withDiffOptions(
|
|
7086
|
-
|
|
7299
|
+
yargs28.positional("directory", {
|
|
7087
7300
|
describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
|
|
7088
7301
|
type: "string"
|
|
7089
7302
|
}).option("what-if", {
|
|
@@ -7156,10 +7369,10 @@ var ProjectMapNodeRemoveModule = {
|
|
|
7156
7369
|
command: "remove <id> <projectMapId>",
|
|
7157
7370
|
aliases: ["delete", "rm"],
|
|
7158
7371
|
describe: "Delete a project map node",
|
|
7159
|
-
builder: (
|
|
7372
|
+
builder: (yargs28) => withConfiguration(
|
|
7160
7373
|
withApiOptions(
|
|
7161
7374
|
withProjectOptions(
|
|
7162
|
-
|
|
7375
|
+
yargs28.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to delete" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to delete from" })
|
|
7163
7376
|
)
|
|
7164
7377
|
)
|
|
7165
7378
|
),
|
|
@@ -7176,10 +7389,10 @@ var ProjectMapNodeUpdateModule = {
|
|
|
7176
7389
|
command: "update <filename> <projectMapId>",
|
|
7177
7390
|
aliases: ["put"],
|
|
7178
7391
|
describe: "Insert or update a project map node",
|
|
7179
|
-
builder: (
|
|
7392
|
+
builder: (yargs28) => withConfiguration(
|
|
7180
7393
|
withApiOptions(
|
|
7181
7394
|
withProjectOptions(
|
|
7182
|
-
|
|
7395
|
+
yargs28.positional("filename", { demandOption: true, describe: "ProjectMap node file with nodes data" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to put into" })
|
|
7183
7396
|
)
|
|
7184
7397
|
)
|
|
7185
7398
|
),
|
|
@@ -7195,9 +7408,9 @@ var ProjectMapNodeUpdateModule = {
|
|
|
7195
7408
|
var ProjectMapNodeModule = {
|
|
7196
7409
|
command: "node <command>",
|
|
7197
7410
|
describe: "Commands for ProjectMap Nodes",
|
|
7198
|
-
builder: (
|
|
7411
|
+
builder: (yargs28) => yargs28.command(ProjectMapNodePullModule).command(ProjectMapNodePushModule).command(ProjectMapNodeGetModule).command(ProjectMapNodeRemoveModule).command(ProjectMapNodeListModule).command(ProjectMapNodeUpdateModule).demandCommand(),
|
|
7199
7412
|
handler: () => {
|
|
7200
|
-
|
|
7413
|
+
yargs22.help();
|
|
7201
7414
|
}
|
|
7202
7415
|
};
|
|
7203
7416
|
|
|
@@ -7206,28 +7419,28 @@ var ProjectMapCommand = {
|
|
|
7206
7419
|
command: "project-map <command>",
|
|
7207
7420
|
aliases: ["prm"],
|
|
7208
7421
|
describe: "Uniform ProjectMap commands",
|
|
7209
|
-
builder: (
|
|
7422
|
+
builder: (yargs28) => yargs28.command(ProjectMapNodeModule).command(ProjectMapDefinitionModule).demandCommand(),
|
|
7210
7423
|
handler: () => {
|
|
7211
|
-
|
|
7424
|
+
yargs23.showHelp();
|
|
7212
7425
|
}
|
|
7213
7426
|
};
|
|
7214
7427
|
|
|
7215
7428
|
// src/commands/redirect/index.ts
|
|
7216
|
-
import
|
|
7429
|
+
import yargs25 from "yargs";
|
|
7217
7430
|
|
|
7218
7431
|
// src/commands/redirect/commands/redirect.ts
|
|
7219
|
-
import
|
|
7432
|
+
import yargs24 from "yargs";
|
|
7220
7433
|
|
|
7221
7434
|
// src/commands/redirect/commands/RedirectDefinition/get.ts
|
|
7222
7435
|
import { UncachedRedirectClient } from "@uniformdev/redirect";
|
|
7223
7436
|
var RedirectDefinitionGetModule = {
|
|
7224
7437
|
command: "get <id>",
|
|
7225
7438
|
describe: "Fetch a redirect",
|
|
7226
|
-
builder: (
|
|
7439
|
+
builder: (yargs28) => withConfiguration(
|
|
7227
7440
|
withFormatOptions(
|
|
7228
7441
|
withApiOptions(
|
|
7229
7442
|
withProjectOptions(
|
|
7230
|
-
|
|
7443
|
+
yargs28.positional("id", { demandOption: true, describe: "Redirect UUID to fetch" })
|
|
7231
7444
|
)
|
|
7232
7445
|
)
|
|
7233
7446
|
)
|
|
@@ -7251,7 +7464,7 @@ var RedirectDefinitionListModule = {
|
|
|
7251
7464
|
command: "list",
|
|
7252
7465
|
describe: "List of redirects",
|
|
7253
7466
|
aliases: ["ls"],
|
|
7254
|
-
builder: (
|
|
7467
|
+
builder: (yargs28) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs28)))),
|
|
7255
7468
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
7256
7469
|
const fetch3 = nodeFetchProxy(proxy);
|
|
7257
7470
|
const client = new UncachedRedirectClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -7317,11 +7530,11 @@ function createRedirectDefinitionEngineDataSource({
|
|
|
7317
7530
|
var RedirectDefinitionPullModule = {
|
|
7318
7531
|
command: "pull <directory>",
|
|
7319
7532
|
describe: "Pulls all redirects to local files in a directory",
|
|
7320
|
-
builder: (
|
|
7533
|
+
builder: (yargs28) => withConfiguration(
|
|
7321
7534
|
withApiOptions(
|
|
7322
7535
|
withProjectOptions(
|
|
7323
7536
|
withDiffOptions(
|
|
7324
|
-
|
|
7537
|
+
yargs28.positional("directory", {
|
|
7325
7538
|
describe: "Directory to save redirects to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
7326
7539
|
type: "string"
|
|
7327
7540
|
}).option("format", {
|
|
@@ -7398,11 +7611,11 @@ import { UncachedRedirectClient as UncachedRedirectClient4 } from "@uniformdev/r
|
|
|
7398
7611
|
var RedirectDefinitionPushModule = {
|
|
7399
7612
|
command: "push <directory>",
|
|
7400
7613
|
describe: "Pushes all redirects from files in a directory or package to Uniform",
|
|
7401
|
-
builder: (
|
|
7614
|
+
builder: (yargs28) => withConfiguration(
|
|
7402
7615
|
withApiOptions(
|
|
7403
7616
|
withProjectOptions(
|
|
7404
7617
|
withDiffOptions(
|
|
7405
|
-
|
|
7618
|
+
yargs28.positional("directory", {
|
|
7406
7619
|
describe: "Directory to read redirects from. If a filename is used, a package will be read instead.",
|
|
7407
7620
|
type: "string"
|
|
7408
7621
|
}).option("what-if", {
|
|
@@ -7466,9 +7679,9 @@ var RedirectDefinitionRemoveModule = {
|
|
|
7466
7679
|
command: "remove <id>",
|
|
7467
7680
|
aliases: ["delete", "rm"],
|
|
7468
7681
|
describe: "Delete a redirect",
|
|
7469
|
-
builder: (
|
|
7682
|
+
builder: (yargs28) => withConfiguration(
|
|
7470
7683
|
withApiOptions(
|
|
7471
|
-
withProjectOptions(
|
|
7684
|
+
withProjectOptions(yargs28.positional("id", { demandOption: true, describe: " UUID to delete" }))
|
|
7472
7685
|
)
|
|
7473
7686
|
),
|
|
7474
7687
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
@@ -7484,10 +7697,10 @@ var RedirectDefinitionUpdateModule = {
|
|
|
7484
7697
|
command: "update <filename>",
|
|
7485
7698
|
aliases: ["put"],
|
|
7486
7699
|
describe: "Insert or update a redirect",
|
|
7487
|
-
builder: (
|
|
7700
|
+
builder: (yargs28) => withConfiguration(
|
|
7488
7701
|
withApiOptions(
|
|
7489
7702
|
withProjectOptions(
|
|
7490
|
-
|
|
7703
|
+
yargs28.positional("filename", { demandOption: true, describe: "Redirect file to put" })
|
|
7491
7704
|
)
|
|
7492
7705
|
)
|
|
7493
7706
|
),
|
|
@@ -7503,9 +7716,9 @@ var RedirectDefinitionUpdateModule = {
|
|
|
7503
7716
|
var RedirectDefinitionModule = {
|
|
7504
7717
|
command: "definition <command>",
|
|
7505
7718
|
describe: "Commands for Redirect Definitions",
|
|
7506
|
-
builder: (
|
|
7719
|
+
builder: (yargs28) => yargs28.command(RedirectDefinitionPullModule).command(RedirectDefinitionPushModule).command(RedirectDefinitionGetModule).command(RedirectDefinitionRemoveModule).command(RedirectDefinitionListModule).command(RedirectDefinitionUpdateModule).demandCommand(),
|
|
7507
7720
|
handler: () => {
|
|
7508
|
-
|
|
7721
|
+
yargs24.help();
|
|
7509
7722
|
}
|
|
7510
7723
|
};
|
|
7511
7724
|
|
|
@@ -7514,14 +7727,14 @@ var RedirectCommand = {
|
|
|
7514
7727
|
command: "redirect <command>",
|
|
7515
7728
|
aliases: ["red"],
|
|
7516
7729
|
describe: "Uniform Redirect commands",
|
|
7517
|
-
builder: (
|
|
7730
|
+
builder: (yargs28) => yargs28.command(RedirectDefinitionModule).demandCommand(),
|
|
7518
7731
|
handler: () => {
|
|
7519
|
-
|
|
7732
|
+
yargs25.showHelp();
|
|
7520
7733
|
}
|
|
7521
7734
|
};
|
|
7522
7735
|
|
|
7523
7736
|
// src/commands/sync/index.ts
|
|
7524
|
-
import
|
|
7737
|
+
import yargs26 from "yargs";
|
|
7525
7738
|
|
|
7526
7739
|
// src/commands/sync/commands/util.ts
|
|
7527
7740
|
import ora2 from "ora";
|
|
@@ -7540,10 +7753,12 @@ function spin(entityType) {
|
|
|
7540
7753
|
stop: () => {
|
|
7541
7754
|
spinner.stop();
|
|
7542
7755
|
console.log = consoleLog;
|
|
7756
|
+
return spinner;
|
|
7543
7757
|
},
|
|
7544
7758
|
succeed() {
|
|
7545
7759
|
spinner.succeed();
|
|
7546
7760
|
console.log = consoleLog;
|
|
7761
|
+
return spinner;
|
|
7547
7762
|
}
|
|
7548
7763
|
};
|
|
7549
7764
|
}
|
|
@@ -7552,11 +7767,11 @@ function spin(entityType) {
|
|
|
7552
7767
|
var SyncPullModule = {
|
|
7553
7768
|
command: "pull",
|
|
7554
7769
|
describe: "Pulls whole project to local files in a directory",
|
|
7555
|
-
builder: (
|
|
7770
|
+
builder: (yargs28) => withConfiguration(
|
|
7556
7771
|
withApiOptions(
|
|
7557
7772
|
withProjectOptions(
|
|
7558
7773
|
withDiffOptions(
|
|
7559
|
-
|
|
7774
|
+
yargs28.option("what-if", {
|
|
7560
7775
|
alias: ["w"],
|
|
7561
7776
|
describe: "What-if mode reports what would be done but changes no files",
|
|
7562
7777
|
default: false,
|
|
@@ -7569,6 +7784,7 @@ var SyncPullModule = {
|
|
|
7569
7784
|
handler: async ({ serialization, ...otherParams }) => {
|
|
7570
7785
|
const config2 = serialization;
|
|
7571
7786
|
const enabledEntities = Object.entries({
|
|
7787
|
+
locale: LocalePullModule,
|
|
7572
7788
|
category: CategoryPullModule,
|
|
7573
7789
|
dataType: DataTypePullModule,
|
|
7574
7790
|
prompt: PromptPullModule,
|
|
@@ -7643,11 +7859,11 @@ var getFormat = (entityType, config2) => {
|
|
|
7643
7859
|
var SyncPushModule = {
|
|
7644
7860
|
command: "push",
|
|
7645
7861
|
describe: "Pushes whole project data from files in a directory or package to Uniform",
|
|
7646
|
-
builder: (
|
|
7862
|
+
builder: (yargs28) => withConfiguration(
|
|
7647
7863
|
withApiOptions(
|
|
7648
7864
|
withProjectOptions(
|
|
7649
7865
|
withDiffOptions(
|
|
7650
|
-
|
|
7866
|
+
yargs28.option("what-if", {
|
|
7651
7867
|
alias: ["w"],
|
|
7652
7868
|
describe: "What-if mode reports what would be done but changes nothing",
|
|
7653
7869
|
default: false,
|
|
@@ -7661,6 +7877,7 @@ var SyncPushModule = {
|
|
|
7661
7877
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
7662
7878
|
const config2 = serialization;
|
|
7663
7879
|
const enabledEntities = Object.entries({
|
|
7880
|
+
locale: LocalePushModule,
|
|
7664
7881
|
category: CategoryPushModule,
|
|
7665
7882
|
dataType: DataTypePushModule,
|
|
7666
7883
|
prompt: PromptPushModule,
|
|
@@ -7741,9 +7958,9 @@ var getFormat2 = (entityType, config2) => {
|
|
|
7741
7958
|
var SyncCommand = {
|
|
7742
7959
|
command: "sync <command>",
|
|
7743
7960
|
describe: "Uniform Sync commands",
|
|
7744
|
-
builder: (
|
|
7961
|
+
builder: (yargs28) => yargs28.command(SyncPullModule).command(SyncPushModule).demandCommand(),
|
|
7745
7962
|
handler: () => {
|
|
7746
|
-
|
|
7963
|
+
yargs26.showHelp();
|
|
7747
7964
|
}
|
|
7748
7965
|
};
|
|
7749
7966
|
|
|
@@ -8009,7 +8226,7 @@ First found was: v${firstVersion}`;
|
|
|
8009
8226
|
|
|
8010
8227
|
// src/index.ts
|
|
8011
8228
|
dotenv.config();
|
|
8012
|
-
var yarggery =
|
|
8229
|
+
var yarggery = yargs27(hideBin(process.argv));
|
|
8013
8230
|
var inlineConfigurationFilePath = "config" in yarggery.argv && yarggery.argv.config;
|
|
8014
8231
|
var configuration = loadConfig(inlineConfigurationFilePath || null);
|
|
8015
8232
|
yarggery.option("verbose", {
|