@uniformdev/cli 19.210.1-alpha.7 → 19.210.2

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.mjs CHANGED
@@ -16,7 +16,7 @@ import {
16
16
  withFormatOptions,
17
17
  withProjectOptions,
18
18
  withTeamOptions
19
- } from "./chunk-3T7NQ5TX.mjs";
19
+ } from "./chunk-KAJUBJZI.mjs";
20
20
 
21
21
  // src/index.ts
22
22
  import * as dotenv from "dotenv";
@@ -29,6 +29,9 @@ import yargs18 from "yargs";
29
29
  // src/commands/canvas/commands/asset.ts
30
30
  import yargs from "yargs";
31
31
 
32
+ // src/commands/canvas/commands/asset/get.ts
33
+ import { UncachedAssetClient } from "@uniformdev/assets";
34
+
32
35
  // src/sync/arraySyncEngineDataSource.ts
33
36
  async function createArraySyncEngineDataSource({
34
37
  name,
@@ -185,7 +188,7 @@ async function createFileSyncEngineDataSource({
185
188
  for (const filename of filenames) {
186
189
  const fullFilename = join(directory, filename);
187
190
  try {
188
- const contents = readFileToObject(fullFilename);
191
+ const contents = await readFileToObject(fullFilename);
189
192
  const displayName = selectDisplayName16(contents);
190
193
  const object = {
191
194
  id: selectIdentifier16(contents),
@@ -248,76 +251,27 @@ function writeUniformPackage(filename, packageContents) {
248
251
 
249
252
  // src/sync/syncEngine.ts
250
253
  import { diffJson, diffLines } from "diff";
251
- import mitt from "mitt";
252
-
253
- // src/sync/serializedDequal.ts
254
- var has = Object.prototype.hasOwnProperty;
255
- var ignoredProperties = /* @__PURE__ */ new Set(["created", "modified", "updated"]);
256
- function serializedDequal(foo, bar) {
257
- let ctor, len;
258
- if (foo === bar) {
259
- return true;
260
- }
261
- if (foo && bar && (ctor = foo.constructor) === bar.constructor) {
262
- if (ctor === Date) {
263
- return foo.getTime() === bar.getTime();
264
- }
265
- if (ctor === RegExp) {
266
- return foo.toString() === bar.toString();
267
- }
268
- if (ctor === Array) {
269
- const fooArray = foo;
270
- const barArray = bar;
271
- if (fooArray.length === barArray.length) {
272
- for (let i = 0; i < fooArray.length; i++) {
273
- if (!serializedDequal(fooArray[i], barArray[i])) {
274
- return false;
275
- }
276
- }
277
- return true;
278
- }
279
- return false;
280
- }
281
- if (!ctor || typeof foo === "object") {
282
- const fooObject = foo;
283
- const barObject = bar;
284
- len = 0;
285
- for (const ctor2 in fooObject) {
286
- const isIgnored = ignoredProperties.has(ctor2);
287
- if (
288
- // custom property name skips
289
- !isIgnored && has.call(fooObject, ctor2) && ++len && !has.call(barObject, ctor2)
290
- ) {
291
- return false;
292
- }
293
- if (!isIgnored && (!(ctor2 in barObject) || !serializedDequal(fooObject[ctor2], barObject[ctor2]))) {
294
- return false;
295
- }
296
- }
297
- const areKeysEqual = Object.keys(barObject).filter((key) => !ignoredProperties.has(key)).length === len;
298
- return areKeysEqual;
299
- }
300
- }
301
- return foo !== foo && bar !== bar;
302
- }
303
-
304
- // src/sync/syncEngine.ts
305
- var syncEngineEvents = mitt();
254
+ import isEqualWith from "lodash.isequalwith";
306
255
  async function syncEngine({
307
256
  source,
308
257
  target,
309
- compareContents = (foo, bar) => serializedDequal(foo.object, bar.object),
258
+ compareContents = (source2, target2) => {
259
+ return isEqualWith(
260
+ source2.object,
261
+ target2.object,
262
+ (_a, _b, key) => key === "created" || key === "modified" || key === "updated" ? true : void 0
263
+ );
264
+ },
310
265
  mode,
311
266
  allowEmptySource = false,
312
267
  whatIf = false,
268
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
313
269
  log: log2 = () => {
314
270
  },
315
271
  onBeforeCompareObjects,
316
272
  onBeforeWriteObject,
317
273
  onError
318
- //verbose = false,
319
274
  }) {
320
- const status = new ReactiveStatusUpdate((status2) => syncEngineEvents.emit("statusUpdate", status2));
321
275
  const targetItems = /* @__PURE__ */ new Map();
322
276
  const deleteTracker = /* @__PURE__ */ new Set();
323
277
  const processDelete = async (object) => {
@@ -326,7 +280,6 @@ async function syncEngine({
326
280
  try {
327
281
  if (!whatIf) {
328
282
  await target.deleteObject(object.providerId, object);
329
- status.changesApplied++;
330
283
  }
331
284
  } catch (e) {
332
285
  if (onError) {
@@ -341,12 +294,11 @@ async function syncEngine({
341
294
  providerId: object.providerId,
342
295
  displayName: object.displayName ?? object.providerId,
343
296
  whatIf,
344
- diff: () => diffLines(JSON.stringify(object.object, null, 2), "")
297
+ diff: diffLines(JSON.stringify(object.object, null, 2), "")
345
298
  });
346
299
  }
347
300
  };
348
301
  for await (const obj of target.objects) {
349
- status.fetched++;
350
302
  if (Array.isArray(obj.id)) {
351
303
  obj.id.forEach((o) => targetItems.set(o, obj));
352
304
  } else {
@@ -359,20 +311,16 @@ async function syncEngine({
359
311
  sourceHasItems = true;
360
312
  const ids = Array.isArray(sourceObject.id) ? sourceObject.id : [sourceObject.id];
361
313
  const targetObject = targetItems.get(ids[0]);
362
- status.compared++;
363
314
  const invalidTargetObjects = ids.map((i) => targetItems.get(i)).filter((o) => o?.object !== targetObject?.object);
364
- if (targetObject && invalidTargetObjects.length === 0) {
315
+ if (targetObject && invalidTargetObjects.length == 0) {
365
316
  sourceObject = onBeforeCompareObjects ? await onBeforeCompareObjects(sourceObject, targetObject) : sourceObject;
366
- const compareResult = compareContents(sourceObject, targetObject);
367
- if (!compareResult) {
317
+ if (!compareContents(sourceObject, targetObject)) {
368
318
  if (mode === "createOrUpdate" || mode === "mirror") {
369
- status.changeCount++;
370
319
  const process2 = async (sourceObject2, targetObject2) => {
371
320
  try {
372
321
  if (!whatIf) {
373
322
  const finalSourceObject = onBeforeWriteObject ? await onBeforeWriteObject(sourceObject2, targetObject2) : sourceObject2;
374
323
  await target.writeObject(finalSourceObject, targetObject2);
375
- status.changesApplied++;
376
324
  }
377
325
  } catch (e) {
378
326
  if (onError) {
@@ -387,7 +335,7 @@ async function syncEngine({
387
335
  providerId: sourceObject2.providerId,
388
336
  displayName: sourceObject2.displayName ?? sourceObject2.providerId,
389
337
  whatIf,
390
- diff: () => diffJson(targetObject2.object, sourceObject2.object)
338
+ diff: diffJson(targetObject2.object, sourceObject2.object)
391
339
  });
392
340
  }
393
341
  };
@@ -396,13 +344,11 @@ async function syncEngine({
396
344
  }
397
345
  ids.forEach((i) => targetItems.delete(i));
398
346
  } else {
399
- status.changeCount++;
400
- const processUpsert = async (sourceObject2, id) => {
347
+ const process2 = async (sourceObject2, id) => {
401
348
  try {
402
349
  if (!whatIf) {
403
350
  const finalSourceObject = onBeforeWriteObject ? await onBeforeWriteObject(sourceObject2) : sourceObject2;
404
351
  await target.writeObject(finalSourceObject);
405
- status.changesApplied++;
406
352
  }
407
353
  } catch (e) {
408
354
  if (onError) {
@@ -417,7 +363,7 @@ async function syncEngine({
417
363
  providerId: id,
418
364
  displayName: sourceObject2.displayName ?? sourceObject2.providerId,
419
365
  whatIf,
420
- diff: () => diffLines("", JSON.stringify(sourceObject2.object, null, 2))
366
+ diff: diffLines("", JSON.stringify(sourceObject2.object, null, 2))
421
367
  });
422
368
  }
423
369
  };
@@ -425,19 +371,18 @@ async function syncEngine({
425
371
  [...invalidTargetObjects, targetObject].forEach((o) => {
426
372
  (Array.isArray(o?.id) ? o?.id : [o?.id])?.forEach((i) => i && targetItems.delete(i));
427
373
  });
428
- const deletes = invalidTargetObjects.filter((invalidTargetObject) => typeof invalidTargetObject !== "undefined").map((invalidTargetObject) => () => processDelete(invalidTargetObject));
374
+ const deletes = invalidTargetObjects.filter((io) => typeof io !== "undefined").map((io) => {
375
+ return () => processDelete(io);
376
+ });
429
377
  if (targetObject) {
430
378
  deletes.push(() => processDelete(targetObject));
431
379
  }
432
- actions.push(
433
- () => Promise.all(deletes.map((deleteFn) => deleteFn())).then(() => processUpsert(sourceObject, ids[0]))
434
- );
380
+ actions.push(() => Promise.all(deletes.map((d) => d())).then(() => process2(sourceObject, ids[0])));
435
381
  } else {
436
- actions.push(() => processUpsert(sourceObject, ids[0]));
382
+ actions.push(() => process2(sourceObject, ids[0]));
437
383
  }
438
384
  }
439
385
  }
440
- status.compared += targetItems.size;
441
386
  if (mode === "mirror") {
442
387
  if (!sourceHasItems && !allowEmptySource && targetItems.size > 0) {
443
388
  throw new Error(
@@ -463,51 +408,6 @@ ${innerError}`
463
408
  Object.setPrototypeOf(this, _SyncEngineError.prototype);
464
409
  }
465
410
  };
466
- var ReactiveStatusUpdate = class {
467
- constructor(onChange) {
468
- this._fetched = 0;
469
- this._compared = 0;
470
- this._changeCount = 0;
471
- this._changesApplied = 0;
472
- this.onChange = onChange;
473
- }
474
- emitChange() {
475
- this.onChange?.({
476
- fetched: this._fetched,
477
- compared: this._compared,
478
- changeCount: this._changeCount,
479
- changesApplied: this._changesApplied
480
- });
481
- }
482
- get fetched() {
483
- return this._fetched;
484
- }
485
- set fetched(value) {
486
- this._fetched = value;
487
- this.emitChange();
488
- }
489
- get compared() {
490
- return this._compared;
491
- }
492
- set compared(value) {
493
- this._compared = value;
494
- this.emitChange();
495
- }
496
- get changeCount() {
497
- return this._changeCount;
498
- }
499
- set changeCount(value) {
500
- this._changeCount = value;
501
- this.emitChange();
502
- }
503
- get changesApplied() {
504
- return this._changesApplied;
505
- }
506
- set changesApplied(value) {
507
- this._changesApplied = value;
508
- this.emitChange();
509
- }
510
- };
511
411
 
512
412
  // src/sync/syncEngineConsoleLogger.ts
513
413
  import { gray, green, red as red2, white, yellow } from "colorette";
@@ -528,8 +428,7 @@ function createSyncEngineConsoleLogger(options) {
528
428
  }
529
429
  let diffString = "";
530
430
  if (diffMode === "on" || diffMode === "update" && action === "update") {
531
- const diffResult = diff();
532
- diffString = "\n" + diffResult.map((change) => {
431
+ diffString = "\n" + diff.map((change) => {
533
432
  if (change.added) {
534
433
  return green(change.value);
535
434
  }
@@ -552,29 +451,6 @@ function createPublishStatusSyncEngineConsoleLogger(options) {
552
451
  };
553
452
  }
554
453
 
555
- // src/commands/canvas/commands/asset/_util.ts
556
- import { UncachedAssetClient } from "@uniformdev/assets";
557
- import { UncachedFileClient } from "@uniformdev/files";
558
-
559
- // src/cliLimitPolicy.ts
560
- import { createLimitPolicy } from "@uniformdev/canvas";
561
- var limit = process.env.UNIFORM_CLI_CONCURRENCY_LIMIT ? parseInt(process.env.UNIFORM_CLI_CONCURRENCY_LIMIT) : 10;
562
- var cliLimitPolicy = createLimitPolicy({
563
- throttle: { interval: 1e3, limit: 10 },
564
- retry: { retries: 3, factor: 2 },
565
- limit
566
- });
567
-
568
- // src/commands/canvas/commands/asset/_util.ts
569
- var selectAssetIdentifier = (e) => e.asset._id;
570
- var selectAssetDisplayName = (e) => `${e.asset.fields?.title?.value ?? "Untitled"} (pid: ${selectAssetIdentifier(e)})`;
571
- function getAssetClient(options) {
572
- return new UncachedAssetClient({ ...options, limitPolicy: cliLimitPolicy });
573
- }
574
- function getFileClient(options) {
575
- return new UncachedFileClient({ ...options, limitPolicy: cliLimitPolicy });
576
- }
577
-
578
454
  // src/commands/canvas/commands/asset/get.ts
579
455
  var AssetGetModule = {
580
456
  command: "get <id>",
@@ -584,6 +460,7 @@ var AssetGetModule = {
584
460
  withFormatOptions(
585
461
  withApiOptions(
586
462
  withProjectOptions(
463
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
587
464
  yargs38.positional("id", { demandOption: true, describe: "Asset ID to fetch" })
588
465
  )
589
466
  )
@@ -592,7 +469,7 @@ var AssetGetModule = {
592
469
  ),
593
470
  handler: async ({ apiHost, apiKey, proxy, id, format, filename, project: projectId, verbose }) => {
594
471
  const fetch3 = nodeFetchProxy(proxy, verbose);
595
- const client = getAssetClient({ apiKey, apiHost, fetch: fetch3, projectId });
472
+ const client = new UncachedAssetClient({ apiKey, apiHost, fetch: fetch3, projectId });
596
473
  const res = await client.get({ offset: 0, limit: 1, assetId: id });
597
474
  if (!res) {
598
475
  throw new Error(`Asset with ID ${id} not found`);
@@ -602,18 +479,23 @@ var AssetGetModule = {
602
479
  };
603
480
 
604
481
  // src/commands/canvas/commands/asset/list.ts
482
+ import { UncachedAssetClient as UncachedAssetClient2 } from "@uniformdev/assets";
605
483
  var AssetListModule = {
606
484
  command: "list",
607
485
  describe: "List assets",
608
486
  builder: (yargs38) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs38))))),
609
487
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
610
488
  const fetch3 = nodeFetchProxy(proxy, verbose);
611
- const client = getAssetClient({ apiKey, apiHost, fetch: fetch3, projectId });
489
+ const client = new UncachedAssetClient2({ apiKey, apiHost, fetch: fetch3, projectId });
612
490
  const res = await client.get({ offset: 0, limit: 1e3 });
613
491
  emitWithFormat(res.assets, format, filename);
614
492
  }
615
493
  };
616
494
 
495
+ // src/commands/canvas/commands/asset/pull.ts
496
+ import { UncachedAssetClient as UncachedAssetClient3 } from "@uniformdev/assets";
497
+ import { UncachedFileClient } from "@uniformdev/files";
498
+
617
499
  // src/files/index.ts
618
500
  import { preferredType } from "@thi.ng/mime";
619
501
  import { FILE_READY_STATE, getFileNameFromUrl } from "@uniformdev/files";
@@ -951,6 +833,10 @@ var legacyUrlToFileName = (url) => {
951
833
  // src/commands/canvas/assetEngineDataSource.ts
952
834
  import { convertAssetToPutAsset } from "@uniformdev/assets";
953
835
 
836
+ // src/commands/canvas/commands/asset/_util.ts
837
+ var selectAssetIdentifier = (e) => e.asset._id;
838
+ var selectAssetDisplayName = (e) => `${e.asset.fields?.title?.value ?? "Untitled"} (pid: ${selectAssetIdentifier(e)})`;
839
+
954
840
  // src/commands/canvas/util.ts
955
841
  import {
956
842
  CANVAS_DRAFT_STATE,
@@ -993,16 +879,16 @@ function createAssetEngineDataSource({
993
879
  }) {
994
880
  async function* getObjects() {
995
881
  const assets = paginateAsync(
996
- async (offset, limit2) => {
882
+ async (offset, limit) => {
997
883
  if (verbose) {
998
- console.log(`Fetching all assets from offset ${offset} with limit ${limit2}`);
884
+ console.log(`Fetching all assets from offset ${offset} with limit ${limit}`);
999
885
  }
1000
886
  return (await client.get({
1001
- limit: limit2,
887
+ limit,
1002
888
  offset
1003
889
  })).assets;
1004
890
  },
1005
- { pageSize: 50 }
891
+ { pageSize: 100 }
1006
892
  );
1007
893
  for await (const e of assets) {
1008
894
  const result = {
@@ -1087,13 +973,13 @@ var AssetPullModule = {
1087
973
  allowEmptySource
1088
974
  }) => {
1089
975
  const fetch3 = nodeFetchProxy(proxy, verbose);
1090
- const client = getAssetClient({
976
+ const client = new UncachedAssetClient3({
1091
977
  apiKey,
1092
978
  apiHost,
1093
979
  fetch: fetch3,
1094
980
  projectId
1095
981
  });
1096
- const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch3, projectId });
982
+ const fileClient = new UncachedFileClient({ apiKey, apiHost, fetch: fetch3, projectId });
1097
983
  const source = createAssetEngineDataSource({ client, verbose });
1098
984
  let target;
1099
985
  const isPackage = isPathAPackageFile(directory);
@@ -1163,6 +1049,8 @@ var AssetPullModule = {
1163
1049
  };
1164
1050
 
1165
1051
  // src/commands/canvas/commands/asset/push.ts
1052
+ import { UncachedAssetClient as UncachedAssetClient4 } from "@uniformdev/assets";
1053
+ import { UncachedFileClient as UncachedFileClient2 } from "@uniformdev/files";
1166
1054
  var AssetPushModule = {
1167
1055
  command: "push <directory>",
1168
1056
  describe: "Pushes all assets from files in a directory to Uniform",
@@ -1199,7 +1087,7 @@ var AssetPushModule = {
1199
1087
  verbose
1200
1088
  }) => {
1201
1089
  const fetch3 = nodeFetchProxy(proxy, verbose);
1202
- const client = getAssetClient({
1090
+ const client = new UncachedAssetClient4({
1203
1091
  apiKey,
1204
1092
  apiHost,
1205
1093
  fetch: fetch3,
@@ -1224,7 +1112,7 @@ var AssetPushModule = {
1224
1112
  });
1225
1113
  }
1226
1114
  const target = createAssetEngineDataSource({ client, verbose });
1227
- const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch3, projectId });
1115
+ const fileClient = new UncachedFileClient2({ apiKey, apiHost, fetch: fetch3, projectId });
1228
1116
  await syncEngine({
1229
1117
  source,
1230
1118
  target,
@@ -1264,6 +1152,9 @@ var AssetPushModule = {
1264
1152
  }
1265
1153
  };
1266
1154
 
1155
+ // src/commands/canvas/commands/asset/remove.ts
1156
+ import { UncachedAssetClient as UncachedAssetClient5 } from "@uniformdev/assets";
1157
+
1267
1158
  // src/log.ts
1268
1159
  import { reset } from "colorette";
1269
1160
  function fillString(char, length) {
@@ -1288,7 +1179,7 @@ var whatIfSimpleLog = ({
1288
1179
  id,
1289
1180
  displayName,
1290
1181
  action
1291
- }) => log({ id, displayName, action, whatIf: true, providerId: "none", diff: () => [] });
1182
+ }) => log({ id, displayName, action, whatIf: true, providerId: "none", diff: [] });
1292
1183
 
1293
1184
  // src/commands/canvas/commands/asset/remove.ts
1294
1185
  var AssetRemoveModule = {
@@ -1304,7 +1195,7 @@ var AssetRemoveModule = {
1304
1195
  ),
1305
1196
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId, verbose, whatIf }) => {
1306
1197
  const fetch3 = nodeFetchProxy(proxy, verbose);
1307
- const client = getAssetClient({ apiKey, apiHost, fetch: fetch3, projectId });
1198
+ const client = new UncachedAssetClient5({ apiKey, apiHost, fetch: fetch3, projectId });
1308
1199
  if (!whatIf) {
1309
1200
  await client.delete({ assetId: id });
1310
1201
  } else {
@@ -1314,7 +1205,7 @@ var AssetRemoveModule = {
1314
1205
  };
1315
1206
 
1316
1207
  // src/commands/canvas/commands/asset/update.ts
1317
- import { convertAssetToPutAsset as convertAssetToPutAsset2 } from "@uniformdev/assets";
1208
+ import { convertAssetToPutAsset as convertAssetToPutAsset2, UncachedAssetClient as UncachedAssetClient6 } from "@uniformdev/assets";
1318
1209
  var AssetUpdateModule = {
1319
1210
  command: "update <filename>",
1320
1211
  aliases: ["put"],
@@ -1330,7 +1221,7 @@ var AssetUpdateModule = {
1330
1221
  ),
1331
1222
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId, verbose, whatIf }) => {
1332
1223
  const fetch3 = nodeFetchProxy(proxy, verbose);
1333
- const client = getAssetClient({ apiKey, apiHost, fetch: fetch3, projectId });
1224
+ const client = new UncachedAssetClient6({ apiKey, apiHost, fetch: fetch3, projectId });
1334
1225
  const file = readFileToObject(filename);
1335
1226
  const putAsset = convertAssetToPutAsset2(file);
1336
1227
  if (!whatIf) {
@@ -1358,15 +1249,8 @@ var AssetModule = {
1358
1249
  // src/commands/canvas/commands/category.ts
1359
1250
  import yargs2 from "yargs";
1360
1251
 
1361
- // src/commands/canvas/commands/category/_util.ts
1362
- import { UncachedCategoryClient } from "@uniformdev/canvas";
1363
- var selectIdentifier = (category) => category.id;
1364
- var selectDisplayName = (category) => `${category.name} (pid: ${category.id})`;
1365
- function getCategoryClient(options) {
1366
- return new UncachedCategoryClient({ ...options, limitPolicy: cliLimitPolicy });
1367
- }
1368
-
1369
1252
  // src/commands/canvas/commands/category/get.ts
1253
+ import { UncachedCategoryClient } from "@uniformdev/canvas";
1370
1254
  var CategoryGetModule = {
1371
1255
  command: "get <id>",
1372
1256
  describe: "Fetch a category",
@@ -1383,7 +1267,7 @@ var CategoryGetModule = {
1383
1267
  ),
1384
1268
  handler: async ({ apiHost, apiKey, proxy, id, format, project: projectId, filename, verbose }) => {
1385
1269
  const fetch3 = nodeFetchProxy(proxy, verbose);
1386
- const client = getCategoryClient({ apiKey, apiHost, fetch: fetch3, projectId });
1270
+ const client = new UncachedCategoryClient({ apiKey, apiHost, fetch: fetch3, projectId });
1387
1271
  const res = await client.getCategories();
1388
1272
  const category = res.categories.find((c) => c.id === id);
1389
1273
  if (!category) {
@@ -1396,6 +1280,7 @@ var CategoryGetModule = {
1396
1280
  };
1397
1281
 
1398
1282
  // src/commands/canvas/commands/category/list.ts
1283
+ import { UncachedCategoryClient as UncachedCategoryClient2 } from "@uniformdev/canvas";
1399
1284
  var CategoryListModule = {
1400
1285
  command: "list",
1401
1286
  describe: "List categories",
@@ -1405,21 +1290,28 @@ var CategoryListModule = {
1405
1290
  ),
1406
1291
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
1407
1292
  const fetch3 = nodeFetchProxy(proxy, verbose);
1408
- const client = getCategoryClient({ apiKey, apiHost, fetch: fetch3, projectId });
1293
+ const client = new UncachedCategoryClient2({ apiKey, apiHost, fetch: fetch3, projectId });
1409
1294
  const res = await client.getCategories();
1410
1295
  emitWithFormat(res.categories, format, filename);
1411
1296
  }
1412
1297
  };
1413
1298
 
1299
+ // src/commands/canvas/commands/category/pull.ts
1300
+ import { UncachedCategoryClient as UncachedCategoryClient3 } from "@uniformdev/canvas";
1301
+
1302
+ // src/commands/canvas/commands/category/_util.ts
1303
+ var selectIdentifier = (category) => category.id;
1304
+ var selectDisplayName = (category) => `${category.name} (pid: ${category.id})`;
1305
+
1414
1306
  // src/commands/canvas/categoriesEngineDataSource.ts
1415
1307
  function createCategoriesEngineDataSource({
1416
1308
  client
1417
1309
  }) {
1418
1310
  async function* getObjects() {
1419
- const categories = paginateAsync(async () => (await client.getCategories()).categories, {
1311
+ const componentDefinitions = paginateAsync(async () => (await client.getCategories()).categories, {
1420
1312
  pageSize: 100
1421
1313
  });
1422
- for await (const def of categories) {
1314
+ for await (const def of componentDefinitions) {
1423
1315
  const result = {
1424
1316
  id: selectIdentifier(def),
1425
1317
  displayName: selectDisplayName(def),
@@ -1485,7 +1377,7 @@ var CategoryPullModule = {
1485
1377
  verbose
1486
1378
  }) => {
1487
1379
  const fetch3 = nodeFetchProxy(proxy, verbose);
1488
- const client = getCategoryClient({ apiKey, apiHost, fetch: fetch3, projectId });
1380
+ const client = new UncachedCategoryClient3({ apiKey, apiHost, fetch: fetch3, projectId });
1489
1381
  const source = createCategoriesEngineDataSource({ client });
1490
1382
  let target;
1491
1383
  const isPackage = isPathAPackageFile(directory);
@@ -1522,6 +1414,7 @@ var CategoryPullModule = {
1522
1414
  };
1523
1415
 
1524
1416
  // src/commands/canvas/commands/category/push.ts
1417
+ import { UncachedCategoryClient as UncachedCategoryClient4 } from "@uniformdev/canvas";
1525
1418
  var CategoryPushModule = {
1526
1419
  command: "push <directory>",
1527
1420
  describe: "Pushes all categories from files in a directory to Uniform Canvas",
@@ -1558,7 +1451,7 @@ var CategoryPushModule = {
1558
1451
  verbose
1559
1452
  }) => {
1560
1453
  const fetch3 = nodeFetchProxy(proxy, verbose);
1561
- const client = getCategoryClient({ apiKey, apiHost, fetch: fetch3, projectId });
1454
+ const client = new UncachedCategoryClient4({ apiKey, apiHost, fetch: fetch3, projectId });
1562
1455
  let source;
1563
1456
  const isPackage = isPathAPackageFile(directory);
1564
1457
  if (isPackage) {
@@ -1590,6 +1483,7 @@ var CategoryPushModule = {
1590
1483
  };
1591
1484
 
1592
1485
  // src/commands/canvas/commands/category/remove.ts
1486
+ import { UncachedCategoryClient as UncachedCategoryClient5 } from "@uniformdev/canvas";
1593
1487
  var CategoryRemoveModule = {
1594
1488
  command: "remove <id>",
1595
1489
  aliases: ["delete", "rm"],
@@ -1605,7 +1499,7 @@ var CategoryRemoveModule = {
1605
1499
  ),
1606
1500
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId, verbose, whatIf }) => {
1607
1501
  const fetch3 = nodeFetchProxy(proxy, verbose);
1608
- const client = getCategoryClient({ apiKey, apiHost, fetch: fetch3, projectId });
1502
+ const client = new UncachedCategoryClient5({ apiKey, apiHost, fetch: fetch3, projectId });
1609
1503
  if (!whatIf) {
1610
1504
  await client.removeCategory({ categoryId: id });
1611
1505
  } else {
@@ -1615,6 +1509,7 @@ var CategoryRemoveModule = {
1615
1509
  };
1616
1510
 
1617
1511
  // src/commands/canvas/commands/category/update.ts
1512
+ import { UncachedCategoryClient as UncachedCategoryClient6 } from "@uniformdev/canvas";
1618
1513
  var CategoryUpdateModule = {
1619
1514
  command: "update <filename>",
1620
1515
  aliases: ["put"],
@@ -1630,7 +1525,7 @@ var CategoryUpdateModule = {
1630
1525
  ),
1631
1526
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId, verbose, whatIf }) => {
1632
1527
  const fetch3 = nodeFetchProxy(proxy, verbose);
1633
- const client = getCategoryClient({ apiKey, apiHost, fetch: fetch3, projectId });
1528
+ const client = new UncachedCategoryClient6({ apiKey, apiHost, fetch: fetch3, projectId });
1634
1529
  const file = readFileToObject(filename);
1635
1530
  if (!whatIf) {
1636
1531
  await client.upsertCategories([file]);
@@ -1654,14 +1549,13 @@ var CategoryModule = {
1654
1549
  // src/commands/canvas/commands/component.ts
1655
1550
  import yargs3 from "yargs";
1656
1551
 
1657
- // src/commands/canvas/commands/component/_util.ts
1552
+ // src/commands/canvas/commands/component/get.ts
1658
1553
  import { UncachedCanvasClient } from "@uniformdev/canvas";
1554
+
1555
+ // src/commands/canvas/commands/component/_util.ts
1659
1556
  var selectIdentifier2 = (component) => component.id;
1660
1557
  var selectDisplayName2 = (component) => `${component.name} (pid: ${component.id})`;
1661
1558
  var selectSchemaUrl = () => "/schemas/json-schema/component-definition/v1.json";
1662
- function getCanvasClient(options) {
1663
- return new UncachedCanvasClient({ ...options, limitPolicy: cliLimitPolicy });
1664
- }
1665
1559
 
1666
1560
  // src/commands/canvas/commands/component/get.ts
1667
1561
  var ComponentGetModule = {
@@ -1683,7 +1577,7 @@ var ComponentGetModule = {
1683
1577
  ),
1684
1578
  handler: async ({ apiHost, apiKey, proxy, id, format, project: projectId, filename, verbose }) => {
1685
1579
  const fetch3 = nodeFetchProxy(proxy, verbose);
1686
- const client = getCanvasClient({ apiKey, apiHost, fetch: fetch3, projectId });
1580
+ const client = new UncachedCanvasClient({ apiKey, apiHost, fetch: fetch3, projectId });
1687
1581
  const res = await client.getComponentDefinitions({ componentId: id, limit: 1 });
1688
1582
  if (res.componentDefinitions.length === 0) {
1689
1583
  console.error("Component did not exist");
@@ -1702,6 +1596,7 @@ var ComponentGetModule = {
1702
1596
  };
1703
1597
 
1704
1598
  // src/commands/canvas/commands/component/list.ts
1599
+ import { UncachedCanvasClient as UncachedCanvasClient2 } from "@uniformdev/canvas";
1705
1600
  var ComponentListModule = {
1706
1601
  command: "list",
1707
1602
  describe: "List component definitions",
@@ -1724,7 +1619,7 @@ var ComponentListModule = {
1724
1619
  apiHost,
1725
1620
  apiKey,
1726
1621
  proxy,
1727
- limit: limit2,
1622
+ limit,
1728
1623
  offset,
1729
1624
  format,
1730
1625
  filename,
@@ -1732,20 +1627,23 @@ var ComponentListModule = {
1732
1627
  verbose
1733
1628
  }) => {
1734
1629
  const fetch3 = nodeFetchProxy(proxy, verbose);
1735
- const client = getCanvasClient({ apiKey, apiHost, fetch: fetch3, projectId });
1736
- const res = await client.getComponentDefinitions({ limit: limit2, offset });
1630
+ const client = new UncachedCanvasClient2({ apiKey, apiHost, fetch: fetch3, projectId });
1631
+ const res = await client.getComponentDefinitions({ limit, offset });
1737
1632
  emitWithFormat(res.componentDefinitions, format, filename);
1738
1633
  }
1739
1634
  };
1740
1635
 
1636
+ // src/commands/canvas/commands/component/pull.ts
1637
+ import { UncachedCanvasClient as UncachedCanvasClient3 } from "@uniformdev/canvas";
1638
+
1741
1639
  // src/commands/canvas/componentDefinitionEngineDataSource.ts
1742
1640
  function createComponentDefinitionEngineDataSource({
1743
1641
  client
1744
1642
  }) {
1745
1643
  async function* getObjects() {
1746
1644
  const componentDefinitions = paginateAsync(
1747
- async (offset, limit2) => (await client.getComponentDefinitions({ limit: limit2, offset })).componentDefinitions,
1748
- { pageSize: 200 }
1645
+ async (offset, limit) => (await client.getComponentDefinitions({ limit, offset })).componentDefinitions,
1646
+ { pageSize: 100 }
1749
1647
  );
1750
1648
  for await (const def of componentDefinitions) {
1751
1649
  const result = {
@@ -1815,7 +1713,7 @@ var ComponentPullModule = {
1815
1713
  verbose
1816
1714
  }) => {
1817
1715
  const fetch3 = nodeFetchProxy(proxy, verbose);
1818
- const client = getCanvasClient({ apiKey, apiHost, fetch: fetch3, projectId });
1716
+ const client = new UncachedCanvasClient3({ apiKey, apiHost, fetch: fetch3, projectId });
1819
1717
  const source = createComponentDefinitionEngineDataSource({ client });
1820
1718
  let target;
1821
1719
  const isPackage = isPathAPackageFile(directory);
@@ -1853,6 +1751,7 @@ var ComponentPullModule = {
1853
1751
  };
1854
1752
 
1855
1753
  // src/commands/canvas/commands/component/push.ts
1754
+ import { UncachedCanvasClient as UncachedCanvasClient4 } from "@uniformdev/canvas";
1856
1755
  var ComponentPushModule = {
1857
1756
  command: "push <directory>",
1858
1757
  describe: "Pushes all component definitions from files in a directory to Uniform Canvas",
@@ -1889,7 +1788,7 @@ var ComponentPushModule = {
1889
1788
  verbose
1890
1789
  }) => {
1891
1790
  const fetch3 = nodeFetchProxy(proxy, verbose);
1892
- const client = getCanvasClient({ apiKey, apiHost, fetch: fetch3, projectId });
1791
+ const client = new UncachedCanvasClient4({ apiKey, apiHost, fetch: fetch3, projectId });
1893
1792
  let source;
1894
1793
  const isPackage = isPathAPackageFile(directory);
1895
1794
  if (isPackage) {
@@ -1922,6 +1821,7 @@ var ComponentPushModule = {
1922
1821
  };
1923
1822
 
1924
1823
  // src/commands/canvas/commands/component/remove.ts
1824
+ import { UncachedCanvasClient as UncachedCanvasClient5 } from "@uniformdev/canvas";
1925
1825
  var ComponentRemoveModule = {
1926
1826
  command: "remove <id>",
1927
1827
  aliases: ["delete", "rm"],
@@ -1940,7 +1840,7 @@ var ComponentRemoveModule = {
1940
1840
  ),
1941
1841
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId, verbose, whatIf }) => {
1942
1842
  const fetch3 = nodeFetchProxy(proxy, verbose);
1943
- const client = getCanvasClient({ apiKey, apiHost, fetch: fetch3, projectId });
1843
+ const client = new UncachedCanvasClient5({ apiKey, apiHost, fetch: fetch3, projectId });
1944
1844
  if (!whatIf) {
1945
1845
  await client.removeComponentDefinition({ componentId: id });
1946
1846
  } else {
@@ -1950,6 +1850,7 @@ var ComponentRemoveModule = {
1950
1850
  };
1951
1851
 
1952
1852
  // src/commands/canvas/commands/component/update.ts
1853
+ import { UncachedCanvasClient as UncachedCanvasClient6 } from "@uniformdev/canvas";
1953
1854
  var ComponentUpdateModule = {
1954
1855
  command: "update <filename>",
1955
1856
  aliases: ["put"],
@@ -1965,10 +1866,10 @@ var ComponentUpdateModule = {
1965
1866
  ),
1966
1867
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId, verbose, whatIf }) => {
1967
1868
  const fetch3 = nodeFetchProxy(proxy, verbose);
1968
- const client = getCanvasClient({ apiKey, apiHost, fetch: fetch3, projectId });
1869
+ const client = new UncachedCanvasClient6({ apiKey, apiHost, fetch: fetch3, projectId });
1969
1870
  const file = readFileToObject(filename);
1970
1871
  if (!whatIf) {
1971
- await client.updateComponentDefinition({ componentDefinition: omit(file, ["$schema"]) });
1872
+ await client.updateComponentDefinition({ componentDefinition: file });
1972
1873
  } else {
1973
1874
  whatIfSimpleLog({ id: file.id, displayName: `Component: ${file.name}`, action: "update" });
1974
1875
  }
@@ -1990,6 +1891,7 @@ var ComponentModule = {
1990
1891
  import yargs4 from "yargs";
1991
1892
 
1992
1893
  // src/commands/canvas/commands/composition/get.ts
1894
+ import { UncachedCanvasClient as UncachedCanvasClient7 } from "@uniformdev/canvas";
1993
1895
  var CompositionGetModule = {
1994
1896
  command: "get <id>",
1995
1897
  describe: "Fetch a composition",
@@ -2072,7 +1974,7 @@ var CompositionGetModule = {
2072
1974
  console.log(`\u{1F41B} get composition:`, parameters);
2073
1975
  }
2074
1976
  const fetch3 = nodeFetchProxy(proxy, verbose);
2075
- const client = getCanvasClient({ apiKey, edgeApiHost, apiHost, fetch: fetch3, projectId });
1977
+ const client = new UncachedCanvasClient7({ apiKey, edgeApiHost, apiHost, fetch: fetch3, projectId });
2076
1978
  const res = prepCompositionForDisk(await client.getCompositionById(parameters));
2077
1979
  emitWithFormat(res, format, filename);
2078
1980
  }
@@ -2085,6 +1987,7 @@ var ComponentPatternGetModule = {
2085
1987
  };
2086
1988
 
2087
1989
  // src/commands/canvas/commands/composition/list.ts
1990
+ import { UncachedCanvasClient as UncachedCanvasClient8 } from "@uniformdev/canvas";
2088
1991
  var CompositionListModule = {
2089
1992
  command: "list",
2090
1993
  describe: "List compositions",
@@ -2136,7 +2039,7 @@ var CompositionListModule = {
2136
2039
  apiHost,
2137
2040
  apiKey,
2138
2041
  proxy,
2139
- limit: limit2,
2042
+ limit,
2140
2043
  offset,
2141
2044
  search,
2142
2045
  format,
@@ -2152,7 +2055,7 @@ var CompositionListModule = {
2152
2055
  verbose
2153
2056
  }) => {
2154
2057
  const parameters = {
2155
- limit: limit2,
2058
+ limit,
2156
2059
  offset,
2157
2060
  search: search && search.length > 0 ? search : void 0,
2158
2061
  pattern: onlyCompositions ? false : onlyPatterns ? true : void 0,
@@ -2166,7 +2069,7 @@ var CompositionListModule = {
2166
2069
  console.log(`\u{1F41B} list compositions:`, parameters);
2167
2070
  }
2168
2071
  const fetch3 = nodeFetchProxy(proxy, verbose);
2169
- const client = getCanvasClient({ apiKey, apiHost, fetch: fetch3, projectId });
2072
+ const client = new UncachedCanvasClient8({ apiKey, apiHost, fetch: fetch3, projectId });
2170
2073
  const res = await client.getCompositionList(parameters);
2171
2074
  emitWithFormat(res.compositions, format, filename);
2172
2075
  }
@@ -2222,6 +2125,9 @@ var ComponentPatternListModule = {
2222
2125
  )
2223
2126
  };
2224
2127
 
2128
+ // src/commands/canvas/commands/composition/publish.ts
2129
+ import { UncachedCanvasClient as UncachedCanvasClient9 } from "@uniformdev/canvas";
2130
+
2225
2131
  // src/commands/canvas/commands/composition/_util.ts
2226
2132
  var selectIdentifier3 = (response) => {
2227
2133
  let baseId = response.composition._id;
@@ -2253,10 +2159,10 @@ function createComponentInstanceEngineDataSource({
2253
2159
  const stateId = convertStateOption(state);
2254
2160
  async function* getObjects() {
2255
2161
  const componentInstances = paginateAsync(
2256
- async (offset, limit2) => {
2162
+ async (offset, limit) => {
2257
2163
  const parameters = {
2258
2164
  ...clientOptions,
2259
- limit: limit2,
2165
+ limit,
2260
2166
  offset,
2261
2167
  pattern: onlyCompositions ? false : onlyPatterns ? true : void 0,
2262
2168
  state: stateId,
@@ -2352,7 +2258,7 @@ var CompositionPublishModule = {
2352
2258
  }
2353
2259
  const compositionIDsArray = ids ? ids.split(",").map((id) => id.trim()) : void 0;
2354
2260
  const fetch3 = nodeFetchProxy(proxy, verbose);
2355
- const client = getCanvasClient({ apiKey, apiHost, fetch: fetch3, projectId });
2261
+ const client = new UncachedCanvasClient9({ apiKey, apiHost, fetch: fetch3, projectId });
2356
2262
  const source = createComponentInstanceEngineDataSource({
2357
2263
  client,
2358
2264
  state: "preview",
@@ -2427,6 +2333,8 @@ var ComponentPatternPublishModule = {
2427
2333
  };
2428
2334
 
2429
2335
  // src/commands/canvas/commands/composition/pull.ts
2336
+ import { UncachedCanvasClient as UncachedCanvasClient10 } from "@uniformdev/canvas";
2337
+ import { UncachedFileClient as UncachedFileClient3 } from "@uniformdev/files";
2430
2338
  var CompositionPullModule = {
2431
2339
  command: "pull <directory>",
2432
2340
  describe: "Pulls all compositions to local files in a directory",
@@ -2485,8 +2393,8 @@ var CompositionPullModule = {
2485
2393
  verbose
2486
2394
  }) => {
2487
2395
  const fetch3 = nodeFetchProxy(proxy, verbose);
2488
- const client = getCanvasClient({ apiKey, apiHost, fetch: fetch3, projectId });
2489
- const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch3, projectId });
2396
+ const client = new UncachedCanvasClient10({ apiKey, apiHost, fetch: fetch3, projectId });
2397
+ const fileClient = new UncachedFileClient3({ apiKey, apiHost, fetch: fetch3, projectId });
2490
2398
  const source = createComponentInstanceEngineDataSource({
2491
2399
  client,
2492
2400
  state,
@@ -2591,6 +2499,8 @@ var ComponentPatternPullModule = {
2591
2499
  };
2592
2500
 
2593
2501
  // src/commands/canvas/commands/composition/push.ts
2502
+ import { UncachedCanvasClient as UncachedCanvasClient11 } from "@uniformdev/canvas";
2503
+ import { UncachedFileClient as UncachedFileClient4 } from "@uniformdev/files";
2594
2504
  var CompositionPushModule = {
2595
2505
  command: "push <directory>",
2596
2506
  describe: "Pushes all compositions from files in a directory to Uniform Canvas",
@@ -2642,7 +2552,7 @@ var CompositionPushModule = {
2642
2552
  verbose
2643
2553
  }) => {
2644
2554
  const fetch3 = nodeFetchProxy(proxy, verbose);
2645
- const client = getCanvasClient({ apiKey, apiHost, fetch: fetch3, projectId });
2555
+ const client = new UncachedCanvasClient11({ apiKey, apiHost, fetch: fetch3, projectId });
2646
2556
  let source;
2647
2557
  const isPackage = isPathAPackageFile(directory);
2648
2558
  if (isPackage) {
@@ -2669,7 +2579,7 @@ var CompositionPushModule = {
2669
2579
  patternType,
2670
2580
  verbose
2671
2581
  });
2672
- const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch3, projectId });
2582
+ const fileClient = new UncachedFileClient4({ apiKey, apiHost, fetch: fetch3, projectId });
2673
2583
  await syncEngine({
2674
2584
  source,
2675
2585
  target,
@@ -2732,6 +2642,7 @@ var ComponentPatternPushModule = {
2732
2642
  };
2733
2643
 
2734
2644
  // src/commands/canvas/commands/composition/remove.ts
2645
+ import { UncachedCanvasClient as UncachedCanvasClient12 } from "@uniformdev/canvas";
2735
2646
  var CompositionRemoveModule = {
2736
2647
  command: "remove <id>",
2737
2648
  aliases: ["delete", "rm"],
@@ -2753,7 +2664,7 @@ var CompositionRemoveModule = {
2753
2664
  console.log(`\u{1F41B} remove composition: (id: ${id})`);
2754
2665
  }
2755
2666
  const fetch3 = nodeFetchProxy(proxy, verbose);
2756
- const client = getCanvasClient({ apiKey, apiHost, fetch: fetch3, projectId });
2667
+ const client = new UncachedCanvasClient12({ apiKey, apiHost, fetch: fetch3, projectId });
2757
2668
  if (!whatIf) {
2758
2669
  await client.removeComposition({ compositionId: id });
2759
2670
  } else {
@@ -2769,7 +2680,10 @@ var ComponentPatternRemoveModule = {
2769
2680
  };
2770
2681
 
2771
2682
  // src/commands/canvas/commands/composition/unpublish.ts
2772
- import { CANVAS_PUBLISHED_STATE as CANVAS_PUBLISHED_STATE2 } from "@uniformdev/canvas";
2683
+ import {
2684
+ CANVAS_PUBLISHED_STATE as CANVAS_PUBLISHED_STATE2,
2685
+ UncachedCanvasClient as UncachedCanvasClient13
2686
+ } from "@uniformdev/canvas";
2773
2687
  import { diffJson as diffJson2 } from "diff";
2774
2688
  var CompositionUnpublishModule = {
2775
2689
  command: "unpublish [ids]",
@@ -2820,7 +2734,7 @@ var CompositionUnpublishModule = {
2820
2734
  const compositionIDsArray = ids ? ids.split(",").map((id) => id.trim()) : void 0;
2821
2735
  const targetItems = /* @__PURE__ */ new Map();
2822
2736
  const fetch3 = nodeFetchProxy(proxy, verbose);
2823
- const client = getCanvasClient({ apiKey, apiHost, fetch: fetch3, projectId });
2737
+ const client = new UncachedCanvasClient13({ apiKey, apiHost, fetch: fetch3, projectId });
2824
2738
  const source = createComponentInstanceEngineDataSource({
2825
2739
  client,
2826
2740
  state: "published",
@@ -2865,7 +2779,7 @@ var CompositionUnpublishModule = {
2865
2779
  providerId: sourceObject.providerId,
2866
2780
  displayName: sourceObject.displayName ?? sourceObject.providerId,
2867
2781
  whatIf,
2868
- diff: () => diffJson2(targetObject.object, sourceObject.object)
2782
+ diff: diffJson2(targetObject.object, sourceObject.object)
2869
2783
  });
2870
2784
  }
2871
2785
  }
@@ -2909,6 +2823,7 @@ var ComponentPatternUnpublishModule = {
2909
2823
  };
2910
2824
 
2911
2825
  // src/commands/canvas/commands/composition/update.ts
2826
+ import { UncachedCanvasClient as UncachedCanvasClient14 } from "@uniformdev/canvas";
2912
2827
  var CompositionUpdateModule = {
2913
2828
  command: "update <filename>",
2914
2829
  aliases: ["put"],
@@ -2932,7 +2847,7 @@ var CompositionUpdateModule = {
2932
2847
  console.log(`\u{1F41B} update composition: (filename: ${filename}, state: ${convertStateOption(state)})`);
2933
2848
  }
2934
2849
  const fetch3 = nodeFetchProxy(proxy, verbose);
2935
- const client = getCanvasClient({ apiKey, apiHost, fetch: fetch3, projectId });
2850
+ const client = new UncachedCanvasClient14({ apiKey, apiHost, fetch: fetch3, projectId });
2936
2851
  const file = readFileToObject(filename);
2937
2852
  if (!whatIf) {
2938
2853
  await client.updateComposition({ ...file, state: convertStateOption(state) });
@@ -3218,15 +3133,8 @@ var CompositionPatternModule = {
3218
3133
  // src/commands/canvas/commands/contentType.ts
3219
3134
  import yargs7 from "yargs";
3220
3135
 
3221
- // src/commands/canvas/commands/contentType/_util.ts
3222
- import { ContentClient } from "@uniformdev/canvas";
3223
- var selectContentTypeIdentifier = (ct) => ct.id;
3224
- var selectContentTypeDisplayName = (ct) => `${ct.name} (pid: ${ct.id})`;
3225
- function getContentClient(options) {
3226
- return new ContentClient({ ...options, limitPolicy: cliLimitPolicy, bypassCache: true });
3227
- }
3228
-
3229
3136
  // src/commands/canvas/commands/contentType/get.ts
3137
+ import { ContentClient } from "@uniformdev/canvas";
3230
3138
  var ContentTypeGetModule = {
3231
3139
  command: "get <id>",
3232
3140
  describe: "Get a content type",
@@ -3246,7 +3154,7 @@ var ContentTypeGetModule = {
3246
3154
  ),
3247
3155
  handler: async ({ apiHost, apiKey, proxy, id, format, filename, project: projectId, verbose }) => {
3248
3156
  const fetch3 = nodeFetchProxy(proxy, verbose);
3249
- const client = getContentClient({ apiKey, apiHost, fetch: fetch3, projectId });
3157
+ const client = new ContentClient({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
3250
3158
  const res = await client.getContentTypes({ offset: 0, limit: 1e3 });
3251
3159
  const found = res.contentTypes.find((f) => f.id === id);
3252
3160
  if (!found) {
@@ -3257,18 +3165,26 @@ var ContentTypeGetModule = {
3257
3165
  };
3258
3166
 
3259
3167
  // src/commands/canvas/commands/contentType/list.ts
3168
+ import { ContentClient as ContentClient2 } from "@uniformdev/canvas";
3260
3169
  var ContentTypeListModule = {
3261
3170
  command: "list",
3262
3171
  describe: "List content types",
3263
3172
  builder: (yargs38) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs38))))),
3264
3173
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
3265
3174
  const fetch3 = nodeFetchProxy(proxy, verbose);
3266
- const client = getContentClient({ apiKey, apiHost, fetch: fetch3, projectId });
3175
+ const client = new ContentClient2({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
3267
3176
  const res = await client.getContentTypes({ offset: 0, limit: 1e3 });
3268
3177
  emitWithFormat(res.contentTypes, format, filename);
3269
3178
  }
3270
3179
  };
3271
3180
 
3181
+ // src/commands/canvas/commands/contentType/pull.ts
3182
+ import { ContentClient as ContentClient3 } from "@uniformdev/canvas";
3183
+
3184
+ // src/commands/canvas/commands/contentType/_util.ts
3185
+ var selectContentTypeIdentifier = (ct) => ct.id;
3186
+ var selectContentTypeDisplayName = (ct) => `${ct.name} (pid: ${ct.id})`;
3187
+
3272
3188
  // src/commands/canvas/contentTypeEngineDataSource.ts
3273
3189
  function createContentTypeEngineDataSource({
3274
3190
  client
@@ -3341,11 +3257,12 @@ var ContentTypePullModule = {
3341
3257
  verbose
3342
3258
  }) => {
3343
3259
  const fetch3 = nodeFetchProxy(proxy, verbose);
3344
- const client = getContentClient({
3260
+ const client = new ContentClient3({
3345
3261
  apiKey,
3346
3262
  apiHost,
3347
3263
  fetch: fetch3,
3348
- projectId
3264
+ projectId,
3265
+ bypassCache: true
3349
3266
  });
3350
3267
  const source = createContentTypeEngineDataSource({ client });
3351
3268
  let target;
@@ -3383,6 +3300,7 @@ var ContentTypePullModule = {
3383
3300
  };
3384
3301
 
3385
3302
  // src/commands/canvas/commands/contentType/push.ts
3303
+ import { ContentClient as ContentClient4 } from "@uniformdev/canvas";
3386
3304
  var ContentTypePushModule = {
3387
3305
  command: "push <directory>",
3388
3306
  describe: "Pushes all content types from files in a directory to Uniform",
@@ -3424,11 +3342,12 @@ var ContentTypePushModule = {
3424
3342
  verbose
3425
3343
  }) => {
3426
3344
  const fetch3 = nodeFetchProxy(proxy, verbose);
3427
- const client = getContentClient({
3345
+ const client = new ContentClient4({
3428
3346
  apiKey,
3429
3347
  apiHost,
3430
3348
  fetch: fetch3,
3431
- projectId
3349
+ projectId,
3350
+ bypassCache: true
3432
3351
  });
3433
3352
  let source;
3434
3353
  const isPackage = isPathAPackageFile(directory);
@@ -3461,6 +3380,7 @@ var ContentTypePushModule = {
3461
3380
  };
3462
3381
 
3463
3382
  // src/commands/canvas/commands/contentType/remove.ts
3383
+ import { ContentClient as ContentClient5 } from "@uniformdev/canvas";
3464
3384
  var ContentTypeRemoveModule = {
3465
3385
  command: "remove <id>",
3466
3386
  aliases: ["delete", "rm"],
@@ -3476,7 +3396,7 @@ var ContentTypeRemoveModule = {
3476
3396
  ),
3477
3397
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId, verbose, whatIf }) => {
3478
3398
  const fetch3 = nodeFetchProxy(proxy, verbose);
3479
- const client = getContentClient({ apiKey, apiHost, fetch: fetch3, projectId });
3399
+ const client = new ContentClient5({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
3480
3400
  if (!whatIf) {
3481
3401
  await client.deleteContentType({ contentTypeId: id });
3482
3402
  } else {
@@ -3486,6 +3406,7 @@ var ContentTypeRemoveModule = {
3486
3406
  };
3487
3407
 
3488
3408
  // src/commands/canvas/commands/contentType/update.ts
3409
+ import { ContentClient as ContentClient6 } from "@uniformdev/canvas";
3489
3410
  var ContentTypeUpdateModule = {
3490
3411
  command: "update <filename>",
3491
3412
  aliases: ["put"],
@@ -3501,7 +3422,7 @@ var ContentTypeUpdateModule = {
3501
3422
  ),
3502
3423
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId, verbose, whatIf }) => {
3503
3424
  const fetch3 = nodeFetchProxy(proxy, verbose);
3504
- const client = getContentClient({ apiKey, apiHost, fetch: fetch3, projectId });
3425
+ const client = new ContentClient6({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
3505
3426
  const file = readFileToObject(filename);
3506
3427
  if (!whatIf) {
3507
3428
  await client.upsertContentType({ contentType: file });
@@ -3525,13 +3446,8 @@ var ContentTypeModule = {
3525
3446
  // src/commands/canvas/commands/dataSource.ts
3526
3447
  import yargs8 from "yargs";
3527
3448
 
3528
- // src/commands/canvas/commands/dataSource/_util.ts
3529
- import { DataSourceClient } from "@uniformdev/canvas";
3530
- function getDataSourceClient(options) {
3531
- return new DataSourceClient({ ...options, bypassCache: true, limitPolicy: cliLimitPolicy });
3532
- }
3533
-
3534
3449
  // src/commands/canvas/commands/dataSource/get.ts
3450
+ import { DataSourceClient } from "@uniformdev/canvas";
3535
3451
  var DataSourceGetModule = {
3536
3452
  command: "get <id>",
3537
3453
  describe: "Get a data source by ID and writes to stdout. Please note this may contain secret data, use discretion.",
@@ -3539,6 +3455,7 @@ var DataSourceGetModule = {
3539
3455
  withApiOptions(
3540
3456
  withDebugOptions(
3541
3457
  withProjectOptions(
3458
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3542
3459
  yargs38.positional("id", { demandOption: true, describe: "Data source public ID to fetch" })
3543
3460
  )
3544
3461
  )
@@ -3546,13 +3463,14 @@ var DataSourceGetModule = {
3546
3463
  ),
3547
3464
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId, verbose }) => {
3548
3465
  const fetch3 = nodeFetchProxy(proxy, verbose);
3549
- const client = getDataSourceClient({ apiKey, apiHost, fetch: fetch3, projectId });
3466
+ const client = new DataSourceClient({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
3550
3467
  const res = await client.get({ dataSourceId: id });
3551
3468
  emitWithFormat(res.result, "json", void 0);
3552
3469
  }
3553
3470
  };
3554
3471
 
3555
3472
  // src/commands/canvas/commands/dataSource/remove.ts
3473
+ import { DataSourceClient as DataSourceClient2 } from "@uniformdev/canvas";
3556
3474
  var DataSourceRemoveModule = {
3557
3475
  command: "remove <id>",
3558
3476
  aliases: ["delete", "rm"],
@@ -3568,7 +3486,7 @@ var DataSourceRemoveModule = {
3568
3486
  ),
3569
3487
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId, verbose, whatIf }) => {
3570
3488
  const fetch3 = nodeFetchProxy(proxy, verbose);
3571
- const client = getDataSourceClient({ apiKey, apiHost, fetch: fetch3, projectId });
3489
+ const client = new DataSourceClient2({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
3572
3490
  if (!whatIf) {
3573
3491
  await client.remove({ dataSourceId: id });
3574
3492
  } else {
@@ -3578,6 +3496,7 @@ var DataSourceRemoveModule = {
3578
3496
  };
3579
3497
 
3580
3498
  // src/commands/canvas/commands/dataSource/update.ts
3499
+ import { DataSourceClient as DataSourceClient3 } from "@uniformdev/canvas";
3581
3500
  var DataSourceUpdateModule = {
3582
3501
  command: "update <dataSource>",
3583
3502
  aliases: ["put"],
@@ -3606,7 +3525,7 @@ var DataSourceUpdateModule = {
3606
3525
  whatIf
3607
3526
  }) => {
3608
3527
  const fetch3 = nodeFetchProxy(proxy, verbose);
3609
- const client = getDataSourceClient({ apiKey, apiHost, fetch: fetch3, projectId });
3528
+ const client = new DataSourceClient3({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
3610
3529
  const file = JSON.parse(dataSource);
3611
3530
  if (!whatIf) {
3612
3531
  await client.upsert({ data: file, integrationType });
@@ -3630,15 +3549,8 @@ var DataSourceModule = {
3630
3549
  // src/commands/canvas/commands/dataType.ts
3631
3550
  import yargs9 from "yargs";
3632
3551
 
3633
- // src/commands/canvas/commands/dataType/_util.ts
3634
- import { DataTypeClient } from "@uniformdev/canvas";
3635
- var selectIdentifier4 = (dataType) => dataType.id;
3636
- var selectDisplayName4 = (dataType) => `${dataType.displayName} (pid: ${dataType.id})`;
3637
- function getDataTypeClient(options) {
3638
- return new DataTypeClient({ ...options, limitPolicy: cliLimitPolicy, bypassCache: true });
3639
- }
3640
-
3641
3552
  // src/commands/canvas/commands/dataType/get.ts
3553
+ import { DataTypeClient } from "@uniformdev/canvas";
3642
3554
  var DataTypeGetModule = {
3643
3555
  command: "get <id>",
3644
3556
  describe: "Get a data type",
@@ -3648,6 +3560,7 @@ var DataTypeGetModule = {
3648
3560
  withDebugOptions(
3649
3561
  withApiOptions(
3650
3562
  withProjectOptions(
3563
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3651
3564
  yargs38.positional("id", { demandOption: true, describe: "Data type public ID to fetch" })
3652
3565
  )
3653
3566
  )
@@ -3656,7 +3569,7 @@ var DataTypeGetModule = {
3656
3569
  ),
3657
3570
  handler: async ({ apiHost, apiKey, proxy, id, format, filename, project: projectId, verbose }) => {
3658
3571
  const fetch3 = nodeFetchProxy(proxy, verbose);
3659
- const client = getDataTypeClient({ apiKey, apiHost, fetch: fetch3, projectId });
3572
+ const client = new DataTypeClient({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
3660
3573
  const res = await client.get();
3661
3574
  const found = res.results.find((f) => f.id === id);
3662
3575
  if (!found) {
@@ -3667,6 +3580,7 @@ var DataTypeGetModule = {
3667
3580
  };
3668
3581
 
3669
3582
  // src/commands/canvas/commands/dataType/list.ts
3583
+ import { DataTypeClient as DataTypeClient2 } from "@uniformdev/canvas";
3670
3584
  var DataTypeListModule = {
3671
3585
  command: "list",
3672
3586
  describe: "List data types",
@@ -3674,12 +3588,19 @@ var DataTypeListModule = {
3674
3588
  builder: (yargs38) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs38))))),
3675
3589
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
3676
3590
  const fetch3 = nodeFetchProxy(proxy, verbose);
3677
- const client = getDataTypeClient({ apiKey, apiHost, fetch: fetch3, projectId });
3591
+ const client = new DataTypeClient2({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
3678
3592
  const res = await client.get();
3679
3593
  emitWithFormat(res.results, format, filename);
3680
3594
  }
3681
3595
  };
3682
3596
 
3597
+ // src/commands/canvas/commands/dataType/pull.ts
3598
+ import { DataTypeClient as DataTypeClient3 } from "@uniformdev/canvas";
3599
+
3600
+ // src/commands/canvas/commands/dataType/_util.ts
3601
+ var selectIdentifier4 = (dataType) => dataType.id;
3602
+ var selectDisplayName4 = (dataType) => `${dataType.displayName} (pid: ${dataType.id})`;
3603
+
3683
3604
  // src/commands/canvas/dataTypeEngineDataSource.ts
3684
3605
  function createDataTypeEngineDataSource({
3685
3606
  client
@@ -3754,11 +3675,12 @@ var DataTypePullModule = {
3754
3675
  verbose
3755
3676
  }) => {
3756
3677
  const fetch3 = nodeFetchProxy(proxy, verbose);
3757
- const client = getDataTypeClient({
3678
+ const client = new DataTypeClient3({
3758
3679
  apiKey,
3759
3680
  apiHost,
3760
3681
  fetch: fetch3,
3761
- projectId
3682
+ projectId,
3683
+ bypassCache: true
3762
3684
  });
3763
3685
  const source = createDataTypeEngineDataSource({ client });
3764
3686
  let target;
@@ -3796,6 +3718,7 @@ var DataTypePullModule = {
3796
3718
  };
3797
3719
 
3798
3720
  // src/commands/canvas/commands/dataType/push.ts
3721
+ import { DataTypeClient as DataTypeClient4 } from "@uniformdev/canvas";
3799
3722
  var DataTypePushModule = {
3800
3723
  command: "push <directory>",
3801
3724
  describe: "Pushes all data types from files in a directory to Uniform",
@@ -3832,11 +3755,12 @@ var DataTypePushModule = {
3832
3755
  verbose
3833
3756
  }) => {
3834
3757
  const fetch3 = nodeFetchProxy(proxy, verbose);
3835
- const client = getDataTypeClient({
3758
+ const client = new DataTypeClient4({
3836
3759
  apiKey,
3837
3760
  apiHost,
3838
3761
  fetch: fetch3,
3839
- projectId
3762
+ projectId,
3763
+ bypassCache: true
3840
3764
  });
3841
3765
  let source;
3842
3766
  const isPackage = isPathAPackageFile(directory);
@@ -3869,6 +3793,7 @@ var DataTypePushModule = {
3869
3793
  };
3870
3794
 
3871
3795
  // src/commands/canvas/commands/dataType/remove.ts
3796
+ import { DataTypeClient as DataTypeClient5 } from "@uniformdev/canvas";
3872
3797
  var DataTypeRemoveModule = {
3873
3798
  command: "remove <id>",
3874
3799
  aliases: ["delete", "rm"],
@@ -3884,7 +3809,7 @@ var DataTypeRemoveModule = {
3884
3809
  ),
3885
3810
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId, whatIf }) => {
3886
3811
  const fetch3 = nodeFetchProxy(proxy);
3887
- const client = getDataTypeClient({ apiKey, apiHost, fetch: fetch3, projectId });
3812
+ const client = new DataTypeClient5({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
3888
3813
  if (!whatIf) {
3889
3814
  await client.remove({ typeId: id });
3890
3815
  } else {
@@ -3894,6 +3819,7 @@ var DataTypeRemoveModule = {
3894
3819
  };
3895
3820
 
3896
3821
  // src/commands/canvas/commands/dataType/update.ts
3822
+ import { DataTypeClient as DataTypeClient6 } from "@uniformdev/canvas";
3897
3823
  var DataTypeUpdateModule = {
3898
3824
  command: "update <filename>",
3899
3825
  aliases: ["put"],
@@ -3909,7 +3835,7 @@ var DataTypeUpdateModule = {
3909
3835
  ),
3910
3836
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId, verbose, whatIf }) => {
3911
3837
  const fetch3 = nodeFetchProxy(proxy, verbose);
3912
- const client = getDataTypeClient({ apiKey, apiHost, fetch: fetch3, projectId });
3838
+ const client = new DataTypeClient6({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
3913
3839
  const file = readFileToObject(filename);
3914
3840
  if (!whatIf) {
3915
3841
  await client.upsert({ data: file });
@@ -3934,6 +3860,7 @@ var DataTypeModule = {
3934
3860
  import yargs10 from "yargs";
3935
3861
 
3936
3862
  // src/commands/canvas/commands/entry/get.ts
3863
+ import { ContentClient as ContentClient7 } from "@uniformdev/canvas";
3937
3864
  var EntryGetModule = {
3938
3865
  command: "get <id>",
3939
3866
  describe: "Get an entry",
@@ -3984,7 +3911,7 @@ var EntryGetModule = {
3984
3911
  verbose
3985
3912
  }) => {
3986
3913
  const fetch3 = nodeFetchProxy(proxy, verbose);
3987
- const client = getContentClient({ apiKey, apiHost, edgeApiHost, fetch: fetch3, projectId });
3914
+ const client = new ContentClient7({ apiKey, apiHost, edgeApiHost, fetch: fetch3, projectId, bypassCache: true });
3988
3915
  const res = await client.getEntries({
3989
3916
  offset: 0,
3990
3917
  limit: 1,
@@ -4004,6 +3931,7 @@ var EntryGetModule = {
4004
3931
  };
4005
3932
 
4006
3933
  // src/commands/canvas/commands/entry/list.ts
3934
+ import { ContentClient as ContentClient8 } from "@uniformdev/canvas";
4007
3935
  var LEGACY_DEFAULT_LIMIT = 1e3;
4008
3936
  var EntryListModule = {
4009
3937
  command: "list",
@@ -4040,16 +3968,16 @@ var EntryListModule = {
4040
3968
  filename,
4041
3969
  project: projectId,
4042
3970
  state,
4043
- limit: limit2,
3971
+ limit,
4044
3972
  offset,
4045
3973
  search,
4046
3974
  verbose
4047
3975
  }) => {
4048
3976
  const fetch3 = nodeFetchProxy(proxy, verbose);
4049
- const client = getContentClient({ apiKey, apiHost, edgeApiHost, fetch: fetch3, projectId });
3977
+ const client = new ContentClient8({ apiKey, apiHost, edgeApiHost, fetch: fetch3, projectId, bypassCache: true });
4050
3978
  const res = await client.getEntries({
4051
3979
  offset,
4052
- limit: search.length > 0 && limit2 === LEGACY_DEFAULT_LIMIT ? 100 : limit2,
3980
+ limit: search.length > 0 && limit === LEGACY_DEFAULT_LIMIT ? 100 : limit,
4053
3981
  // Search API requires a lower default limit (100)
4054
3982
  search: search.length > 0 ? search : void 0,
4055
3983
  state: convertStateOption(state),
@@ -4061,6 +3989,9 @@ var EntryListModule = {
4061
3989
  }
4062
3990
  };
4063
3991
 
3992
+ // src/commands/canvas/commands/entry/publish.ts
3993
+ import { ContentClient as ContentClient10 } from "@uniformdev/canvas";
3994
+
4064
3995
  // src/commands/canvas/entryEngineDataSource.ts
4065
3996
  import { ApiClientError, convertEntryToPutEntry } from "@uniformdev/canvas";
4066
3997
 
@@ -4093,11 +4024,11 @@ function createEntryEngineDataSource({
4093
4024
  const stateId = convertStateOption(state);
4094
4025
  async function* getObjects() {
4095
4026
  const entries = paginateAsync(
4096
- async (offset, limit2) => {
4027
+ async (offset, limit) => {
4097
4028
  try {
4098
4029
  return (await client.getEntries({
4099
4030
  offset,
4100
- limit: limit2,
4031
+ limit,
4101
4032
  entryIDs,
4102
4033
  pattern: onlyEntries ? false : onlyPatterns ? true : void 0,
4103
4034
  skipDataResolution: true,
@@ -4168,7 +4099,7 @@ var EntryPublishModule = {
4168
4099
  }
4169
4100
  const entryIDsArray = ids ? ids.split(",").map((id) => id.trim()) : void 0;
4170
4101
  const fetch3 = nodeFetchProxy(proxy, verbose);
4171
- const client = getContentClient({ apiKey, apiHost, edgeApiHost, fetch: fetch3, projectId });
4102
+ const client = new ContentClient10({ apiKey, apiHost, edgeApiHost, fetch: fetch3, projectId, bypassCache: true });
4172
4103
  const source = createEntryEngineDataSource({
4173
4104
  client,
4174
4105
  state: "preview",
@@ -4193,6 +4124,8 @@ var EntryPublishModule = {
4193
4124
  };
4194
4125
 
4195
4126
  // src/commands/canvas/commands/entry/pull.ts
4127
+ import { ContentClient as ContentClient11 } from "@uniformdev/canvas";
4128
+ import { UncachedFileClient as UncachedFileClient5 } from "@uniformdev/files";
4196
4129
  var EntryPullModule = {
4197
4130
  command: "pull <directory>",
4198
4131
  describe: "Pulls all entries to local files in a directory",
@@ -4239,13 +4172,14 @@ var EntryPullModule = {
4239
4172
  verbose
4240
4173
  }) => {
4241
4174
  const fetch3 = nodeFetchProxy(proxy, verbose);
4242
- const client = getContentClient({
4175
+ const client = new ContentClient11({
4243
4176
  apiKey,
4244
4177
  apiHost,
4245
4178
  fetch: fetch3,
4246
- projectId
4179
+ projectId,
4180
+ bypassCache: true
4247
4181
  });
4248
- const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch3, projectId });
4182
+ const fileClient = new UncachedFileClient5({ apiKey, apiHost, fetch: fetch3, projectId });
4249
4183
  const source = createEntryEngineDataSource({ client, state, onlyEntries: true });
4250
4184
  let target;
4251
4185
  const isPackage = isPathAPackageFile(directory);
@@ -4294,6 +4228,8 @@ var EntryPullModule = {
4294
4228
  };
4295
4229
 
4296
4230
  // src/commands/canvas/commands/entry/push.ts
4231
+ import { ContentClient as ContentClient12 } from "@uniformdev/canvas";
4232
+ import { UncachedFileClient as UncachedFileClient6 } from "@uniformdev/files";
4297
4233
  var EntryPushModule = {
4298
4234
  command: "push <directory>",
4299
4235
  describe: "Pushes all entries from files in a directory to Uniform",
@@ -4333,11 +4269,12 @@ var EntryPushModule = {
4333
4269
  verbose
4334
4270
  }) => {
4335
4271
  const fetch3 = nodeFetchProxy(proxy, verbose);
4336
- const client = getContentClient({
4272
+ const client = new ContentClient12({
4337
4273
  apiKey,
4338
4274
  apiHost,
4339
4275
  fetch: fetch3,
4340
- projectId
4276
+ projectId,
4277
+ bypassCache: true
4341
4278
  });
4342
4279
  let source;
4343
4280
  const isPackage = isPathAPackageFile(directory);
@@ -4358,7 +4295,7 @@ var EntryPushModule = {
4358
4295
  });
4359
4296
  }
4360
4297
  const target = createEntryEngineDataSource({ client, state, onlyEntries: true });
4361
- const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch3, projectId });
4298
+ const fileClient = new UncachedFileClient6({ apiKey, apiHost, fetch: fetch3, projectId });
4362
4299
  await syncEngine({
4363
4300
  source,
4364
4301
  target,
@@ -4382,6 +4319,7 @@ var EntryPushModule = {
4382
4319
  };
4383
4320
 
4384
4321
  // src/commands/canvas/commands/entry/remove.ts
4322
+ import { ContentClient as ContentClient13 } from "@uniformdev/canvas";
4385
4323
  var EntryRemoveModule = {
4386
4324
  command: "remove <id>",
4387
4325
  aliases: ["delete", "rm"],
@@ -4397,7 +4335,7 @@ var EntryRemoveModule = {
4397
4335
  ),
4398
4336
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId, verbose, whatIf }) => {
4399
4337
  const fetch3 = nodeFetchProxy(proxy, verbose);
4400
- const client = getContentClient({ apiKey, apiHost, fetch: fetch3, projectId });
4338
+ const client = new ContentClient13({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
4401
4339
  if (!whatIf) {
4402
4340
  await client.deleteEntry({ entryId: id });
4403
4341
  } else {
@@ -4407,7 +4345,7 @@ var EntryRemoveModule = {
4407
4345
  };
4408
4346
 
4409
4347
  // src/commands/canvas/commands/entry/unpublish.ts
4410
- import { CANVAS_PUBLISHED_STATE as CANVAS_PUBLISHED_STATE3 } from "@uniformdev/canvas";
4348
+ import { CANVAS_PUBLISHED_STATE as CANVAS_PUBLISHED_STATE3, ContentClient as ContentClient14 } from "@uniformdev/canvas";
4411
4349
  import { diffJson as diffJson3 } from "diff";
4412
4350
  var EntryUnpublishModule = {
4413
4351
  command: "unpublish [ids]",
@@ -4437,7 +4375,7 @@ var EntryUnpublishModule = {
4437
4375
  const entryIDsArray = ids ? ids.split(",").map((id) => id.trim()) : void 0;
4438
4376
  const targetItems = /* @__PURE__ */ new Map();
4439
4377
  const fetch3 = nodeFetchProxy(proxy, verbose);
4440
- const client = getContentClient({ apiKey, apiHost, fetch: fetch3, projectId });
4378
+ const client = new ContentClient14({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
4441
4379
  const source = createEntryEngineDataSource({
4442
4380
  client,
4443
4381
  state: "published",
@@ -4475,13 +4413,14 @@ var EntryUnpublishModule = {
4475
4413
  providerId: sourceObject.providerId,
4476
4414
  displayName: sourceObject.displayName ?? sourceObject.providerId,
4477
4415
  whatIf,
4478
- diff: () => diffJson3(targetObject.object, sourceObject.object)
4416
+ diff: diffJson3(targetObject.object, sourceObject.object)
4479
4417
  });
4480
4418
  }
4481
4419
  }
4482
4420
  };
4483
4421
 
4484
4422
  // src/commands/canvas/commands/entry/update.ts
4423
+ import { ContentClient as ContentClient15 } from "@uniformdev/canvas";
4485
4424
  var EntryUpdateModule = {
4486
4425
  command: "update <filename>",
4487
4426
  aliases: ["put"],
@@ -4509,7 +4448,7 @@ var EntryUpdateModule = {
4509
4448
  whatIf
4510
4449
  }) => {
4511
4450
  const fetch3 = nodeFetchProxy(proxy, verbose);
4512
- const client = getContentClient({ apiKey, apiHost, edgeApiHost, fetch: fetch3, projectId });
4451
+ const client = new ContentClient15({ apiKey, apiHost, edgeApiHost, fetch: fetch3, projectId, bypassCache: true });
4513
4452
  const file = readFileToObject(filename);
4514
4453
  if (!whatIf) {
4515
4454
  await client.upsertEntry({ ...file, state: convertStateOption(state) });
@@ -4533,6 +4472,7 @@ var EntryModule = {
4533
4472
  import yargs11 from "yargs";
4534
4473
 
4535
4474
  // src/commands/canvas/commands/entryPattern/get.ts
4475
+ import { ContentClient as ContentClient16 } from "@uniformdev/canvas";
4536
4476
  var EntryPatternGetModule = {
4537
4477
  command: "get <id>",
4538
4478
  describe: "Get an entry pattern",
@@ -4555,7 +4495,7 @@ var EntryPatternGetModule = {
4555
4495
  ),
4556
4496
  handler: async ({ apiHost, apiKey, proxy, id, format, filename, project: projectId, state, verbose }) => {
4557
4497
  const fetch3 = nodeFetchProxy(proxy, verbose);
4558
- const client = getContentClient({ apiKey, apiHost, fetch: fetch3, projectId });
4498
+ const client = new ContentClient16({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
4559
4499
  const res = await client.getEntries({
4560
4500
  offset: 0,
4561
4501
  limit: 1,
@@ -4574,6 +4514,7 @@ var EntryPatternGetModule = {
4574
4514
  };
4575
4515
 
4576
4516
  // src/commands/canvas/commands/entryPattern/list.ts
4517
+ import { ContentClient as ContentClient17 } from "@uniformdev/canvas";
4577
4518
  var EntryPatternListModule = {
4578
4519
  command: "list",
4579
4520
  describe: "List entry patterns",
@@ -4594,7 +4535,7 @@ var EntryPatternListModule = {
4594
4535
  verbose
4595
4536
  }) => {
4596
4537
  const fetch3 = nodeFetchProxy(proxy, verbose);
4597
- const client = getContentClient({ apiKey, apiHost, edgeApiHost, fetch: fetch3, projectId });
4538
+ const client = new ContentClient17({ apiKey, apiHost, edgeApiHost, fetch: fetch3, projectId, bypassCache: true });
4598
4539
  const res = await client.getEntries({
4599
4540
  offset: 0,
4600
4541
  limit: 1e3,
@@ -4609,6 +4550,7 @@ var EntryPatternListModule = {
4609
4550
  };
4610
4551
 
4611
4552
  // src/commands/canvas/commands/entryPattern/publish.ts
4553
+ import { ContentClient as ContentClient18 } from "@uniformdev/canvas";
4612
4554
  var EntryPatternPublishModule = {
4613
4555
  command: "publish [ids]",
4614
4556
  describe: "Publishes entry pattern(s)",
@@ -4638,7 +4580,7 @@ var EntryPatternPublishModule = {
4638
4580
  }
4639
4581
  const entryIDsArray = ids ? ids.split(",").map((id) => id.trim()) : void 0;
4640
4582
  const fetch3 = nodeFetchProxy(proxy, verbose);
4641
- const client = getContentClient({ apiKey, apiHost, edgeApiHost, fetch: fetch3, projectId });
4583
+ const client = new ContentClient18({ apiKey, apiHost, edgeApiHost, fetch: fetch3, projectId, bypassCache: true });
4642
4584
  const source = createEntryEngineDataSource({
4643
4585
  client,
4644
4586
  state: "preview",
@@ -4663,6 +4605,8 @@ var EntryPatternPublishModule = {
4663
4605
  };
4664
4606
 
4665
4607
  // src/commands/canvas/commands/entryPattern/pull.ts
4608
+ import { ContentClient as ContentClient19 } from "@uniformdev/canvas";
4609
+ import { UncachedFileClient as UncachedFileClient7 } from "@uniformdev/files";
4666
4610
  var EntryPatternPullModule = {
4667
4611
  command: "pull <directory>",
4668
4612
  describe: "Pulls all entry patterns to local files in a directory",
@@ -4709,13 +4653,14 @@ var EntryPatternPullModule = {
4709
4653
  verbose
4710
4654
  }) => {
4711
4655
  const fetch3 = nodeFetchProxy(proxy, verbose);
4712
- const client = getContentClient({
4656
+ const client = new ContentClient19({
4713
4657
  apiKey,
4714
4658
  apiHost,
4715
4659
  fetch: fetch3,
4716
- projectId
4660
+ projectId,
4661
+ bypassCache: true
4717
4662
  });
4718
- const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch3, projectId });
4663
+ const fileClient = new UncachedFileClient7({ apiKey, apiHost, fetch: fetch3, projectId });
4719
4664
  const source = createEntryEngineDataSource({ client, state, onlyPatterns: true });
4720
4665
  let target;
4721
4666
  const isPackage = isPathAPackageFile(directory);
@@ -4764,6 +4709,8 @@ var EntryPatternPullModule = {
4764
4709
  };
4765
4710
 
4766
4711
  // src/commands/canvas/commands/entryPattern/push.ts
4712
+ import { ContentClient as ContentClient20 } from "@uniformdev/canvas";
4713
+ import { UncachedFileClient as UncachedFileClient8 } from "@uniformdev/files";
4767
4714
  var EntryPatternPushModule = {
4768
4715
  command: "push <directory>",
4769
4716
  describe: "Pushes all entry patterns from files in a directory to Uniform",
@@ -4808,11 +4755,12 @@ var EntryPatternPushModule = {
4808
4755
  verbose
4809
4756
  }) => {
4810
4757
  const fetch3 = nodeFetchProxy(proxy, verbose);
4811
- const client = getContentClient({
4758
+ const client = new ContentClient20({
4812
4759
  apiKey,
4813
4760
  apiHost,
4814
4761
  fetch: fetch3,
4815
- projectId
4762
+ projectId,
4763
+ bypassCache: true
4816
4764
  });
4817
4765
  let source;
4818
4766
  const isPackage = isPathAPackageFile(directory);
@@ -4833,7 +4781,7 @@ var EntryPatternPushModule = {
4833
4781
  });
4834
4782
  }
4835
4783
  const target = createEntryEngineDataSource({ client, state, onlyPatterns: true });
4836
- const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch3, projectId });
4784
+ const fileClient = new UncachedFileClient8({ apiKey, apiHost, fetch: fetch3, projectId });
4837
4785
  await syncEngine({
4838
4786
  source,
4839
4787
  target,
@@ -4857,6 +4805,7 @@ var EntryPatternPushModule = {
4857
4805
  };
4858
4806
 
4859
4807
  // src/commands/canvas/commands/entryPattern/remove.ts
4808
+ import { ContentClient as ContentClient21 } from "@uniformdev/canvas";
4860
4809
  var EntryPatternRemoveModule = {
4861
4810
  command: "remove <id>",
4862
4811
  aliases: ["delete", "rm"],
@@ -4872,7 +4821,7 @@ var EntryPatternRemoveModule = {
4872
4821
  ),
4873
4822
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId, verbose, whatIf }) => {
4874
4823
  const fetch3 = nodeFetchProxy(proxy, verbose);
4875
- const client = getContentClient({ apiKey, apiHost, fetch: fetch3, projectId });
4824
+ const client = new ContentClient21({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
4876
4825
  if (!whatIf) {
4877
4826
  await client.deleteEntry({ entryId: id });
4878
4827
  } else {
@@ -4882,7 +4831,7 @@ var EntryPatternRemoveModule = {
4882
4831
  };
4883
4832
 
4884
4833
  // src/commands/canvas/commands/entryPattern/unpublish.ts
4885
- import { CANVAS_PUBLISHED_STATE as CANVAS_PUBLISHED_STATE4 } from "@uniformdev/canvas";
4834
+ import { CANVAS_PUBLISHED_STATE as CANVAS_PUBLISHED_STATE4, ContentClient as ContentClient22 } from "@uniformdev/canvas";
4886
4835
  import { diffJson as diffJson4 } from "diff";
4887
4836
  var EntryPatternUnpublishModule = {
4888
4837
  command: "unpublish [ids]",
@@ -4912,7 +4861,7 @@ var EntryPatternUnpublishModule = {
4912
4861
  const entryIDsArray = ids ? ids.split(",").map((id) => id.trim()) : void 0;
4913
4862
  const targetItems = /* @__PURE__ */ new Map();
4914
4863
  const fetch3 = nodeFetchProxy(proxy, verbose);
4915
- const client = getContentClient({ apiKey, apiHost, fetch: fetch3, projectId });
4864
+ const client = new ContentClient22({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
4916
4865
  const source = createEntryEngineDataSource({
4917
4866
  client,
4918
4867
  state: "published",
@@ -4950,13 +4899,14 @@ var EntryPatternUnpublishModule = {
4950
4899
  providerId: sourceObject.providerId,
4951
4900
  displayName: sourceObject.displayName ?? sourceObject.providerId,
4952
4901
  whatIf,
4953
- diff: () => diffJson4(targetObject.object, sourceObject.object)
4902
+ diff: diffJson4(targetObject.object, sourceObject.object)
4954
4903
  });
4955
4904
  }
4956
4905
  }
4957
4906
  };
4958
4907
 
4959
4908
  // src/commands/canvas/commands/entryPattern/update.ts
4909
+ import { ContentClient as ContentClient23 } from "@uniformdev/canvas";
4960
4910
  var EntryPatternUpdateModule = {
4961
4911
  command: "update <filename>",
4962
4912
  aliases: ["put"],
@@ -4984,7 +4934,7 @@ var EntryPatternUpdateModule = {
4984
4934
  whatIf
4985
4935
  }) => {
4986
4936
  const fetch3 = nodeFetchProxy(proxy, verbose);
4987
- const client = getContentClient({ apiKey, apiHost, edgeApiHost, fetch: fetch3, projectId });
4937
+ const client = new ContentClient23({ apiKey, apiHost, edgeApiHost, fetch: fetch3, projectId, bypassCache: true });
4988
4938
  const file = readFileToObject(filename);
4989
4939
  if (!whatIf) {
4990
4940
  await client.upsertEntry({ ...file, state: convertStateOption(state) });
@@ -5011,6 +4961,9 @@ var EntryPatternModule = {
5011
4961
  // src/commands/canvas/commands/locale.ts
5012
4962
  import yargs12 from "yargs";
5013
4963
 
4964
+ // src/commands/canvas/commands/locale/pull.ts
4965
+ import { LocaleClient } from "@uniformdev/canvas";
4966
+
5014
4967
  // src/commands/canvas/localesEngineDataSource.ts
5015
4968
  function createLocaleEngineDataSource({
5016
4969
  client
@@ -5041,12 +4994,6 @@ function createLocaleEngineDataSource({
5041
4994
  };
5042
4995
  }
5043
4996
 
5044
- // src/commands/canvas/commands/locale/_util.ts
5045
- import { LocaleClient } from "@uniformdev/canvas";
5046
- function getLocaleClient(options) {
5047
- return new LocaleClient({ ...options, bypassCache: true, limitPolicy: cliLimitPolicy });
5048
- }
5049
-
5050
4997
  // src/commands/canvas/commands/locale/pull.ts
5051
4998
  var LocalePullModule = {
5052
4999
  command: "pull <directory>",
@@ -5091,11 +5038,12 @@ var LocalePullModule = {
5091
5038
  verbose
5092
5039
  }) => {
5093
5040
  const fetch3 = nodeFetchProxy(proxy, verbose);
5094
- const client = getLocaleClient({
5041
+ const client = new LocaleClient({
5095
5042
  apiKey,
5096
5043
  apiHost,
5097
5044
  fetch: fetch3,
5098
- projectId
5045
+ projectId,
5046
+ bypassCache: true
5099
5047
  });
5100
5048
  const source = createLocaleEngineDataSource({ client });
5101
5049
  let target;
@@ -5133,6 +5081,7 @@ var LocalePullModule = {
5133
5081
  };
5134
5082
 
5135
5083
  // src/commands/canvas/commands/locale/push.ts
5084
+ import { LocaleClient as LocaleClient2 } from "@uniformdev/canvas";
5136
5085
  var LocalePushModule = {
5137
5086
  command: "push <directory>",
5138
5087
  describe: "Pushes all locales from files in a directory to Uniform",
@@ -5169,11 +5118,12 @@ var LocalePushModule = {
5169
5118
  verbose
5170
5119
  }) => {
5171
5120
  const fetch3 = nodeFetchProxy(proxy, verbose);
5172
- const client = getLocaleClient({
5121
+ const client = new LocaleClient2({
5173
5122
  apiKey,
5174
5123
  apiHost,
5175
5124
  fetch: fetch3,
5176
- projectId
5125
+ projectId,
5126
+ bypassCache: true
5177
5127
  });
5178
5128
  let source;
5179
5129
  const isPackage = isPathAPackageFile(directory);
@@ -5445,15 +5395,8 @@ var PatternModule = {
5445
5395
  // src/commands/canvas/commands/previewUrl.ts
5446
5396
  import yargs14 from "yargs";
5447
5397
 
5448
- // src/commands/canvas/commands/previewUrl/_util.ts
5449
- import { PreviewClient } from "@uniformdev/canvas";
5450
- var selectIdentifier5 = (previewUrl) => previewUrl.id;
5451
- var selectDisplayName5 = (previewUrl) => `${previewUrl.name} (pid: ${previewUrl.id})`;
5452
- function getPreviewClient(options) {
5453
- return new PreviewClient({ ...options, bypassCache: true, limitPolicy: cliLimitPolicy });
5454
- }
5455
-
5456
5398
  // src/commands/canvas/commands/previewUrl/get.ts
5399
+ import { PreviewClient } from "@uniformdev/canvas";
5457
5400
  var PreviewUrlGetModule = {
5458
5401
  command: "get <id>",
5459
5402
  describe: "Fetch a preview URL",
@@ -5470,7 +5413,7 @@ var PreviewUrlGetModule = {
5470
5413
  ),
5471
5414
  handler: async ({ apiHost, apiKey, proxy, id, format, project: projectId, filename, verbose }) => {
5472
5415
  const fetch3 = nodeFetchProxy(proxy, verbose);
5473
- const client = getPreviewClient({ apiKey, apiHost, fetch: fetch3, projectId });
5416
+ const client = new PreviewClient({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
5474
5417
  const previewUrl = await client.getPreviewUrl({ id });
5475
5418
  if (!previewUrl) {
5476
5419
  console.error("Preview URL did not exist");
@@ -5482,6 +5425,7 @@ var PreviewUrlGetModule = {
5482
5425
  };
5483
5426
 
5484
5427
  // src/commands/canvas/commands/previewUrl/list.ts
5428
+ import { PreviewClient as PreviewClient2 } from "@uniformdev/canvas";
5485
5429
  var PreviewUrlListModule = {
5486
5430
  command: "list",
5487
5431
  describe: "List preview URLs",
@@ -5491,12 +5435,19 @@ var PreviewUrlListModule = {
5491
5435
  ),
5492
5436
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
5493
5437
  const fetch3 = nodeFetchProxy(proxy, verbose);
5494
- const client = getPreviewClient({ apiKey, apiHost, fetch: fetch3, projectId });
5438
+ const client = new PreviewClient2({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
5495
5439
  const res = await client.getPreviewUrls();
5496
5440
  emitWithFormat(res.previewUrls, format, filename);
5497
5441
  }
5498
5442
  };
5499
5443
 
5444
+ // src/commands/canvas/commands/previewUrl/pull.ts
5445
+ import { PreviewClient as PreviewClient3 } from "@uniformdev/canvas";
5446
+
5447
+ // src/commands/canvas/commands/previewUrl/_util.ts
5448
+ var selectIdentifier5 = (previewUrl) => previewUrl.id;
5449
+ var selectDisplayName5 = (previewUrl) => `${previewUrl.name} (pid: ${previewUrl.id})`;
5450
+
5500
5451
  // src/commands/canvas/previewUrlEngineDataSource.ts
5501
5452
  function createPreviewUrlEngineDataSource({
5502
5453
  client
@@ -5569,7 +5520,7 @@ var PreviewUrlPullModule = {
5569
5520
  verbose
5570
5521
  }) => {
5571
5522
  const fetch3 = nodeFetchProxy(proxy, verbose);
5572
- const client = getPreviewClient({ apiKey, apiHost, fetch: fetch3, projectId });
5523
+ const client = new PreviewClient3({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
5573
5524
  const source = createPreviewUrlEngineDataSource({ client });
5574
5525
  let target;
5575
5526
  const isPackage = isPathAPackageFile(directory);
@@ -5606,6 +5557,7 @@ var PreviewUrlPullModule = {
5606
5557
  };
5607
5558
 
5608
5559
  // src/commands/canvas/commands/previewUrl/push.ts
5560
+ import { PreviewClient as PreviewClient4 } from "@uniformdev/canvas";
5609
5561
  var PreviewUrlPushModule = {
5610
5562
  command: "push <directory>",
5611
5563
  describe: "Pushes all preview urls from files in a directory to Uniform Canvas",
@@ -5642,7 +5594,7 @@ var PreviewUrlPushModule = {
5642
5594
  verbose
5643
5595
  }) => {
5644
5596
  const fetch3 = nodeFetchProxy(proxy, verbose);
5645
- const client = getPreviewClient({ apiKey, apiHost, fetch: fetch3, projectId });
5597
+ const client = new PreviewClient4({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
5646
5598
  let source;
5647
5599
  const isPackage = isPathAPackageFile(directory);
5648
5600
  if (isPackage) {
@@ -5674,6 +5626,7 @@ var PreviewUrlPushModule = {
5674
5626
  };
5675
5627
 
5676
5628
  // src/commands/canvas/commands/previewUrl/remove.ts
5629
+ import { PreviewClient as PreviewClient5 } from "@uniformdev/canvas";
5677
5630
  var PreviewUrlRemoveModule = {
5678
5631
  command: "remove <id>",
5679
5632
  aliases: ["delete", "rm"],
@@ -5689,7 +5642,7 @@ var PreviewUrlRemoveModule = {
5689
5642
  ),
5690
5643
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId, verbose, whatIf }) => {
5691
5644
  const fetch3 = nodeFetchProxy(proxy, verbose);
5692
- const client = getPreviewClient({ apiKey, apiHost, fetch: fetch3, projectId });
5645
+ const client = new PreviewClient5({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
5693
5646
  if (!whatIf) {
5694
5647
  await client.deletePreviewUrl({ id });
5695
5648
  } else {
@@ -5699,6 +5652,7 @@ var PreviewUrlRemoveModule = {
5699
5652
  };
5700
5653
 
5701
5654
  // src/commands/canvas/commands/previewUrl/update.ts
5655
+ import { PreviewClient as PreviewClient6 } from "@uniformdev/canvas";
5702
5656
  var PreviewUrlUpdateModule = {
5703
5657
  command: "update <filename>",
5704
5658
  aliases: ["put"],
@@ -5714,7 +5668,7 @@ var PreviewUrlUpdateModule = {
5714
5668
  ),
5715
5669
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId, whatIf, verbose }) => {
5716
5670
  const fetch3 = nodeFetchProxy(proxy, verbose);
5717
- const client = getPreviewClient({ apiKey, apiHost, fetch: fetch3, projectId });
5671
+ const client = new PreviewClient6({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
5718
5672
  const file = readFileToObject(filename);
5719
5673
  if (!whatIf) {
5720
5674
  await client.upsertPreviewUrl(file);
@@ -5739,6 +5693,7 @@ var PreviewUrlModule = {
5739
5693
  import yargs15 from "yargs";
5740
5694
 
5741
5695
  // src/commands/canvas/commands/previewViewport/get.ts
5696
+ import { PreviewClient as PreviewClient7 } from "@uniformdev/canvas";
5742
5697
  var PreviewViewportGetModule = {
5743
5698
  command: "get <id>",
5744
5699
  describe: "Fetch a preview viewport",
@@ -5755,7 +5710,7 @@ var PreviewViewportGetModule = {
5755
5710
  ),
5756
5711
  handler: async ({ apiHost, apiKey, proxy, id, format, project: projectId, filename, verbose }) => {
5757
5712
  const fetch3 = nodeFetchProxy(proxy, verbose);
5758
- const client = getPreviewClient({ apiKey, apiHost, fetch: fetch3, projectId });
5713
+ const client = new PreviewClient7({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
5759
5714
  const previewViewport = await client.getPreviewViewport({ id });
5760
5715
  if (!previewViewport) {
5761
5716
  console.error("Preview viewport did not exist");
@@ -5767,6 +5722,7 @@ var PreviewViewportGetModule = {
5767
5722
  };
5768
5723
 
5769
5724
  // src/commands/canvas/commands/previewViewport/list.ts
5725
+ import { PreviewClient as PreviewClient8 } from "@uniformdev/canvas";
5770
5726
  var PreviewViewportListModule = {
5771
5727
  command: "list",
5772
5728
  describe: "List preview viewports",
@@ -5776,12 +5732,15 @@ var PreviewViewportListModule = {
5776
5732
  ),
5777
5733
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
5778
5734
  const fetch3 = nodeFetchProxy(proxy, verbose);
5779
- const client = getPreviewClient({ apiKey, apiHost, fetch: fetch3, projectId });
5735
+ const client = new PreviewClient8({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
5780
5736
  const res = await client.getPreviewViewports();
5781
5737
  emitWithFormat(res.previewViewports, format, filename);
5782
5738
  }
5783
5739
  };
5784
5740
 
5741
+ // src/commands/canvas/commands/previewViewport/pull.ts
5742
+ import { PreviewClient as PreviewClient9 } from "@uniformdev/canvas";
5743
+
5785
5744
  // src/commands/canvas/commands/previewViewport/_util.ts
5786
5745
  var selectIdentifier6 = (previewViewport) => previewViewport.id;
5787
5746
  var selectDisplayName6 = (previewViewport) => `${previewViewport.name} (pid: ${previewViewport.id})`;
@@ -5858,7 +5817,7 @@ var PreviewViewportPullModule = {
5858
5817
  verbose
5859
5818
  }) => {
5860
5819
  const fetch3 = nodeFetchProxy(proxy, verbose);
5861
- const client = getPreviewClient({ apiKey, apiHost, fetch: fetch3, projectId });
5820
+ const client = new PreviewClient9({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
5862
5821
  const source = createPreviewViewportEngineDataSource({ client });
5863
5822
  let target;
5864
5823
  const isPackage = isPathAPackageFile(directory);
@@ -5895,6 +5854,7 @@ var PreviewViewportPullModule = {
5895
5854
  };
5896
5855
 
5897
5856
  // src/commands/canvas/commands/previewViewport/push.ts
5857
+ import { PreviewClient as PreviewClient10 } from "@uniformdev/canvas";
5898
5858
  var PreviewViewportPushModule = {
5899
5859
  command: "push <directory>",
5900
5860
  describe: "Pushes all preview viewports from files in a directory to Uniform Canvas",
@@ -5931,7 +5891,7 @@ var PreviewViewportPushModule = {
5931
5891
  verbose
5932
5892
  }) => {
5933
5893
  const fetch3 = nodeFetchProxy(proxy, verbose);
5934
- const client = getPreviewClient({ apiKey, apiHost, fetch: fetch3, projectId });
5894
+ const client = new PreviewClient10({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
5935
5895
  let source;
5936
5896
  const isPackage = isPathAPackageFile(directory);
5937
5897
  if (isPackage) {
@@ -5963,6 +5923,7 @@ var PreviewViewportPushModule = {
5963
5923
  };
5964
5924
 
5965
5925
  // src/commands/canvas/commands/previewViewport/remove.ts
5926
+ import { PreviewClient as PreviewClient11 } from "@uniformdev/canvas";
5966
5927
  var PreviewViewportRemoveModule = {
5967
5928
  command: "remove <id>",
5968
5929
  aliases: ["delete", "rm"],
@@ -5978,7 +5939,7 @@ var PreviewViewportRemoveModule = {
5978
5939
  ),
5979
5940
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId, verbose, whatIf }) => {
5980
5941
  const fetch3 = nodeFetchProxy(proxy, verbose);
5981
- const client = getPreviewClient({ apiKey, apiHost, fetch: fetch3, projectId });
5942
+ const client = new PreviewClient11({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
5982
5943
  if (!whatIf) {
5983
5944
  await client.deletePreviewViewport({ id });
5984
5945
  } else {
@@ -5988,6 +5949,7 @@ var PreviewViewportRemoveModule = {
5988
5949
  };
5989
5950
 
5990
5951
  // src/commands/canvas/commands/previewViewport/update.ts
5952
+ import { PreviewClient as PreviewClient12 } from "@uniformdev/canvas";
5991
5953
  var PreviewViewportUpdateModule = {
5992
5954
  command: "update <filename>",
5993
5955
  aliases: ["put"],
@@ -6003,7 +5965,7 @@ var PreviewViewportUpdateModule = {
6003
5965
  ),
6004
5966
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId, whatIf, verbose }) => {
6005
5967
  const fetch3 = nodeFetchProxy(proxy, verbose);
6006
- const client = getPreviewClient({ apiKey, apiHost, fetch: fetch3, projectId });
5968
+ const client = new PreviewClient12({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
6007
5969
  const file = readFileToObject(filename);
6008
5970
  if (!whatIf) {
6009
5971
  await client.upsertPreviewViewport(file);
@@ -6027,13 +5989,8 @@ var PreviewViewportModule = {
6027
5989
  // src/commands/canvas/commands/prompts.ts
6028
5990
  import yargs16 from "yargs";
6029
5991
 
6030
- // src/commands/canvas/commands/prompts/_util.ts
6031
- import { PromptClient } from "@uniformdev/canvas";
6032
- var selectPromptIdentifier = (e) => e.id;
6033
- var selectPromptDisplayName = (e) => `${e.name ?? "Untitled"} (pid: ${e.id})`;
6034
- var getPromptClient = (options) => new PromptClient({ ...options, bypassCache: true, limitPolicy: cliLimitPolicy });
6035
-
6036
5992
  // src/commands/canvas/commands/prompts/get.ts
5993
+ import { PromptClient } from "@uniformdev/canvas";
6037
5994
  var PromptGetModule = {
6038
5995
  command: "get <id>",
6039
5996
  describe: "Get a prompt",
@@ -6042,6 +5999,7 @@ var PromptGetModule = {
6042
5999
  withFormatOptions(
6043
6000
  withApiOptions(
6044
6001
  withProjectOptions(
6002
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6045
6003
  yargs38.positional("id", { demandOption: true, describe: "Prompt ID to fetch" })
6046
6004
  )
6047
6005
  )
@@ -6050,7 +6008,7 @@ var PromptGetModule = {
6050
6008
  ),
6051
6009
  handler: async ({ apiHost, apiKey, proxy, id, format, filename, project: projectId, verbose }) => {
6052
6010
  const fetch3 = nodeFetchProxy(proxy, verbose);
6053
- const client = getPromptClient({ apiKey, apiHost, fetch: fetch3, projectId });
6011
+ const client = new PromptClient({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
6054
6012
  const res = await client.get({ promptId: id });
6055
6013
  if (!res) {
6056
6014
  throw new Error(`Prompt with ID ${id} not found`);
@@ -6060,18 +6018,26 @@ var PromptGetModule = {
6060
6018
  };
6061
6019
 
6062
6020
  // src/commands/canvas/commands/prompts/list.ts
6021
+ import { PromptClient as PromptClient2 } from "@uniformdev/canvas";
6063
6022
  var PromptListModule = {
6064
6023
  command: "list",
6065
6024
  describe: "List prompts",
6066
6025
  builder: (yargs38) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs38))))),
6067
6026
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
6068
6027
  const fetch3 = nodeFetchProxy(proxy, verbose);
6069
- const client = getPromptClient({ apiKey, apiHost, fetch: fetch3, projectId });
6028
+ const client = new PromptClient2({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
6070
6029
  const res = await client.get();
6071
6030
  emitWithFormat(res, format, filename);
6072
6031
  }
6073
6032
  };
6074
6033
 
6034
+ // src/commands/canvas/commands/prompts/pull.ts
6035
+ import { PromptClient as PromptClient3 } from "@uniformdev/canvas";
6036
+
6037
+ // src/commands/canvas/commands/prompts/_util.ts
6038
+ var selectPromptIdentifier = (e) => e.id;
6039
+ var selectPromptDisplayName = (e) => `${e.name ?? "Untitled"} (pid: ${e.id})`;
6040
+
6075
6041
  // src/commands/canvas/promptEngineDataSource.ts
6076
6042
  function createPromptEngineDataSource({
6077
6043
  client
@@ -6146,11 +6112,12 @@ var PromptPullModule = {
6146
6112
  verbose
6147
6113
  }) => {
6148
6114
  const fetch3 = nodeFetchProxy(proxy, verbose);
6149
- const client = getPromptClient({
6115
+ const client = new PromptClient3({
6150
6116
  apiKey,
6151
6117
  apiHost,
6152
6118
  fetch: fetch3,
6153
- projectId
6119
+ projectId,
6120
+ bypassCache: true
6154
6121
  });
6155
6122
  const source = createPromptEngineDataSource({ client });
6156
6123
  let target;
@@ -6188,6 +6155,7 @@ var PromptPullModule = {
6188
6155
  };
6189
6156
 
6190
6157
  // src/commands/canvas/commands/prompts/push.ts
6158
+ import { PromptClient as PromptClient4 } from "@uniformdev/canvas";
6191
6159
  var PromptPushModule = {
6192
6160
  command: "push <directory>",
6193
6161
  describe: "Pushes all prompts from files in a directory to Uniform",
@@ -6224,11 +6192,12 @@ var PromptPushModule = {
6224
6192
  verbose
6225
6193
  }) => {
6226
6194
  const fetch3 = nodeFetchProxy(proxy, verbose);
6227
- const client = getPromptClient({
6195
+ const client = new PromptClient4({
6228
6196
  apiKey,
6229
6197
  apiHost,
6230
6198
  fetch: fetch3,
6231
- projectId
6199
+ projectId,
6200
+ bypassCache: true
6232
6201
  });
6233
6202
  let source;
6234
6203
  const isPackage = isPathAPackageFile(directory);
@@ -6261,6 +6230,7 @@ var PromptPushModule = {
6261
6230
  };
6262
6231
 
6263
6232
  // src/commands/canvas/commands/prompts/remove.ts
6233
+ import { PromptClient as PromptClient5 } from "@uniformdev/canvas";
6264
6234
  var PromptRemoveModule = {
6265
6235
  command: "remove <id>",
6266
6236
  aliases: ["delete", "rm"],
@@ -6274,7 +6244,7 @@ var PromptRemoveModule = {
6274
6244
  ),
6275
6245
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId, verbose, whatIf }) => {
6276
6246
  const fetch3 = nodeFetchProxy(proxy, verbose);
6277
- const client = getPromptClient({ apiKey, apiHost, fetch: fetch3, projectId });
6247
+ const client = new PromptClient5({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
6278
6248
  if (!whatIf) {
6279
6249
  await client.remove({ promptId: id });
6280
6250
  } else {
@@ -6284,6 +6254,7 @@ var PromptRemoveModule = {
6284
6254
  };
6285
6255
 
6286
6256
  // src/commands/canvas/commands/prompts/update.ts
6257
+ import { PromptClient as PromptClient6 } from "@uniformdev/canvas";
6287
6258
  var PromptUpdateModule = {
6288
6259
  command: "update <filename>",
6289
6260
  aliases: ["put"],
@@ -6299,7 +6270,7 @@ var PromptUpdateModule = {
6299
6270
  ),
6300
6271
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId, verbose, whatIf }) => {
6301
6272
  const fetch3 = nodeFetchProxy(proxy, verbose);
6302
- const client = getPromptClient({ apiKey, apiHost, fetch: fetch3, projectId });
6273
+ const client = new PromptClient6({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
6303
6274
  const file = readFileToObject(filename);
6304
6275
  if (!whatIf) {
6305
6276
  await client.upsert({ data: file });
@@ -6323,11 +6294,12 @@ var PromptModule = {
6323
6294
  // src/commands/canvas/commands/workflow.ts
6324
6295
  import yargs17 from "yargs";
6325
6296
 
6326
- // src/commands/canvas/commands/workflow/_util.ts
6297
+ // src/commands/canvas/commands/workflow/pull.ts
6327
6298
  import { WorkflowClient } from "@uniformdev/canvas";
6299
+
6300
+ // src/commands/canvas/commands/workflow/_util.ts
6328
6301
  var selectIdentifier7 = (workflow) => workflow.id;
6329
6302
  var selectDisplayName7 = (workflow) => `${workflow.name} (pid: ${workflow.id})`;
6330
- var getWorkflowClient = (options) => new WorkflowClient({ ...options, bypassCache: true, limitPolicy: cliLimitPolicy });
6331
6303
 
6332
6304
  // src/commands/canvas/workflowEngineDataSource.ts
6333
6305
  function createWorkflowEngineDataSource({
@@ -6404,7 +6376,7 @@ var WorkflowPullModule = {
6404
6376
  verbose
6405
6377
  }) => {
6406
6378
  const fetch3 = nodeFetchProxy(proxy, verbose);
6407
- const client = getWorkflowClient({ apiKey, apiHost, fetch: fetch3, projectId });
6379
+ const client = new WorkflowClient({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
6408
6380
  const source = createWorkflowEngineDataSource({ client });
6409
6381
  let target;
6410
6382
  const isPackage = isPathAPackageFile(directory);
@@ -6441,6 +6413,7 @@ var WorkflowPullModule = {
6441
6413
  };
6442
6414
 
6443
6415
  // src/commands/canvas/commands/workflow/push.ts
6416
+ import { WorkflowClient as WorkflowClient2 } from "@uniformdev/canvas";
6444
6417
  var WorkflowPushModule = {
6445
6418
  command: "push <directory>",
6446
6419
  describe: "Pushes all workflows from files in a directory to Uniform Canvas",
@@ -6477,7 +6450,7 @@ var WorkflowPushModule = {
6477
6450
  verbose
6478
6451
  }) => {
6479
6452
  const fetch3 = nodeFetchProxy(proxy, verbose);
6480
- const client = getWorkflowClient({ apiKey, apiHost, fetch: fetch3, projectId });
6453
+ const client = new WorkflowClient2({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
6481
6454
  let source;
6482
6455
  const isPackage = isPathAPackageFile(directory);
6483
6456
  if (isPackage) {
@@ -6536,13 +6509,8 @@ import yargs25 from "yargs";
6536
6509
  // src/commands/context/commands/aggregate.ts
6537
6510
  import yargs19 from "yargs";
6538
6511
 
6539
- // src/commands/context/commands/aggregate/_util.ts
6540
- import { AggregateClient } from "@uniformdev/context/api";
6541
- var selectIdentifier8 = (source) => source.id;
6542
- var selectDisplayName8 = (source) => `${source.name} (pid: ${source.id})`;
6543
- var getAggregateClient = (options) => new AggregateClient({ ...options, bypassCache: true, limitPolicy: cliLimitPolicy });
6544
-
6545
6512
  // src/commands/context/commands/aggregate/get.ts
6513
+ import { UncachedAggregateClient } from "@uniformdev/context/api";
6546
6514
  var AggregateGetModule = {
6547
6515
  command: "get <id>",
6548
6516
  describe: "Fetch an aggregate",
@@ -6557,7 +6525,7 @@ var AggregateGetModule = {
6557
6525
  ),
6558
6526
  handler: async ({ apiHost, apiKey, proxy, id, format, project: projectId, filename }) => {
6559
6527
  const fetch3 = nodeFetchProxy(proxy);
6560
- const client = getAggregateClient({ apiKey, apiHost, fetch: fetch3, projectId });
6528
+ const client = new UncachedAggregateClient({ apiKey, apiHost, fetch: fetch3, projectId });
6561
6529
  const res = await client.get({ aggregateId: id });
6562
6530
  if (res.aggregates.length === 0) {
6563
6531
  console.error("Aggregate did not exist");
@@ -6569,6 +6537,7 @@ var AggregateGetModule = {
6569
6537
  };
6570
6538
 
6571
6539
  // src/commands/context/commands/aggregate/list.ts
6540
+ import { UncachedAggregateClient as UncachedAggregateClient2 } from "@uniformdev/context/api";
6572
6541
  var AggregateListModule = {
6573
6542
  command: "list",
6574
6543
  describe: "List aggregates",
@@ -6576,12 +6545,19 @@ var AggregateListModule = {
6576
6545
  builder: (yargs38) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs38)))),
6577
6546
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
6578
6547
  const fetch3 = nodeFetchProxy(proxy);
6579
- const client = getAggregateClient({ apiKey, apiHost, fetch: fetch3, projectId });
6548
+ const client = new UncachedAggregateClient2({ apiKey, apiHost, fetch: fetch3, projectId });
6580
6549
  const res = await client.get({});
6581
6550
  emitWithFormat(res.aggregates, format, filename);
6582
6551
  }
6583
6552
  };
6584
6553
 
6554
+ // src/commands/context/commands/aggregate/pull.ts
6555
+ import { UncachedAggregateClient as UncachedAggregateClient3 } from "@uniformdev/context/api";
6556
+
6557
+ // src/commands/context/commands/aggregate/_util.ts
6558
+ var selectIdentifier8 = (source) => source.id;
6559
+ var selectDisplayName8 = (source) => `${source.name} (pid: ${source.id})`;
6560
+
6585
6561
  // src/commands/context/aggregateEngineDataSource.ts
6586
6562
  function createAggregateEngineDataSource({
6587
6563
  client,
@@ -6676,7 +6652,7 @@ var AggregatePullModule = {
6676
6652
  verbose
6677
6653
  }) => {
6678
6654
  const fetch3 = nodeFetchProxy(proxy, verbose);
6679
- const client = getAggregateClient({ apiKey, apiHost, fetch: fetch3, projectId });
6655
+ const client = new UncachedAggregateClient3({ apiKey, apiHost, fetch: fetch3, projectId });
6680
6656
  const source = createAggregateEngineDataSource({ client });
6681
6657
  let target;
6682
6658
  const isPackage = isPathAPackageFile(directory);
@@ -6713,6 +6689,7 @@ var AggregatePullModule = {
6713
6689
  };
6714
6690
 
6715
6691
  // src/commands/context/commands/aggregate/push.ts
6692
+ import { UncachedAggregateClient as UncachedAggregateClient4 } from "@uniformdev/context/api";
6716
6693
  var AggregatePushModule = {
6717
6694
  command: "push <directory>",
6718
6695
  describe: "Pushes all aggregates from files in a directory or package to Uniform",
@@ -6749,7 +6726,7 @@ var AggregatePushModule = {
6749
6726
  verbose
6750
6727
  }) => {
6751
6728
  const fetch3 = nodeFetchProxy(proxy, verbose);
6752
- const client = getAggregateClient({ apiKey, apiHost, fetch: fetch3, projectId });
6729
+ const client = new UncachedAggregateClient4({ apiKey, apiHost, fetch: fetch3, projectId });
6753
6730
  let source;
6754
6731
  const isPackage = isPathAPackageFile(directory);
6755
6732
  if (isPackage) {
@@ -6782,6 +6759,7 @@ var AggregatePushModule = {
6782
6759
  };
6783
6760
 
6784
6761
  // src/commands/context/commands/aggregate/remove.ts
6762
+ import { UncachedAggregateClient as UncachedAggregateClient5 } from "@uniformdev/context/api";
6785
6763
  var AggregateRemoveModule = {
6786
6764
  command: "remove <id>",
6787
6765
  aliases: ["delete", "rm"],
@@ -6795,12 +6773,13 @@ var AggregateRemoveModule = {
6795
6773
  ),
6796
6774
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
6797
6775
  const fetch3 = nodeFetchProxy(proxy);
6798
- const client = getAggregateClient({ apiKey, apiHost, fetch: fetch3, projectId });
6776
+ const client = new UncachedAggregateClient5({ apiKey, apiHost, fetch: fetch3, projectId });
6799
6777
  await client.remove({ aggregateId: id });
6800
6778
  }
6801
6779
  };
6802
6780
 
6803
6781
  // src/commands/context/commands/aggregate/update.ts
6782
+ import { UncachedAggregateClient as UncachedAggregateClient6 } from "@uniformdev/context/api";
6804
6783
  var AggregateUpdateModule = {
6805
6784
  command: "update <filename>",
6806
6785
  aliases: ["put"],
@@ -6814,7 +6793,7 @@ var AggregateUpdateModule = {
6814
6793
  ),
6815
6794
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
6816
6795
  const fetch3 = nodeFetchProxy(proxy);
6817
- const client = getAggregateClient({ apiKey, apiHost, fetch: fetch3, projectId });
6796
+ const client = new UncachedAggregateClient6({ apiKey, apiHost, fetch: fetch3, projectId });
6818
6797
  const file = readFileToObject(filename);
6819
6798
  await client.upsert({ aggregate: file });
6820
6799
  }
@@ -6834,15 +6813,8 @@ var AggregateModule = {
6834
6813
  // src/commands/context/commands/enrichment.ts
6835
6814
  import yargs20 from "yargs";
6836
6815
 
6837
- // src/commands/context/commands/enrichment/_util.ts
6838
- import { UncachedEnrichmentClient } from "@uniformdev/context/api";
6839
- var selectIdentifier9 = (source) => source.id;
6840
- var selectDisplayName9 = (source) => `${source.name} (pid: ${source.id})`;
6841
- function getEnrichmentClient(options) {
6842
- return new UncachedEnrichmentClient({ ...options, limitPolicy: cliLimitPolicy });
6843
- }
6844
-
6845
6816
  // src/commands/context/commands/enrichment/get.ts
6817
+ import { UncachedEnrichmentClient } from "@uniformdev/context/api";
6846
6818
  var EnrichmentGetModule = {
6847
6819
  command: "get <id>",
6848
6820
  describe: "Fetch an enrichment category and its values",
@@ -6857,7 +6829,7 @@ var EnrichmentGetModule = {
6857
6829
  ),
6858
6830
  handler: async ({ apiHost, apiKey, proxy, id, format, project: projectId, filename }) => {
6859
6831
  const fetch3 = nodeFetchProxy(proxy);
6860
- const client = getEnrichmentClient({ apiKey, apiHost, fetch: fetch3, projectId });
6832
+ const client = new UncachedEnrichmentClient({ apiKey, apiHost, fetch: fetch3, projectId });
6861
6833
  const res = (await client.get())?.enrichments?.filter((enr) => enr.id === id);
6862
6834
  if (res.length === 0) {
6863
6835
  console.error("Enrichment did not exist");
@@ -6869,6 +6841,7 @@ var EnrichmentGetModule = {
6869
6841
  };
6870
6842
 
6871
6843
  // src/commands/context/commands/enrichment/list.ts
6844
+ import { UncachedEnrichmentClient as UncachedEnrichmentClient2 } from "@uniformdev/context/api";
6872
6845
  var EnrichmentListModule = {
6873
6846
  command: "list",
6874
6847
  describe: "List enrichments",
@@ -6876,12 +6849,19 @@ var EnrichmentListModule = {
6876
6849
  builder: (yargs38) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs38)))),
6877
6850
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
6878
6851
  const fetch3 = nodeFetchProxy(proxy);
6879
- const client = getEnrichmentClient({ apiKey, apiHost, fetch: fetch3, projectId });
6852
+ const client = new UncachedEnrichmentClient2({ apiKey, apiHost, fetch: fetch3, projectId });
6880
6853
  const res = await client.get();
6881
6854
  emitWithFormat(res.enrichments, format, filename);
6882
6855
  }
6883
6856
  };
6884
6857
 
6858
+ // src/commands/context/commands/enrichment/pull.ts
6859
+ import { UncachedEnrichmentClient as UncachedEnrichmentClient3 } from "@uniformdev/context/api";
6860
+
6861
+ // src/commands/context/commands/enrichment/_util.ts
6862
+ var selectIdentifier9 = (source) => source.id;
6863
+ var selectDisplayName9 = (source) => `${source.name} (pid: ${source.id})`;
6864
+
6885
6865
  // src/commands/context/enrichmentEngineDataSource.ts
6886
6866
  function createEnrichmentEngineDataSource({
6887
6867
  client
@@ -7008,7 +6988,7 @@ var EnrichmentPullModule = {
7008
6988
  verbose
7009
6989
  }) => {
7010
6990
  const fetch3 = nodeFetchProxy(proxy, verbose);
7011
- const client = getEnrichmentClient({ apiKey, apiHost, fetch: fetch3, projectId });
6991
+ const client = new UncachedEnrichmentClient3({ apiKey, apiHost, fetch: fetch3, projectId });
7012
6992
  const source = createEnrichmentEngineDataSource({ client });
7013
6993
  let target;
7014
6994
  const isPackage = isPathAPackageFile(directory);
@@ -7045,6 +7025,7 @@ var EnrichmentPullModule = {
7045
7025
  };
7046
7026
 
7047
7027
  // src/commands/context/commands/enrichment/push.ts
7028
+ import { UncachedEnrichmentClient as UncachedEnrichmentClient4 } from "@uniformdev/context/api";
7048
7029
  var EnrichmentPushModule = {
7049
7030
  command: "push <directory>",
7050
7031
  describe: "Pushes all enrichments from files in a directory or package to Uniform",
@@ -7079,7 +7060,7 @@ var EnrichmentPushModule = {
7079
7060
  verbose
7080
7061
  }) => {
7081
7062
  const fetch3 = nodeFetchProxy(proxy, verbose);
7082
- const client = getEnrichmentClient({ apiKey, apiHost, fetch: fetch3, projectId });
7063
+ const client = new UncachedEnrichmentClient4({ apiKey, apiHost, fetch: fetch3, projectId });
7083
7064
  let source;
7084
7065
  const isPackage = isPathAPackageFile(directory);
7085
7066
  if (isPackage) {
@@ -7111,6 +7092,7 @@ var EnrichmentPushModule = {
7111
7092
  };
7112
7093
 
7113
7094
  // src/commands/context/commands/enrichment/remove.ts
7095
+ import { UncachedEnrichmentClient as UncachedEnrichmentClient5 } from "@uniformdev/context/api";
7114
7096
  var EnrichmentRemoveModule = {
7115
7097
  command: "remove <id>",
7116
7098
  aliases: ["delete", "rm"],
@@ -7124,7 +7106,7 @@ var EnrichmentRemoveModule = {
7124
7106
  ),
7125
7107
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
7126
7108
  const fetch3 = nodeFetchProxy(proxy);
7127
- const client = getEnrichmentClient({ apiKey, apiHost, fetch: fetch3, projectId });
7109
+ const client = new UncachedEnrichmentClient5({ apiKey, apiHost, fetch: fetch3, projectId });
7128
7110
  await client.removeCategory({ enrichmentId: id });
7129
7111
  }
7130
7112
  };
@@ -8138,13 +8120,13 @@ import yargs26 from "yargs";
8138
8120
  import { readFileSync } from "fs";
8139
8121
 
8140
8122
  // src/commands/integration/commands/definition/edgehancer/EdgehancerClient.ts
8141
- import { createLimitPolicy as createLimitPolicy2 } from "@uniformdev/canvas";
8123
+ import { createLimitPolicy } from "@uniformdev/canvas";
8142
8124
  import { ApiClient } from "@uniformdev/context/api";
8143
8125
  var ENDPOINT = "/api/v1/integration-edgehancers";
8144
8126
  var EdgehancerClient = class extends ApiClient {
8145
8127
  constructor(options) {
8146
8128
  if (!options.limitPolicy) {
8147
- options.limitPolicy = createLimitPolicy2({});
8129
+ options.limitPolicy = createLimitPolicy({});
8148
8130
  }
8149
8131
  super(options);
8150
8132
  this.options = options;
@@ -8234,13 +8216,13 @@ var IntegrationEdgehancerModule = {
8234
8216
  };
8235
8217
 
8236
8218
  // src/commands/integration/commands/definition/DefinitionClient.ts
8237
- import { createLimitPolicy as createLimitPolicy3 } from "@uniformdev/canvas";
8219
+ import { createLimitPolicy as createLimitPolicy2 } from "@uniformdev/canvas";
8238
8220
  import { ApiClient as ApiClient2 } from "@uniformdev/context/api";
8239
8221
  var ENDPOINT2 = "/api/v1/integration-definitions";
8240
8222
  var DefinitionClient = class extends ApiClient2 {
8241
8223
  constructor(options) {
8242
8224
  if (!options.limitPolicy) {
8243
- options.limitPolicy = createLimitPolicy3({});
8225
+ options.limitPolicy = createLimitPolicy2({});
8244
8226
  }
8245
8227
  super(options);
8246
8228
  this.options = options;
@@ -8319,13 +8301,13 @@ var IntegrationDefinitionModule = {
8319
8301
  };
8320
8302
 
8321
8303
  // src/commands/integration/commands/InstallClient.ts
8322
- import { createLimitPolicy as createLimitPolicy4 } from "@uniformdev/canvas";
8304
+ import { createLimitPolicy as createLimitPolicy3 } from "@uniformdev/canvas";
8323
8305
  import { ApiClient as ApiClient3 } from "@uniformdev/context/api";
8324
8306
  var ENDPOINT3 = "/api/v1/integration-installations";
8325
8307
  var InstallClient = class extends ApiClient3 {
8326
8308
  constructor(options) {
8327
8309
  if (!options.limitPolicy) {
8328
- options.limitPolicy = createLimitPolicy4({});
8310
+ options.limitPolicy = createLimitPolicy3({});
8329
8311
  }
8330
8312
  super(options);
8331
8313
  this.options = options;
@@ -8367,10 +8349,10 @@ var IntegrationInstallModule = {
8367
8349
  )
8368
8350
  )
8369
8351
  ),
8370
- handler: async ({ apiHost, apiKey, proxy, type, configuration, project: projectId }) => {
8352
+ handler: async ({ apiHost, apiKey, proxy, type, configuration: configuration2, project: projectId }) => {
8371
8353
  const fetch3 = nodeFetchProxy(proxy);
8372
8354
  const client = new InstallClient({ apiKey, apiHost, fetch: fetch3, projectId });
8373
- const data = configuration ? JSON.parse(configuration) : void 0;
8355
+ const data = configuration2 ? JSON.parse(configuration2) : void 0;
8374
8356
  await client.install({ data, type });
8375
8357
  }
8376
8358
  };
@@ -8430,7 +8412,7 @@ import { PostHog } from "posthog-node";
8430
8412
  // package.json
8431
8413
  var package_default = {
8432
8414
  name: "@uniformdev/cli",
8433
- version: "19.210.0",
8415
+ version: "19.210.2",
8434
8416
  description: "Uniform command line interface tool",
8435
8417
  license: "SEE LICENSE IN LICENSE.txt",
8436
8418
  main: "./cli.js",
@@ -8479,7 +8461,7 @@ var package_default = {
8479
8461
  "isomorphic-git": "1.25.2",
8480
8462
  "js-yaml": "^4.1.0",
8481
8463
  jsonwebtoken: "9.0.2",
8482
- mitt: "^3.0.1",
8464
+ "lodash.isequalwith": "^4.4.0",
8483
8465
  open: "10.1.0",
8484
8466
  ora: "8.0.1",
8485
8467
  "p-queue": "7.3.4",
@@ -8496,6 +8478,7 @@ var package_default = {
8496
8478
  "@types/inquirer": "9.0.7",
8497
8479
  "@types/js-yaml": "4.0.9",
8498
8480
  "@types/jsonwebtoken": "9.0.5",
8481
+ "@types/lodash.isequalwith": "4.4.9",
8499
8482
  "@types/node": "22.7.8",
8500
8483
  "@types/yargs": "17.0.32"
8501
8484
  },
@@ -9591,15 +9574,8 @@ import yargs33 from "yargs";
9591
9574
  // src/commands/project-map/commands/projectMapDefinition.ts
9592
9575
  import yargs31 from "yargs";
9593
9576
 
9594
- // src/commands/project-map/commands/ProjectMapDefinition/_util.ts
9595
- import { UncachedProjectMapClient } from "@uniformdev/project-map";
9596
- var selectIdentifier13 = (source) => source.id;
9597
- var selectDisplayName13 = (source) => `${source.name} (pid: ${source.id})`;
9598
- function getProjectMapClient(options) {
9599
- return new UncachedProjectMapClient({ ...options, limitPolicy: cliLimitPolicy });
9600
- }
9601
-
9602
9577
  // src/commands/project-map/commands/ProjectMapDefinition/get.ts
9578
+ import { UncachedProjectMapClient } from "@uniformdev/project-map";
9603
9579
  var ProjectMapDefinitionGetModule = {
9604
9580
  command: "get <id>",
9605
9581
  describe: "Fetch a project map",
@@ -9614,7 +9590,7 @@ var ProjectMapDefinitionGetModule = {
9614
9590
  ),
9615
9591
  handler: async ({ apiHost, apiKey, proxy, id, format, project: projectId, filename }) => {
9616
9592
  const fetch3 = nodeFetchProxy(proxy);
9617
- const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch3, projectId });
9593
+ const client = new UncachedProjectMapClient({ apiKey, apiHost, fetch: fetch3, projectId });
9618
9594
  const res = await client.getProjectMapDefinition({ projectMapId: id });
9619
9595
  if (res.projectMaps.length === 0) {
9620
9596
  console.error("ProjectMap does not exist");
@@ -9626,6 +9602,7 @@ var ProjectMapDefinitionGetModule = {
9626
9602
  };
9627
9603
 
9628
9604
  // src/commands/project-map/commands/ProjectMapDefinition/list.ts
9605
+ import { UncachedProjectMapClient as UncachedProjectMapClient2 } from "@uniformdev/project-map";
9629
9606
  var ProjectMapDefinitionListModule = {
9630
9607
  command: "list",
9631
9608
  describe: "List of project maps",
@@ -9633,12 +9610,15 @@ var ProjectMapDefinitionListModule = {
9633
9610
  builder: (yargs38) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs38)))),
9634
9611
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
9635
9612
  const fetch3 = nodeFetchProxy(proxy);
9636
- const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch3, projectId });
9613
+ const client = new UncachedProjectMapClient2({ apiKey, apiHost, fetch: fetch3, projectId });
9637
9614
  const res = await client.getProjectMapDefinitions();
9638
9615
  emitWithFormat(res.projectMaps, format, filename);
9639
9616
  }
9640
9617
  };
9641
9618
 
9619
+ // src/commands/project-map/commands/ProjectMapDefinition/pull.ts
9620
+ import { UncachedProjectMapClient as UncachedProjectMapClient3 } from "@uniformdev/project-map";
9621
+
9642
9622
  // src/commands/project-map/package.ts
9643
9623
  function readContextPackage2(filename, assertExists, verbose) {
9644
9624
  if (verbose) {
@@ -9650,6 +9630,10 @@ function writeContextPackage2(filename, packageContents) {
9650
9630
  writeUniformPackage(filename, packageContents);
9651
9631
  }
9652
9632
 
9633
+ // src/commands/project-map/commands/ProjectMapDefinition/_util.ts
9634
+ var selectIdentifier13 = (source) => source.id;
9635
+ var selectDisplayName13 = (source) => `${source.name} (pid: ${source.id})`;
9636
+
9653
9637
  // src/commands/project-map/ProjectMapDefinitionEngineDataSource.ts
9654
9638
  function createProjectMapDefinitionEngineDataSource({
9655
9639
  client
@@ -9724,7 +9708,7 @@ var ProjectMapDefinitionPullModule = {
9724
9708
  verbose
9725
9709
  }) => {
9726
9710
  const fetch3 = nodeFetchProxy(proxy, verbose);
9727
- const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch3, projectId });
9711
+ const client = new UncachedProjectMapClient3({ apiKey, apiHost, fetch: fetch3, projectId });
9728
9712
  const source = createProjectMapDefinitionEngineDataSource({ client });
9729
9713
  let target;
9730
9714
  const isPackage = isPathAPackageFile(directory);
@@ -9761,6 +9745,7 @@ var ProjectMapDefinitionPullModule = {
9761
9745
  };
9762
9746
 
9763
9747
  // src/commands/project-map/commands/ProjectMapDefinition/push.ts
9748
+ import { UncachedProjectMapClient as UncachedProjectMapClient4 } from "@uniformdev/project-map";
9764
9749
  var ProjectMapDefinitionPushModule = {
9765
9750
  command: "push <directory>",
9766
9751
  describe: "Pushes all project maps from files in a directory or package to Uniform",
@@ -9797,7 +9782,7 @@ var ProjectMapDefinitionPushModule = {
9797
9782
  verbose
9798
9783
  }) => {
9799
9784
  const fetch3 = nodeFetchProxy(proxy, verbose);
9800
- const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch3, projectId });
9785
+ const client = new UncachedProjectMapClient4({ apiKey, apiHost, fetch: fetch3, projectId });
9801
9786
  let source;
9802
9787
  const isPackage = isPathAPackageFile(directory);
9803
9788
  if (isPackage) {
@@ -9829,6 +9814,7 @@ var ProjectMapDefinitionPushModule = {
9829
9814
  };
9830
9815
 
9831
9816
  // src/commands/project-map/commands/ProjectMapDefinition/remove.ts
9817
+ import { UncachedProjectMapClient as UncachedProjectMapClient5 } from "@uniformdev/project-map";
9832
9818
  var ProjectMapDefinitionRemoveModule = {
9833
9819
  command: "remove <id>",
9834
9820
  aliases: ["delete", "rm"],
@@ -9840,12 +9826,13 @@ var ProjectMapDefinitionRemoveModule = {
9840
9826
  ),
9841
9827
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
9842
9828
  const fetch3 = nodeFetchProxy(proxy);
9843
- const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch3, projectId });
9829
+ const client = new UncachedProjectMapClient5({ apiKey, apiHost, fetch: fetch3, projectId });
9844
9830
  await client.deleteProjectMap({ projectMapId: id });
9845
9831
  }
9846
9832
  };
9847
9833
 
9848
9834
  // src/commands/project-map/commands/ProjectMapDefinition/update.ts
9835
+ import { UncachedProjectMapClient as UncachedProjectMapClient6 } from "@uniformdev/project-map";
9849
9836
  var ProjectMapDefinitionUpdateModule = {
9850
9837
  command: "update <filename>",
9851
9838
  aliases: ["put"],
@@ -9859,7 +9846,7 @@ var ProjectMapDefinitionUpdateModule = {
9859
9846
  ),
9860
9847
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
9861
9848
  const fetch3 = nodeFetchProxy(proxy);
9862
- const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch3, projectId });
9849
+ const client = new UncachedProjectMapClient6({ apiKey, apiHost, fetch: fetch3, projectId });
9863
9850
  const file = readFileToObject(filename);
9864
9851
  await client.upsertProjectMap({ projectMap: file });
9865
9852
  }
@@ -9879,6 +9866,7 @@ var ProjectMapDefinitionModule = {
9879
9866
  import yargs32 from "yargs";
9880
9867
 
9881
9868
  // src/commands/project-map/commands/ProjectMapNode/get.ts
9869
+ import { UncachedProjectMapClient as UncachedProjectMapClient7 } from "@uniformdev/project-map";
9882
9870
  var ProjectMapNodeGetModule = {
9883
9871
  command: "get <id> <projectMapId>",
9884
9872
  describe: "Fetch a project map node",
@@ -9893,7 +9881,7 @@ var ProjectMapNodeGetModule = {
9893
9881
  ),
9894
9882
  handler: async ({ apiHost, apiKey, proxy, id, projectMapId, format, project: projectId, filename }) => {
9895
9883
  const fetch3 = nodeFetchProxy(proxy);
9896
- const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch3, projectId });
9884
+ const client = new UncachedProjectMapClient7({ apiKey, apiHost, fetch: fetch3, projectId });
9897
9885
  console.log("Debugging params for node get", { projectMapId, id, projectId });
9898
9886
  const res = await client.getNodes({ projectMapId, id });
9899
9887
  if (res.nodes?.length === 0) {
@@ -9906,6 +9894,7 @@ var ProjectMapNodeGetModule = {
9906
9894
  };
9907
9895
 
9908
9896
  // src/commands/project-map/commands/ProjectMapNode/list.ts
9897
+ import { UncachedProjectMapClient as UncachedProjectMapClient8 } from "@uniformdev/project-map";
9909
9898
  var ProjectMapNodeListModule = {
9910
9899
  command: "list <projectMapId>",
9911
9900
  describe: "List project map nodes",
@@ -9926,12 +9915,15 @@ var ProjectMapNodeListModule = {
9926
9915
  ),
9927
9916
  handler: async ({ apiHost, apiKey, proxy, projectMapId, format, filename, project: projectId, state }) => {
9928
9917
  const fetch3 = nodeFetchProxy(proxy);
9929
- const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch3, projectId });
9918
+ const client = new UncachedProjectMapClient8({ apiKey, apiHost, fetch: fetch3, projectId });
9930
9919
  const res = await client.getNodes({ projectMapId, state: convertStateOption(state) });
9931
9920
  emitWithFormat({ nodes: res.nodes ?? [], projectMapId }, format, filename);
9932
9921
  }
9933
9922
  };
9934
9923
 
9924
+ // src/commands/project-map/commands/ProjectMapNode/pull.ts
9925
+ import { UncachedProjectMapClient as UncachedProjectMapClient9 } from "@uniformdev/project-map";
9926
+
9935
9927
  // src/commands/project-map/commands/ProjectMapNode/_util.ts
9936
9928
  var selectIdentifier14 = (source, projectId) => [
9937
9929
  projectId + source.projectMapId + source.id,
@@ -10025,7 +10017,7 @@ var ProjectMapNodePullModule = {
10025
10017
  verbose
10026
10018
  }) => {
10027
10019
  const fetch3 = nodeFetchProxy(proxy, verbose);
10028
- const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch3, projectId });
10020
+ const client = new UncachedProjectMapClient9({ apiKey, apiHost, fetch: fetch3, projectId });
10029
10021
  const source = createProjectMapNodeEngineDataSource({ client, projectId });
10030
10022
  let target;
10031
10023
  const isPackage = isPathAPackageFile(directory);
@@ -10067,7 +10059,8 @@ var ProjectMapNodePullModule = {
10067
10059
 
10068
10060
  // src/commands/project-map/commands/ProjectMapNode/push.ts
10069
10061
  import {
10070
- __INTERNAL_MISSING_PARENT_NODE_ERROR
10062
+ __INTERNAL_MISSING_PARENT_NODE_ERROR,
10063
+ UncachedProjectMapClient as UncachedProjectMapClient10
10071
10064
  } from "@uniformdev/project-map";
10072
10065
  var ProjectMapNodePushModule = {
10073
10066
  command: "push <directory>",
@@ -10105,7 +10098,7 @@ var ProjectMapNodePushModule = {
10105
10098
  verbose
10106
10099
  }) => {
10107
10100
  const fetch3 = nodeFetchProxy(proxy, verbose);
10108
- const client = getProjectMapClient({
10101
+ const client = new UncachedProjectMapClient10({
10109
10102
  apiKey,
10110
10103
  apiHost,
10111
10104
  fetch: fetch3,
@@ -10175,6 +10168,7 @@ var ProjectMapNodePushModule = {
10175
10168
  };
10176
10169
 
10177
10170
  // src/commands/project-map/commands/ProjectMapNode/remove.ts
10171
+ import { UncachedProjectMapClient as UncachedProjectMapClient11 } from "@uniformdev/project-map";
10178
10172
  var ProjectMapNodeRemoveModule = {
10179
10173
  command: "remove <id> <projectMapId>",
10180
10174
  aliases: ["delete", "rm"],
@@ -10188,12 +10182,13 @@ var ProjectMapNodeRemoveModule = {
10188
10182
  ),
10189
10183
  handler: async ({ apiHost, apiKey, proxy, projectMapId, id, project: projectId }) => {
10190
10184
  const fetch3 = nodeFetchProxy(proxy);
10191
- const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch3, projectId });
10185
+ const client = new UncachedProjectMapClient11({ apiKey, apiHost, fetch: fetch3, projectId });
10192
10186
  await client.deleteProjectMapNode({ projectMapId, nodeId: id });
10193
10187
  }
10194
10188
  };
10195
10189
 
10196
10190
  // src/commands/project-map/commands/ProjectMapNode/update.ts
10191
+ import { UncachedProjectMapClient as UncachedProjectMapClient12 } from "@uniformdev/project-map";
10197
10192
  var ProjectMapNodeUpdateModule = {
10198
10193
  command: "update <filename> <projectMapId>",
10199
10194
  aliases: ["put"],
@@ -10207,7 +10202,7 @@ var ProjectMapNodeUpdateModule = {
10207
10202
  ),
10208
10203
  handler: async ({ apiHost, apiKey, proxy, projectMapId, filename, project: projectId }) => {
10209
10204
  const fetch3 = nodeFetchProxy(proxy);
10210
- const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch3, projectId });
10205
+ const client = new UncachedProjectMapClient12({ apiKey, apiHost, fetch: fetch3, projectId });
10211
10206
  const file = readFileToObject(filename);
10212
10207
  await client.upsertProjectMapNodes({ nodes: [{ node: file }], projectMapId });
10213
10208
  }
@@ -10240,26 +10235,8 @@ import yargs35 from "yargs";
10240
10235
  // src/commands/redirect/commands/redirect.ts
10241
10236
  import yargs34 from "yargs";
10242
10237
 
10243
- // src/commands/redirect/commands/RedirectDefinition/_util.ts
10244
- import { UncachedRedirectClient } from "@uniformdev/redirect";
10245
- var selectIdentifier15 = (source) => source.id;
10246
- var selectFilename2 = (source) => {
10247
- const index = source.sourceUrl.lastIndexOf("/");
10248
- return cleanFileName(source.sourceUrl.substring(index + 1)) + `_${source.id}`;
10249
- };
10250
- var selectDisplayName15 = (source) => {
10251
- let pathName = source.sourceUrl;
10252
- if (pathName.length > 30) {
10253
- const slashIndex = source.sourceUrl.indexOf("/", source.sourceUrl.length - 30);
10254
- pathName = "..." + pathName.substring(slashIndex);
10255
- }
10256
- return `${pathName} (id: ${source.id})`;
10257
- };
10258
- function getRedirectClient(options) {
10259
- return new UncachedRedirectClient({ ...options, limitPolicy: cliLimitPolicy });
10260
- }
10261
-
10262
10238
  // src/commands/redirect/commands/RedirectDefinition/get.ts
10239
+ import { UncachedRedirectClient } from "@uniformdev/redirect";
10263
10240
  var RedirectDefinitionGetModule = {
10264
10241
  command: "get <id>",
10265
10242
  describe: "Fetch a redirect",
@@ -10274,7 +10251,7 @@ var RedirectDefinitionGetModule = {
10274
10251
  ),
10275
10252
  handler: async ({ apiHost, apiKey, proxy, id, format, project: projectId, filename }) => {
10276
10253
  const fetch3 = nodeFetchProxy(proxy);
10277
- const client = getRedirectClient({ apiKey, apiHost, fetch: fetch3, projectId });
10254
+ const client = new UncachedRedirectClient({ apiKey, apiHost, fetch: fetch3, projectId });
10278
10255
  const res = await client.getRedirect({ id });
10279
10256
  if (!res) {
10280
10257
  console.error("Redirect does not exist");
@@ -10286,6 +10263,7 @@ var RedirectDefinitionGetModule = {
10286
10263
  };
10287
10264
 
10288
10265
  // src/commands/redirect/commands/RedirectDefinition/list.ts
10266
+ import { UncachedRedirectClient as UncachedRedirectClient2 } from "@uniformdev/redirect";
10289
10267
  var RedirectDefinitionListModule = {
10290
10268
  command: "list",
10291
10269
  describe: "List of redirects",
@@ -10293,12 +10271,15 @@ var RedirectDefinitionListModule = {
10293
10271
  builder: (yargs38) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs38)))),
10294
10272
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
10295
10273
  const fetch3 = nodeFetchProxy(proxy);
10296
- const client = getRedirectClient({ apiKey, apiHost, fetch: fetch3, projectId });
10274
+ const client = new UncachedRedirectClient2({ apiKey, apiHost, fetch: fetch3, projectId });
10297
10275
  const res = await client.getRedirects({});
10298
10276
  emitWithFormat(res, format, filename);
10299
10277
  }
10300
10278
  };
10301
10279
 
10280
+ // src/commands/redirect/commands/RedirectDefinition/pull.ts
10281
+ import { UncachedRedirectClient as UncachedRedirectClient3 } from "@uniformdev/redirect";
10282
+
10302
10283
  // src/commands/redirect/package.ts
10303
10284
  function readContextPackage3(filename, assertExists, verbose) {
10304
10285
  if (verbose) {
@@ -10310,6 +10291,21 @@ function writeContextPackage3(filename, packageContents) {
10310
10291
  writeUniformPackage(filename, packageContents);
10311
10292
  }
10312
10293
 
10294
+ // src/commands/redirect/commands/RedirectDefinition/_util.ts
10295
+ var selectIdentifier15 = (source) => source.id;
10296
+ var selectFilename2 = (source) => {
10297
+ const index = source.sourceUrl.lastIndexOf("/");
10298
+ return cleanFileName(source.sourceUrl.substring(index + 1)) + `_${source.id}`;
10299
+ };
10300
+ var selectDisplayName15 = (source) => {
10301
+ let pathName = source.sourceUrl;
10302
+ if (pathName.length > 30) {
10303
+ const slashIndex = source.sourceUrl.indexOf("/", source.sourceUrl.length - 30);
10304
+ pathName = "..." + pathName.substring(slashIndex);
10305
+ }
10306
+ return `${pathName} (id: ${source.id})`;
10307
+ };
10308
+
10313
10309
  // src/commands/redirect/RedirectEngineDataSource.ts
10314
10310
  function createRedirectDefinitionEngineDataSource({
10315
10311
  client
@@ -10382,7 +10378,7 @@ var RedirectDefinitionPullModule = {
10382
10378
  verbose
10383
10379
  }) => {
10384
10380
  const fetch3 = nodeFetchProxy(proxy, verbose);
10385
- const client = getRedirectClient({ apiKey, apiHost, fetch: fetch3, projectId });
10381
+ const client = new UncachedRedirectClient3({ apiKey, apiHost, fetch: fetch3, projectId });
10386
10382
  const source = createRedirectDefinitionEngineDataSource({ client });
10387
10383
  let target;
10388
10384
  const isPackage = isPathAPackageFile(directory);
@@ -10420,6 +10416,7 @@ var RedirectDefinitionPullModule = {
10420
10416
  };
10421
10417
 
10422
10418
  // src/commands/redirect/commands/RedirectDefinition/push.ts
10419
+ import { UncachedRedirectClient as UncachedRedirectClient4 } from "@uniformdev/redirect";
10423
10420
  var RedirectDefinitionPushModule = {
10424
10421
  command: "push <directory>",
10425
10422
  describe: "Pushes all redirects from files in a directory or package to Uniform",
@@ -10456,7 +10453,7 @@ var RedirectDefinitionPushModule = {
10456
10453
  verbose
10457
10454
  }) => {
10458
10455
  const fetch3 = nodeFetchProxy(proxy, verbose);
10459
- const client = getRedirectClient({ apiKey, apiHost, fetch: fetch3, projectId });
10456
+ const client = new UncachedRedirectClient4({ apiKey, apiHost, fetch: fetch3, projectId });
10460
10457
  let source;
10461
10458
  const isPackage = isPathAPackageFile(directory);
10462
10459
  if (isPackage) {
@@ -10488,6 +10485,7 @@ var RedirectDefinitionPushModule = {
10488
10485
  };
10489
10486
 
10490
10487
  // src/commands/redirect/commands/RedirectDefinition/remove.ts
10488
+ import { UncachedRedirectClient as UncachedRedirectClient5 } from "@uniformdev/redirect";
10491
10489
  var RedirectDefinitionRemoveModule = {
10492
10490
  command: "remove <id>",
10493
10491
  aliases: ["delete", "rm"],
@@ -10499,12 +10497,13 @@ var RedirectDefinitionRemoveModule = {
10499
10497
  ),
10500
10498
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
10501
10499
  const fetch3 = nodeFetchProxy(proxy);
10502
- const client = getRedirectClient({ apiKey, apiHost, fetch: fetch3, projectId });
10500
+ const client = new UncachedRedirectClient5({ apiKey, apiHost, fetch: fetch3, projectId });
10503
10501
  await client.deleteRedirect(id);
10504
10502
  }
10505
10503
  };
10506
10504
 
10507
10505
  // src/commands/redirect/commands/RedirectDefinition/update.ts
10506
+ import { UncachedRedirectClient as UncachedRedirectClient6 } from "@uniformdev/redirect";
10508
10507
  var RedirectDefinitionUpdateModule = {
10509
10508
  command: "update <filename>",
10510
10509
  aliases: ["put"],
@@ -10518,7 +10517,7 @@ var RedirectDefinitionUpdateModule = {
10518
10517
  ),
10519
10518
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
10520
10519
  const fetch3 = nodeFetchProxy(proxy);
10521
- const client = getRedirectClient({ apiKey, apiHost, fetch: fetch3, projectId });
10520
+ const client = new UncachedRedirectClient6({ apiKey, apiHost, fetch: fetch3, projectId });
10522
10521
  const file = readFileToObject(filename);
10523
10522
  await client.upsertRedirect(file);
10524
10523
  }
@@ -10554,53 +10553,28 @@ async function spinPromise(action, options) {
10554
10553
  const { successText, failText } = typeof options === "object" ? options : { successText: void 0, failText: void 0 };
10555
10554
  const spinner = ora2(options).start();
10556
10555
  const consoleReplay = [];
10557
- const revertLog = patchConsole({
10558
- fn: "log",
10559
- ora: spinner,
10560
- replay: consoleReplay,
10561
- defaultText: options.text
10562
- });
10563
- const revertError = patchConsole({
10564
- fn: "error",
10565
- ora: spinner,
10566
- replay: consoleReplay,
10567
- defaultText: options.text
10568
- });
10569
- const revertWarning = patchConsole({
10570
- fn: "warn",
10571
- ora: spinner,
10572
- replay: consoleReplay,
10573
- defaultText: options.text
10574
- });
10556
+ const revertLog = patchConsole("log", spinner, consoleReplay);
10557
+ const revertError = patchConsole("error", spinner, consoleReplay);
10558
+ const revertWarning = patchConsole("warn", spinner, consoleReplay);
10575
10559
  const unpatchConsole = () => {
10576
10560
  revertLog();
10577
10561
  revertError();
10578
10562
  revertWarning();
10579
10563
  };
10580
10564
  let thrownError = void 0;
10581
- const executeReplay = () => {
10582
- unpatchConsole();
10583
- replayConsole(consoleReplay);
10584
- };
10585
- const executeReplayOnSigint = () => {
10586
- executeReplay();
10587
- process.exit(1);
10588
- };
10589
- process.on("SIGINT", executeReplayOnSigint);
10590
10565
  try {
10591
10566
  const result = await action;
10592
- const finalStatusText = spinner.text.startsWith(options.text) && spinner.text.length > options.text.length ? spinner.text.slice(options.text.length).trim() : `\u2699\uFE0F compared: ${numPad(0)} changes: 0`;
10593
- const padding = " ".repeat(Math.max(4, 40 - successText.length));
10594
- spinner.succeed(successText + padding + finalStatusText);
10567
+ spinner.succeed(successText);
10595
10568
  return result;
10596
10569
  } catch (error) {
10597
- executeReplay();
10598
- spinner.fail(failText?.(error));
10570
+ const indexOfConsoleMessages = spinner.text.indexOf("\n");
10571
+ const capturedConsole = indexOfConsoleMessages > -1 ? spinner.text.slice(0, indexOfConsoleMessages) : "";
10572
+ spinner.fail(failText === void 0 ? void 0 : failText(error, capturedConsole));
10599
10573
  thrownError = error;
10600
10574
  } finally {
10601
- process.off("SIGINT", executeReplayOnSigint);
10575
+ unpatchConsole();
10602
10576
  if (!thrownError) {
10603
- executeReplay();
10577
+ replayConsole(consoleReplay);
10604
10578
  }
10605
10579
  }
10606
10580
  if (thrownError) {
@@ -10612,51 +10586,20 @@ function replayConsole(replay) {
10612
10586
  console[fn](...args);
10613
10587
  }
10614
10588
  }
10615
- function patchConsole({
10616
- fn,
10617
- ora: ora3,
10618
- replay = [],
10619
- defaultText
10620
- }) {
10589
+ function patchConsole(fn, ora3, replay = []) {
10621
10590
  const original = console[fn];
10622
- const handleSyncStatusUpdate = ({
10623
- compared,
10624
- changeCount,
10625
- changesApplied,
10626
- fetched
10627
- }) => {
10628
- if (compared === 0 && fetched === 0) {
10629
- return;
10630
- }
10631
- const clauses = [];
10632
- if (fetched > 0 && compared === 0) {
10633
- clauses.push(`fetching: ${numPad(fetched)}`);
10634
- }
10635
- if (compared > 0) {
10636
- clauses.push(`compared: ${numPad(compared)}`);
10637
- }
10638
- if (changesApplied === 0) {
10639
- clauses.push(`changes: ${changeCount}`);
10591
+ console[fn] = (...text) => {
10592
+ if (text.length === 1 && typeof text[0] === "string") {
10593
+ ora3.text += "\n" + text;
10640
10594
  } else {
10641
- clauses.push(`applied: ${changesApplied}/${changeCount}`);
10595
+ original(...text);
10642
10596
  }
10643
- const statusText = clauses.join(" ");
10644
- const padding = " ".repeat(Math.max(4, 40 - defaultText.length));
10645
- ora3.text = `${defaultText}${padding}\u2699\uFE0F ${statusText}`;
10646
- };
10647
- syncEngineEvents.on("statusUpdate", handleSyncStatusUpdate);
10648
- console[fn] = (...text) => {
10649
10597
  replay.push({ fn, args: text });
10650
10598
  };
10651
10599
  return () => {
10652
10600
  console[fn] = original;
10653
- syncEngineEvents.off("statusUpdate", handleSyncStatusUpdate);
10654
10601
  };
10655
10602
  }
10656
- function numPad(num, spaces = 6) {
10657
- const numbah = num.toString(10);
10658
- return numbah + " ".repeat(Math.max(0, spaces - numbah.length));
10659
- }
10660
10603
 
10661
10604
  // src/commands/sync/commands/pull.ts
10662
10605
  var SyncPullModule = {
@@ -10825,102 +10768,19 @@ var SyncPushModule = {
10825
10768
  }
10826
10769
  }
10827
10770
  if (config2.entitiesConfig?.componentPattern && config2.entitiesConfig?.componentPattern?.push?.disabled !== true && config2.entitiesConfig?.componentPattern?.publish) {
10828
- try {
10829
- await spinPromise(
10830
- ComponentPatternPublishModule.handler({
10831
- ...otherParams,
10832
- patternType: "component",
10833
- onlyPatterns: true,
10834
- all: true
10835
- }),
10836
- {
10837
- text: "publishing component patterns...",
10838
- successText: "published component patterns",
10839
- failText(error) {
10840
- return `publishing component patterns
10841
-
10842
- ${error.stack ?? error.message}`;
10843
- }
10844
- }
10845
- );
10846
- } catch {
10847
- process.exit(1);
10848
- }
10771
+ await ComponentPatternPublishModule.handler({ ...otherParams, all: true });
10849
10772
  }
10850
10773
  if (config2.entitiesConfig?.compositionPattern && config2.entitiesConfig?.compositionPattern?.push?.disabled !== true && config2.entitiesConfig?.compositionPattern?.publish) {
10851
- try {
10852
- await spinPromise(
10853
- CompositionPatternPublishModule.handler({
10854
- ...otherParams,
10855
- all: true,
10856
- onlyPatterns: true,
10857
- patternType: "composition"
10858
- }),
10859
- {
10860
- text: "publishing composition patterns...",
10861
- successText: "published composition patterns",
10862
- failText(error) {
10863
- return `publishing composition patterns
10864
-
10865
- ${error.stack ?? error.message}`;
10866
- }
10867
- }
10868
- );
10869
- } catch {
10870
- process.exit(1);
10871
- }
10774
+ await CompositionPatternPublishModule.handler({ ...otherParams, all: true });
10872
10775
  }
10873
10776
  if (config2.entitiesConfig?.composition && config2.entitiesConfig?.composition?.push?.disabled !== true && config2.entitiesConfig?.composition?.publish) {
10874
- try {
10875
- await spinPromise(
10876
- CompositionPublishModule.handler({
10877
- ...otherParams,
10878
- all: true,
10879
- onlyCompositions: true
10880
- }),
10881
- {
10882
- text: "publishing compositions...",
10883
- successText: "published compositions",
10884
- failText(error) {
10885
- return `publishing compositions
10886
-
10887
- ${error.stack ?? error.message}`;
10888
- }
10889
- }
10890
- );
10891
- } catch {
10892
- process.exit(1);
10893
- }
10777
+ await CompositionPublishModule.handler({ ...otherParams, all: true });
10894
10778
  }
10895
10779
  if (config2.entitiesConfig?.entry && config2.entitiesConfig?.entry?.push?.disabled !== true && config2.entitiesConfig?.entry?.publish) {
10896
- try {
10897
- await spinPromise(EntryPublishModule.handler({ ...otherParams, all: true }), {
10898
- text: "publishing entries...",
10899
- successText: "published entries",
10900
- failText(error) {
10901
- return `publishing entries
10902
-
10903
- ${error.stack ?? error.message}`;
10904
- }
10905
- });
10906
- } catch {
10907
- process.exit(1);
10908
- }
10780
+ await EntryPublishModule.handler({ ...otherParams, all: true });
10909
10781
  }
10910
10782
  if (config2.entitiesConfig?.entryPattern && config2.entitiesConfig?.entryPattern?.push?.disabled !== true && config2.entitiesConfig?.entryPattern?.publish) {
10911
- try {
10912
- await spinPromise(EntryPatternPublishModule.handler({ ...otherParams, all: true }), {
10913
- text: "publishing entry patterns...",
10914
- successText: "published entry patterns",
10915
- failText(error) {
10916
- return `publishing entry patterns
10917
-
10918
- ${error.stack ?? error.message}`;
10919
- }
10920
- });
10921
- } catch {
10922
- process.exit(1);
10923
- }
10783
+ await EntryPatternPublishModule.handler({ ...otherParams, all: true });
10924
10784
  }
10925
10785
  }
10926
10786
  };
@@ -11207,9 +11067,12 @@ First found was: v${firstVersion}`;
11207
11067
  // src/index.ts
11208
11068
  dotenv.config();
11209
11069
  var yarggery = yargs37(hideBin(process.argv));
11210
- var defaultConfig2 = loadConfig(null);
11070
+ var inlineConfigurationFilePath = "config" in yarggery.argv && yarggery.argv.config;
11071
+ var configuration = loadConfig(inlineConfigurationFilePath || null);
11211
11072
  yarggery.option("verbose", {
11212
11073
  describe: "Include verbose logging",
11213
11074
  default: false,
11214
11075
  type: "boolean"
11215
- }).scriptName("uniform").config(defaultConfig2).config("config", "Specify a custom Uniform CLI config file", (configPath) => loadConfig(configPath)).command(CanvasCommand).command(ContextCommand).command(ProjectMapCommand).command(RedirectCommand).command(SyncCommand).command(NewCmd).command(NewMeshCmd).command(OptimizeCommand).command(IntegrationCommand).recommendCommands().demandCommand(1, "").strict().help().middleware([checkForUpdateMiddleware, checkLocalDepsVersions]).parse();
11076
+ }).scriptName("uniform").config(configuration).config("config", function() {
11077
+ return {};
11078
+ }).command(CanvasCommand).command(ContextCommand).command(ProjectMapCommand).command(RedirectCommand).command(SyncCommand).command(NewCmd).command(NewMeshCmd).command(OptimizeCommand).command(IntegrationCommand).demandCommand(1, "").strict().help().middleware([checkForUpdateMiddleware, checkLocalDepsVersions]).argv;