@codiac.io/codiac-cli 1.3.68 → 1.3.70
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/api-plus-local/api-client-plus-local.d.ts +12 -4
- package/dist/apis/api-plus-local/api-client-plus-local.js +121 -92
- package/dist/apis/api-plus-local/api-client-plus-local.js.map +1 -1
- package/dist/apis/api-plus-local/asset-where-entity-merger.d.ts +4 -2
- package/dist/apis/api-plus-local/asset-where-entity-merger.js +17 -8
- package/dist/apis/api-plus-local/asset-where-entity-merger.js.map +1 -1
- package/dist/apis/api-plus-local/enterprise-state-entity-merger.d.ts +3 -2
- package/dist/apis/api-plus-local/enterprise-state-entity-merger.js +13 -2
- package/dist/apis/api-plus-local/enterprise-state-entity-merger.js.map +1 -1
- package/dist/apis/api-plus-local/root-map-entity-merger.d.ts +7 -3
- package/dist/apis/api-plus-local/root-map-entity-merger.js +19 -8
- package/dist/apis/api-plus-local/root-map-entity-merger.js.map +1 -1
- package/dist/apis/codiac-api/gen/contracts.d.ts +38 -4
- package/dist/apis/codiac-api/gen/contracts.js +2 -0
- package/dist/apis/codiac-api/gen/contracts.js.map +1 -1
- package/dist/apis/codiac-relay/common/api-user-creds.d.ts +2 -2
- package/dist/apis/codiac-relay/common/api-user-creds.js +2 -1
- package/dist/apis/codiac-relay/common/api-user-creds.js.map +1 -1
- package/dist/apis/codiac-relay/gen/client.d.ts +5 -1
- package/dist/apis/codiac-relay/gen/client.js +16 -0
- package/dist/apis/codiac-relay/gen/client.js.map +1 -1
- package/dist/apis/codiac-relay/gen/contracts.d.ts +131 -2
- package/dist/apis/codiac-relay/gen/contracts.js +12 -1
- package/dist/apis/codiac-relay/gen/contracts.js.map +1 -1
- package/dist/apis/nats/nats-client.d.ts +1 -0
- package/dist/apis/nats/nats-client.js +8 -4
- package/dist/apis/nats/nats-client.js.map +1 -1
- package/dist/cli-common/argument-manager.d.ts +1 -1
- package/dist/cli-common/command-base.d.ts +6 -4
- package/dist/cli-common/command-base.js +31 -22
- package/dist/cli-common/command-base.js.map +1 -1
- package/dist/codiac-constants.d.ts +2 -0
- package/dist/codiac-constants.js +2 -0
- package/dist/codiac-constants.js.map +1 -1
- package/dist/codiac-entities/cluster-capture-def.d.ts +4 -2
- package/dist/command-base-enterprise.d.ts +2 -1
- package/dist/command-base-enterprise.js +10 -7
- package/dist/command-base-enterprise.js.map +1 -1
- package/dist/command-base-tenantless.d.ts +2 -1
- package/dist/command-base-tenantless.js +12 -10
- package/dist/command-base-tenantless.js.map +1 -1
- package/dist/commands/asset/create.d.ts +2 -8
- package/dist/commands/asset/create.js +24 -4
- package/dist/commands/asset/create.js.map +1 -1
- package/dist/commands/asset/deploy.d.ts +8 -4
- package/dist/commands/asset/deploy.js +58 -29
- package/dist/commands/asset/deploy.js.map +1 -1
- package/dist/commands/asset/entrypoint/delete.js +3 -3
- package/dist/commands/asset/entrypoint/delete.js.map +1 -1
- package/dist/commands/asset/entrypoint/set.js +3 -3
- package/dist/commands/asset/entrypoint/set.js.map +1 -1
- package/dist/commands/asset/list.d.ts +2 -0
- package/dist/commands/asset/list.js +4 -0
- package/dist/commands/asset/list.js.map +1 -1
- package/dist/commands/asset/view.d.ts +4 -4
- package/dist/commands/asset/view.js +3 -2
- package/dist/commands/asset/view.js.map +1 -1
- package/dist/commands/cabinet/create.d.ts +2 -1
- package/dist/commands/cabinet/create.js +15 -2
- package/dist/commands/cabinet/create.js.map +1 -1
- package/dist/commands/cabinet/obliterate.d.ts +3 -1
- package/dist/commands/cabinet/obliterate.js +6 -2
- package/dist/commands/cabinet/obliterate.js.map +1 -1
- package/dist/commands/cluster/start.d.ts +37 -0
- package/dist/commands/cluster/start.js +191 -0
- package/dist/commands/cluster/start.js.map +1 -0
- package/dist/commands/cluster/stop.d.ts +36 -0
- package/dist/commands/cluster/stop.js +190 -0
- package/dist/commands/cluster/stop.js.map +1 -0
- package/dist/commands/config/add.d.ts +3 -2
- package/dist/commands/config/add.js +8 -25
- package/dist/commands/config/add.js.map +1 -1
- package/dist/commands/config/delete.js +7 -4
- package/dist/commands/config/delete.js.map +1 -1
- package/dist/commands/config/settings/get.js +7 -4
- package/dist/commands/config/settings/get.js.map +1 -1
- package/dist/commands/config/view.d.ts +0 -1
- package/dist/commands/config/view.js +5 -39
- package/dist/commands/config/view.js.map +1 -1
- package/dist/commands/environment/cluster/attach.js +15 -4
- package/dist/commands/environment/cluster/attach.js.map +1 -1
- package/dist/commands/environment/cluster/detach.js +6 -1
- package/dist/commands/environment/cluster/detach.js.map +1 -1
- package/dist/commands/environment/create.d.ts +1 -0
- package/dist/commands/environment/create.js +22 -3
- package/dist/commands/environment/create.js.map +1 -1
- package/dist/commands/environment/list.d.ts +3 -0
- package/dist/commands/environment/list.js +20 -7
- package/dist/commands/environment/list.js.map +1 -1
- package/dist/commands/filestore/capture.js.map +1 -1
- package/dist/commands/imageRegistry/capture.js +4 -0
- package/dist/commands/imageRegistry/capture.js.map +1 -1
- package/dist/commands/imageRegistry/list.d.ts +29 -0
- package/dist/commands/imageRegistry/list.js +108 -0
- package/dist/commands/imageRegistry/list.js.map +1 -0
- package/dist/commands/init.js +4 -4
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/noc/cluster/capture.d.ts +0 -2
- package/dist/commands/noc/cluster/capture.js +19 -15
- package/dist/commands/noc/cluster/capture.js.map +1 -1
- package/dist/commands/noc/cluster/create.d.ts +20 -0
- package/dist/commands/noc/cluster/create.js +244 -17
- package/dist/commands/noc/cluster/create.js.map +1 -1
- package/dist/commands/noc/cluster/destroy.d.ts +4 -0
- package/dist/commands/noc/cluster/destroy.js +38 -9
- package/dist/commands/noc/cluster/destroy.js.map +1 -1
- package/dist/commands/noc/cluster/forget.d.ts +2 -1
- package/dist/commands/noc/cluster/forget.js +20 -3
- package/dist/commands/noc/cluster/forget.js.map +1 -1
- package/dist/commands/noc/cluster/init.d.ts +1 -0
- package/dist/commands/noc/cluster/init.js +10 -3
- package/dist/commands/noc/cluster/init.js.map +1 -1
- package/dist/commands/noc/cluster/list.js +6 -2
- package/dist/commands/noc/cluster/list.js.map +1 -1
- package/dist/message-contracts/terminal-command-request.d.ts +66 -0
- package/dist/message-contracts/terminal-command-request.js +13 -0
- package/dist/message-contracts/terminal-command-request.js.map +1 -0
- package/dist/ops/LocalOps.d.ts +1 -1
- package/dist/ops/LocalOps.js +4 -4
- package/dist/ops/LocalOps.js.map +1 -1
- package/dist/ops/entities/cli-config.d.ts +2 -1
- package/dist/ops/entities/cli-config.js +3 -2
- package/dist/ops/entities/cli-config.js.map +1 -1
- package/dist/ops/index.d.ts +0 -3
- package/dist/ops/index.js +3 -3
- package/dist/ops/index.js.map +1 -1
- package/dist/ops/k8s/k8s-utils.js.map +1 -1
- package/dist/ops/scaffolding/base-scaffolding.d.ts +1 -1
- package/dist/ops/scaffolding/base-scaffolding.js +2 -1
- package/dist/ops/scaffolding/base-scaffolding.js.map +1 -1
- package/dist/ops/scaffolding/codiac-api-scaffolding.js.map +1 -1
- package/dist/ops/scaffolding/typescript-scaffolding.d.ts +2 -1
- package/dist/ops/scaffolding/typescript-scaffolding.js +2 -1
- package/dist/ops/scaffolding/typescript-scaffolding.js.map +1 -1
- package/dist/ops/terminal-command-runner/local-command-runner.d.ts +41 -0
- package/dist/ops/terminal-command-runner/local-command-runner.js +146 -0
- package/dist/ops/terminal-command-runner/local-command-runner.js.map +1 -0
- package/dist/ops/terminal-utils.d.ts +56 -0
- package/dist/ops/terminal-utils.js +721 -0
- package/dist/ops/terminal-utils.js.map +1 -0
- package/dist/relay/relay-container.js +4 -1
- package/dist/relay/relay-container.js.map +1 -1
- package/dist/relay/wsclient/relay-websocket-client.d.ts +3 -0
- package/dist/relay/wsclient/relay-websocket-client.js +9 -0
- package/dist/relay/wsclient/relay-websocket-client.js.map +1 -1
- package/dist/sdk/codiac-sdk-for-cli.d.ts +29 -0
- package/dist/sdk/codiac-sdk-for-cli.js +83 -0
- package/dist/sdk/codiac-sdk-for-cli.js.map +1 -0
- package/dist/{uilogic → sdk}/i-cluster-configurator.d.ts +2 -1
- package/dist/sdk/i-cluster-configurator.js.map +1 -0
- package/dist/sdk/i-file-store-configurator.js.map +1 -0
- package/dist/{uilogic → sdk}/i-login-configurator.d.ts +10 -3
- package/dist/sdk/i-login-configurator.js.map +1 -0
- package/dist/sdk/i-registry-configurator.js.map +1 -0
- package/dist/sdk/i-secret-store-configurator.js.map +1 -0
- package/dist/sdk/index.d.ts +7 -0
- package/dist/sdk/index.js +11 -0
- package/dist/sdk/index.js.map +1 -0
- package/dist/sdk-adapters/artifact-hub/artifact-hub-cli-adapter.d.ts +6 -0
- package/dist/sdk-adapters/artifact-hub/artifact-hub-cli-adapter.js +16 -0
- package/dist/sdk-adapters/artifact-hub/artifact-hub-cli-adapter.js.map +1 -0
- package/dist/{uilogic/cloud-resource-configurators → sdk-adapters/artifact-hub}/helm-resource-configurator.d.ts +4 -4
- package/dist/{uilogic/cloud-resource-configurators → sdk-adapters/artifact-hub}/helm-resource-configurator.js +5 -1
- package/dist/sdk-adapters/artifact-hub/helm-resource-configurator.js.map +1 -0
- package/dist/sdk-adapters/artifact-hub/index.d.ts +2 -0
- package/dist/sdk-adapters/artifact-hub/index.js +6 -0
- package/dist/sdk-adapters/artifact-hub/index.js.map +1 -0
- package/dist/sdk-adapters/aws/aws-cli-adapter.d.ts +6 -0
- package/dist/sdk-adapters/aws/aws-cli-adapter.js +20 -0
- package/dist/sdk-adapters/aws/aws-cli-adapter.js.map +1 -0
- package/dist/{uilogic/cloud-resource-configurators → sdk-adapters/aws}/aws-resource-configurator.d.ts +6 -9
- package/dist/{uilogic/cloud-resource-configurators → sdk-adapters/aws}/aws-resource-configurator.js +20 -10
- package/dist/sdk-adapters/aws/aws-resource-configurator.js.map +1 -0
- package/dist/sdk-adapters/aws/index.d.ts +2 -0
- package/dist/sdk-adapters/aws/index.js +6 -0
- package/dist/sdk-adapters/aws/index.js.map +1 -0
- package/dist/{uilogic/cloud-resource-configurators → sdk-adapters/azure}/az-interactive-login-configurator.d.ts +6 -7
- package/dist/{uilogic/cloud-resource-configurators → sdk-adapters/azure}/az-interactive-login-configurator.js +7 -8
- package/dist/sdk-adapters/azure/az-interactive-login-configurator.js.map +1 -0
- package/dist/sdk-adapters/azure/azure-cli-adapter.d.ts +6 -0
- package/dist/sdk-adapters/azure/azure-cli-adapter.js +20 -0
- package/dist/sdk-adapters/azure/azure-cli-adapter.js.map +1 -0
- package/dist/{uilogic/cloud-resource-configurators → sdk-adapters/azure}/azure-resource-configurator.d.ts +4 -13
- package/dist/{uilogic/cloud-resource-configurators → sdk-adapters/azure}/azure-resource-configurator.js +33 -38
- package/dist/sdk-adapters/azure/azure-resource-configurator.js.map +1 -0
- package/dist/sdk-adapters/azure/index.d.ts +3 -0
- package/dist/sdk-adapters/azure/index.js +7 -0
- package/dist/sdk-adapters/azure/index.js.map +1 -0
- package/dist/sdk-adapters/docker-hub/docker-hub-cli-adapter.d.ts +6 -0
- package/dist/sdk-adapters/docker-hub/docker-hub-cli-adapter.js +16 -0
- package/dist/sdk-adapters/docker-hub/docker-hub-cli-adapter.js.map +1 -0
- package/dist/{uilogic/cloud-resource-configurators → sdk-adapters/docker-hub}/docker-hub-resource-configurator.d.ts +4 -4
- package/dist/{uilogic/cloud-resource-configurators → sdk-adapters/docker-hub}/docker-hub-resource-configurator.js +7 -1
- package/dist/sdk-adapters/docker-hub/docker-hub-resource-configurator.js.map +1 -0
- package/dist/sdk-adapters/docker-hub/index.d.ts +2 -0
- package/dist/sdk-adapters/docker-hub/index.js +6 -0
- package/dist/sdk-adapters/docker-hub/index.js.map +1 -0
- package/dist/sdk-adapters/local-machine/index.js +4 -0
- package/dist/sdk-adapters/local-machine/index.js.map +1 -0
- package/dist/sdk-adapters/local-machine/local-machine-cli-adapter.js +14 -0
- package/dist/sdk-adapters/local-machine/local-machine-cli-adapter.js.map +1 -0
- package/dist/sdk-adapters/local-machine/local-machine-login-configurator.d.ts +17 -0
- package/dist/sdk-adapters/local-machine/local-machine-login-configurator.js +66 -0
- package/dist/sdk-adapters/local-machine/local-machine-login-configurator.js.map +1 -0
- package/dist/sdk-adapters/local-machine/local-machine-resource-configurator.d.ts +21 -0
- package/dist/sdk-adapters/local-machine/local-machine-resource-configurator.js +126 -0
- package/dist/sdk-adapters/local-machine/local-machine-resource-configurator.js.map +1 -0
- package/dist/sdk-adapters/shared/resource-configurator-base.d.ts +31 -0
- package/dist/sdk-adapters/shared/resource-configurator-base.js +124 -0
- package/dist/sdk-adapters/shared/resource-configurator-base.js.map +1 -0
- package/dist/uilogic/build-configurator.d.ts +2 -1
- package/dist/uilogic/build-configurator.js.map +1 -1
- package/dist/uilogic/cloud-provider-contextualizer.d.ts +4 -4
- package/dist/uilogic/cloud-provider-contextualizer.js +24 -9
- package/dist/uilogic/cloud-provider-contextualizer.js.map +1 -1
- package/dist/uilogic/cloud-resource-configurator-factory.d.ts +6 -10
- package/dist/uilogic/cloud-resource-configurator-factory.js +31 -19
- package/dist/uilogic/cloud-resource-configurator-factory.js.map +1 -1
- package/dist/uilogic/cloud-resource-configurators/asset-configurator.d.ts +8 -1
- package/dist/uilogic/cloud-resource-configurators/asset-configurator.js.map +1 -1
- package/dist/uilogic/cloud-resource-configurators/unsupported-resource-configurator.d.ts +1 -1
- package/dist/uilogic/config-ui-utils.d.ts +19 -14
- package/dist/uilogic/config-ui-utils.js +66 -21
- package/dist/uilogic/config-ui-utils.js.map +1 -1
- package/dist/uilogic/enterprise-contextualizer.d.ts +2 -1
- package/dist/uilogic/enterprise-contextualizer.js.map +1 -1
- package/dist/uilogic/i-messaging-client.d.ts +1 -0
- package/dist/uilogic/image-registry-contextualizer.d.ts +3 -3
- package/dist/uilogic/image-registry-contextualizer.js +4 -2
- package/dist/uilogic/image-registry-contextualizer.js.map +1 -1
- package/dist/uilogic/index.d.ts +0 -4
- package/dist/uilogic/index.js +0 -4
- package/dist/uilogic/index.js.map +1 -1
- package/dist/uilogic/lrp-watcher-predef.js +10 -4
- package/dist/uilogic/lrp-watcher-predef.js.map +1 -1
- package/dist/uilogic/rootmap-ui-utils.d.ts +2 -0
- package/dist/uilogic/rootmap-ui-utils.js +35 -11
- package/dist/uilogic/rootmap-ui-utils.js.map +1 -1
- package/dist/uilogic/tenant-contextualizer.d.ts +1 -1
- package/dist/uilogic/tenant-contextualizer.js.map +1 -1
- package/dist/uilogic/type-safety-utils.d.ts +11 -0
- package/dist/uilogic/type-safety-utils.js +13 -0
- package/dist/uilogic/type-safety-utils.js.map +1 -1
- package/dist/uilogic/validators/non-empty-validator.d.ts +7 -0
- package/dist/uilogic/validators/non-empty-validator.js +20 -0
- package/dist/uilogic/validators/non-empty-validator.js.map +1 -0
- package/dist/uilogic/validators/semver-range-validator.d.ts +1 -1
- package/dist/uilogic/validators/semver-range-validator.js +2 -2
- package/dist/uilogic/validators/semver-range-validator.js.map +1 -1
- package/oclif.manifest.json +250 -23
- package/package.json +4 -4
- package/dist/ops/azure-container-registry-client/azure-container-registry-client.js +0 -148
- package/dist/ops/azure-container-registry-client/azure-container-registry-client.js.map +0 -1
- package/dist/uilogic/cloud-resource-configurators/aws-resource-configurator.js.map +0 -1
- package/dist/uilogic/cloud-resource-configurators/az-interactive-login-configurator.js.map +0 -1
- package/dist/uilogic/cloud-resource-configurators/azure-resource-configurator.js.map +0 -1
- package/dist/uilogic/cloud-resource-configurators/azure-types.js +0 -10
- package/dist/uilogic/cloud-resource-configurators/azure-types.js.map +0 -1
- package/dist/uilogic/cloud-resource-configurators/docker-hub-resource-configurator.js.map +0 -1
- package/dist/uilogic/cloud-resource-configurators/helm-resource-configurator.js.map +0 -1
- package/dist/uilogic/i-cluster-configurator.js.map +0 -1
- package/dist/uilogic/i-file-store-configurator.js.map +0 -1
- package/dist/uilogic/i-login-configurator.js.map +0 -1
- package/dist/uilogic/i-registry-configurator.js.map +0 -1
- package/dist/uilogic/i-secret-store-configurator.js.map +0 -1
- /package/dist/{uilogic → sdk}/i-cluster-configurator.js +0 -0
- /package/dist/{uilogic → sdk}/i-file-store-configurator.d.ts +0 -0
- /package/dist/{uilogic → sdk}/i-file-store-configurator.js +0 -0
- /package/dist/{uilogic → sdk}/i-login-configurator.js +0 -0
- /package/dist/{uilogic → sdk}/i-registry-configurator.d.ts +0 -0
- /package/dist/{uilogic → sdk}/i-registry-configurator.js +0 -0
- /package/dist/{uilogic → sdk}/i-secret-store-configurator.d.ts +0 -0
- /package/dist/{uilogic → sdk}/i-secret-store-configurator.js +0 -0
- /package/dist/{ops/azure-container-registry-client/azure-container-registry-client.d.ts → sdk-adapters/local-machine/index.d.ts} +0 -0
- /package/dist/{uilogic/cloud-resource-configurators/azure-types.d.ts → sdk-adapters/local-machine/local-machine-cli-adapter.d.ts} +0 -0
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.70 linux-x64 node-v16.17.1
|
|
25
25
|
$ codiac --help [COMMAND]
|
|
26
26
|
USAGE
|
|
27
27
|
$ codiac COMMAND
|
|
@@ -3,16 +3,26 @@ import * as cont from "@codiac.io/codiac-common/contracts";
|
|
|
3
3
|
import { ApiUserCreds, CodiacClient, CodiacClientConfig } from "../codiac-api";
|
|
4
4
|
import { CrudEndpointInfo } from "../codiac-api/common/api-crud-client-base";
|
|
5
5
|
import { RelayClient as GenRelayClient } from "../codiac-relay";
|
|
6
|
+
export declare class ApiClientPlusLocalConfig {
|
|
7
|
+
/** The local data api mimics the remote api endpoints and routes,
|
|
8
|
+
* but may have those endpoint routes prefixed to avoid any collisions or ambiguity.
|
|
9
|
+
* When that is true, this prefix will need to be applied
|
|
10
|
+
* when rerouting a remote endpoint call to a local one. */
|
|
11
|
+
localDataRoutePrefix?: string | undefined;
|
|
12
|
+
}
|
|
6
13
|
/** Wrapper for the Codiac Api that redirects calls from the remote codiac api
|
|
7
14
|
* to the to the local api endpoints (in the relay),
|
|
8
15
|
* based on whether the entity is flagged as a local entity or not.
|
|
9
16
|
*/
|
|
10
17
|
export declare class ApiClientPlusLocal extends CodiacClient {
|
|
18
|
+
private settings?;
|
|
11
19
|
/** This factory method is just for convenience and hasty backward compatibility with consumers not using ioc. */
|
|
12
|
-
static createPlus(relayClient: GenRelayClient, logger: IBetterLogger, apiRootUrl?: string, authToken?: string): ApiClientPlusLocal;
|
|
13
|
-
constructor(relayClientWithLocalData: GenRelayClient, logger: IBetterLogger,
|
|
20
|
+
static createPlus(relayClient: GenRelayClient, logger: IBetterLogger, localDataRoutePrefix?: string, apiRootUrl?: string, authToken?: string): ApiClientPlusLocal;
|
|
21
|
+
constructor(relayClientWithLocalData: GenRelayClient, logger: IBetterLogger, remoteApiSettings?: CodiacClientConfig, settings?: ApiClientPlusLocalConfig | undefined, credentials?: ApiUserCreds);
|
|
14
22
|
private entityMergers;
|
|
15
23
|
private localDataClient;
|
|
24
|
+
tryMakeRestCall<TReq extends Object, TRes extends cont.Result>(ep: CrudEndpointInfo, request: TReq, options?: IRepoOptions): Promise<TRes>;
|
|
25
|
+
makeAnyRestCall<TReq extends Object, TRes>(ep: CrudEndpointInfo, request: TReq, options?: IRepoOptions): Promise<TRes>;
|
|
16
26
|
/** Both params MUST be of the SAME RESULT TYPE.
|
|
17
27
|
*
|
|
18
28
|
* Ignores additional if original has an error.
|
|
@@ -23,8 +33,6 @@ export declare class ApiClientPlusLocal extends CodiacClient {
|
|
|
23
33
|
* @param absorbErrors (default: false) When true, error, success, and message from the additional shall be brought forward in the ultimate result.
|
|
24
34
|
*/
|
|
25
35
|
private absorbOutput;
|
|
26
|
-
tryMakeRestCall<TReq extends Object, TRes extends cont.Result>(ep: CrudEndpointInfo, request: TReq, options?: IRepoOptions): Promise<TRes>;
|
|
27
|
-
makeAnyRestCall<TReq extends Object, TRes>(ep: CrudEndpointInfo, request: TReq, options?: IRepoOptions): Promise<TRes>;
|
|
28
36
|
/** Merges the two objects as arrays or based on a custom merger
|
|
29
37
|
* or falling back to a raw object merge. */
|
|
30
38
|
protected merge<T>(operationId: string, responseRemote: T, localResponse: T | undefined): T;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var ApiClientPlusLocal_1;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.ApiClientPlusLocal = void 0;
|
|
4
|
+
exports.ApiClientPlusLocal = exports.ApiClientPlusLocalConfig = void 0;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
|
-
const
|
|
6
|
+
const path = require("path");
|
|
7
7
|
const inversify_1 = require("inversify");
|
|
8
8
|
const _ = require("lodash");
|
|
9
|
+
const codiac_common_1 = require("@codiac.io/codiac-common");
|
|
9
10
|
const type_safety_utils_1 = require("../../uilogic/type-safety-utils");
|
|
10
11
|
const codiac_api_1 = require("../codiac-api");
|
|
11
12
|
const codiac_relay_1 = require("../codiac-relay");
|
|
@@ -29,107 +30,49 @@ function asOutputResult(candidate) {
|
|
|
29
30
|
let sr = candidate;
|
|
30
31
|
return Boolean(sr.output) ? sr : undefined;
|
|
31
32
|
}
|
|
33
|
+
class ApiClientPlusLocalConfig {
|
|
34
|
+
}
|
|
35
|
+
exports.ApiClientPlusLocalConfig = ApiClientPlusLocalConfig;
|
|
32
36
|
/** Wrapper for the Codiac Api that redirects calls from the remote codiac api
|
|
33
37
|
* to the to the local api endpoints (in the relay),
|
|
34
38
|
* based on whether the entity is flagged as a local entity or not.
|
|
35
39
|
*/
|
|
36
40
|
let ApiClientPlusLocal = ApiClientPlusLocal_1 = class ApiClientPlusLocal extends codiac_api_1.CodiacClient {
|
|
37
41
|
/** This factory method is just for convenience and hasty backward compatibility with consumers not using ioc. */
|
|
38
|
-
static createPlus(relayClient, logger, apiRootUrl, authToken) {
|
|
39
|
-
|
|
42
|
+
static createPlus(relayClient, logger, localDataRoutePrefix, apiRootUrl, authToken) {
|
|
43
|
+
let settings = localDataRoutePrefix ? { localDataRoutePrefix: localDataRoutePrefix } : undefined;
|
|
44
|
+
return new ApiClientPlusLocal_1(relayClient, logger, { apiBaseUrl: apiRootUrl }, settings, (authToken) ? { apiToken: authToken } : undefined);
|
|
40
45
|
}
|
|
41
|
-
|
|
42
|
-
|
|
46
|
+
// public static bootstrap(ioc: interfaces.Container, settings?: ApiClientPlusLocalConfig | undefined): void {
|
|
47
|
+
// let ultimate = _.merge({}, settings);
|
|
48
|
+
// ioc.bind(ApiClientPlusLocalConfig).toConstantValue(ultimate);
|
|
49
|
+
// }
|
|
50
|
+
constructor(relayClientWithLocalData, logger, remoteApiSettings, settings, credentials) {
|
|
51
|
+
super(logger, remoteApiSettings, credentials);
|
|
52
|
+
this.settings = settings;
|
|
43
53
|
// HACK: Hard cast here because we dont have an interface for the local data api plugin
|
|
44
54
|
this.localDataClient = relayClientWithLocalData;
|
|
45
55
|
this.entityMergers = {
|
|
46
|
-
"assetWhere": new asset_where_entity_merger_1.
|
|
47
|
-
"getRootMap": new root_map_entity_merger_1.
|
|
56
|
+
"assetWhere": new asset_where_entity_merger_1.AssetWhereResponseMerger(),
|
|
57
|
+
"getRootMap": new root_map_entity_merger_1.GetRootMapResponseMerger(),
|
|
48
58
|
"getDeployedState": new enterprise_state_entity_merger_1.DeployedStateEntityMerger()
|
|
49
59
|
};
|
|
50
60
|
}
|
|
51
|
-
/** Both params MUST be of the SAME RESULT TYPE.
|
|
52
|
-
*
|
|
53
|
-
* Ignores additional if original has an error.
|
|
54
|
-
*
|
|
55
|
-
* Mutates the original by appending the output of the additional.
|
|
56
|
-
* NOTE: `error`, `success`, and `message` from the additional ARE IGNORED by default.
|
|
57
|
-
*
|
|
58
|
-
* @param absorbErrors (default: false) When true, error, success, and message from the additional shall be brought forward in the ultimate result.
|
|
59
|
-
*/
|
|
60
|
-
absorbOutput(original, additional, absorbErrors = false) {
|
|
61
|
-
var _a, _b, _c, _d;
|
|
62
|
-
try {
|
|
63
|
-
// Ignore additional if the original errored out.
|
|
64
|
-
if (additional == undefined)
|
|
65
|
-
return original;
|
|
66
|
-
if (original.error)
|
|
67
|
-
return original;
|
|
68
|
-
// If we're reading we still want success when original returned none,
|
|
69
|
-
// but additional returned at least one.
|
|
70
|
-
original.success = original.success || additional.success;
|
|
71
|
-
if (absorbErrors == true) {
|
|
72
|
-
if (additional.message && !_.isEmpty(additional.message)) {
|
|
73
|
-
original.message = ((_a = original.message) !== null && _a !== void 0 ? _a : "").concat("\n", additional.message).trim();
|
|
74
|
-
}
|
|
75
|
-
if (additional.error) {
|
|
76
|
-
original.error = additional.error;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
// ListResult OUTPUT
|
|
80
|
-
let lrAddl = asListResult(additional);
|
|
81
|
-
if (lrAddl && lrAddl.output && lrAddl.output.length > 0) {
|
|
82
|
-
let lrOrig = original;
|
|
83
|
-
lrOrig.output = (_b = lrOrig.output) !== null && _b !== void 0 ? _b : [];
|
|
84
|
-
lrOrig.output.push(...lrAddl.output);
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
// SingleResult OUTPUT
|
|
88
|
-
let srAddl = asSingleResult(additional);
|
|
89
|
-
if (srAddl) {
|
|
90
|
-
let srOrig = original;
|
|
91
|
-
if (srOrig.output) {
|
|
92
|
-
// find a registered object merger and apply it to merge both objs
|
|
93
|
-
// eg: RootMap - how do we do this?
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
srOrig.output = srAddl.output; // Take the additional; it's the only one here.
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
// BatchResult OUTPUT
|
|
101
|
-
let brOrig = asBatchResult(original);
|
|
102
|
-
if (brOrig) {
|
|
103
|
-
let brAddl = asBatchResult(additional);
|
|
104
|
-
if (brAddl === null || brAddl === void 0 ? void 0 : brAddl.successes) {
|
|
105
|
-
brOrig.successes = ((_c = brOrig.successes) !== null && _c !== void 0 ? _c : []);
|
|
106
|
-
brOrig.successes.push(...brAddl.successes);
|
|
107
|
-
}
|
|
108
|
-
if (brAddl === null || brAddl === void 0 ? void 0 : brAddl.failures) {
|
|
109
|
-
brOrig.failures = ((_d = brOrig.failures) !== null && _d !== void 0 ? _d : []);
|
|
110
|
-
brOrig.failures.push(...brAddl.failures);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
return original;
|
|
116
|
-
}
|
|
117
|
-
catch (err) {
|
|
118
|
-
throw err;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
61
|
tryMakeRestCall(ep, request, options) {
|
|
122
62
|
const _super = Object.create(null, {
|
|
123
63
|
tryMakeRestCall: { get: () => super.tryMakeRestCall }
|
|
124
64
|
});
|
|
125
|
-
var _a, _b;
|
|
65
|
+
var _a, _b, _c, _d;
|
|
126
66
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
127
67
|
let response = { success: false };
|
|
128
68
|
try {
|
|
129
|
-
let
|
|
69
|
+
let epLocal = _.clone(ep);
|
|
70
|
+
if ((_a = this.settings) === null || _a === void 0 ? void 0 : _a.localDataRoutePrefix)
|
|
71
|
+
epLocal.route = path.posix.join(this.settings.localDataRoutePrefix, ep.route);
|
|
72
|
+
let isLocal = (_b = type_safety_utils_1.TypeSafetyUtils.toTriState(options === null || options === void 0 ? void 0 : options.thisMachine)) !== null && _b !== void 0 ? _b : type_safety_utils_1.TypeSafetyUtils.toTriState(request.thisMachine);
|
|
130
73
|
if (isLocal == true) {
|
|
131
74
|
// Request made specifically for local entity(ies)
|
|
132
|
-
|
|
75
|
+
response = yield this.localDataClient.tryMakeRestCall(epLocal, request, options);
|
|
133
76
|
}
|
|
134
77
|
else {
|
|
135
78
|
if (ep.verb == codiac_common_1.httpRestVerb.GET) {
|
|
@@ -139,19 +82,21 @@ let ApiClientPlusLocal = ApiClientPlusLocal_1 = class ApiClientPlusLocal extends
|
|
|
139
82
|
if (responseRemote.error)
|
|
140
83
|
return responseRemote;
|
|
141
84
|
// Q: Add locals to the output?
|
|
142
|
-
// A: Yes, unless they specifically wanted locals omitted (that feature doesnt exist yet, so dont worry about it)
|
|
85
|
+
// A: Yes, unless they specifically wanted locals omitted (that feature doesnt exist yet, so dont worry about it)
|
|
143
86
|
// A: OR unless theyre asking for a single record, in which case the local shouldnt return one anyway, but its a waste to ask.
|
|
144
87
|
// A: OR unless the local api doesnt have a method for that endpoint
|
|
145
|
-
// what if remote fails but not local?
|
|
88
|
+
// what if remote fails but not local? Throw
|
|
146
89
|
// what if local fails but not remote? log a warning/error but dont throw
|
|
147
90
|
let localResponse;
|
|
148
|
-
if (
|
|
149
|
-
|
|
91
|
+
if (isLocal != false) /* Unless they explicitly omitted local data */ {
|
|
92
|
+
if (this.localDataClient[ep.entityTypeName]) {
|
|
93
|
+
localResponse = yield this.localDataClient.tryMakeRestCall(epLocal, request, options);
|
|
94
|
+
}
|
|
150
95
|
}
|
|
151
96
|
response = this.absorbOutput(responseRemote, localResponse);
|
|
152
97
|
}
|
|
153
98
|
else {
|
|
154
|
-
// WRITE OPERATION
|
|
99
|
+
// WRITE OPERATION
|
|
155
100
|
// TODO: Investigate specifying thisMachine on patch specs and idspecs
|
|
156
101
|
response = yield _super.tryMakeRestCall.call(this, ep, request, options);
|
|
157
102
|
}
|
|
@@ -159,7 +104,7 @@ let ApiClientPlusLocal = ApiClientPlusLocal_1 = class ApiClientPlusLocal extends
|
|
|
159
104
|
}
|
|
160
105
|
catch (err) {
|
|
161
106
|
response.error = err;
|
|
162
|
-
response.message = "Error performing ".concat(ep.op, " ", ep.entityTypeName, ": ", (
|
|
107
|
+
response.message = "Error performing ".concat(ep.op, " ", ep.entityTypeName, ": ", (_c = err.name) !== null && _c !== void 0 ? _c : "", (_d = err.message) !== null && _d !== void 0 ? _d : "");
|
|
163
108
|
}
|
|
164
109
|
finally {
|
|
165
110
|
return response;
|
|
@@ -170,12 +115,16 @@ let ApiClientPlusLocal = ApiClientPlusLocal_1 = class ApiClientPlusLocal extends
|
|
|
170
115
|
const _super = Object.create(null, {
|
|
171
116
|
makeAnyRestCall: { get: () => super.makeAnyRestCall }
|
|
172
117
|
});
|
|
118
|
+
var _a, _b;
|
|
173
119
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
174
120
|
try {
|
|
175
|
-
let
|
|
121
|
+
let epLocal = _.clone(ep);
|
|
122
|
+
if ((_a = this.settings) === null || _a === void 0 ? void 0 : _a.localDataRoutePrefix)
|
|
123
|
+
epLocal.route = path.posix.join(this.settings.localDataRoutePrefix, ep.route);
|
|
124
|
+
let isLocal = (_b = type_safety_utils_1.TypeSafetyUtils.toTriState(options === null || options === void 0 ? void 0 : options.thisMachine)) !== null && _b !== void 0 ? _b : type_safety_utils_1.TypeSafetyUtils.toTriState(request.thisMachine);
|
|
176
125
|
if (isLocal == true) {
|
|
177
126
|
// Request made specifically for local entity(ies)
|
|
178
|
-
return yield this.localDataClient.makeAnyRestCall(
|
|
127
|
+
return yield this.localDataClient.makeAnyRestCall(epLocal, request, options);
|
|
179
128
|
}
|
|
180
129
|
else {
|
|
181
130
|
if (ep.verb == codiac_common_1.httpRestVerb.GET) {
|
|
@@ -184,8 +133,12 @@ let ApiClientPlusLocal = ApiClientPlusLocal_1 = class ApiClientPlusLocal extends
|
|
|
184
133
|
if (responseRemote.error)
|
|
185
134
|
return responseRemote;
|
|
186
135
|
let localResponse;
|
|
187
|
-
if (
|
|
188
|
-
|
|
136
|
+
if (isLocal != false) /* Unless they explicitly omitted local data */ {
|
|
137
|
+
if (this.localDataClient.Call[ep.op]) {
|
|
138
|
+
localResponse = yield this.localDataClient.makeAnyRestCall(epLocal, request, options);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (localResponse) {
|
|
189
142
|
const composite = this.merge(ep.op, responseRemote, localResponse);
|
|
190
143
|
return composite;
|
|
191
144
|
}
|
|
@@ -204,6 +157,80 @@ let ApiClientPlusLocal = ApiClientPlusLocal_1 = class ApiClientPlusLocal extends
|
|
|
204
157
|
}
|
|
205
158
|
});
|
|
206
159
|
}
|
|
160
|
+
/** Both params MUST be of the SAME RESULT TYPE.
|
|
161
|
+
*
|
|
162
|
+
* Ignores additional if original has an error.
|
|
163
|
+
*
|
|
164
|
+
* Mutates the original by appending the output of the additional.
|
|
165
|
+
* NOTE: `error`, `success`, and `message` from the additional ARE IGNORED by default.
|
|
166
|
+
*
|
|
167
|
+
* @param absorbErrors (default: false) When true, error, success, and message from the additional shall be brought forward in the ultimate result.
|
|
168
|
+
*/
|
|
169
|
+
absorbOutput(original, additional, absorbErrors = false) {
|
|
170
|
+
var _a, _b, _c, _d, _e, _f;
|
|
171
|
+
try {
|
|
172
|
+
// Ignore additional if the original errored out.
|
|
173
|
+
if (additional == undefined)
|
|
174
|
+
return original;
|
|
175
|
+
if (original.error)
|
|
176
|
+
return original;
|
|
177
|
+
// If we're reading we still want success when original returned none,
|
|
178
|
+
// but additional returned at least one.
|
|
179
|
+
original.success = original.success || additional.success;
|
|
180
|
+
if (absorbErrors == true) {
|
|
181
|
+
if (additional.message && !_.isEmpty(additional.message)) {
|
|
182
|
+
original.message = ((_a = original.message) !== null && _a !== void 0 ? _a : "").concat("\n", additional.message).trim();
|
|
183
|
+
}
|
|
184
|
+
if (additional.error) {
|
|
185
|
+
original.error = additional.error;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
// ListResult OUTPUT
|
|
189
|
+
let lrAddl = asListResult(additional);
|
|
190
|
+
if (lrAddl && lrAddl.output && lrAddl.output.length > 0) {
|
|
191
|
+
let lrOrig = original;
|
|
192
|
+
lrOrig.output = (_b = lrOrig.output) !== null && _b !== void 0 ? _b : [];
|
|
193
|
+
lrOrig.output.push(...lrAddl.output);
|
|
194
|
+
lrOrig.count = (_d = (_c = lrOrig.output) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0;
|
|
195
|
+
lrOrig.success = Boolean(lrOrig.output.length > 0);
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
// SingleResult OUTPUT
|
|
199
|
+
let srAddl = asSingleResult(additional);
|
|
200
|
+
if (srAddl) {
|
|
201
|
+
let srOrig = original;
|
|
202
|
+
if (srOrig.output) {
|
|
203
|
+
// find a registered object merger and apply it to merge both objs
|
|
204
|
+
// eg: RootMap - how do we do this?
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
srOrig.output = srAddl.output; // Take the additional; it's the only one here.
|
|
208
|
+
}
|
|
209
|
+
srOrig.success = Boolean(srOrig.output != undefined);
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
// BatchResult OUTPUT
|
|
213
|
+
let brOrig = asBatchResult(original);
|
|
214
|
+
if (brOrig) {
|
|
215
|
+
let brAddl = asBatchResult(additional);
|
|
216
|
+
if (brAddl === null || brAddl === void 0 ? void 0 : brAddl.successes) {
|
|
217
|
+
brOrig.successes = ((_e = brOrig.successes) !== null && _e !== void 0 ? _e : []);
|
|
218
|
+
brOrig.successes.push(...brAddl.successes);
|
|
219
|
+
}
|
|
220
|
+
if (brAddl === null || brAddl === void 0 ? void 0 : brAddl.failures) {
|
|
221
|
+
brOrig.failures = ((_f = brOrig.failures) !== null && _f !== void 0 ? _f : []);
|
|
222
|
+
brOrig.failures.push(...brAddl.failures);
|
|
223
|
+
}
|
|
224
|
+
brOrig.success = Boolean((brOrig.successes != undefined) && (brOrig.successes.length > 0) && (brOrig.failures == undefined || brOrig.failures.length == 0));
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return original;
|
|
229
|
+
}
|
|
230
|
+
catch (err) {
|
|
231
|
+
throw err;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
207
234
|
/** Merges the two objects as arrays or based on a custom merger
|
|
208
235
|
* or falling back to a raw object merge. */
|
|
209
236
|
merge(operationId, responseRemote, localResponse) {
|
|
@@ -234,8 +261,10 @@ ApiClientPlusLocal = ApiClientPlusLocal_1 = tslib_1.__decorate([
|
|
|
234
261
|
tslib_1.__param(0, (0, inversify_1.inject)(codiac_relay_1.RelayClient)),
|
|
235
262
|
tslib_1.__param(1, (0, inversify_1.inject)(codiac_common_1.INTERFACES.IBetterLogger)),
|
|
236
263
|
tslib_1.__param(2, (0, inversify_1.inject)(codiac_api_1.CodiacClientConfig)),
|
|
237
|
-
tslib_1.__param(3, (0, inversify_1.inject)(
|
|
264
|
+
tslib_1.__param(3, (0, inversify_1.inject)(ApiClientPlusLocalConfig)),
|
|
265
|
+
tslib_1.__param(4, (0, inversify_1.inject)(codiac_api_1.ApiUserCreds)),
|
|
238
266
|
tslib_1.__metadata("design:paramtypes", [codiac_relay_1.RelayClient, Object, codiac_api_1.CodiacClientConfig,
|
|
267
|
+
ApiClientPlusLocalConfig,
|
|
239
268
|
codiac_api_1.ApiUserCreds])
|
|
240
269
|
], ApiClientPlusLocal);
|
|
241
270
|
exports.ApiClientPlusLocal = ApiClientPlusLocal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-client-plus-local.js","sourceRoot":"","sources":["../../../src/apis/api-plus-local/api-client-plus-local.ts"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"api-client-plus-local.js","sourceRoot":"","sources":["../../../src/apis/api-plus-local/api-client-plus-local.ts"],"names":[],"mappings":";;;;;AAAA,6BAA6B;AAC7B,yCAA+C;AAC/C,4BAA6B;AAC7B,4DAAiG;AAIjG,uEAAkE;AAClE,8CAA+E;AAE/E,kDAAgE;AAChE,2EAAuE;AACvE,qFAA4G;AAE5G,qEAAoE;AAWpE,SAAS,aAAa,CAAC,SAAyB;;IAC9C,IAAI,EAAE,GAAG,SAAqC,CAAC;IAC/C,OAAO,CAAC,OAAO,CAAC,MAAA,EAAE,CAAC,SAAS,mCAAI,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AACjE,CAAC;AAED,SAAS,YAAY,CAAC,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AC;CAGF,CAAA;AA/OY,kBAAkB;IAD9B,IAAA,sBAAU,GAAE;IAiBR,mBAAA,IAAA,kBAAM,EAAC,0BAAc,CAAC,CAAA;IACtB,mBAAA,IAAA,kBAAM,EAAC,0BAAU,CAAC,aAAa,CAAC,CAAA;IAChC,mBAAA,IAAA,kBAAM,EAAC,+BAAkB,CAAC,CAAA;IAC1B,mBAAA,IAAA,kBAAM,EAAC,wBAAwB,CAAC,CAAA;IAChC,mBAAA,IAAA,kBAAM,EAAC,yBAAY,CAAC,CAAA;6CAJ6B,0BAAc,UAEhB,+BAAkB;QACb,wBAAwB;QACzC,yBAAY;GApBvC,kBAAkB,CA+O9B;AA/OY,gDAAkB"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { IEntityMerger } from "./i-entity-merger";
|
|
2
2
|
import { CabinetAssetVersion } from "../codiac-api/contracts";
|
|
3
|
-
|
|
3
|
+
/** IMPORTANT!!! Merges two `ListResult<CabinetAssetVersion>` instances (NOT raw `CabinetAssetVersion` entities).
|
|
4
|
+
*/
|
|
5
|
+
export declare class AssetWhereResponseMerger implements IEntityMerger {
|
|
4
6
|
constructor();
|
|
5
7
|
merge<T>(original: T, additional?: T | undefined): T;
|
|
6
8
|
/** Mutates the original */
|
|
7
|
-
|
|
9
|
+
mergeEntities(original: CabinetAssetVersion[], additional?: CabinetAssetVersion[] | undefined): CabinetAssetVersion[];
|
|
8
10
|
}
|
|
@@ -1,22 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.AssetWhereResponseMerger = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const inversify_1 = require("inversify");
|
|
6
6
|
const _ = require("lodash");
|
|
7
|
-
|
|
7
|
+
/** IMPORTANT!!! Merges two `ListResult<CabinetAssetVersion>` instances (NOT raw `CabinetAssetVersion` entities).
|
|
8
|
+
*/
|
|
9
|
+
let AssetWhereResponseMerger = class AssetWhereResponseMerger {
|
|
8
10
|
constructor() {
|
|
9
11
|
}
|
|
10
12
|
merge(original, additional) {
|
|
11
|
-
|
|
13
|
+
// Extract the entity from the response envelope
|
|
14
|
+
let originalOut = original === null || original === void 0 ? void 0 : original.output;
|
|
15
|
+
let additionalOut = additional === null || additional === void 0 ? void 0 : additional.output;
|
|
16
|
+
// Merge the entities into 1
|
|
17
|
+
let ult = this.mergeEntities(originalOut !== null && originalOut !== void 0 ? originalOut : [], additionalOut);
|
|
18
|
+
// rewrite the original output
|
|
19
|
+
original.output = ult;
|
|
20
|
+
return original;
|
|
12
21
|
}
|
|
13
22
|
/** Mutates the original */
|
|
14
|
-
|
|
23
|
+
mergeEntities(original, additional) {
|
|
15
24
|
var _a;
|
|
16
25
|
try {
|
|
17
26
|
if (additional == undefined || _.isEmpty(additional))
|
|
18
27
|
return original;
|
|
19
|
-
original;
|
|
28
|
+
original.push(...additional);
|
|
20
29
|
return original;
|
|
21
30
|
}
|
|
22
31
|
catch (err) {
|
|
@@ -25,9 +34,9 @@ let AssetWhereEntityMerger = class AssetWhereEntityMerger {
|
|
|
25
34
|
}
|
|
26
35
|
}
|
|
27
36
|
};
|
|
28
|
-
|
|
37
|
+
AssetWhereResponseMerger = tslib_1.__decorate([
|
|
29
38
|
(0, inversify_1.injectable)(),
|
|
30
39
|
tslib_1.__metadata("design:paramtypes", [])
|
|
31
|
-
],
|
|
32
|
-
exports.
|
|
40
|
+
], AssetWhereResponseMerger);
|
|
41
|
+
exports.AssetWhereResponseMerger = AssetWhereResponseMerger;
|
|
33
42
|
//# sourceMappingURL=asset-where-entity-merger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset-where-entity-merger.js","sourceRoot":"","sources":["../../../src/apis/api-plus-local/asset-where-entity-merger.ts"],"names":[],"mappings":";;;;AAAA,yCAA+C;AAC/C,4BAA6B;
|
|
1
|
+
{"version":3,"file":"asset-where-entity-merger.js","sourceRoot":"","sources":["../../../src/apis/api-plus-local/asset-where-entity-merger.ts"],"names":[],"mappings":";;;;AAAA,yCAA+C;AAC/C,4BAA6B;AAM7B;GACG;AAEI,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IACnC;IACA,CAAC;IAEM,KAAK,CAAI,QAAW,EAAE,UAA0B;QACrD,gDAAgD;QAChD,IAAI,WAAW,GAAI,QAAiD,aAAjD,QAAQ,uBAAR,QAAQ,CAA2C,MAA+B,CAAC;QACtG,IAAI,aAAa,GAAI,UAAmD,aAAnD,UAAU,uBAAV,UAAU,CAA2C,MAA2C,CAAC;QACtH,4BAA4B;QAC5B,IAAI,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,EAAE,EAAE,aAAa,CAAC,CAAC;QAC/D,8BAA8B;QAC7B,QAAiD,CAAC,MAAM,GAAG,GAAG,CAAC;QAChE,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,2BAA2B;IACpB,aAAa,CAAC,QAA+B,EAAE,UAA8C;;QAClG,IAAI;YACF,IAAI,UAAU,IAAI,SAAS,IAAI,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;gBAAE,OAAO,QAAQ,CAAC;YAEtE,QAAQ,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC;YAE7B,OAAO,QAAQ,CAAC;SACjB;QAAC,OAAO,GAAG,EAAE;YACZ,MAAM,MAAM,GAAG,+CAA+C,CAAC,MAAM,CAAC,MAAA,GAAG,CAAC,OAAO,mCAAI,EAAE,CAAC,CAAC;YACzF,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC;SACzB;IACH,CAAC;CACF,CAAA;AA5BY,wBAAwB;IADpC,IAAA,sBAAU,GAAE;;GACA,wBAAwB,CA4BpC;AA5BY,4DAAwB"}
|
|
@@ -2,7 +2,8 @@ import { IEntityMerger } from "./i-entity-merger";
|
|
|
2
2
|
import { EnterpriseState } from "../codiac-api/contracts";
|
|
3
3
|
export declare class DeployedStateEntityMerger implements IEntityMerger {
|
|
4
4
|
constructor();
|
|
5
|
-
|
|
5
|
+
/** Mutates the original. */
|
|
6
|
+
merge<TResponse>(original: TResponse, additional?: TResponse | undefined): TResponse;
|
|
6
7
|
/** Mutates the original */
|
|
7
|
-
|
|
8
|
+
mergeEntities(original: EnterpriseState, additional?: EnterpriseState | undefined): EnterpriseState;
|
|
8
9
|
}
|
|
@@ -7,11 +7,22 @@ const _ = require("lodash");
|
|
|
7
7
|
let DeployedStateEntityMerger = class DeployedStateEntityMerger {
|
|
8
8
|
constructor() {
|
|
9
9
|
}
|
|
10
|
+
// public merge<T>(original: T, additional?: T | undefined): T {
|
|
11
|
+
// return this.merge(original as EnterpriseState, additional as EnterpriseState | undefined) as T;
|
|
12
|
+
// }
|
|
13
|
+
/** Mutates the original. */
|
|
10
14
|
merge(original, additional) {
|
|
11
|
-
|
|
15
|
+
// Extract the entity from the response envelope
|
|
16
|
+
let originalOut = original === null || original === void 0 ? void 0 : original.output;
|
|
17
|
+
let additionalOut = additional === null || additional === void 0 ? void 0 : additional.output;
|
|
18
|
+
// merge the entities into 1
|
|
19
|
+
let ult = this.mergeEntities(originalOut, additionalOut);
|
|
20
|
+
// rewrite the original output
|
|
21
|
+
original.output = ult;
|
|
22
|
+
return original;
|
|
12
23
|
}
|
|
13
24
|
/** Mutates the original */
|
|
14
|
-
|
|
25
|
+
mergeEntities(original, additional) {
|
|
15
26
|
var _a, _b, _c, _d, _e;
|
|
16
27
|
try {
|
|
17
28
|
if (additional == undefined || _.isEmpty(additional))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enterprise-state-entity-merger.js","sourceRoot":"","sources":["../../../src/apis/api-plus-local/enterprise-state-entity-merger.ts"],"names":[],"mappings":";;;;AAAA,yCAA+C;AAC/C,4BAA6B;
|
|
1
|
+
{"version":3,"file":"enterprise-state-entity-merger.js","sourceRoot":"","sources":["../../../src/apis/api-plus-local/enterprise-state-entity-merger.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AAkB,GAAG,CAAC,GAAG,MAAA,QAAQ,CAAC,kBAAkB,mCAAI,EAAE,EAAE,GAAG,MAAA,UAAU,CAAC,kBAAkB,mCAAI,EAAE,CAAC,CAAC;gBAC7G,QAAQ,CAAC,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;aACrF;YAED,OAAO,QAAQ,CAAC;SACjB;QAAC,OAAO,GAAG,EAAE;YACZ,MAAM,MAAM,GAAG,+CAA+C,CAAC,MAAM,CAAC,MAAA,GAAG,CAAC,OAAO,mCAAI,EAAE,CAAC,CAAC;YACzF,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC;SACzB;IACH,CAAC;CACF,CAAA;AA3CY,yBAAyB;IADrC,IAAA,sBAAU,GAAE;;GACA,yBAAyB,CA2CrC;AA3CY,8DAAyB"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { IEntityMerger } from "./i-entity-merger";
|
|
2
2
|
import { RootMap } from "../codiac-api/contracts";
|
|
3
|
-
|
|
3
|
+
/** IMPORTANT!!! Merges two `SingleResult<RootMap>` instances (NOT raw `RootMap` entities).
|
|
4
|
+
*/
|
|
5
|
+
export declare class GetRootMapResponseMerger implements IEntityMerger {
|
|
4
6
|
constructor();
|
|
7
|
+
/** Mutates the original. */
|
|
5
8
|
merge<T>(original: T, additional?: T | undefined): T;
|
|
6
|
-
/**
|
|
7
|
-
|
|
9
|
+
/** (Strongly-typed implementation of the merge method)
|
|
10
|
+
* Mutates the original */
|
|
11
|
+
mergeEntities(original: RootMap, additional?: RootMap | undefined): RootMap;
|
|
8
12
|
}
|
|
@@ -1,17 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.GetRootMapResponseMerger = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const inversify_1 = require("inversify");
|
|
6
6
|
const _ = require("lodash");
|
|
7
|
-
|
|
7
|
+
/** IMPORTANT!!! Merges two `SingleResult<RootMap>` instances (NOT raw `RootMap` entities).
|
|
8
|
+
*/
|
|
9
|
+
let GetRootMapResponseMerger = class GetRootMapResponseMerger {
|
|
8
10
|
constructor() {
|
|
9
11
|
}
|
|
12
|
+
/** Mutates the original. */
|
|
10
13
|
merge(original, additional) {
|
|
11
|
-
|
|
14
|
+
// Extract the entity from the response envelope
|
|
15
|
+
let originalOut = original === null || original === void 0 ? void 0 : original.output;
|
|
16
|
+
let additionalOut = additional === null || additional === void 0 ? void 0 : additional.output;
|
|
17
|
+
// merge the entities into 1
|
|
18
|
+
let ult = this.mergeEntities(originalOut, additionalOut);
|
|
19
|
+
// rewrite the original output
|
|
20
|
+
original.output = ult;
|
|
21
|
+
return original;
|
|
12
22
|
}
|
|
13
|
-
/**
|
|
14
|
-
|
|
23
|
+
/** (Strongly-typed implementation of the merge method)
|
|
24
|
+
* Mutates the original */
|
|
25
|
+
mergeEntities(original, additional) {
|
|
15
26
|
var _a, _b, _c;
|
|
16
27
|
try {
|
|
17
28
|
if (additional == undefined || _.isEmpty(additional))
|
|
@@ -43,9 +54,9 @@ let RootMapEntityMerger = class RootMapEntityMerger {
|
|
|
43
54
|
}
|
|
44
55
|
}
|
|
45
56
|
};
|
|
46
|
-
|
|
57
|
+
GetRootMapResponseMerger = tslib_1.__decorate([
|
|
47
58
|
(0, inversify_1.injectable)(),
|
|
48
59
|
tslib_1.__metadata("design:paramtypes", [])
|
|
49
|
-
],
|
|
50
|
-
exports.
|
|
60
|
+
], GetRootMapResponseMerger);
|
|
61
|
+
exports.GetRootMapResponseMerger = GetRootMapResponseMerger;
|
|
51
62
|
//# sourceMappingURL=root-map-entity-merger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root-map-entity-merger.js","sourceRoot":"","sources":["../../../src/apis/api-plus-local/root-map-entity-merger.ts"],"names":[],"mappings":";;;;AAAA,yCAA+C;AAC/C,4BAA6B;
|
|
1
|
+
{"version":3,"file":"root-map-entity-merger.js","sourceRoot":"","sources":["../../../src/apis/api-plus-local/root-map-entity-merger.ts"],"names":[],"mappings":";;;;AAAA,yCAA+C;AAC/C,4BAA6B;AAM7B;GACG;AAEI,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IACnC;IACA,CAAC;IAED,4BAA4B;IACrB,KAAK,CAAI,QAAW,EAAE,UAA0B;QACrD,gDAAgD;QAChD,IAAI,WAAW,GAAI,QAAuC,aAAvC,QAAQ,uBAAR,QAAQ,CAAiC,MAAiB,CAAC;QAC9E,IAAI,aAAa,GAAI,UAAyC,aAAzC,UAAU,uBAAV,UAAU,CAAiC,MAA6B,CAAC;QAC9F,4BAA4B;QAC5B,IAAI,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;QACzD,8BAA8B;QAC7B,QAAuC,CAAC,MAAM,GAAG,GAAG,CAAC;QACtD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;8BAC0B;IACnB,aAAa,CAAC,QAAiB,EAAE,UAAgC;;QACtE,IAAI;YACF,IAAI,UAAU,IAAI,SAAS,IAAI,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;gBAAE,OAAO,QAAQ,CAAC;YAEtE,kBAAkB;YAClB,IAAI,UAAU,CAAC,QAAQ,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE;gBAC3D,QAAQ,CAAC,QAAQ,GAAG,CAAC,GAAG,MAAA,QAAQ,CAAC,QAAQ,mCAAI,EAAE,EAAE,GAAG,MAAA,UAAU,CAAC,QAAQ,mCAAI,EAAE,CAAC,CAAC;aAChF;YACD,mCAAmC;YACnC,IAAI,UAAU,CAAC,WAAW,IAAI,UAAU,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE;gBAC/D,KAAK,IA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