@qawolf/ci-sdk 3.7.0 → 3.8.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.
Files changed (29) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +89 -7
  3. package/dist/index.js +629 -83
  4. package/dist/index.js.map +4 -4
  5. package/dist/lib/sdk/defaults/contracts.d.ts +24 -0
  6. package/dist/lib/sdk/domain/collectCommitChanges/commitChange.d.ts +22 -0
  7. package/dist/lib/sdk/domain/collectCommitChanges/fitChanges.d.ts +17 -0
  8. package/dist/lib/sdk/domain/collectCommitChanges/parseLog.d.ts +7 -5
  9. package/dist/lib/sdk/domain/collectCommitChanges/readCommitRange.d.ts +32 -0
  10. package/dist/lib/sdk/domain/collectCommitChanges/summarizeCommits.d.ts +3 -6
  11. package/dist/lib/sdk/domain/collectDeployChanges/explainCollection.d.ts +8 -0
  12. package/dist/lib/sdk/domain/collectDeployChanges/filterChanges.d.ts +21 -0
  13. package/dist/lib/sdk/domain/collectDeployChanges/index.d.ts +18 -0
  14. package/dist/lib/sdk/domain/collectDeployChanges/isGitHubRepository.d.ts +8 -0
  15. package/dist/lib/sdk/domain/collectDeployChanges/sendableChanges.d.ts +8 -0
  16. package/dist/lib/sdk/domain/collectDeployChanges/testHarness.d.ts +46 -0
  17. package/dist/lib/sdk/domain/collectDeployChanges/types.d.ts +60 -0
  18. package/dist/lib/sdk/domain/detectProviderDeploymentId/ciSystems.d.ts +16 -0
  19. package/dist/lib/sdk/domain/detectProviderDeploymentId/index.d.ts +3 -4
  20. package/dist/lib/sdk/domain/repositoryCoverage/contracts.d.ts +10 -0
  21. package/dist/lib/sdk/domain/repositoryCoverage/findRepositoryCoverage.d.ts +17 -0
  22. package/dist/lib/sdk/domain/repositoryCoverage/identifyRepository.d.ts +44 -0
  23. package/dist/lib/sdk/domain/repositoryCoverage/index.d.ts +15 -0
  24. package/dist/lib/sdk/domain/repositoryCoverage/testHarness.d.ts +46 -0
  25. package/dist/lib/sdk/domain/repositoryCoverage/types.d.ts +73 -0
  26. package/dist/lib/sdk/domain/uploadBuild/types.d.ts +2 -2
  27. package/dist/lib/sdk/index.d.ts +35 -5
  28. package/dist/tests/test-lib.d.ts +27 -5
  29. package/package.json +8 -7
