@codiac.io/codiac-cli 1.3.121 → 1.3.123
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/i-client.d.ts +12 -0
- package/dist/apis/codiac-api-nats/gen/client.d.ts +5 -0
- package/dist/apis/codiac-api-nats/gen/client.js +22 -8
- package/dist/apis/codiac-api-nats/gen/client.js.map +1 -1
- package/dist/apis/codiac-api-nats/gen/config.d.ts +2 -1
- package/dist/apis/codiac-api-nats/gen/config.js +3 -2
- package/dist/apis/codiac-api-nats/gen/config.js.map +1 -1
- package/dist/apis/codiac-relay/gen/contracts/types.gen.d.ts +10 -3
- package/dist/apis/codiac-relay/gen/contracts/types.gen.js.map +1 -1
- package/dist/apis/codiac-relay-nats/common/creds.d.ts +8 -0
- package/dist/apis/codiac-relay-nats/common/creds.js +19 -0
- package/dist/apis/codiac-relay-nats/common/creds.js.map +1 -0
- package/dist/apis/codiac-relay-nats/common/token-utils.d.ts +11 -0
- package/dist/apis/codiac-relay-nats/common/token-utils.js +84 -0
- package/dist/apis/codiac-relay-nats/common/token-utils.js.map +1 -0
- package/dist/apis/codiac-relay-nats/common/token.d.ts +4 -0
- package/dist/apis/codiac-relay-nats/common/token.js +16 -0
- package/dist/apis/codiac-relay-nats/common/token.js.map +1 -0
- package/dist/apis/codiac-relay-nats/common/types.d.ts +8 -0
- package/dist/apis/codiac-relay-nats/common/types.js +3 -0
- package/dist/apis/codiac-relay-nats/common/types.js.map +1 -0
- package/dist/apis/codiac-relay-nats/common/utils.d.ts +56 -0
- package/dist/apis/codiac-relay-nats/common/utils.js +323 -0
- package/dist/apis/codiac-relay-nats/common/utils.js.map +1 -0
- package/dist/apis/codiac-relay-nats/gen/client.d.ts +995 -0
- package/dist/apis/codiac-relay-nats/gen/client.js +5750 -0
- package/dist/apis/codiac-relay-nats/gen/client.js.map +1 -0
- package/dist/apis/codiac-relay-nats/gen/config.d.ts +19 -0
- package/dist/apis/codiac-relay-nats/gen/config.js +19 -0
- package/dist/apis/codiac-relay-nats/gen/config.js.map +1 -0
- package/dist/apis/codiac-relay-nats/gen/contracts/index.d.ts +1 -0
- package/dist/apis/codiac-relay-nats/gen/contracts/index.js +6 -0
- package/dist/apis/codiac-relay-nats/gen/contracts/index.js.map +1 -0
- package/dist/apis/codiac-relay-nats/gen/contracts/transformers.gen.d.ts +315 -0
- package/dist/apis/codiac-relay-nats/gen/contracts/transformers.gen.js +3656 -0
- package/dist/apis/codiac-relay-nats/gen/contracts/transformers.gen.js.map +1 -0
- package/dist/apis/codiac-relay-nats/gen/contracts/types.gen.d.ts +16515 -0
- package/dist/apis/codiac-relay-nats/gen/contracts/types.gen.js +408 -0
- package/dist/apis/codiac-relay-nats/gen/contracts/types.gen.js.map +1 -0
- package/dist/apis/codiac-relay-nats/gen/contracts.ng.d.ts +4517 -0
- package/dist/apis/codiac-relay-nats/gen/contracts.ng.js +573 -0
- package/dist/apis/codiac-relay-nats/gen/contracts.ng.js.map +1 -0
- package/dist/apis/codiac-relay-nats/index.d.ts +3 -0
- package/dist/apis/codiac-relay-nats/index.js +7 -0
- package/dist/apis/codiac-relay-nats/index.js.map +1 -0
- package/dist/bootstrapper-for-api-clients.d.ts +6 -0
- package/dist/bootstrapper-for-api-clients.js +110 -0
- package/dist/bootstrapper-for-api-clients.js.map +1 -0
- package/dist/bootstrapper-for-enterprise-commands.js +2 -59
- package/dist/bootstrapper-for-enterprise-commands.js.map +1 -1
- package/dist/command-base-enterprise.js +17 -4
- package/dist/command-base-enterprise.js.map +1 -1
- package/dist/command-base-exec-tenant.js +11 -4
- package/dist/command-base-exec-tenant.js.map +1 -1
- package/dist/commands/asset/view.js +1 -1
- package/dist/commands/asset/view.js.map +1 -1
- package/dist/commands/cluster/connect.js +1 -1
- package/dist/commands/cluster/connect.js.map +1 -1
- package/dist/commands/csp/login.d.ts +25 -6
- package/dist/commands/csp/login.js +186 -142
- package/dist/commands/csp/login.js.map +1 -1
- package/dist/commands/csp/logout.d.ts +5 -3
- package/dist/commands/csp/logout.js +27 -16
- package/dist/commands/csp/logout.js.map +1 -1
- package/dist/commands/noc/cluster/forget.js +3 -3
- package/dist/commands/noc/cluster/forget.js.map +1 -1
- package/dist/ops/k8s/k8s-utils.d.ts +2 -1
- package/dist/ops/k8s/k8s-utils.js +4 -3
- package/dist/ops/k8s/k8s-utils.js.map +1 -1
- package/dist/ops/k8s/kube-config-utils.d.ts +2 -1
- package/dist/ops/k8s/kube-config-utils.js +1 -1
- package/dist/ops/k8s/kube-config-utils.js.map +1 -1
- package/dist/read-stdin.js +7 -6
- package/dist/read-stdin.js.map +1 -1
- package/dist/relay/relay-container.js +1 -1
- package/dist/sdk/i-login-configurator.d.ts +2 -1
- package/dist/sdk-adapters/azure/az-interactive-login-configurator.d.ts +2 -2
- package/dist/sdk-adapters/azure/az-interactive-login-configurator.js +2 -2
- package/dist/sdk-adapters/azure/az-interactive-login-configurator.js.map +1 -1
- package/dist/sdk-adapters/docker-hub/docker-hub-resource-configurator.js +1 -0
- package/dist/sdk-adapters/docker-hub/docker-hub-resource-configurator.js.map +1 -1
- package/dist/uilogic/cloud-provider-contextualizer.d.ts +5 -1
- package/dist/uilogic/cloud-provider-contextualizer.js +48 -7
- package/dist/uilogic/cloud-provider-contextualizer.js.map +1 -1
- package/oclif.manifest.json +60 -11
- 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.123 linux-x64 node-v16.17.1
|
|
25
25
|
$ codiac --help [COMMAND]
|
|
26
26
|
USAGE
|
|
27
27
|
$ codiac COMMAND
|
|
@@ -4,6 +4,18 @@ import { IRepoOptions, IThrowingRepoOptions } from "@codiac.io/codiac-common";
|
|
|
4
4
|
import { UpdatePartialWhereRequest } from "@codiac.io/codiac-common/contracts";
|
|
5
5
|
import { ListResult, BatchResult, SingleResult, PatchSpecForOne, PatchSpecForMany, IdSpecFor } from "@codiac.io/codiac-common/contracts";
|
|
6
6
|
import * as Contracts from './contracts';
|
|
7
|
+
/** Exposes the inner request call to allow a child class
|
|
8
|
+
* to override the core comms behavior. */
|
|
9
|
+
export interface IStackableNatsClient {
|
|
10
|
+
request<TRequest, TResponse>(subject: string, req?: TRequest, options?: IRepoOptions): Promise<TResponse>;
|
|
11
|
+
supportsSubject(subject: string): boolean;
|
|
12
|
+
/** Attempts to find the operationId for the endpoint that supports the given subject
|
|
13
|
+
* (Throws if not found)
|
|
14
|
+
*
|
|
15
|
+
* @param subject Must be in its template form, with variables not hydrated) eg: `"get.shoes.:vendor"`, NOT `"get.shoes.nike"`
|
|
16
|
+
* */
|
|
17
|
+
opFor(subject: string): string;
|
|
18
|
+
}
|
|
7
19
|
export interface ICodiacClient {
|
|
8
20
|
apiRootUrl?: string;
|
|
9
21
|
setUserToken(token: string): void;
|
|
@@ -33,6 +33,11 @@ export declare class CodiacNatsClient {
|
|
|
33
33
|
connect(): Promise<Nats.ServerInfo | undefined>;
|
|
34
34
|
isConnected(): boolean;
|
|
35
35
|
disconnect(): Promise<void>;
|
|
36
|
+
/** Disregards any instances and checks the underlying connection store
|
|
37
|
+
* for any connections that are currently not closed or draining. */
|
|
38
|
+
static areAnyConnected(): boolean;
|
|
39
|
+
/** Closes any unclosed connections in the underlying connection store (regardless of instances). */
|
|
40
|
+
static disconnectAll(): Promise<void>;
|
|
36
41
|
/** Declaration of what messaging protocol to connect with. */
|
|
37
42
|
private clientType;
|
|
38
43
|
get tokenCredentials(): TokenCreds | undefined;
|
|
@@ -29,7 +29,7 @@ let CodiacNatsClient = CodiacNatsClient_1 = class CodiacNatsClient {
|
|
|
29
29
|
ioc.rebind(config_1.CodiacNatsClientConfig).toConstantValue(ultimate);
|
|
30
30
|
}
|
|
31
31
|
else {
|
|
32
|
-
const ultimate = _.assignIn(this.DEFAULTS, settings);
|
|
32
|
+
const ultimate = _.assignIn({}, this.DEFAULTS, settings);
|
|
33
33
|
ioc.bind(config_1.CodiacNatsClientConfig).toConstantValue(ultimate);
|
|
34
34
|
}
|
|
35
35
|
// COMMENTED OUT BC:
|
|
@@ -166,20 +166,33 @@ let CodiacNatsClient = CodiacNatsClient_1 = class CodiacNatsClient {
|
|
|
166
166
|
return (_c = CodiacNatsClient_1.nc) === null || _c === void 0 ? void 0 : _c.info;
|
|
167
167
|
}
|
|
168
168
|
catch (err) {
|
|
169
|
-
|
|
169
|
+
err.message = "Error connecting to nats: ".concat((_d = err.message) !== null && _d !== void 0 ? _d : "(no error message available)");
|
|
170
|
+
this.logger.error(err.message);
|
|
170
171
|
throw err;
|
|
171
172
|
}
|
|
172
173
|
});
|
|
173
174
|
}
|
|
174
175
|
isConnected() {
|
|
175
|
-
|
|
176
|
-
return (CodiacNatsClient_1.nc != undefined) && (!CodiacNatsClient_1.nc.isClosed() && !CodiacNatsClient_1.nc.isDraining());
|
|
176
|
+
return CodiacNatsClient_1.areAnyConnected();
|
|
177
177
|
}
|
|
178
178
|
disconnect() {
|
|
179
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
180
|
+
yield CodiacNatsClient_1.disconnectAll();
|
|
181
|
+
return;
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
/** Disregards any instances and checks the underlying connection store
|
|
185
|
+
* for any connections that are currently not closed or draining. */
|
|
186
|
+
static areAnyConnected() {
|
|
187
|
+
// is this accurate enough? or do we need to build a listener on `RelayNatsClient.nc.status()`?
|
|
188
|
+
return (this.nc != undefined) && (!this.nc.isClosed() && !this.nc.isDraining());
|
|
189
|
+
}
|
|
190
|
+
/** Closes any unclosed connections in the underlying connection store (regardless of instances). */
|
|
191
|
+
static disconnectAll() {
|
|
179
192
|
var _a;
|
|
180
193
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
181
|
-
if (
|
|
182
|
-
yield ((_a =
|
|
194
|
+
if (this.nc != undefined && !this.nc.isClosed()) {
|
|
195
|
+
yield ((_a = this.nc) === null || _a === void 0 ? void 0 : _a.close());
|
|
183
196
|
}
|
|
184
197
|
return;
|
|
185
198
|
});
|
|
@@ -241,7 +254,7 @@ let CodiacNatsClient = CodiacNatsClient_1 = class CodiacNatsClient {
|
|
|
241
254
|
yield this.connect();
|
|
242
255
|
// disconnectNow = true;
|
|
243
256
|
}
|
|
244
|
-
const res = yield CodiacNatsClient_1.nc.request(subject, JSON.stringify(req), { headers: reqHeaders, timeout:
|
|
257
|
+
const res = yield CodiacNatsClient_1.nc.request(subject, JSON.stringify(req), { headers: reqHeaders, timeout: this.settings.requestTimeoutInMs });
|
|
245
258
|
let output = res.json();
|
|
246
259
|
// COMMENTED OUT BC: disconnect() needs to get invoked from the caller so that it can stay open for many executions.
|
|
247
260
|
// We could build some config to enable different connection paradigms, but its not necessary at the moment.
|
|
@@ -265,7 +278,8 @@ CodiacNatsClient.apiVersion = "version";
|
|
|
265
278
|
/** The name of the jwt claim in the codiac token that holds the nats credentials. */
|
|
266
279
|
CodiacNatsClient.CLAIM_FOR_GLOBAL_CLIENT_KEY = "gck";
|
|
267
280
|
CodiacNatsClient.DEFAULTS = {
|
|
268
|
-
baseUrl: "ws://localhost:9222"
|
|
281
|
+
baseUrl: "ws://localhost:9222",
|
|
282
|
+
requestTimeoutInMs: 15000
|
|
269
283
|
};
|
|
270
284
|
CodiacNatsClient = CodiacNatsClient_1 = tslib_1.__decorate([
|
|
271
285
|
(0, inversify_1.injectable)(),
|