@capraconsulting/cals-cli 3.13.1 → 3.14.0
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/cals-cli.mjs +588 -2450
- package/lib/cals-cli.mjs.map +1 -1
- package/lib/cli/reporter.d.ts +5 -6
- package/lib/cli/util.d.ts +1 -6
- package/lib/config.d.ts +0 -2
- package/lib/definition/index.d.ts +1 -1
- package/lib/definition/types.d.ts +0 -52
- package/lib/github/index.d.ts +0 -2
- package/lib/github/service.d.ts +2 -67
- package/lib/github/types.d.ts +0 -63
- package/lib/github/util.d.ts +0 -1
- package/lib/index.d.ts +0 -9
- package/lib/index.es.js +8 -1323
- package/lib/index.es.js.map +1 -1
- package/lib/index.js +8 -1323
- package/lib/index.js.map +1 -1
- package/package.json +7 -19
- package/lib/cli/commands/definition/dump-setup.d.ts +0 -3
- package/lib/cli/commands/definition/util.d.ts +0 -6
- package/lib/cli/commands/definition/util.test.d.ts +0 -1
- package/lib/cli/commands/definition/validate.d.ts +0 -3
- package/lib/cli/commands/definition.d.ts +0 -3
- package/lib/cli/commands/delete-cache.d.ts +0 -3
- package/lib/cli/commands/getting-started.d.ts +0 -3
- package/lib/cli/commands/github/analyze-directory.d.ts +0 -3
- package/lib/cli/commands/github/configure.d.ts +0 -3
- package/lib/cli/commands/github/list-pull-requests-stats.d.ts +0 -3
- package/lib/cli/commands/github/list-webhooks.d.ts +0 -3
- package/lib/cli/commands/github/util.d.ts +0 -3
- package/lib/cli/commands/snyk/report.d.ts +0 -3
- package/lib/cli/commands/snyk/set-token.d.ts +0 -3
- package/lib/cli/commands/snyk/sync.d.ts +0 -3
- package/lib/cli/commands/snyk.d.ts +0 -3
- package/lib/github/changeset/changeset.d.ts +0 -21
- package/lib/github/changeset/execute.d.ts +0 -10
- package/lib/github/changeset/types.d.ts +0 -88
- package/lib/snyk/index.d.ts +0 -3
- package/lib/snyk/service.d.ts +0 -30
- package/lib/snyk/token.d.ts +0 -11
- package/lib/snyk/types.d.ts +0 -62
- package/lib/snyk/util.d.ts +0 -3
- package/lib/snyk/util.test.d.ts +0 -1
- package/lib/testing/executor.d.ts +0 -25
- package/lib/testing/index.d.ts +0 -2
- package/lib/testing/lib.d.ts +0 -63
package/lib/cals-cli.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cals-cli.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cals-cli.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/lib/cli/reporter.d.ts
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import chalk from "chalk";
|
|
2
|
+
export declare function readInput(options: {
|
|
3
|
+
prompt: string;
|
|
4
|
+
silent?: boolean;
|
|
5
|
+
timeout?: number;
|
|
6
|
+
}): Promise<string>;
|
|
2
7
|
export declare class Reporter {
|
|
3
|
-
constructor(opts?: {
|
|
4
|
-
nonInteractive?: boolean;
|
|
5
|
-
verbose?: boolean;
|
|
6
|
-
});
|
|
7
8
|
stdout: NodeJS.WriteStream & {
|
|
8
9
|
fd: 1;
|
|
9
10
|
};
|
|
10
11
|
stderr: NodeJS.WriteStream & {
|
|
11
12
|
fd: 2;
|
|
12
13
|
};
|
|
13
|
-
nonInteractive: boolean;
|
|
14
|
-
isVerbose: boolean;
|
|
15
14
|
format: typeof chalk;
|
|
16
15
|
error(msg: string): void;
|
|
17
16
|
log(msg: string): void;
|
package/lib/cli/util.d.ts
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import type { Arguments, Options } from "yargs";
|
|
2
1
|
import { CacheProvider } from "../cache";
|
|
3
2
|
import { Config } from "../config";
|
|
4
|
-
import { DefinitionFile } from "../definition";
|
|
5
3
|
import { Reporter } from "./reporter";
|
|
6
|
-
export declare function createReporter(
|
|
4
|
+
export declare function createReporter(): Reporter;
|
|
7
5
|
export declare function createCacheProvider(config: Config, argv: Record<string, unknown>): CacheProvider;
|
|
8
6
|
export declare function createConfig(): Config;
|
|
9
|
-
export declare const definitionFileOptionName = "definition-file";
|
|
10
|
-
export declare const definitionFileOptionValue: Options;
|
|
11
|
-
export declare function getDefinitionFile(argv: Arguments): DefinitionFile;
|
package/lib/config.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { DefinitionFile, getGitHubOrgs, getRepoId, getRepos, parseDefinition, } from "./definition";
|
|
2
|
-
export type { Definition, DefinitionRepo, GetReposResponse, Project,
|
|
2
|
+
export type { Definition, DefinitionRepo, GetReposResponse, Project, } from "./types";
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
import type { Permission } from "../github/types";
|
|
2
1
|
export interface Definition {
|
|
3
|
-
snyk?: {
|
|
4
|
-
accountId: string;
|
|
5
|
-
};
|
|
6
|
-
github: {
|
|
7
|
-
users: User[];
|
|
8
|
-
teams: {
|
|
9
|
-
organization: string;
|
|
10
|
-
teams: Team[];
|
|
11
|
-
}[];
|
|
12
|
-
};
|
|
13
2
|
projects: Project[];
|
|
14
3
|
}
|
|
15
4
|
export interface Project {
|
|
@@ -17,59 +6,18 @@ export interface Project {
|
|
|
17
6
|
github: {
|
|
18
7
|
organization: string;
|
|
19
8
|
repos?: DefinitionRepo[];
|
|
20
|
-
teams?: RepoTeam[];
|
|
21
9
|
}[];
|
|
22
10
|
tags?: string[];
|
|
23
|
-
/**
|
|
24
|
-
* Some external-defined entity being responsible for the project.
|
|
25
|
-
*/
|
|
26
|
-
responsible?: string;
|
|
27
|
-
}
|
|
28
|
-
export type User = UserBot | UserEmployee | UserExternal;
|
|
29
|
-
export interface UserBot {
|
|
30
|
-
type: "bot";
|
|
31
|
-
login: string;
|
|
32
|
-
name: string;
|
|
33
|
-
}
|
|
34
|
-
export interface UserEmployee {
|
|
35
|
-
type: "employee";
|
|
36
|
-
login: string;
|
|
37
|
-
capraUsername: string;
|
|
38
|
-
name: string;
|
|
39
|
-
}
|
|
40
|
-
export interface UserExternal {
|
|
41
|
-
type: "external";
|
|
42
|
-
login: string;
|
|
43
|
-
name: string;
|
|
44
11
|
}
|
|
45
12
|
export interface DefinitionRepo {
|
|
46
13
|
name: string;
|
|
47
14
|
previousNames?: DefinitionRepoPreviousName[];
|
|
48
15
|
archived?: boolean;
|
|
49
|
-
issues?: boolean;
|
|
50
|
-
wiki?: boolean;
|
|
51
|
-
teams?: RepoTeam[];
|
|
52
|
-
snyk?: boolean;
|
|
53
|
-
public?: boolean;
|
|
54
|
-
/**
|
|
55
|
-
* Some external-defined entity being responsible for the repository.
|
|
56
|
-
*
|
|
57
|
-
* Will override the project-defined responsible.
|
|
58
|
-
*/
|
|
59
|
-
responsible?: string;
|
|
60
16
|
}
|
|
61
17
|
export interface DefinitionRepoPreviousName {
|
|
62
18
|
name: string;
|
|
63
19
|
project: string;
|
|
64
20
|
}
|
|
65
|
-
export interface RepoTeam {
|
|
66
|
-
name: string;
|
|
67
|
-
permission: Permission;
|
|
68
|
-
}
|
|
69
|
-
export interface Team {
|
|
70
|
-
name: string;
|
|
71
|
-
members: string[];
|
|
72
|
-
}
|
|
73
21
|
export interface GetReposResponse {
|
|
74
22
|
id: string;
|
|
75
23
|
orgName: string;
|
package/lib/github/index.d.ts
CHANGED
package/lib/github/service.d.ts
CHANGED
|
@@ -1,89 +1,24 @@
|
|
|
1
1
|
import { Octokit } from "@octokit/rest";
|
|
2
2
|
import type { CacheProvider } from "../cache";
|
|
3
|
-
import type { Config } from "../config";
|
|
4
3
|
import { type GitHubTokenProvider } from "./token";
|
|
5
|
-
import type {
|
|
6
|
-
interface SearchedPullRequestListQueryResult {
|
|
7
|
-
search: {
|
|
8
|
-
pageInfo: {
|
|
9
|
-
hasNextPage: boolean;
|
|
10
|
-
endCursor: string | null;
|
|
11
|
-
};
|
|
12
|
-
edges: {
|
|
13
|
-
node: {
|
|
14
|
-
__typename: string;
|
|
15
|
-
number: number;
|
|
16
|
-
baseRepository: {
|
|
17
|
-
name: string;
|
|
18
|
-
owner: {
|
|
19
|
-
login: string;
|
|
20
|
-
};
|
|
21
|
-
defaultBranchRef: {
|
|
22
|
-
name: string;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
author: {
|
|
26
|
-
login: string;
|
|
27
|
-
};
|
|
28
|
-
title: string;
|
|
29
|
-
commits: {
|
|
30
|
-
nodes: {
|
|
31
|
-
commit: {
|
|
32
|
-
messageHeadline: string;
|
|
33
|
-
};
|
|
34
|
-
}[];
|
|
35
|
-
};
|
|
36
|
-
createdAt: string;
|
|
37
|
-
updatedAt: string;
|
|
38
|
-
};
|
|
39
|
-
}[];
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
export type SearchedPullRequestListItem = SearchedPullRequestListQueryResult["search"]["edges"][0]["node"];
|
|
4
|
+
import type { Repo } from "./types";
|
|
43
5
|
interface GitHubServiceProps {
|
|
44
|
-
config: Config;
|
|
45
6
|
octokit: Octokit;
|
|
46
7
|
cache: CacheProvider;
|
|
47
8
|
tokenProvider: GitHubTokenProvider;
|
|
48
9
|
}
|
|
49
10
|
export declare class GitHubService {
|
|
50
|
-
private config;
|
|
51
11
|
octokit: Octokit;
|
|
52
12
|
private cache;
|
|
53
13
|
private tokenProvider;
|
|
54
14
|
private semaphore;
|
|
55
15
|
constructor(props: GitHubServiceProps);
|
|
56
|
-
private
|
|
57
|
-
get requestCount(): number;
|
|
58
|
-
runGraphqlQuery<T>(query: string): Promise<T>;
|
|
16
|
+
private runGraphqlQuery;
|
|
59
17
|
getOrgRepoList({ org }: {
|
|
60
18
|
org: string;
|
|
61
19
|
}): Promise<Repo[]>;
|
|
62
|
-
getOrgMembersList(org: string): Promise<OrgsListMembersResponseItem[]>;
|
|
63
|
-
getOrgMembersInvitedList(org: string): Promise<OrgsListPendingInvitationsResponseItem[]>;
|
|
64
|
-
getOrgMembersListIncludingInvited(org: string): Promise<OrgMemberOrInvited[]>;
|
|
65
|
-
getRepository(owner: string, repo: string): Promise<ReposGetResponse | undefined>;
|
|
66
|
-
getRepositoryTeamsList(repo: ReposGetResponse): Promise<ReposListTeamsResponseItem[]>;
|
|
67
|
-
getRepositoryHooks(owner: string, repo: string): Promise<ReposListHooksResponseItem[]>;
|
|
68
|
-
getOrg(org: string): Promise<OrgsGetResponse>;
|
|
69
|
-
getTeamList(org: OrgsGetResponse): Promise<TeamsListResponseItem[]>;
|
|
70
|
-
getTeamMemberList(org: OrgsGetResponse, team: TeamsListResponseItem): Promise<TeamsListMembersResponseItem[]>;
|
|
71
|
-
getTeamMemberInvitedList(org: OrgsGetResponse, team: TeamsListResponseItem): Promise<TeamsListPendingInvitationsResponseItem[]>;
|
|
72
|
-
getTeamMemberListIncludingInvited(org: OrgsGetResponse, team: TeamsListResponseItem): Promise<TeamMemberOrInvited[]>;
|
|
73
|
-
getSearchedPullRequestList(owner: string): Promise<SearchedPullRequestListItem[]>;
|
|
74
|
-
getHasVulnerabilityAlertsEnabled(owner: string, repo: string): Promise<boolean>;
|
|
75
|
-
enableVulnerabilityAlerts(owner: string, repo: string): Promise<void>;
|
|
76
|
-
/**
|
|
77
|
-
* Get the vulnerability alerts for a repository.
|
|
78
|
-
*/
|
|
79
|
-
getVulnerabilityAlerts(owner: string, repo: string): Promise<VulnerabilityAlert[]>;
|
|
80
|
-
/**
|
|
81
|
-
* Get the Renovate Dependency Dashboard issue.
|
|
82
|
-
*/
|
|
83
|
-
getRenovateDependencyDashboardIssue(owner: string, repo: string): Promise<RenovateDependencyDashboardIssue | undefined>;
|
|
84
20
|
}
|
|
85
21
|
interface CreateGitHubServiceProps {
|
|
86
|
-
config: Config;
|
|
87
22
|
cache: CacheProvider;
|
|
88
23
|
tokenProvider?: GitHubTokenProvider;
|
|
89
24
|
}
|
package/lib/github/types.d.ts
CHANGED
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
import type { Endpoints } from "@octokit/types";
|
|
2
|
-
export type OrgsGetResponse = Endpoints["GET /orgs/{org}"]["response"]["data"];
|
|
3
|
-
export type OrgsListMembersResponseItem = Exclude<Endpoints["GET /orgs/{org}/members"]["response"]["data"][0], null>;
|
|
4
|
-
export type OrgsListPendingInvitationsResponseItem = Endpoints["GET /orgs/{org}/invitations"]["response"]["data"][0];
|
|
5
|
-
export type ReposGetResponse = Endpoints["GET /repos/{owner}/{repo}"]["response"]["data"];
|
|
6
|
-
export type ReposListTeamsResponseItem = Endpoints["GET /repos/{owner}/{repo}/teams"]["response"]["data"][0];
|
|
7
|
-
export type ReposListHooksResponseItem = Endpoints["GET /repos/{owner}/{repo}/hooks"]["response"]["data"][0];
|
|
8
|
-
export type ReposUpdateParams = Endpoints["PATCH /repos/{owner}/{repo}"]["parameters"];
|
|
9
|
-
export type TeamsListMembersResponseItem = Exclude<Endpoints["GET /teams/{team_id}/members"]["response"]["data"][0], null>;
|
|
10
|
-
export type TeamsListPendingInvitationsResponseItem = Endpoints["GET /teams/{team_id}/invitations"]["response"]["data"][0];
|
|
11
|
-
export type TeamsListResponseItem = Endpoints["GET /orgs/{org}/teams"]["response"]["data"][0];
|
|
12
1
|
export interface Repo {
|
|
13
2
|
name: string;
|
|
14
3
|
owner: {
|
|
@@ -31,55 +20,3 @@ export interface Repo {
|
|
|
31
20
|
}[];
|
|
32
21
|
};
|
|
33
22
|
}
|
|
34
|
-
export interface VulnerabilityAlert {
|
|
35
|
-
dismissReason: string | null;
|
|
36
|
-
state: "DISMISSED" | "FIXED" | "OPEN";
|
|
37
|
-
vulnerableManifestFilename: string;
|
|
38
|
-
vulnerableManifestPath: string;
|
|
39
|
-
vulnerableRequirements: string | null;
|
|
40
|
-
securityAdvisory: {
|
|
41
|
-
description: string;
|
|
42
|
-
identifiers: Array<{
|
|
43
|
-
type: string;
|
|
44
|
-
value: string;
|
|
45
|
-
}>;
|
|
46
|
-
references: Array<{
|
|
47
|
-
url: string;
|
|
48
|
-
}>;
|
|
49
|
-
severity: "CRITICAL" | "HIGH" | "LOW" | "MODERATE";
|
|
50
|
-
} | null;
|
|
51
|
-
securityVulnerability: {
|
|
52
|
-
package: {
|
|
53
|
-
name: string;
|
|
54
|
-
ecosystem: "COMPOSER" | "MAVEN" | "NPM" | "NUGET" | "PIP" | "RUBYGEMS";
|
|
55
|
-
};
|
|
56
|
-
firstPatchedVersion: {
|
|
57
|
-
identifier: string;
|
|
58
|
-
};
|
|
59
|
-
vulnerableVersionRange: string;
|
|
60
|
-
} | null;
|
|
61
|
-
}
|
|
62
|
-
export type Permission = "admin" | "push" | "pull";
|
|
63
|
-
export type TeamMemberOrInvited = {
|
|
64
|
-
type: "member";
|
|
65
|
-
login: string;
|
|
66
|
-
data: TeamsListMembersResponseItem;
|
|
67
|
-
} | {
|
|
68
|
-
type: "invited";
|
|
69
|
-
login: string;
|
|
70
|
-
data: TeamsListPendingInvitationsResponseItem;
|
|
71
|
-
};
|
|
72
|
-
export type OrgMemberOrInvited = {
|
|
73
|
-
type: "member";
|
|
74
|
-
login: string;
|
|
75
|
-
data: OrgsListMembersResponseItem;
|
|
76
|
-
} | {
|
|
77
|
-
type: "invited";
|
|
78
|
-
login: string;
|
|
79
|
-
data: OrgsListPendingInvitationsResponseItem;
|
|
80
|
-
};
|
|
81
|
-
export interface RenovateDependencyDashboardIssue {
|
|
82
|
-
number: number;
|
|
83
|
-
body: string;
|
|
84
|
-
lastUpdatedByRenovate: string | null;
|
|
85
|
-
}
|
package/lib/github/util.d.ts
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
import { CacheProvider } from "./cache";
|
|
2
|
-
import { Reporter } from "./cli/reporter";
|
|
3
|
-
import { createReporter } from "./cli/util";
|
|
4
|
-
import { Config } from "./config";
|
|
5
|
-
import { DefinitionFile } from "./definition";
|
|
6
|
-
import { createGitHubService, GitHubService } from "./github";
|
|
7
1
|
export declare const VERSION: string;
|
|
8
2
|
export * as definition from "./definition";
|
|
9
3
|
export * as github from "./github";
|
|
10
|
-
export * as snyk from "./snyk";
|
|
11
|
-
export * from "./testing";
|
|
12
|
-
export { CacheProvider, Config, createGitHubService, createReporter, DefinitionFile, GitHubService, Reporter, };
|