@uniformdev/cli 20.49.1 → 20.49.3-alpha.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1124,7 +1124,7 @@ import { PostHog } from "posthog-node";
1124
1124
  // package.json
1125
1125
  var package_default = {
1126
1126
  name: "@uniformdev/cli",
1127
- version: "20.49.1",
1127
+ version: "20.49.2",
1128
1128
  description: "Uniform command line interface tool",
1129
1129
  license: "SEE LICENSE IN LICENSE.txt",
1130
1130
  main: "./cli.js",
@@ -1343,16 +1343,12 @@ function getMcpDirectory(agentType, customDir) {
1343
1343
  // src/commands/ai/lib/mcp.ts
1344
1344
  import { yellow as yellow2 } from "colorette";
1345
1345
  import { existsSync as existsSync3, readFileSync } from "fs";
1346
- function createUniformMcpServerConfig(apiKey, projectId, aiApiHost, apiHost) {
1346
+ function createUniformMcpServerConfig(apiKey, projectId, aiApiHost, _apiHost) {
1347
1347
  return {
1348
- type: "stdio",
1349
- command: "npx",
1350
- args: ["-y", "@uniformdev/uniform-mcp"],
1351
- env: {
1352
- UNIFORM_API_KEY: apiKey,
1353
- UNIFORM_PROJECT_ID: projectId,
1354
- UNIFORM_AI_API_HOST: aiApiHost,
1355
- UNIFORM_API_HOST: apiHost
1348
+ type: "streamable-http",
1349
+ url: `${aiApiHost}/projects/${projectId}/mcp`,
1350
+ headers: {
1351
+ "x-api-key": apiKey
1356
1352
  }
1357
1353
  };
1358
1354
  }
@@ -2616,6 +2612,15 @@ var compareCompositionsOrEntriesWithoutAssetUrls = (source, target) => {
2616
2612
  removeUrlsFromAssetParameters(structuredClone(target.object))
2617
2613
  );
2618
2614
  };
2615
+ var PUBLISH_TIMESTAMP_TOLERANCE_MS = 2e3;
2616
+ var compareCompositionsOrEntriesWithoutAssetUrlsForPublishing = (source, target) => {
2617
+ const sourceModified = new Date(source.object.modified).getTime();
2618
+ const targetModified = new Date(target.object.modified).getTime();
2619
+ if (sourceModified - targetModified > PUBLISH_TIMESTAMP_TOLERANCE_MS) {
2620
+ return false;
2621
+ }
2622
+ return compareCompositionsOrEntriesWithoutAssetUrls(source, target);
2623
+ };
2619
2624
  var removeUrlFromAsset = (asset) => {
2620
2625
  if (asset.asset.fields?.url?.value) {
2621
2626
  asset.asset.fields.url.value = "";
@@ -4205,7 +4210,7 @@ var CompositionPublishModule = {
4205
4210
  fileClient
4206
4211
  });
4207
4212
  },
4208
- compareContents: compareCompositionsOrEntriesWithoutAssetUrls,
4213
+ compareContents: compareCompositionsOrEntriesWithoutAssetUrlsForPublishing,
4209
4214
  onBeforeWriteObject: async (sourceObject) => {
4210
4215
  return uploadFilesForCompositionOrEntry({
4211
4216
  entity: sourceObject,
@@ -4746,7 +4751,6 @@ var CompositionUnpublishModule = {
4746
4751
  console.log(`Composition ${id} was not found`);
4747
4752
  return;
4748
4753
  }
4749
- console.log(`\u{1F41B} unpublishing composition: (id: ${id})`);
4750
4754
  if (!whatIf) {
4751
4755
  actions.push(client.removeComposition({ compositionId: id, state: CANVAS_PUBLISHED_STATE2 }));
4752
4756
  }
@@ -4759,6 +4763,7 @@ var CompositionUnpublishModule = {
4759
4763
  diff: () => diffJson2(targetObject.object, sourceObject.object)
4760
4764
  });
4761
4765
  }
4766
+ await Promise.all(actions);
4762
4767
  }
4763
4768
  };
4764
4769
 
@@ -6049,10 +6054,10 @@ var EntryPublishModule = {
6049
6054
  command: "publish [ids]",
6050
6055
  describe: "Publishes entry(ies)",
6051
6056
  builder: (yargs42) => withConfiguration(
6052
- withDiffOptions(
6053
- withApiOptions(
6054
- withProjectOptions(
6055
- withDiffOptions(
6057
+ withDebugOptions(
6058
+ withDiffOptions(
6059
+ withApiOptions(
6060
+ withProjectOptions(
6056
6061
  yargs42.positional("ids", {
6057
6062
  describe: "Publishes entry(ies) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
6058
6063
  type: "string"
@@ -6112,7 +6117,7 @@ var EntryPublishModule = {
6112
6117
  fileClient
6113
6118
  });
6114
6119
  },
6115
- compareContents: compareCompositionsOrEntriesWithoutAssetUrls,
6120
+ compareContents: compareCompositionsOrEntriesWithoutAssetUrlsForPublishing,
6116
6121
  onBeforeWriteObject: async (sourceObject) => {
6117
6122
  return uploadFilesForCompositionOrEntry({
6118
6123
  entity: sourceObject,
@@ -6431,6 +6436,7 @@ var EntryUnpublishModule = {
6431
6436
  diff: () => diffJson3(targetObject.object, sourceObject.object)
6432
6437
  });
6433
6438
  }
6439
+ await Promise.all(actions);
6434
6440
  }
6435
6441
  };
6436
6442
 
@@ -6664,7 +6670,7 @@ var EntryPatternPublishModule = {
6664
6670
  fileClient
6665
6671
  });
6666
6672
  },
6667
- compareContents: compareCompositionsOrEntriesWithoutAssetUrls,
6673
+ compareContents: compareCompositionsOrEntriesWithoutAssetUrlsForPublishing,
6668
6674
  onBeforeWriteObject: async (sourceObject) => {
6669
6675
  return uploadFilesForCompositionOrEntry({
6670
6676
  entity: sourceObject,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/cli",
3
- "version": "20.49.1",
3
+ "version": "20.49.3-alpha.9+e5b9a8ca05",
4
4
  "description": "Uniform command line interface tool",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./cli.js",
@@ -28,13 +28,13 @@
28
28
  "dependencies": {
29
29
  "@inquirer/prompts": "^7.10.1",
30
30
  "@thi.ng/mime": "^2.2.23",
31
- "@uniformdev/assets": "20.49.1",
32
- "@uniformdev/canvas": "20.49.1",
33
- "@uniformdev/context": "20.49.1",
34
- "@uniformdev/files": "20.49.1",
35
- "@uniformdev/project-map": "20.49.1",
36
- "@uniformdev/redirect": "20.49.1",
37
- "@uniformdev/richtext": "20.49.1",
31
+ "@uniformdev/assets": "20.49.3-alpha.9+e5b9a8ca05",
32
+ "@uniformdev/canvas": "20.49.3-alpha.9+e5b9a8ca05",
33
+ "@uniformdev/context": "20.49.3-alpha.9+e5b9a8ca05",
34
+ "@uniformdev/files": "20.49.3-alpha.9+e5b9a8ca05",
35
+ "@uniformdev/project-map": "20.49.3-alpha.9+e5b9a8ca05",
36
+ "@uniformdev/redirect": "20.49.3-alpha.9+e5b9a8ca05",
37
+ "@uniformdev/richtext": "20.49.3-alpha.9+e5b9a8ca05",
38
38
  "call-bind": "^1.0.2",
39
39
  "colorette": "2.0.20",
40
40
  "cosmiconfig": "9.0.0",
@@ -81,5 +81,5 @@
81
81
  "publishConfig": {
82
82
  "access": "public"
83
83
  },
84
- "gitHead": "5ecbefb8d8bf62b69600ebe59ed73a0d466438f5"
84
+ "gitHead": "e5b9a8ca05d0b8b26886079b687417e53d44f9cb"
85
85
  }
@@ -1,44 +0,0 @@
1
- type CLICompositionState = 'preview' | 'published' | number;
2
- type StateArgs = {
3
- state: CLICompositionState;
4
- };
5
-
6
- type SyncMode = 'mirror' | 'createOrUpdate' | 'create';
7
- type EntityTypes = 'aggregate' | 'asset' | 'category' | 'workflow' | 'webhook' | 'component' | 'composition' | 'contentType' | 'dataType' | 'enrichment' | 'entry' | 'entryPattern' | 'locale' | 'componentPattern' | 'compositionPattern' | 'projectMapDefinition' | 'projectMapNode' | 'previewUrl' | 'previewViewport' | 'prompt' | 'quirk' | 'redirect' | 'signal' | 'test';
8
- type SyncFileFormat = 'yaml' | 'json';
9
- type EntityConfiguration = {
10
- mode?: SyncMode;
11
- directory?: string;
12
- format?: SyncFileFormat;
13
- disabled?: true;
14
- };
15
- type EntityWithStateConfiguration = EntityConfiguration & Partial<StateArgs>;
16
- type PublishableEntitiesConfiguration = EntityWithStateConfiguration & {
17
- publish?: boolean;
18
- };
19
- type SerializationEntitiesConfiguration = Record<EntityTypes, {
20
- pull?: EntityConfiguration;
21
- push?: EntityConfiguration;
22
- } & EntityConfiguration> & {
23
- composition?: PublishableEntitiesConfiguration;
24
- componentPattern?: PublishableEntitiesConfiguration;
25
- compositionPattern?: PublishableEntitiesConfiguration;
26
- entry?: PublishableEntitiesConfiguration;
27
- entryPattern?: PublishableEntitiesConfiguration;
28
- };
29
- type SerializationConfiguration = {
30
- entitiesConfig: Partial<SerializationEntitiesConfiguration>;
31
- directory: string;
32
- mode: SyncMode;
33
- allowEmptySource: boolean;
34
- format: SyncFileFormat;
35
- };
36
- type RecursivePartial<T> = {
37
- [P in keyof T]?: RecursivePartial<T[P]>;
38
- };
39
- type UserDefinedSerializationConfiguration = RecursivePartial<SerializationConfiguration>;
40
- type CLIConfiguration = {
41
- serialization: UserDefinedSerializationConfiguration;
42
- };
43
-
44
- export type { CLIConfiguration as C, EntityTypes as E };