@capraconsulting/cals-cli 2.25.22 → 2.25.24
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/lib/cache.d.ts +27 -27
- package/lib/cals-cli.d.ts +1 -1
- package/lib/cals-cli.js +2748 -2748
- package/lib/cli/commands/definition/dump-setup.d.ts +3 -3
- package/lib/cli/commands/definition/util.d.ts +6 -6
- package/lib/cli/commands/definition/util.test.d.ts +1 -1
- package/lib/cli/commands/definition/validate.d.ts +3 -3
- package/lib/cli/commands/definition.d.ts +3 -3
- package/lib/cli/commands/delete-cache.d.ts +3 -3
- package/lib/cli/commands/getting-started.d.ts +3 -3
- package/lib/cli/commands/github/analyze-directory.d.ts +3 -3
- package/lib/cli/commands/github/configure.d.ts +3 -3
- package/lib/cli/commands/github/generate-clone-commands.d.ts +3 -3
- package/lib/cli/commands/github/list-pull-requests-stats.d.ts +3 -3
- package/lib/cli/commands/github/list-repos.d.ts +3 -3
- package/lib/cli/commands/github/list-webhooks.d.ts +3 -3
- package/lib/cli/commands/github/set-token.d.ts +3 -3
- package/lib/cli/commands/github/sync.d.ts +9 -9
- package/lib/cli/commands/github/util.d.ts +3 -3
- package/lib/cli/commands/github.d.ts +3 -3
- package/lib/cli/commands/snyk/report.d.ts +3 -3
- package/lib/cli/commands/snyk/set-token.d.ts +3 -3
- package/lib/cli/commands/snyk/sync.d.ts +3 -3
- package/lib/cli/commands/snyk.d.ts +3 -3
- package/lib/cli/index.d.ts +1 -1
- package/lib/cli/index.test.d.ts +1 -1
- package/lib/cli/reporter.d.ts +27 -27
- package/lib/cli/util.d.ts +11 -11
- package/lib/config.d.ts +14 -14
- package/lib/definition/definition.d.ts +13 -13
- package/lib/definition/definition.test.d.ts +1 -1
- package/lib/definition/index.d.ts +2 -2
- package/lib/definition/types.d.ts +78 -78
- package/lib/git/GitRepo.d.ts +31 -31
- package/lib/git/util.d.ts +16 -16
- package/lib/git/util.test.d.ts +1 -1
- package/lib/github/changeset/changeset.d.ts +21 -21
- package/lib/github/changeset/execute.d.ts +10 -10
- package/lib/github/changeset/types.d.ts +93 -93
- package/lib/github/index.d.ts +2 -2
- package/lib/github/service.d.ts +91 -91
- package/lib/github/token.d.ts +11 -11
- package/lib/github/types.d.ts +85 -85
- package/lib/github/util.d.ts +8 -8
- package/lib/index.d.ts +14 -14
- package/lib/index.es.js +1519 -1519
- package/lib/index.js +1519 -1519
- package/lib/load-secrets/index.d.ts +2 -2
- package/lib/load-secrets/load-secrets.d.ts +7 -7
- package/lib/load-secrets/types.d.ts +22 -22
- package/lib/snyk/index.d.ts +3 -3
- package/lib/snyk/service.d.ts +21 -21
- package/lib/snyk/token.d.ts +11 -11
- package/lib/snyk/types.d.ts +27 -27
- package/lib/snyk/util.d.ts +3 -3
- package/lib/snyk/util.test.d.ts +1 -1
- package/lib/sonarcloud/index.d.ts +2 -2
- package/lib/sonarcloud/service.d.ts +33 -33
- package/lib/sonarcloud/token.d.ts +8 -8
- package/lib/testing/executor.d.ts +25 -25
- package/lib/testing/index.d.ts +2 -2
- package/lib/testing/lib.d.ts +64 -64
- package/package.json +7 -7
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { loadSecretsCli } from "./load-secrets";
|
|
2
|
-
export { JsonSecret, Secret, SecretGroup } from "./types";
|
|
1
|
+
export { loadSecretsCli } from "./load-secrets";
|
|
2
|
+
export { JsonSecret, Secret, SecretGroup } from "./types";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { SecretGroup } from "./types";
|
|
2
|
-
/**
|
|
3
|
-
* Load secrets interactively into Secrets Manager.
|
|
4
|
-
*/
|
|
5
|
-
export declare function loadSecretsCli(props: {
|
|
6
|
-
secretGroups: SecretGroup[];
|
|
7
|
-
}): void;
|
|
1
|
+
import { SecretGroup } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Load secrets interactively into Secrets Manager.
|
|
4
|
+
*/
|
|
5
|
+
export declare function loadSecretsCli(props: {
|
|
6
|
+
secretGroups: SecretGroup[];
|
|
7
|
+
}): void;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
export interface BaseSecret {
|
|
2
|
-
name: string;
|
|
3
|
-
description?: string;
|
|
4
|
-
}
|
|
5
|
-
export type JsonSecretSimpleField = string;
|
|
6
|
-
export interface JsonSecretDescribedField {
|
|
7
|
-
key: string;
|
|
8
|
-
description?: string;
|
|
9
|
-
example?: string;
|
|
10
|
-
}
|
|
11
|
-
export interface JsonSecret extends BaseSecret {
|
|
12
|
-
type: "json";
|
|
13
|
-
fields: (JsonSecretSimpleField | JsonSecretDescribedField)[];
|
|
14
|
-
}
|
|
15
|
-
export type Secret = JsonSecret;
|
|
16
|
-
export interface SecretGroup {
|
|
17
|
-
accountId: string;
|
|
18
|
-
region: string;
|
|
19
|
-
description: string;
|
|
20
|
-
namePrefix: string;
|
|
21
|
-
secrets: Secret[];
|
|
22
|
-
}
|
|
1
|
+
export interface BaseSecret {
|
|
2
|
+
name: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
}
|
|
5
|
+
export type JsonSecretSimpleField = string;
|
|
6
|
+
export interface JsonSecretDescribedField {
|
|
7
|
+
key: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
example?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface JsonSecret extends BaseSecret {
|
|
12
|
+
type: "json";
|
|
13
|
+
fields: (JsonSecretSimpleField | JsonSecretDescribedField)[];
|
|
14
|
+
}
|
|
15
|
+
export type Secret = JsonSecret;
|
|
16
|
+
export interface SecretGroup {
|
|
17
|
+
accountId: string;
|
|
18
|
+
region: string;
|
|
19
|
+
description: string;
|
|
20
|
+
namePrefix: string;
|
|
21
|
+
secrets: Secret[];
|
|
22
|
+
}
|
package/lib/snyk/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { createSnykService, SnykService } from "./service";
|
|
2
|
-
export { SnykGitHubRepo, SnykProject } from "./types";
|
|
3
|
-
export { getGitHubRepo, getGitHubRepoId } from "./util";
|
|
1
|
+
export { createSnykService, SnykService } from "./service";
|
|
2
|
+
export { SnykGitHubRepo, SnykProject } from "./types";
|
|
3
|
+
export { getGitHubRepo, getGitHubRepoId } from "./util";
|
package/lib/snyk/service.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { Config } from "../config";
|
|
2
|
-
import { Definition } from "../definition/types";
|
|
3
|
-
import { SnykTokenProvider } from "./token";
|
|
4
|
-
import { SnykProject } from "./types";
|
|
5
|
-
interface SnykServiceProps {
|
|
6
|
-
config: Config;
|
|
7
|
-
tokenProvider: SnykTokenProvider;
|
|
8
|
-
}
|
|
9
|
-
export declare class SnykService {
|
|
10
|
-
private config;
|
|
11
|
-
private tokenProvider;
|
|
12
|
-
constructor(props: SnykServiceProps);
|
|
13
|
-
getProjects(definition: Definition): Promise<SnykProject[]>;
|
|
14
|
-
getProjectsByAccountId(snykAccountId: string): Promise<SnykProject[]>;
|
|
15
|
-
}
|
|
16
|
-
interface CreateSnykServiceProps {
|
|
17
|
-
config: Config;
|
|
18
|
-
tokenProvider?: SnykTokenProvider;
|
|
19
|
-
}
|
|
20
|
-
export declare function createSnykService(props: CreateSnykServiceProps): SnykService;
|
|
21
|
-
export {};
|
|
1
|
+
import { Config } from "../config";
|
|
2
|
+
import { Definition } from "../definition/types";
|
|
3
|
+
import { SnykTokenProvider } from "./token";
|
|
4
|
+
import { SnykProject } from "./types";
|
|
5
|
+
interface SnykServiceProps {
|
|
6
|
+
config: Config;
|
|
7
|
+
tokenProvider: SnykTokenProvider;
|
|
8
|
+
}
|
|
9
|
+
export declare class SnykService {
|
|
10
|
+
private config;
|
|
11
|
+
private tokenProvider;
|
|
12
|
+
constructor(props: SnykServiceProps);
|
|
13
|
+
getProjects(definition: Definition): Promise<SnykProject[]>;
|
|
14
|
+
getProjectsByAccountId(snykAccountId: string): Promise<SnykProject[]>;
|
|
15
|
+
}
|
|
16
|
+
interface CreateSnykServiceProps {
|
|
17
|
+
config: Config;
|
|
18
|
+
tokenProvider?: SnykTokenProvider;
|
|
19
|
+
}
|
|
20
|
+
export declare function createSnykService(props: CreateSnykServiceProps): SnykService;
|
|
21
|
+
export {};
|
package/lib/snyk/token.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export interface SnykTokenProvider {
|
|
2
|
-
getToken(): Promise<string | undefined>;
|
|
3
|
-
markInvalid(): Promise<void>;
|
|
4
|
-
}
|
|
5
|
-
export declare class SnykTokenCliProvider implements SnykTokenProvider {
|
|
6
|
-
private keyringService;
|
|
7
|
-
private keyringAccount;
|
|
8
|
-
getToken(): Promise<string | undefined>;
|
|
9
|
-
markInvalid(): Promise<void>;
|
|
10
|
-
setToken(value: string): Promise<void>;
|
|
11
|
-
}
|
|
1
|
+
export interface SnykTokenProvider {
|
|
2
|
+
getToken(): Promise<string | undefined>;
|
|
3
|
+
markInvalid(): Promise<void>;
|
|
4
|
+
}
|
|
5
|
+
export declare class SnykTokenCliProvider implements SnykTokenProvider {
|
|
6
|
+
private keyringService;
|
|
7
|
+
private keyringAccount;
|
|
8
|
+
getToken(): Promise<string | undefined>;
|
|
9
|
+
markInvalid(): Promise<void>;
|
|
10
|
+
setToken(value: string): Promise<void>;
|
|
11
|
+
}
|
package/lib/snyk/types.d.ts
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
export interface SnykProject {
|
|
2
|
-
name: string;
|
|
3
|
-
id: string;
|
|
4
|
-
created: string;
|
|
5
|
-
origin: string;
|
|
6
|
-
type: string;
|
|
7
|
-
testFrequency: string;
|
|
8
|
-
isMonitored: boolean;
|
|
9
|
-
totalDependencies: number;
|
|
10
|
-
issueCountsBySeverity: {
|
|
11
|
-
critical?: number;
|
|
12
|
-
high: number;
|
|
13
|
-
medium: number;
|
|
14
|
-
low: number;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* E.g. http://github.com/capralifecycle/some-repo.git
|
|
18
|
-
* Set when using the CLI.
|
|
19
|
-
*/
|
|
20
|
-
remoteRepoUrl?: string;
|
|
21
|
-
lastTestedDate?: string | null;
|
|
22
|
-
browseUrl: string;
|
|
23
|
-
}
|
|
24
|
-
export interface SnykGitHubRepo {
|
|
25
|
-
owner: string;
|
|
26
|
-
name: string;
|
|
27
|
-
}
|
|
1
|
+
export interface SnykProject {
|
|
2
|
+
name: string;
|
|
3
|
+
id: string;
|
|
4
|
+
created: string;
|
|
5
|
+
origin: string;
|
|
6
|
+
type: string;
|
|
7
|
+
testFrequency: string;
|
|
8
|
+
isMonitored: boolean;
|
|
9
|
+
totalDependencies: number;
|
|
10
|
+
issueCountsBySeverity: {
|
|
11
|
+
critical?: number;
|
|
12
|
+
high: number;
|
|
13
|
+
medium: number;
|
|
14
|
+
low: number;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* E.g. http://github.com/capralifecycle/some-repo.git
|
|
18
|
+
* Set when using the CLI.
|
|
19
|
+
*/
|
|
20
|
+
remoteRepoUrl?: string;
|
|
21
|
+
lastTestedDate?: string | null;
|
|
22
|
+
browseUrl: string;
|
|
23
|
+
}
|
|
24
|
+
export interface SnykGitHubRepo {
|
|
25
|
+
owner: string;
|
|
26
|
+
name: string;
|
|
27
|
+
}
|
package/lib/snyk/util.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { SnykGitHubRepo, SnykProject } from "./types";
|
|
2
|
-
export declare function getGitHubRepo(snykProject: SnykProject): SnykGitHubRepo | undefined;
|
|
3
|
-
export declare function getGitHubRepoId(repo: SnykGitHubRepo | undefined): string | undefined;
|
|
1
|
+
import { SnykGitHubRepo, SnykProject } from "./types";
|
|
2
|
+
export declare function getGitHubRepo(snykProject: SnykProject): SnykGitHubRepo | undefined;
|
|
3
|
+
export declare function getGitHubRepoId(repo: SnykGitHubRepo | undefined): string | undefined;
|
package/lib/snyk/util.test.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { createSonarCloudService, SonarCloudService } from "./service";
|
|
2
|
-
export { SonarCloudTokenProvider, SonarCloudTokenCliProvider } from "./token";
|
|
1
|
+
export { createSonarCloudService, SonarCloudService } from "./service";
|
|
2
|
+
export { SonarCloudTokenProvider, SonarCloudTokenCliProvider } from "./token";
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { Config } from "../config";
|
|
2
|
-
import { SonarCloudTokenProvider } from "./token";
|
|
3
|
-
interface SonarCloudServiceProps {
|
|
4
|
-
config: Config;
|
|
5
|
-
tokenProvider: SonarCloudTokenProvider;
|
|
6
|
-
}
|
|
7
|
-
export declare class SonarCloudService {
|
|
8
|
-
private config;
|
|
9
|
-
private tokenProvider;
|
|
10
|
-
constructor(props: SonarCloudServiceProps);
|
|
11
|
-
/**
|
|
12
|
-
* Returns metrics for project with given key.
|
|
13
|
-
* ONLY test coverage metrics are returned as of now
|
|
14
|
-
*/
|
|
15
|
-
getMetricsByProjectKey(sonarCloudProjectKey: string): Promise<{
|
|
16
|
-
component: {
|
|
17
|
-
id: string;
|
|
18
|
-
key: string;
|
|
19
|
-
name: string;
|
|
20
|
-
qualifier: string;
|
|
21
|
-
measures: {
|
|
22
|
-
metric: string;
|
|
23
|
-
value: string;
|
|
24
|
-
}[];
|
|
25
|
-
};
|
|
26
|
-
} | undefined>;
|
|
27
|
-
}
|
|
28
|
-
interface CreateSonarCloudServiceProps {
|
|
29
|
-
config: Config;
|
|
30
|
-
tokenProvider?: SonarCloudTokenProvider;
|
|
31
|
-
}
|
|
32
|
-
export declare function createSonarCloudService(props: CreateSonarCloudServiceProps): SonarCloudService;
|
|
33
|
-
export {};
|
|
1
|
+
import { Config } from "../config";
|
|
2
|
+
import { SonarCloudTokenProvider } from "./token";
|
|
3
|
+
interface SonarCloudServiceProps {
|
|
4
|
+
config: Config;
|
|
5
|
+
tokenProvider: SonarCloudTokenProvider;
|
|
6
|
+
}
|
|
7
|
+
export declare class SonarCloudService {
|
|
8
|
+
private config;
|
|
9
|
+
private tokenProvider;
|
|
10
|
+
constructor(props: SonarCloudServiceProps);
|
|
11
|
+
/**
|
|
12
|
+
* Returns metrics for project with given key.
|
|
13
|
+
* ONLY test coverage metrics are returned as of now
|
|
14
|
+
*/
|
|
15
|
+
getMetricsByProjectKey(sonarCloudProjectKey: string): Promise<{
|
|
16
|
+
component: {
|
|
17
|
+
id: string;
|
|
18
|
+
key: string;
|
|
19
|
+
name: string;
|
|
20
|
+
qualifier: string;
|
|
21
|
+
measures: {
|
|
22
|
+
metric: string;
|
|
23
|
+
value: string;
|
|
24
|
+
}[];
|
|
25
|
+
};
|
|
26
|
+
} | undefined>;
|
|
27
|
+
}
|
|
28
|
+
interface CreateSonarCloudServiceProps {
|
|
29
|
+
config: Config;
|
|
30
|
+
tokenProvider?: SonarCloudTokenProvider;
|
|
31
|
+
}
|
|
32
|
+
export declare function createSonarCloudService(props: CreateSonarCloudServiceProps): SonarCloudService;
|
|
33
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export interface SonarCloudTokenProvider {
|
|
2
|
-
getToken(): Promise<string | undefined>;
|
|
3
|
-
markInvalid(): Promise<void>;
|
|
4
|
-
}
|
|
5
|
-
export declare class SonarCloudTokenCliProvider implements SonarCloudTokenProvider {
|
|
6
|
-
getToken(): Promise<string | undefined>;
|
|
7
|
-
markInvalid(): Promise<void>;
|
|
8
|
-
}
|
|
1
|
+
export interface SonarCloudTokenProvider {
|
|
2
|
+
getToken(): Promise<string | undefined>;
|
|
3
|
+
markInvalid(): Promise<void>;
|
|
4
|
+
}
|
|
5
|
+
export declare class SonarCloudTokenCliProvider implements SonarCloudTokenProvider {
|
|
6
|
+
getToken(): Promise<string | undefined>;
|
|
7
|
+
markInvalid(): Promise<void>;
|
|
8
|
+
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
export declare class TestExecutor {
|
|
2
|
-
private shutdown;
|
|
3
|
-
private cleanupTask;
|
|
4
|
-
private usingWithCleanupTasks;
|
|
5
|
-
private readonly tasks;
|
|
6
|
-
/**
|
|
7
|
-
* Check if we are currently in shutdown state due to user
|
|
8
|
-
* asking to abort (Ctrl+C).
|
|
9
|
-
*/
|
|
10
|
-
checkCanContinue(): void;
|
|
11
|
-
runTasks(): Promise<void>;
|
|
12
|
-
/**
|
|
13
|
-
* Register a task that will be run during cleanup phase.
|
|
14
|
-
*/
|
|
15
|
-
registerCleanupTask(task: () => Promise<void>): void;
|
|
16
|
-
/**
|
|
17
|
-
* Run the code block while ensuring we can run cleanup tasks
|
|
18
|
-
* after the execution or if the process is interrupted.
|
|
19
|
-
*
|
|
20
|
-
* The main method of the program should be executed by using
|
|
21
|
-
* this method.
|
|
22
|
-
*/
|
|
23
|
-
runWithCleanupTasks(body: (executor: TestExecutor) => Promise<void>): Promise<void>;
|
|
24
|
-
}
|
|
25
|
-
export declare function createTestExecutor(): TestExecutor;
|
|
1
|
+
export declare class TestExecutor {
|
|
2
|
+
private shutdown;
|
|
3
|
+
private cleanupTask;
|
|
4
|
+
private usingWithCleanupTasks;
|
|
5
|
+
private readonly tasks;
|
|
6
|
+
/**
|
|
7
|
+
* Check if we are currently in shutdown state due to user
|
|
8
|
+
* asking to abort (Ctrl+C).
|
|
9
|
+
*/
|
|
10
|
+
checkCanContinue(): void;
|
|
11
|
+
runTasks(): Promise<void>;
|
|
12
|
+
/**
|
|
13
|
+
* Register a task that will be run during cleanup phase.
|
|
14
|
+
*/
|
|
15
|
+
registerCleanupTask(task: () => Promise<void>): void;
|
|
16
|
+
/**
|
|
17
|
+
* Run the code block while ensuring we can run cleanup tasks
|
|
18
|
+
* after the execution or if the process is interrupted.
|
|
19
|
+
*
|
|
20
|
+
* The main method of the program should be executed by using
|
|
21
|
+
* this method.
|
|
22
|
+
*/
|
|
23
|
+
runWithCleanupTasks(body: (executor: TestExecutor) => Promise<void>): Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
export declare function createTestExecutor(): TestExecutor;
|
package/lib/testing/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { createTestExecutor, TestExecutor } from "./executor";
|
|
2
|
-
export { createNetwork, curl, getDockerHostAddress, pollForCondition, runNpmRunScript, startContainer, waitForEnterToContinue, waitForHttpOk, waitForPostgresAvailable, } from "./lib";
|
|
1
|
+
export { createTestExecutor, TestExecutor } from "./executor";
|
|
2
|
+
export { createNetwork, curl, getDockerHostAddress, pollForCondition, runNpmRunScript, startContainer, waitForEnterToContinue, waitForHttpOk, waitForPostgresAvailable, } from "./lib";
|
package/lib/testing/lib.d.ts
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import execa from "execa";
|
|
3
|
-
import { TestExecutor } from "./executor";
|
|
4
|
-
export interface Container {
|
|
5
|
-
id: string;
|
|
6
|
-
name: string;
|
|
7
|
-
network: Network;
|
|
8
|
-
process: execa.ExecaChildProcess;
|
|
9
|
-
executor: TestExecutor;
|
|
10
|
-
}
|
|
11
|
-
export interface Network {
|
|
12
|
-
id: string;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Create a new Docker network.
|
|
16
|
-
*/
|
|
17
|
-
export declare function createNetwork(executor: TestExecutor): Promise<Network>;
|
|
18
|
-
/**
|
|
19
|
-
* Execute curl within the Docker network.
|
|
20
|
-
*/
|
|
21
|
-
export declare function curl(executor: TestExecutor, network: Network, ...args: string[]): Promise<string>;
|
|
22
|
-
/**
|
|
23
|
-
* Repeatedly check for a condition until timeout.
|
|
24
|
-
*
|
|
25
|
-
* The condition can throw an error without aborting the loop.
|
|
26
|
-
* To abort the condition must return false.
|
|
27
|
-
*/
|
|
28
|
-
export declare function pollForCondition({ container, attempts, waitIntervalSec, condition, }: {
|
|
29
|
-
container: Container;
|
|
30
|
-
attempts: number;
|
|
31
|
-
waitIntervalSec: number;
|
|
32
|
-
condition: () => Promise<boolean>;
|
|
33
|
-
}): Promise<void>;
|
|
34
|
-
export declare function waitForHttpOk({ container, url, attempts, waitIntervalSec, }: {
|
|
35
|
-
container: Container;
|
|
36
|
-
url: string;
|
|
37
|
-
attempts?: number;
|
|
38
|
-
waitIntervalSec?: number;
|
|
39
|
-
}): Promise<void>;
|
|
40
|
-
export declare function waitForPostgresAvailable({ container, attempts, waitIntervalSec, username, password, dbname, }: {
|
|
41
|
-
container: Container;
|
|
42
|
-
attempts?: number;
|
|
43
|
-
waitIntervalSec?: number;
|
|
44
|
-
username?: string;
|
|
45
|
-
password?: string;
|
|
46
|
-
dbname: string;
|
|
47
|
-
}): Promise<void>;
|
|
48
|
-
export declare function startContainer({ executor, network, imageId, alias, env, dockerArgs, pull, }: {
|
|
49
|
-
executor: TestExecutor;
|
|
50
|
-
network: Network;
|
|
51
|
-
imageId: string;
|
|
52
|
-
alias?: string;
|
|
53
|
-
env?: Record<string, string>;
|
|
54
|
-
dockerArgs?: string[];
|
|
55
|
-
pull?: boolean;
|
|
56
|
-
}): Promise<Container>;
|
|
57
|
-
export declare function runNpmRunScript(name: string, options?: {
|
|
58
|
-
env: NodeJS.ProcessEnv;
|
|
59
|
-
}): Promise<void>;
|
|
60
|
-
/**
|
|
61
|
-
* This likely does not cover all situations.
|
|
62
|
-
*/
|
|
63
|
-
export declare function getDockerHostAddress(): Promise<string>;
|
|
64
|
-
export declare function waitForEnterToContinue(prompt?: string): Promise<void>;
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import execa from "execa";
|
|
3
|
+
import { TestExecutor } from "./executor";
|
|
4
|
+
export interface Container {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
network: Network;
|
|
8
|
+
process: execa.ExecaChildProcess;
|
|
9
|
+
executor: TestExecutor;
|
|
10
|
+
}
|
|
11
|
+
export interface Network {
|
|
12
|
+
id: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Create a new Docker network.
|
|
16
|
+
*/
|
|
17
|
+
export declare function createNetwork(executor: TestExecutor): Promise<Network>;
|
|
18
|
+
/**
|
|
19
|
+
* Execute curl within the Docker network.
|
|
20
|
+
*/
|
|
21
|
+
export declare function curl(executor: TestExecutor, network: Network, ...args: string[]): Promise<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Repeatedly check for a condition until timeout.
|
|
24
|
+
*
|
|
25
|
+
* The condition can throw an error without aborting the loop.
|
|
26
|
+
* To abort the condition must return false.
|
|
27
|
+
*/
|
|
28
|
+
export declare function pollForCondition({ container, attempts, waitIntervalSec, condition, }: {
|
|
29
|
+
container: Container;
|
|
30
|
+
attempts: number;
|
|
31
|
+
waitIntervalSec: number;
|
|
32
|
+
condition: () => Promise<boolean>;
|
|
33
|
+
}): Promise<void>;
|
|
34
|
+
export declare function waitForHttpOk({ container, url, attempts, waitIntervalSec, }: {
|
|
35
|
+
container: Container;
|
|
36
|
+
url: string;
|
|
37
|
+
attempts?: number;
|
|
38
|
+
waitIntervalSec?: number;
|
|
39
|
+
}): Promise<void>;
|
|
40
|
+
export declare function waitForPostgresAvailable({ container, attempts, waitIntervalSec, username, password, dbname, }: {
|
|
41
|
+
container: Container;
|
|
42
|
+
attempts?: number;
|
|
43
|
+
waitIntervalSec?: number;
|
|
44
|
+
username?: string;
|
|
45
|
+
password?: string;
|
|
46
|
+
dbname: string;
|
|
47
|
+
}): Promise<void>;
|
|
48
|
+
export declare function startContainer({ executor, network, imageId, alias, env, dockerArgs, pull, }: {
|
|
49
|
+
executor: TestExecutor;
|
|
50
|
+
network: Network;
|
|
51
|
+
imageId: string;
|
|
52
|
+
alias?: string;
|
|
53
|
+
env?: Record<string, string>;
|
|
54
|
+
dockerArgs?: string[];
|
|
55
|
+
pull?: boolean;
|
|
56
|
+
}): Promise<Container>;
|
|
57
|
+
export declare function runNpmRunScript(name: string, options?: {
|
|
58
|
+
env: NodeJS.ProcessEnv;
|
|
59
|
+
}): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* This likely does not cover all situations.
|
|
62
|
+
*/
|
|
63
|
+
export declare function getDockerHostAddress(): Promise<string>;
|
|
64
|
+
export declare function waitForEnterToContinue(prompt?: string): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capraconsulting/cals-cli",
|
|
3
|
-
"version": "2.25.
|
|
3
|
+
"version": "2.25.24",
|
|
4
4
|
"description": "CLI for repeatable tasks in CALS",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"prepare": "node scripts/create-definition-schema.js && husky install",
|
|
@@ -58,22 +58,22 @@
|
|
|
58
58
|
"@types/semver": "7.5.0",
|
|
59
59
|
"@types/sprintf-js": "1.1.2",
|
|
60
60
|
"@types/yargs": "17.0.24",
|
|
61
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
62
|
-
"@typescript-eslint/parser": "5.
|
|
61
|
+
"@typescript-eslint/eslint-plugin": "5.62.0",
|
|
62
|
+
"@typescript-eslint/parser": "5.62.0",
|
|
63
63
|
"dateformat": "4.6.3",
|
|
64
64
|
"del": "6.1.1",
|
|
65
65
|
"eslint": "8.44.0",
|
|
66
66
|
"eslint-config-prettier": "8.8.0",
|
|
67
67
|
"eslint-plugin-prettier": "4.2.1",
|
|
68
68
|
"husky": "8.0.3",
|
|
69
|
-
"jest": "
|
|
69
|
+
"jest": "^29.6.1",
|
|
70
70
|
"prettier": "2.8.8",
|
|
71
71
|
"rollup": "2.79.1",
|
|
72
72
|
"rollup-plugin-typescript2": "0.35.0",
|
|
73
|
-
"semantic-release": "
|
|
73
|
+
"semantic-release": "21.0.7",
|
|
74
74
|
"tempy": "1.0.1",
|
|
75
|
-
"ts-jest": "
|
|
76
|
-
"typescript": "
|
|
75
|
+
"ts-jest": "^29.1.1",
|
|
76
|
+
"typescript": "5.1.6",
|
|
77
77
|
"typescript-json-schema": "0.56.0"
|
|
78
78
|
},
|
|
79
79
|
"files": [
|