@types/artillery 1.6.3 → 1.7.1
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.
- artillery/LICENSE +0 -0
- artillery/README.md +3 -20
- artillery/index.d.ts +162 -9
- artillery/package.json +9 -7
artillery/LICENSE
CHANGED
|
File without changes
|
artillery/README.md
CHANGED
|
@@ -6,28 +6,11 @@ This package contains type definitions for artillery (https://github.com/artille
|
|
|
6
6
|
|
|
7
7
|
# Details
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/artillery.
|
|
9
|
-
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/artillery/index.d.ts)
|
|
10
|
-
````ts
|
|
11
|
-
// Type definitions for artillery 1.6
|
|
12
|
-
// Project: https://github.com/artilleryio/artillery
|
|
13
|
-
// Definitions by: DefinitelyTyped <https://github.com/DefinitelyTyped>
|
|
14
|
-
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
15
|
-
// TypeScript Version: 2.3
|
|
16
|
-
import * as request from 'request';
|
|
17
|
-
import * as events from 'events';
|
|
18
|
-
|
|
19
|
-
export interface ScenarioContext { vars: {[key: string]: any}; }
|
|
20
|
-
export type Next = (err?: Error) => void;
|
|
21
|
-
export type ResponseRequest = request.ResponseRequest;
|
|
22
|
-
export type RequestResponse = request.RequestResponse;
|
|
23
|
-
export type EventEmitter = events.EventEmitter;
|
|
24
|
-
|
|
25
|
-
````
|
|
26
9
|
|
|
27
10
|
### Additional Details
|
|
28
|
-
* Last updated:
|
|
29
|
-
* Dependencies: [@types/
|
|
11
|
+
* Last updated: Fri, 22 Sep 2023 18:11:04 GMT
|
|
12
|
+
* Dependencies: [@types/got](https://npmjs.com/package/@types/got), [@types/node](https://npmjs.com/package/@types/node), [@types/node:events](https://npmjs.com/package/@types/node:events), [@types/tough-cookie](https://npmjs.com/package/@types/tough-cookie)
|
|
30
13
|
* Global values: none
|
|
31
14
|
|
|
32
15
|
# Credits
|
|
33
|
-
These definitions were written by [
|
|
16
|
+
These definitions were written by [BendingBender](https://github.com/BendingBender).
|
artillery/index.d.ts
CHANGED
|
@@ -1,13 +1,166 @@
|
|
|
1
|
-
// Type definitions for artillery 1.
|
|
1
|
+
// Type definitions for artillery 1.7
|
|
2
2
|
// Project: https://github.com/artilleryio/artillery
|
|
3
|
-
// Definitions by:
|
|
3
|
+
// Definitions by: BendingBender <https://github.com/BendingBender>
|
|
4
4
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
5
|
-
// TypeScript Version: 2.3
|
|
6
|
-
import * as request from 'request';
|
|
7
|
-
import * as events from 'events';
|
|
8
5
|
|
|
9
|
-
|
|
6
|
+
/// <reference types="node" />
|
|
7
|
+
|
|
8
|
+
import { OptionsOfJSONResponseBody, OptionsOfTextResponseBody, OptionsOfUnknownResponseBody, Response } from "got";
|
|
9
|
+
import * as events from "node:events";
|
|
10
|
+
import { CookieJar } from "tough-cookie";
|
|
11
|
+
|
|
12
|
+
export type ActionFn<
|
|
13
|
+
TContextVars extends Record<string, unknown> = Record<string, unknown>,
|
|
14
|
+
TContextFuncs extends Record<string, (...args: any[]) => any> = Record<string, (...args: any[]) => any>,
|
|
15
|
+
> = (context: ScenarioContext<TContextVars, TContextFuncs>, ee: EventEmitter, next: Next) => void;
|
|
16
|
+
|
|
17
|
+
export type BeforeScenarioFn<
|
|
18
|
+
TContextVars extends Record<string, unknown> = Record<string, unknown>,
|
|
19
|
+
TContextFuncs extends Record<string, (...args: any[]) => any> = Record<string, (...args: any[]) => any>,
|
|
20
|
+
> = ActionFn<TContextVars, TContextFuncs>;
|
|
21
|
+
|
|
22
|
+
export type AfterScenarioFn<
|
|
23
|
+
TContextVars extends Record<string, unknown> = Record<string, unknown>,
|
|
24
|
+
TContextFuncs extends Record<string, (...args: any[]) => any> = Record<string, (...args: any[]) => any>,
|
|
25
|
+
> = ActionFn<TContextVars, TContextFuncs>;
|
|
26
|
+
|
|
27
|
+
export type BeforeRequestFn<
|
|
28
|
+
TContextVars extends Record<string, unknown> = Record<string, unknown>,
|
|
29
|
+
TContextFuncs extends Record<string, (...args: any[]) => any> = Record<string, (...args: any[]) => any>,
|
|
30
|
+
> = (
|
|
31
|
+
requestParams: RequestParams,
|
|
32
|
+
context: ScenarioContext<TContextVars, TContextFuncs>,
|
|
33
|
+
ee: EventEmitter,
|
|
34
|
+
next: Next,
|
|
35
|
+
) => void;
|
|
36
|
+
|
|
37
|
+
export type AfterResponseFn<
|
|
38
|
+
TContextVars extends Record<string, unknown> = Record<string, unknown>,
|
|
39
|
+
TContextFuncs extends Record<string, (...args: any[]) => any> = Record<string, (...args: any[]) => any>,
|
|
40
|
+
> = (
|
|
41
|
+
requestConfig:
|
|
42
|
+
& OptionsOfTextResponseBody
|
|
43
|
+
& OptionsOfJSONResponseBody
|
|
44
|
+
& OptionsOfUnknownResponseBody
|
|
45
|
+
& Record<string, unknown>,
|
|
46
|
+
response: Response,
|
|
47
|
+
context: ScenarioContext<TContextVars, TContextFuncs>,
|
|
48
|
+
ee: EventEmitter,
|
|
49
|
+
next: Next,
|
|
50
|
+
) => void;
|
|
51
|
+
|
|
52
|
+
export interface ScenarioContext<
|
|
53
|
+
TContextVars extends Record<string, unknown> = Record<string, unknown>,
|
|
54
|
+
TContextFuncs extends Record<string, (...args: any[]) => any> = Record<string, (...args: any[]) => any>,
|
|
55
|
+
> {
|
|
56
|
+
vars: TContextVars & ContextVars;
|
|
57
|
+
funcs: TContextFuncs & ContextFuncs;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface ContextVars {
|
|
61
|
+
target: string | undefined;
|
|
62
|
+
$environment: string | undefined;
|
|
63
|
+
$processEnvironment: Record<string, string>;
|
|
64
|
+
$uuid: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface ContextFuncs {
|
|
68
|
+
$randomNumber(max?: number): number;
|
|
69
|
+
// tslint:disable-next-line:unified-signatures
|
|
70
|
+
$randomNumber(min: number, max: number): number;
|
|
71
|
+
$randomString(length?: number): string;
|
|
72
|
+
$template<T>(input: T): T;
|
|
73
|
+
}
|
|
10
74
|
export type Next = (err?: Error) => void;
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
75
|
+
export interface EventEmitter extends events.EventEmitter {
|
|
76
|
+
addListener(
|
|
77
|
+
eventName: "counter" | "histogram" | "customStat",
|
|
78
|
+
listener: (name: string, value: number) => void,
|
|
79
|
+
): this;
|
|
80
|
+
addListener(eventName: "started" | "request", listener: () => void): this;
|
|
81
|
+
addListener(eventName: "error", listener: (error: unknown) => void): this;
|
|
82
|
+
addListener(eventName: "match", listener: (success: boolean, match: Match) => void): this;
|
|
83
|
+
addListener(eventName: "response", listener: (delta: number, code: number, uid: string) => void): this;
|
|
84
|
+
addListener(eventName: string | symbol, listener: (...args: unknown[]) => void): this;
|
|
85
|
+
on(eventName: "counter" | "histogram" | "customStat", listener: (name: string, value: number) => void): this;
|
|
86
|
+
on(eventName: "started" | "request", listener: () => void): this;
|
|
87
|
+
on(eventName: "error", listener: (error: unknown) => void): this;
|
|
88
|
+
on(eventName: "match", listener: (success: boolean, match: Match) => void): this;
|
|
89
|
+
on(eventName: "response", listener: (delta: number, code: number, uid: string) => void): this;
|
|
90
|
+
on(eventName: string | symbol, listener: (...args: unknown[]) => void): this;
|
|
91
|
+
once(eventName: "counter" | "histogram" | "customStat", listener: (name: string, value: number) => void): this;
|
|
92
|
+
once(eventName: "started" | "request", listener: () => void): this;
|
|
93
|
+
once(eventName: "error", listener: (error: unknown) => void): this;
|
|
94
|
+
once(eventName: "match", listener: (success: boolean, match: Match) => void): this;
|
|
95
|
+
once(eventName: "response", listener: (delta: number, code: number, uid: string) => void): this;
|
|
96
|
+
once(eventName: string | symbol, listener: (...args: unknown[]) => void): this;
|
|
97
|
+
removeListener(
|
|
98
|
+
eventName: "counter" | "histogram" | "customStat",
|
|
99
|
+
listener: (name: string, value: number) => void,
|
|
100
|
+
): this;
|
|
101
|
+
removeListener(eventName: "started" | "request", listener: () => void): this;
|
|
102
|
+
removeListener(eventName: "error", listener: (error: unknown) => void): this;
|
|
103
|
+
removeListener(eventName: "match", listener: (success: boolean, match: Match) => void): this;
|
|
104
|
+
removeListener(eventName: "response", listener: (delta: number, code: number, uid: string) => void): this;
|
|
105
|
+
removeListener(eventName: string | symbol, listener: (...args: unknown[]) => void): this;
|
|
106
|
+
off(eventName: "counter" | "histogram" | "customStat", listener: (name: string, value: number) => void): this;
|
|
107
|
+
off(eventName: "started" | "request", listener: () => void): this;
|
|
108
|
+
off(eventName: "error", listener: (error: unknown) => void): this;
|
|
109
|
+
off(eventName: "match", listener: (success: boolean, match: Match) => void): this;
|
|
110
|
+
off(eventName: "response", listener: (delta: number, code: number, uid: string) => void): this;
|
|
111
|
+
off(eventName: string | symbol, listener: (...args: unknown[]) => void): this;
|
|
112
|
+
emit(eventName: "counter" | "histogram" | "customStat", name: string, value: number): boolean;
|
|
113
|
+
emit(eventName: "started" | "request"): boolean;
|
|
114
|
+
emit(eventName: "error", error: unknown): boolean;
|
|
115
|
+
emit(eventName: "match", success: boolean, match: Match): boolean;
|
|
116
|
+
emit(eventName: "response", delta: number, code: number, uid: string): boolean;
|
|
117
|
+
emit(eventName: string | symbol, ...args: unknown[]): boolean;
|
|
118
|
+
prependListener(
|
|
119
|
+
eventName: "counter" | "histogram" | "customStat",
|
|
120
|
+
listener: (name: string, value: number) => void,
|
|
121
|
+
): this;
|
|
122
|
+
prependListener(eventName: "started" | "request", listener: () => void): this;
|
|
123
|
+
prependListener(eventName: "error", listener: (error: unknown) => void): this;
|
|
124
|
+
prependListener(eventName: "match", listener: (success: boolean, match: Match) => void): this;
|
|
125
|
+
prependListener(eventName: "response", listener: (delta: number, code: number, uid: string) => void): this;
|
|
126
|
+
prependListener(eventName: string | symbol, listener: (...args: unknown[]) => void): this;
|
|
127
|
+
prependOnceListener(
|
|
128
|
+
eventName: "counter" | "histogram" | "customStat",
|
|
129
|
+
listener: (name: string, value: number) => void,
|
|
130
|
+
): this;
|
|
131
|
+
prependOnceListener(eventName: "started" | "request", listener: () => void): this;
|
|
132
|
+
prependOnceListener(eventName: "error", listener: (error: unknown) => void): this;
|
|
133
|
+
prependOnceListener(eventName: "match", listener: (success: boolean, match: Match) => void): this;
|
|
134
|
+
prependOnceListener(eventName: "response", listener: (delta: number, code: number, uid: string) => void): this;
|
|
135
|
+
prependOnceListener(eventName: string | symbol, listener: (...args: unknown[]) => void): this;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export interface Match {
|
|
139
|
+
expected: string;
|
|
140
|
+
got?: string;
|
|
141
|
+
expression: string;
|
|
142
|
+
strict?: boolean;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export interface RequestParams {
|
|
146
|
+
[key: string]: unknown;
|
|
147
|
+
|
|
148
|
+
url?: string;
|
|
149
|
+
uri?: string;
|
|
150
|
+
method: string;
|
|
151
|
+
headers: Record<string, string>;
|
|
152
|
+
timeout: number;
|
|
153
|
+
json?: Record<string | number, unknown>;
|
|
154
|
+
form?: Record<string | number, unknown>;
|
|
155
|
+
formData?: Record<string | number, unknown>;
|
|
156
|
+
cookieJar?: CookieJar;
|
|
157
|
+
https?: Record<string, unknown>;
|
|
158
|
+
body?: unknown;
|
|
159
|
+
name?: string;
|
|
160
|
+
followRedirect?: boolean;
|
|
161
|
+
followAllRedirects?: boolean;
|
|
162
|
+
auth?: {
|
|
163
|
+
user: string;
|
|
164
|
+
pass: string;
|
|
165
|
+
};
|
|
166
|
+
}
|
artillery/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/artillery",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.1",
|
|
4
4
|
"description": "TypeScript definitions for artillery",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/artillery",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"contributors": [
|
|
8
8
|
{
|
|
9
|
-
"name": "
|
|
10
|
-
"url": "https://github.com/
|
|
11
|
-
"githubUsername": "
|
|
9
|
+
"name": "BendingBender",
|
|
10
|
+
"url": "https://github.com/BendingBender",
|
|
11
|
+
"githubUsername": "BendingBender"
|
|
12
12
|
}
|
|
13
13
|
],
|
|
14
14
|
"main": "",
|
|
@@ -20,8 +20,10 @@
|
|
|
20
20
|
},
|
|
21
21
|
"scripts": {},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@types/
|
|
23
|
+
"@types/node": "*",
|
|
24
|
+
"@types/tough-cookie": "*",
|
|
25
|
+
"got": "^11.8.5"
|
|
24
26
|
},
|
|
25
|
-
"typesPublisherContentHash": "
|
|
26
|
-
"typeScriptVersion": "
|
|
27
|
+
"typesPublisherContentHash": "e3f420de2ad435ed4aa35cd4fc25dce8d4ac41db39255941ffd30f89a97b31fa",
|
|
28
|
+
"typeScriptVersion": "4.5"
|
|
27
29
|
}
|