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