@contrail/cli 2.2.1 → 2.2.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/README.md +1 -1
- package/dist/commands/app/delete.js +1 -1
- package/dist/commands/types/uploadOptionSetHierarchies.js +2 -2
- package/dist/commands/types/uploadOptionSetsHierarchyLocalFile.js +2 -2
- package/dist/commands/types/uploadTypePolicies.js +5 -5
- package/dist/commands/types/uploadTypePropertyPolicies.js +5 -5
- package/dist/commands/types/uploadUsageInfo.js +5 -5
- package/dist/commands/webhooks/list.js +1 -1
- package/dist/helpers/app/app-deployer.js +2 -0
- package/dist/helpers/types/type-uploader.js +5 -5
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
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/2.2.
|
|
20
|
+
@contrail/cli/2.2.2 darwin-arm64 node-v18.13.0
|
|
21
21
|
$ contrail --help [COMMAND]
|
|
22
22
|
USAGE
|
|
23
23
|
$ contrail COMMAND
|
|
@@ -13,7 +13,7 @@ class DeleteApp extends basecommand_1.BaseCommand {
|
|
|
13
13
|
appDeclaration = (0, load_app_config_1.loadAppConfig)();
|
|
14
14
|
}
|
|
15
15
|
catch (e) {
|
|
16
|
-
|
|
16
|
+
logger_1.default.error(`%s Application Removal Failed. ${e}`);
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
19
|
logger_1.default.info(`Removing Application. ${appDeclaration.appIdentifier}`);
|
|
@@ -99,7 +99,7 @@ async function uploadOSH(loadedOSHs) {
|
|
|
99
99
|
if (!transformOSHNameToID(osh.hierarchy, optionSets)) {
|
|
100
100
|
continue;
|
|
101
101
|
}
|
|
102
|
-
logger_1.default.debug(`Creating:
|
|
102
|
+
logger_1.default.debug(`Creating: ${JSON.stringify(osh)}`);
|
|
103
103
|
await new sdk_1.Entities().create({
|
|
104
104
|
entityName: 'option-set-hierarchy',
|
|
105
105
|
object: osh,
|
|
@@ -201,7 +201,7 @@ async function uploadOSHLinks(reducedOSHLinks) {
|
|
|
201
201
|
if (!transformReducedLink(loadedLink, typesWithProperties, currentOSHs)) {
|
|
202
202
|
continue;
|
|
203
203
|
}
|
|
204
|
-
logger_1.default.debug(`Creating:
|
|
204
|
+
logger_1.default.debug(`Creating: ${JSON.stringify(loadedLink)}`);
|
|
205
205
|
await new sdk_1.Entities().create({
|
|
206
206
|
entityName: 'type-option-set-hierarchy-link',
|
|
207
207
|
object: {
|
|
@@ -101,7 +101,7 @@ async function uploadOptionSetHierarchiesLocalFile(fileLocation, name) {
|
|
|
101
101
|
});
|
|
102
102
|
const existing = currentOptionSetHierarchies.find((osh) => osh.name === name);
|
|
103
103
|
if (existing) {
|
|
104
|
-
logger_1.default.info(`Updating:
|
|
104
|
+
logger_1.default.info(`Updating: ${optionSetHierarchy.name}`);
|
|
105
105
|
await new sdk_1.Entities().update({
|
|
106
106
|
entityName: 'option-set-hierarchy',
|
|
107
107
|
id: existing.id,
|
|
@@ -109,7 +109,7 @@ async function uploadOptionSetHierarchiesLocalFile(fileLocation, name) {
|
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
111
|
else {
|
|
112
|
-
logger_1.default.info(`Creating:
|
|
112
|
+
logger_1.default.info(`Creating: ${optionSetHierarchy.name}`);
|
|
113
113
|
await new sdk_1.Entities().create({
|
|
114
114
|
entityName: 'option-set-hierarchy',
|
|
115
115
|
object: optionSetHierarchy,
|
|
@@ -117,14 +117,14 @@ async function uploadTypePolicyObjects(reducedTypePolicies) {
|
|
|
117
117
|
try {
|
|
118
118
|
const found = currentTypePolicyByIdentifier[identifier];
|
|
119
119
|
if (!found) {
|
|
120
|
-
logger_1.default.info(`Creating:
|
|
120
|
+
logger_1.default.info(`Creating: ${identifier}`);
|
|
121
121
|
await new sdk_1.Entities().create({
|
|
122
122
|
entityName: 'type-policy',
|
|
123
123
|
object: loadedTPP,
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
126
|
else {
|
|
127
|
-
logger_1.default.info(`Updating:
|
|
127
|
+
logger_1.default.info(`Updating: ${identifier}`);
|
|
128
128
|
await new sdk_1.Entities().update({
|
|
129
129
|
entityName: 'type-policy',
|
|
130
130
|
id: found.id,
|
|
@@ -140,7 +140,7 @@ async function uploadTypePolicyObjects(reducedTypePolicies) {
|
|
|
140
140
|
try {
|
|
141
141
|
const found = loadedTypePolicyByIdentifier[identifier];
|
|
142
142
|
if (!found) {
|
|
143
|
-
logger_1.default.info(`Deleting:
|
|
143
|
+
logger_1.default.info(`Deleting: ${identifier}`);
|
|
144
144
|
await new sdk_1.Entities().delete({
|
|
145
145
|
entityName: 'type-policy',
|
|
146
146
|
id: currentTPP['id'],
|
|
@@ -165,7 +165,7 @@ async function uploadTypePolicyLinks(reducedTypePolicyLinks) {
|
|
|
165
165
|
const foundType = types.find((type) => type.id === currentLink.typeId);
|
|
166
166
|
const foundTypePolicy = currentTypePolicies.find((tp) => tp.id === currentLink.typePolicyId);
|
|
167
167
|
if (!foundType || !foundTypePolicy) {
|
|
168
|
-
logger_1.default.info(`skipping unhashable, invalid policy link:
|
|
168
|
+
logger_1.default.info(`skipping unhashable, invalid policy link: ${currentLink}`);
|
|
169
169
|
}
|
|
170
170
|
const hash = `${foundType.slug}|${foundTypePolicy.identifier}`;
|
|
171
171
|
currentLinksHashes[hash] = currentLink;
|
|
@@ -204,7 +204,7 @@ async function uploadTypePolicyLinks(reducedTypePolicyLinks) {
|
|
|
204
204
|
try {
|
|
205
205
|
const found = reducedLinksByHashes[currentLinkHash];
|
|
206
206
|
if (!found) {
|
|
207
|
-
logger_1.default.info(`Deleting:
|
|
207
|
+
logger_1.default.info(`Deleting: ${currentLinkHash}`);
|
|
208
208
|
await new sdk_1.Entities().delete({
|
|
209
209
|
entityName: 'type-policy-link',
|
|
210
210
|
id: currentLink['id'],
|
|
@@ -119,14 +119,14 @@ async function uploadTPPolicyObjects(reducedTypePropertyPolicies) {
|
|
|
119
119
|
try {
|
|
120
120
|
const found = currentTPPByLabel[label];
|
|
121
121
|
if (!found) {
|
|
122
|
-
logger_1.default.info(`Creating:
|
|
122
|
+
logger_1.default.info(`Creating: ${label}`);
|
|
123
123
|
await new sdk_1.Entities().create({
|
|
124
124
|
entityName: 'type-property-policy',
|
|
125
125
|
object: loadedTPP,
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
128
|
else {
|
|
129
|
-
logger_1.default.info(`Updating:
|
|
129
|
+
logger_1.default.info(`Updating: ${label}`);
|
|
130
130
|
await new sdk_1.Entities().update({
|
|
131
131
|
entityName: 'type-property-policy',
|
|
132
132
|
id: found.id,
|
|
@@ -142,7 +142,7 @@ async function uploadTPPolicyObjects(reducedTypePropertyPolicies) {
|
|
|
142
142
|
try {
|
|
143
143
|
const found = loadedTPPByName[label];
|
|
144
144
|
if (!found) {
|
|
145
|
-
logger_1.default.info(`Deleting:
|
|
145
|
+
logger_1.default.info(`Deleting: ${label}`);
|
|
146
146
|
await new sdk_1.Entities().delete({
|
|
147
147
|
entityName: 'type-property-policy',
|
|
148
148
|
id: currentTPP['id'],
|
|
@@ -177,7 +177,7 @@ async function uploadTypePropertyPolicyLinks(reducedTypePropertyPolicyLinks) {
|
|
|
177
177
|
const foundTypeProperty = typeProperties.find((tp) => tp.id === currentLink.typePropertyId);
|
|
178
178
|
const foundTPP = currentTPPs.find((tpp) => tpp.id === currentLink.typePropertyPolicyId);
|
|
179
179
|
if (!foundTypeProperty || !foundTPP) {
|
|
180
|
-
logger_1.default.info(`skipping unhashable, invalid policy link:
|
|
180
|
+
logger_1.default.info(`skipping unhashable, invalid policy link: ${currentLink}`);
|
|
181
181
|
}
|
|
182
182
|
const hash = `${foundTypeProperty.typeSlug}${foundTypeProperty.slug}|${foundTPP.identifier}`;
|
|
183
183
|
currentLinksHashes[hash] = currentLink;
|
|
@@ -216,7 +216,7 @@ async function uploadTypePropertyPolicyLinks(reducedTypePropertyPolicyLinks) {
|
|
|
216
216
|
try {
|
|
217
217
|
const found = reducedLinksByHashes[currentLinkHash];
|
|
218
218
|
if (!found) {
|
|
219
|
-
logger_1.default.info(`Deleting:
|
|
219
|
+
logger_1.default.info(`Deleting: ${currentLinkHash}`);
|
|
220
220
|
await new sdk_1.Entities().delete({
|
|
221
221
|
entityName: 'type-property-policy-link',
|
|
222
222
|
id: currentLink['id'],
|
|
@@ -70,7 +70,7 @@ async function uploadUsageInfoObjects(loadedUsageInfo) {
|
|
|
70
70
|
const foundType = typesWithProperties.find((t) => t.id === currentUI.typeId);
|
|
71
71
|
const foundTypeProperty = typeProperties.find((tp) => tp.id === currentUI.typePropertyId);
|
|
72
72
|
if (!foundType || !foundTypeProperty) {
|
|
73
|
-
logger_1.default.info(`skipping unhashable, invalid usage info:
|
|
73
|
+
logger_1.default.info(`skipping unhashable, invalid usage info: ${currentUI}`);
|
|
74
74
|
continue;
|
|
75
75
|
}
|
|
76
76
|
const hash = `${foundType.slug}|${foundTypeProperty.slug}`;
|
|
@@ -81,7 +81,7 @@ async function uploadUsageInfoObjects(loadedUsageInfo) {
|
|
|
81
81
|
const hash = `${loadedUI.typeSlug}|${loadedUI.typePropertySlug}`;
|
|
82
82
|
reducedUsageInfoHashes[hash] = loadedUI;
|
|
83
83
|
}
|
|
84
|
-
logger_1.default.debug(`current usage info:
|
|
84
|
+
logger_1.default.debug(`current usage info: ${currentUsageInfo}`);
|
|
85
85
|
logger_1.default.debug('loaded usage info:', loadedUsageInfo);
|
|
86
86
|
for (const loadedUI of loadedUsageInfo) {
|
|
87
87
|
try {
|
|
@@ -90,7 +90,7 @@ async function uploadUsageInfoObjects(loadedUsageInfo) {
|
|
|
90
90
|
if (!transformReducedUI(loadedUI, typesWithProperties, typeProperties)) {
|
|
91
91
|
continue;
|
|
92
92
|
}
|
|
93
|
-
logger_1.default.debug(`Creating:
|
|
93
|
+
logger_1.default.debug(`Creating: ${loadedUI}`);
|
|
94
94
|
await new sdk_1.Entities().create({
|
|
95
95
|
entityName: 'type-property-usage-info',
|
|
96
96
|
object: {
|
|
@@ -110,7 +110,7 @@ async function uploadUsageInfoObjects(loadedUsageInfo) {
|
|
|
110
110
|
if (!transformReducedUI(loadedUI, typesWithProperties, typeProperties)) {
|
|
111
111
|
continue;
|
|
112
112
|
}
|
|
113
|
-
logger_1.default.info(`Updating:
|
|
113
|
+
logger_1.default.info(`Updating: ${loadedUI}`);
|
|
114
114
|
await new sdk_1.Entities().update({
|
|
115
115
|
entityName: 'type-property-usage-info',
|
|
116
116
|
id: found.id,
|
|
@@ -129,7 +129,7 @@ async function uploadUsageInfoObjects(loadedUsageInfo) {
|
|
|
129
129
|
try {
|
|
130
130
|
const found = reducedUsageInfoHashes[hash];
|
|
131
131
|
if (!found) {
|
|
132
|
-
logger_1.default.debug(`Creating:
|
|
132
|
+
logger_1.default.debug(`Creating: ${hash}`);
|
|
133
133
|
await new sdk_1.Entities().delete({
|
|
134
134
|
entityName: 'type-property-usage-info',
|
|
135
135
|
id: currentUI['id'],
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const core_1 = require("@oclif/core");
|
|
4
|
-
const login_1 = require("../../auth/login");
|
|
5
4
|
const webhooks_1 = require("../../api/webhooks");
|
|
5
|
+
const login_1 = require("../../auth/login");
|
|
6
6
|
const basecommand_1 = require("../../basecommand");
|
|
7
7
|
class ListWebhooks extends basecommand_1.BaseCommand {
|
|
8
8
|
async run() {
|
|
@@ -113,6 +113,7 @@ class AppDeployer {
|
|
|
113
113
|
: [];
|
|
114
114
|
const updates = {
|
|
115
115
|
name: appDeclaration.appName,
|
|
116
|
+
version: appDeclaration.version,
|
|
116
117
|
public: appDeclaration.visibility === 'public',
|
|
117
118
|
hidden: appDeclaration.hidden,
|
|
118
119
|
description: appDeclaration.appDescription,
|
|
@@ -127,6 +128,7 @@ class AppDeployer {
|
|
|
127
128
|
appCodePackageId: appCodePackageId !== null && appCodePackageId !== void 0 ? appCodePackageId : null,
|
|
128
129
|
frameworkVersion: 2,
|
|
129
130
|
};
|
|
131
|
+
logger_1.default.debug(`app update: ${JSON.stringify(updates, null, 2)}`);
|
|
130
132
|
if (this.dryRun) {
|
|
131
133
|
logger_1.default.info('Dry run, not creating app');
|
|
132
134
|
return {};
|
|
@@ -69,7 +69,7 @@ async function uploadReducedTypes(dir) {
|
|
|
69
69
|
logger_1.default.info(`Cannot create a base type. Skipping: ${type.slug}`);
|
|
70
70
|
continue;
|
|
71
71
|
}
|
|
72
|
-
logger_1.default.info(`Creating Type:
|
|
72
|
+
logger_1.default.info(`Creating Type: ${type.slug}`);
|
|
73
73
|
const createdType = await new sdk_1.Entities().create({
|
|
74
74
|
entityName: 'type',
|
|
75
75
|
object: {
|
|
@@ -84,7 +84,7 @@ async function uploadReducedTypes(dir) {
|
|
|
84
84
|
await uploadReducedTypeProperties(createdType, newTypeProperties, type.typeProperties);
|
|
85
85
|
}
|
|
86
86
|
else {
|
|
87
|
-
logger_1.default.info(`Updating Type:
|
|
87
|
+
logger_1.default.info(`Updating Type: ${type.slug}`);
|
|
88
88
|
const updatedType = await new sdk_1.Entities().update({
|
|
89
89
|
entityName: 'type',
|
|
90
90
|
id: found.id,
|
|
@@ -124,7 +124,7 @@ async function uploadReducedTypeProperties(type, currentPropertyTypes, newProper
|
|
|
124
124
|
try {
|
|
125
125
|
const found = currentPropertyTypeBySlug[newPropertyType.slug];
|
|
126
126
|
if (!found && !newPropertyType.inherited) {
|
|
127
|
-
logger_1.default.info(`Creating Type-Property:
|
|
127
|
+
logger_1.default.info(`Creating Type-Property: ${newPropertyType.slug}`);
|
|
128
128
|
await sdk_1.Request.request(`/types/${type.id}/type-properties`, {
|
|
129
129
|
method: 'POST',
|
|
130
130
|
body: JSON.stringify({
|
|
@@ -155,7 +155,7 @@ async function uploadReducedTypeProperties(type, currentPropertyTypes, newProper
|
|
|
155
155
|
else if (found &&
|
|
156
156
|
!newPropertyType.inherited &&
|
|
157
157
|
!typePropertiesEqual(found, newPropertyType, optionSetIdByIdentifier)) {
|
|
158
|
-
logger_1.default.info(`Updating Type-Property:
|
|
158
|
+
logger_1.default.info(`Updating Type-Property: ${newPropertyType.slug}`);
|
|
159
159
|
await new sdk_1.Entities().update({
|
|
160
160
|
entityName: 'type-property',
|
|
161
161
|
id: found.id,
|
|
@@ -189,7 +189,7 @@ async function uploadReducedTypeProperties(type, currentPropertyTypes, newProper
|
|
|
189
189
|
try {
|
|
190
190
|
const found = newPropertyTypesBySlug[currentPropertyType.slug];
|
|
191
191
|
if (!found && !currentPropertyType.inherited) {
|
|
192
|
-
logger_1.default.info(`Deleting Type-Property:
|
|
192
|
+
logger_1.default.info(`Deleting Type-Property: ${currentPropertyType.slug}`);
|
|
193
193
|
await sdk_1.Request.request(`/types/${type.id}/type-properties/${currentPropertyType.id}`, {
|
|
194
194
|
method: 'DELETE',
|
|
195
195
|
headers: {
|
package/oclif.manifest.json
CHANGED