@types/k6 0.53.0 → 0.53.2
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.
- k6/README.md +1 -1
- k6/{crypto.d.ts → crypto/index.d.ts} +1 -162
- k6/encoding/index.d.ts +46 -0
- k6/execution/index.d.ts +115 -0
- k6/experimental/{fs.d.ts → fs/index.d.ts} +2 -0
- k6/experimental/{redis.d.ts → redis/index.d.ts} +5 -0
- k6/experimental/streams/index.d.ts +198 -0
- k6/experimental/{tracing.d.ts → tracing/index.d.ts} +3 -1
- k6/experimental/{websockets.d.ts → websockets/index.d.ts} +3 -1
- k6/global.d.ts +11 -3
- k6/{http.d.ts → http/index.d.ts} +14 -227
- k6/index.d.ts +3 -22
- k6/net/grpc/index.d.ts +196 -0
- k6/{options.d.ts → options/index.d.ts} +1 -1
- k6/package.json +3 -2
- k6/{ws.d.ts → ws/index.d.ts} +2 -41
- k6/encoding.d.ts +0 -90
- k6/execution.d.ts +0 -121
- k6/net/grpc.d.ts +0 -202
- /k6/{browser.d.ts → browser/index.d.ts} +0 -0
- /k6/{data.d.ts → data/index.d.ts} +0 -0
- /k6/experimental/{browser.d.ts → browser/index.d.ts} +0 -0
- /k6/experimental/{timers.d.ts → timers/index.d.ts} +0 -0
- /k6/experimental/{webcrypto.d.ts → webcrypto/index.d.ts} +0 -0
- /k6/{html.d.ts → html/index.d.ts} +0 -0
- /k6/{metrics.d.ts → metrics/index.d.ts} +0 -0
- /k6/{timers.d.ts → timers/index.d.ts} +0 -0
k6/execution.d.ts
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { Options } from "./options";
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
* The execution module provides information about the current test execution state.
|
|
5
|
-
* https://grafana.com/docs/k6/latest/javascript-api/k6-execution/
|
|
6
|
-
*/
|
|
7
|
-
declare namespace execution {
|
|
8
|
-
/**
|
|
9
|
-
* Information about the current scenario.
|
|
10
|
-
*/
|
|
11
|
-
const scenario: {
|
|
12
|
-
/**
|
|
13
|
-
* The assigned name of the running scenario.
|
|
14
|
-
*/
|
|
15
|
-
name: string;
|
|
16
|
-
/**
|
|
17
|
-
* The name of the running Executor type.
|
|
18
|
-
*/
|
|
19
|
-
executor: string;
|
|
20
|
-
/**
|
|
21
|
-
* The Unix timestamp in milliseconds when the scenario started.
|
|
22
|
-
*/
|
|
23
|
-
startTime: number;
|
|
24
|
-
/**
|
|
25
|
-
* Percentage in a 0 to 1 interval of the scenario progress.
|
|
26
|
-
*/
|
|
27
|
-
progress: number;
|
|
28
|
-
/**
|
|
29
|
-
* The unique and zero-based sequential number of the current iteration in the scenario, across the current instance.
|
|
30
|
-
*/
|
|
31
|
-
iterationInInstance: number;
|
|
32
|
-
/**
|
|
33
|
-
* The unique and zero-based sequential number of the current iteration in the scenario.
|
|
34
|
-
*/
|
|
35
|
-
iterationInTest: number;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Information about the current load generator instance.
|
|
40
|
-
*/
|
|
41
|
-
const instance: {
|
|
42
|
-
/**
|
|
43
|
-
* The number of prematurely interrupted iterations in the current instance.
|
|
44
|
-
*/
|
|
45
|
-
iterationsInterrupted: number;
|
|
46
|
-
/**
|
|
47
|
-
* The number of completed iterations in the current instance.
|
|
48
|
-
*/
|
|
49
|
-
iterationsCompleted: number;
|
|
50
|
-
/**
|
|
51
|
-
* The number of active VUs.
|
|
52
|
-
*/
|
|
53
|
-
vusActive: number;
|
|
54
|
-
/**
|
|
55
|
-
* The number of currently initialized VUs.
|
|
56
|
-
*/
|
|
57
|
-
vusInitialized: number;
|
|
58
|
-
/**
|
|
59
|
-
* The time passed from the start of the current test run in milliseconds.
|
|
60
|
-
*/
|
|
61
|
-
currentTestRunDuration: number;
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Control the test execution.
|
|
66
|
-
*/
|
|
67
|
-
const test: {
|
|
68
|
-
/**
|
|
69
|
-
* Aborts the test run with the exit code 108.
|
|
70
|
-
* https://grafana.com/docs/k6/latest/javascript-api/k6-execution/#test
|
|
71
|
-
* @param input - Aborted message.
|
|
72
|
-
* @example
|
|
73
|
-
* import exec from "k6/execution";
|
|
74
|
-
* exec.test.abort();
|
|
75
|
-
* exec.test.abort('this is the reason');
|
|
76
|
-
*/
|
|
77
|
-
abort(input?: string): void;
|
|
78
|
-
|
|
79
|
-
options: Options;
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Information about the current virtual user.
|
|
84
|
-
*/
|
|
85
|
-
const vu: {
|
|
86
|
-
/**
|
|
87
|
-
* The identifier of the iteration in the current instance.
|
|
88
|
-
*/
|
|
89
|
-
iterationInInstance: number;
|
|
90
|
-
/**
|
|
91
|
-
* The identifier of the iteration in the current scenario.
|
|
92
|
-
*/
|
|
93
|
-
iterationInScenario: number;
|
|
94
|
-
/**
|
|
95
|
-
* The identifier of the VU across the instance.
|
|
96
|
-
*/
|
|
97
|
-
idInInstance: number;
|
|
98
|
-
/**
|
|
99
|
-
* The globally unique (across the whole test run) identifier of the VU.
|
|
100
|
-
*/
|
|
101
|
-
idInTest: number;
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Map to set or get VU tags.
|
|
105
|
-
* @deprecated should use `metrics.tags` instead of just `tags`
|
|
106
|
-
*/
|
|
107
|
-
tags: Record<string, number | string | boolean>;
|
|
108
|
-
metrics: {
|
|
109
|
-
/**
|
|
110
|
-
* Map to set or get VU tags.
|
|
111
|
-
*/
|
|
112
|
-
tags: Record<string, number | string | boolean>;
|
|
113
|
-
/**
|
|
114
|
-
* Map to set or get VU metadata.
|
|
115
|
-
*/
|
|
116
|
-
metadata: Record<string, number | string | boolean>;
|
|
117
|
-
};
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export default execution;
|
k6/net/grpc.d.ts
DELETED
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
// === Response ===
|
|
2
|
-
// ----------------
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* gRPC response.
|
|
6
|
-
*/
|
|
7
|
-
export interface Response {
|
|
8
|
-
status: number;
|
|
9
|
-
|
|
10
|
-
message: object;
|
|
11
|
-
|
|
12
|
-
headers: object;
|
|
13
|
-
|
|
14
|
-
trailers: object;
|
|
15
|
-
|
|
16
|
-
error: object;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface ConnectParams {
|
|
20
|
-
/**
|
|
21
|
-
* If `true` will connect to the gRPC server using plaintext i.e. insecure.
|
|
22
|
-
*/
|
|
23
|
-
plaintext?: boolean;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* If `true` connection will try to use the gRPC server reflection protocol.
|
|
27
|
-
* https://github.com/grpc/grpc/blob/master/doc/server-reflection.md
|
|
28
|
-
*/
|
|
29
|
-
reflect?: boolean;
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Metadata to send with reflection request.
|
|
33
|
-
*/
|
|
34
|
-
reflectMetadata?: object;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Connection timeout to use.
|
|
38
|
-
*/
|
|
39
|
-
timeout?: string | number;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Maximum message size in bytes the client can receive.
|
|
43
|
-
*/
|
|
44
|
-
maxReceiveSize?: number;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Maximum message size in bytes the client can send.
|
|
48
|
-
*/
|
|
49
|
-
maxSendSize?: number;
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* TLS settings of the connection.
|
|
53
|
-
*/
|
|
54
|
-
tls?: TLSParams;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export interface TLSParams {
|
|
58
|
-
/**
|
|
59
|
-
* PEM formatted client certificate.
|
|
60
|
-
*/
|
|
61
|
-
cert: string;
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* PEM formatted client private key.
|
|
65
|
-
*/
|
|
66
|
-
key: string;
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Password for decrypting the client's private key.
|
|
70
|
-
*/
|
|
71
|
-
password?: string;
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* PEM formatted string/strings of the certificate authorities.
|
|
75
|
-
*/
|
|
76
|
-
cacerts?: string | string[];
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export interface Params {
|
|
80
|
-
/**
|
|
81
|
-
* @deprecated Use metadata instead.
|
|
82
|
-
*/
|
|
83
|
-
headers?: object;
|
|
84
|
-
|
|
85
|
-
metadata?: object;
|
|
86
|
-
|
|
87
|
-
tags?: object;
|
|
88
|
-
|
|
89
|
-
timeout?: string | number;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export interface GrpcError {
|
|
93
|
-
code: number;
|
|
94
|
-
details: string[] | object[];
|
|
95
|
-
message: string;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* This module provides a gRPC client for Remote Procedure Calls over HTTP/2.
|
|
100
|
-
* https://grafana.com/docs/k6/latest/javascript-api/k6-net-grpc/
|
|
101
|
-
*/
|
|
102
|
-
declare namespace grpc {
|
|
103
|
-
/**
|
|
104
|
-
* gRPC client to interact with a gRPC server.
|
|
105
|
-
* https://grafana.com/docs/k6/latest/javascript-api/k6-net-grpc/client/
|
|
106
|
-
*/
|
|
107
|
-
class Client {
|
|
108
|
-
protected __brand: never;
|
|
109
|
-
|
|
110
|
-
constructor();
|
|
111
|
-
|
|
112
|
-
/** Opens a connection to a gRPC server. */
|
|
113
|
-
connect(address: string, params?: ConnectParams): void;
|
|
114
|
-
|
|
115
|
-
/** Loads and parses the protocol buffer descriptors. */
|
|
116
|
-
load(importPaths: string[], ...protoFiles: string[]): void;
|
|
117
|
-
|
|
118
|
-
/** Loads a protoset and parses the protocol buffer descriptors */
|
|
119
|
-
loadProtoset(protosetPath: string): void;
|
|
120
|
-
|
|
121
|
-
/** Invokes an unary RPC request. */
|
|
122
|
-
invoke(url: string, request: object, params?: Params): Response;
|
|
123
|
-
|
|
124
|
-
/** Asynchronously invokes an unary RPC request. */
|
|
125
|
-
asyncInvoke(url: string, request: object, params?: Params): Promise<Response>;
|
|
126
|
-
|
|
127
|
-
/** Close the connection. */
|
|
128
|
-
close(): void;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* StreamEvent describes the possible events that can be emitted
|
|
133
|
-
* by a gRPC stream.
|
|
134
|
-
*/
|
|
135
|
-
type StreamEvent =
|
|
136
|
-
/**
|
|
137
|
-
* Event fired when data has been received from the server.
|
|
138
|
-
*/
|
|
139
|
-
| "data"
|
|
140
|
-
/**
|
|
141
|
-
* Event fired when a stream has been closed due to an error.
|
|
142
|
-
*/
|
|
143
|
-
| "error"
|
|
144
|
-
/**
|
|
145
|
-
* Event fired when the stream closes.
|
|
146
|
-
*/
|
|
147
|
-
| "end";
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Stream allows you to use streaming RPCs.
|
|
151
|
-
*/
|
|
152
|
-
class Stream {
|
|
153
|
-
/**
|
|
154
|
-
* The gRPC stream constructor, representing a single gRPC stream.
|
|
155
|
-
*
|
|
156
|
-
* @param client - the gRPC client to use, it must be connected.
|
|
157
|
-
* @param url - the RPC method to call.
|
|
158
|
-
* @param params - the parameters to use for the RPC call.
|
|
159
|
-
*/
|
|
160
|
-
constructor(client: Client, url: string, params?: Params);
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Set up handler functions for various events on the gRPC stream.
|
|
164
|
-
*
|
|
165
|
-
* @param event - the event to listen for
|
|
166
|
-
* @param listener - the callback to invoke when the event is emitted
|
|
167
|
-
*/
|
|
168
|
-
on(event: StreamEvent, listener: (data: object | GrpcError | undefined) => void): void;
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* Writes a request to the stream.
|
|
172
|
-
*
|
|
173
|
-
* @param request - the request (message) to send to the server
|
|
174
|
-
*/
|
|
175
|
-
write(request: object): void;
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* Signals to the server that the client has finished sending messages.
|
|
179
|
-
*/
|
|
180
|
-
end(): void;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
const StatusOK: number;
|
|
184
|
-
const StatusCanceled: number;
|
|
185
|
-
const StatusUnknown: number;
|
|
186
|
-
const StatusInvalidArgument: number;
|
|
187
|
-
const StatusDeadlineExceeded: number;
|
|
188
|
-
const StatusNotFound: number;
|
|
189
|
-
const StatusAlreadyExists: number;
|
|
190
|
-
const StatusPermissionDenied: number;
|
|
191
|
-
const StatusResourceExhausted: number;
|
|
192
|
-
const StatusFailedPrecondition: number;
|
|
193
|
-
const StatusAborted: number;
|
|
194
|
-
const StatusOutOfRange: number;
|
|
195
|
-
const StatusUnimplemented: number;
|
|
196
|
-
const StatusInternal: number;
|
|
197
|
-
const StatusUnavailable: number;
|
|
198
|
-
const StatusDataLoss: number;
|
|
199
|
-
const StatusUnauthenticated: number;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
export default grpc;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|