@qawolf/ci-sdk 2.2.0 → 2.5.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 +13 -0
- package/dist/index.cjs +389 -196
- package/dist/index.cjs.map +7 -1
- package/dist/index.d.ts +4 -557
- package/dist/index.js +364 -194
- package/dist/index.js.map +7 -1
- package/dist/lib/api/ci-greenlight-bug-data.d.ts +67 -0
- package/dist/lib/api/ci-greenlight.d.ts +76 -0
- package/dist/lib/api/generate-signed-url-for-run-inputs-executables.d.ts +4 -0
- package/dist/lib/api/generate-signed-url-for-team-storage.d.ts +4 -0
- package/dist/lib/api/index.d.ts +2 -0
- package/dist/lib/api/log.d.ts +6 -0
- package/dist/lib/api/signed-url.d.ts +11 -0
- package/dist/lib/api-types.d.ts +5 -0
- package/dist/lib/other.d.ts +5 -0
- package/dist/lib/sdk/defaults/fetch.d.ts +1 -0
- package/dist/lib/sdk/defaults/log.d.ts +2 -0
- package/dist/lib/sdk/defaults/serviceBase.d.ts +1 -0
- package/dist/lib/sdk/defaults/userAgent.d.ts +1 -0
- package/dist/lib/sdk/dependencies.d.ts +7 -0
- package/dist/lib/sdk/domain/attemptDeploy/deployConfig.d.ts +37 -0
- package/dist/lib/sdk/domain/attemptDeploy/deploySuccessWireResponse.d.ts +39 -0
- package/dist/lib/sdk/domain/attemptDeploy/handleSuccessResponse.d.ts +3 -0
- package/dist/lib/sdk/domain/attemptDeploy/index.d.ts +4 -0
- package/dist/lib/sdk/domain/attemptDeploy/mapDeploySuccessResponse.d.ts +3 -0
- package/dist/lib/sdk/domain/attemptDeploy/parseDeploySuccessWireResponse.d.ts +2 -0
- package/dist/lib/sdk/domain/attemptDeploy/types.d.ts +129 -0
- package/dist/lib/sdk/domain/generateSignedUrls/generate-signed-url-for-run-inputs-executables.d.ts +4 -0
- package/dist/lib/sdk/domain/generateSignedUrls/generate-signed-url-for-team-storage.d.ts +16 -0
- package/dist/lib/sdk/domain/generateSignedUrls/types.d.ts +28 -0
- package/dist/lib/sdk/domain/notifyTerminatedEphemeralEnvironment/index.d.ts +4 -0
- package/dist/lib/sdk/domain/notifyTerminatedEphemeralEnvironment/types.d.ts +48 -0
- package/dist/lib/sdk/domain/pollCiGreenlight/buildCompletedRunResult.d.ts +8 -0
- package/dist/lib/sdk/domain/pollCiGreenlight/consts.d.ts +7 -0
- package/dist/lib/sdk/domain/pollCiGreenlight/index.d.ts +4 -0
- package/dist/lib/sdk/domain/pollCiGreenlight/iterator.d.ts +43 -0
- package/dist/lib/sdk/domain/pollCiGreenlight/logging.d.ts +25 -0
- package/dist/lib/sdk/domain/pollCiGreenlight/mapIteratorAbortToGreenlightStatus.d.ts +7 -0
- package/dist/lib/sdk/domain/pollCiGreenlight/types.d.ts +145 -0
- package/dist/lib/sdk/index.d.ts +26 -0
- package/package.json +8 -7
- package/dist/index.d.cts +0 -557
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qawolf/ci-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A simple SDK for interacting with QAWolf in CI scripts.",
|
|
6
6
|
"keywords": [],
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
|
-
"build": "
|
|
25
|
-
"lint:ci": "npm run lint:
|
|
26
|
-
"lint:dev": "npm run lint:
|
|
27
|
-
"lint:
|
|
28
|
-
"lint:
|
|
24
|
+
"build": "platform-builder --config platformBuilder.config.ts --config platformBuilder.cjs.config.ts",
|
|
25
|
+
"lint:ci": "npm run lint:first-half; FIRST_HALF_EXIT=$?; npm run lint:second-half && exit $FIRST_HALF_EXIT",
|
|
26
|
+
"lint:dev": "npm run lint:first-half",
|
|
27
|
+
"lint:first-half": "eslint . --fix --quiet && oxfmt --write .",
|
|
28
|
+
"lint:second-half": "dpdm --exit-code circular:1 --no-tree --no-warning --transform --include='.*' --exclude='/(dist|node_modules)/' '**/*'",
|
|
29
29
|
"prepublishOnly": "nx run ci-sdk:build",
|
|
30
30
|
"test": "NODE_OPTIONS=\"--experimental-vm-modules\" NODE_NO_WARNINGS=1 jest",
|
|
31
31
|
"tsc:check": "tsc --noEmit"
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
"tslib": "^2.6.2"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"
|
|
39
|
+
"@qawolf/platform-builder": "^1.2.2",
|
|
40
|
+
"tsx": "^4.19.4",
|
|
40
41
|
"typescript": "^5.9.3"
|
|
41
42
|
},
|
|
42
43
|
"engines": {
|
package/dist/index.d.cts
DELETED
|
@@ -1,557 +0,0 @@
|
|
|
1
|
-
import { LogDriver } from '@qawolf/ci-utils';
|
|
2
|
-
export { LogDriver } from '@qawolf/ci-utils';
|
|
3
|
-
|
|
4
|
-
type ApiConfig = {
|
|
5
|
-
apiKey: string;
|
|
6
|
-
serviceBase: string;
|
|
7
|
-
userAgent: string;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
type FetchDriver = typeof fetch;
|
|
11
|
-
type SdkDependencies = {
|
|
12
|
-
fetch: FetchDriver;
|
|
13
|
-
log: LogDriver;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
type CiGreenlightBugDetails = {
|
|
17
|
-
/**
|
|
18
|
-
* The URL of this BR in the QAWolf application.
|
|
19
|
-
*/
|
|
20
|
-
applicationUrl: string;
|
|
21
|
-
/**
|
|
22
|
-
* If this bug report is linked to an external issue, it will
|
|
23
|
-
* show up here.
|
|
24
|
-
*/
|
|
25
|
-
externalIssue: {
|
|
26
|
-
/**
|
|
27
|
-
* The URL of the external issue in the external platform
|
|
28
|
-
* application.
|
|
29
|
-
*/
|
|
30
|
-
applicationUrl: string;
|
|
31
|
-
/**
|
|
32
|
-
* The ID of this issue in the external platform.
|
|
33
|
-
*/
|
|
34
|
-
externalIssueId: string;
|
|
35
|
-
/**
|
|
36
|
-
* Lowercase platform name (e.g. "jira").
|
|
37
|
-
*/
|
|
38
|
-
platform: string;
|
|
39
|
-
} | undefined;
|
|
40
|
-
/**
|
|
41
|
-
* True if the bug is blocking.
|
|
42
|
-
*/
|
|
43
|
-
isBlocking: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* True if the bug has been found in this run.
|
|
46
|
-
*/
|
|
47
|
-
isNew: boolean;
|
|
48
|
-
/**
|
|
49
|
-
* The name of this bug.
|
|
50
|
-
*/
|
|
51
|
-
name: string;
|
|
52
|
-
/**
|
|
53
|
-
* The bug number.
|
|
54
|
-
*/
|
|
55
|
-
number: number;
|
|
56
|
-
/**
|
|
57
|
-
* The priority of this bug.
|
|
58
|
-
*/
|
|
59
|
-
priority: "medium" | "unprioritized" | "low" | "high" | "urgent";
|
|
60
|
-
};
|
|
61
|
-
type CiGreenlightBugData = {
|
|
62
|
-
/**
|
|
63
|
-
* The count of blocking bugs reproduced in the run.
|
|
64
|
-
*/
|
|
65
|
-
blockingBugsCount: number;
|
|
66
|
-
/**
|
|
67
|
-
* The count of non-blocking bugs reproduced in the run.
|
|
68
|
-
*/
|
|
69
|
-
nonBlockingBugsCount: number;
|
|
70
|
-
/**
|
|
71
|
-
* Blocking bugs that were not reproduced in this run, but are still
|
|
72
|
-
* opened in the run environment. This may happen when the run only covers a
|
|
73
|
-
* subset of the workflows in environment.
|
|
74
|
-
*/
|
|
75
|
-
otherBlockingBugsInEnvironment: CiGreenlightBugDetails[];
|
|
76
|
-
/**
|
|
77
|
-
* Bugs that were reproduced in this run. This includes newly found bugs.
|
|
78
|
-
* Filter by `isBlocking` and read `applicationUrl` for blocking /
|
|
79
|
-
* non-blocking bug URLs.
|
|
80
|
-
*/
|
|
81
|
-
reproducedBugs: CiGreenlightBugDetails[];
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
type CiGreenlightStatusBase = {
|
|
85
|
-
relevantRunId: string;
|
|
86
|
-
relevantRunUrl: string;
|
|
87
|
-
rootRunId: string;
|
|
88
|
-
rootRunUrl: string;
|
|
89
|
-
};
|
|
90
|
-
type CiGreenlightStatusExtended = {
|
|
91
|
-
relevantRunWithBugsUrl: string;
|
|
92
|
-
workflowsDisabledAfterRunCount: number;
|
|
93
|
-
workflowsInRunCount: number;
|
|
94
|
-
workflowsUnderInvestigationCount: number;
|
|
95
|
-
};
|
|
96
|
-
/**
|
|
97
|
-
* The status of a CI greenlight run. See the API documentation here for
|
|
98
|
-
* more details: https://qawolf.notion.site/1b170576efea411fa785842a71e7c99e
|
|
99
|
-
*/
|
|
100
|
-
type CiGreenlightStatus = CiGreenlightStatusBase & (({
|
|
101
|
-
greenlight: boolean;
|
|
102
|
-
runStage: "completed";
|
|
103
|
-
} & CiGreenlightBugData & CiGreenlightStatusExtended) | ({
|
|
104
|
-
greenlight: false;
|
|
105
|
-
runStage: "underReview";
|
|
106
|
-
} & CiGreenlightBugData & CiGreenlightStatusExtended) | ({
|
|
107
|
-
greenlight: false;
|
|
108
|
-
runStage: "initializing";
|
|
109
|
-
} & Partial<CiGreenlightStatusExtended>) | ({
|
|
110
|
-
greenlight: false;
|
|
111
|
-
/**
|
|
112
|
-
* Human-readable copy explaining why the run was canceled, when the
|
|
113
|
-
* server provides it.
|
|
114
|
-
*/
|
|
115
|
-
message?: string;
|
|
116
|
-
/**
|
|
117
|
-
* Stable, machine-readable code for why the run was canceled, when the
|
|
118
|
-
* server provides it. Treat as an open set of values.
|
|
119
|
-
*/
|
|
120
|
-
reason?: string;
|
|
121
|
-
runStage: "canceled";
|
|
122
|
-
} & Partial<CiGreenlightStatusExtended>));
|
|
123
|
-
|
|
124
|
-
type GenerateSignedUrlStatus = {
|
|
125
|
-
fileLocation?: string;
|
|
126
|
-
playgroundFileLocation?: string;
|
|
127
|
-
success: true;
|
|
128
|
-
uploadUrl?: string;
|
|
129
|
-
} | {
|
|
130
|
-
abortReason: GenerateSignedUrlAbortReason$1;
|
|
131
|
-
httpStatus?: number;
|
|
132
|
-
success: false;
|
|
133
|
-
};
|
|
134
|
-
type GenerateSignedUrlAbortReason$1 = "client-network-error" | "sdk-argument-validation-failed" | "400-invalid-request" | "401-invalid-credentials" | "403-forbidden" | "5XX-server-error" | "XXX-other-http-code";
|
|
135
|
-
type GenerateSignedUrlConfig = {
|
|
136
|
-
destinationFilePath: string;
|
|
137
|
-
/**
|
|
138
|
-
* The workspace to generate the URL for. Required when authenticating with an
|
|
139
|
-
* organization API key, which is not tied to a single workspace. Omit it when
|
|
140
|
-
* authenticating with a workspace API key, which already implies one.
|
|
141
|
-
*/
|
|
142
|
-
workspaceId?: string;
|
|
143
|
-
};
|
|
144
|
-
type GenerateSignedUrlResponse = {
|
|
145
|
-
errorMessage?: string;
|
|
146
|
-
fileLocation?: string;
|
|
147
|
-
httpStatus: number;
|
|
148
|
-
playgroundFileLocation?: string;
|
|
149
|
-
signedUrl?: string;
|
|
150
|
-
success: boolean;
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
type BaseDeployConfig = {
|
|
154
|
-
branch: string | undefined;
|
|
155
|
-
commitUrl: string | undefined;
|
|
156
|
-
deduplicationKey: string | undefined;
|
|
157
|
-
deploymentType: string | undefined;
|
|
158
|
-
deploymentUrl: string | undefined;
|
|
159
|
-
sha: string | undefined;
|
|
160
|
-
variables: Record<string, string> | undefined;
|
|
161
|
-
/**
|
|
162
|
-
* The workspace this deployment belongs to. Required when authenticating with
|
|
163
|
-
* an organization API key, which is not tied to a single workspace. Omit it
|
|
164
|
-
* when authenticating with a workspace API key, which already implies one.
|
|
165
|
-
*/
|
|
166
|
-
workspaceId?: string;
|
|
167
|
-
};
|
|
168
|
-
type GitHubDeployConfig = BaseDeployConfig & {
|
|
169
|
-
hostingService: "GitHub" | undefined;
|
|
170
|
-
pullRequestNumber: number | undefined;
|
|
171
|
-
repository: {
|
|
172
|
-
name: string;
|
|
173
|
-
owner: string;
|
|
174
|
-
} | undefined;
|
|
175
|
-
};
|
|
176
|
-
type GitLabDeployConfig = BaseDeployConfig & {
|
|
177
|
-
hostingService: "GitLab" | undefined;
|
|
178
|
-
mergeRequestNumber: number | undefined;
|
|
179
|
-
repository: {
|
|
180
|
-
name: string;
|
|
181
|
-
namespace: string;
|
|
182
|
-
} | undefined;
|
|
183
|
-
};
|
|
184
|
-
type EphemeralDeployConfig = BaseDeployConfig & {
|
|
185
|
-
deploymentUrl: string;
|
|
186
|
-
ephemeralEnvironment: true;
|
|
187
|
-
};
|
|
188
|
-
type DeployConfig = GitHubDeployConfig | GitLabDeployConfig | EphemeralDeployConfig;
|
|
189
|
-
|
|
190
|
-
type WireSuiteResult = {
|
|
191
|
-
created_suite_id: string;
|
|
192
|
-
trigger_id: string;
|
|
193
|
-
} | {
|
|
194
|
-
failure_reason: string;
|
|
195
|
-
trigger_id: string;
|
|
196
|
-
} | {
|
|
197
|
-
duplicate_suite_id: string;
|
|
198
|
-
skip_reason: string;
|
|
199
|
-
trigger_id: string;
|
|
200
|
-
} | {
|
|
201
|
-
trigger_id: string;
|
|
202
|
-
};
|
|
203
|
-
type DeploySuccessWireResponse = {
|
|
204
|
-
environment: {
|
|
205
|
-
alias?: string;
|
|
206
|
-
id: string;
|
|
207
|
-
isStatic: boolean;
|
|
208
|
-
} | undefined;
|
|
209
|
-
results: WireSuiteResult[];
|
|
210
|
-
skipped_deployment?: {
|
|
211
|
-
message: string;
|
|
212
|
-
reason: string;
|
|
213
|
-
};
|
|
214
|
-
skipped_triggers?: {
|
|
215
|
-
environment_id: string;
|
|
216
|
-
message: string;
|
|
217
|
-
reason: string;
|
|
218
|
-
trigger_id: string;
|
|
219
|
-
}[];
|
|
220
|
-
};
|
|
221
|
-
|
|
222
|
-
type DeploySuccessSuiteCreatedResult = {
|
|
223
|
-
createdSuiteId: string;
|
|
224
|
-
triggerId: string;
|
|
225
|
-
};
|
|
226
|
-
type DeploySuccessSuiteCreationFailureResult = {
|
|
227
|
-
failureReason: string;
|
|
228
|
-
triggerId: string;
|
|
229
|
-
};
|
|
230
|
-
type DeploySuccessSuiteAlreadyExistsResult = {
|
|
231
|
-
duplicateSuiteId: string;
|
|
232
|
-
skipReason: string;
|
|
233
|
-
triggerId: string;
|
|
234
|
-
};
|
|
235
|
-
type DeploySuccessSuiteUnrecognizedResult = {
|
|
236
|
-
triggerId: string;
|
|
237
|
-
unrecognized: true;
|
|
238
|
-
};
|
|
239
|
-
type DeploySuccessSuiteResult = DeploySuccessSuiteCreatedResult | DeploySuccessSuiteCreationFailureResult | DeploySuccessSuiteAlreadyExistsResult | DeploySuccessSuiteUnrecognizedResult;
|
|
240
|
-
type DeploySuccessSkippedTrigger = {
|
|
241
|
-
environmentId: string;
|
|
242
|
-
message: string;
|
|
243
|
-
reason: string;
|
|
244
|
-
triggerId: string;
|
|
245
|
-
};
|
|
246
|
-
type DeploySuccessDeploymentSkipped = {
|
|
247
|
-
message: string;
|
|
248
|
-
reason: string;
|
|
249
|
-
};
|
|
250
|
-
type DeployStatus = {
|
|
251
|
-
environment: {
|
|
252
|
-
alias?: string;
|
|
253
|
-
id: string;
|
|
254
|
-
isStatic: boolean;
|
|
255
|
-
} | undefined;
|
|
256
|
-
results: Array<DeploySuccessSuiteResult>;
|
|
257
|
-
skippedDeployment?: DeploySuccessDeploymentSkipped;
|
|
258
|
-
skippedTriggers?: DeploySuccessSkippedTrigger[];
|
|
259
|
-
};
|
|
260
|
-
type DeployStatusSuccessResponse = {
|
|
261
|
-
data: DeployStatus;
|
|
262
|
-
ok: true;
|
|
263
|
-
status: number;
|
|
264
|
-
};
|
|
265
|
-
type DeployStatusErrorResponse = {
|
|
266
|
-
data: undefined;
|
|
267
|
-
ok: false;
|
|
268
|
-
status: number | undefined;
|
|
269
|
-
};
|
|
270
|
-
type DeployStatusResponse = DeployStatusSuccessResponse | DeployStatusErrorResponse;
|
|
271
|
-
type AttemptDeployHttpAbortReason = "4XX-client-error" | "401-unauthorized" | "403-forbidden" | "5XX-server-error" | "network-error";
|
|
272
|
-
type AttemptDeployNonHttpAbortReason = "network-error" | "invalid-response-body";
|
|
273
|
-
type AttemptDeployAbortReason = AttemptDeployHttpAbortReason | AttemptDeployNonHttpAbortReason;
|
|
274
|
-
type NotifyDeployStatus = {
|
|
275
|
-
/**
|
|
276
|
-
* Environment ID associated with the deployment.
|
|
277
|
-
*/
|
|
278
|
-
environmentId: string;
|
|
279
|
-
/**
|
|
280
|
-
* Deployment notification successful.
|
|
281
|
-
*/
|
|
282
|
-
outcome: "success";
|
|
283
|
-
/**
|
|
284
|
-
* Run ID might be undefined if the deployment is a preview deployment.
|
|
285
|
-
*/
|
|
286
|
-
runId: string | undefined;
|
|
287
|
-
} | {
|
|
288
|
-
/**
|
|
289
|
-
* One or more triggers matched the deployment but could not run (e.g. the
|
|
290
|
-
* environment was still syncing). A precondition was not met, so this is a
|
|
291
|
-
* failure rather than a skip: retrying once the environment is ready may
|
|
292
|
-
* create a run.
|
|
293
|
-
*/
|
|
294
|
-
failReason: "trigger-skipped";
|
|
295
|
-
outcome: "failed";
|
|
296
|
-
skippedTriggers: DeploySuccessSkippedTrigger[];
|
|
297
|
-
} | {
|
|
298
|
-
/**
|
|
299
|
-
* No trigger matched the deployment. This is deterministic given the
|
|
300
|
-
* current configuration (repeating the request with the same config
|
|
301
|
-
* yields the same result), so it is a skip rather than a failure, and the
|
|
302
|
-
* caller should not treat it as an error. `skippedDeployment` carries the
|
|
303
|
-
* server's reason when it provided one (undefined on older servers or the
|
|
304
|
-
* legacy arm); there is no separate SDK-level reason code, since
|
|
305
|
-
* `outcome: "skipped"` only ever means no trigger matched.
|
|
306
|
-
*/
|
|
307
|
-
outcome: "skipped";
|
|
308
|
-
skippedDeployment: DeploySuccessDeploymentSkipped | undefined;
|
|
309
|
-
} | {
|
|
310
|
-
/**
|
|
311
|
-
* `unknown-result` means the response carried a result arm this SDK
|
|
312
|
-
* version does not recognize (the backend is newer). The caller should
|
|
313
|
-
* upgrade the SDK; the outcome could not be classified.
|
|
314
|
-
*/
|
|
315
|
-
failReason: "no-environment" | "run-could-not-be-created" | "unknown-result";
|
|
316
|
-
/**
|
|
317
|
-
* A run could not be created.
|
|
318
|
-
*/
|
|
319
|
-
outcome: "failed";
|
|
320
|
-
} | {
|
|
321
|
-
abortReason: AttemptDeployNonHttpAbortReason;
|
|
322
|
-
httpStatus?: never;
|
|
323
|
-
/**
|
|
324
|
-
* An unrecoverable error occurred.
|
|
325
|
-
*/
|
|
326
|
-
outcome: "aborted";
|
|
327
|
-
} | {
|
|
328
|
-
abortReason: AttemptDeployHttpAbortReason;
|
|
329
|
-
httpStatus: number | undefined;
|
|
330
|
-
/**
|
|
331
|
-
* An unrecoverable HTTP error occurred.
|
|
332
|
-
*/
|
|
333
|
-
outcome: "aborted";
|
|
334
|
-
};
|
|
335
|
-
type AttemptDeployFailedReason = Extract<NotifyDeployStatus, {
|
|
336
|
-
outcome: "failed";
|
|
337
|
-
}>["failReason"];
|
|
338
|
-
|
|
339
|
-
/**
|
|
340
|
-
* The workspace that owns the environment. Required when authenticating with an
|
|
341
|
-
* organization API key, which is not tied to a single workspace. Omit it when
|
|
342
|
-
* authenticating with a workspace API key, which already implies one.
|
|
343
|
-
*
|
|
344
|
-
* Absent from the `environmentId` lookup, where the environment identifies its
|
|
345
|
-
* own workspace.
|
|
346
|
-
*/
|
|
347
|
-
type WorkspaceLookup = {
|
|
348
|
-
workspaceId?: string;
|
|
349
|
-
};
|
|
350
|
-
type NotifyTerminatedEphemeralEnvironmentInput = {
|
|
351
|
-
environmentId: string;
|
|
352
|
-
} | ({
|
|
353
|
-
deploymentUrl: string;
|
|
354
|
-
} & WorkspaceLookup) | ({
|
|
355
|
-
environmentAlias: string;
|
|
356
|
-
} & WorkspaceLookup);
|
|
357
|
-
type NotifyTerminatedEphemeralEnvironmentFailedReason = "environmentNotFound" | "missingLookup" | "alreadyTerminated";
|
|
358
|
-
type NotifyTerminatedEphemeralEnvironmentHttpAbortReason = "4XX-client-error" | "401-unauthorized" | "403-forbidden" | "409-conflict" | "5XX-server-error" | "network-error";
|
|
359
|
-
type NotifyTerminatedEphemeralEnvironmentNonHttpAbortReason = "network-error";
|
|
360
|
-
type NotifyTerminatedEphemeralEnvironmentAbortReason = NotifyTerminatedEphemeralEnvironmentHttpAbortReason | NotifyTerminatedEphemeralEnvironmentNonHttpAbortReason;
|
|
361
|
-
type TerminatedEphemeralEnvironmentSuccessResult = {
|
|
362
|
-
environmentId: string;
|
|
363
|
-
};
|
|
364
|
-
type NotifyTerminatedEphemeralEnvironmentResult = {
|
|
365
|
-
environmentId: string;
|
|
366
|
-
/**
|
|
367
|
-
* Environment termination successful.
|
|
368
|
-
*/
|
|
369
|
-
outcome: "success";
|
|
370
|
-
} | {
|
|
371
|
-
abortReason: NotifyTerminatedEphemeralEnvironmentAbortReason;
|
|
372
|
-
httpStatus?: never;
|
|
373
|
-
/**
|
|
374
|
-
* An unrecoverable error occurred.
|
|
375
|
-
*/
|
|
376
|
-
outcome: "aborted";
|
|
377
|
-
} | {
|
|
378
|
-
abortReason: NotifyTerminatedEphemeralEnvironmentHttpAbortReason;
|
|
379
|
-
httpStatus: number | undefined;
|
|
380
|
-
/**
|
|
381
|
-
* An unrecoverable HTTP error occurred.
|
|
382
|
-
*/
|
|
383
|
-
outcome: "aborted";
|
|
384
|
-
};
|
|
385
|
-
|
|
386
|
-
type PollCiGreenlightPollConfig = {
|
|
387
|
-
/**
|
|
388
|
-
* If true, the job will be aborted when a superseding run is detected.
|
|
389
|
-
*
|
|
390
|
-
* @default false
|
|
391
|
-
*/
|
|
392
|
-
abortOnSuperseded: boolean;
|
|
393
|
-
/**
|
|
394
|
-
* Maximum number of network operations retries before aborting the job.
|
|
395
|
-
*
|
|
396
|
-
* @default 10
|
|
397
|
-
*/
|
|
398
|
-
maxRetries: number;
|
|
399
|
-
/**
|
|
400
|
-
* Timeout in milliseconds before aborting this polling operation.
|
|
401
|
-
*
|
|
402
|
-
* @default 120 minutes
|
|
403
|
-
*/
|
|
404
|
-
pollTimeout: number;
|
|
405
|
-
/**
|
|
406
|
-
* Interval in milliseconds between network operations retries.
|
|
407
|
-
*
|
|
408
|
-
* @default 10 seconds
|
|
409
|
-
*/
|
|
410
|
-
retryInterval: number;
|
|
411
|
-
/**
|
|
412
|
-
* Interval in milliseconds between polling for a run in progress.
|
|
413
|
-
*
|
|
414
|
-
* @default 30 seconds
|
|
415
|
-
*/
|
|
416
|
-
runInProgressInterval: number;
|
|
417
|
-
/**
|
|
418
|
-
* Interval in milliseconds between polling for a run under review.
|
|
419
|
-
*
|
|
420
|
-
* @default 60 minutes
|
|
421
|
-
*/
|
|
422
|
-
runUnderReviewInterval: number;
|
|
423
|
-
};
|
|
424
|
-
type PollCiGreenlightHttpAbortReason = "4XX-client-error" | "404-run-not-found" | "5XX-server-error" | "XXX-other-http-code";
|
|
425
|
-
type PollCiGreenlightNonHttpAbortReason = "poll-timed-out" | "run-canceled" | "network-error" | "superseded-run";
|
|
426
|
-
type PollCiGreenlightAbortReason = PollCiGreenlightNonHttpAbortReason | PollCiGreenlightHttpAbortReason;
|
|
427
|
-
type PollCiGreenlightStatus = {
|
|
428
|
-
greenlightStatus: Extract<CiGreenlightStatus, {
|
|
429
|
-
runStage: "completed";
|
|
430
|
-
}>;
|
|
431
|
-
/**
|
|
432
|
-
* No blocking bugs were found in the run.
|
|
433
|
-
*/
|
|
434
|
-
outcome: "success";
|
|
435
|
-
} | {
|
|
436
|
-
greenlightStatus: Extract<CiGreenlightStatus, {
|
|
437
|
-
runStage: "completed";
|
|
438
|
-
}>;
|
|
439
|
-
/**
|
|
440
|
-
* Blocking bugs were found in the run.
|
|
441
|
-
*/
|
|
442
|
-
outcome: "failed";
|
|
443
|
-
} | {
|
|
444
|
-
abortReason: PollCiGreenlightHttpAbortReason;
|
|
445
|
-
httpStatus: number;
|
|
446
|
-
/**
|
|
447
|
-
* The run was aborted due to an unrecoverable error.
|
|
448
|
-
*/
|
|
449
|
-
outcome: "aborted";
|
|
450
|
-
} | {
|
|
451
|
-
abortReason: PollCiGreenlightNonHttpAbortReason;
|
|
452
|
-
httpStatus: undefined;
|
|
453
|
-
/**
|
|
454
|
-
* The run was aborted due to an unrecoverable error.
|
|
455
|
-
*/
|
|
456
|
-
outcome: "aborted";
|
|
457
|
-
};
|
|
458
|
-
type PollCiGreenlightParams = {
|
|
459
|
-
/**
|
|
460
|
-
* Callback to be called when the lifecycle stage of the run changes.
|
|
461
|
-
*/
|
|
462
|
-
onRunStageChanged?: (current: CiGreenlightStatus, previous: CiGreenlightStatus | undefined) => unknown | Promise<unknown>;
|
|
463
|
-
runId: string;
|
|
464
|
-
} & Partial<PollCiGreenlightPollConfig>;
|
|
465
|
-
/**
|
|
466
|
-
* Successful status iteration containing greenlight status and metadata
|
|
467
|
-
*/
|
|
468
|
-
type PollCiGreenlightStatusIteration = {
|
|
469
|
-
/**
|
|
470
|
-
* Milliseconds elapsed since polling started
|
|
471
|
-
*/
|
|
472
|
-
elapsedMs: number;
|
|
473
|
-
/**
|
|
474
|
-
* False when this is a successful status iteration
|
|
475
|
-
*/
|
|
476
|
-
isAborted: false;
|
|
477
|
-
/**
|
|
478
|
-
* Whether the run reached a terminal stage without greenlight.
|
|
479
|
-
* True when the run completed without greenlight or was canceled.
|
|
480
|
-
* You should exit with an error code when this is true.
|
|
481
|
-
*/
|
|
482
|
-
isFailedTerminalStage: boolean;
|
|
483
|
-
/**
|
|
484
|
-
* The previous status, if any
|
|
485
|
-
*/
|
|
486
|
-
previousStatus: CiGreenlightStatus | undefined;
|
|
487
|
-
/**
|
|
488
|
-
* Whether the run stage changed from the previous iteration
|
|
489
|
-
*/
|
|
490
|
-
stageChanged: boolean;
|
|
491
|
-
/**
|
|
492
|
-
* The current greenlight status from the API
|
|
493
|
-
*/
|
|
494
|
-
status: CiGreenlightStatus;
|
|
495
|
-
};
|
|
496
|
-
/**
|
|
497
|
-
* Iterator aborted due to unrecoverable HTTP client error (4XX)
|
|
498
|
-
*/
|
|
499
|
-
type PollCiGreenlightIteratorHttpAborted = {
|
|
500
|
-
abortReason: PollCiGreenlightHttpAbortReason;
|
|
501
|
-
elapsedMs: number;
|
|
502
|
-
httpStatus: number;
|
|
503
|
-
/**
|
|
504
|
-
* True when the iterator was aborted
|
|
505
|
-
*/
|
|
506
|
-
isAborted: true;
|
|
507
|
-
};
|
|
508
|
-
/**
|
|
509
|
-
* Iterator aborted due to non-HTTP reasons (timeout, canceled, network, superseded)
|
|
510
|
-
*/
|
|
511
|
-
type PollCiGreenlightIteratorNonHttpAborted = {
|
|
512
|
-
abortReason: Exclude<PollCiGreenlightNonHttpAbortReason, "superseded-run">;
|
|
513
|
-
elapsedMs: number;
|
|
514
|
-
httpStatus: undefined;
|
|
515
|
-
/**
|
|
516
|
-
* True when the iterator was aborted
|
|
517
|
-
*/
|
|
518
|
-
isAborted: true;
|
|
519
|
-
};
|
|
520
|
-
/**
|
|
521
|
-
* Yielded value from the async generator - either a status update or a terminal abort condition
|
|
522
|
-
*/
|
|
523
|
-
type PollCiGreenlightIteration = PollCiGreenlightStatusIteration | PollCiGreenlightIteratorHttpAborted | PollCiGreenlightIteratorNonHttpAborted;
|
|
524
|
-
/**
|
|
525
|
-
* Parameters for the async generator
|
|
526
|
-
*/
|
|
527
|
-
type MakePollCiGreenlightStatusIteratorParams = {
|
|
528
|
-
runId: string;
|
|
529
|
-
} & Partial<PollCiGreenlightPollConfig>;
|
|
530
|
-
|
|
531
|
-
type GenerateSignedUrlAbortReason = "client-network-error" | "sdk-argument-validation-failed" | "400-invalid-request" | "401-invalid-credentials" | "403-forbidden" | "5XX-server-error" | "XXX-other-http-code";
|
|
532
|
-
|
|
533
|
-
declare function attemptNotifyDeploy(deps: SdkDependencies, apiConfig: ApiConfig, config: Partial<DeployConfig>): Promise<NotifyDeployStatus>;
|
|
534
|
-
|
|
535
|
-
declare function makeQaWolfSdk({ apiKey, serviceBase, userAgent, }: {
|
|
536
|
-
apiKey: string;
|
|
537
|
-
serviceBase?: string;
|
|
538
|
-
userAgent?: string;
|
|
539
|
-
}, { fetch, log, }?: Partial<SdkDependencies>): {
|
|
540
|
-
attemptNotifyDeploy: (config: Partial<DeployConfig>) => Promise<NotifyDeployStatus>;
|
|
541
|
-
generateSignedUrlForRunInputsExecutablesStorage: (config: GenerateSignedUrlConfig) => Promise<GenerateSignedUrlStatus>;
|
|
542
|
-
generateSignedUrlForTempTeamStorage: (config: GenerateSignedUrlConfig) => Promise<{
|
|
543
|
-
fileLocation?: string;
|
|
544
|
-
playgroundFileLocation?: string;
|
|
545
|
-
success: true;
|
|
546
|
-
uploadUrl?: string;
|
|
547
|
-
} | {
|
|
548
|
-
abortReason: GenerateSignedUrlAbortReason;
|
|
549
|
-
httpStatus?: number;
|
|
550
|
-
success: false;
|
|
551
|
-
}>;
|
|
552
|
-
makePollCiGreenlightStatusIterator: (args_0: MakePollCiGreenlightStatusIteratorParams) => AsyncGenerator<PollCiGreenlightIteration, void, unknown>;
|
|
553
|
-
notifyTerminatedEphemeralEnvironment: (config: NotifyTerminatedEphemeralEnvironmentInput) => Promise<NotifyTerminatedEphemeralEnvironmentResult>;
|
|
554
|
-
pollCiGreenlightStatus: (args_0: PollCiGreenlightParams) => Promise<PollCiGreenlightStatus>;
|
|
555
|
-
};
|
|
556
|
-
|
|
557
|
-
export { type AttemptDeployAbortReason, type AttemptDeployFailedReason, type AttemptDeployHttpAbortReason, type AttemptDeployNonHttpAbortReason, type CiGreenlightStatus, type CiGreenlightStatusBase, type DeployConfig, type DeployStatus, type DeployStatusErrorResponse, type DeployStatusResponse, type DeployStatusSuccessResponse, type DeploySuccessDeploymentSkipped, type DeploySuccessSkippedTrigger, type DeploySuccessSuiteAlreadyExistsResult, type DeploySuccessSuiteCreatedResult, type DeploySuccessSuiteCreationFailureResult, type DeploySuccessSuiteResult, type DeploySuccessSuiteUnrecognizedResult, type DeploySuccessWireResponse, type EphemeralDeployConfig, type FetchDriver, type GenerateSignedUrlAbortReason$1 as GenerateSignedUrlAbortReason, type GenerateSignedUrlConfig, type GenerateSignedUrlResponse, type GenerateSignedUrlStatus, type GitHubDeployConfig, type GitLabDeployConfig, type MakePollCiGreenlightStatusIteratorParams, type NotifyDeployStatus, type NotifyTerminatedEphemeralEnvironmentAbortReason, type NotifyTerminatedEphemeralEnvironmentFailedReason, type NotifyTerminatedEphemeralEnvironmentHttpAbortReason, type NotifyTerminatedEphemeralEnvironmentInput, type NotifyTerminatedEphemeralEnvironmentNonHttpAbortReason, type NotifyTerminatedEphemeralEnvironmentResult, type PollCiGreenlightAbortReason, type PollCiGreenlightHttpAbortReason, type PollCiGreenlightIteration, type PollCiGreenlightIteratorHttpAborted, type PollCiGreenlightIteratorNonHttpAborted, type PollCiGreenlightNonHttpAbortReason, type PollCiGreenlightParams, type PollCiGreenlightPollConfig, type PollCiGreenlightStatus, type PollCiGreenlightStatusIteration, type SdkDependencies, type TerminatedEphemeralEnvironmentSuccessResult, attemptNotifyDeploy, makeQaWolfSdk };
|