@qawolf/ci-sdk 3.0.0 → 3.1.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/README.md +271 -10
- package/dist/index.d.ts +1 -0
- package/dist/index.js +221 -4
- package/dist/index.js.map +4 -4
- package/dist/lib/sdk/domain/attemptDeploy/index.d.ts +4 -0
- package/dist/lib/sdk/domain/detectProviderDeploymentId/index.d.ts +49 -0
- package/dist/lib/sdk/domain/pollCiGreenlight/index.d.ts +4 -0
- package/dist/lib/sdk/domain/reportDeployment/index.d.ts +4 -0
- package/dist/lib/sdk/domain/reportDeployment/types.d.ts +50 -0
- package/dist/lib/sdk/index.d.ts +35 -0
- package/dist/lib/sdk/publicApi/callContract.d.ts +39 -0
- package/package.json +6 -4
package/dist/lib/sdk/index.d.ts
CHANGED
|
@@ -4,7 +4,37 @@ export declare function makeQaWolfSdk({ apiKey, serviceBase, userAgent, }: {
|
|
|
4
4
|
serviceBase?: string;
|
|
5
5
|
userAgent?: string;
|
|
6
6
|
}, { fetch, log, }?: Partial<SdkDependencies>): {
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Reports through the legacy `deploy_success` webhook, which
|
|
9
|
+
* triggers do not see. Use `deployment.reportStatus` instead.
|
|
10
|
+
*/
|
|
7
11
|
attemptNotifyDeploy: (config: Partial<import("./domain/attemptDeploy/deployConfig.js").DeployConfig>) => Promise<import("./domain/attemptDeploy/types.js").NotifyDeployStatus>;
|
|
12
|
+
deployment: {
|
|
13
|
+
reportStatus: (params: {
|
|
14
|
+
providerDeploymentId: string;
|
|
15
|
+
status: "success" | "pending" | "failure" | "inactive";
|
|
16
|
+
workspaceId: string;
|
|
17
|
+
deployTarget?: string | undefined;
|
|
18
|
+
environment?: {
|
|
19
|
+
id: string;
|
|
20
|
+
} | {
|
|
21
|
+
name: string;
|
|
22
|
+
baseEphemeralEnvironment?: string | undefined;
|
|
23
|
+
ephemeral?: boolean | undefined;
|
|
24
|
+
} | undefined;
|
|
25
|
+
environmentVariables?: Record<string, string> | undefined;
|
|
26
|
+
metadata?: {
|
|
27
|
+
commitAuthorName?: string | undefined;
|
|
28
|
+
commitMessage?: string | undefined;
|
|
29
|
+
commitSha?: string | undefined;
|
|
30
|
+
commitUrl?: string | undefined;
|
|
31
|
+
pullRequestNumber?: number | undefined;
|
|
32
|
+
ref?: string | undefined;
|
|
33
|
+
repository?: string | undefined;
|
|
34
|
+
} | undefined;
|
|
35
|
+
service?: string | undefined;
|
|
36
|
+
}) => Promise<import("./domain/reportDeployment/types.js").ReportDeploymentResult>;
|
|
37
|
+
};
|
|
8
38
|
generateSignedUrlForRunInputsExecutablesStorage: (config: import("./domain/generateSignedUrls/types.js").GenerateSignedUrlConfig) => Promise<import("./domain/generateSignedUrls/types.js").GenerateSignedUrlStatus>;
|
|
9
39
|
generateSignedUrlForTempTeamStorage: (config: import("./domain/generateSignedUrls/types.js").GenerateSignedUrlConfig) => Promise<{
|
|
10
40
|
fileLocation?: string;
|
|
@@ -19,9 +49,14 @@ export declare function makeQaWolfSdk({ apiKey, serviceBase, userAgent, }: {
|
|
|
19
49
|
}>;
|
|
20
50
|
makePollCiGreenlightStatusIterator: (args_0: import("./domain/pollCiGreenlight/types.js").MakePollCiGreenlightStatusIteratorParams) => AsyncGenerator<import("./domain/pollCiGreenlight/types.js").PollCiGreenlightIteration, void, unknown>;
|
|
21
51
|
notifyTerminatedEphemeralEnvironment: (config: import("./domain/notifyTerminatedEphemeralEnvironment/types.js").NotifyTerminatedEphemeralEnvironmentInput) => Promise<import("./domain/notifyTerminatedEphemeralEnvironment/types.js").NotifyTerminatedEphemeralEnvironmentResult>;
|
|
52
|
+
/**
|
|
53
|
+
* @deprecated Polls a run id that only `attemptNotifyDeploy` returns, so it
|
|
54
|
+
* keeps the pipeline on the legacy `deploy_success` webhook.
|
|
55
|
+
*/
|
|
22
56
|
pollCiGreenlightStatus: (args_0: import("./domain/pollCiGreenlight/types.js").PollCiGreenlightParams) => Promise<import("./domain/pollCiGreenlight/types.js").PollCiGreenlightStatus>;
|
|
23
57
|
};
|
|
24
58
|
export type * from "./domain/attemptDeploy/index.js";
|
|
25
59
|
export type * from "./domain/generateSignedUrls/types.js";
|
|
26
60
|
export type * from "./domain/notifyTerminatedEphemeralEnvironment/types.js";
|
|
27
61
|
export type * from "./domain/pollCiGreenlight/types.js";
|
|
62
|
+
export type * from "./domain/reportDeployment/types.js";
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
import type { ApiConfig } from "../../api-types.js";
|
|
3
|
+
import type { SdkDependencies } from "../dependencies.js";
|
|
4
|
+
/**
|
|
5
|
+
* The structural shape of a `@qawolf/api-contracts` contract. Declared here
|
|
6
|
+
* because the package exports the contracts but not the type describing them.
|
|
7
|
+
*/
|
|
8
|
+
export type PublicApiContract<InputData = unknown, OutputData = unknown> = {
|
|
9
|
+
input: z.ZodType<unknown, InputData>;
|
|
10
|
+
name: string;
|
|
11
|
+
output: z.ZodType<OutputData>;
|
|
12
|
+
};
|
|
13
|
+
export type PublicApiCallFailure = {
|
|
14
|
+
/** The QA Wolf incident id to quote to support, when the server sent one. */
|
|
15
|
+
eventId: string | undefined;
|
|
16
|
+
httpStatus: number;
|
|
17
|
+
/** The server's explanation of the refusal, when it sent one. */
|
|
18
|
+
message: string | undefined;
|
|
19
|
+
outcome: "http-error";
|
|
20
|
+
} | {
|
|
21
|
+
outcome: "network-error";
|
|
22
|
+
}
|
|
23
|
+
/** The server answered 2xx with a body the contract's output rejects. */
|
|
24
|
+
| {
|
|
25
|
+
outcome: "invalid-response-body";
|
|
26
|
+
};
|
|
27
|
+
export type PublicApiCallResult<Data> = {
|
|
28
|
+
data: Data;
|
|
29
|
+
outcome: "ok";
|
|
30
|
+
} | PublicApiCallFailure;
|
|
31
|
+
/**
|
|
32
|
+
* Calls one public API contract and validates the answer with that contract's
|
|
33
|
+
* own output schema, so a caller reads the contract's types rather than a
|
|
34
|
+
* hand-written copy of them.
|
|
35
|
+
*/
|
|
36
|
+
export declare function callPublicContract<InputData, OutputData>({ fetch: localFetch, log }: SdkDependencies, apiConfig: ApiConfig, { contract, input, }: {
|
|
37
|
+
contract: PublicApiContract<InputData, OutputData>;
|
|
38
|
+
input: InputData;
|
|
39
|
+
}): Promise<PublicApiCallResult<OutputData>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qawolf/ci-sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A simple SDK for interacting with QAWolf in CI scripts.",
|
|
6
6
|
"keywords": [],
|
|
@@ -23,18 +23,20 @@
|
|
|
23
23
|
"lint:ci": "npm run lint:first-half; FIRST_HALF_EXIT=$?; npm run lint:second-half && exit $FIRST_HALF_EXIT",
|
|
24
24
|
"lint:dev": "npm run lint:first-half",
|
|
25
25
|
"lint:first-half": "oxlint . --fix --quiet --report-unused-disable-directives --type-aware && oxfmt --write .",
|
|
26
|
-
"lint:second-half": "
|
|
26
|
+
"lint:second-half": "rev-dep config run",
|
|
27
27
|
"prepublishOnly": "nx run ci-sdk:build",
|
|
28
28
|
"test": "NODE_OPTIONS=\"--experimental-vm-modules\" NODE_NO_WARNINGS=1 jest",
|
|
29
29
|
"tsc:check": "tsc --noEmit"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
+
"@qawolf/api-contracts": ">=0.68.0",
|
|
32
33
|
"@qawolf/ci-utils": "^2.0.0",
|
|
33
34
|
"@sinonjs/fake-timers": "^10.3.0",
|
|
34
|
-
"tslib": "^2.6.2"
|
|
35
|
+
"tslib": "^2.6.2",
|
|
36
|
+
"zod": "^4.1.11"
|
|
35
37
|
},
|
|
36
38
|
"devDependencies": {
|
|
37
|
-
"@qawolf/platform-builder": "^1.2.
|
|
39
|
+
"@qawolf/platform-builder": "^1.2.7",
|
|
38
40
|
"tsx": "^4.19.4",
|
|
39
41
|
"typescript": "^5.9.3"
|
|
40
42
|
},
|