@uniformdev/cli 19.49.1 → 19.50.2-alpha.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.mjs +69 -55
  2. package/package.json +8 -8
package/dist/index.mjs CHANGED
@@ -1203,7 +1203,10 @@ import yargs3 from "yargs";
1203
1203
  import { UncachedCanvasClient as UncachedCanvasClient7 } from "@uniformdev/canvas";
1204
1204
 
1205
1205
  // src/commands/canvas/util.ts
1206
- import { CANVAS_DRAFT_STATE, CANVAS_PUBLISHED_STATE } from "@uniformdev/canvas";
1206
+ import {
1207
+ CANVAS_DRAFT_STATE,
1208
+ CANVAS_PUBLISHED_STATE
1209
+ } from "@uniformdev/canvas";
1207
1210
  function prepCompositionForDisk(composition) {
1208
1211
  const prepped = {
1209
1212
  ...composition
@@ -2658,7 +2661,10 @@ var EntryListModule = {
2658
2661
  };
2659
2662
 
2660
2663
  // src/commands/canvas/commands/entry/pull.ts
2661
- import { ContentClient as ContentClient9 } from "@uniformdev/canvas";
2664
+ import { ContentClient as ContentClient10 } from "@uniformdev/canvas";
2665
+
2666
+ // src/commands/canvas/entryEngineDataSource.ts
2667
+ import { convertEntryToPutEntry } from "@uniformdev/canvas";
2662
2668
 
2663
2669
  // src/commands/canvas/commands/entry/_util.ts
2664
2670
  var selectEntryIdentifier = (e) => e.entry._id;
@@ -2666,16 +2672,18 @@ var selectEntryDisplayName = (e) => `${e.entry._name ?? "Untitled"} (pid: ${e.en
2666
2672
 
2667
2673
  // src/commands/canvas/entryEngineDataSource.ts
2668
2674
  function createEntryEngineDataSource({
2669
- client
2675
+ client,
2676
+ state
2670
2677
  }) {
2678
+ const stateId = convertCompositionState(state);
2671
2679
  async function* getObjects() {
2672
- const { entries } = await client.getEntries({ offset: 0, limit: 1e3 });
2680
+ const { entries } = await client.getEntries({ offset: 0, limit: 1e3, skipDataResolution: true });
2673
2681
  for await (const e of entries) {
2674
2682
  const result = {
2675
2683
  id: selectEntryIdentifier(e),
2676
2684
  displayName: selectEntryDisplayName(e),
2677
2685
  providerId: e.entry._id,
2678
- object: e
2686
+ object: prepCompositionForDisk(e)
2679
2687
  };
2680
2688
  yield result;
2681
2689
  }
@@ -2686,7 +2694,7 @@ function createEntryEngineDataSource({
2686
2694
  await client.deleteEntry({ entryId: providerId });
2687
2695
  },
2688
2696
  writeObject: async ({ object }) => {
2689
- await client.upsertEntry(object);
2697
+ await client.upsertEntry({ ...convertEntryToPutEntry(object), state: stateId });
2690
2698
  }
2691
2699
  };
2692
2700
  }
@@ -2698,28 +2706,30 @@ var EntryPullModule = {
2698
2706
  builder: (yargs25) => withConfiguration(
2699
2707
  withApiOptions(
2700
2708
  withProjectOptions(
2701
- withDiffOptions(
2702
- yargs25.positional("directory", {
2703
- describe: "Directory to save the entries to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
2704
- type: "string"
2705
- }).option("format", {
2706
- alias: ["f"],
2707
- describe: "Output format",
2708
- default: "yaml",
2709
- choices: ["yaml", "json"],
2710
- type: "string"
2711
- }).option("what-if", {
2712
- alias: ["w"],
2713
- describe: "What-if mode reports what would be done but changes no files",
2714
- default: false,
2715
- type: "boolean"
2716
- }).option("mode", {
2717
- alias: ["m"],
2718
- describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
2719
- choices: ["create", "createOrUpdate", "mirror"],
2720
- default: "mirror",
2721
- type: "string"
2722
- })
2709
+ withStateOptions(
2710
+ withDiffOptions(
2711
+ yargs25.positional("directory", {
2712
+ describe: "Directory to save the entries to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
2713
+ type: "string"
2714
+ }).option("format", {
2715
+ alias: ["f"],
2716
+ describe: "Output format",
2717
+ default: "yaml",
2718
+ choices: ["yaml", "json"],
2719
+ type: "string"
2720
+ }).option("what-if", {
2721
+ alias: ["w"],
2722
+ describe: "What-if mode reports what would be done but changes no files",
2723
+ default: false,
2724
+ type: "boolean"
2725
+ }).option("mode", {
2726
+ alias: ["m"],
2727
+ describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
2728
+ choices: ["create", "createOrUpdate", "mirror"],
2729
+ default: "mirror",
2730
+ type: "string"
2731
+ })
2732
+ )
2723
2733
  )
2724
2734
  )
2725
2735
  )
@@ -2732,18 +2742,19 @@ var EntryPullModule = {
2732
2742
  format,
2733
2743
  mode,
2734
2744
  whatIf,
2745
+ state,
2735
2746
  project: projectId,
2736
2747
  diff: diffMode
2737
2748
  }) => {
2738
2749
  const fetch3 = nodeFetchProxy(proxy);
2739
- const client = new ContentClient9({
2750
+ const client = new ContentClient10({
2740
2751
  apiKey,
2741
2752
  apiHost,
2742
2753
  fetch: fetch3,
2743
2754
  projectId,
2744
2755
  bypassCache: true
2745
2756
  });
2746
- const source = createEntryEngineDataSource({ client });
2757
+ const source = createEntryEngineDataSource({ client, state });
2747
2758
  let target;
2748
2759
  const isPackage = isPathAPackageFile(directory);
2749
2760
  if (isPackage) {
@@ -2776,29 +2787,31 @@ var EntryPullModule = {
2776
2787
  };
2777
2788
 
2778
2789
  // src/commands/canvas/commands/entry/push.ts
2779
- import { ContentClient as ContentClient10 } from "@uniformdev/canvas";
2790
+ import { ContentClient as ContentClient11 } from "@uniformdev/canvas";
2780
2791
  var EntryPushModule = {
2781
2792
  command: "push <directory>",
2782
2793
  describe: "Pushes all entries from files in a directory to Uniform",
2783
2794
  builder: (yargs25) => withConfiguration(
2784
2795
  withApiOptions(
2785
2796
  withProjectOptions(
2786
- withDiffOptions(
2787
- yargs25.positional("directory", {
2788
- describe: "Directory to read the entries from. If a filename is used, a package will be read instead.",
2789
- type: "string"
2790
- }).option("what-if", {
2791
- alias: ["w"],
2792
- describe: "What-if mode reports what would be done but changes nothing",
2793
- default: false,
2794
- type: "boolean"
2795
- }).option("mode", {
2796
- alias: ["m"],
2797
- describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
2798
- choices: ["create", "createOrUpdate", "mirror"],
2799
- default: "mirror",
2800
- type: "string"
2801
- })
2797
+ withStateOptions(
2798
+ withDiffOptions(
2799
+ yargs25.positional("directory", {
2800
+ describe: "Directory to read the entries from. If a filename is used, a package will be read instead.",
2801
+ type: "string"
2802
+ }).option("what-if", {
2803
+ alias: ["w"],
2804
+ describe: "What-if mode reports what would be done but changes nothing",
2805
+ default: false,
2806
+ type: "boolean"
2807
+ }).option("mode", {
2808
+ alias: ["m"],
2809
+ describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
2810
+ choices: ["create", "createOrUpdate", "mirror"],
2811
+ default: "mirror",
2812
+ type: "string"
2813
+ })
2814
+ )
2802
2815
  )
2803
2816
  )
2804
2817
  )
@@ -2810,11 +2823,12 @@ var EntryPushModule = {
2810
2823
  directory,
2811
2824
  mode,
2812
2825
  whatIf,
2826
+ state,
2813
2827
  project: projectId,
2814
2828
  diff: diffMode
2815
2829
  }) => {
2816
2830
  const fetch3 = nodeFetchProxy(proxy);
2817
- const client = new ContentClient10({
2831
+ const client = new ContentClient11({
2818
2832
  apiKey,
2819
2833
  apiHost,
2820
2834
  fetch: fetch3,
@@ -2837,7 +2851,7 @@ var EntryPushModule = {
2837
2851
  selectDisplayName: selectEntryDisplayName
2838
2852
  });
2839
2853
  }
2840
- const target = createEntryEngineDataSource({ client });
2854
+ const target = createEntryEngineDataSource({ client, state });
2841
2855
  await syncEngine({
2842
2856
  source,
2843
2857
  target,
@@ -2849,7 +2863,7 @@ var EntryPushModule = {
2849
2863
  };
2850
2864
 
2851
2865
  // src/commands/canvas/commands/entry/remove.ts
2852
- import { ContentClient as ContentClient11 } from "@uniformdev/canvas";
2866
+ import { ContentClient as ContentClient12 } from "@uniformdev/canvas";
2853
2867
  var EntryRemoveModule = {
2854
2868
  command: "remove <id>",
2855
2869
  aliases: ["delete", "rm"],
@@ -2863,13 +2877,13 @@ var EntryRemoveModule = {
2863
2877
  ),
2864
2878
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
2865
2879
  const fetch3 = nodeFetchProxy(proxy);
2866
- const client = new ContentClient11({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
2880
+ const client = new ContentClient12({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
2867
2881
  await client.deleteEntry({ entryId: id });
2868
2882
  }
2869
2883
  };
2870
2884
 
2871
2885
  // src/commands/canvas/commands/entry/update.ts
2872
- import { ContentClient as ContentClient12 } from "@uniformdev/canvas";
2886
+ import { ContentClient as ContentClient13 } from "@uniformdev/canvas";
2873
2887
  var EntryUpdateModule = {
2874
2888
  command: "update <filename>",
2875
2889
  aliases: ["put"],
@@ -2883,7 +2897,7 @@ var EntryUpdateModule = {
2883
2897
  ),
2884
2898
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
2885
2899
  const fetch3 = nodeFetchProxy(proxy);
2886
- const client = new ContentClient12({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
2900
+ const client = new ContentClient13({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
2887
2901
  const file = readFileToObject(filename);
2888
2902
  await client.upsertEntry(file);
2889
2903
  }
@@ -4745,7 +4759,7 @@ import { PostHog } from "posthog-node";
4745
4759
  // package.json
4746
4760
  var package_default = {
4747
4761
  name: "@uniformdev/cli",
4748
- version: "19.49.1",
4762
+ version: "19.50.1",
4749
4763
  description: "Uniform command line interface tool",
4750
4764
  license: "SEE LICENSE IN LICENSE.txt",
4751
4765
  main: "./cli.js",
@@ -4782,7 +4796,7 @@ var package_default = {
4782
4796
  "isomorphic-git": "1.24.5",
4783
4797
  "isomorphic-unfetch": "^3.1.0",
4784
4798
  "js-yaml": "^4.1.0",
4785
- jsonwebtoken: "9.0.1",
4799
+ jsonwebtoken: "9.0.2",
4786
4800
  "lodash.isequalwith": "^4.4.0",
4787
4801
  open: "9.1.0",
4788
4802
  ora: "6.3.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/cli",
3
- "version": "19.49.1",
3
+ "version": "19.50.2-alpha.11+3ffe35383",
4
4
  "description": "Uniform command line interface tool",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./cli.js",
@@ -17,11 +17,11 @@
17
17
  },
18
18
  "dependencies": {
19
19
  "@thi.ng/mime": "^2.2.23",
20
- "@uniformdev/canvas": "19.49.1",
21
- "@uniformdev/context": "19.49.1",
22
- "@uniformdev/files": "19.49.1",
23
- "@uniformdev/project-map": "19.49.1",
24
- "@uniformdev/redirect": "19.49.1",
20
+ "@uniformdev/canvas": "19.50.2-alpha.11+3ffe35383",
21
+ "@uniformdev/context": "19.50.2-alpha.11+3ffe35383",
22
+ "@uniformdev/files": "19.50.2-alpha.11+3ffe35383",
23
+ "@uniformdev/project-map": "19.50.2-alpha.11+3ffe35383",
24
+ "@uniformdev/redirect": "19.50.2-alpha.11+3ffe35383",
25
25
  "colorette": "2.0.20",
26
26
  "cosmiconfig": "8.2.0",
27
27
  "cosmiconfig-typescript-loader": "5.0.0",
@@ -37,7 +37,7 @@
37
37
  "isomorphic-git": "1.24.5",
38
38
  "isomorphic-unfetch": "^3.1.0",
39
39
  "js-yaml": "^4.1.0",
40
- "jsonwebtoken": "9.0.1",
40
+ "jsonwebtoken": "9.0.2",
41
41
  "lodash.isequalwith": "^4.4.0",
42
42
  "open": "9.1.0",
43
43
  "ora": "6.3.1",
@@ -66,5 +66,5 @@
66
66
  "publishConfig": {
67
67
  "access": "public"
68
68
  },
69
- "gitHead": "a14b97601fb78b44be7f0849841b9828dec0ea96"
69
+ "gitHead": "3ffe35383d936fe485db7afd0506f4ea40386926"
70
70
  }