@codiac.io/codiac-cli 1.3.120 → 1.3.122
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/codiac-constants.d.ts +1 -1
- package/dist/codiac-constants.js +1 -1
- package/dist/codiac-constants.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/aws/aws-resource-configurator.js +13 -9
- package/dist/sdk-adapters/aws/aws-resource-configurator.js.map +1 -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/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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** The in-memory representation of the api client config file. */
|
|
2
2
|
export declare class CodiacNatsClientConfig {
|
|
3
|
-
constructor(baseUrl: string);
|
|
3
|
+
constructor(baseUrl: string, requestTimeoutInMs: number);
|
|
4
4
|
/** Fully-qualified url to the target nats service.
|
|
5
5
|
* Protocol prefix must be:
|
|
6
6
|
* * Nats (`"nats://"`)
|
|
@@ -14,4 +14,5 @@ export declare class CodiacNatsClientConfig {
|
|
|
14
14
|
* ***NOTE:*** Client mode (nats or websockets) will be derived from the protocol specified in this url.
|
|
15
15
|
*/
|
|
16
16
|
baseUrl: string;
|
|
17
|
+
requestTimeoutInMs: number;
|
|
17
18
|
}
|
|
@@ -5,13 +5,14 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const inversify_1 = require("inversify");
|
|
6
6
|
/** The in-memory representation of the api client config file. */
|
|
7
7
|
let CodiacNatsClientConfig = class CodiacNatsClientConfig {
|
|
8
|
-
constructor(baseUrl) {
|
|
8
|
+
constructor(baseUrl, requestTimeoutInMs) {
|
|
9
9
|
this.baseUrl = baseUrl;
|
|
10
|
+
this.requestTimeoutInMs = requestTimeoutInMs;
|
|
10
11
|
}
|
|
11
12
|
};
|
|
12
13
|
CodiacNatsClientConfig = tslib_1.__decorate([
|
|
13
14
|
(0, inversify_1.injectable)(),
|
|
14
|
-
tslib_1.__metadata("design:paramtypes", [String])
|
|
15
|
+
tslib_1.__metadata("design:paramtypes", [String, Number])
|
|
15
16
|
], CodiacNatsClientConfig);
|
|
16
17
|
exports.CodiacNatsClientConfig = CodiacNatsClientConfig;
|
|
17
18
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../src/apis/codiac-api-nats/gen/config.ts"],"names":[],"mappings":";;;;AAAA,yCAAuC;AAEvC,kEAAkE;AAE3D,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IACjC,YAAY,OAAe;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../src/apis/codiac-api-nats/gen/config.ts"],"names":[],"mappings":";;;;AAAA,yCAAuC;AAEvC,kEAAkE;AAE3D,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IACjC,YAAY,OAAe,EAAE,kBAA0B;QACrD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;IAC/C,CAAC;CAiBF,CAAA;AArBY,sBAAsB;IADlC,IAAA,sBAAU,GAAE;;GACA,sBAAsB,CAqBlC;AArBY,wDAAsB"}
|
|
@@ -2278,6 +2278,7 @@ export type CspLogoutInteractiveRequest = {
|
|
|
2278
2278
|
providerCode: CloudProviderEnum;
|
|
2279
2279
|
correlationId: string;
|
|
2280
2280
|
commChannel: CommChannelRef;
|
|
2281
|
+
accountRef?: IcspAccountFilter;
|
|
2281
2282
|
};
|
|
2282
2283
|
export type CspLogoutInteractiveResponse = {
|
|
2283
2284
|
correlationId: string;
|
|
@@ -5554,6 +5555,12 @@ export type ICommandLineProbeAction = {
|
|
|
5554
5555
|
command: Array<string>;
|
|
5555
5556
|
actionType: ProbeActionTypesEnum;
|
|
5556
5557
|
};
|
|
5558
|
+
/** Filter to help identify/select authentication creds
|
|
5559
|
+
* within a given Cloud Service Provider (CSP). */
|
|
5560
|
+
export type IcspAccountFilter = {
|
|
5561
|
+
subscriptionId?: string;
|
|
5562
|
+
tenantId?: string;
|
|
5563
|
+
};
|
|
5557
5564
|
export type IcspPrimaryCredsMeta = {
|
|
5558
5565
|
username: string;
|
|
5559
5566
|
created: Date;
|
|
@@ -15805,7 +15812,7 @@ export type ClientOptions = {
|
|
|
15805
15812
|
export type CredentialType = "client_credentials" | "username_password" | "refresh_token";
|
|
15806
15813
|
/** Indicates which authentication flow is to be used with the given credentials. */
|
|
15807
15814
|
export declare const CredentialType: {
|
|
15808
|
-
client_credentials:
|
|
15809
|
-
username_password:
|
|
15810
|
-
refresh_token:
|
|
15815
|
+
readonly client_credentials: "client_credentials";
|
|
15816
|
+
readonly username_password: "username_password";
|
|
15817
|
+
readonly refresh_token: "refresh_token";
|
|
15811
15818
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.gen.js","sourceRoot":"","sources":["../../../../../src/apis/codiac-relay/gen/contracts/types.gen.ts"],"names":[],"mappings":";AAAA,qDAAqD;;;AA8GxC,QAAA,eAAe,GAAG;IAC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A2B;CAC9C,CAAC;AAOX;;GAEG;AACU,QAAA,YAAY,GAAG;IACxB,WAAW,EAAE,aAAa;IAC1B,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,OAAO;IACd,SAAS,EAAE,WAAW;IACtB,KAAK,EAAE,OAAO;CACR,CAAC;
|
|
1
|
+
{"version":3,"file":"types.gen.js","sourceRoot":"","sources":["../../../../../src/apis/codiac-relay/gen/contracts/types.gen.ts"],"names":[],"mappings":";AAAA,qDAAqD;;;AA8GxC,QAAA,eAAe,GAAG;IAC3B,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;CACN,CAAC;AAiDE,QAAA,iBAAiB,GAAG;IAC7B,aAAa,EAAE,eAAe;IAC9B,mBAAmB,EAAE,qBAAqB;IAC1C,YAAY,EAAE,cAAc;IAC5B,KAAK,EAAE,OAAO;IACd,UAAU,EAAE,YAAY;CAClB,CAAC;AAkEX;;GAEG;AACU,QAAA,KAAK,GAAG;IACjB,CAAC,EAAE,GAAG;IACN,CAAC,EAAE,GAAG;IACN,CAAC,EAAE,GAAG;IACN,CAAC,EAAE,GAAG;IACN,CAAC,EAAE,GAAG;IACN,GAAG,EAAE,GAAG;CACF,CAAC;AA8BX;;GAEG;AACU,QAAA,QAAQ,GAAG;IACpB,CAAC,EAAE,GAAG;IACN,EAAE,EAAE,IAAI;IACR,CAAC,EAAE,GAAG;IACN,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,CAAC,EAAE,GAAG;IACN,EAAE,EAAE,IAAI;IACR,CAAC,EAAE,GAAG;IACN,EAAE,EAAE,IAAI;IACR,CAAC,EAAE,GAAG;IACN,EAAE,EAAE,IAAI;IACR,CAAC,EAAE,GAAG;CACA,CAAC;AA8CE,QAAA,cAAc,GAAG;IAC1B,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,OAAO,EAAE,SAAS;CACZ,CAAC;AAs2BE,QAAA,UAAU,GAAG;I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AG;IAC1B,kBAAkB,EAAE,oBAAoB;IACxC,iBAAiB,EAAE,mBAAmB;IACtC,aAAa,EAAE,eAAe;CACxB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NatsCreds = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const inversify_1 = require("inversify");
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
let NatsCreds = class NatsCreds {
|
|
10
|
+
constructor(authenticators) {
|
|
11
|
+
this.authenticator = authenticators !== null && authenticators !== void 0 ? authenticators : undefined;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
NatsCreds = tslib_1.__decorate([
|
|
15
|
+
(0, inversify_1.injectable)(),
|
|
16
|
+
tslib_1.__metadata("design:paramtypes", [Array])
|
|
17
|
+
], NatsCreds);
|
|
18
|
+
exports.NatsCreds = NatsCreds;
|
|
19
|
+
//# sourceMappingURL=creds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"creds.js","sourceRoot":"","sources":["../../../../src/apis/codiac-relay-nats/common/creds.ts"],"names":[],"mappings":";;;;AAAA,yCAAuC;AAGvC;;GAEG;AAEI,IAAM,SAAS,GAAf,MAAM,SAAS;IAIpB,YAAY,cAAqC;QAC/C,IAAI,CAAC,aAAa,GAAG,cAAc,aAAd,cAAc,cAAd,cAAc,GAAI,SAAS,CAAA;IAClD,CAAC;CACF,CAAA;AAPY,SAAS;IADrB,IAAA,sBAAU,GAAE;;GACA,SAAS,CAOrB;AAPY,8BAAS"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IBetterLogger } from "@codiac.io/codiac-common";
|
|
2
|
+
export declare class TokenUtils {
|
|
3
|
+
private logger;
|
|
4
|
+
constructor(logger: IBetterLogger);
|
|
5
|
+
/** Determines whether the given token is expired.
|
|
6
|
+
* @param throwOnError throws any encountered errors, including token parsing errors.
|
|
7
|
+
*/
|
|
8
|
+
isExpired(token: string, throwOnError?: boolean): boolean;
|
|
9
|
+
extractTokenExpiration(token: string): Date | undefined;
|
|
10
|
+
extractRoles(token: string): string[] | undefined;
|
|
11
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TokenUtils = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const codiac_common_1 = require("@codiac.io/codiac-common");
|
|
6
|
+
const contracts_1 = require("@codiac.io/codiac-common/contracts");
|
|
7
|
+
const jwt_lib_1 = require("@codiac.io/jwt-lib");
|
|
8
|
+
const inversify_1 = require("inversify");
|
|
9
|
+
let TokenUtils = class TokenUtils {
|
|
10
|
+
constructor(logger) {
|
|
11
|
+
this.logger = logger;
|
|
12
|
+
}
|
|
13
|
+
/** Determines whether the given token is expired.
|
|
14
|
+
* @param throwOnError throws any encountered errors, including token parsing errors.
|
|
15
|
+
*/
|
|
16
|
+
isExpired(token, throwOnError = false) {
|
|
17
|
+
try {
|
|
18
|
+
const exp = this.extractTokenExpiration(token);
|
|
19
|
+
return (exp == undefined) || !(0, codiac_common_1.isFuture)(exp);
|
|
20
|
+
}
|
|
21
|
+
catch (err) {
|
|
22
|
+
let newErr = new contracts_1.CodiacError(`Error determining expiry status: ${err.message || ""}`, err);
|
|
23
|
+
this.logger.detail(newErr.message);
|
|
24
|
+
if (throwOnError) {
|
|
25
|
+
throw newErr;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
extractTokenExpiration(token) {
|
|
33
|
+
let exp;
|
|
34
|
+
try {
|
|
35
|
+
const encoder = new jwt_lib_1.JwtEncoder();
|
|
36
|
+
const tokenObj = encoder.tryDecode(token);
|
|
37
|
+
const CLAIM_KEY_FOR_EXPIRATION = "exp"; // this is just a standard claim so it ought to come from the jwt lib
|
|
38
|
+
const rawExp = tokenObj === null || tokenObj === void 0 ? void 0 : tokenObj.payload[CLAIM_KEY_FOR_EXPIRATION];
|
|
39
|
+
if (rawExp) {
|
|
40
|
+
try {
|
|
41
|
+
exp = new Date(rawExp);
|
|
42
|
+
this.logger.trace(`Exracted token expiration (utc): ${(exp === null || exp === void 0 ? void 0 : exp.toUTCString()) || "undefined"}`);
|
|
43
|
+
}
|
|
44
|
+
catch (_a) {
|
|
45
|
+
this.logger.trace(`Invalid date format in token expiration: [${rawExp}]`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return exp;
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
throw new Error(`Error parsing expiration from token: ${err.message}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
extractRoles(token) {
|
|
55
|
+
var _a;
|
|
56
|
+
let roles;
|
|
57
|
+
try {
|
|
58
|
+
const encoder = new jwt_lib_1.JwtEncoder();
|
|
59
|
+
const tokenObj = encoder.tryDecode(token);
|
|
60
|
+
const CLAIM_KEY_FOR_ROLES = "roles"; // this is just a standard claim so it ought to come from the jwt lib
|
|
61
|
+
const rawValue = tokenObj === null || tokenObj === void 0 ? void 0 : tokenObj.payload[CLAIM_KEY_FOR_ROLES];
|
|
62
|
+
if (rawValue) {
|
|
63
|
+
try {
|
|
64
|
+
roles = rawValue.split(",");
|
|
65
|
+
this.logger.trace(`Extracted roles: ${rawValue || "undefined"}`);
|
|
66
|
+
}
|
|
67
|
+
catch (err) {
|
|
68
|
+
this.logger.trace(`Error parsing roles from claim: [${(_a = err.message) !== null && _a !== void 0 ? _a : "no details available"}]`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return roles;
|
|
72
|
+
}
|
|
73
|
+
catch (err) {
|
|
74
|
+
throw new Error(`Error parsing expiration from token: ${err.message}`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
TokenUtils = tslib_1.__decorate([
|
|
79
|
+
(0, inversify_1.injectable)(),
|
|
80
|
+
tslib_1.__param(0, (0, inversify_1.inject)(codiac_common_1.INTERFACES.IBetterLogger)),
|
|
81
|
+
tslib_1.__metadata("design:paramtypes", [Object])
|
|
82
|
+
], TokenUtils);
|
|
83
|
+
exports.TokenUtils = TokenUtils;
|
|
84
|
+
//# sourceMappingURL=token-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-utils.js","sourceRoot":"","sources":["../../../../src/apis/codiac-relay-nats/common/token-utils.ts"],"names":[],"mappings":";;;;AAAA,4DAA+E;AAC/E,kEAAiE;AACjE,gDAAgD;AAChD,yCAA+C;AAGxC,IAAM,UAAU,GAAhB,MAAM,UAAU;IAErB,YAAsD,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAE3E,CAAC;IAID;;OAEG;IACI,SAAS,CAAC,KAAa,EAAE,eAAwB,KAAK;QAC3D,IAAI;YACF,MAAM,GAAG,GAAG,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC;YAC/C,OAAO,CAAC,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,IAAA,wBAAQ,EAAC,GAAG,CAAC,CAAC;SAC7C;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,MAAM,GAAG,IAAI,uBAAW,CAAC,oCAAoC,GAAG,CAAC,OAAO,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,CAAA;YAC1F,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YACnC,IAAI,YAAY,EAAE;gBAChB,MAAM,MAAM,CAAC;aACd;iBAAM;gBACL,OAAO,IAAI,CAAC;aACb;SACF;IACH,CAAC;IAGM,sBAAsB,CAAC,KAAa;QACzC,IAAI,GAAqB,CAAC;QAC1B,IAAI;YACF,MAAM,OAAO,GAAG,IAAI,oBAAU,EAAE,CAAC;YACj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AAC,OAAO,GAAG,EAAE;oBACZ,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,oCAAoC,MAAA,GAAG,CAAC,OAAO,mCAAI,sBAAsB,GAAG,CAAC,CAAC;iBACjG;aACF;YACD,OAAO,KAAK,CAAC;SACd;QAAC,OAAO,GAAG,EAAE;YACZ,MAAM,IAAI,KAAK,CAAC,wCAAwC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;SACxE;IACH,CAAC;CAEF,CAAA;AAtEY,UAAU;IADtB,IAAA,sBAAU,GAAE;IAGE,mBAAA,IAAA,kBAAM,EAAC,0BAAU,CAAC,aAAa,CAAC,CAAA;;GAFlC,UAAU,CAsEtB;AAtEY,gCAAU"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TokenCreds = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const inversify_1 = require("inversify");
|
|
6
|
+
let TokenCreds = class TokenCreds {
|
|
7
|
+
constructor(jwtToken) {
|
|
8
|
+
this.jwtToken = jwtToken;
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
TokenCreds = tslib_1.__decorate([
|
|
12
|
+
(0, inversify_1.injectable)(),
|
|
13
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
14
|
+
], TokenCreds);
|
|
15
|
+
exports.TokenCreds = TokenCreds;
|
|
16
|
+
//# sourceMappingURL=token.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token.js","sourceRoot":"","sources":["../../../../src/apis/codiac-relay-nats/common/token.ts"],"names":[],"mappings":";;;;AAAA,yCAAuC;AAGhC,IAAM,UAAU,GAAhB,MAAM,UAAU;IACrB,YAAmB,QAAgB;QAAhB,aAAQ,GAAR,QAAQ,CAAQ;IAAG,CAAC;CACxC,CAAA;AAFY,UAAU;IADtB,IAAA,sBAAU,GAAE;;GACA,UAAU,CAEtB;AAFY,gCAAU"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/apis/codiac-relay-nats/common/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { IRepoOptions } from "@codiac.io/codiac-common";
|
|
2
|
+
import { classDef, stringDictionary, ISerializer, typeRef } from "@codiac.io/codiac-common";
|
|
3
|
+
import { IBetterLogger } from '@codiac.io/codiac-common/IBetterLogger';
|
|
4
|
+
export declare class TypeName {
|
|
5
|
+
static endpointSpec<T>(entityType: classDef<T> | string): string;
|
|
6
|
+
static arrayOf<T>(entityType: classDef<T> | string): string;
|
|
7
|
+
static criteriaFor<T>(entityType: classDef<T> | string): string;
|
|
8
|
+
}
|
|
9
|
+
/** Returns the instantiated object or array.
|
|
10
|
+
* Returns undefined for both an empty or missing source file.
|
|
11
|
+
* Uses JSON.parse and does not perform any explicit casting.
|
|
12
|
+
* Throws encountered exceptions. Resolves tilde (~) path prefixes.
|
|
13
|
+
* @param pathName Fully qualified path and filename of the json file.
|
|
14
|
+
* @param allowComments (default: false) Flag to use a json comment parser to support comments in the json file.
|
|
15
|
+
*/
|
|
16
|
+
export declare function deserializeJsonFile<T>(pathName: string, allowComments?: boolean): T | undefined;
|
|
17
|
+
/** Uses JSON.stringify() to write the given object to a file. Resolves tilde (~) path prefixes.
|
|
18
|
+
* @param subject The object to serialize.
|
|
19
|
+
* @param pathName Fully-qualified path and filename (eg "/users/JoeCool/.config/app-config.json").
|
|
20
|
+
* @param allowComments (default: false) Flag to use a json comment parser to support comments in the json file.
|
|
21
|
+
*/
|
|
22
|
+
export declare function serializeJsonFile(subject: any, pathName: string, allowComments?: boolean): void;
|
|
23
|
+
/** Replaces the leading tilde (~) in the given file path
|
|
24
|
+
* with the absolute path to the os.homedir (eg: "/Users/JoeCool").
|
|
25
|
+
* NOTE: Relative paths will slide through this function untouched:
|
|
26
|
+
* this function does not necessarily return an absolute path! */
|
|
27
|
+
export declare function resolveHomeDir(pathName: string): string;
|
|
28
|
+
/** */
|
|
29
|
+
export declare function smashMergeConfg<TSettings>(defaults: TSettings, configsInPriorityOrder?: Partial<TSettings>[]): TSettings;
|
|
30
|
+
export declare function headersFrom(options: IRepoOptions | undefined, existingHeaders?: {
|
|
31
|
+
[key: string]: string;
|
|
32
|
+
} | undefined): {
|
|
33
|
+
[key: string]: string;
|
|
34
|
+
} | undefined;
|
|
35
|
+
export declare function extractPrimitiveProperties(remaining: any): any;
|
|
36
|
+
export declare function omit(entity: any, paths: string[]): any;
|
|
37
|
+
export declare function buildUrl(route: string, request: any, applyRemainingToQuerystring?: boolean): string;
|
|
38
|
+
/** Injects any property values from the request into subject parameters by name.
|
|
39
|
+
*
|
|
40
|
+
* This method DOES NOT mutate the request object. */
|
|
41
|
+
export declare function hydrateSubjectParams(subject: string, request: any): string;
|
|
42
|
+
export declare function applyPropertySerializers(entity: any, serializerMap: stringDictionary): any;
|
|
43
|
+
/** Returns undefined when no serializer has been registered for the given valueType. */
|
|
44
|
+
export declare function getSerializerFor(valueType: typeRef | string): ISerializer | undefined;
|
|
45
|
+
/** For special serializers (eg: StringFilter, etc).
|
|
46
|
+
* Maps the given serializer for use on the given type
|
|
47
|
+
* when later converting input to an http request.
|
|
48
|
+
* NOTE: a default serializer will be used if reqd and none has been registered here.
|
|
49
|
+
*/
|
|
50
|
+
export declare function registerSerializerFor<T>(valueType: classDef<T> | string, serializer: ISerializer): void;
|
|
51
|
+
export declare function initialize(endpointsJson: any[], logger?: IBetterLogger): void;
|
|
52
|
+
/** Produces the value for the "Authorization" http header in an RFC 2617 Basic Authentication scheme.
|
|
53
|
+
* Consists of the string "Basic " followed by a colon-separated, base64 encoded string of the username and password.
|
|
54
|
+
* eg: for userid "Aladdin" and password "open sesame", this function will return "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==".
|
|
55
|
+
* @see https://tools.ietf.org/html/rfc2617#page-4 RFC 2617 HTTP Authentication - Assembling the header value for a basic authentication request. */
|
|
56
|
+
export declare function buildBasicAuthenticationHeader(userName: string, passwordOrApiKey: string): string;
|