@codiac.io/codiac-cli 1.3.83 → 1.3.85
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/apis/codiac-api-nats/gen/client.d.ts +4 -4
- package/dist/apis/codiac-api-nats/gen/client.js +72 -54
- package/dist/apis/codiac-api-nats/gen/client.js.map +1 -1
- package/dist/command-base-enterprise.d.ts +5 -0
- package/dist/command-base-enterprise.js +23 -7
- package/dist/command-base-enterprise.js.map +1 -1
- package/dist/command-base-exec-tenant.js +8 -2
- package/dist/command-base-exec-tenant.js.map +1 -1
- package/dist/command-base-exec.js +8 -2
- package/dist/command-base-exec.js.map +1 -1
- package/dist/commands/asset/list.js +3 -0
- package/dist/commands/asset/list.js.map +1 -1
- package/dist/commands/asset/probe/create.js +4 -0
- package/dist/commands/asset/probe/create.js.map +1 -1
- package/dist/commands/asset/recycle.js +3 -0
- package/dist/commands/asset/recycle.js.map +1 -1
- package/dist/commands/asset/undeploy.js +7 -0
- package/dist/commands/asset/undeploy.js.map +1 -1
- package/dist/commands/asset/view.js +5 -2
- package/dist/commands/asset/view.js.map +1 -1
- package/dist/commands/asset/volume/create.js +107 -98
- package/dist/commands/asset/volume/create.js.map +1 -1
- package/dist/commands/asset/volume/delete.js +50 -41
- package/dist/commands/asset/volume/delete.js.map +1 -1
- package/dist/commands/asset/volume/list.js +23 -14
- package/dist/commands/asset/volume/list.js.map +1 -1
- package/dist/commands/cabinet/list.js +4 -2
- package/dist/commands/cabinet/list.js.map +1 -1
- package/dist/commands/config/add.js +5 -0
- package/dist/commands/config/add.js.map +1 -1
- package/dist/commands/config/delete.js +4 -0
- package/dist/commands/config/delete.js.map +1 -1
- package/dist/commands/config/deploy.js +4 -0
- package/dist/commands/config/deploy.js.map +1 -1
- package/dist/commands/config/import.js +108 -98
- package/dist/commands/config/import.js.map +1 -1
- package/dist/commands/config/settings/get.js +4 -0
- package/dist/commands/config/settings/get.js.map +1 -1
- package/dist/commands/config/view.js +72 -59
- package/dist/commands/config/view.js.map +1 -1
- package/dist/commands/csp/login.js +6 -0
- package/dist/commands/csp/login.js.map +1 -1
- package/dist/commands/csp/logout.js +3 -0
- package/dist/commands/csp/logout.js.map +1 -1
- package/dist/commands/deploy.js +3 -0
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/enterprise/list.js +5 -1
- package/dist/commands/enterprise/list.js.map +1 -1
- package/dist/commands/env/add.js +107 -97
- package/dist/commands/env/add.js.map +1 -1
- package/dist/commands/environment/list.js +5 -2
- package/dist/commands/environment/list.js.map +1 -1
- package/dist/commands/host/map.js +97 -87
- package/dist/commands/host/map.js.map +1 -1
- package/dist/commands/imageRegistry/capture.js +4 -3
- package/dist/commands/imageRegistry/capture.js.map +1 -1
- package/dist/commands/imageRegistry/forget.js +4 -3
- package/dist/commands/imageRegistry/forget.js.map +1 -1
- package/dist/commands/imageRegistry/pullSecret/set.js +4 -3
- package/dist/commands/imageRegistry/pullSecret/set.js.map +1 -1
- package/dist/commands/imageRegistry/pullSecret/unset.js +4 -3
- package/dist/commands/imageRegistry/pullSecret/unset.js.map +1 -1
- package/dist/commands/images/add.js +37 -28
- package/dist/commands/images/add.js.map +1 -1
- package/dist/commands/kit/create.js +3 -2
- package/dist/commands/kit/create.js.map +1 -1
- package/dist/commands/login.js +3 -0
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/logout.js +3 -0
- package/dist/commands/logout.js.map +1 -1
- package/dist/commands/noc/cluster/deinit.js +9 -3
- package/dist/commands/noc/cluster/deinit.js.map +1 -1
- package/dist/commands/noc/cluster/grant.js +61 -49
- package/dist/commands/noc/cluster/grant.js.map +1 -1
- package/dist/commands/noc/cluster/init.js +9 -3
- package/dist/commands/noc/cluster/init.js.map +1 -1
- package/dist/commands/noc/cluster/list.js +5 -2
- package/dist/commands/noc/cluster/list.js.map +1 -1
- package/dist/commands/noc/cluster/recreate.js +24 -14
- package/dist/commands/noc/cluster/recreate.js.map +1 -1
- package/dist/commands/portal.js +3 -0
- package/dist/commands/portal.js.map +1 -1
- package/dist/commands/secretStore/capture.js +35 -36
- package/dist/commands/secretStore/capture.js.map +1 -1
- package/dist/commands/secretStore/forget.js +32 -33
- package/dist/commands/secretStore/forget.js.map +1 -1
- package/dist/commands/tenant/create.js +34 -32
- package/dist/commands/tenant/create.js.map +1 -1
- package/dist/commands/tenant/switch.js +30 -34
- package/dist/commands/tenant/switch.js.map +1 -1
- package/dist/commands/whereami.js +3 -0
- package/dist/commands/whereami.js.map +1 -1
- package/dist/relay/relay-container.js +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ $ npm install -g @codiac.io/codiac-cli
|
|
|
21
21
|
$ codiac COMMAND
|
|
22
22
|
running command...
|
|
23
23
|
$ codiac (--version|-v)
|
|
24
|
-
@codiac.io/codiac-cli/1.3.
|
|
24
|
+
@codiac.io/codiac-cli/1.3.85 linux-x64 node-v16.17.1
|
|
25
25
|
$ codiac --help [COMMAND]
|
|
26
26
|
USAGE
|
|
27
27
|
$ codiac COMMAND
|
|
@@ -2540,10 +2540,10 @@ declare class OtherOperations {
|
|
|
2540
2540
|
/** Shows the cabinets to which the given asset is currently deployed and which version is where. */
|
|
2541
2541
|
assetWhere(request: Contracts.AssetWhereRequest, options?: IRepoOptions): Promise<ListResult<Contracts.CabinetAssetVersion>>;
|
|
2542
2542
|
/** Retrieves the enterprise configuration currently in play in a single given cabinet,
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2543
|
+
in terms of versions of the enterprise and its assets.
|
|
2544
|
+
This is a composite/hybrid object made up of a Cabinet, EnterpriseVersionConfig and an EnterpriseRunState.
|
|
2545
|
+
Compares versions of each asset between the version specified in the assigned enterprise version config
|
|
2546
|
+
and the version that is actually physically running in the cabinet. */
|
|
2547
2547
|
getCabinetConfigState(request: Contracts.CabinetConfigStateRequest, options?: IRepoOptions): Promise<Contracts.CabinetConfigState>;
|
|
2548
2548
|
/** Retrieves all available enterprises, environments, cabinets, and clusters for the given tenant. */
|
|
2549
2549
|
getCabinetScopes(request: Contracts.CabinetScopesCriteria, options?: IRepoOptions): Promise<ListResult<Contracts.EnterpriseScope>>;
|
|
@@ -133,35 +133,42 @@ let CodiacNatsClient = CodiacNatsClient_1 = class CodiacNatsClient {
|
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
connect() {
|
|
136
|
-
var _a, _b, _c;
|
|
137
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
136
|
+
var _a, _b, _c, _d;
|
|
137
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
138
|
+
try {
|
|
139
|
+
// Assemble authenticator from codiac jwt
|
|
140
|
+
const codiacJwt = (_a = this._tokenCredentials) === null || _a === void 0 ? void 0 : _a.jwtToken;
|
|
141
|
+
if (codiacJwt == undefined) {
|
|
142
|
+
throw new Error("No token client available.");
|
|
143
|
+
}
|
|
144
|
+
const payload = (_b = new jwt.JwtEncoder().tryDecode(codiacJwt)) === null || _b === void 0 ? void 0 : _b.payload;
|
|
145
|
+
if (payload == undefined)
|
|
146
|
+
throw new Error("Empty jwt payload");
|
|
147
|
+
const gck = payload[CodiacNatsClient_1.CLAIM_FOR_GLOBAL_CLIENT_KEY];
|
|
148
|
+
if (gck == undefined)
|
|
149
|
+
throw new Error("No global client key was available in the token payload.");
|
|
150
|
+
const natsCreds = buffer_1.Buffer.from(gck, 'base64').toString('utf-8');
|
|
151
|
+
const opts = {
|
|
152
|
+
servers: this.settings.baseUrl,
|
|
153
|
+
authenticator: [
|
|
154
|
+
Nats.tokenAuthenticator(codiacJwt),
|
|
155
|
+
Nats.credsAuthenticator(new TextEncoder().encode(natsCreds))
|
|
156
|
+
],
|
|
157
|
+
verbose: true
|
|
158
|
+
};
|
|
159
|
+
if (this.clientType === "websockets") {
|
|
160
|
+
CodiacNatsClient_1._nc = yield Nats.wsconnect(opts);
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
CodiacNatsClient_1._nc = yield Transport.connect(opts);
|
|
164
|
+
}
|
|
165
|
+
this.logger.write(`Connected to ${this.settings.baseUrl}`);
|
|
166
|
+
return (_c = CodiacNatsClient_1.nc) === null || _c === void 0 ? void 0 : _c.info;
|
|
159
167
|
}
|
|
160
|
-
|
|
161
|
-
|
|
168
|
+
catch (err) {
|
|
169
|
+
this.logger.error((_d = err.message) !== null && _d !== void 0 ? _d : "Error connecting to nats: (no error message available)");
|
|
170
|
+
throw err;
|
|
162
171
|
}
|
|
163
|
-
this.logger.write(`Connected to ${this.settings.baseUrl}`);
|
|
164
|
-
return (_c = CodiacNatsClient_1.nc) === null || _c === void 0 ? void 0 : _c.info;
|
|
165
172
|
});
|
|
166
173
|
}
|
|
167
174
|
isConnected() {
|
|
@@ -200,7 +207,7 @@ let CodiacNatsClient = CodiacNatsClient_1 = class CodiacNatsClient {
|
|
|
200
207
|
// const values = isGet ? this.getValues(req) : { ...req };
|
|
201
208
|
const loadedSubject = Utils.hydrateSubjectParams(subject, req);
|
|
202
209
|
const headers = options ? Utils.headersFrom(options) : undefined;
|
|
203
|
-
return this.makeRequest(loadedSubject, req, headers);
|
|
210
|
+
return yield this.makeRequest(loadedSubject, req, headers);
|
|
204
211
|
}
|
|
205
212
|
catch (error) {
|
|
206
213
|
if (noThrow) {
|
|
@@ -213,31 +220,42 @@ let CodiacNatsClient = CodiacNatsClient_1 = class CodiacNatsClient {
|
|
|
213
220
|
}
|
|
214
221
|
makeRequest(subject, req, headers) {
|
|
215
222
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
216
|
-
return new Promise((resolve, reject) =>
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}
|
|
223
|
+
// return new Promise<TResponse>(async (resolve, reject) => {
|
|
224
|
+
try {
|
|
225
|
+
// this.logger.detail(`Api client making request: ${httpVerb} ${url?.split("?")[0]}`);
|
|
226
|
+
let reqHeaders = Nats.headers();
|
|
227
|
+
reqHeaders.append("content-type", "application/json");
|
|
228
|
+
if (this.tokenCredentials) {
|
|
229
|
+
reqHeaders.append(CodiacNatsClient_1.DEFAULT_TOKEN_HEADER_PARAM, this.tokenCredentials.jwtToken);
|
|
230
|
+
}
|
|
231
|
+
if (headers) {
|
|
232
|
+
for (let headerKey in headers) {
|
|
233
|
+
if (headers[headerKey])
|
|
234
|
+
reqHeaders.append(headerKey, headers[headerKey]);
|
|
229
235
|
}
|
|
230
|
-
if (!this.isConnected())
|
|
231
|
-
yield this.connect();
|
|
232
|
-
const res = yield CodiacNatsClient_1.nc.request(subject, JSON.stringify(req), { headers: reqHeaders, timeout: 5000 });
|
|
233
|
-
resolve(res.json());
|
|
234
236
|
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
237
|
+
/** Determines whether a connection needs to be
|
|
238
|
+
* opened (and closed) just for this request. */
|
|
239
|
+
// let disconnectNow = false;
|
|
240
|
+
if (!this.isConnected()) {
|
|
241
|
+
yield this.connect();
|
|
242
|
+
// disconnectNow = true;
|
|
239
243
|
}
|
|
240
|
-
|
|
244
|
+
const res = yield CodiacNatsClient_1.nc.request(subject, JSON.stringify(req), { headers: reqHeaders, timeout: 5000 });
|
|
245
|
+
let output = res.json();
|
|
246
|
+
// COMMENTED OUT BC: disconnect() needs to get invoked from the caller so that it can stay open for many executions.
|
|
247
|
+
// We could build some config to enable different connection paradigms, but its not necessary at the moment.
|
|
248
|
+
// if (disconnectNow) {
|
|
249
|
+
// await this.disconnect();
|
|
250
|
+
// }
|
|
251
|
+
return output;
|
|
252
|
+
}
|
|
253
|
+
catch (err) {
|
|
254
|
+
this.logger.error(`Error making call: ${err.message}`, { subject: subject, error: err });
|
|
255
|
+
this.logger.debug(err);
|
|
256
|
+
throw (err);
|
|
257
|
+
}
|
|
258
|
+
// });
|
|
241
259
|
});
|
|
242
260
|
}
|
|
243
261
|
}; // end class CodiacNatsClient
|
|
@@ -15693,10 +15711,10 @@ class OtherOperations {
|
|
|
15693
15711
|
});
|
|
15694
15712
|
}
|
|
15695
15713
|
/** Retrieves the enterprise configuration currently in play in a single given cabinet,
|
|
15696
|
-
|
|
15697
|
-
|
|
15698
|
-
|
|
15699
|
-
|
|
15714
|
+
in terms of versions of the enterprise and its assets.
|
|
15715
|
+
This is a composite/hybrid object made up of a Cabinet, EnterpriseVersionConfig and an EnterpriseRunState.
|
|
15716
|
+
Compares versions of each asset between the version specified in the assigned enterprise version config
|
|
15717
|
+
and the version that is actually physically running in the cabinet. */
|
|
15700
15718
|
getCabinetConfigState(request, options) {
|
|
15701
15719
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
15702
15720
|
return yield this.core.request("get.enterprise.:enterprise.cabinet.:cabinet.config-state", request, options);
|