@contrail/cli 3.3.2 → 3.3.4

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/README.md CHANGED
@@ -17,7 +17,7 @@ $ npm install -g @contrail/cli
17
17
  $ contrail COMMAND
18
18
  running command...
19
19
  $ contrail (--version)
20
- @contrail/cli/3.3.2 darwin-x64 node-v22.12.0
20
+ @contrail/cli/3.3.4 darwin-arm64 node-v20.19.4
21
21
  $ contrail --help [COMMAND]
22
22
  USAGE
23
23
  $ contrail COMMAND
@@ -40,6 +40,10 @@ async function authUser() {
40
40
  return await refreshCurrentUserOrg();
41
41
  }
42
42
  catch (e) {
43
+ if (isNetworkConnectionError(e)) {
44
+ logger_1.default.error("Encountered a network connection issue. Please ensure you're connected to the internet and try again");
45
+ process.exit(1);
46
+ }
43
47
  logger_1.default.info('Token expired. Requesting auth credentials...');
44
48
  }
45
49
  }
@@ -211,3 +215,7 @@ async function returnAndStoreConfig(config) {
211
215
  await (0, config_1.storeConfig)(configCopy);
212
216
  return configCopy;
213
217
  }
218
+ function isNetworkConnectionError(e) {
219
+ const cause = e?.cause;
220
+ return cause?.code === 'ENOTFOUND' || cause?.code === 'ECONNREFUSED';
221
+ }
@@ -40,10 +40,12 @@ class DeployExtension extends basecommand_1.BaseCommand {
40
40
  await this.validateExtensionDeclaration(appDeclaration, extensionIdentifier);
41
41
  const extensionDir = this.getExtensionDirectory(extensionIdentifier);
42
42
  // 2. Package and upload extension
43
- const createdPackage = await (0, extension_package_deployer_1.createExtensionPackage)(app.id, extensionDir, { debug: this.flags.debug });
43
+ const createdPackage = await (0, extension_package_deployer_1.createExtensionPackage)(app.id, extensionDir, {
44
+ debug: this.flags.debug,
45
+ });
44
46
  // 3. Poll until package is ready (timeout after 1 minute)
45
47
  const readyPackage = await this.pollUntilPackageIsReady(createdPackage);
46
- logger_1.default.info("Extension package is ready...Checking for extension deployment");
48
+ logger_1.default.info('Extension package is ready...Checking for extension deployment');
47
49
  logger_1.default.debug(JSON.stringify(readyPackage, null, 2));
48
50
  const deployment = await this.pollUntilDeploymentIsReady(readyPackage.deploymentId);
49
51
  logger_1.default.info(`${chalk_1.default.green.bold('SUCCESS')} Extension package is ready.`);
@@ -103,6 +103,7 @@ async function uploadUsageInfoObjects(loadedUsageInfo) {
103
103
  numberFormat: loadedUI.numberFormat,
104
104
  defaultValue: loadedUI.defaultValue,
105
105
  label: loadedUI.label,
106
+ isArchived: loadedUI.isArchived,
106
107
  },
107
108
  });
108
109
  }
@@ -115,8 +116,21 @@ async function uploadUsageInfoObjects(loadedUsageInfo) {
115
116
  entityName: 'type-property-usage-info',
116
117
  id: found.id,
117
118
  object: {
118
- editable: loadedUI.editable,
119
- used: loadedUI.used,
119
+ editable: loadedUI?.editable,
120
+ used: loadedUI?.used,
121
+ formulaFunction: loadedUI?.formulaFunction,
122
+ validationFunction: loadedUI?.validationFunction,
123
+ numberFormat: loadedUI?.numberFormat,
124
+ defaultValue: loadedUI?.defaultValue,
125
+ label: loadedUI?.label,
126
+ required: loadedUI?.required,
127
+ searchable: loadedUI?.searchable,
128
+ isUniqueProperty: loadedUI?.isUniqueProperty,
129
+ isUniquePropertyInFamily: loadedUI?.isUniquePropertyInFamily,
130
+ copyBehavior: loadedUI?.copyBehavior,
131
+ copyDefault: loadedUI?.copyDefault,
132
+ propertyLevel: loadedUI?.propertyLevel,
133
+ isArchived: loadedUI?.isArchived,
120
134
  },
121
135
  });
122
136
  }
