cdk-common 2.0.1290 → 2.0.1292
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/.jsii +2 -2
- package/lib/main.js +1 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/assert/strict.d.ts +105 -2
- package/node_modules/@types/concat-stream/node_modules/@types/node/assert.d.ts +119 -95
- package/node_modules/@types/concat-stream/node_modules/@types/node/crypto.d.ts +117 -7
- package/node_modules/@types/concat-stream/node_modules/@types/node/events.d.ts +79 -33
- package/node_modules/@types/concat-stream/node_modules/@types/node/fs.d.ts +224 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/http.d.ts +28 -3
- package/node_modules/@types/concat-stream/node_modules/@types/node/package.json +3 -3
- package/node_modules/@types/concat-stream/node_modules/@types/node/test.d.ts +2 -23
- package/node_modules/@types/concat-stream/node_modules/@types/node/util.d.ts +5 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/web-globals/events.d.ts +3 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/worker_threads.d.ts +33 -47
- package/node_modules/@types/concat-stream/node_modules/@types/node/zlib.d.ts +6 -0
- package/node_modules/@types/concat-stream/node_modules/undici-types/agent.d.ts +0 -4
- package/node_modules/@types/concat-stream/node_modules/undici-types/client.d.ts +0 -2
- package/node_modules/@types/concat-stream/node_modules/undici-types/dispatcher.d.ts +0 -6
- package/node_modules/@types/concat-stream/node_modules/undici-types/h2c-client.d.ts +0 -2
- package/node_modules/@types/concat-stream/node_modules/undici-types/index.d.ts +3 -1
- package/node_modules/@types/concat-stream/node_modules/undici-types/mock-interceptor.d.ts +0 -1
- package/node_modules/@types/concat-stream/node_modules/undici-types/package.json +1 -1
- package/node_modules/@types/concat-stream/node_modules/undici-types/snapshot-agent.d.ts +107 -0
- package/node_modules/@types/form-data/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/form-data/node_modules/@types/node/assert/strict.d.ts +105 -2
- package/node_modules/@types/form-data/node_modules/@types/node/assert.d.ts +119 -95
- package/node_modules/@types/form-data/node_modules/@types/node/crypto.d.ts +117 -7
- package/node_modules/@types/form-data/node_modules/@types/node/events.d.ts +79 -33
- package/node_modules/@types/form-data/node_modules/@types/node/fs.d.ts +224 -0
- package/node_modules/@types/form-data/node_modules/@types/node/http.d.ts +28 -3
- package/node_modules/@types/form-data/node_modules/@types/node/package.json +3 -3
- package/node_modules/@types/form-data/node_modules/@types/node/test.d.ts +2 -23
- package/node_modules/@types/form-data/node_modules/@types/node/util.d.ts +5 -0
- package/node_modules/@types/form-data/node_modules/@types/node/web-globals/events.d.ts +3 -0
- package/node_modules/@types/form-data/node_modules/@types/node/worker_threads.d.ts +33 -47
- package/node_modules/@types/form-data/node_modules/@types/node/zlib.d.ts +6 -0
- package/node_modules/@types/form-data/node_modules/undici-types/agent.d.ts +0 -4
- package/node_modules/@types/form-data/node_modules/undici-types/client.d.ts +0 -2
- package/node_modules/@types/form-data/node_modules/undici-types/dispatcher.d.ts +0 -6
- package/node_modules/@types/form-data/node_modules/undici-types/h2c-client.d.ts +0 -2
- package/node_modules/@types/form-data/node_modules/undici-types/index.d.ts +3 -1
- package/node_modules/@types/form-data/node_modules/undici-types/mock-interceptor.d.ts +0 -1
- package/node_modules/@types/form-data/node_modules/undici-types/package.json +1 -1
- package/node_modules/@types/form-data/node_modules/undici-types/snapshot-agent.d.ts +107 -0
- package/package.json +4 -4
|
@@ -338,6 +338,11 @@ declare module "util" {
|
|
|
338
338
|
* @since v9.7.0
|
|
339
339
|
*/
|
|
340
340
|
export function getSystemErrorName(err: number): string;
|
|
341
|
+
/**
|
|
342
|
+
* Enable or disable printing a stack trace on `SIGINT`. The API is only available on the main thread.
|
|
343
|
+
* @since 24.6.0
|
|
344
|
+
*/
|
|
345
|
+
export function setTraceSigInt(enable: boolean): void;
|
|
341
346
|
/**
|
|
342
347
|
* Returns a Map of all system error codes available from the Node.js API.
|
|
343
348
|
* The mapping between error codes and error names is platform-dependent.
|
|
@@ -51,6 +51,7 @@ interface EventListenerObject {
|
|
|
51
51
|
handleEvent(object: Event): void;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
type _EventListenerOptions = typeof globalThis extends { onmessage: any } ? {} : EventListenerOptions;
|
|
54
55
|
interface EventListenerOptions {
|
|
55
56
|
capture?: boolean;
|
|
56
57
|
}
|
|
@@ -85,6 +86,8 @@ declare global {
|
|
|
85
86
|
new(type: string, eventInitDict?: EventInit): Event;
|
|
86
87
|
};
|
|
87
88
|
|
|
89
|
+
interface EventListenerOptions extends _EventListenerOptions {}
|
|
90
|
+
|
|
88
91
|
interface EventTarget extends _EventTarget {}
|
|
89
92
|
var EventTarget: typeof globalThis extends { onmessage: any; EventTarget: infer T } ? T
|
|
90
93
|
: {
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
*/
|
|
57
57
|
declare module "worker_threads" {
|
|
58
58
|
import { Context } from "node:vm";
|
|
59
|
-
import { EventEmitter } from "node:events";
|
|
59
|
+
import { EventEmitter, NodeEventTarget } from "node:events";
|
|
60
60
|
import { EventLoopUtilityFunction } from "node:perf_hooks";
|
|
61
61
|
import { FileHandle } from "node:fs/promises";
|
|
62
62
|
import { Readable, Writable } from "node:stream";
|
|
@@ -70,6 +70,7 @@ declare module "worker_threads" {
|
|
|
70
70
|
const resourceLimits: ResourceLimits;
|
|
71
71
|
const SHARE_ENV: unique symbol;
|
|
72
72
|
const threadId: number;
|
|
73
|
+
const threadName: string | null;
|
|
73
74
|
const workerData: any;
|
|
74
75
|
/**
|
|
75
76
|
* Instances of the `worker.MessageChannel` class represent an asynchronous,
|
|
@@ -112,7 +113,7 @@ declare module "worker_threads" {
|
|
|
112
113
|
* This implementation matches [browser `MessagePort`](https://developer.mozilla.org/en-US/docs/Web/API/MessagePort) s.
|
|
113
114
|
* @since v10.5.0
|
|
114
115
|
*/
|
|
115
|
-
class MessagePort
|
|
116
|
+
class MessagePort implements EventTarget {
|
|
116
117
|
/**
|
|
117
118
|
* Disables further sending of messages on either side of the connection.
|
|
118
119
|
* This method can be called when no further communication will happen over this `MessagePort`.
|
|
@@ -225,42 +226,32 @@ declare module "worker_threads" {
|
|
|
225
226
|
* @since v10.5.0
|
|
226
227
|
*/
|
|
227
228
|
start(): void;
|
|
228
|
-
addListener(event: "close", listener: () => void): this;
|
|
229
|
+
addListener(event: "close", listener: (ev: Event) => void): this;
|
|
229
230
|
addListener(event: "message", listener: (value: any) => void): this;
|
|
230
231
|
addListener(event: "messageerror", listener: (error: Error) => void): this;
|
|
231
|
-
addListener(event: string
|
|
232
|
-
emit(event: "close"): boolean;
|
|
232
|
+
addListener(event: string, listener: (arg: any) => void): this;
|
|
233
|
+
emit(event: "close", ev: Event): boolean;
|
|
233
234
|
emit(event: "message", value: any): boolean;
|
|
234
235
|
emit(event: "messageerror", error: Error): boolean;
|
|
235
|
-
emit(event: string
|
|
236
|
-
|
|
236
|
+
emit(event: string, arg: any): boolean;
|
|
237
|
+
off(event: "close", listener: (ev: Event) => void, options?: EventListenerOptions): this;
|
|
238
|
+
off(event: "message", listener: (value: any) => void, options?: EventListenerOptions): this;
|
|
239
|
+
off(event: "messageerror", listener: (error: Error) => void, options?: EventListenerOptions): this;
|
|
240
|
+
off(event: string, listener: (arg: any) => void, options?: EventListenerOptions): this;
|
|
241
|
+
on(event: "close", listener: (ev: Event) => void): this;
|
|
237
242
|
on(event: "message", listener: (value: any) => void): this;
|
|
238
243
|
on(event: "messageerror", listener: (error: Error) => void): this;
|
|
239
|
-
on(event: string
|
|
240
|
-
once(event: "close", listener: () => void): this;
|
|
244
|
+
on(event: string, listener: (arg: any) => void): this;
|
|
245
|
+
once(event: "close", listener: (ev: Event) => void): this;
|
|
241
246
|
once(event: "message", listener: (value: any) => void): this;
|
|
242
247
|
once(event: "messageerror", listener: (error: Error) => void): this;
|
|
243
|
-
once(event: string
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
prependOnceListener(event: "close", listener: () => void): this;
|
|
249
|
-
prependOnceListener(event: "message", listener: (value: any) => void): this;
|
|
250
|
-
prependOnceListener(event: "messageerror", listener: (error: Error) => void): this;
|
|
251
|
-
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
252
|
-
removeListener(event: "close", listener: () => void): this;
|
|
253
|
-
removeListener(event: "message", listener: (value: any) => void): this;
|
|
254
|
-
removeListener(event: "messageerror", listener: (error: Error) => void): this;
|
|
255
|
-
removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
256
|
-
off(event: "close", listener: () => void): this;
|
|
257
|
-
off(event: "message", listener: (value: any) => void): this;
|
|
258
|
-
off(event: "messageerror", listener: (error: Error) => void): this;
|
|
259
|
-
off(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
260
|
-
addEventListener: EventTarget["addEventListener"];
|
|
261
|
-
dispatchEvent: EventTarget["dispatchEvent"];
|
|
262
|
-
removeEventListener: EventTarget["removeEventListener"];
|
|
248
|
+
once(event: string, listener: (arg: any) => void): this;
|
|
249
|
+
removeListener(event: "close", listener: (ev: Event) => void, options?: EventListenerOptions): this;
|
|
250
|
+
removeListener(event: "message", listener: (value: any) => void, options?: EventListenerOptions): this;
|
|
251
|
+
removeListener(event: "messageerror", listener: (error: Error) => void, options?: EventListenerOptions): this;
|
|
252
|
+
removeListener(event: string, listener: (arg: any) => void, options?: EventListenerOptions): this;
|
|
263
253
|
}
|
|
254
|
+
interface MessagePort extends NodeEventTarget {}
|
|
264
255
|
interface WorkerOptions {
|
|
265
256
|
/**
|
|
266
257
|
* List of arguments which would be stringified and appended to
|
|
@@ -402,6 +393,12 @@ declare module "worker_threads" {
|
|
|
402
393
|
* @since v10.5.0
|
|
403
394
|
*/
|
|
404
395
|
readonly threadId: number;
|
|
396
|
+
/**
|
|
397
|
+
* A string identifier for the referenced thread or null if the thread is not running.
|
|
398
|
+
* Inside the worker thread, it is available as `require('node:worker_threads').threadName`.
|
|
399
|
+
* @since v24.6.0
|
|
400
|
+
*/
|
|
401
|
+
readonly threadName: string | null;
|
|
405
402
|
/**
|
|
406
403
|
* Provides the set of JS engine resource constraints for this Worker thread.
|
|
407
404
|
* If the `resourceLimits` option was passed to the `Worker` constructor,
|
|
@@ -429,24 +426,6 @@ declare module "worker_threads" {
|
|
|
429
426
|
* @since v10.5.0
|
|
430
427
|
*/
|
|
431
428
|
postMessage(value: any, transferList?: readonly Transferable[]): void;
|
|
432
|
-
/**
|
|
433
|
-
* Sends a value to another worker, identified by its thread ID.
|
|
434
|
-
* @param threadId The target thread ID. If the thread ID is invalid, a `ERR_WORKER_MESSAGING_FAILED` error will be thrown.
|
|
435
|
-
* If the target thread ID is the current thread ID, a `ERR_WORKER_MESSAGING_SAME_THREAD` error will be thrown.
|
|
436
|
-
* @param value The value to send.
|
|
437
|
-
* @param transferList If one or more `MessagePort`-like objects are passed in value, a `transferList` is required for those items
|
|
438
|
-
* or `ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST` is thrown. See `port.postMessage()` for more information.
|
|
439
|
-
* @param timeout Time to wait for the message to be delivered in milliseconds. By default it's `undefined`, which means wait forever.
|
|
440
|
-
* If the operation times out, a `ERR_WORKER_MESSAGING_TIMEOUT` error is thrown.
|
|
441
|
-
* @since v22.5.0
|
|
442
|
-
*/
|
|
443
|
-
postMessageToThread(threadId: number, value: any, timeout?: number): Promise<void>;
|
|
444
|
-
postMessageToThread(
|
|
445
|
-
threadId: number,
|
|
446
|
-
value: any,
|
|
447
|
-
transferList: readonly Transferable[],
|
|
448
|
-
timeout?: number,
|
|
449
|
-
): Promise<void>;
|
|
450
429
|
/**
|
|
451
430
|
* Opposite of `unref()`, calling `ref()` on a previously `unref()`ed worker does _not_ let the program exit if it's the only active handle left (the default
|
|
452
431
|
* behavior). If the worker is `ref()`ed, calling `ref()` again has
|
|
@@ -466,6 +445,13 @@ declare module "worker_threads" {
|
|
|
466
445
|
* @since v10.5.0
|
|
467
446
|
*/
|
|
468
447
|
terminate(): Promise<number>;
|
|
448
|
+
/**
|
|
449
|
+
* This method returns a `Promise` that will resolve to an object identical to `process.threadCpuUsage()`,
|
|
450
|
+
* or reject with an `ERR_WORKER_NOT_RUNNING` error if the worker is no longer running.
|
|
451
|
+
* This methods allows the statistics to be observed from outside the actual thread.
|
|
452
|
+
* @since v24.6.0
|
|
453
|
+
*/
|
|
454
|
+
cpuUsage(prev?: NodeJS.CpuUsage): Promise<NodeJS.CpuUsage>;
|
|
469
455
|
/**
|
|
470
456
|
* Returns a readable stream for a V8 snapshot of the current state of the Worker.
|
|
471
457
|
* See `v8.getHeapSnapshot()` for more details.
|
|
@@ -180,6 +180,12 @@ declare module "zlib" {
|
|
|
180
180
|
* If `true`, returns an object with `buffer` and `engine`.
|
|
181
181
|
*/
|
|
182
182
|
info?: boolean | undefined;
|
|
183
|
+
/**
|
|
184
|
+
* Optional dictionary used to improve compression efficiency when compressing or decompressing data that
|
|
185
|
+
* shares common patterns with the dictionary.
|
|
186
|
+
* @since v24.6.0
|
|
187
|
+
*/
|
|
188
|
+
dictionary?: NodeJS.ArrayBufferView | undefined;
|
|
183
189
|
}
|
|
184
190
|
interface Zlib {
|
|
185
191
|
readonly bytesWritten: number;
|
|
@@ -22,14 +22,10 @@ declare namespace Agent {
|
|
|
22
22
|
export interface Options extends Pool.Options {
|
|
23
23
|
/** Default: `(origin, opts) => new Pool(origin, opts)`. */
|
|
24
24
|
factory?(origin: string | URL, opts: Object): Dispatcher;
|
|
25
|
-
/** Integer. Default: `0` */
|
|
26
|
-
maxRedirections?: number;
|
|
27
25
|
|
|
28
26
|
interceptors?: { Agent?: readonly Dispatcher.DispatchInterceptor[] } & Pool.Options['interceptors']
|
|
29
27
|
}
|
|
30
28
|
|
|
31
29
|
export interface DispatchOptions extends Dispatcher.DispatchOptions {
|
|
32
|
-
/** Integer. */
|
|
33
|
-
maxRedirections?: number;
|
|
34
30
|
}
|
|
35
31
|
}
|
|
@@ -71,8 +71,6 @@ export declare namespace Client {
|
|
|
71
71
|
/** TODO */
|
|
72
72
|
maxCachedSessions?: number;
|
|
73
73
|
/** TODO */
|
|
74
|
-
maxRedirections?: number;
|
|
75
|
-
/** TODO */
|
|
76
74
|
connect?: Partial<buildConnector.BuildOptions> | buildConnector.connector;
|
|
77
75
|
/** TODO */
|
|
78
76
|
maxRequestsPerClient?: number;
|
|
@@ -135,8 +135,6 @@ declare namespace Dispatcher {
|
|
|
135
135
|
signal?: AbortSignal | EventEmitter | null;
|
|
136
136
|
/** This argument parameter is passed through to `ConnectData` */
|
|
137
137
|
opaque?: TOpaque;
|
|
138
|
-
/** Default: 0 */
|
|
139
|
-
maxRedirections?: number;
|
|
140
138
|
/** Default: false */
|
|
141
139
|
redirectionLimitReached?: boolean;
|
|
142
140
|
/** Default: `null` */
|
|
@@ -147,8 +145,6 @@ declare namespace Dispatcher {
|
|
|
147
145
|
opaque?: TOpaque;
|
|
148
146
|
/** Default: `null` */
|
|
149
147
|
signal?: AbortSignal | EventEmitter | null;
|
|
150
|
-
/** Default: 0 */
|
|
151
|
-
maxRedirections?: number;
|
|
152
148
|
/** Default: false */
|
|
153
149
|
redirectionLimitReached?: boolean;
|
|
154
150
|
/** Default: `null` */
|
|
@@ -172,8 +168,6 @@ declare namespace Dispatcher {
|
|
|
172
168
|
protocol?: string;
|
|
173
169
|
/** Default: `null` */
|
|
174
170
|
signal?: AbortSignal | EventEmitter | null;
|
|
175
|
-
/** Default: 0 */
|
|
176
|
-
maxRedirections?: number;
|
|
177
171
|
/** Default: false */
|
|
178
172
|
redirectionLimitReached?: boolean;
|
|
179
173
|
/** Default: `null` */
|
|
@@ -51,8 +51,6 @@ export declare namespace H2CClient {
|
|
|
51
51
|
/** TODO */
|
|
52
52
|
maxCachedSessions?: number;
|
|
53
53
|
/** TODO */
|
|
54
|
-
maxRedirections?: number;
|
|
55
|
-
/** TODO */
|
|
56
54
|
connect?: Omit<Partial<buildConnector.BuildOptions>, 'allowH2'> | buildConnector.connector;
|
|
57
55
|
/** TODO */
|
|
58
56
|
maxRequestsPerClient?: number;
|
|
@@ -13,6 +13,7 @@ import Agent from './agent'
|
|
|
13
13
|
import MockClient from './mock-client'
|
|
14
14
|
import MockPool from './mock-pool'
|
|
15
15
|
import MockAgent from './mock-agent'
|
|
16
|
+
import { SnapshotAgent } from './snapshot-agent'
|
|
16
17
|
import { MockCallHistory, MockCallHistoryLog } from './mock-call-history'
|
|
17
18
|
import mockErrors from './mock-errors'
|
|
18
19
|
import ProxyAgent from './proxy-agent'
|
|
@@ -33,7 +34,7 @@ export * from './content-type'
|
|
|
33
34
|
export * from './cache'
|
|
34
35
|
export { Interceptable } from './mock-interceptor'
|
|
35
36
|
|
|
36
|
-
export { Dispatcher, BalancedPool, Pool, Client, buildConnector, errors, Agent, request, stream, pipeline, connect, upgrade, setGlobalDispatcher, getGlobalDispatcher, setGlobalOrigin, getGlobalOrigin, interceptors, MockClient, MockPool, MockAgent, MockCallHistory, MockCallHistoryLog, mockErrors, ProxyAgent, EnvHttpProxyAgent, RedirectHandler, DecoratorHandler, RetryHandler, RetryAgent, H2CClient }
|
|
37
|
+
export { Dispatcher, BalancedPool, Pool, Client, buildConnector, errors, Agent, request, stream, pipeline, connect, upgrade, setGlobalDispatcher, getGlobalDispatcher, setGlobalOrigin, getGlobalOrigin, interceptors, MockClient, MockPool, MockAgent, SnapshotAgent, MockCallHistory, MockCallHistoryLog, mockErrors, ProxyAgent, EnvHttpProxyAgent, RedirectHandler, DecoratorHandler, RetryHandler, RetryAgent, H2CClient }
|
|
37
38
|
export default Undici
|
|
38
39
|
|
|
39
40
|
declare namespace Undici {
|
|
@@ -58,6 +59,7 @@ declare namespace Undici {
|
|
|
58
59
|
const MockClient: typeof import('./mock-client').default
|
|
59
60
|
const MockPool: typeof import('./mock-pool').default
|
|
60
61
|
const MockAgent: typeof import('./mock-agent').default
|
|
62
|
+
const SnapshotAgent: typeof import('./snapshot-agent').SnapshotAgent
|
|
61
63
|
const MockCallHistory: typeof import('./mock-call-history').MockCallHistory
|
|
62
64
|
const MockCallHistoryLog: typeof import('./mock-call-history').MockCallHistoryLog
|
|
63
65
|
const mockErrors: typeof import('./mock-errors').default
|
|
@@ -69,7 +69,6 @@ declare namespace MockInterceptor {
|
|
|
69
69
|
headers?: Headers | Record<string, string>;
|
|
70
70
|
origin?: string;
|
|
71
71
|
body?: BodyInit | Dispatcher.DispatchOptions['body'] | null;
|
|
72
|
-
maxRedirections?: number;
|
|
73
72
|
}
|
|
74
73
|
|
|
75
74
|
export type MockResponseDataHandler<TData extends object = object> = (
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import MockAgent from './mock-agent'
|
|
2
|
+
|
|
3
|
+
declare class SnapshotRecorder {
|
|
4
|
+
constructor (options?: SnapshotRecorder.Options)
|
|
5
|
+
|
|
6
|
+
record (requestOpts: any, response: any): Promise<void>
|
|
7
|
+
findSnapshot (requestOpts: any): SnapshotRecorder.Snapshot | undefined
|
|
8
|
+
loadSnapshots (filePath?: string): Promise<void>
|
|
9
|
+
saveSnapshots (filePath?: string): Promise<void>
|
|
10
|
+
clear (): void
|
|
11
|
+
getSnapshots (): SnapshotRecorder.Snapshot[]
|
|
12
|
+
size (): number
|
|
13
|
+
resetCallCounts (): void
|
|
14
|
+
deleteSnapshot (requestOpts: any): boolean
|
|
15
|
+
getSnapshotInfo (requestOpts: any): SnapshotRecorder.SnapshotInfo | null
|
|
16
|
+
replaceSnapshots (snapshotData: SnapshotRecorder.SnapshotData[]): void
|
|
17
|
+
destroy (): void
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare namespace SnapshotRecorder {
|
|
21
|
+
export interface Options {
|
|
22
|
+
snapshotPath?: string
|
|
23
|
+
mode?: 'record' | 'playback' | 'update'
|
|
24
|
+
maxSnapshots?: number
|
|
25
|
+
autoFlush?: boolean
|
|
26
|
+
flushInterval?: number
|
|
27
|
+
matchHeaders?: string[]
|
|
28
|
+
ignoreHeaders?: string[]
|
|
29
|
+
excludeHeaders?: string[]
|
|
30
|
+
matchBody?: boolean
|
|
31
|
+
matchQuery?: boolean
|
|
32
|
+
caseSensitive?: boolean
|
|
33
|
+
shouldRecord?: (requestOpts: any) => boolean
|
|
34
|
+
shouldPlayback?: (requestOpts: any) => boolean
|
|
35
|
+
excludeUrls?: (string | RegExp)[]
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface Snapshot {
|
|
39
|
+
request: {
|
|
40
|
+
method: string
|
|
41
|
+
url: string
|
|
42
|
+
headers: Record<string, string>
|
|
43
|
+
body?: string
|
|
44
|
+
}
|
|
45
|
+
responses: {
|
|
46
|
+
statusCode: number
|
|
47
|
+
headers: Record<string, string>
|
|
48
|
+
body: string
|
|
49
|
+
trailers: Record<string, string>
|
|
50
|
+
}[]
|
|
51
|
+
callCount: number
|
|
52
|
+
timestamp: string
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface SnapshotInfo {
|
|
56
|
+
hash: string
|
|
57
|
+
request: {
|
|
58
|
+
method: string
|
|
59
|
+
url: string
|
|
60
|
+
headers: Record<string, string>
|
|
61
|
+
body?: string
|
|
62
|
+
}
|
|
63
|
+
responseCount: number
|
|
64
|
+
callCount: number
|
|
65
|
+
timestamp: string
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface SnapshotData {
|
|
69
|
+
hash: string
|
|
70
|
+
snapshot: Snapshot
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
declare class SnapshotAgent extends MockAgent {
|
|
75
|
+
constructor (options?: SnapshotAgent.Options)
|
|
76
|
+
|
|
77
|
+
saveSnapshots (filePath?: string): Promise<void>
|
|
78
|
+
loadSnapshots (filePath?: string): Promise<void>
|
|
79
|
+
getRecorder (): SnapshotRecorder
|
|
80
|
+
getMode (): 'record' | 'playback' | 'update'
|
|
81
|
+
clearSnapshots (): void
|
|
82
|
+
resetCallCounts (): void
|
|
83
|
+
deleteSnapshot (requestOpts: any): boolean
|
|
84
|
+
getSnapshotInfo (requestOpts: any): SnapshotRecorder.SnapshotInfo | null
|
|
85
|
+
replaceSnapshots (snapshotData: SnapshotRecorder.SnapshotData[]): void
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
declare namespace SnapshotAgent {
|
|
89
|
+
export interface Options extends MockAgent.Options {
|
|
90
|
+
mode?: 'record' | 'playback' | 'update'
|
|
91
|
+
snapshotPath?: string
|
|
92
|
+
maxSnapshots?: number
|
|
93
|
+
autoFlush?: boolean
|
|
94
|
+
flushInterval?: number
|
|
95
|
+
matchHeaders?: string[]
|
|
96
|
+
ignoreHeaders?: string[]
|
|
97
|
+
excludeHeaders?: string[]
|
|
98
|
+
matchBody?: boolean
|
|
99
|
+
matchQuery?: boolean
|
|
100
|
+
caseSensitive?: boolean
|
|
101
|
+
shouldRecord?: (requestOpts: any) => boolean
|
|
102
|
+
shouldPlayback?: (requestOpts: any) => boolean
|
|
103
|
+
excludeUrls?: (string | RegExp)[]
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export { SnapshotAgent, SnapshotRecorder }
|
package/package.json
CHANGED
|
@@ -50,11 +50,11 @@
|
|
|
50
50
|
"jest": "^27",
|
|
51
51
|
"jest-junit": "^16",
|
|
52
52
|
"jsii": "5.7.x",
|
|
53
|
-
"jsii-diff": "^1.
|
|
53
|
+
"jsii-diff": "^1.115.0",
|
|
54
54
|
"jsii-docgen": "^10.5.0",
|
|
55
|
-
"jsii-pacmak": "^1.
|
|
55
|
+
"jsii-pacmak": "^1.115.0",
|
|
56
56
|
"jsii-rosetta": "5.7.x",
|
|
57
|
-
"projen": "0.96.
|
|
57
|
+
"projen": "0.96.5",
|
|
58
58
|
"ts-jest": "^27",
|
|
59
59
|
"typescript": "^5"
|
|
60
60
|
},
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"publishConfig": {
|
|
88
88
|
"access": "public"
|
|
89
89
|
},
|
|
90
|
-
"version": "2.0.
|
|
90
|
+
"version": "2.0.1292",
|
|
91
91
|
"jest": {
|
|
92
92
|
"coverageProvider": "v8",
|
|
93
93
|
"testMatch": [
|