@contrail/cli 3.6.0-alpha-8-alpha.668a0d5 → 3.6.0-alpha-8-alpha.6d0c626
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.6.0-alpha-8-alpha.
|
|
20
|
+
@contrail/cli/3.6.0-alpha-8-alpha.6d0c626 linux-x64 node-v24.20.0
|
|
21
21
|
$ contrail --help [COMMAND]
|
|
22
22
|
USAGE
|
|
23
23
|
$ contrail COMMAND
|
|
@@ -98,7 +98,21 @@ async function deleteEntityByIds(entityName, ids) {
|
|
|
98
98
|
async function deleteEntityById(entityName, id) {
|
|
99
99
|
const client = new sdk_1.Entities();
|
|
100
100
|
if (IS_DRY_RUN) {
|
|
101
|
-
return client.get({ entityName, id, ignore404: true });
|
|
101
|
+
return client.get({ entityName, id, ignore404: true }).catch(throwIfNot404);
|
|
102
102
|
}
|
|
103
|
-
return client.delete({ entityName, id, ignore404: true });
|
|
103
|
+
return client.delete({ entityName, id, ignore404: true }).catch(throwIfNot404);
|
|
104
|
+
}
|
|
105
|
+
function throwIfNot404(e) {
|
|
106
|
+
const { statusCode } = parseSDKErrorMessage(e);
|
|
107
|
+
if (statusCode === 404) {
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
throw e;
|
|
111
|
+
}
|
|
112
|
+
function parseSDKErrorMessage(e) {
|
|
113
|
+
const parsed = JSON.parse(e.details);
|
|
114
|
+
return {
|
|
115
|
+
statusCode: parsed.statusCode,
|
|
116
|
+
message: parsed.message,
|
|
117
|
+
};
|
|
104
118
|
}
|
|
@@ -183,8 +183,7 @@ async function find(entityName, options = {}) {
|
|
|
183
183
|
return (0, batchFetch_1.batchFetch)(entityName, payload);
|
|
184
184
|
}
|
|
185
185
|
else {
|
|
186
|
-
|
|
187
|
-
return client.get(id ? { ...payload, ignore404: true } : payload);
|
|
186
|
+
return client.get(payload);
|
|
188
187
|
}
|
|
189
188
|
}
|
|
190
189
|
async function* streamPaginatedFind(typePath, options = {}) {
|
package/oclif.manifest.json
CHANGED