@@ -119,7 +119,7 @@ async function createExtensionPackage(appId, extensionDir, options) {
119
119
  await uploadExtensionPackage(appExtensionPackage, tmpDir, options);
120
120
  logger_1.default.info(`${chalk_1.default.green.bold('COMPLETE')} Extension packaged and uploaded.`);
121
121
  if (options.debug) {
122
- logger_1.default.debug("debug mode enabled. Not cleaning up tmp dir.");
122
+ logger_1.default.debug('debug mode enabled. Not cleaning up tmp dir.');
123
123
  }
124
124
  else {
125
125
  cleanUp(tmpDir);
@@ -103,13 +103,13 @@ exports.writeConfig = writeConfig;
103
103
  async function getConfig() {
104
104
  let fileContent;
105
105
  try {
106
- fileContent = await (await node_fs_1.promises.readFile(configFileLocation)).toString();
106
+ fileContent = (await node_fs_1.promises.readFile(configFileLocation)).toString();
107
107
  }
108
108
  catch {
109
109
  logger_1.default.debug(`failed to open config file (${configFileLocation}) for reading.`);
110
110
  logger_1.default.debug('trying to initialize config file');
111
111
  await initializeVibeIQConfig();
112
- fileContent = await (await node_fs_1.promises.readFile(configFileLocation)).toString();
112
+ fileContent = (await node_fs_1.promises.readFile(configFileLocation)).toString();
113
113
  }
114
114
  try {
115
115
  const configFileJSON = JSON.parse(fileContent);
@@ -156,7 +156,7 @@ async function getConfigContent(fileName) {
156
156
  const configFilePath = (0, node_path_1.join)(configDirectoryLocation, `${fileName}.json`);
157
157
  let fileContent;
158
158
  try {
159
- fileContent = await (await node_fs_1.promises.readFile(configFilePath)).toString();
159
+ fileContent = (await node_fs_1.promises.readFile(configFilePath)).toString();
160
160
  return JSON.parse(fileContent);
161
161
  }
162
162
  catch (error) {
@@ -200,6 +200,11 @@ async function uploadReducedTypeProperties(type, currentPropertyTypes, newProper
200
200
  // !newPropertyType.inherited &&
201
201
  // !typePropertiesEqual(found, newPropertyType, optionSetIdBySlug)
202
202
  ) {
203
+ // Skip platform-managed entities
204
+ if (newPropertyType.core) {
205
+ logger_1.default.debug(`Skipping platform-managed property: ${newPropertyType.slug}`);
206
+ continue;
207
+ }
203
208
  const proposedTP = {
204
209
  isArchived: newPropertyType.isArchived ?? null,
205
210
  propertyType: newPropertyType.propertyType ?? null,
@@ -1,5 +1,7 @@
1
1
  ### Running your app
2
+
2
3
  Run `npm run start` at the root directory of your app (where the `package.json` file is located).
3
4
 
4
5
  ### Publishing your app
5
- Run `contrail app publish` to publish a new version of the app.
6
+
7
+ Run `contrail app publish` to publish a new version of the app.
@@ -1,3 +1,3 @@
1
1
  {
2
2
  "foo": "bar"
3
- }
3
+ }
@@ -25,10 +25,7 @@
25
25
  "no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 0 }],
26
26
  "no-trailing-spaces": "error",
27
27
  "no-mixed-spaces-and-tabs": ["error", "smart-tabs"],
28
- "@typescript-eslint/no-empty-function": [
29
- "error",
30
- { "allow": ["arrowFunctions"] }
31
- ],
28
+ "@typescript-eslint/no-empty-function": ["error", { "allow": ["arrowFunctions"] }],
32
29
  "@typescript-eslint/no-explicit-any": "off",
33
30
  "@typescript-eslint/no-var-requires": "warn",
34
31
  "no-unused-vars": "off",
@@ -4,15 +4,7 @@
4
4
  "emitDecoratorMetadata": true,
5
5
  "esModuleInterop": true,
6
6
  "experimentalDecorators": true,
7
- "lib": [
8
- "es5",
9
- "ES2015",
10
- "ES2016",
11
- "ES2017",
12
- "ES2020",
13
- "dom",
14
- "esnext.asynciterable"
15
- ],
7
+ "lib": ["es5", "ES2015", "ES2016", "ES2017", "ES2020", "dom", "esnext.asynciterable"],
16
8
  "module": "CommonJS",
17
9
  // "moduleResolution": "node",
18
10
  "noImplicitAny": false,
@@ -22,16 +14,8 @@
22
14
  "strict": false,
23
15
  "strictPropertyInitialization": false,
24
16
  "target": "ES2020",
25
- "types": [
26
- "node", "jest"
27
- ]
17
+ "types": ["node", "jest"]
28
18
  },
29
- "exclude": [
30
- "node_modules",
31
- "**/__tests__/*"
32
- ],
33
- "include": [
34
- "src",
35
- "package.json"
36
- ]
37
- }
19
+ "exclude": ["node_modules", "**/__tests__/*"],
20
+ "include": ["src", "package.json"]
21
+ }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.3.2",
2
+ "version": "3.3.4",
3
3
  "commands": {
4
4
  "app:create": {
5
5
  "id": "app:create",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/cli",
3
- "version": "3.3.2",
3
+ "version": "3.3.4",
4
4
  "description": "VibeIQ's Contrail Platform CLI.",
5
5
  "bin": {
6
6
  "contrail-cli": "./bin/run",
@@ -23,7 +23,7 @@
23
23
  ],
24
24
  "dependencies": {
25
25
  "@contrail/entity-types": "^1.3.0",
26
- "@contrail/org-config-migration": "^1.1.5",
26
+ "@contrail/org-config-migration": "^1.1.7",
27
27
  "@contrail/sdk": "^1.4.6",
28
28
  "@contrail/types": "^3.0.48",
29
29
  "@contrail/util": "^1.1.10",