@types/k6 0.34.0 → 0.34.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.
- k6/README.md +1 -1
- k6/http.d.ts +41 -19
- k6/package.json +2 -2
k6/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for k6 (https://k6.io/docs/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/k6.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Tue, 05 Oct 2021 12:01:19 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
* Global values: none
|
|
14
14
|
|
k6/http.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { Selection } from './html';
|
|
|
10
10
|
* @returns Resulting response.
|
|
11
11
|
*/
|
|
12
12
|
export function del<RT extends ResponseType | undefined>(
|
|
13
|
-
url: string,
|
|
13
|
+
url: string | HttpURL,
|
|
14
14
|
body?: RequestBody | null,
|
|
15
15
|
params?: RefinedParams<RT> | null
|
|
16
16
|
): RefinedResponse<RT>;
|
|
@@ -25,7 +25,7 @@ export function del<RT extends ResponseType | undefined>(
|
|
|
25
25
|
* http.get('https://k6.io')
|
|
26
26
|
*/
|
|
27
27
|
export function get<RT extends ResponseType | undefined>(
|
|
28
|
-
url: string,
|
|
28
|
+
url: string | HttpURL,
|
|
29
29
|
params?: RefinedParams<RT> | null
|
|
30
30
|
): RefinedResponse<RT>;
|
|
31
31
|
|
|
@@ -38,7 +38,7 @@ export function get<RT extends ResponseType | undefined>(
|
|
|
38
38
|
* @returns Resulting response.
|
|
39
39
|
*/
|
|
40
40
|
export function options<RT extends ResponseType | undefined>(
|
|
41
|
-
url: string,
|
|
41
|
+
url: string | HttpURL,
|
|
42
42
|
body?: RequestBody | null,
|
|
43
43
|
params?: RefinedParams<RT> | null
|
|
44
44
|
): RefinedResponse<RT>;
|
|
@@ -52,7 +52,7 @@ export function options<RT extends ResponseType | undefined>(
|
|
|
52
52
|
* @returns Resulting response.
|
|
53
53
|
*/
|
|
54
54
|
export function patch<RT extends ResponseType | undefined>(
|
|
55
|
-
url: string,
|
|
55
|
+
url: string | HttpURL,
|
|
56
56
|
body?: RequestBody | null,
|
|
57
57
|
params?: RefinedParams<RT> | null
|
|
58
58
|
): RefinedResponse<RT>;
|
|
@@ -70,7 +70,7 @@ export function patch<RT extends ResponseType | undefined>(
|
|
|
70
70
|
* http.post(url, formData, { headers: headers });
|
|
71
71
|
*/
|
|
72
72
|
export function post<RT extends ResponseType | undefined>(
|
|
73
|
-
url: string,
|
|
73
|
+
url: string | HttpURL,
|
|
74
74
|
body?: RequestBody | null,
|
|
75
75
|
params?: RefinedParams<RT> | null
|
|
76
76
|
): RefinedResponse<RT>;
|
|
@@ -84,7 +84,7 @@ export function post<RT extends ResponseType | undefined>(
|
|
|
84
84
|
* @returns Resulting response.
|
|
85
85
|
*/
|
|
86
86
|
export function put<RT extends ResponseType | undefined>(
|
|
87
|
-
url: string,
|
|
87
|
+
url: string | HttpURL,
|
|
88
88
|
body?: RequestBody | null,
|
|
89
89
|
params?: RefinedParams<RT> | null
|
|
90
90
|
): RefinedResponse<RT>;
|
|
@@ -104,7 +104,7 @@ export function put<RT extends ResponseType | undefined>(
|
|
|
104
104
|
*/
|
|
105
105
|
export function request<RT extends ResponseType | undefined>(
|
|
106
106
|
method: string,
|
|
107
|
-
url: string,
|
|
107
|
+
url: string | HttpURL,
|
|
108
108
|
body?: RequestBody | null,
|
|
109
109
|
params?: RefinedParams<RT> | null
|
|
110
110
|
): RefinedResponse<RT>;
|
|
@@ -307,12 +307,12 @@ export interface StructuredRequestBody {
|
|
|
307
307
|
* Batch request specification.
|
|
308
308
|
* https://k6.io/docs/javascript-api/k6-http/batch-requests
|
|
309
309
|
*/
|
|
310
|
-
export type BatchRequest = string | ArrayBatchRequest | ObjectBatchRequest;
|
|
310
|
+
export type BatchRequest = string | HttpURL | ArrayBatchRequest | ObjectBatchRequest;
|
|
311
311
|
|
|
312
312
|
/**
|
|
313
313
|
* Array form batch request specification.
|
|
314
314
|
*/
|
|
315
|
-
export type ArrayBatchRequest = [ string, string, (RequestBody | null)?, (Params | null)? ];
|
|
315
|
+
export type ArrayBatchRequest = [ string, string | HttpURL, (RequestBody | null)?, (Params | null)? ];
|
|
316
316
|
|
|
317
317
|
/**
|
|
318
318
|
* Object form batch request specification.
|
|
@@ -322,7 +322,7 @@ export interface ObjectBatchRequest {
|
|
|
322
322
|
method: string;
|
|
323
323
|
|
|
324
324
|
/** Request URL. */
|
|
325
|
-
url: string;
|
|
325
|
+
url: string | HttpURL;
|
|
326
326
|
|
|
327
327
|
/** Request body. */
|
|
328
328
|
body?: RequestBody | null;
|
|
@@ -345,6 +345,7 @@ export type BatchRequests = BatchRequest[] | { [name: string]: BatchRequest };
|
|
|
345
345
|
*/
|
|
346
346
|
export type RefinedBatchRequest<RT extends ResponseType | undefined> =
|
|
347
347
|
| string
|
|
348
|
+
| HttpURL
|
|
348
349
|
| ArrayRefinedBatchRequest<RT>
|
|
349
350
|
| ObjectRefinedBatchRequest<RT>;
|
|
350
351
|
|
|
@@ -353,7 +354,7 @@ export type RefinedBatchRequest<RT extends ResponseType | undefined> =
|
|
|
353
354
|
*/
|
|
354
355
|
export type ArrayRefinedBatchRequest<RT extends ResponseType | undefined> = [
|
|
355
356
|
string,
|
|
356
|
-
string,
|
|
357
|
+
string | HttpURL ,
|
|
357
358
|
(RequestBody | null)?,
|
|
358
359
|
(RefinedParams<RT> | null)?
|
|
359
360
|
];
|
|
@@ -363,7 +364,7 @@ export type ArrayRefinedBatchRequest<RT extends ResponseType | undefined> = [
|
|
|
363
364
|
*/
|
|
364
365
|
export interface ObjectRefinedBatchRequest<RT extends ResponseType | undefined> {
|
|
365
366
|
method: string;
|
|
366
|
-
url: string;
|
|
367
|
+
url: string | HttpURL;
|
|
367
368
|
body?: RequestBody | null;
|
|
368
369
|
params?: RefinedParams<RT> | null;
|
|
369
370
|
}
|
|
@@ -734,6 +735,16 @@ export interface ExpectedStatusesObject {
|
|
|
734
735
|
max: number;
|
|
735
736
|
}
|
|
736
737
|
|
|
738
|
+
// === HTTP URL ===
|
|
739
|
+
// -----------------------
|
|
740
|
+
|
|
741
|
+
/**
|
|
742
|
+
* Returned value from http.url method.
|
|
743
|
+
*/
|
|
744
|
+
interface HttpURL {
|
|
745
|
+
__brand: "http-url";
|
|
746
|
+
}
|
|
747
|
+
|
|
737
748
|
/**
|
|
738
749
|
* The http module contains functionality for performing HTTP transactions.
|
|
739
750
|
* https://k6.io/docs/javascript-api/k6-http/
|
|
@@ -748,7 +759,7 @@ declare namespace http {
|
|
|
748
759
|
* @returns Resulting response.
|
|
749
760
|
*/
|
|
750
761
|
function del<RT extends ResponseType | undefined>(
|
|
751
|
-
url: string,
|
|
762
|
+
url: string | HttpURL,
|
|
752
763
|
body?: RequestBody | null,
|
|
753
764
|
params?: RefinedParams<RT> | null
|
|
754
765
|
): RefinedResponse<RT>;
|
|
@@ -763,7 +774,7 @@ declare namespace http {
|
|
|
763
774
|
* http.get('https://k6.io')
|
|
764
775
|
*/
|
|
765
776
|
function get<RT extends ResponseType | undefined>(
|
|
766
|
-
url: string,
|
|
777
|
+
url: string | HttpURL,
|
|
767
778
|
params?: RefinedParams<RT> | null
|
|
768
779
|
): RefinedResponse<RT>;
|
|
769
780
|
|
|
@@ -776,7 +787,7 @@ declare namespace http {
|
|
|
776
787
|
* @returns Resulting response.
|
|
777
788
|
*/
|
|
778
789
|
function options<RT extends ResponseType | undefined>(
|
|
779
|
-
url: string,
|
|
790
|
+
url: string | HttpURL,
|
|
780
791
|
body?: RequestBody | null,
|
|
781
792
|
params?: RefinedParams<RT> | null
|
|
782
793
|
): RefinedResponse<RT>;
|
|
@@ -790,7 +801,7 @@ declare namespace http {
|
|
|
790
801
|
* @returns Resulting response.
|
|
791
802
|
*/
|
|
792
803
|
function patch<RT extends ResponseType | undefined>(
|
|
793
|
-
url: string,
|
|
804
|
+
url: string | HttpURL,
|
|
794
805
|
body?: RequestBody | null,
|
|
795
806
|
params?: RefinedParams<RT> | null
|
|
796
807
|
): RefinedResponse<RT>;
|
|
@@ -808,7 +819,7 @@ declare namespace http {
|
|
|
808
819
|
* http.post(url, formData, { headers: headers });
|
|
809
820
|
*/
|
|
810
821
|
function post<RT extends ResponseType | undefined>(
|
|
811
|
-
url: string,
|
|
822
|
+
url: string | HttpURL,
|
|
812
823
|
body?: RequestBody | null,
|
|
813
824
|
params?: RefinedParams<RT> | null
|
|
814
825
|
): RefinedResponse<RT>;
|
|
@@ -822,7 +833,7 @@ declare namespace http {
|
|
|
822
833
|
* @returns Resulting response.
|
|
823
834
|
*/
|
|
824
835
|
function put<RT extends ResponseType | undefined>(
|
|
825
|
-
url: string,
|
|
836
|
+
url: string | HttpURL,
|
|
826
837
|
body?: RequestBody | null,
|
|
827
838
|
params?: RefinedParams<RT> | null
|
|
828
839
|
): RefinedResponse<RT>;
|
|
@@ -842,11 +853,22 @@ declare namespace http {
|
|
|
842
853
|
*/
|
|
843
854
|
function request<RT extends ResponseType | undefined>(
|
|
844
855
|
method: string,
|
|
845
|
-
url: string,
|
|
856
|
+
url: string | HttpURL,
|
|
846
857
|
body?: RequestBody | null,
|
|
847
858
|
params?: RefinedParams<RT> | null
|
|
848
859
|
): RefinedResponse<RT>;
|
|
849
860
|
|
|
861
|
+
/**
|
|
862
|
+
* Creates a URL with set name tag.
|
|
863
|
+
* https://k6.io/docs/using-k6/http-requests/#url-grouping
|
|
864
|
+
* @param strings - Passed string values.
|
|
865
|
+
* @param args - Tagged template expressions.
|
|
866
|
+
* @returns HTTP URL object.
|
|
867
|
+
* @example
|
|
868
|
+
* http.get(http.url`http://example.com/posts/${id}`) // tags.name="http://example.com/posts/${}",
|
|
869
|
+
*/
|
|
870
|
+
function url(strings: TemplateStringsArray, ...args: Array<string | number | boolean>): HttpURL;
|
|
871
|
+
|
|
850
872
|
/**
|
|
851
873
|
* Batch multiple HTTP requests together,
|
|
852
874
|
* to issue them in parallel over multiple TCP connections.
|
k6/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/k6",
|
|
3
|
-
"version": "0.34.
|
|
3
|
+
"version": "0.34.1",
|
|
4
4
|
"description": "TypeScript definitions for k6",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/k6",
|
|
6
6
|
"license": "MIT",
|
|
@@ -50,6 +50,6 @@
|
|
|
50
50
|
},
|
|
51
51
|
"scripts": {},
|
|
52
52
|
"dependencies": {},
|
|
53
|
-
"typesPublisherContentHash": "
|
|
53
|
+
"typesPublisherContentHash": "1464c1344e7828c4033e8647caf04d302cf4d51aa76cde676ca348aeee7e6ee8",
|
|
54
54
|
"typeScriptVersion": "3.7"
|
|
55
55
|
}
|