@@ -12,23 +12,51 @@ export declare function makeQaWolfSdk({ apiKey, serviceBase, userAgent, }: {
12
12
  * triggers do not see. Use `deployment.reportStatus` instead.
13
13
  */
14
14
  attemptNotifyDeploy: (config: Partial<import("./domain/attemptDeploy/deployConfig.js").DeployConfig>) => Promise<import("./domain/attemptDeploy/types.js").NotifyDeployStatus>;
15
+ codeHostIntegration: {
16
+ /** Works out this job's repository and asks QA Wolf what it can read there. */
17
+ findForRepository: (args_0?: import("./domain/repositoryCoverage/types.js").FindRepositoryCoverageParams | undefined) => Promise<import("./domain/repositoryCoverage/types.js").FindRepositoryCoverageResult>;
18
+ };
15
19
  deployment: {
16
20
  /** Builds `changes` for `reportStatus` from the local git history; sends nothing itself. */
17
21
  collectCommitChanges: (args_0: import("./domain/collectCommitChanges/types.js").CollectCommitChangesParams) => Promise<import("./domain/collectCommitChanges/types.js").CollectCommitChangesResult>;
22
+ /**
23
+ * Builds `changes` for `reportStatus` from the deploy's commits, including
24
+ * ones QA Wolf can't read of the repository, with ids, your filter and
25
+ * redaction applied; sends nothing itself.
26
+ */
27
+ collectDeployChanges: (params: import("./domain/collectDeployChanges/types.js").CollectDeployChangesParams) => Promise<import("./domain/collectDeployChanges/types.js").CollectDeployChangesResult>;
18
28
  reportStatus: (params: {
19
29
  providerDeploymentId: string;
20
- status: "success" | "pending" | "failure" | "inactive";
30
+ status: "success" | "failure" | "inactive" | "pending";
21
31
  workspaceId: string;
22
32
  builds?: string[] | undefined;
23
33
  changes?: {
24
- items?: {
25
- kind: "pull-request" | "commit";
34
+ ci?: string | undefined;
35
+ items?: ({
36
+ title: string;
37
+ kind: "pull-request";
38
+ changedPaths?: string[] | undefined;
39
+ description?: string | undefined;
40
+ url?: string | undefined;
41
+ mergeCommitSha?: string | undefined;
42
+ number?: number | undefined;
43
+ } | {
26
44
  title: string;
45
+ kind: "commit";
27
46
  changedPaths?: string[] | undefined;
28
47
  description?: string | undefined;
29
48
  url?: string | undefined;
30
- }[] | undefined;
49
+ pullRequestNumber?: number | undefined;
50
+ sha?: string | undefined;
51
+ })[] | undefined;
31
52
  omittedCount?: number | undefined;
53
+ problems?: ({
54
+ kind: "filter-failed";
55
+ } | {
56
+ kind: "history-unavailable";
57
+ } | {
58
+ kind: "since-not-found";
59
+ })[] | undefined;
32
60
  releaseNotes?: string | undefined;
33
61
  } | undefined;
34
62
  deployTarget?: string | undefined;
@@ -83,7 +111,7 @@ export declare function makeQaWolfSdk({ apiKey, serviceBase, userAgent, }: {
83
111
  } | {
84
112
  deploymentId: string;
85
113
  outcome: "not-tested";
86
- reason: "no-trigger-matched" | "no-run-created";
114
+ reason: "no-run-created" | "no-trigger-matched";
87
115
  triggers: {
88
116
  message: string;
89
117
  triggerName: string;
@@ -247,11 +275,13 @@ export declare function makeQaWolfSdk({ apiKey, serviceBase, userAgent, }: {
247
275
  };
248
276
  export type * from "./domain/attemptDeploy/index.js";
249
277
  export type * from "./domain/collectCommitChanges/types.js";
278
+ export type * from "./domain/collectDeployChanges/types.js";
250
279
  export type * from "./domain/environment/types.js";
251
280
  export type * from "./domain/generateSignedUrls/types.js";
252
281
  export type * from "./domain/notifyTerminatedEphemeralEnvironment/types.js";
253
282
  export type * from "./domain/pollCiGreenlight/types.js";
254
283
  export type * from "./domain/promotion/types.js";
255
284
  export type * from "./domain/reportDeployment/types.js";
285
+ export type * from "./domain/repositoryCoverage/types.js";
256
286
  export type * from "./domain/uploadBuild/types.js";
257
287
  export type * from "./domain/waitForVerdict/types.js";
@@ -8,22 +8,44 @@ export declare function makeQaWolfSdkForTest({ apiKey }: {
8
8
  log: LogDriver;
9
9
  sdk: {
10
10
  attemptNotifyDeploy: (config: Partial<import("../index.js").DeployConfig>) => Promise<import("../index.js").NotifyDeployStatus>;
11
+ codeHostIntegration: {
12
+ findForRepository: (args_0?: import("../lib/sdk/index.js").FindRepositoryCoverageParams | undefined) => Promise<import("../lib/sdk/index.js").FindRepositoryCoverageResult>;
13
+ };
11
14
  deployment: {
12
15
  collectCommitChanges: (args_0: import("../lib/sdk/index.js").CollectCommitChangesParams) => Promise<import("../lib/sdk/index.js").CollectCommitChangesResult>;
16
+ collectDeployChanges: (params: import("../lib/sdk/index.js").CollectDeployChangesParams) => Promise<import("../lib/sdk/index.js").CollectDeployChangesResult>;
13
17
  reportStatus: (params: {
14
18
  providerDeploymentId: string;
15
- status: "success" | "pending" | "failure" | "inactive";
19
+ status: "success" | "failure" | "inactive" | "pending";
16
20
  workspaceId: string;
17
21
  builds?: string[] | undefined;
18
22
  changes?: {
19
- items?: {
20
- kind: "pull-request" | "commit";
23
+ ci?: string | undefined;
24
+ items?: ({
25
+ title: string;
26
+ kind: "pull-request";
27
+ changedPaths?: string[] | undefined;
28
+ description?: string | undefined;
29
+ url?: string | undefined;
30
+ mergeCommitSha?: string | undefined;
31
+ number?: number | undefined;
32
+ } | {
21
33
  title: string;
34
+ kind: "commit";
22
35
  changedPaths?: string[] | undefined;
23
36
  description?: string | undefined;
24
37
  url?: string | undefined;
25
- }[] | undefined;
38
+ pullRequestNumber?: number | undefined;
39
+ sha?: string | undefined;
40
+ })[] | undefined;
26
41
  omittedCount?: number | undefined;
42
+ problems?: ({
43
+ kind: "filter-failed";
44
+ } | {
45
+ kind: "history-unavailable";
46
+ } | {
47
+ kind: "since-not-found";
48
+ })[] | undefined;
27
49
  releaseNotes?: string | undefined;
28
50
  } | undefined;
29
51
  deployTarget?: string | undefined;
@@ -78,7 +100,7 @@ export declare function makeQaWolfSdkForTest({ apiKey }: {
78
100
  } | {
79
101
  deploymentId: string;
80
102
  outcome: "not-tested";
81
- reason: "no-trigger-matched" | "no-run-created";
103
+ reason: "no-run-created" | "no-trigger-matched";
82
104
  triggers: {
83
105
  message: string;
84
106
  triggerName: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qawolf/ci-sdk",
3
- "version": "3.7.0",
3
+ "version": "3.8.0",
4
4
  "private": false,
5
5
  "description": "A simple SDK for interacting with QAWolf in CI scripts.",
6
6
  "keywords": [],
@@ -13,6 +13,7 @@
13
13
  },
14
14
  "files": [
15
15
  "/dist",
16
+ "/LICENSE",
16
17
  "/README.md"
17
18
  ],
18
19
  "type": "module",
@@ -25,16 +26,16 @@
25
26
  },
26
27
  "scripts": {
27
28
  "build": "platform-builder --config platformBuilder.config.ts",
28
- "lint:ci": "npm run lint:first-half; FIRST_HALF_EXIT=$?; npm run lint:second-half && exit $FIRST_HALF_EXIT",
29
- "lint:dev": "npm run lint:first-half",
30
- "lint:first-half": "oxlint . --fix --quiet --report-unused-disable-directives --type-aware && oxfmt --write .",
29
+ "lint:ci": "pnpm run lint:first-half; FIRST_HALF_EXIT=$?; pnpm run lint:second-half && exit $FIRST_HALF_EXIT",
30
+ "lint:dev": "pnpm run lint:first-half",
31
+ "lint:first-half": "oxfmt --write . && { oxlint . --fix --quiet --report-unused-disable-directives --type-aware || { oxfmt --write . && oxlint . --fix --quiet --report-unused-disable-directives --type-aware; }; } && oxfmt --write .",
31
32
  "lint:second-half": "rev-dep config run",
32
33
  "prepublishOnly": "nx run ci-sdk:build",
33
34
  "test": "NODE_OPTIONS=\"--experimental-vm-modules\" NODE_NO_WARNINGS=1 jest",
34
- "tsc:check": "tsc --noEmit"
35
+ "tsc:check": "tsrs --noEmit"
35
36
  },
36
37
  "dependencies": {
37
- "@qawolf/api-contracts": ">=0.108.0",
38
+ "@qawolf/api-contracts": ">=0.148.0",
38
39
  "@qawolf/ci-utils": "^2.0.0",
39
40
  "@sinonjs/fake-timers": "^10.3.0",
40
41
  "superjson": "^2.2.6",
@@ -44,7 +45,7 @@
44
45
  "devDependencies": {
45
46
  "@qawolf/platform-builder": "^1.2.7",
46
47
  "tsx": "^4.19.4",
47
- "typescript": "^5.9.3"
48
+ "typescript": "^6.0.3"
48
49
  },
49
50
  "engines": {
50
51
  "node": ">=24.14.1 <25"