@datadog/datadog-ci-plugin-synthetics 5.12.0 → 5.13.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/dist/bundle.d.ts +2392 -0
- package/dist/bundle.js +144530 -0
- package/dist/bundle.js.LEGAL.txt +2412 -0
- package/dist/bundle.js.map +1 -0
- package/dist/commands/deploy-tests.js +2 -125
- package/dist/commands/import-tests.js +2 -118
- package/dist/commands/run-tests.js +2 -319
- package/dist/commands/upload-application.js +2 -138
- package/package.json +19 -19
- package/dist/api.d.ts +0 -52
- package/dist/api.js +0 -333
- package/dist/api.js.map +0 -1
- package/dist/batch.d.ts +0 -9
- package/dist/batch.js +0 -325
- package/dist/batch.js.map +0 -1
- package/dist/build-and-test.d.ts +0 -25
- package/dist/build-and-test.js +0 -196
- package/dist/build-and-test.js.map +0 -1
- package/dist/commands/deploy-tests.d.ts +0 -19
- package/dist/commands/deploy-tests.js.map +0 -1
- package/dist/commands/import-tests.d.ts +0 -19
- package/dist/commands/import-tests.js.map +0 -1
- package/dist/commands/run-tests.d.ts +0 -19
- package/dist/commands/run-tests.js.map +0 -1
- package/dist/commands/upload-application.d.ts +0 -18
- package/dist/commands/upload-application.js.map +0 -1
- package/dist/deploy-tests-lib.d.ts +0 -2
- package/dist/deploy-tests-lib.js +0 -96
- package/dist/deploy-tests-lib.js.map +0 -1
- package/dist/errors.d.ts +0 -19
- package/dist/errors.js +0 -31
- package/dist/errors.js.map +0 -1
- package/dist/import-tests-lib.d.ts +0 -2
- package/dist/import-tests-lib.js +0 -71
- package/dist/import-tests-lib.js.map +0 -1
- package/dist/index.d.ts +0 -8
- package/dist/index.js +0 -46
- package/dist/index.js.map +0 -1
- package/dist/interfaces.d.ts +0 -759
- package/dist/interfaces.js +0 -27
- package/dist/interfaces.js.map +0 -1
- package/dist/local-test-definition.d.ts +0 -2
- package/dist/local-test-definition.js +0 -16
- package/dist/local-test-definition.js.map +0 -1
- package/dist/mobile.d.ts +0 -28
- package/dist/mobile.js +0 -275
- package/dist/mobile.js.map +0 -1
- package/dist/multilocator.d.ts +0 -2
- package/dist/multilocator.js +0 -88
- package/dist/multilocator.js.map +0 -1
- package/dist/reporters/constants.d.ts +0 -6
- package/dist/reporters/constants.js +0 -14
- package/dist/reporters/constants.js.map +0 -1
- package/dist/reporters/default.d.ts +0 -33
- package/dist/reporters/default.js +0 -461
- package/dist/reporters/default.js.map +0 -1
- package/dist/reporters/junit.d.ts +0 -100
- package/dist/reporters/junit.js +0 -425
- package/dist/reporters/junit.js.map +0 -1
- package/dist/reporters/mobile/app-upload.d.ts +0 -14
- package/dist/reporters/mobile/app-upload.js +0 -54
- package/dist/reporters/mobile/app-upload.js.map +0 -1
- package/dist/run-tests-lib.d.ts +0 -28
- package/dist/run-tests-lib.js +0 -281
- package/dist/run-tests-lib.js.map +0 -1
- package/dist/test.d.ts +0 -29
- package/dist/test.js +0 -200
- package/dist/test.js.map +0 -1
- package/dist/tunnel/crypto.d.ts +0 -6
- package/dist/tunnel/crypto.js +0 -48
- package/dist/tunnel/crypto.js.map +0 -1
- package/dist/tunnel/index.d.ts +0 -1
- package/dist/tunnel/index.js +0 -6
- package/dist/tunnel/index.js.map +0 -1
- package/dist/tunnel/tunnel.d.ts +0 -49
- package/dist/tunnel/tunnel.js +0 -329
- package/dist/tunnel/tunnel.js.map +0 -1
- package/dist/tunnel/websocket.d.ts +0 -39
- package/dist/tunnel/websocket.js +0 -154
- package/dist/tunnel/websocket.js.map +0 -1
- package/dist/utils/internal.d.ts +0 -58
- package/dist/utils/internal.js +0 -317
- package/dist/utils/internal.js.map +0 -1
- package/dist/utils/public.d.ts +0 -81
- package/dist/utils/public.js +0 -524
- package/dist/utils/public.js.map +0 -1
package/dist/bundle.d.ts
ADDED
|
@@ -0,0 +1,2392 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Readable, Writable } from "stream";
|
|
3
|
+
import { URL, URLSearchParams } from "node:url";
|
|
4
|
+
import { Duplex, Readable as Readable$1, Writable as Writable$1 } from "node:stream";
|
|
5
|
+
import { EventEmitter } from "node:events";
|
|
6
|
+
import { Blob, File } from "node:buffer";
|
|
7
|
+
import { ConnectionOptions, TLSSocket } from "node:tls";
|
|
8
|
+
import { IpcNetConnectOpts, Socket, TcpNetConnectOpts } from "node:net";
|
|
9
|
+
|
|
10
|
+
//#region \0rolldown/runtime.js
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/tunnel/tunnel.d.ts
|
|
13
|
+
interface TunnelInfo {
|
|
14
|
+
host: string;
|
|
15
|
+
id: string;
|
|
16
|
+
privateKey: string;
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/utils/internal.d.ts
|
|
20
|
+
type RecursivePartial<T> = { [P in keyof T]?: RecursivePartial<T[P]> };
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/errors.d.ts
|
|
23
|
+
type NonCriticalCiErrorCode = 'NO_TESTS_TO_RUN' | 'MISSING_TESTS' | 'UNAUTHORIZED_TESTS';
|
|
24
|
+
type CriticalCiErrorCode = 'AUTHORIZATION_ERROR' | 'INVALID_CONFIG' | 'MISSING_API_KEY' | 'MISSING_APP_KEY' | 'POLL_RESULTS_FAILED' | 'BATCH_TIMEOUT_RUNAWAY' | 'TOO_MANY_TESTS_TO_TRIGGER' | 'TRIGGER_TESTS_FAILED' | 'TUNNEL_START_FAILED' | 'TUNNEL_NOT_SUPPORTED' | 'UNAVAILABLE_TEST_CONFIG' | 'UNAVAILABLE_TUNNEL_CONFIG' | 'UPLOAD_MOBILE_APPLICATION_TESTS_FAILED' | 'MISSING_MOBILE_APPLICATION_PATH' | 'MISSING_MOBILE_APPLICATION_ID' | 'MISSING_MOBILE_VERSION_NAME' | 'INVALID_MOBILE_APP' | 'INVALID_MOBILE_APP_UPLOAD_PARAMETERS' | 'MOBILE_APP_UPLOAD_TIMEOUT' | 'UNKNOWN_MOBILE_APP_UPLOAD_FAILURE' | 'LTD_MULTILOCATORS_UPDATE_FAILED';
|
|
25
|
+
type CiErrorCode = NonCriticalCiErrorCode | CriticalCiErrorCode;
|
|
26
|
+
declare class CiError extends Error {
|
|
27
|
+
code: CiErrorCode;
|
|
28
|
+
constructor(code: CiErrorCode, message?: string);
|
|
29
|
+
toJson(): {
|
|
30
|
+
code: CiErrorCode;
|
|
31
|
+
message: string;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
declare class CriticalError extends CiError {
|
|
35
|
+
code: CriticalCiErrorCode;
|
|
36
|
+
constructor(code: CriticalCiErrorCode, message?: string);
|
|
37
|
+
}
|
|
38
|
+
declare namespace public_d_exports {
|
|
39
|
+
export { ExitReason, InitialSummary, PASSED_RESULT_OUTCOMES, PUBLIC_ID_REGEX, ParsedPublicId, ResultOutcome, ciTriggerApp, createInitialSummary, fetchTest, filterTestPlan, getAppBaseURL, getBatchUrl, getDatadogHost, getExecutionRule, getExitReason, getFilePathRelativeToRepo, getOrgSettings, getReporter, getResultOutcome, getResultUrl, getStrictestExecutionRule, getSuites, getTestOverridesCount, isDeviceIdSet, isResultSkippedBySelectiveRerun, isTestSupportedByTunnel, makeTestPayload, normalizePublicId, parsePublicIdWithVersion, pluralize, readableOperation, renderResults, reportCiError, reportExitLogs, retry, setCiTriggerApp, sortResultsByOutcome, toExitCode };
|
|
40
|
+
}
|
|
41
|
+
declare const PUBLIC_ID_REGEX: RegExp;
|
|
42
|
+
declare const readableOperation: { [key in Operator]: string };
|
|
43
|
+
declare let ciTriggerApp: string;
|
|
44
|
+
declare const makeTestPayload: (test: Test, triggerConfig: TriggerConfig, publicId: string) => TestPayload;
|
|
45
|
+
declare const getTestOverridesCount: (testOverrides: UserConfigOverride) => number;
|
|
46
|
+
declare const setCiTriggerApp: (source: string) => void;
|
|
47
|
+
declare const getExecutionRule: (test?: Test, configOverride?: UserConfigOverride) => ExecutionRule;
|
|
48
|
+
declare const getStrictestExecutionRule: (configRule: ExecutionRule, testRule?: ExecutionRule) => ExecutionRule;
|
|
49
|
+
declare const isTestSupportedByTunnel: (test: Test) => boolean | undefined;
|
|
50
|
+
declare const enum ResultOutcome {
|
|
51
|
+
Passed = "passed",
|
|
52
|
+
PreviouslyPassed = "previously-passed",
|
|
53
|
+
PassedNonBlocking = "passed-non-blocking",
|
|
54
|
+
Failed = "failed",
|
|
55
|
+
FailedNonBlocking = "failed-non-blocking"
|
|
56
|
+
}
|
|
57
|
+
declare const PASSED_RESULT_OUTCOMES: ResultOutcome[];
|
|
58
|
+
declare const getResultOutcome: (result: Result) => ResultOutcome;
|
|
59
|
+
declare const getSuites: (pattern: string, reporter: MainReporter) => Promise<Suite[]>;
|
|
60
|
+
declare const getFilePathRelativeToRepo: (filePath: string) => Promise<string>;
|
|
61
|
+
declare const normalizePublicId: (id: string) => string | undefined;
|
|
62
|
+
interface ParsedPublicId {
|
|
63
|
+
publicId: string;
|
|
64
|
+
version?: number;
|
|
65
|
+
}
|
|
66
|
+
declare const parsePublicIdWithVersion: (id: string) => ParsedPublicId | undefined;
|
|
67
|
+
declare const getOrgSettings: (reporter: MainReporter, config: SyntheticsCIConfig) => Promise<SyntheticsOrgSettings | undefined>;
|
|
68
|
+
declare const isResultSkippedBySelectiveRerun: (result: Result) => result is ResultSkippedBySelectiveRerun;
|
|
69
|
+
type InitialSummary = Omit<Summary, 'batchId'>;
|
|
70
|
+
declare const createInitialSummary: () => InitialSummary;
|
|
71
|
+
declare const getReporter: (reporters: Reporter[]) => MainReporter;
|
|
72
|
+
declare const isDeviceIdSet: (result: Result) => result is Required<Result>;
|
|
73
|
+
declare const fetchTest: (publicId: string, config: SyntheticsCIConfig) => Promise<Test>;
|
|
74
|
+
declare const retry: <T, E extends Error>(func: () => Promise<T>, shouldRetryAfterWait: (retries: number, error: E) => number | undefined) => Promise<T>;
|
|
75
|
+
declare const getAppBaseURL: ({
|
|
76
|
+
datadogSite,
|
|
77
|
+
subdomain
|
|
78
|
+
}: {
|
|
79
|
+
datadogSite: string;
|
|
80
|
+
subdomain: string;
|
|
81
|
+
}) => string;
|
|
82
|
+
declare const getBatchUrl: (baseUrl: string, batchId: string) => string;
|
|
83
|
+
declare const getResultUrl: (baseUrl: string, test: Test, resultId: string, batchId: string) => string;
|
|
84
|
+
/**
|
|
85
|
+
* Sort results with the following rules:
|
|
86
|
+
* - Passed results come first
|
|
87
|
+
* - Then non-blocking failed results
|
|
88
|
+
* - And finally failed results
|
|
89
|
+
*/
|
|
90
|
+
declare const sortResultsByOutcome: () => (r1: Result, r2: Result) => number;
|
|
91
|
+
declare const renderResults: ({
|
|
92
|
+
config,
|
|
93
|
+
orgSettings,
|
|
94
|
+
reporter,
|
|
95
|
+
results,
|
|
96
|
+
startTime,
|
|
97
|
+
summary
|
|
98
|
+
}: {
|
|
99
|
+
config: RunTestsCommandConfig;
|
|
100
|
+
orgSettings: SyntheticsOrgSettings | undefined;
|
|
101
|
+
reporter: MainReporter;
|
|
102
|
+
results: Result[];
|
|
103
|
+
startTime: number;
|
|
104
|
+
summary: Summary;
|
|
105
|
+
}) => void;
|
|
106
|
+
declare const reportExitLogs: (reporter: MainReporter, config: Pick<RunTestsCommandConfig, 'failOnTimeout' | 'failOnCriticalErrors'>, {
|
|
107
|
+
results,
|
|
108
|
+
error
|
|
109
|
+
}: {
|
|
110
|
+
results?: Result[] | undefined;
|
|
111
|
+
error?: unknown;
|
|
112
|
+
}) => void;
|
|
113
|
+
declare const getExitReason: (config: Pick<RunTestsCommandConfig, 'failOnCriticalErrors' | 'failOnMissingTests'>, {
|
|
114
|
+
results,
|
|
115
|
+
error
|
|
116
|
+
}: {
|
|
117
|
+
results?: Result[] | undefined;
|
|
118
|
+
error?: unknown;
|
|
119
|
+
}) => "failing-tests" | "missing-tests" | "critical-error" | "passed";
|
|
120
|
+
type ExitReason = ReturnType<typeof getExitReason>;
|
|
121
|
+
declare const toExitCode: (reason: ExitReason) => 1 | 0;
|
|
122
|
+
declare const getDatadogHost: (hostConfig: {
|
|
123
|
+
apiVersion: 'v1' | 'v2' | 'unstable';
|
|
124
|
+
config: APIHelperConfig;
|
|
125
|
+
useIntake: boolean;
|
|
126
|
+
}) => string;
|
|
127
|
+
declare const pluralize: (word: string, count: number) => string;
|
|
128
|
+
declare const reportCiError: (error: CiError, reporter: MainReporter) => void;
|
|
129
|
+
declare const filterTestPlan: (testPlan: TestPlan, initialSummary: InitialSummary, predicate: (item: TestPlanItem) => boolean) => {
|
|
130
|
+
testPlan: TestPlan;
|
|
131
|
+
initialSummary: InitialSummary;
|
|
132
|
+
};
|
|
133
|
+
//#endregion
|
|
134
|
+
//#region ../../node_modules/undici/types/utility.d.ts
|
|
135
|
+
type AutocompletePrimitiveBaseType<T> = T extends string ? string : T extends number ? number : T extends boolean ? boolean : never;
|
|
136
|
+
type Autocomplete<T> = T | (AutocompletePrimitiveBaseType<T> & Record<never, never>);
|
|
137
|
+
//#endregion
|
|
138
|
+
//#region ../../node_modules/undici/types/header.d.ts
|
|
139
|
+
/**
|
|
140
|
+
* The header type declaration of `undici`.
|
|
141
|
+
*/
|
|
142
|
+
type IncomingHttpHeaders = Record<string, string | string[] | undefined>;
|
|
143
|
+
type HeaderNames = Autocomplete<'Accept' | 'Accept-CH' | 'Accept-Charset' | 'Accept-Encoding' | 'Accept-Language' | 'Accept-Patch' | 'Accept-Post' | 'Accept-Ranges' | 'Access-Control-Allow-Credentials' | 'Access-Control-Allow-Headers' | 'Access-Control-Allow-Methods' | 'Access-Control-Allow-Origin' | 'Access-Control-Expose-Headers' | 'Access-Control-Max-Age' | 'Access-Control-Request-Headers' | 'Access-Control-Request-Method' | 'Age' | 'Allow' | 'Alt-Svc' | 'Alt-Used' | 'Authorization' | 'Cache-Control' | 'Clear-Site-Data' | 'Connection' | 'Content-Disposition' | 'Content-Encoding' | 'Content-Language' | 'Content-Length' | 'Content-Location' | 'Content-Range' | 'Content-Security-Policy' | 'Content-Security-Policy-Report-Only' | 'Content-Type' | 'Cookie' | 'Cross-Origin-Embedder-Policy' | 'Cross-Origin-Opener-Policy' | 'Cross-Origin-Resource-Policy' | 'Date' | 'Device-Memory' | 'ETag' | 'Expect' | 'Expect-CT' | 'Expires' | 'Forwarded' | 'From' | 'Host' | 'If-Match' | 'If-Modified-Since' | 'If-None-Match' | 'If-Range' | 'If-Unmodified-Since' | 'Keep-Alive' | 'Last-Modified' | 'Link' | 'Location' | 'Max-Forwards' | 'Origin' | 'Permissions-Policy' | 'Priority' | 'Proxy-Authenticate' | 'Proxy-Authorization' | 'Range' | 'Referer' | 'Referrer-Policy' | 'Retry-After' | 'Sec-Fetch-Dest' | 'Sec-Fetch-Mode' | 'Sec-Fetch-Site' | 'Sec-Fetch-User' | 'Sec-Purpose' | 'Sec-WebSocket-Accept' | 'Server' | 'Server-Timing' | 'Service-Worker-Navigation-Preload' | 'Set-Cookie' | 'SourceMap' | 'Strict-Transport-Security' | 'TE' | 'Timing-Allow-Origin' | 'Trailer' | 'Transfer-Encoding' | 'Upgrade' | 'Upgrade-Insecure-Requests' | 'User-Agent' | 'Vary' | 'Via' | 'WWW-Authenticate' | 'X-Content-Type-Options' | 'X-Frame-Options'>;
|
|
144
|
+
type IANARegisteredMimeType = Autocomplete<'audio/aac' | 'video/x-msvideo' | 'image/avif' | 'video/av1' | 'application/octet-stream' | 'image/bmp' | 'text/css' | 'text/csv' | 'application/vnd.ms-fontobject' | 'application/epub+zip' | 'image/gif' | 'application/gzip' | 'text/html' | 'image/x-icon' | 'text/calendar' | 'image/jpeg' | 'text/javascript' | 'application/json' | 'application/ld+json' | 'audio/x-midi' | 'audio/mpeg' | 'video/mp4' | 'video/mpeg' | 'audio/ogg' | 'video/ogg' | 'application/ogg' | 'audio/opus' | 'font/otf' | 'application/pdf' | 'image/png' | 'application/rtf' | 'image/svg+xml' | 'image/tiff' | 'video/mp2t' | 'font/ttf' | 'text/plain' | 'application/wasm' | 'video/webm' | 'audio/webm' | 'image/webp' | 'font/woff' | 'font/woff2' | 'application/xhtml+xml' | 'application/xml' | 'application/zip' | 'video/3gpp' | 'video/3gpp2' | 'model/gltf+json' | 'model/gltf-binary'>;
|
|
145
|
+
type KnownHeaderValues = {
|
|
146
|
+
'content-type': IANARegisteredMimeType;
|
|
147
|
+
};
|
|
148
|
+
type HeaderRecord = { [K in HeaderNames | Lowercase<HeaderNames>]?: Lowercase<K> extends keyof KnownHeaderValues ? KnownHeaderValues[Lowercase<K>] : string };
|
|
149
|
+
//#endregion
|
|
150
|
+
//#region ../../node_modules/undici/types/readable.d.ts
|
|
151
|
+
declare class BodyReadable extends Readable$1 {
|
|
152
|
+
constructor(opts: {
|
|
153
|
+
resume: (this: Readable$1, size: number) => void | null;
|
|
154
|
+
abort: () => void | null;
|
|
155
|
+
contentType?: string;
|
|
156
|
+
contentLength?: number;
|
|
157
|
+
highWaterMark?: number;
|
|
158
|
+
});
|
|
159
|
+
/** Consumes and returns the body as a string
|
|
160
|
+
* https://fetch.spec.whatwg.org/#dom-body-text
|
|
161
|
+
*/
|
|
162
|
+
text(): Promise<string>;
|
|
163
|
+
/** Consumes and returns the body as a JavaScript Object
|
|
164
|
+
* https://fetch.spec.whatwg.org/#dom-body-json
|
|
165
|
+
*/
|
|
166
|
+
json(): Promise<unknown>;
|
|
167
|
+
/** Consumes and returns the body as a Blob
|
|
168
|
+
* https://fetch.spec.whatwg.org/#dom-body-blob
|
|
169
|
+
*/
|
|
170
|
+
blob(): Promise<Blob>;
|
|
171
|
+
/** Consumes and returns the body as an Uint8Array
|
|
172
|
+
* https://fetch.spec.whatwg.org/#dom-body-bytes
|
|
173
|
+
*/
|
|
174
|
+
bytes(): Promise<Uint8Array>;
|
|
175
|
+
/** Consumes and returns the body as an ArrayBuffer
|
|
176
|
+
* https://fetch.spec.whatwg.org/#dom-body-arraybuffer
|
|
177
|
+
*/
|
|
178
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
179
|
+
/** Not implemented
|
|
180
|
+
*
|
|
181
|
+
* https://fetch.spec.whatwg.org/#dom-body-formdata
|
|
182
|
+
*/
|
|
183
|
+
formData(): Promise<never>;
|
|
184
|
+
/** Returns true if the body is not null and the body has been consumed
|
|
185
|
+
*
|
|
186
|
+
* Otherwise, returns false
|
|
187
|
+
*
|
|
188
|
+
* https://fetch.spec.whatwg.org/#dom-body-bodyused
|
|
189
|
+
*/
|
|
190
|
+
readonly bodyUsed: boolean;
|
|
191
|
+
/**
|
|
192
|
+
* If body is null, it should return null as the body
|
|
193
|
+
*
|
|
194
|
+
* If body is not null, should return the body as a ReadableStream
|
|
195
|
+
*
|
|
196
|
+
* https://fetch.spec.whatwg.org/#dom-body-body
|
|
197
|
+
*/
|
|
198
|
+
readonly body: never | undefined;
|
|
199
|
+
/** Dumps the response body by reading `limit` number of bytes.
|
|
200
|
+
* @param opts.limit Number of bytes to read (optional) - Default: 131072
|
|
201
|
+
* @param opts.signal AbortSignal to cancel the operation (optional)
|
|
202
|
+
*/
|
|
203
|
+
dump(opts?: {
|
|
204
|
+
limit: number;
|
|
205
|
+
signal?: AbortSignal;
|
|
206
|
+
}): Promise<void>;
|
|
207
|
+
}
|
|
208
|
+
//#endregion
|
|
209
|
+
//#region ../../node_modules/undici/types/fetch.d.ts
|
|
210
|
+
type BodyInit = ArrayBuffer | AsyncIterable<Uint8Array> | Blob | FormData | Iterable<Uint8Array> | NodeJS.ArrayBufferView | URLSearchParams | null | string;
|
|
211
|
+
interface SpecIterator<T, TReturn = any, TNext = undefined> {
|
|
212
|
+
next(...args: [] | [TNext]): IteratorResult<T, TReturn>;
|
|
213
|
+
}
|
|
214
|
+
interface SpecIterableIterator<T> extends SpecIterator<T> {
|
|
215
|
+
[Symbol.iterator](): SpecIterableIterator<T>;
|
|
216
|
+
}
|
|
217
|
+
interface SpecIterable<T> {
|
|
218
|
+
[Symbol.iterator](): SpecIterator<T>;
|
|
219
|
+
}
|
|
220
|
+
type HeadersInit = [string, string][] | HeaderRecord | Headers;
|
|
221
|
+
declare class Headers implements SpecIterable<[string, string]> {
|
|
222
|
+
constructor(init?: HeadersInit);
|
|
223
|
+
readonly append: (name: string, value: string) => void;
|
|
224
|
+
readonly delete: (name: string) => void;
|
|
225
|
+
readonly get: (name: string) => string | null;
|
|
226
|
+
readonly has: (name: string) => boolean;
|
|
227
|
+
readonly set: (name: string, value: string) => void;
|
|
228
|
+
readonly getSetCookie: () => string[];
|
|
229
|
+
readonly forEach: (callbackfn: (value: string, key: string, iterable: Headers) => void, thisArg?: unknown) => void;
|
|
230
|
+
readonly keys: () => SpecIterableIterator<string>;
|
|
231
|
+
readonly values: () => SpecIterableIterator<string>;
|
|
232
|
+
readonly entries: () => SpecIterableIterator<[string, string]>;
|
|
233
|
+
readonly [Symbol.iterator]: () => SpecIterableIterator<[string, string]>;
|
|
234
|
+
}
|
|
235
|
+
//#endregion
|
|
236
|
+
//#region ../../node_modules/undici/types/formdata.d.ts
|
|
237
|
+
/**
|
|
238
|
+
* A `string` or `File` that represents a single value from a set of `FormData` key-value pairs.
|
|
239
|
+
*/
|
|
240
|
+
declare type FormDataEntryValue = string | File;
|
|
241
|
+
/**
|
|
242
|
+
* Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using fetch().
|
|
243
|
+
*/
|
|
244
|
+
declare class FormData {
|
|
245
|
+
/**
|
|
246
|
+
* Appends a new value onto an existing key inside a FormData object,
|
|
247
|
+
* or adds the key if it does not already exist.
|
|
248
|
+
*
|
|
249
|
+
* The difference between `set()` and `append()` is that if the specified key already exists, `set()` will overwrite all existing values with the new one, whereas `append()` will append the new value onto the end of the existing set of values.
|
|
250
|
+
*
|
|
251
|
+
* @param name The name of the field whose data is contained in `value`.
|
|
252
|
+
* @param value The field's value. This can be [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob)
|
|
253
|
+
or [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File). If none of these are specified the value is converted to a string.
|
|
254
|
+
* @param fileName The filename reported to the server, when a Blob or File is passed as the second parameter. The default filename for Blob objects is "blob". The default filename for File objects is the file's filename.
|
|
255
|
+
*/
|
|
256
|
+
append(name: string, value: unknown, fileName?: string): void;
|
|
257
|
+
/**
|
|
258
|
+
* Set a new value for an existing key inside FormData,
|
|
259
|
+
* or add the new field if it does not already exist.
|
|
260
|
+
*
|
|
261
|
+
* @param name The name of the field whose data is contained in `value`.
|
|
262
|
+
* @param value The field's value. This can be [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob)
|
|
263
|
+
or [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File). If none of these are specified the value is converted to a string.
|
|
264
|
+
* @param fileName The filename reported to the server, when a Blob or File is passed as the second parameter. The default filename for Blob objects is "blob". The default filename for File objects is the file's filename.
|
|
265
|
+
*
|
|
266
|
+
*/
|
|
267
|
+
set(name: string, value: unknown, fileName?: string): void;
|
|
268
|
+
/**
|
|
269
|
+
* Returns the first value associated with a given key from within a `FormData` object.
|
|
270
|
+
* If you expect multiple values and want all of them, use the `getAll()` method instead.
|
|
271
|
+
*
|
|
272
|
+
* @param {string} name A name of the value you want to retrieve.
|
|
273
|
+
*
|
|
274
|
+
* @returns A `FormDataEntryValue` containing the value. If the key doesn't exist, the method returns null.
|
|
275
|
+
*/
|
|
276
|
+
get(name: string): FormDataEntryValue | null;
|
|
277
|
+
/**
|
|
278
|
+
* Returns all the values associated with a given key from within a `FormData` object.
|
|
279
|
+
*
|
|
280
|
+
* @param {string} name A name of the value you want to retrieve.
|
|
281
|
+
*
|
|
282
|
+
* @returns An array of `FormDataEntryValue` whose key matches the value passed in the `name` parameter. If the key doesn't exist, the method returns an empty list.
|
|
283
|
+
*/
|
|
284
|
+
getAll(name: string): FormDataEntryValue[];
|
|
285
|
+
/**
|
|
286
|
+
* Returns a boolean stating whether a `FormData` object contains a certain key.
|
|
287
|
+
*
|
|
288
|
+
* @param name A string representing the name of the key you want to test for.
|
|
289
|
+
*
|
|
290
|
+
* @return A boolean value.
|
|
291
|
+
*/
|
|
292
|
+
has(name: string): boolean;
|
|
293
|
+
/**
|
|
294
|
+
* Deletes a key and its value(s) from a `FormData` object.
|
|
295
|
+
*
|
|
296
|
+
* @param name The name of the key you want to delete.
|
|
297
|
+
*/
|
|
298
|
+
delete(name: string): void;
|
|
299
|
+
/**
|
|
300
|
+
* Executes given callback function for each field of the FormData instance
|
|
301
|
+
*/
|
|
302
|
+
forEach: (callbackfn: (value: FormDataEntryValue, key: string, iterable: FormData) => void, thisArg?: unknown) => void;
|
|
303
|
+
/**
|
|
304
|
+
* Returns an [`iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) allowing to go through all keys contained in this `FormData` object.
|
|
305
|
+
* Each key is a `string`.
|
|
306
|
+
*/
|
|
307
|
+
keys: () => SpecIterableIterator<string>;
|
|
308
|
+
/**
|
|
309
|
+
* Returns an [`iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) allowing to go through all values contained in this object `FormData` object.
|
|
310
|
+
* Each value is a [`FormDataValue`](https://developer.mozilla.org/en-US/docs/Web/API/FormDataEntryValue).
|
|
311
|
+
*/
|
|
312
|
+
values: () => SpecIterableIterator<FormDataEntryValue>;
|
|
313
|
+
/**
|
|
314
|
+
* Returns an [`iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) allowing to go through the `FormData` key/value pairs.
|
|
315
|
+
* The key of each pair is a string; the value is a [`FormDataValue`](https://developer.mozilla.org/en-US/docs/Web/API/FormDataEntryValue).
|
|
316
|
+
*/
|
|
317
|
+
entries: () => SpecIterableIterator<[string, FormDataEntryValue]>;
|
|
318
|
+
/**
|
|
319
|
+
* An alias for FormData#entries()
|
|
320
|
+
*/
|
|
321
|
+
[Symbol.iterator]: () => SpecIterableIterator<[string, FormDataEntryValue]>;
|
|
322
|
+
readonly [Symbol.toStringTag]: string;
|
|
323
|
+
}
|
|
324
|
+
//#endregion
|
|
325
|
+
//#region ../../node_modules/undici/types/connector.d.ts
|
|
326
|
+
declare function buildConnector(options?: buildConnector.BuildOptions): buildConnector.connector;
|
|
327
|
+
declare namespace buildConnector {
|
|
328
|
+
export type BuildOptions = (ConnectionOptions | TcpNetConnectOpts | IpcNetConnectOpts) & {
|
|
329
|
+
allowH2?: boolean;
|
|
330
|
+
maxCachedSessions?: number | null;
|
|
331
|
+
socketPath?: string | null;
|
|
332
|
+
timeout?: number | null;
|
|
333
|
+
port?: number;
|
|
334
|
+
keepAlive?: boolean | null;
|
|
335
|
+
keepAliveInitialDelay?: number | null;
|
|
336
|
+
typeOfService?: number | null;
|
|
337
|
+
};
|
|
338
|
+
export interface Options {
|
|
339
|
+
hostname: string;
|
|
340
|
+
host?: string;
|
|
341
|
+
protocol: string;
|
|
342
|
+
port: string;
|
|
343
|
+
servername?: string;
|
|
344
|
+
localAddress?: string | null;
|
|
345
|
+
socketPath?: string | null;
|
|
346
|
+
httpSocket?: Socket;
|
|
347
|
+
}
|
|
348
|
+
export type Callback = (...args: CallbackArgs) => void;
|
|
349
|
+
type CallbackArgs = [null, Socket | TLSSocket] | [Error, null];
|
|
350
|
+
export interface connector {
|
|
351
|
+
(options: buildConnector.Options, callback: buildConnector.Callback): void;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
//#endregion
|
|
355
|
+
//#region ../../node_modules/undici/types/client-stats.d.ts
|
|
356
|
+
declare class ClientStats {
|
|
357
|
+
constructor(pool: Client);
|
|
358
|
+
/** If socket has open connection. */
|
|
359
|
+
connected: boolean;
|
|
360
|
+
/** Number of open socket connections in this client that do not have an active request. */
|
|
361
|
+
pending: number;
|
|
362
|
+
/** Number of currently active requests of this client. */
|
|
363
|
+
running: number;
|
|
364
|
+
/** Number of active, pending, or queued requests of this client. */
|
|
365
|
+
size: number;
|
|
366
|
+
}
|
|
367
|
+
//#endregion
|
|
368
|
+
//#region ../../node_modules/undici/types/client.d.ts
|
|
369
|
+
type ClientConnectOptions = Omit<Dispatcher.ConnectOptions, 'origin'>;
|
|
370
|
+
/**
|
|
371
|
+
* A basic HTTP/1.1 client, mapped on top a single TCP/TLS connection. Pipelining is disabled by default.
|
|
372
|
+
*/
|
|
373
|
+
declare class Client extends Dispatcher {
|
|
374
|
+
constructor(url: string | URL, options?: Client.Options);
|
|
375
|
+
/** Property to get and set the pipelining factor. */
|
|
376
|
+
pipelining: number;
|
|
377
|
+
/** `true` after `client.close()` has been called. */
|
|
378
|
+
closed: boolean;
|
|
379
|
+
/** `true` after `client.destroyed()` has been called or `client.close()` has been called and the client shutdown has completed. */
|
|
380
|
+
destroyed: boolean;
|
|
381
|
+
/** Aggregate stats for a Client. */
|
|
382
|
+
readonly stats: ClientStats; // Override dispatcher APIs.
|
|
383
|
+
override connect(options: ClientConnectOptions): Promise<Dispatcher.ConnectData>;
|
|
384
|
+
override connect(options: ClientConnectOptions, callback: (err: Error | null, data: Dispatcher.ConnectData) => void): void;
|
|
385
|
+
}
|
|
386
|
+
declare namespace Client {
|
|
387
|
+
export interface OptionsInterceptors {
|
|
388
|
+
Client: readonly Dispatcher.DispatchInterceptor[];
|
|
389
|
+
}
|
|
390
|
+
export interface Options {
|
|
391
|
+
/** TODO */
|
|
392
|
+
interceptors?: OptionsInterceptors;
|
|
393
|
+
/** The maximum length of request headers in bytes. Default: Node.js' `--max-http-header-size` or `16384` (16KiB). */
|
|
394
|
+
maxHeaderSize?: number;
|
|
395
|
+
/** The amount of time, in milliseconds, the parser will wait to receive the complete HTTP headers (Node 14 and above only). Default: `300e3` milliseconds (300s). */
|
|
396
|
+
headersTimeout?: number;
|
|
397
|
+
/** @deprecated unsupported socketTimeout, use headersTimeout & bodyTimeout instead */
|
|
398
|
+
socketTimeout?: never;
|
|
399
|
+
/** @deprecated unsupported requestTimeout, use headersTimeout & bodyTimeout instead */
|
|
400
|
+
requestTimeout?: never;
|
|
401
|
+
/** TODO */
|
|
402
|
+
connectTimeout?: number;
|
|
403
|
+
/** The timeout after which a request will time out, in milliseconds. Monitors time between receiving body data. Use `0` to disable it entirely. Default: `300e3` milliseconds (300s). */
|
|
404
|
+
bodyTimeout?: number;
|
|
405
|
+
/** @deprecated unsupported idleTimeout, use keepAliveTimeout instead */
|
|
406
|
+
idleTimeout?: never;
|
|
407
|
+
/** @deprecated unsupported keepAlive, use pipelining=0 instead */
|
|
408
|
+
keepAlive?: never;
|
|
409
|
+
/** the timeout, in milliseconds, after which a socket without active requests will time out. Monitors time between activity on a connected socket. This value may be overridden by *keep-alive* hints from the server. Default: `4e3` milliseconds (4s). */
|
|
410
|
+
keepAliveTimeout?: number;
|
|
411
|
+
/** @deprecated unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead */
|
|
412
|
+
maxKeepAliveTimeout?: never;
|
|
413
|
+
/** the maximum allowed `idleTimeout`, in milliseconds, when overridden by *keep-alive* hints from the server. Default: `600e3` milliseconds (10min). */
|
|
414
|
+
keepAliveMaxTimeout?: number;
|
|
415
|
+
/** A number of milliseconds subtracted from server *keep-alive* hints when overriding `idleTimeout` to account for timing inaccuracies caused by e.g. transport latency. Default: `1e3` milliseconds (1s). */
|
|
416
|
+
keepAliveTimeoutThreshold?: number;
|
|
417
|
+
/** TODO */
|
|
418
|
+
socketPath?: string;
|
|
419
|
+
/** The amount of concurrent requests to be sent over the single TCP/TLS connection according to [RFC7230](https://tools.ietf.org/html/rfc7230#section-6.3.2). Default: `1`. */
|
|
420
|
+
pipelining?: number;
|
|
421
|
+
/** @deprecated use the connect option instead */
|
|
422
|
+
tls?: never;
|
|
423
|
+
/** If `true`, an error is thrown when the request content-length header doesn't match the length of the request body. Default: `true`. */
|
|
424
|
+
strictContentLength?: boolean;
|
|
425
|
+
/** TODO */
|
|
426
|
+
maxCachedSessions?: number;
|
|
427
|
+
/** TODO */
|
|
428
|
+
connect?: Partial<buildConnector.BuildOptions> | buildConnector.connector;
|
|
429
|
+
/** TODO */
|
|
430
|
+
maxRequestsPerClient?: number;
|
|
431
|
+
/** TODO */
|
|
432
|
+
localAddress?: string;
|
|
433
|
+
/** Max response body size in bytes, -1 is disabled */
|
|
434
|
+
maxResponseSize?: number;
|
|
435
|
+
/** Enables a family autodetection algorithm that loosely implements section 5 of RFC 8305. */
|
|
436
|
+
autoSelectFamily?: boolean;
|
|
437
|
+
/** The amount of time in milliseconds to wait for a connection attempt to finish before trying the next address when using the `autoSelectFamily` option. */
|
|
438
|
+
autoSelectFamilyAttemptTimeout?: number;
|
|
439
|
+
/**
|
|
440
|
+
* @description Enables support for H2 if the server has assigned bigger priority to it through ALPN negotiation.
|
|
441
|
+
* @default false
|
|
442
|
+
*/
|
|
443
|
+
allowH2?: boolean;
|
|
444
|
+
/**
|
|
445
|
+
* @description Dictates the maximum number of concurrent streams for a single H2 session. It can be overridden by a SETTINGS remote frame.
|
|
446
|
+
* @default 100
|
|
447
|
+
*/
|
|
448
|
+
maxConcurrentStreams?: number;
|
|
449
|
+
/**
|
|
450
|
+
* @description Sets the HTTP/2 stream-level flow-control window size (SETTINGS_INITIAL_WINDOW_SIZE).
|
|
451
|
+
* @default 262144
|
|
452
|
+
*/
|
|
453
|
+
initialWindowSize?: number;
|
|
454
|
+
/**
|
|
455
|
+
* @description Sets the HTTP/2 connection-level flow-control window size (ClientHttp2Session.setLocalWindowSize).
|
|
456
|
+
* @default 524288
|
|
457
|
+
*/
|
|
458
|
+
connectionWindowSize?: number;
|
|
459
|
+
/**
|
|
460
|
+
* @description Time interval between PING frames dispatch
|
|
461
|
+
* @default 60000
|
|
462
|
+
*/
|
|
463
|
+
pingInterval?: number;
|
|
464
|
+
}
|
|
465
|
+
export interface SocketInfo {
|
|
466
|
+
localAddress?: string;
|
|
467
|
+
localPort?: number;
|
|
468
|
+
remoteAddress?: string;
|
|
469
|
+
remotePort?: number;
|
|
470
|
+
remoteFamily?: string;
|
|
471
|
+
timeout?: number;
|
|
472
|
+
bytesWritten?: number;
|
|
473
|
+
bytesRead?: number;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
//#endregion
|
|
477
|
+
//#region ../../node_modules/undici/types/errors.d.ts
|
|
478
|
+
declare namespace Errors {
|
|
479
|
+
export class UndiciError extends Error {
|
|
480
|
+
name: string;
|
|
481
|
+
code: string;
|
|
482
|
+
}
|
|
483
|
+
/** Connect timeout error. */
|
|
484
|
+
export class ConnectTimeoutError extends UndiciError {
|
|
485
|
+
name: 'ConnectTimeoutError';
|
|
486
|
+
code: 'UND_ERR_CONNECT_TIMEOUT';
|
|
487
|
+
}
|
|
488
|
+
/** A header exceeds the `headersTimeout` option. */
|
|
489
|
+
export class HeadersTimeoutError extends UndiciError {
|
|
490
|
+
name: 'HeadersTimeoutError';
|
|
491
|
+
code: 'UND_ERR_HEADERS_TIMEOUT';
|
|
492
|
+
}
|
|
493
|
+
/** Headers overflow error. */
|
|
494
|
+
export class HeadersOverflowError extends UndiciError {
|
|
495
|
+
name: 'HeadersOverflowError';
|
|
496
|
+
code: 'UND_ERR_HEADERS_OVERFLOW';
|
|
497
|
+
}
|
|
498
|
+
/** A body exceeds the `bodyTimeout` option. */
|
|
499
|
+
export class BodyTimeoutError extends UndiciError {
|
|
500
|
+
name: 'BodyTimeoutError';
|
|
501
|
+
code: 'UND_ERR_BODY_TIMEOUT';
|
|
502
|
+
}
|
|
503
|
+
export class ResponseError extends UndiciError {
|
|
504
|
+
constructor(message: string, code: number, options: {
|
|
505
|
+
headers?: IncomingHttpHeaders | string[] | null;
|
|
506
|
+
body?: null | Record<string, any> | string;
|
|
507
|
+
});
|
|
508
|
+
name: 'ResponseError';
|
|
509
|
+
code: 'UND_ERR_RESPONSE';
|
|
510
|
+
statusCode: number;
|
|
511
|
+
body: null | Record<string, any> | string;
|
|
512
|
+
headers: IncomingHttpHeaders | string[] | null;
|
|
513
|
+
}
|
|
514
|
+
/** Passed an invalid argument. */
|
|
515
|
+
export class InvalidArgumentError extends UndiciError {
|
|
516
|
+
name: 'InvalidArgumentError';
|
|
517
|
+
code: 'UND_ERR_INVALID_ARG';
|
|
518
|
+
}
|
|
519
|
+
/** Returned an invalid value. */
|
|
520
|
+
export class InvalidReturnValueError extends UndiciError {
|
|
521
|
+
name: 'InvalidReturnValueError';
|
|
522
|
+
code: 'UND_ERR_INVALID_RETURN_VALUE';
|
|
523
|
+
}
|
|
524
|
+
/** The request has been aborted by the user. */
|
|
525
|
+
export class RequestAbortedError extends UndiciError {
|
|
526
|
+
name: 'AbortError';
|
|
527
|
+
code: 'UND_ERR_ABORTED';
|
|
528
|
+
}
|
|
529
|
+
/** Expected error with reason. */
|
|
530
|
+
export class InformationalError extends UndiciError {
|
|
531
|
+
name: 'InformationalError';
|
|
532
|
+
code: 'UND_ERR_INFO';
|
|
533
|
+
}
|
|
534
|
+
/** Request body length does not match content-length header. */
|
|
535
|
+
export class RequestContentLengthMismatchError extends UndiciError {
|
|
536
|
+
name: 'RequestContentLengthMismatchError';
|
|
537
|
+
code: 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH';
|
|
538
|
+
}
|
|
539
|
+
/** Response body length does not match content-length header. */
|
|
540
|
+
export class ResponseContentLengthMismatchError extends UndiciError {
|
|
541
|
+
name: 'ResponseContentLengthMismatchError';
|
|
542
|
+
code: 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH';
|
|
543
|
+
}
|
|
544
|
+
/** Trying to use a destroyed client. */
|
|
545
|
+
export class ClientDestroyedError extends UndiciError {
|
|
546
|
+
name: 'ClientDestroyedError';
|
|
547
|
+
code: 'UND_ERR_DESTROYED';
|
|
548
|
+
}
|
|
549
|
+
/** Trying to use a closed client. */
|
|
550
|
+
export class ClientClosedError extends UndiciError {
|
|
551
|
+
name: 'ClientClosedError';
|
|
552
|
+
code: 'UND_ERR_CLOSED';
|
|
553
|
+
}
|
|
554
|
+
/** There is an error with the socket. */
|
|
555
|
+
export class SocketError extends UndiciError {
|
|
556
|
+
name: 'SocketError';
|
|
557
|
+
code: 'UND_ERR_SOCKET';
|
|
558
|
+
socket: Client.SocketInfo | null;
|
|
559
|
+
}
|
|
560
|
+
/** Encountered unsupported functionality. */
|
|
561
|
+
export class NotSupportedError extends UndiciError {
|
|
562
|
+
name: 'NotSupportedError';
|
|
563
|
+
code: 'UND_ERR_NOT_SUPPORTED';
|
|
564
|
+
}
|
|
565
|
+
/** No upstream has been added to the BalancedPool. */
|
|
566
|
+
export class BalancedPoolMissingUpstreamError extends UndiciError {
|
|
567
|
+
name: 'MissingUpstreamError';
|
|
568
|
+
code: 'UND_ERR_BPL_MISSING_UPSTREAM';
|
|
569
|
+
}
|
|
570
|
+
export class HTTPParserError extends UndiciError {
|
|
571
|
+
name: 'HTTPParserError';
|
|
572
|
+
code: string;
|
|
573
|
+
}
|
|
574
|
+
/** The response exceed the length allowed. */
|
|
575
|
+
export class ResponseExceededMaxSizeError extends UndiciError {
|
|
576
|
+
name: 'ResponseExceededMaxSizeError';
|
|
577
|
+
code: 'UND_ERR_RES_EXCEEDED_MAX_SIZE';
|
|
578
|
+
}
|
|
579
|
+
export class RequestRetryError extends UndiciError {
|
|
580
|
+
constructor(message: string, statusCode: number, headers?: IncomingHttpHeaders | string[] | null, body?: null | Record<string, any> | string);
|
|
581
|
+
name: 'RequestRetryError';
|
|
582
|
+
code: 'UND_ERR_REQ_RETRY';
|
|
583
|
+
statusCode: number;
|
|
584
|
+
data: {
|
|
585
|
+
count: number;
|
|
586
|
+
};
|
|
587
|
+
headers: Record<string, string | string[]>;
|
|
588
|
+
}
|
|
589
|
+
export class SecureProxyConnectionError extends UndiciError {
|
|
590
|
+
constructor(cause?: Error, message?: string, options?: Record<any, any>);
|
|
591
|
+
name: 'SecureProxyConnectionError';
|
|
592
|
+
code: 'UND_ERR_PRX_TLS';
|
|
593
|
+
}
|
|
594
|
+
export class MaxOriginsReachedError extends UndiciError {
|
|
595
|
+
name: 'MaxOriginsReachedError';
|
|
596
|
+
code: 'UND_ERR_MAX_ORIGINS_REACHED';
|
|
597
|
+
}
|
|
598
|
+
/** SOCKS5 proxy related error. */
|
|
599
|
+
export class Socks5ProxyError extends UndiciError {
|
|
600
|
+
constructor(message?: string, code?: string);
|
|
601
|
+
name: 'Socks5ProxyError';
|
|
602
|
+
code: string;
|
|
603
|
+
}
|
|
604
|
+
/** WebSocket decompressed message exceeded maximum size. */
|
|
605
|
+
export class MessageSizeExceededError extends UndiciError {
|
|
606
|
+
name: 'MessageSizeExceededError';
|
|
607
|
+
code: 'UND_ERR_WS_MESSAGE_SIZE_EXCEEDED';
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
//#endregion
|
|
611
|
+
//#region ../../node_modules/undici/types/dispatcher.d.ts
|
|
612
|
+
type AbortSignal$1 = unknown;
|
|
613
|
+
type UndiciHeaders = Record<string, string | string[]> | IncomingHttpHeaders | string[] | Iterable<[string, string | string[] | undefined]> | null;
|
|
614
|
+
/** Dispatcher is the core API used to dispatch requests. */
|
|
615
|
+
declare class Dispatcher extends EventEmitter {
|
|
616
|
+
/** Dispatches a request. This API is expected to evolve through semver-major versions and is less stable than the preceding higher level APIs. It is primarily intended for library developers who implement higher level APIs on top of this. */
|
|
617
|
+
dispatch(options: Dispatcher.DispatchOptions, handler: Dispatcher.DispatchHandler): boolean;
|
|
618
|
+
/** Starts two-way communications with the requested resource. */
|
|
619
|
+
connect<TOpaque = null>(options: Dispatcher.ConnectOptions<TOpaque>, callback: (err: Error | null, data: Dispatcher.ConnectData<TOpaque>) => void): void;
|
|
620
|
+
connect<TOpaque = null>(options: Dispatcher.ConnectOptions<TOpaque>): Promise<Dispatcher.ConnectData<TOpaque>>;
|
|
621
|
+
/** Compose a chain of dispatchers */
|
|
622
|
+
compose(dispatchers: Dispatcher.DispatcherComposeInterceptor[]): Dispatcher.ComposedDispatcher;
|
|
623
|
+
compose(...dispatchers: Dispatcher.DispatcherComposeInterceptor[]): Dispatcher.ComposedDispatcher;
|
|
624
|
+
/** Performs an HTTP request. */
|
|
625
|
+
request<TOpaque = null>(options: Dispatcher.RequestOptions<TOpaque>, callback: (err: Error | null, data: Dispatcher.ResponseData<TOpaque>) => void): void;
|
|
626
|
+
request<TOpaque = null>(options: Dispatcher.RequestOptions<TOpaque>): Promise<Dispatcher.ResponseData<TOpaque>>;
|
|
627
|
+
/** For easy use with `stream.pipeline`. */
|
|
628
|
+
pipeline<TOpaque = null>(options: Dispatcher.PipelineOptions<TOpaque>, handler: Dispatcher.PipelineHandler<TOpaque>): Duplex;
|
|
629
|
+
/** A faster version of `Dispatcher.request`. */
|
|
630
|
+
stream<TOpaque = null>(options: Dispatcher.RequestOptions<TOpaque>, factory: Dispatcher.StreamFactory<TOpaque>, callback: (err: Error | null, data: Dispatcher.StreamData<TOpaque>) => void): void;
|
|
631
|
+
stream<TOpaque = null>(options: Dispatcher.RequestOptions<TOpaque>, factory: Dispatcher.StreamFactory<TOpaque>): Promise<Dispatcher.StreamData<TOpaque>>;
|
|
632
|
+
/** Upgrade to a different protocol. */
|
|
633
|
+
upgrade(options: Dispatcher.UpgradeOptions, callback: (err: Error | null, data: Dispatcher.UpgradeData) => void): void;
|
|
634
|
+
upgrade(options: Dispatcher.UpgradeOptions): Promise<Dispatcher.UpgradeData>;
|
|
635
|
+
/** Closes the client and gracefully waits for enqueued requests to complete before invoking the callback (or returning a promise if no callback is provided). */
|
|
636
|
+
close(callback: () => void): void;
|
|
637
|
+
close(): Promise<void>;
|
|
638
|
+
/** Destroy the client abruptly with the given err. All the pending and running requests will be asynchronously aborted and error. Waits until socket is closed before invoking the callback (or returning a promise if no callback is provided). Since this operation is asynchronously dispatched there might still be some progress on dispatched requests. */
|
|
639
|
+
destroy(err: Error | null, callback: () => void): void;
|
|
640
|
+
destroy(callback: () => void): void;
|
|
641
|
+
destroy(err: Error | null): Promise<void>;
|
|
642
|
+
destroy(): Promise<void>;
|
|
643
|
+
on(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this;
|
|
644
|
+
on(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
|
645
|
+
on(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
|
646
|
+
on(eventName: 'drain', callback: (origin: URL) => void): this;
|
|
647
|
+
once(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this;
|
|
648
|
+
once(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
|
649
|
+
once(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
|
650
|
+
once(eventName: 'drain', callback: (origin: URL) => void): this;
|
|
651
|
+
off(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this;
|
|
652
|
+
off(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
|
653
|
+
off(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
|
654
|
+
off(eventName: 'drain', callback: (origin: URL) => void): this;
|
|
655
|
+
addListener(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this;
|
|
656
|
+
addListener(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
|
657
|
+
addListener(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
|
658
|
+
addListener(eventName: 'drain', callback: (origin: URL) => void): this;
|
|
659
|
+
removeListener(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this;
|
|
660
|
+
removeListener(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
|
661
|
+
removeListener(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
|
662
|
+
removeListener(eventName: 'drain', callback: (origin: URL) => void): this;
|
|
663
|
+
prependListener(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this;
|
|
664
|
+
prependListener(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
|
665
|
+
prependListener(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
|
666
|
+
prependListener(eventName: 'drain', callback: (origin: URL) => void): this;
|
|
667
|
+
prependOnceListener(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this;
|
|
668
|
+
prependOnceListener(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
|
669
|
+
prependOnceListener(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
|
670
|
+
prependOnceListener(eventName: 'drain', callback: (origin: URL) => void): this;
|
|
671
|
+
listeners(eventName: 'connect'): ((origin: URL, targets: readonly Dispatcher[]) => void)[];
|
|
672
|
+
listeners(eventName: 'disconnect'): ((origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[];
|
|
673
|
+
listeners(eventName: 'connectionError'): ((origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[];
|
|
674
|
+
listeners(eventName: 'drain'): ((origin: URL) => void)[];
|
|
675
|
+
rawListeners(eventName: 'connect'): ((origin: URL, targets: readonly Dispatcher[]) => void)[];
|
|
676
|
+
rawListeners(eventName: 'disconnect'): ((origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[];
|
|
677
|
+
rawListeners(eventName: 'connectionError'): ((origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[];
|
|
678
|
+
rawListeners(eventName: 'drain'): ((origin: URL) => void)[];
|
|
679
|
+
emit(eventName: 'connect', origin: URL, targets: readonly Dispatcher[]): boolean;
|
|
680
|
+
emit(eventName: 'disconnect', origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError): boolean;
|
|
681
|
+
emit(eventName: 'connectionError', origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError): boolean;
|
|
682
|
+
emit(eventName: 'drain', origin: URL): boolean;
|
|
683
|
+
}
|
|
684
|
+
declare namespace Dispatcher {
|
|
685
|
+
export interface ComposedDispatcher extends Dispatcher {}
|
|
686
|
+
export type Dispatch = Dispatcher['dispatch'];
|
|
687
|
+
export type DispatcherComposeInterceptor = (dispatch: Dispatch) => Dispatch;
|
|
688
|
+
export interface DispatchOptions {
|
|
689
|
+
origin?: string | URL;
|
|
690
|
+
path: string;
|
|
691
|
+
method: HttpMethod;
|
|
692
|
+
/** Default: `null` */
|
|
693
|
+
body?: string | Buffer | Uint8Array | Readable$1 | null | FormData;
|
|
694
|
+
/** Default: `null` */
|
|
695
|
+
headers?: UndiciHeaders;
|
|
696
|
+
/** Query string params to be embedded in the request URL. Default: `null` */
|
|
697
|
+
query?: Record<string, any>;
|
|
698
|
+
/** Whether the requests can be safely retried or not. If `false` the request won't be sent until all preceding requests in the pipeline have completed. Default: `true` if `method` is `HEAD` or `GET`. */
|
|
699
|
+
idempotent?: boolean;
|
|
700
|
+
/** Whether the response is expected to take a long time and would end up blocking the pipeline. When this is set to `true` further pipelining will be avoided on the same connection until headers have been received. Defaults to `method !== 'HEAD'`. */
|
|
701
|
+
blocking?: boolean;
|
|
702
|
+
/** The IP Type of Service (ToS) value for the request socket. Must be an integer between 0 and 255. Default: `0` */
|
|
703
|
+
typeOfService?: number | null;
|
|
704
|
+
/** Upgrade the request. Should be used to specify the kind of upgrade i.e. `'Websocket'`. Default: `method === 'CONNECT' || null`. */
|
|
705
|
+
upgrade?: boolean | string | null;
|
|
706
|
+
/** The amount of time, in milliseconds, the parser will wait to receive the complete HTTP headers. Defaults to 300 seconds. */
|
|
707
|
+
headersTimeout?: number | null;
|
|
708
|
+
/** The timeout after which a request will time out, in milliseconds. Monitors time between receiving body data. Use 0 to disable it entirely. Defaults to 300 seconds. */
|
|
709
|
+
bodyTimeout?: number | null;
|
|
710
|
+
/** Whether the request should stablish a keep-alive or not. Default `false` */
|
|
711
|
+
reset?: boolean;
|
|
712
|
+
/** Whether Undici should throw an error upon receiving a 4xx or 5xx response from the server. Defaults to false */
|
|
713
|
+
throwOnError?: boolean;
|
|
714
|
+
/** For H2, it appends the expect: 100-continue header, and halts the request body until a 100-continue is received from the remote server */
|
|
715
|
+
expectContinue?: boolean;
|
|
716
|
+
}
|
|
717
|
+
export interface ConnectOptions<TOpaque = null> {
|
|
718
|
+
origin: string | URL;
|
|
719
|
+
path: string;
|
|
720
|
+
/** Default: `null` */
|
|
721
|
+
headers?: UndiciHeaders;
|
|
722
|
+
/** Default: `null` */
|
|
723
|
+
signal?: AbortSignal$1 | EventEmitter | null;
|
|
724
|
+
/** This argument parameter is passed through to `ConnectData` */
|
|
725
|
+
opaque?: TOpaque;
|
|
726
|
+
/** Default: false */
|
|
727
|
+
redirectionLimitReached?: boolean;
|
|
728
|
+
/** Default: `null` */
|
|
729
|
+
responseHeaders?: 'raw' | null;
|
|
730
|
+
}
|
|
731
|
+
export interface RequestOptions<TOpaque = null> extends DispatchOptions {
|
|
732
|
+
/** Default: `null` */
|
|
733
|
+
opaque?: TOpaque;
|
|
734
|
+
/** Default: `null` */
|
|
735
|
+
signal?: AbortSignal$1 | EventEmitter | null;
|
|
736
|
+
/** Default: false */
|
|
737
|
+
redirectionLimitReached?: boolean;
|
|
738
|
+
/** Default: `null` */
|
|
739
|
+
onInfo?: (info: {
|
|
740
|
+
statusCode: number;
|
|
741
|
+
headers: Record<string, string | string[]>;
|
|
742
|
+
}) => void;
|
|
743
|
+
/** Default: `null` */
|
|
744
|
+
responseHeaders?: 'raw' | null;
|
|
745
|
+
/** Default: `64 KiB` */
|
|
746
|
+
highWaterMark?: number;
|
|
747
|
+
}
|
|
748
|
+
export interface PipelineOptions<TOpaque = null> extends RequestOptions<TOpaque> {
|
|
749
|
+
/** `true` if the `handler` will return an object stream. Default: `false` */
|
|
750
|
+
objectMode?: boolean;
|
|
751
|
+
}
|
|
752
|
+
export interface UpgradeOptions {
|
|
753
|
+
path: string;
|
|
754
|
+
/** Default: `'GET'` */
|
|
755
|
+
method?: string;
|
|
756
|
+
/** Default: `null` */
|
|
757
|
+
headers?: UndiciHeaders;
|
|
758
|
+
/** A string of comma separated protocols, in descending preference order. Default: `'Websocket'` */
|
|
759
|
+
protocol?: string;
|
|
760
|
+
/** Default: `null` */
|
|
761
|
+
signal?: AbortSignal$1 | EventEmitter | null;
|
|
762
|
+
/** Default: false */
|
|
763
|
+
redirectionLimitReached?: boolean;
|
|
764
|
+
/** Default: `null` */
|
|
765
|
+
responseHeaders?: 'raw' | null;
|
|
766
|
+
}
|
|
767
|
+
export interface ConnectData<TOpaque = null> {
|
|
768
|
+
statusCode: number;
|
|
769
|
+
headers: IncomingHttpHeaders;
|
|
770
|
+
socket: Duplex;
|
|
771
|
+
opaque: TOpaque;
|
|
772
|
+
}
|
|
773
|
+
export interface ResponseData<TOpaque = null> {
|
|
774
|
+
statusCode: number;
|
|
775
|
+
statusText: string;
|
|
776
|
+
headers: IncomingHttpHeaders;
|
|
777
|
+
body: BodyReadable & BodyMixin;
|
|
778
|
+
trailers: Record<string, string>;
|
|
779
|
+
opaque: TOpaque;
|
|
780
|
+
context: object;
|
|
781
|
+
}
|
|
782
|
+
export interface PipelineHandlerData<TOpaque = null> {
|
|
783
|
+
statusCode: number;
|
|
784
|
+
headers: IncomingHttpHeaders;
|
|
785
|
+
opaque: TOpaque;
|
|
786
|
+
body: BodyReadable;
|
|
787
|
+
context: object;
|
|
788
|
+
}
|
|
789
|
+
export interface StreamData<TOpaque = null> {
|
|
790
|
+
opaque: TOpaque;
|
|
791
|
+
trailers: Record<string, string>;
|
|
792
|
+
}
|
|
793
|
+
export interface UpgradeData<TOpaque = null> {
|
|
794
|
+
headers: IncomingHttpHeaders;
|
|
795
|
+
socket: Duplex;
|
|
796
|
+
opaque: TOpaque;
|
|
797
|
+
}
|
|
798
|
+
export interface StreamFactoryData<TOpaque = null> {
|
|
799
|
+
statusCode: number;
|
|
800
|
+
headers: IncomingHttpHeaders;
|
|
801
|
+
opaque: TOpaque;
|
|
802
|
+
context: object;
|
|
803
|
+
}
|
|
804
|
+
export type StreamFactory<TOpaque = null> = (data: StreamFactoryData<TOpaque>) => Writable$1;
|
|
805
|
+
export interface DispatchController {
|
|
806
|
+
get aborted(): boolean;
|
|
807
|
+
get paused(): boolean;
|
|
808
|
+
get reason(): Error | null;
|
|
809
|
+
abort(reason: Error): void;
|
|
810
|
+
pause(): void;
|
|
811
|
+
resume(): void;
|
|
812
|
+
}
|
|
813
|
+
export interface DispatchHandler {
|
|
814
|
+
onRequestStart?(controller: DispatchController, context: any): void;
|
|
815
|
+
onRequestUpgrade?(controller: DispatchController, statusCode: number, headers: IncomingHttpHeaders, socket: Duplex): void;
|
|
816
|
+
onResponseStart?(controller: DispatchController, statusCode: number, headers: IncomingHttpHeaders, statusMessage?: string): void;
|
|
817
|
+
onResponseData?(controller: DispatchController, chunk: Buffer): void;
|
|
818
|
+
onResponseEnd?(controller: DispatchController, trailers: IncomingHttpHeaders): void;
|
|
819
|
+
onResponseError?(controller: DispatchController, error: Error): void;
|
|
820
|
+
/** Invoked before request is dispatched on socket. May be invoked multiple times when a request is retried when the request at the head of the pipeline fails. */
|
|
821
|
+
/** @deprecated */
|
|
822
|
+
onConnect?(abort: (err?: Error) => void): void;
|
|
823
|
+
/** Invoked when an error has occurred. */
|
|
824
|
+
/** @deprecated */
|
|
825
|
+
onError?(err: Error): void;
|
|
826
|
+
/** Invoked when request is upgraded either due to a `Upgrade` header or `CONNECT` method. */
|
|
827
|
+
/** @deprecated */
|
|
828
|
+
onUpgrade?(statusCode: number, headers: Buffer[] | string[] | null, socket: Duplex): void;
|
|
829
|
+
/** Invoked when response is received, before headers have been read. **/
|
|
830
|
+
/** @deprecated */
|
|
831
|
+
onResponseStarted?(): void;
|
|
832
|
+
/** Invoked when statusCode and headers have been received. May be invoked multiple times due to 1xx informational headers. */
|
|
833
|
+
/** @deprecated */
|
|
834
|
+
onHeaders?(statusCode: number, headers: Buffer[], resume: () => void, statusText: string): boolean;
|
|
835
|
+
/** Invoked when response payload data is received. */
|
|
836
|
+
/** @deprecated */
|
|
837
|
+
onData?(chunk: Buffer): boolean;
|
|
838
|
+
/** Invoked when response payload and trailers have been received and the request has completed. */
|
|
839
|
+
/** @deprecated */
|
|
840
|
+
onComplete?(trailers: string[] | null): void;
|
|
841
|
+
/** Invoked when a body chunk is sent to the server. May be invoked multiple times for chunked requests */
|
|
842
|
+
/** @deprecated */
|
|
843
|
+
onBodySent?(chunkSize: number, totalBytesSent: number): void;
|
|
844
|
+
}
|
|
845
|
+
export type PipelineHandler<TOpaque = null> = (data: PipelineHandlerData<TOpaque>) => Readable$1;
|
|
846
|
+
export type HttpMethod = Autocomplete<'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH'>;
|
|
847
|
+
/**
|
|
848
|
+
* @link https://fetch.spec.whatwg.org/#body-mixin
|
|
849
|
+
*/
|
|
850
|
+
interface BodyMixin {
|
|
851
|
+
readonly body?: never;
|
|
852
|
+
readonly bodyUsed: boolean;
|
|
853
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
854
|
+
blob(): Promise<Blob>;
|
|
855
|
+
bytes(): Promise<Uint8Array>;
|
|
856
|
+
formData(): Promise<never>;
|
|
857
|
+
json(): Promise<unknown>;
|
|
858
|
+
text(): Promise<string>;
|
|
859
|
+
}
|
|
860
|
+
export interface DispatchInterceptor {
|
|
861
|
+
(dispatch: Dispatch): Dispatch;
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
//#endregion
|
|
865
|
+
//#region ../../node_modules/undici/types/mock-interceptor.d.ts
|
|
866
|
+
/** The scope associated with a mock dispatch. */
|
|
867
|
+
declare class MockScope<TData extends object = object> {
|
|
868
|
+
constructor(mockDispatch: MockInterceptor.MockDispatch<TData>);
|
|
869
|
+
/** Delay a reply by a set amount of time in ms. */
|
|
870
|
+
delay(waitInMs: number): MockScope<TData>;
|
|
871
|
+
/** Persist the defined mock data for the associated reply. It will return the defined mock data indefinitely. */
|
|
872
|
+
persist(): MockScope<TData>;
|
|
873
|
+
/** Define a reply for a set amount of matching requests. */
|
|
874
|
+
times(repeatTimes: number): MockScope<TData>;
|
|
875
|
+
}
|
|
876
|
+
/** The interceptor for a Mock. */
|
|
877
|
+
declare class MockInterceptor {
|
|
878
|
+
constructor(options: MockInterceptor.Options, mockDispatches: MockInterceptor.MockDispatch[]);
|
|
879
|
+
/** Mock an undici request with the defined reply. */
|
|
880
|
+
reply<TData extends object = object>(replyOptionsCallback: MockInterceptor.MockReplyOptionsCallback<TData>): MockScope<TData>;
|
|
881
|
+
reply<TData extends object = object>(statusCode: number, data?: TData | Buffer | string | MockInterceptor.MockResponseDataHandler<TData>, responseOptions?: MockInterceptor.MockResponseOptions): MockScope<TData>;
|
|
882
|
+
/** Mock an undici request by throwing the defined reply error. */
|
|
883
|
+
replyWithError<TError extends Error = Error>(error: TError): MockScope;
|
|
884
|
+
/** Set default reply headers on the interceptor for subsequent mocked replies. */
|
|
885
|
+
defaultReplyHeaders(headers: IncomingHttpHeaders): MockInterceptor;
|
|
886
|
+
/** Set default reply trailers on the interceptor for subsequent mocked replies. */
|
|
887
|
+
defaultReplyTrailers(trailers: Record<string, string>): MockInterceptor;
|
|
888
|
+
/** Set automatically calculated content-length header on subsequent mocked replies. */
|
|
889
|
+
replyContentLength(): MockInterceptor;
|
|
890
|
+
}
|
|
891
|
+
declare namespace MockInterceptor {
|
|
892
|
+
/** MockInterceptor options. */
|
|
893
|
+
export interface Options {
|
|
894
|
+
/** Path to intercept on. */
|
|
895
|
+
path: string | RegExp | ((path: string) => boolean);
|
|
896
|
+
/** Method to intercept on. Defaults to GET. */
|
|
897
|
+
method?: string | RegExp | ((method: string) => boolean);
|
|
898
|
+
/** Body to intercept on. */
|
|
899
|
+
body?: string | RegExp | ((body: string) => boolean);
|
|
900
|
+
/** Headers to intercept on. */
|
|
901
|
+
headers?: Record<string, string | RegExp | ((body: string) => boolean)> | ((headers: Record<string, string>) => boolean);
|
|
902
|
+
/** Query params to intercept on */
|
|
903
|
+
query?: Record<string, any>;
|
|
904
|
+
}
|
|
905
|
+
export interface MockDispatch<TData extends object = object, TError extends Error = Error> extends Options {
|
|
906
|
+
times: number | null;
|
|
907
|
+
persist: boolean;
|
|
908
|
+
consumed: boolean;
|
|
909
|
+
data: MockDispatchData<TData, TError>;
|
|
910
|
+
}
|
|
911
|
+
export interface MockDispatchData<TData extends object = object, TError extends Error = Error> extends MockResponseOptions {
|
|
912
|
+
error: TError | null;
|
|
913
|
+
statusCode?: number;
|
|
914
|
+
data?: TData | string;
|
|
915
|
+
}
|
|
916
|
+
export interface MockResponseOptions {
|
|
917
|
+
headers?: IncomingHttpHeaders;
|
|
918
|
+
trailers?: Record<string, string>;
|
|
919
|
+
}
|
|
920
|
+
export interface MockResponseCallbackOptions {
|
|
921
|
+
path: string;
|
|
922
|
+
method: string;
|
|
923
|
+
headers?: Headers | Record<string, string>;
|
|
924
|
+
origin?: string;
|
|
925
|
+
body?: BodyInit | Dispatcher.DispatchOptions['body'] | null;
|
|
926
|
+
}
|
|
927
|
+
export type MockResponseDataHandler<TData extends object = object> = (opts: MockResponseCallbackOptions) => TData | Buffer | string;
|
|
928
|
+
export type MockReplyOptionsCallback<TData extends object = object> = (opts: MockResponseCallbackOptions) => {
|
|
929
|
+
statusCode: number;
|
|
930
|
+
data?: TData | Buffer | string;
|
|
931
|
+
responseOptions?: MockResponseOptions;
|
|
932
|
+
};
|
|
933
|
+
}
|
|
934
|
+
//#endregion
|
|
935
|
+
//#region ../../node_modules/typanion/lib/types.d.ts
|
|
936
|
+
declare type BoundCoercionFn = () => BoundCoercionFn;
|
|
937
|
+
declare type CoercionFn = (v: any) => BoundCoercionFn;
|
|
938
|
+
declare type Coercion = [string, BoundCoercionFn];
|
|
939
|
+
declare type LooseTest<U> = (value: U, test?: ValidationState) => boolean;
|
|
940
|
+
declare type ValidationState = {
|
|
941
|
+
p?: string;
|
|
942
|
+
errors?: string[];
|
|
943
|
+
coercions?: Coercion[];
|
|
944
|
+
coercion?: CoercionFn;
|
|
945
|
+
};
|
|
946
|
+
//#endregion
|
|
947
|
+
//#region ../../node_modules/clipanion/lib/format.d.ts
|
|
948
|
+
interface ColorFormat {
|
|
949
|
+
header(str: string): string;
|
|
950
|
+
bold(str: string): string;
|
|
951
|
+
error(str: string): string;
|
|
952
|
+
code(str: string): string;
|
|
953
|
+
}
|
|
954
|
+
//#endregion
|
|
955
|
+
//#region ../../node_modules/clipanion/lib/advanced/options/utils.d.ts
|
|
956
|
+
declare const isOptionSymbol: unique symbol;
|
|
957
|
+
//#endregion
|
|
958
|
+
//#region ../../node_modules/clipanion/lib/advanced/Cli.d.ts
|
|
959
|
+
/**
|
|
960
|
+
* The base context of the CLI.
|
|
961
|
+
*
|
|
962
|
+
* All Contexts have to extend it.
|
|
963
|
+
*/
|
|
964
|
+
declare type BaseContext = {
|
|
965
|
+
/**
|
|
966
|
+
* Environment variables.
|
|
967
|
+
*
|
|
968
|
+
* @default
|
|
969
|
+
* process.env
|
|
970
|
+
*/
|
|
971
|
+
env: Record<string, string | undefined>;
|
|
972
|
+
/**
|
|
973
|
+
* The input stream of the CLI.
|
|
974
|
+
*
|
|
975
|
+
* @default
|
|
976
|
+
* process.stdin
|
|
977
|
+
*/
|
|
978
|
+
stdin: Readable;
|
|
979
|
+
/**
|
|
980
|
+
* The output stream of the CLI.
|
|
981
|
+
*
|
|
982
|
+
* @default
|
|
983
|
+
* process.stdout
|
|
984
|
+
*/
|
|
985
|
+
stdout: Writable;
|
|
986
|
+
/**
|
|
987
|
+
* The error stream of the CLI.
|
|
988
|
+
*
|
|
989
|
+
* @default
|
|
990
|
+
* process.stderr
|
|
991
|
+
*/
|
|
992
|
+
stderr: Writable;
|
|
993
|
+
/**
|
|
994
|
+
* Whether colors should be enabled.
|
|
995
|
+
*/
|
|
996
|
+
colorDepth: number;
|
|
997
|
+
};
|
|
998
|
+
declare type CliOptions = Readonly<{
|
|
999
|
+
/**
|
|
1000
|
+
* The label of the binary.
|
|
1001
|
+
*
|
|
1002
|
+
* Shown at the top of the usage information.
|
|
1003
|
+
*/
|
|
1004
|
+
binaryLabel?: string;
|
|
1005
|
+
/**
|
|
1006
|
+
* The name of the binary.
|
|
1007
|
+
*
|
|
1008
|
+
* Included in the path and the examples of the definitions.
|
|
1009
|
+
*/
|
|
1010
|
+
binaryName: string;
|
|
1011
|
+
/**
|
|
1012
|
+
* The version of the binary.
|
|
1013
|
+
*
|
|
1014
|
+
* Shown at the top of the usage information.
|
|
1015
|
+
*/
|
|
1016
|
+
binaryVersion?: string;
|
|
1017
|
+
/**
|
|
1018
|
+
* If `true`, the Cli will hook into the process standard streams to catch
|
|
1019
|
+
* the output produced by console.log and redirect them into the context
|
|
1020
|
+
* streams. Note: stdin isn't captured at the moment.
|
|
1021
|
+
*
|
|
1022
|
+
* @default
|
|
1023
|
+
* false
|
|
1024
|
+
*/
|
|
1025
|
+
enableCapture: boolean;
|
|
1026
|
+
/**
|
|
1027
|
+
* If `true`, the Cli will use colors in the output. If `false`, it won't.
|
|
1028
|
+
* If `undefined`, Clipanion will infer the correct value from the env.
|
|
1029
|
+
*/
|
|
1030
|
+
enableColors?: boolean;
|
|
1031
|
+
}>;
|
|
1032
|
+
declare type MiniCli<Context extends BaseContext> = CliOptions & {
|
|
1033
|
+
/**
|
|
1034
|
+
* Returns an Array representing the definitions of all registered commands.
|
|
1035
|
+
*/
|
|
1036
|
+
definitions(): Array<Definition>;
|
|
1037
|
+
/**
|
|
1038
|
+
* Formats errors using colors.
|
|
1039
|
+
*
|
|
1040
|
+
* @param error The error to format. If `error.name` is `'Error'`, it is replaced with `'Internal Error'`.
|
|
1041
|
+
* @param opts.command The command whose usage will be included in the formatted error.
|
|
1042
|
+
*/
|
|
1043
|
+
error(error: Error, opts?: {
|
|
1044
|
+
command?: Command<Context> | null;
|
|
1045
|
+
}): string;
|
|
1046
|
+
/**
|
|
1047
|
+
* Returns a rich color format if colors are enabled, or a plain text format otherwise.
|
|
1048
|
+
*
|
|
1049
|
+
* @param colored Forcefully enable or disable colors.
|
|
1050
|
+
*/
|
|
1051
|
+
format(colored?: boolean): ColorFormat;
|
|
1052
|
+
/**
|
|
1053
|
+
* Compiles a command and its arguments using the `CommandBuilder`.
|
|
1054
|
+
*
|
|
1055
|
+
* @param input An array containing the name of the command and its arguments
|
|
1056
|
+
*
|
|
1057
|
+
* @returns The compiled `Command`, with its properties populated with the arguments.
|
|
1058
|
+
*/
|
|
1059
|
+
process(input: Array<string>, context?: Partial<Context>): Command<Context>;
|
|
1060
|
+
/**
|
|
1061
|
+
* Runs a command.
|
|
1062
|
+
*
|
|
1063
|
+
* @param input An array containing the name of the command and its arguments
|
|
1064
|
+
* @param context Overrides the Context of the main `Cli` instance
|
|
1065
|
+
*
|
|
1066
|
+
* @returns The exit code of the command
|
|
1067
|
+
*/
|
|
1068
|
+
run(input: Array<string>, context?: Partial<Context>): Promise<number>;
|
|
1069
|
+
/**
|
|
1070
|
+
* Returns the usage of a command.
|
|
1071
|
+
*
|
|
1072
|
+
* @param command The `Command` whose usage will be returned or `null` to return the usage of all commands.
|
|
1073
|
+
* @param opts.detailed If `true`, the usage of a command will also include its description, details, and examples. Doesn't have any effect if `command` is `null` or doesn't have a `usage` property.
|
|
1074
|
+
* @param opts.prefix The prefix displayed before each command. Defaults to `$`.
|
|
1075
|
+
*/
|
|
1076
|
+
usage(command?: CommandClass<Context> | Command<Context> | null, opts?: {
|
|
1077
|
+
detailed?: boolean;
|
|
1078
|
+
prefix?: string;
|
|
1079
|
+
}): string;
|
|
1080
|
+
};
|
|
1081
|
+
//#endregion
|
|
1082
|
+
//#region ../../node_modules/clipanion/lib/advanced/Command.d.ts
|
|
1083
|
+
/**
|
|
1084
|
+
* The usage of a Command.
|
|
1085
|
+
*/
|
|
1086
|
+
declare type Usage = {
|
|
1087
|
+
/**
|
|
1088
|
+
* The category of the command.
|
|
1089
|
+
*
|
|
1090
|
+
* Included in the detailed usage.
|
|
1091
|
+
*/
|
|
1092
|
+
category?: string;
|
|
1093
|
+
/**
|
|
1094
|
+
* The short description of the command, formatted as Markdown.
|
|
1095
|
+
*
|
|
1096
|
+
* Included in the detailed usage.
|
|
1097
|
+
*/
|
|
1098
|
+
description?: string;
|
|
1099
|
+
/**
|
|
1100
|
+
* The extended details of the command, formatted as Markdown.
|
|
1101
|
+
*
|
|
1102
|
+
* Included in the detailed usage.
|
|
1103
|
+
*/
|
|
1104
|
+
details?: string;
|
|
1105
|
+
/**
|
|
1106
|
+
* Examples of the command represented as an Array of tuples.
|
|
1107
|
+
*
|
|
1108
|
+
* The first element of the tuple represents the description of the example.
|
|
1109
|
+
*
|
|
1110
|
+
* The second element of the tuple represents the command of the example.
|
|
1111
|
+
* If present, the leading `$0` is replaced with `cli.binaryName`.
|
|
1112
|
+
*/
|
|
1113
|
+
examples?: Array<[string, string]>;
|
|
1114
|
+
};
|
|
1115
|
+
/**
|
|
1116
|
+
* The definition of a Command.
|
|
1117
|
+
*/
|
|
1118
|
+
declare type Definition = Usage & {
|
|
1119
|
+
/**
|
|
1120
|
+
* The path of the command, starting with `cli.binaryName`.
|
|
1121
|
+
*/
|
|
1122
|
+
path: string;
|
|
1123
|
+
/**
|
|
1124
|
+
* The detailed usage of the command.
|
|
1125
|
+
*/
|
|
1126
|
+
usage: string;
|
|
1127
|
+
/**
|
|
1128
|
+
* The various options registered on the command.
|
|
1129
|
+
*/
|
|
1130
|
+
options: Array<{
|
|
1131
|
+
definition: string;
|
|
1132
|
+
description?: string;
|
|
1133
|
+
required: boolean;
|
|
1134
|
+
}>;
|
|
1135
|
+
};
|
|
1136
|
+
declare type CommandClass<Context extends BaseContext = BaseContext> = {
|
|
1137
|
+
new (): Command<Context>;
|
|
1138
|
+
paths?: Array<Array<string>>;
|
|
1139
|
+
schema?: Array<LooseTest<{
|
|
1140
|
+
[key: string]: unknown;
|
|
1141
|
+
}>>;
|
|
1142
|
+
usage?: Usage;
|
|
1143
|
+
};
|
|
1144
|
+
/**
|
|
1145
|
+
* Base abstract class for CLI commands. The main thing to remember is to
|
|
1146
|
+
* declare an async `execute` member function that will be called when the
|
|
1147
|
+
* command is invoked from the CLI, and optionally a `paths` property to
|
|
1148
|
+
* declare the set of paths under which the command should be exposed.
|
|
1149
|
+
*/
|
|
1150
|
+
declare abstract class Command<Context extends BaseContext = BaseContext> {
|
|
1151
|
+
/**
|
|
1152
|
+
* @deprecated Do not use this; prefer the static `paths` property instead.
|
|
1153
|
+
*/
|
|
1154
|
+
paths?: undefined;
|
|
1155
|
+
/**
|
|
1156
|
+
* Defined to prevent a common typo.
|
|
1157
|
+
*/
|
|
1158
|
+
static path: never;
|
|
1159
|
+
/**
|
|
1160
|
+
* Paths under which the command should be exposed.
|
|
1161
|
+
*/
|
|
1162
|
+
static paths?: Array<Array<string>>;
|
|
1163
|
+
/**
|
|
1164
|
+
* Defines the usage information for the given command.
|
|
1165
|
+
*/
|
|
1166
|
+
static Usage(usage: Usage): Usage;
|
|
1167
|
+
/**
|
|
1168
|
+
* Contains the usage information for the command. If undefined, the
|
|
1169
|
+
* command will be hidden from the general listing.
|
|
1170
|
+
*/
|
|
1171
|
+
static usage?: Usage;
|
|
1172
|
+
/**
|
|
1173
|
+
* Defines a schema to apply before running the `execute` method. The
|
|
1174
|
+
* schema is expected to be generated by Typanion.
|
|
1175
|
+
*
|
|
1176
|
+
* @see https://github.com/arcanis/typanion
|
|
1177
|
+
*/
|
|
1178
|
+
static schema?: Array<LooseTest<{
|
|
1179
|
+
[key: string]: unknown;
|
|
1180
|
+
}>>;
|
|
1181
|
+
/**
|
|
1182
|
+
* Standard function that'll get executed by `Cli#run` and `Cli#runExit`.
|
|
1183
|
+
*
|
|
1184
|
+
* Expected to return an exit code or nothing (which Clipanion will treat
|
|
1185
|
+
* as if 0 had been returned).
|
|
1186
|
+
*/
|
|
1187
|
+
abstract execute(): Promise<number | void>;
|
|
1188
|
+
/**
|
|
1189
|
+
* Standard error handler which will simply rethrow the error. Can be used
|
|
1190
|
+
* to add custom logic to handle errors from the command or simply return
|
|
1191
|
+
* the parent class error handling.
|
|
1192
|
+
*/
|
|
1193
|
+
catch(error: any): Promise<void>;
|
|
1194
|
+
/**
|
|
1195
|
+
* Predefined that will be set to true if `-h,--help` has been used, in
|
|
1196
|
+
* which case `Command#execute` won't be called.
|
|
1197
|
+
*/
|
|
1198
|
+
help: boolean;
|
|
1199
|
+
/**
|
|
1200
|
+
* Predefined variable that will be populated with a miniature API that can
|
|
1201
|
+
* be used to query Clipanion and forward commands.
|
|
1202
|
+
*/
|
|
1203
|
+
cli: MiniCli<Context>;
|
|
1204
|
+
/**
|
|
1205
|
+
* Predefined variable that will be populated with the context of the
|
|
1206
|
+
* application.
|
|
1207
|
+
*/
|
|
1208
|
+
context: Context;
|
|
1209
|
+
/**
|
|
1210
|
+
* Predefined variable that will be populated with the path that got used
|
|
1211
|
+
* to access the command currently being executed.
|
|
1212
|
+
*/
|
|
1213
|
+
path: Array<string>;
|
|
1214
|
+
validateAndExecute(): Promise<number>;
|
|
1215
|
+
/**
|
|
1216
|
+
* Used to detect option definitions.
|
|
1217
|
+
*/
|
|
1218
|
+
static isOption: typeof isOptionSymbol;
|
|
1219
|
+
/**
|
|
1220
|
+
* Just an helper to use along with the `paths` fields, to make it
|
|
1221
|
+
* clearer that a command is the default one.
|
|
1222
|
+
*
|
|
1223
|
+
* @example
|
|
1224
|
+
* class MyCommand extends Command {
|
|
1225
|
+
* static paths = [Command.Default];
|
|
1226
|
+
* }
|
|
1227
|
+
*/
|
|
1228
|
+
static Default: never[];
|
|
1229
|
+
}
|
|
1230
|
+
//#endregion
|
|
1231
|
+
//#region ../base/dist/helpers/interfaces.d.ts
|
|
1232
|
+
interface Metadata {
|
|
1233
|
+
ci: {
|
|
1234
|
+
job: {
|
|
1235
|
+
id?: string;
|
|
1236
|
+
name?: string;
|
|
1237
|
+
url?: string;
|
|
1238
|
+
};
|
|
1239
|
+
pipeline: {
|
|
1240
|
+
id?: string;
|
|
1241
|
+
name?: string;
|
|
1242
|
+
number?: number;
|
|
1243
|
+
url?: string;
|
|
1244
|
+
};
|
|
1245
|
+
provider: {
|
|
1246
|
+
name?: string;
|
|
1247
|
+
};
|
|
1248
|
+
stage: {
|
|
1249
|
+
name?: string;
|
|
1250
|
+
};
|
|
1251
|
+
workspace_path?: string;
|
|
1252
|
+
};
|
|
1253
|
+
git: {
|
|
1254
|
+
branch?: string;
|
|
1255
|
+
commit: {
|
|
1256
|
+
author: {
|
|
1257
|
+
date?: string;
|
|
1258
|
+
email?: string;
|
|
1259
|
+
name?: string;
|
|
1260
|
+
};
|
|
1261
|
+
committer: {
|
|
1262
|
+
date?: string;
|
|
1263
|
+
email?: string;
|
|
1264
|
+
name?: string;
|
|
1265
|
+
};
|
|
1266
|
+
message?: string;
|
|
1267
|
+
sha?: string;
|
|
1268
|
+
};
|
|
1269
|
+
repository_url?: string;
|
|
1270
|
+
tag?: string;
|
|
1271
|
+
};
|
|
1272
|
+
}
|
|
1273
|
+
//#endregion
|
|
1274
|
+
//#region ../base/dist/helpers/utils.d.ts
|
|
1275
|
+
type ProxyType = 'http' | 'https' | 'socks' | 'socks4' | 'socks4a' | 'socks5' | 'socks5h' | 'pac+data' | 'pac+file' | 'pac+ftp' | 'pac+http' | 'pac+https';
|
|
1276
|
+
interface ProxyConfiguration {
|
|
1277
|
+
auth?: {
|
|
1278
|
+
password: string;
|
|
1279
|
+
username: string;
|
|
1280
|
+
};
|
|
1281
|
+
host?: string;
|
|
1282
|
+
port?: number;
|
|
1283
|
+
protocol: ProxyType;
|
|
1284
|
+
}
|
|
1285
|
+
//#endregion
|
|
1286
|
+
//#region src/interfaces.d.ts
|
|
1287
|
+
type SupportedReporter = 'junit' | 'default';
|
|
1288
|
+
interface MainReporter {
|
|
1289
|
+
log(log: string): void;
|
|
1290
|
+
error(error: string): void;
|
|
1291
|
+
initErrors(errors: string[]): void;
|
|
1292
|
+
testTrigger(test: Test, testId: string, executionRule: ExecutionRule, testOverrides: UserConfigOverride): void;
|
|
1293
|
+
testWait(test: Test): void;
|
|
1294
|
+
testsWait(tests: Test[], baseUrl: string, batchId: string, skippedCount?: number): void;
|
|
1295
|
+
resultReceived(result: ResultInBatch): void;
|
|
1296
|
+
resultEnd(result: Result, baseUrl: string, batchId: string): void;
|
|
1297
|
+
reportStart(timings: {
|
|
1298
|
+
startTime: number;
|
|
1299
|
+
}): void;
|
|
1300
|
+
runEnd(summary: Summary, baseUrl: string, orgSettings?: SyntheticsOrgSettings): void;
|
|
1301
|
+
dryRunEnd(summary: InitialSummary, testPlan: TestPlan, config: RunTestsCommandConfig, orgSettings?: SyntheticsOrgSettings): void;
|
|
1302
|
+
}
|
|
1303
|
+
interface ReporterContext {
|
|
1304
|
+
stdout: Writable;
|
|
1305
|
+
stderr: Writable;
|
|
1306
|
+
}
|
|
1307
|
+
type Reporter = Partial<MainReporter>;
|
|
1308
|
+
interface BaseServerResult {
|
|
1309
|
+
id: string;
|
|
1310
|
+
status: 'passed' | 'failed' | 'skipped';
|
|
1311
|
+
failure?: {
|
|
1312
|
+
code: string;
|
|
1313
|
+
message: string;
|
|
1314
|
+
};
|
|
1315
|
+
unhealthy?: boolean;
|
|
1316
|
+
finished_at: number;
|
|
1317
|
+
}
|
|
1318
|
+
interface Device {
|
|
1319
|
+
id: string;
|
|
1320
|
+
resolution: {
|
|
1321
|
+
width: number;
|
|
1322
|
+
height: number;
|
|
1323
|
+
};
|
|
1324
|
+
}
|
|
1325
|
+
interface BrowserServerResult extends BaseServerResult {
|
|
1326
|
+
duration: number;
|
|
1327
|
+
start_url: string;
|
|
1328
|
+
steps: Step[];
|
|
1329
|
+
}
|
|
1330
|
+
interface AssertionResult {
|
|
1331
|
+
actual: any;
|
|
1332
|
+
expected?: any;
|
|
1333
|
+
valid: boolean;
|
|
1334
|
+
}
|
|
1335
|
+
interface ApiServerResult extends BaseServerResult {
|
|
1336
|
+
assertions: AssertionResult[];
|
|
1337
|
+
timings: {
|
|
1338
|
+
total: number;
|
|
1339
|
+
};
|
|
1340
|
+
}
|
|
1341
|
+
interface MultiStep {
|
|
1342
|
+
allow_failure: boolean;
|
|
1343
|
+
assertion_results: AssertionResult[];
|
|
1344
|
+
failure?: {
|
|
1345
|
+
code: string;
|
|
1346
|
+
message: string;
|
|
1347
|
+
};
|
|
1348
|
+
name: string;
|
|
1349
|
+
status: 'passed' | 'failed' | 'skipped';
|
|
1350
|
+
subtype: string;
|
|
1351
|
+
timings: {
|
|
1352
|
+
total: number;
|
|
1353
|
+
};
|
|
1354
|
+
}
|
|
1355
|
+
interface MultiStepsServerResult extends BaseServerResult {
|
|
1356
|
+
duration: number;
|
|
1357
|
+
steps: MultiStep[];
|
|
1358
|
+
}
|
|
1359
|
+
type ServerResult = BrowserServerResult | ApiServerResult | MultiStepsServerResult;
|
|
1360
|
+
interface RawPollResult {
|
|
1361
|
+
data: {
|
|
1362
|
+
id: string;
|
|
1363
|
+
type: string;
|
|
1364
|
+
attributes: Omit<PollResult, 'test'>;
|
|
1365
|
+
relationships: {
|
|
1366
|
+
test: {
|
|
1367
|
+
data: {
|
|
1368
|
+
id: string;
|
|
1369
|
+
type: string;
|
|
1370
|
+
};
|
|
1371
|
+
};
|
|
1372
|
+
};
|
|
1373
|
+
}[];
|
|
1374
|
+
included: {
|
|
1375
|
+
type: string;
|
|
1376
|
+
id: string;
|
|
1377
|
+
attributes: Pick<RawPollResultTest, 'type' | 'subtype' | 'config'>;
|
|
1378
|
+
}[];
|
|
1379
|
+
}
|
|
1380
|
+
interface RawPollResultTest {
|
|
1381
|
+
id: string;
|
|
1382
|
+
type: 'browser' | 'api' | 'mobile';
|
|
1383
|
+
subtype?: string;
|
|
1384
|
+
config: {
|
|
1385
|
+
request?: {
|
|
1386
|
+
dns_server?: string | undefined;
|
|
1387
|
+
};
|
|
1388
|
+
};
|
|
1389
|
+
}
|
|
1390
|
+
type PollResult = {
|
|
1391
|
+
test_type: 'api' | 'browser' | 'mobile';
|
|
1392
|
+
test: RecursivePartial<Test>;
|
|
1393
|
+
result?: ServerResult;
|
|
1394
|
+
resultID: string;
|
|
1395
|
+
device?: Device;
|
|
1396
|
+
};
|
|
1397
|
+
/**
|
|
1398
|
+
* Information required to convert a `PollResult` to a `Result`.
|
|
1399
|
+
*/
|
|
1400
|
+
type ResultDisplayInfo = {
|
|
1401
|
+
getLocation: (datacenterId: string, test: Test) => string;
|
|
1402
|
+
options: {
|
|
1403
|
+
batchTimeout: number;
|
|
1404
|
+
datadogSite: string;
|
|
1405
|
+
failOnCriticalErrors?: boolean;
|
|
1406
|
+
failOnTimeout?: boolean;
|
|
1407
|
+
subdomain: string;
|
|
1408
|
+
};
|
|
1409
|
+
tests: Test[];
|
|
1410
|
+
};
|
|
1411
|
+
type SelectiveRerunDecision = {
|
|
1412
|
+
decision: 'run';
|
|
1413
|
+
reason: 'in_progress';
|
|
1414
|
+
} | {
|
|
1415
|
+
decision: 'run';
|
|
1416
|
+
reason: 'failed';
|
|
1417
|
+
linked_result_id: string;
|
|
1418
|
+
} | {
|
|
1419
|
+
decision: 'run';
|
|
1420
|
+
reason: 'edited';
|
|
1421
|
+
} | {
|
|
1422
|
+
decision: 'run';
|
|
1423
|
+
reason: 'new';
|
|
1424
|
+
} | {
|
|
1425
|
+
decision: 'skip';
|
|
1426
|
+
reason: 'passed';
|
|
1427
|
+
linked_result_id: string;
|
|
1428
|
+
};
|
|
1429
|
+
interface Summary {
|
|
1430
|
+
/** The ID of the CI batch that was started by this datadog-ci execution. */
|
|
1431
|
+
batchId: string;
|
|
1432
|
+
/** The number of critical errors that occurred during the CI batch. */
|
|
1433
|
+
criticalErrors: number;
|
|
1434
|
+
/** The number of results expected by datadog-ci, prior to any selective rerun. */
|
|
1435
|
+
expected: number;
|
|
1436
|
+
/** The number of results that failed during the CI batch. */
|
|
1437
|
+
failed: number;
|
|
1438
|
+
/** The number of results that failed during the CI batch without blocking the CI. */
|
|
1439
|
+
failedNonBlocking: number;
|
|
1440
|
+
/** The metadata collected for the CI batch. */
|
|
1441
|
+
metadata?: Metadata;
|
|
1442
|
+
/** The number of results that passed during the CI batch. */
|
|
1443
|
+
passed: number;
|
|
1444
|
+
/** The number of results that already passed in previous CI batches on the same commit. */
|
|
1445
|
+
previouslyPassed: number;
|
|
1446
|
+
/** The number of tests that were skipped when starting the CI batch. */
|
|
1447
|
+
skipped: number;
|
|
1448
|
+
/** The public IDs of tests that could not be accessed due to permissions when starting the CI batch. */
|
|
1449
|
+
testsNotAuthorized: Set<string>;
|
|
1450
|
+
/** The public IDs of tests that could not be found when starting the CI batch. */
|
|
1451
|
+
testsNotFound: Set<string>;
|
|
1452
|
+
/** The number of results that failed due to the CI batch timing out. */
|
|
1453
|
+
timedOut: number;
|
|
1454
|
+
}
|
|
1455
|
+
interface TestPlanItem {
|
|
1456
|
+
/** The execution rule to apply to the test. This is read-only and only here for filtering purposes. To apply overrides, you may edit the `testOverrides`. */
|
|
1457
|
+
executionRule: Readonly<ExecutionRule>;
|
|
1458
|
+
/** The definition of the test to run. This is read-only and only here for filtering purposes. To apply overrides, you may edit the `testOverrides`. */
|
|
1459
|
+
test: Readonly<Test>;
|
|
1460
|
+
/** The overrides to apply to the test. You can edit this to alter the test plan. */
|
|
1461
|
+
testOverrides: TestPayload;
|
|
1462
|
+
}
|
|
1463
|
+
type TestPlan = TestPlanItem[];
|
|
1464
|
+
interface BaseResult {
|
|
1465
|
+
/** The device used in this test run. */
|
|
1466
|
+
device?: Device;
|
|
1467
|
+
/** Duration of this test run in milliseconds. */
|
|
1468
|
+
duration: number;
|
|
1469
|
+
/** The execution rule that was used for this test run. */
|
|
1470
|
+
executionRule: ExecutionRule;
|
|
1471
|
+
/** The ID of the initial attempt if this test run is a retry. */
|
|
1472
|
+
initialResultId?: string;
|
|
1473
|
+
/** Whether this test run is intermediary and expected to be retried. */
|
|
1474
|
+
isNonFinal?: boolean;
|
|
1475
|
+
/** The location from which this test run was executed. */
|
|
1476
|
+
location: string;
|
|
1477
|
+
/** Whether this test run passed, taking into account `failOnCriticalErrors` and `failOnTimeout`. */
|
|
1478
|
+
passed: boolean;
|
|
1479
|
+
/** Raw information about the test run. May not always be present. */
|
|
1480
|
+
result?: ServerResult;
|
|
1481
|
+
/** The ID of this test run. */
|
|
1482
|
+
resultId: string;
|
|
1483
|
+
/** The number of retries, including this test run. */
|
|
1484
|
+
retries: number;
|
|
1485
|
+
/** The maximum number of retries for this test run. */
|
|
1486
|
+
maxRetries: number;
|
|
1487
|
+
/** Information about the selective rerun that was applied to this test run. */
|
|
1488
|
+
selectiveRerun?: SelectiveRerunDecision;
|
|
1489
|
+
/** The test that was run, including any overrides. */
|
|
1490
|
+
test: Test;
|
|
1491
|
+
/** Whether this test run timed out. */
|
|
1492
|
+
timedOut: boolean;
|
|
1493
|
+
/** The timestamp of this test run. */
|
|
1494
|
+
timestamp: number;
|
|
1495
|
+
}
|
|
1496
|
+
type ResultSkippedBySelectiveRerun = Omit<BaseResult, 'duration' | 'location' | 'result' | 'retries' | 'maxRetries' | 'timestamp'> & {
|
|
1497
|
+
executionRule: ExecutionRule.SKIPPED;
|
|
1498
|
+
selectiveRerun: Extract<SelectiveRerunDecision, {
|
|
1499
|
+
decision: 'skip';
|
|
1500
|
+
}>;
|
|
1501
|
+
};
|
|
1502
|
+
type Result = BaseResult | ResultSkippedBySelectiveRerun;
|
|
1503
|
+
type Status = 'passed' | 'failed' | 'in_progress' | 'skipped';
|
|
1504
|
+
type BatchStatus = 'passed' | 'failed' | 'in_progress';
|
|
1505
|
+
interface BaseResultInBatch {
|
|
1506
|
+
duration: number;
|
|
1507
|
+
execution_rule: ExecutionRule;
|
|
1508
|
+
initial_result_id?: string;
|
|
1509
|
+
location: string;
|
|
1510
|
+
result_id: string;
|
|
1511
|
+
retries: number | null;
|
|
1512
|
+
max_retries: number | null;
|
|
1513
|
+
selective_rerun?: SelectiveRerunDecision;
|
|
1514
|
+
status: Status;
|
|
1515
|
+
test_public_id: string;
|
|
1516
|
+
timed_out: boolean | null;
|
|
1517
|
+
}
|
|
1518
|
+
type SkippedResultInBatch = Omit<BaseResultInBatch, 'duration' | 'location' | 'result_id'> & {
|
|
1519
|
+
execution_rule: ExecutionRule.SKIPPED;
|
|
1520
|
+
status: 'skipped';
|
|
1521
|
+
};
|
|
1522
|
+
type ResultInBatchSkippedBySelectiveRerun = SkippedResultInBatch & {
|
|
1523
|
+
selective_rerun: Extract<SelectiveRerunDecision, {
|
|
1524
|
+
decision: 'skip';
|
|
1525
|
+
}>;
|
|
1526
|
+
};
|
|
1527
|
+
type ResultInBatch = BaseResultInBatch | ResultInBatchSkippedBySelectiveRerun;
|
|
1528
|
+
interface Batch {
|
|
1529
|
+
results: ResultInBatch[];
|
|
1530
|
+
status: BatchStatus;
|
|
1531
|
+
}
|
|
1532
|
+
type ServerResultInBatch = BaseResultInBatch | SkippedResultInBatch;
|
|
1533
|
+
interface ServerBatch {
|
|
1534
|
+
results: ServerResultInBatch[];
|
|
1535
|
+
status: BatchStatus;
|
|
1536
|
+
}
|
|
1537
|
+
interface Vitals {
|
|
1538
|
+
cls?: number;
|
|
1539
|
+
lcp?: number;
|
|
1540
|
+
url: string;
|
|
1541
|
+
}
|
|
1542
|
+
interface BrowserError {
|
|
1543
|
+
description: string;
|
|
1544
|
+
name: string;
|
|
1545
|
+
type: string;
|
|
1546
|
+
}
|
|
1547
|
+
interface Step {
|
|
1548
|
+
allow_failure: boolean;
|
|
1549
|
+
browser_errors: BrowserError[];
|
|
1550
|
+
description: string;
|
|
1551
|
+
duration: number;
|
|
1552
|
+
failure?: {
|
|
1553
|
+
code?: string;
|
|
1554
|
+
message: string;
|
|
1555
|
+
};
|
|
1556
|
+
public_id?: string;
|
|
1557
|
+
status: string;
|
|
1558
|
+
id?: number;
|
|
1559
|
+
element_updates?: {
|
|
1560
|
+
multi_locator?: MultiLocator;
|
|
1561
|
+
};
|
|
1562
|
+
sub_test_public_id?: string;
|
|
1563
|
+
sub_test_step_details?: Step[];
|
|
1564
|
+
type: string;
|
|
1565
|
+
url: string;
|
|
1566
|
+
value?: string | number;
|
|
1567
|
+
vitals_metrics: Vitals[];
|
|
1568
|
+
warnings?: {
|
|
1569
|
+
message: string;
|
|
1570
|
+
type: string;
|
|
1571
|
+
}[];
|
|
1572
|
+
}
|
|
1573
|
+
interface MultiLocator {
|
|
1574
|
+
[key: string]: unknown;
|
|
1575
|
+
}
|
|
1576
|
+
interface TestStepWithUnsupportedFields {
|
|
1577
|
+
public_id?: string;
|
|
1578
|
+
params: {
|
|
1579
|
+
element?: {
|
|
1580
|
+
multiLocator?: MultiLocator;
|
|
1581
|
+
userLocator?: unknown;
|
|
1582
|
+
};
|
|
1583
|
+
};
|
|
1584
|
+
}
|
|
1585
|
+
interface TestRequest {
|
|
1586
|
+
dnsServer?: string;
|
|
1587
|
+
dnsServerPort?: number;
|
|
1588
|
+
headers: {
|
|
1589
|
+
[key: string]: string;
|
|
1590
|
+
};
|
|
1591
|
+
host?: string;
|
|
1592
|
+
method: string;
|
|
1593
|
+
port?: number;
|
|
1594
|
+
timeout: number;
|
|
1595
|
+
url: string;
|
|
1596
|
+
}
|
|
1597
|
+
interface LocalTestDefinition {
|
|
1598
|
+
config: {
|
|
1599
|
+
assertions: Assertion[];
|
|
1600
|
+
request?: TestRequest;
|
|
1601
|
+
steps?: {
|
|
1602
|
+
subtype: string;
|
|
1603
|
+
}[];
|
|
1604
|
+
variables: string[];
|
|
1605
|
+
};
|
|
1606
|
+
locations: string[];
|
|
1607
|
+
name: string;
|
|
1608
|
+
options: OptionsWithUnsupportedFields;
|
|
1609
|
+
/** Can be used to link to an existing remote test. */
|
|
1610
|
+
public_id?: string;
|
|
1611
|
+
subtype?: string;
|
|
1612
|
+
steps?: TestStepWithUnsupportedFields[];
|
|
1613
|
+
type: 'api' | 'browser' | 'mobile';
|
|
1614
|
+
}
|
|
1615
|
+
interface Options$1 {
|
|
1616
|
+
ci?: {
|
|
1617
|
+
executionRule: ExecutionRule;
|
|
1618
|
+
};
|
|
1619
|
+
device_ids?: string[];
|
|
1620
|
+
mobileApplication?: MobileApplication;
|
|
1621
|
+
retry?: {
|
|
1622
|
+
count?: number;
|
|
1623
|
+
};
|
|
1624
|
+
}
|
|
1625
|
+
interface OptionsWithUnsupportedFields extends Options$1 {
|
|
1626
|
+
bindings?: null | unknown[];
|
|
1627
|
+
min_failure_duration?: number;
|
|
1628
|
+
min_location_failed?: any;
|
|
1629
|
+
monitor_name?: string;
|
|
1630
|
+
monitor_options?: any;
|
|
1631
|
+
monitor_priority?: number;
|
|
1632
|
+
tick_every?: number;
|
|
1633
|
+
}
|
|
1634
|
+
interface LocalTestDefinitionWithUnsupportedFields extends LocalTestDefinition {
|
|
1635
|
+
created_at?: any;
|
|
1636
|
+
created_by?: any;
|
|
1637
|
+
creator?: any;
|
|
1638
|
+
creation_source?: string;
|
|
1639
|
+
message?: string;
|
|
1640
|
+
modified_at?: any;
|
|
1641
|
+
modified_by?: any;
|
|
1642
|
+
monitor_id?: number;
|
|
1643
|
+
overall_state?: any;
|
|
1644
|
+
overall_state_modified?: any;
|
|
1645
|
+
status?: string;
|
|
1646
|
+
stepCount?: any;
|
|
1647
|
+
tags?: string[];
|
|
1648
|
+
version?: any;
|
|
1649
|
+
version_uuid?: any;
|
|
1650
|
+
}
|
|
1651
|
+
interface ServerTest extends LocalTestDefinitionWithUnsupportedFields {
|
|
1652
|
+
monitor_id: number;
|
|
1653
|
+
status: 'live' | 'paused';
|
|
1654
|
+
public_id: string;
|
|
1655
|
+
}
|
|
1656
|
+
type Test = (ServerTest | LocalTestDefinitionWithUnsupportedFields) & {
|
|
1657
|
+
suite?: string;
|
|
1658
|
+
};
|
|
1659
|
+
interface Assertion {
|
|
1660
|
+
actual: string | number | Date | {
|
|
1661
|
+
[key: string]: any;
|
|
1662
|
+
};
|
|
1663
|
+
errorMessage?: string;
|
|
1664
|
+
operator: Operator;
|
|
1665
|
+
property?: string;
|
|
1666
|
+
target: string | number | Date | {
|
|
1667
|
+
[key: string]: any;
|
|
1668
|
+
};
|
|
1669
|
+
type: string;
|
|
1670
|
+
valid: boolean;
|
|
1671
|
+
}
|
|
1672
|
+
declare enum Operator {
|
|
1673
|
+
contains = "contains",
|
|
1674
|
+
doesNotContain = "doesNotContain",
|
|
1675
|
+
is = "is",
|
|
1676
|
+
isNot = "isNot",
|
|
1677
|
+
isInLessThan = "isInLessThan",
|
|
1678
|
+
isInMoreThan = "isInMoreThan",
|
|
1679
|
+
lessThan = "lessThan",
|
|
1680
|
+
lessThanOrEqual = "lessThanOrEqual",
|
|
1681
|
+
moreThan = "moreThan",
|
|
1682
|
+
moreThanOrEqual = "moreThanOrEqual",
|
|
1683
|
+
matches = "matches",
|
|
1684
|
+
doesNotMatch = "doesNotMatch",
|
|
1685
|
+
validatesJSONPath = "validatesJSONPath",
|
|
1686
|
+
validatesXPath = "validatesXPath"
|
|
1687
|
+
}
|
|
1688
|
+
interface Location {
|
|
1689
|
+
display_name: string;
|
|
1690
|
+
id: number;
|
|
1691
|
+
is_active: boolean;
|
|
1692
|
+
name: string;
|
|
1693
|
+
region: string;
|
|
1694
|
+
}
|
|
1695
|
+
interface LocationsMapping {
|
|
1696
|
+
[key: string]: string;
|
|
1697
|
+
}
|
|
1698
|
+
interface ServerTrigger {
|
|
1699
|
+
batch_id: string;
|
|
1700
|
+
locations: Location[];
|
|
1701
|
+
selective_rerun_rate_limited?: boolean;
|
|
1702
|
+
}
|
|
1703
|
+
interface TriggerInfo {
|
|
1704
|
+
batchId: string;
|
|
1705
|
+
locations: Location[];
|
|
1706
|
+
selectiveRerunRateLimited?: boolean;
|
|
1707
|
+
testsNotAuthorized: Set<string>;
|
|
1708
|
+
}
|
|
1709
|
+
interface RetryConfig {
|
|
1710
|
+
/** The number of attempts to perform in case of test failure. */
|
|
1711
|
+
count: number;
|
|
1712
|
+
/** The interval between attempts in milliseconds. */
|
|
1713
|
+
interval: number;
|
|
1714
|
+
}
|
|
1715
|
+
interface MobileApplication {
|
|
1716
|
+
applicationId: string;
|
|
1717
|
+
referenceId: string;
|
|
1718
|
+
referenceType: 'latest' | 'version' | 'temporary';
|
|
1719
|
+
}
|
|
1720
|
+
interface CookiesObject {
|
|
1721
|
+
/** Whether to append or replace the original cookies. */
|
|
1722
|
+
append?: boolean;
|
|
1723
|
+
/** Cookie header to add or replace (e.g. `name1=value1;name2=value2;`). */
|
|
1724
|
+
value: string;
|
|
1725
|
+
}
|
|
1726
|
+
interface BaseConfigOverride {
|
|
1727
|
+
/** Override the certificate checks in Synthetic API and Browser tests. */
|
|
1728
|
+
allowInsecureCertificates?: boolean;
|
|
1729
|
+
/** Override the credentials for basic authentication. */
|
|
1730
|
+
basicAuth?: BasicAuthCredentials;
|
|
1731
|
+
/** Override the data to send in API tests. */
|
|
1732
|
+
body?: string;
|
|
1733
|
+
/** Override the content type for the data to send in API tests. */
|
|
1734
|
+
bodyType?: string;
|
|
1735
|
+
/**
|
|
1736
|
+
* Override the cookies for API and browser tests.
|
|
1737
|
+
* - If this is a string, it is used to replace the original cookies.
|
|
1738
|
+
* - If this is an object, the format must be `{append?: boolean, value: string}`, and depending on the value of `append`, it is appended or replaces the original cookies.
|
|
1739
|
+
*/
|
|
1740
|
+
cookies?: string | CookiesObject;
|
|
1741
|
+
/**
|
|
1742
|
+
* Override the `Set-Cookie` headers in browser tests only.
|
|
1743
|
+
* - If this is a string, it is used to replace the original `Set-Cookie` headers.
|
|
1744
|
+
* - If this is an object, the format must be `{append?: boolean, value: string}`, and depending on the value of `append`, it is appended or replaces the original `Set-Cookie` headers.
|
|
1745
|
+
*/
|
|
1746
|
+
setCookies?: string | CookiesObject;
|
|
1747
|
+
/**
|
|
1748
|
+
* Override the maximum duration of steps in seconds for browser tests. This does not override individually set step timeouts.
|
|
1749
|
+
*/
|
|
1750
|
+
defaultStepTimeout?: number;
|
|
1751
|
+
/** Override the list of devices on which to run the Synthetic tests. */
|
|
1752
|
+
deviceIds?: string[];
|
|
1753
|
+
/**
|
|
1754
|
+
* Override the execution rule for Synthetic tests.
|
|
1755
|
+
*
|
|
1756
|
+
* The execution rule for the test defines the behavior of the CI batch in case of a failing test. It accepts one of the following values:
|
|
1757
|
+
*
|
|
1758
|
+
* - `blocking`: A failed test causes the CI batch to fail.
|
|
1759
|
+
* - `non_blocking`: A failed test does not cause the CI batch to fail.
|
|
1760
|
+
* - `skipped`: The test is not run at all.
|
|
1761
|
+
*/
|
|
1762
|
+
executionRule?: ExecutionRule;
|
|
1763
|
+
/** Override whether or not to follow HTTP redirections in API tests. */
|
|
1764
|
+
followRedirects?: boolean;
|
|
1765
|
+
/**
|
|
1766
|
+
* Override the headers in the API and browser tests.
|
|
1767
|
+
*
|
|
1768
|
+
* This object specifies the headers to be replaced in the test. It should have keys representing the names of the headers to be replaced, and values indicating the new header values.
|
|
1769
|
+
*/
|
|
1770
|
+
headers?: {
|
|
1771
|
+
[key: string]: string;
|
|
1772
|
+
};
|
|
1773
|
+
/** Override the list of locations to run the test from. The possible values are listed [in this API response](https://app.datadoghq.com/api/v1/synthetics/locations?only_public=true). */
|
|
1774
|
+
locations?: string[];
|
|
1775
|
+
/**
|
|
1776
|
+
* An array of regex patterns to modify resource URLs in the test. This can be useful for dynamically changing resource URLs during test execution.
|
|
1777
|
+
*
|
|
1778
|
+
* Each regex pattern should be in the format:
|
|
1779
|
+
*
|
|
1780
|
+
* - **`your_regex|your_substitution`**: The pipe-based syntax, to avoid any conflicts with / characters in URLs.
|
|
1781
|
+
* - For example, `https://example.com(.*)|http://subdomain.example.com$1` to transform `https://example.com/resource` to `http://subdomain.example.com/resource`.
|
|
1782
|
+
* - **`s/your_regex/your_substitution/modifiers`**: The slash syntax, which supports modifiers.
|
|
1783
|
+
* - For example, `s/(https://www.)(.*)/$1staging-$2/` to transform `https://www.example.com/resource` into `https://www.staging-example.com/resource`.
|
|
1784
|
+
*/
|
|
1785
|
+
resourceUrlSubstitutionRegexes?: string[];
|
|
1786
|
+
/** Override the retry policy for the test. */
|
|
1787
|
+
retry?: RetryConfig;
|
|
1788
|
+
/**
|
|
1789
|
+
* Override the start URL for API and browser tests.
|
|
1790
|
+
*
|
|
1791
|
+
* Local and [global variables](https://docs.datadoghq.com/synthetics/platform/settings/?tab=specifyvalue#global-variables) specified in the URL (for example, `{{ URL }}`) are replaced when the test is run.
|
|
1792
|
+
*
|
|
1793
|
+
* You can combine this with the `variables` override to override both the start URL and the variable values. For example:
|
|
1794
|
+
*
|
|
1795
|
+
* ```bash
|
|
1796
|
+
* --override startUrl="{{ URL }}?static_hash={{ STATIC_HASH }}" --override variables.STATIC_HASH=abcdef
|
|
1797
|
+
* ```
|
|
1798
|
+
*/
|
|
1799
|
+
startUrl?: string;
|
|
1800
|
+
/**
|
|
1801
|
+
* A regex to modify the starting URL of browser and HTTP tests, whether it comes from the original test or the `startUrl` override.
|
|
1802
|
+
*
|
|
1803
|
+
* If the URL contains variables, this regex applies after the interpolation of the variables.
|
|
1804
|
+
*
|
|
1805
|
+
* There are two possible formats:
|
|
1806
|
+
*
|
|
1807
|
+
* - **`your_regex|your_substitution`**: The pipe-based syntax, to avoid any conflicts with `/` characters in URLs.
|
|
1808
|
+
* - For example, `https://example.com(.*)|http://subdomain.example.com$1` to transform `https://example.com/test` to `http://subdomain.example.com/test`.
|
|
1809
|
+
* - **`s/your_regex/your_substitution/modifiers`**: The slash syntax, which supports modifiers.
|
|
1810
|
+
* - For example, `s/(https://www.)(.*)/$1extra-$2/` to transform `https://www.example.com` into `https://www.extra-example.com`.
|
|
1811
|
+
*/
|
|
1812
|
+
startUrlSubstitutionRegex?: string;
|
|
1813
|
+
/** Override the maximum duration in seconds for browser tests. */
|
|
1814
|
+
testTimeout?: number;
|
|
1815
|
+
/**
|
|
1816
|
+
* Override existing or inject new local and [global variables](https://docs.datadoghq.com/synthetics/platform/settings/?tab=specifyvalue#global-variables) in Synthetic tests.
|
|
1817
|
+
*
|
|
1818
|
+
* This object should include keys corresponding to the names of the variables to be replaced, and values representing the new values for these variables.
|
|
1819
|
+
*/
|
|
1820
|
+
variables?: {
|
|
1821
|
+
[key: string]: string;
|
|
1822
|
+
};
|
|
1823
|
+
}
|
|
1824
|
+
interface UserConfigOverride extends BaseConfigOverride {
|
|
1825
|
+
/** Override the mobile application version for Synthetic mobile application tests. The version must be uploaded and available within Datadog. */
|
|
1826
|
+
mobileApplicationVersion?: string;
|
|
1827
|
+
/** Override the application version for Synthetic mobile application tests. */
|
|
1828
|
+
mobileApplicationVersionFilePath?: string;
|
|
1829
|
+
}
|
|
1830
|
+
interface ServerConfigOverride extends BaseConfigOverride {
|
|
1831
|
+
appExtractedMetadata?: MobileAppExtractedMetadata;
|
|
1832
|
+
mobileApplication?: MobileApplication;
|
|
1833
|
+
tunnel?: TunnelInfo;
|
|
1834
|
+
}
|
|
1835
|
+
interface BatchOptions {
|
|
1836
|
+
batch_timeout?: number;
|
|
1837
|
+
selective_rerun?: boolean;
|
|
1838
|
+
}
|
|
1839
|
+
interface Payload {
|
|
1840
|
+
metadata?: Metadata;
|
|
1841
|
+
tests: TestPayload[];
|
|
1842
|
+
options?: BatchOptions;
|
|
1843
|
+
}
|
|
1844
|
+
interface LocalTestPayload extends ServerConfigOverride {
|
|
1845
|
+
local_test_definition: LocalTestDefinition;
|
|
1846
|
+
}
|
|
1847
|
+
interface RemoteTestPayload extends ServerConfigOverride {
|
|
1848
|
+
public_id: string;
|
|
1849
|
+
version?: number;
|
|
1850
|
+
}
|
|
1851
|
+
type TestPayload = LocalTestPayload | RemoteTestPayload;
|
|
1852
|
+
/** Missing test, either because it's not found, or because it could not be read. */
|
|
1853
|
+
interface TestMissing {
|
|
1854
|
+
errorMessage: string;
|
|
1855
|
+
}
|
|
1856
|
+
interface TestSkipped {
|
|
1857
|
+
test: Test;
|
|
1858
|
+
overriddenConfig: TestPayload;
|
|
1859
|
+
executionRule: ExecutionRule.SKIPPED;
|
|
1860
|
+
}
|
|
1861
|
+
interface TestWithOverride {
|
|
1862
|
+
test: Test;
|
|
1863
|
+
overriddenConfig: TestPayload;
|
|
1864
|
+
executionRule: ExecutionRule;
|
|
1865
|
+
}
|
|
1866
|
+
interface MobileTestWithOverride extends TestWithOverride {
|
|
1867
|
+
test: Test & {
|
|
1868
|
+
type: 'mobile';
|
|
1869
|
+
options: {
|
|
1870
|
+
mobileApplication: MobileApplication;
|
|
1871
|
+
};
|
|
1872
|
+
};
|
|
1873
|
+
}
|
|
1874
|
+
interface BasicAuthCredentials {
|
|
1875
|
+
password: string;
|
|
1876
|
+
username: string;
|
|
1877
|
+
}
|
|
1878
|
+
interface BaseTriggerConfig {
|
|
1879
|
+
/** Overrides for this Synthetic test only. This takes precedence over all other overrides. */
|
|
1880
|
+
testOverrides?: UserConfigOverride;
|
|
1881
|
+
/** Name of a test suite (for JUnit reports). */
|
|
1882
|
+
suite?: string;
|
|
1883
|
+
}
|
|
1884
|
+
interface RemoteTriggerConfig extends BaseTriggerConfig {
|
|
1885
|
+
/**
|
|
1886
|
+
* Public ID of a test (e.g. `abc-def-ghi`), or its full URL (e.g. `https://app.datadoghq.com/synthetics/details/abc-def-ghi`).
|
|
1887
|
+
*
|
|
1888
|
+
* @pattern ^(https://.*)?([a-z2-9]{3}-[a-z2-9]{3}-[a-z2-9]{3})$
|
|
1889
|
+
*/
|
|
1890
|
+
id: string;
|
|
1891
|
+
version?: number;
|
|
1892
|
+
}
|
|
1893
|
+
interface LocalTriggerConfig extends BaseTriggerConfig {
|
|
1894
|
+
localTestDefinition: LocalTestDefinition;
|
|
1895
|
+
}
|
|
1896
|
+
type TriggerConfig = RemoteTriggerConfig | LocalTriggerConfig;
|
|
1897
|
+
declare enum ExecutionRule {
|
|
1898
|
+
BLOCKING = "blocking",
|
|
1899
|
+
NON_BLOCKING = "non_blocking",
|
|
1900
|
+
SKIPPED = "skipped"
|
|
1901
|
+
}
|
|
1902
|
+
interface Suite {
|
|
1903
|
+
content: TestConfig;
|
|
1904
|
+
name?: string;
|
|
1905
|
+
}
|
|
1906
|
+
interface TestConfig {
|
|
1907
|
+
tests: TriggerConfig[];
|
|
1908
|
+
}
|
|
1909
|
+
interface TestSearchResult {
|
|
1910
|
+
tests: {
|
|
1911
|
+
public_id: string;
|
|
1912
|
+
}[];
|
|
1913
|
+
}
|
|
1914
|
+
interface APIConfiguration {
|
|
1915
|
+
apiKey: string;
|
|
1916
|
+
appKey: string;
|
|
1917
|
+
baseIntakeUrl: string;
|
|
1918
|
+
baseUnstableUrl: string;
|
|
1919
|
+
baseV1Url: string;
|
|
1920
|
+
baseV2Url: string;
|
|
1921
|
+
proxyOpts: ProxyConfiguration;
|
|
1922
|
+
}
|
|
1923
|
+
interface APIHelperConfig {
|
|
1924
|
+
apiKey: string;
|
|
1925
|
+
appKey: string;
|
|
1926
|
+
datadogSite: string;
|
|
1927
|
+
proxy: ProxyConfiguration;
|
|
1928
|
+
}
|
|
1929
|
+
interface DatadogCIConfig extends APIHelperConfig {
|
|
1930
|
+
configPath: string;
|
|
1931
|
+
}
|
|
1932
|
+
interface SyntheticsCIConfig extends DatadogCIConfig {}
|
|
1933
|
+
interface RunTestsCommandConfig extends SyntheticsCIConfig {
|
|
1934
|
+
batchTimeout?: number;
|
|
1935
|
+
buildCommand?: string;
|
|
1936
|
+
defaultTestOverrides?: UserConfigOverride;
|
|
1937
|
+
failOnCriticalErrors: boolean;
|
|
1938
|
+
failOnMissingTests: boolean;
|
|
1939
|
+
failOnTimeout: boolean;
|
|
1940
|
+
files: string[];
|
|
1941
|
+
jUnitReport?: string;
|
|
1942
|
+
mobileApplicationVersionFilePath?: string;
|
|
1943
|
+
publicIds: string[];
|
|
1944
|
+
/** Whether to only run the tests which failed in the previous test batches. By default, the organization default setting is used. */
|
|
1945
|
+
selectiveRerun?: boolean;
|
|
1946
|
+
/** Used to create URLs to the Datadog UI. */
|
|
1947
|
+
subdomain: string;
|
|
1948
|
+
testSearchQuery?: string;
|
|
1949
|
+
tunnel: boolean;
|
|
1950
|
+
}
|
|
1951
|
+
type WrapperConfig = Partial<RunTestsCommandConfig>;
|
|
1952
|
+
interface UploadApplicationCommandConfig extends SyntheticsCIConfig {
|
|
1953
|
+
configPath: string;
|
|
1954
|
+
mobileApplicationVersionFilePath?: string;
|
|
1955
|
+
mobileApplicationId?: string;
|
|
1956
|
+
versionName?: string;
|
|
1957
|
+
latest?: boolean;
|
|
1958
|
+
}
|
|
1959
|
+
interface MobileApplicationUploadPart {
|
|
1960
|
+
partNumber: number;
|
|
1961
|
+
md5: string;
|
|
1962
|
+
blob: Buffer;
|
|
1963
|
+
}
|
|
1964
|
+
interface MobileApplicationUploadPartResponse {
|
|
1965
|
+
PartNumber: number;
|
|
1966
|
+
ETag: string;
|
|
1967
|
+
}
|
|
1968
|
+
interface MultipartPresignedUrlsResponse {
|
|
1969
|
+
file_name: string;
|
|
1970
|
+
multipart_presigned_urls_params: {
|
|
1971
|
+
key: string;
|
|
1972
|
+
upload_id: string;
|
|
1973
|
+
urls: {
|
|
1974
|
+
[key: string]: string;
|
|
1975
|
+
};
|
|
1976
|
+
};
|
|
1977
|
+
}
|
|
1978
|
+
type MobileApplicationNewVersionParams = {
|
|
1979
|
+
originalFileName: string;
|
|
1980
|
+
versionName: string;
|
|
1981
|
+
isLatest: boolean;
|
|
1982
|
+
};
|
|
1983
|
+
type AppUploadDetails = {
|
|
1984
|
+
appId: string;
|
|
1985
|
+
appPath: string;
|
|
1986
|
+
versionName?: string;
|
|
1987
|
+
};
|
|
1988
|
+
type MobileAppValidationStatus = 'pending' | 'complete' | 'error' | 'user_error';
|
|
1989
|
+
type MobileInvalidAppResult = {
|
|
1990
|
+
invalid_reason: string;
|
|
1991
|
+
invalid_message: string;
|
|
1992
|
+
};
|
|
1993
|
+
type MobileAppExtractedMetadata = Record<string, unknown>;
|
|
1994
|
+
type MobileValidAppResult = {
|
|
1995
|
+
extracted_metadata: MobileAppExtractedMetadata;
|
|
1996
|
+
app_version_uuid: string;
|
|
1997
|
+
};
|
|
1998
|
+
type MobileUserErrorResult = {
|
|
1999
|
+
user_error_reason: string;
|
|
2000
|
+
user_error_message: string;
|
|
2001
|
+
};
|
|
2002
|
+
type MobileAppUploadResult = {
|
|
2003
|
+
status: MobileAppValidationStatus;
|
|
2004
|
+
is_valid?: boolean;
|
|
2005
|
+
org_uuid?: string;
|
|
2006
|
+
invalid_app_result?: MobileInvalidAppResult;
|
|
2007
|
+
valid_app_result?: MobileValidAppResult;
|
|
2008
|
+
user_error_result?: MobileUserErrorResult;
|
|
2009
|
+
};
|
|
2010
|
+
interface SyntheticsOrgSettings {
|
|
2011
|
+
onDemandConcurrencyCap: number;
|
|
2012
|
+
}
|
|
2013
|
+
interface MobileApplicationVersion {
|
|
2014
|
+
id?: string;
|
|
2015
|
+
application_id: string;
|
|
2016
|
+
file_name: string;
|
|
2017
|
+
original_file_name: string;
|
|
2018
|
+
is_latest: boolean;
|
|
2019
|
+
version_name: string;
|
|
2020
|
+
created_at?: string;
|
|
2021
|
+
}
|
|
2022
|
+
interface ImportTestsCommandConfig extends SyntheticsCIConfig {
|
|
2023
|
+
configPath: string;
|
|
2024
|
+
files: string[];
|
|
2025
|
+
publicIds: string[];
|
|
2026
|
+
testSearchQuery?: string;
|
|
2027
|
+
}
|
|
2028
|
+
interface DeployTestsCommandConfig extends SyntheticsCIConfig {
|
|
2029
|
+
configPath: string;
|
|
2030
|
+
excludeFields?: string[];
|
|
2031
|
+
files: string[];
|
|
2032
|
+
publicIds: string[];
|
|
2033
|
+
subdomain: string;
|
|
2034
|
+
}
|
|
2035
|
+
//#endregion
|
|
2036
|
+
//#region src/reporters/default.d.ts
|
|
2037
|
+
declare class DefaultReporter implements MainReporter {
|
|
2038
|
+
private context;
|
|
2039
|
+
private testWaitSpinner?;
|
|
2040
|
+
private write;
|
|
2041
|
+
private totalDuration?;
|
|
2042
|
+
constructor({
|
|
2043
|
+
context
|
|
2044
|
+
}: {
|
|
2045
|
+
context: ReporterContext;
|
|
2046
|
+
});
|
|
2047
|
+
error(error: string): void;
|
|
2048
|
+
initErrors(errors: string[]): void;
|
|
2049
|
+
log(log: string): void;
|
|
2050
|
+
reportStart(timings: {
|
|
2051
|
+
startTime: number;
|
|
2052
|
+
}): void;
|
|
2053
|
+
resultEnd(result: Result, baseUrl: string, batchId: string): void;
|
|
2054
|
+
resultReceived(result: ResultInBatch): void;
|
|
2055
|
+
dryRunEnd(summary: InitialSummary, testPlan: TestPlan, config: RunTestsCommandConfig, orgSettings?: SyntheticsOrgSettings): void;
|
|
2056
|
+
runEnd(summary: Summary, baseUrl: string, orgSettings?: SyntheticsOrgSettings): void;
|
|
2057
|
+
testsWait(tests: Test[], baseUrl: string, batchId: string, skippedCount?: number): void;
|
|
2058
|
+
testTrigger(test: Pick<Test, 'name'>, testId: string, executionRule: ExecutionRule, testOverrides: UserConfigOverride): void;
|
|
2059
|
+
testWait(test: Test): void;
|
|
2060
|
+
private removeSpinner;
|
|
2061
|
+
}
|
|
2062
|
+
//#endregion
|
|
2063
|
+
//#region src/reporters/junit.d.ts
|
|
2064
|
+
interface SuiteStats {
|
|
2065
|
+
errors: number;
|
|
2066
|
+
failures: number;
|
|
2067
|
+
skipped: number;
|
|
2068
|
+
tests: number;
|
|
2069
|
+
}
|
|
2070
|
+
interface TestCaseStats {
|
|
2071
|
+
steps_allowfailures: number;
|
|
2072
|
+
steps_count: number;
|
|
2073
|
+
steps_errors: number;
|
|
2074
|
+
steps_failures: number;
|
|
2075
|
+
steps_skipped: number;
|
|
2076
|
+
steps_warnings: number;
|
|
2077
|
+
}
|
|
2078
|
+
interface XMLSuiteProperties extends SuiteStats {
|
|
2079
|
+
name: string;
|
|
2080
|
+
}
|
|
2081
|
+
interface XMLSuite {
|
|
2082
|
+
$: XMLSuiteProperties;
|
|
2083
|
+
testcase: XMLTestCase[];
|
|
2084
|
+
}
|
|
2085
|
+
interface XMLTestCaseProperties extends TestCaseStats {
|
|
2086
|
+
classname: string | undefined;
|
|
2087
|
+
file: string | undefined;
|
|
2088
|
+
name: string;
|
|
2089
|
+
time: number | undefined;
|
|
2090
|
+
timestamp: string;
|
|
2091
|
+
}
|
|
2092
|
+
interface XMLTestCase {
|
|
2093
|
+
$: XMLTestCaseProperties;
|
|
2094
|
+
allowed_error: XMLError[];
|
|
2095
|
+
browser_error: XMLError[];
|
|
2096
|
+
error: XMLError[];
|
|
2097
|
+
failure: XMLError[];
|
|
2098
|
+
properties: {
|
|
2099
|
+
property: {
|
|
2100
|
+
$: {
|
|
2101
|
+
name: string;
|
|
2102
|
+
value: any;
|
|
2103
|
+
};
|
|
2104
|
+
}[];
|
|
2105
|
+
};
|
|
2106
|
+
skipped: string[];
|
|
2107
|
+
warning: XMLError[];
|
|
2108
|
+
}
|
|
2109
|
+
interface XMLJSON {
|
|
2110
|
+
testsuites: {
|
|
2111
|
+
$: {
|
|
2112
|
+
batch_id: string;
|
|
2113
|
+
batch_url: string;
|
|
2114
|
+
name: string;
|
|
2115
|
+
tests_critical_error: number;
|
|
2116
|
+
tests_failed: number;
|
|
2117
|
+
tests_failed_non_blocking: number;
|
|
2118
|
+
tests_not_authorized: number;
|
|
2119
|
+
tests_not_found: number;
|
|
2120
|
+
tests_passed: number;
|
|
2121
|
+
tests_skipped: number;
|
|
2122
|
+
tests_timed_out: number;
|
|
2123
|
+
};
|
|
2124
|
+
testsuite: XMLSuite[];
|
|
2125
|
+
};
|
|
2126
|
+
}
|
|
2127
|
+
interface XMLError {
|
|
2128
|
+
$: {
|
|
2129
|
+
[key: string]: string;
|
|
2130
|
+
type: string;
|
|
2131
|
+
};
|
|
2132
|
+
_: string;
|
|
2133
|
+
}
|
|
2134
|
+
interface Args {
|
|
2135
|
+
context: ReporterContext;
|
|
2136
|
+
jUnitReport?: string;
|
|
2137
|
+
runName?: string;
|
|
2138
|
+
}
|
|
2139
|
+
declare class JUnitReporter implements Reporter {
|
|
2140
|
+
private builder;
|
|
2141
|
+
private destination;
|
|
2142
|
+
private json;
|
|
2143
|
+
private write;
|
|
2144
|
+
constructor({
|
|
2145
|
+
context,
|
|
2146
|
+
jUnitReport,
|
|
2147
|
+
runName
|
|
2148
|
+
}: Args);
|
|
2149
|
+
resultEnd(result: Result, baseUrl: string, batchId: string): void;
|
|
2150
|
+
runEnd(summary: Summary, baseUrl: string): void;
|
|
2151
|
+
testTrigger(test: Test, testId: string, executionRule: ExecutionRule, testOverrides: UserConfigOverride): void;
|
|
2152
|
+
private addTestCaseToSuite;
|
|
2153
|
+
private getApiStepStats;
|
|
2154
|
+
private getApiTestErrors;
|
|
2155
|
+
private getBrowserStepStats;
|
|
2156
|
+
private getBrowserTestErrors;
|
|
2157
|
+
private getMultiStepTestErrors;
|
|
2158
|
+
private getSkippedTestCase;
|
|
2159
|
+
private getSuiteByName;
|
|
2160
|
+
private getTestCase;
|
|
2161
|
+
private getTestCaseStats;
|
|
2162
|
+
}
|
|
2163
|
+
//#endregion
|
|
2164
|
+
//#region src/run-tests-lib.d.ts
|
|
2165
|
+
type ExecuteOptions = {
|
|
2166
|
+
initialSummary?: InitialSummary;
|
|
2167
|
+
jUnitReport?: string;
|
|
2168
|
+
reporters?: (SupportedReporter | Reporter)[];
|
|
2169
|
+
runId?: string;
|
|
2170
|
+
suites?: Suite[];
|
|
2171
|
+
testPlan?: TestPlan;
|
|
2172
|
+
};
|
|
2173
|
+
declare const executeTests: (reporter: MainReporter, config: RunTestsCommandConfig, suites?: Suite[], testPlan?: TestPlan, providedInitialSummary?: InitialSummary) => Promise<{
|
|
2174
|
+
results: Result[];
|
|
2175
|
+
summary: Summary;
|
|
2176
|
+
}>;
|
|
2177
|
+
declare const planDryRun: (reporter: MainReporter, runConfig: WrapperConfig, suites?: Suite[]) => Promise<{
|
|
2178
|
+
testPlan: TestPlan;
|
|
2179
|
+
initialSummary: InitialSummary;
|
|
2180
|
+
}>;
|
|
2181
|
+
declare const executeWithDetails: (runConfig: WrapperConfig, {
|
|
2182
|
+
initialSummary,
|
|
2183
|
+
jUnitReport,
|
|
2184
|
+
reporters,
|
|
2185
|
+
runId,
|
|
2186
|
+
suites,
|
|
2187
|
+
testPlan
|
|
2188
|
+
}: ExecuteOptions) => Promise<{
|
|
2189
|
+
results: Result[];
|
|
2190
|
+
summary: Summary;
|
|
2191
|
+
exitCode: 0 | 1;
|
|
2192
|
+
}>;
|
|
2193
|
+
declare const execute: (runConfig: WrapperConfig, executeOptions: ExecuteOptions) => Promise<0 | 1>;
|
|
2194
|
+
//#endregion
|
|
2195
|
+
//#region src/index.d.ts
|
|
2196
|
+
declare const DEFAULT_COMMAND_CONFIG: RunTestsCommandConfig;
|
|
2197
|
+
//#endregion
|
|
2198
|
+
//#region ../base/dist/index.d.ts
|
|
2199
|
+
type CommandContext = BaseContext & {
|
|
2200
|
+
builtinPlugins: string[];
|
|
2201
|
+
};
|
|
2202
|
+
/**
|
|
2203
|
+
* This command should be extended by **every** command in the monorepo.
|
|
2204
|
+
*/
|
|
2205
|
+
declare abstract class BaseCommand extends Command<CommandContext> {}
|
|
2206
|
+
//#endregion
|
|
2207
|
+
//#region ../base/dist/commands/synthetics/deploy-tests.d.ts
|
|
2208
|
+
declare class SyntheticsDeployTestsCommand extends BaseCommand {
|
|
2209
|
+
static paths: string[][];
|
|
2210
|
+
static usage: Usage;
|
|
2211
|
+
protected apiKey: string | undefined;
|
|
2212
|
+
protected appKey: string | undefined;
|
|
2213
|
+
protected configPath: string | undefined;
|
|
2214
|
+
protected datadogSite: string | undefined;
|
|
2215
|
+
protected fips: boolean;
|
|
2216
|
+
protected fipsIgnoreError: boolean;
|
|
2217
|
+
files: string[] | undefined;
|
|
2218
|
+
publicIds: string[] | undefined;
|
|
2219
|
+
subdomain: string | undefined;
|
|
2220
|
+
excludeFields: string[] | undefined;
|
|
2221
|
+
execute(): Promise<number | void>;
|
|
2222
|
+
}
|
|
2223
|
+
//#endregion
|
|
2224
|
+
//#region ../base/dist/helpers/logger.d.ts
|
|
2225
|
+
declare enum LogLevel {
|
|
2226
|
+
DEBUG = 1,
|
|
2227
|
+
INFO = 2,
|
|
2228
|
+
WARN = 3,
|
|
2229
|
+
ERROR = 4
|
|
2230
|
+
}
|
|
2231
|
+
declare class Logger {
|
|
2232
|
+
private loglevel;
|
|
2233
|
+
private writeMessage;
|
|
2234
|
+
private shouldIncludeTimestamp;
|
|
2235
|
+
constructor(writeMessage: (s: string) => void, loglevel: LogLevel, shouldIncludeTimestamp?: boolean);
|
|
2236
|
+
setLogLevel(newLogLevel: LogLevel): void;
|
|
2237
|
+
setShouldIncludeTime(newShouldIncludeTimestamp: boolean): void;
|
|
2238
|
+
error(s: string): void;
|
|
2239
|
+
warn(s: string): void;
|
|
2240
|
+
info(s: string): void;
|
|
2241
|
+
debug(s: string): void;
|
|
2242
|
+
}
|
|
2243
|
+
//#endregion
|
|
2244
|
+
//#region src/commands/deploy-tests.d.ts
|
|
2245
|
+
declare class PluginCommand$3 extends SyntheticsDeployTestsCommand {
|
|
2246
|
+
protected reporter: MainReporter;
|
|
2247
|
+
protected config: DeployTestsCommandConfig;
|
|
2248
|
+
protected fipsConfig: {
|
|
2249
|
+
fips: boolean;
|
|
2250
|
+
fipsIgnoreError: boolean;
|
|
2251
|
+
};
|
|
2252
|
+
protected logger: Logger;
|
|
2253
|
+
static getDefaultConfig(): DeployTestsCommandConfig;
|
|
2254
|
+
protected setup(): Promise<void>;
|
|
2255
|
+
protected resolveConfig(): Promise<void>;
|
|
2256
|
+
execute(): Promise<1 | 0>;
|
|
2257
|
+
protected resolveConfigFromEnv(): RecursivePartial<DeployTestsCommandConfig>;
|
|
2258
|
+
protected resolveConfigFromCli(): RecursivePartial<DeployTestsCommandConfig>;
|
|
2259
|
+
}
|
|
2260
|
+
//#endregion
|
|
2261
|
+
//#region ../base/dist/commands/synthetics/import-tests.d.ts
|
|
2262
|
+
declare class SyntheticsImportTestsCommand extends BaseCommand {
|
|
2263
|
+
static paths: string[][];
|
|
2264
|
+
static usage: Usage;
|
|
2265
|
+
protected apiKey: string | undefined;
|
|
2266
|
+
protected appKey: string | undefined;
|
|
2267
|
+
protected configPath: string | undefined;
|
|
2268
|
+
protected datadogSite: string | undefined;
|
|
2269
|
+
protected fips: boolean;
|
|
2270
|
+
protected fipsIgnoreError: boolean;
|
|
2271
|
+
files: string[] | undefined;
|
|
2272
|
+
publicIds: string[] | undefined;
|
|
2273
|
+
testSearchQuery: string | undefined;
|
|
2274
|
+
execute(): Promise<number | void>;
|
|
2275
|
+
}
|
|
2276
|
+
//#endregion
|
|
2277
|
+
//#region src/commands/import-tests.d.ts
|
|
2278
|
+
declare class PluginCommand$2 extends SyntheticsImportTestsCommand {
|
|
2279
|
+
protected reporter: MainReporter;
|
|
2280
|
+
protected config: ImportTestsCommandConfig;
|
|
2281
|
+
protected fipsConfig: {
|
|
2282
|
+
fips: boolean;
|
|
2283
|
+
fipsIgnoreError: boolean;
|
|
2284
|
+
};
|
|
2285
|
+
protected logger: Logger;
|
|
2286
|
+
static getDefaultConfig(): ImportTestsCommandConfig;
|
|
2287
|
+
protected setup(): Promise<void>;
|
|
2288
|
+
protected resolveConfig(): Promise<void>;
|
|
2289
|
+
execute(): Promise<1 | 0>;
|
|
2290
|
+
protected resolveConfigFromEnv(): RecursivePartial<ImportTestsCommandConfig>;
|
|
2291
|
+
protected resolveConfigFromCli(): RecursivePartial<ImportTestsCommandConfig>;
|
|
2292
|
+
}
|
|
2293
|
+
//#endregion
|
|
2294
|
+
//#region ../base/dist/commands/synthetics/run-tests.d.ts
|
|
2295
|
+
declare class SyntheticsRunTestsCommand extends BaseCommand {
|
|
2296
|
+
static paths: string[][];
|
|
2297
|
+
static usage: Usage;
|
|
2298
|
+
jUnitReport: string | undefined;
|
|
2299
|
+
runName: string | undefined;
|
|
2300
|
+
protected apiKey: string | undefined;
|
|
2301
|
+
protected appKey: string | undefined;
|
|
2302
|
+
protected configPath: string | undefined;
|
|
2303
|
+
protected datadogSite: string | undefined;
|
|
2304
|
+
protected fips: boolean;
|
|
2305
|
+
protected fipsIgnoreError: boolean;
|
|
2306
|
+
batchTimeout: number | undefined;
|
|
2307
|
+
failOnCriticalErrors: boolean | undefined;
|
|
2308
|
+
failOnMissingTests: boolean | undefined;
|
|
2309
|
+
failOnTimeout: boolean | undefined;
|
|
2310
|
+
files: string[] | undefined;
|
|
2311
|
+
mobileApplicationVersion: string | undefined;
|
|
2312
|
+
mobileApplicationVersionFilePath: string | undefined;
|
|
2313
|
+
overrides: string[] | undefined;
|
|
2314
|
+
publicIds: string[] | undefined;
|
|
2315
|
+
selectiveRerun: boolean | undefined;
|
|
2316
|
+
subdomain: string | undefined;
|
|
2317
|
+
testSearchQuery: string | undefined;
|
|
2318
|
+
tunnel: boolean | undefined;
|
|
2319
|
+
buildCommand: string | undefined;
|
|
2320
|
+
dryRun: boolean | undefined;
|
|
2321
|
+
execute(): Promise<number | void>;
|
|
2322
|
+
}
|
|
2323
|
+
//#endregion
|
|
2324
|
+
//#region src/commands/run-tests.d.ts
|
|
2325
|
+
declare class PluginCommand$1 extends SyntheticsRunTestsCommand {
|
|
2326
|
+
protected reporter: MainReporter;
|
|
2327
|
+
protected config: RunTestsCommandConfig;
|
|
2328
|
+
protected fipsConfig: {
|
|
2329
|
+
fips: boolean;
|
|
2330
|
+
fipsIgnoreError: boolean;
|
|
2331
|
+
};
|
|
2332
|
+
protected setup(): Promise<void>;
|
|
2333
|
+
protected resolveConfig(): Promise<void>;
|
|
2334
|
+
execute(): Promise<1 | 0>;
|
|
2335
|
+
protected resolveConfigFromEnv(): RecursivePartial<RunTestsCommandConfig>;
|
|
2336
|
+
protected resolveConfigFromCli(): RecursivePartial<RunTestsCommandConfig>;
|
|
2337
|
+
protected normalizeConfig(): void;
|
|
2338
|
+
protected validateConfig(): void;
|
|
2339
|
+
protected getReporters(): Reporter[];
|
|
2340
|
+
}
|
|
2341
|
+
//#endregion
|
|
2342
|
+
//#region ../base/dist/commands/synthetics/upload-application.d.ts
|
|
2343
|
+
declare class SyntheticsUploadApplicationCommand extends BaseCommand {
|
|
2344
|
+
static paths: string[][];
|
|
2345
|
+
static usage: Usage;
|
|
2346
|
+
protected apiKey: string | undefined;
|
|
2347
|
+
protected appKey: string | undefined;
|
|
2348
|
+
protected configPath: string | undefined;
|
|
2349
|
+
protected datadogSite: string | undefined;
|
|
2350
|
+
protected fips: boolean;
|
|
2351
|
+
protected fipsIgnoreError: boolean;
|
|
2352
|
+
mobileApplicationVersionFilePath: string | undefined;
|
|
2353
|
+
mobileApplicationId: string | undefined;
|
|
2354
|
+
versionName: string | undefined;
|
|
2355
|
+
latest: boolean | undefined;
|
|
2356
|
+
execute(): Promise<number | void>;
|
|
2357
|
+
}
|
|
2358
|
+
//#endregion
|
|
2359
|
+
//#region src/commands/upload-application.d.ts
|
|
2360
|
+
declare class PluginCommand extends SyntheticsUploadApplicationCommand {
|
|
2361
|
+
protected config: UploadApplicationCommandConfig;
|
|
2362
|
+
protected fipsConfig: {
|
|
2363
|
+
fips: boolean;
|
|
2364
|
+
fipsIgnoreError: boolean;
|
|
2365
|
+
};
|
|
2366
|
+
protected logger: Logger;
|
|
2367
|
+
static getDefaultConfig(): UploadApplicationCommandConfig;
|
|
2368
|
+
protected setup(): Promise<void>;
|
|
2369
|
+
protected resolveConfig(): Promise<void>;
|
|
2370
|
+
execute(): Promise<1 | 0>;
|
|
2371
|
+
protected resolveConfigFromEnv(): RecursivePartial<UploadApplicationCommandConfig>;
|
|
2372
|
+
protected resolveConfigFromCli(): RecursivePartial<UploadApplicationCommandConfig>;
|
|
2373
|
+
}
|
|
2374
|
+
//#endregion
|
|
2375
|
+
//#region dist/.bundle-entry.d.ts
|
|
2376
|
+
declare const commands: {
|
|
2377
|
+
"deploy-tests": {
|
|
2378
|
+
PluginCommand: typeof PluginCommand$3;
|
|
2379
|
+
};
|
|
2380
|
+
"import-tests": {
|
|
2381
|
+
PluginCommand: typeof PluginCommand$2;
|
|
2382
|
+
};
|
|
2383
|
+
"run-tests": {
|
|
2384
|
+
PluginCommand: typeof PluginCommand$1;
|
|
2385
|
+
};
|
|
2386
|
+
"upload-application": {
|
|
2387
|
+
PluginCommand: typeof PluginCommand;
|
|
2388
|
+
};
|
|
2389
|
+
};
|
|
2390
|
+
//#endregion
|
|
2391
|
+
export { APIConfiguration, APIHelperConfig, ApiServerResult, AppUploadDetails, Assertion, BaseConfigOverride, BaseResult, BaseResultInBatch, BaseServerResult, BasicAuthCredentials, Batch, BatchOptions, BrowserError, BrowserServerResult, CiError, CookiesObject, CriticalError, DEFAULT_COMMAND_CONFIG, DatadogCIConfig, DefaultReporter, DeployTestsCommandConfig, Device, ExecutionRule, ImportTestsCommandConfig, JUnitReporter, LocalTestDefinition, LocalTestPayload, LocalTriggerConfig, Location, LocationsMapping, MainReporter, MobileAppExtractedMetadata, MobileAppUploadResult, MobileApplication, MobileApplicationNewVersionParams, MobileApplicationUploadPart, MobileApplicationUploadPartResponse, MobileApplicationVersion, MobileTestWithOverride, MultiLocator, MultiStep, MultiStepsServerResult, MultipartPresignedUrlsResponse, Operator, OptionsWithUnsupportedFields, Payload, PollResult, RawPollResult, RawPollResultTest, RemoteTestPayload, RemoteTriggerConfig, Reporter, ReporterContext, Result, ResultDisplayInfo, ResultInBatch, ResultInBatchSkippedBySelectiveRerun, ResultSkippedBySelectiveRerun, RetryConfig, RunTestsCommandConfig, SelectiveRerunDecision, ServerBatch, ServerConfigOverride, ServerResult, ServerTest, ServerTrigger, Step, Suite, Summary, SupportedReporter, SyntheticsCIConfig, SyntheticsOrgSettings, Test, TestConfig, TestMissing, TestPayload, TestPlan, TestPlanItem, TestRequest, TestSearchResult, TestSkipped, TestStepWithUnsupportedFields, TestWithOverride, TriggerConfig, TriggerInfo, UploadApplicationCommandConfig, UserConfigOverride, Vitals, WrapperConfig, type XMLJSON, commands, execute, executeTests, executeWithDetails, planDryRun, public_d_exports as utils };
|
|
2392
|
+
//# sourceMappingURL=bundle.d.ts.map
|