@grafana/openapi-to-k6 0.3.1 → 0.4.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.
- package/.github/workflows/publish.yaml +39 -13
- package/.github/workflows/tests.yaml +23 -10
- package/.nvmrc +1 -1
- package/CODEOWNERS +2 -0
- package/README.md +34 -39
- package/catalog-info.yaml +13 -0
- package/dist/generator/k6Client.js +7 -4
- package/examples/basic_schema/single/simpleAPI.ts +5 -3
- package/examples/basic_schema/split/simpleAPI.schemas.ts +1 -1
- package/examples/basic_schema/split/simpleAPI.ts +5 -3
- package/examples/basic_schema/tags/default.ts +5 -3
- package/examples/basic_schema/tags/simpleAPI.schemas.ts +1 -1
- package/examples/form_data_schema/single/formDataAPI.ts +15 -13
- package/examples/form_data_schema/split/formDataAPI.schemas.ts +11 -11
- package/examples/form_data_schema/split/formDataAPI.ts +5 -3
- package/examples/form_data_schema/tags/default.ts +5 -3
- package/examples/form_data_schema/tags/formDataAPI.schemas.ts +11 -11
- package/examples/form_url_encoded_data_schema/single/formURLEncodedAPI.ts +15 -13
- package/examples/form_url_encoded_data_schema/split/formURLEncodedAPI.schemas.ts +11 -11
- package/examples/form_url_encoded_data_schema/split/formURLEncodedAPI.ts +5 -3
- package/examples/form_url_encoded_data_schema/tags/default.ts +5 -3
- package/examples/form_url_encoded_data_schema/tags/formURLEncodedAPI.schemas.ts +11 -11
- package/examples/form_url_encoded_data_with_query_params_schema/single/formURLEncodedAPIWithQueryParameters.ts +22 -20
- package/examples/form_url_encoded_data_with_query_params_schema/split/formURLEncodedAPIWithQueryParameters.schemas.ts +18 -18
- package/examples/form_url_encoded_data_with_query_params_schema/split/formURLEncodedAPIWithQueryParameters.ts +5 -3
- package/examples/form_url_encoded_data_with_query_params_schema/tags/default.ts +5 -3
- package/examples/form_url_encoded_data_with_query_params_schema/tags/formURLEncodedAPIWithQueryParameters.schemas.ts +18 -18
- package/examples/get_request_with_path_parameters_schema/single/simpleAPI.ts +5 -3
- package/examples/get_request_with_path_parameters_schema/split/simpleAPI.schemas.ts +1 -1
- package/examples/get_request_with_path_parameters_schema/split/simpleAPI.ts +5 -3
- package/examples/get_request_with_path_parameters_schema/tags/default.ts +5 -3
- package/examples/get_request_with_path_parameters_schema/tags/simpleAPI.schemas.ts +1 -1
- package/examples/headers_schema/single/headerDemoAPI.ts +24 -18
- package/examples/headers_schema/split/headerDemoAPI.schemas.ts +12 -12
- package/examples/headers_schema/split/headerDemoAPI.ts +13 -7
- package/examples/headers_schema/tags/default.ts +13 -7
- package/examples/headers_schema/tags/headerDemoAPI.schemas.ts +12 -12
- package/examples/no_title_schema/single/k6Client.ts +5 -3
- package/examples/no_title_schema/split/k6Client.schemas.ts +1 -1
- package/examples/no_title_schema/split/k6Client.ts +5 -3
- package/examples/no_title_schema/tags/default.ts +5 -3
- package/examples/no_title_schema/tags/k6Client.schemas.ts +1 -1
- package/examples/post_request_with_query_params/single/exampleAPI.ts +21 -19
- package/examples/post_request_with_query_params/split/exampleAPI.schemas.ts +17 -17
- package/examples/post_request_with_query_params/split/exampleAPI.ts +5 -3
- package/examples/post_request_with_query_params/tags/default.ts +5 -3
- package/examples/post_request_with_query_params/tags/exampleAPI.schemas.ts +17 -17
- package/examples/query_params_schema/single/exampleAPI.ts +13 -11
- package/examples/query_params_schema/split/exampleAPI.schemas.ts +9 -9
- package/examples/query_params_schema/split/exampleAPI.ts +5 -3
- package/examples/query_params_schema/tags/default.ts +5 -3
- package/examples/query_params_schema/tags/exampleAPI.schemas.ts +9 -9
- package/examples/simple_post_request_schema/single/exampleAPI.ts +21 -19
- package/examples/simple_post_request_schema/split/exampleAPI.schemas.ts +17 -17
- package/examples/simple_post_request_schema/split/exampleAPI.ts +5 -3
- package/examples/simple_post_request_schema/tags/default.ts +5 -3
- package/examples/simple_post_request_schema/tags/exampleAPI.schemas.ts +17 -17
- package/package.json +20 -20
- package/renovate.json +6 -0
- package/src/generator/k6Client.ts +9 -3
- package/tests/functional-tests/test-generator/fixtures/form_data_schema.json +2 -2
- package/tests/functional-tests/test-generator/fixtures/form_url_encoded_data_schema.json +2 -2
- package/tests/functional-tests/test-generator/fixtures/form_url_encoded_data_with_query_params_schema.json +1 -1
- package/tests/functional-tests/test-generator/fixtures/get_request_with_path_parameters_schema.json +1 -1
- package/tests/functional-tests/test-generator/fixtures/headers_schema.json +6 -6
- package/tests/functional-tests/test-generator/fixtures/simple_post_request_schema.json +1 -1
- package/tests/functional-tests/test-generator/generator.test.ts +9 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Automatically generated by @grafana/openapi-to-k6: 0.
|
|
2
|
+
* Automatically generated by @grafana/openapi-to-k6: 0.4.1
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Form Data API
|
|
5
5
|
* Service version: 1.0.0
|
|
@@ -36,6 +36,7 @@ export class DefaultClient {
|
|
|
36
36
|
): {
|
|
37
37
|
response: Response
|
|
38
38
|
data: PostUpload200
|
|
39
|
+
operationId: string
|
|
39
40
|
} {
|
|
40
41
|
const formData = new FormData()
|
|
41
42
|
formData.append('file', postUploadBody.file)
|
|
@@ -44,12 +45,12 @@ export class DefaultClient {
|
|
|
44
45
|
}
|
|
45
46
|
formData.append('userId', postUploadBody.userId)
|
|
46
47
|
|
|
47
|
-
const
|
|
48
|
+
const k6url = new URL(this.cleanBaseUrl + `/upload`)
|
|
48
49
|
const mergedRequestParameters = this._mergeRequestParameters(
|
|
49
50
|
requestParameters || {},
|
|
50
51
|
this.commonRequestParameters
|
|
51
52
|
)
|
|
52
|
-
const response = http.request('POST',
|
|
53
|
+
const response = http.request('POST', k6url.toString(), formData.body(), {
|
|
53
54
|
...mergedRequestParameters,
|
|
54
55
|
headers: {
|
|
55
56
|
...mergedRequestParameters?.headers,
|
|
@@ -66,6 +67,7 @@ export class DefaultClient {
|
|
|
66
67
|
return {
|
|
67
68
|
response,
|
|
68
69
|
data,
|
|
70
|
+
operationId: 'PostUpload',
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
73
|
|
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Automatically generated by @grafana/openapi-to-k6: 0.
|
|
2
|
+
* Automatically generated by @grafana/openapi-to-k6: 0.4.1
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Form Data API
|
|
5
5
|
* Service version: 1.0.0
|
|
6
6
|
*/
|
|
7
|
-
export type PostUpload400 = {
|
|
8
|
-
success?: boolean
|
|
9
|
-
error?: string
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export type PostUpload200 = {
|
|
13
|
-
success?: boolean
|
|
14
|
-
message?: string
|
|
15
|
-
}
|
|
16
|
-
|
|
17
7
|
export type PostUploadBody = {
|
|
18
8
|
/** File to upload */
|
|
19
9
|
file: Blob
|
|
@@ -22,3 +12,13 @@ export type PostUploadBody = {
|
|
|
22
12
|
/** User ID associated with the upload */
|
|
23
13
|
userId: string
|
|
24
14
|
}
|
|
15
|
+
|
|
16
|
+
export type PostUpload200 = {
|
|
17
|
+
success?: boolean
|
|
18
|
+
message?: string
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type PostUpload400 = {
|
|
22
|
+
success?: boolean
|
|
23
|
+
error?: string
|
|
24
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Automatically generated by @grafana/openapi-to-k6: 0.
|
|
2
|
+
* Automatically generated by @grafana/openapi-to-k6: 0.4.1
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Form URL Encoded API
|
|
5
5
|
* Service version: 1.0.0
|
|
@@ -7,16 +7,6 @@
|
|
|
7
7
|
import { URL } from 'https://jslib.k6.io/url/1.0.0/index.js'
|
|
8
8
|
import http from 'k6/http'
|
|
9
9
|
import type { Params, Response } from 'k6/http'
|
|
10
|
-
export type PostSubmitForm400 = {
|
|
11
|
-
success?: boolean
|
|
12
|
-
error?: string
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export type PostSubmitForm200 = {
|
|
16
|
-
success?: boolean
|
|
17
|
-
message?: string
|
|
18
|
-
}
|
|
19
|
-
|
|
20
10
|
export type PostSubmitFormBody = {
|
|
21
11
|
/** Name of the user */
|
|
22
12
|
name: string
|
|
@@ -26,6 +16,16 @@ export type PostSubmitFormBody = {
|
|
|
26
16
|
email: string
|
|
27
17
|
}
|
|
28
18
|
|
|
19
|
+
export type PostSubmitForm200 = {
|
|
20
|
+
success?: boolean
|
|
21
|
+
message?: string
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type PostSubmitForm400 = {
|
|
25
|
+
success?: boolean
|
|
26
|
+
error?: string
|
|
27
|
+
}
|
|
28
|
+
|
|
29
29
|
/**
|
|
30
30
|
* This is the base client to use for interacting with the API.
|
|
31
31
|
*/
|
|
@@ -52,15 +52,16 @@ export class FormURLEncodedAPIClient {
|
|
|
52
52
|
): {
|
|
53
53
|
response: Response
|
|
54
54
|
data: PostSubmitForm200
|
|
55
|
+
operationId: string
|
|
55
56
|
} {
|
|
56
|
-
const
|
|
57
|
+
const k6url = new URL(this.cleanBaseUrl + `/submit-form`)
|
|
57
58
|
const mergedRequestParameters = this._mergeRequestParameters(
|
|
58
59
|
requestParameters || {},
|
|
59
60
|
this.commonRequestParameters
|
|
60
61
|
)
|
|
61
62
|
const response = http.request(
|
|
62
63
|
'POST',
|
|
63
|
-
|
|
64
|
+
k6url.toString(),
|
|
64
65
|
JSON.stringify(postSubmitFormBody),
|
|
65
66
|
{
|
|
66
67
|
...mergedRequestParameters,
|
|
@@ -80,6 +81,7 @@ export class FormURLEncodedAPIClient {
|
|
|
80
81
|
return {
|
|
81
82
|
response,
|
|
82
83
|
data,
|
|
84
|
+
operationId: 'PostSubmitForm',
|
|
83
85
|
}
|
|
84
86
|
}
|
|
85
87
|
|
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Automatically generated by @grafana/openapi-to-k6: 0.
|
|
2
|
+
* Automatically generated by @grafana/openapi-to-k6: 0.4.1
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Form URL Encoded API
|
|
5
5
|
* Service version: 1.0.0
|
|
6
6
|
*/
|
|
7
|
-
export type PostSubmitForm400 = {
|
|
8
|
-
success?: boolean
|
|
9
|
-
error?: string
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export type PostSubmitForm200 = {
|
|
13
|
-
success?: boolean
|
|
14
|
-
message?: string
|
|
15
|
-
}
|
|
16
|
-
|
|
17
7
|
export type PostSubmitFormBody = {
|
|
18
8
|
/** Name of the user */
|
|
19
9
|
name: string
|
|
@@ -22,3 +12,13 @@ export type PostSubmitFormBody = {
|
|
|
22
12
|
/** Email address of the user */
|
|
23
13
|
email: string
|
|
24
14
|
}
|
|
15
|
+
|
|
16
|
+
export type PostSubmitForm200 = {
|
|
17
|
+
success?: boolean
|
|
18
|
+
message?: string
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type PostSubmitForm400 = {
|
|
22
|
+
success?: boolean
|
|
23
|
+
error?: string
|
|
24
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Automatically generated by @grafana/openapi-to-k6: 0.
|
|
2
|
+
* Automatically generated by @grafana/openapi-to-k6: 0.4.1
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Form URL Encoded API
|
|
5
5
|
* Service version: 1.0.0
|
|
@@ -38,15 +38,16 @@ export class FormURLEncodedAPIClient {
|
|
|
38
38
|
): {
|
|
39
39
|
response: Response
|
|
40
40
|
data: PostSubmitForm200
|
|
41
|
+
operationId: string
|
|
41
42
|
} {
|
|
42
|
-
const
|
|
43
|
+
const k6url = new URL(this.cleanBaseUrl + `/submit-form`)
|
|
43
44
|
const mergedRequestParameters = this._mergeRequestParameters(
|
|
44
45
|
requestParameters || {},
|
|
45
46
|
this.commonRequestParameters
|
|
46
47
|
)
|
|
47
48
|
const response = http.request(
|
|
48
49
|
'POST',
|
|
49
|
-
|
|
50
|
+
k6url.toString(),
|
|
50
51
|
JSON.stringify(postSubmitFormBody),
|
|
51
52
|
{
|
|
52
53
|
...mergedRequestParameters,
|
|
@@ -66,6 +67,7 @@ export class FormURLEncodedAPIClient {
|
|
|
66
67
|
return {
|
|
67
68
|
response,
|
|
68
69
|
data,
|
|
70
|
+
operationId: 'PostSubmitForm',
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
73
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Automatically generated by @grafana/openapi-to-k6: 0.
|
|
2
|
+
* Automatically generated by @grafana/openapi-to-k6: 0.4.1
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Form URL Encoded API
|
|
5
5
|
* Service version: 1.0.0
|
|
@@ -38,15 +38,16 @@ export class DefaultClient {
|
|
|
38
38
|
): {
|
|
39
39
|
response: Response
|
|
40
40
|
data: PostSubmitForm200
|
|
41
|
+
operationId: string
|
|
41
42
|
} {
|
|
42
|
-
const
|
|
43
|
+
const k6url = new URL(this.cleanBaseUrl + `/submit-form`)
|
|
43
44
|
const mergedRequestParameters = this._mergeRequestParameters(
|
|
44
45
|
requestParameters || {},
|
|
45
46
|
this.commonRequestParameters
|
|
46
47
|
)
|
|
47
48
|
const response = http.request(
|
|
48
49
|
'POST',
|
|
49
|
-
|
|
50
|
+
k6url.toString(),
|
|
50
51
|
JSON.stringify(postSubmitFormBody),
|
|
51
52
|
{
|
|
52
53
|
...mergedRequestParameters,
|
|
@@ -66,6 +67,7 @@ export class DefaultClient {
|
|
|
66
67
|
return {
|
|
67
68
|
response,
|
|
68
69
|
data,
|
|
70
|
+
operationId: 'PostSubmitForm',
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
73
|
|
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Automatically generated by @grafana/openapi-to-k6: 0.
|
|
2
|
+
* Automatically generated by @grafana/openapi-to-k6: 0.4.1
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Form URL Encoded API
|
|
5
5
|
* Service version: 1.0.0
|
|
6
6
|
*/
|
|
7
|
-
export type PostSubmitForm400 = {
|
|
8
|
-
success?: boolean
|
|
9
|
-
error?: string
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export type PostSubmitForm200 = {
|
|
13
|
-
success?: boolean
|
|
14
|
-
message?: string
|
|
15
|
-
}
|
|
16
|
-
|
|
17
7
|
export type PostSubmitFormBody = {
|
|
18
8
|
/** Name of the user */
|
|
19
9
|
name: string
|
|
@@ -22,3 +12,13 @@ export type PostSubmitFormBody = {
|
|
|
22
12
|
/** Email address of the user */
|
|
23
13
|
email: string
|
|
24
14
|
}
|
|
15
|
+
|
|
16
|
+
export type PostSubmitForm200 = {
|
|
17
|
+
success?: boolean
|
|
18
|
+
message?: string
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type PostSubmitForm400 = {
|
|
22
|
+
success?: boolean
|
|
23
|
+
error?: string
|
|
24
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Automatically generated by @grafana/openapi-to-k6: 0.
|
|
2
|
+
* Automatically generated by @grafana/openapi-to-k6: 0.4.1
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Form URL Encoded API with Query Parameters
|
|
5
5
|
* Service version: 1.0.0
|
|
@@ -7,14 +7,15 @@
|
|
|
7
7
|
import { URL, URLSearchParams } from 'https://jslib.k6.io/url/1.0.0/index.js'
|
|
8
8
|
import http from 'k6/http'
|
|
9
9
|
import type { Params, Response } from 'k6/http'
|
|
10
|
-
export type
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
export type PostSubmitFormParams = {
|
|
11
|
+
/**
|
|
12
|
+
* Authentication token
|
|
13
|
+
*/
|
|
14
|
+
token: string
|
|
15
|
+
/**
|
|
16
|
+
* Locale of the user
|
|
17
|
+
*/
|
|
18
|
+
locale?: string
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
export type PostSubmitFormBody = {
|
|
@@ -26,15 +27,14 @@ export type PostSubmitFormBody = {
|
|
|
26
27
|
email: string
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
export type
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
locale?: string
|
|
30
|
+
export type PostSubmitForm200 = {
|
|
31
|
+
success?: boolean
|
|
32
|
+
message?: string
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type PostSubmitForm400 = {
|
|
36
|
+
success?: boolean
|
|
37
|
+
error?: string
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
/**
|
|
@@ -64,8 +64,9 @@ export class FormURLEncodedAPIWithQueryParametersClient {
|
|
|
64
64
|
): {
|
|
65
65
|
response: Response
|
|
66
66
|
data: PostSubmitForm200
|
|
67
|
+
operationId: string
|
|
67
68
|
} {
|
|
68
|
-
const
|
|
69
|
+
const k6url = new URL(
|
|
69
70
|
this.cleanBaseUrl +
|
|
70
71
|
`/submit-form` +
|
|
71
72
|
`?${new URLSearchParams(params).toString()}`
|
|
@@ -76,7 +77,7 @@ export class FormURLEncodedAPIWithQueryParametersClient {
|
|
|
76
77
|
)
|
|
77
78
|
const response = http.request(
|
|
78
79
|
'POST',
|
|
79
|
-
|
|
80
|
+
k6url.toString(),
|
|
80
81
|
JSON.stringify(postSubmitFormBody),
|
|
81
82
|
{
|
|
82
83
|
...mergedRequestParameters,
|
|
@@ -96,6 +97,7 @@ export class FormURLEncodedAPIWithQueryParametersClient {
|
|
|
96
97
|
return {
|
|
97
98
|
response,
|
|
98
99
|
data,
|
|
100
|
+
operationId: 'PostSubmitForm',
|
|
99
101
|
}
|
|
100
102
|
}
|
|
101
103
|
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Automatically generated by @grafana/openapi-to-k6: 0.
|
|
2
|
+
* Automatically generated by @grafana/openapi-to-k6: 0.4.1
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Form URL Encoded API with Query Parameters
|
|
5
5
|
* Service version: 1.0.0
|
|
6
6
|
*/
|
|
7
|
-
export type
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
export type PostSubmitFormParams = {
|
|
8
|
+
/**
|
|
9
|
+
* Authentication token
|
|
10
|
+
*/
|
|
11
|
+
token: string
|
|
12
|
+
/**
|
|
13
|
+
* Locale of the user
|
|
14
|
+
*/
|
|
15
|
+
locale?: string
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export type PostSubmitFormBody = {
|
|
@@ -23,13 +24,12 @@ export type PostSubmitFormBody = {
|
|
|
23
24
|
email: string
|
|
24
25
|
}
|
|
25
26
|
|
|
26
|
-
export type
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
locale?: string
|
|
27
|
+
export type PostSubmitForm200 = {
|
|
28
|
+
success?: boolean
|
|
29
|
+
message?: string
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type PostSubmitForm400 = {
|
|
33
|
+
success?: boolean
|
|
34
|
+
error?: string
|
|
35
35
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Automatically generated by @grafana/openapi-to-k6: 0.
|
|
2
|
+
* Automatically generated by @grafana/openapi-to-k6: 0.4.1
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Form URL Encoded API with Query Parameters
|
|
5
5
|
* Service version: 1.0.0
|
|
@@ -40,8 +40,9 @@ export class FormURLEncodedAPIWithQueryParametersClient {
|
|
|
40
40
|
): {
|
|
41
41
|
response: Response
|
|
42
42
|
data: PostSubmitForm200
|
|
43
|
+
operationId: string
|
|
43
44
|
} {
|
|
44
|
-
const
|
|
45
|
+
const k6url = new URL(
|
|
45
46
|
this.cleanBaseUrl +
|
|
46
47
|
`/submit-form` +
|
|
47
48
|
`?${new URLSearchParams(params).toString()}`
|
|
@@ -52,7 +53,7 @@ export class FormURLEncodedAPIWithQueryParametersClient {
|
|
|
52
53
|
)
|
|
53
54
|
const response = http.request(
|
|
54
55
|
'POST',
|
|
55
|
-
|
|
56
|
+
k6url.toString(),
|
|
56
57
|
JSON.stringify(postSubmitFormBody),
|
|
57
58
|
{
|
|
58
59
|
...mergedRequestParameters,
|
|
@@ -72,6 +73,7 @@ export class FormURLEncodedAPIWithQueryParametersClient {
|
|
|
72
73
|
return {
|
|
73
74
|
response,
|
|
74
75
|
data,
|
|
76
|
+
operationId: 'PostSubmitForm',
|
|
75
77
|
}
|
|
76
78
|
}
|
|
77
79
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Automatically generated by @grafana/openapi-to-k6: 0.
|
|
2
|
+
* Automatically generated by @grafana/openapi-to-k6: 0.4.1
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Form URL Encoded API with Query Parameters
|
|
5
5
|
* Service version: 1.0.0
|
|
@@ -40,8 +40,9 @@ export class DefaultClient {
|
|
|
40
40
|
): {
|
|
41
41
|
response: Response
|
|
42
42
|
data: PostSubmitForm200
|
|
43
|
+
operationId: string
|
|
43
44
|
} {
|
|
44
|
-
const
|
|
45
|
+
const k6url = new URL(
|
|
45
46
|
this.cleanBaseUrl +
|
|
46
47
|
`/submit-form` +
|
|
47
48
|
`?${new URLSearchParams(params).toString()}`
|
|
@@ -52,7 +53,7 @@ export class DefaultClient {
|
|
|
52
53
|
)
|
|
53
54
|
const response = http.request(
|
|
54
55
|
'POST',
|
|
55
|
-
|
|
56
|
+
k6url.toString(),
|
|
56
57
|
JSON.stringify(postSubmitFormBody),
|
|
57
58
|
{
|
|
58
59
|
...mergedRequestParameters,
|
|
@@ -72,6 +73,7 @@ export class DefaultClient {
|
|
|
72
73
|
return {
|
|
73
74
|
response,
|
|
74
75
|
data,
|
|
76
|
+
operationId: 'PostSubmitForm',
|
|
75
77
|
}
|
|
76
78
|
}
|
|
77
79
|
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Automatically generated by @grafana/openapi-to-k6: 0.
|
|
2
|
+
* Automatically generated by @grafana/openapi-to-k6: 0.4.1
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Form URL Encoded API with Query Parameters
|
|
5
5
|
* Service version: 1.0.0
|
|
6
6
|
*/
|
|
7
|
-
export type
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
export type PostSubmitFormParams = {
|
|
8
|
+
/**
|
|
9
|
+
* Authentication token
|
|
10
|
+
*/
|
|
11
|
+
token: string
|
|
12
|
+
/**
|
|
13
|
+
* Locale of the user
|
|
14
|
+
*/
|
|
15
|
+
locale?: string
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export type PostSubmitFormBody = {
|
|
@@ -23,13 +24,12 @@ export type PostSubmitFormBody = {
|
|
|
23
24
|
email: string
|
|
24
25
|
}
|
|
25
26
|
|
|
26
|
-
export type
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
locale?: string
|
|
27
|
+
export type PostSubmitForm200 = {
|
|
28
|
+
success?: boolean
|
|
29
|
+
message?: string
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type PostSubmitForm400 = {
|
|
33
|
+
success?: boolean
|
|
34
|
+
error?: string
|
|
35
35
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Automatically generated by @grafana/openapi-to-k6: 0.
|
|
2
|
+
* Automatically generated by @grafana/openapi-to-k6: 0.4.1
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Simple API
|
|
5
5
|
* An API with a single GET request that takes a path parameter
|
|
@@ -40,15 +40,16 @@ export class SimpleAPIClient {
|
|
|
40
40
|
): {
|
|
41
41
|
response: Response
|
|
42
42
|
data: GetItemById200
|
|
43
|
+
operationId: string
|
|
43
44
|
} {
|
|
44
|
-
const
|
|
45
|
+
const k6url = new URL(this.cleanBaseUrl + `/items/${id}`)
|
|
45
46
|
const mergedRequestParameters = this._mergeRequestParameters(
|
|
46
47
|
requestParameters || {},
|
|
47
48
|
this.commonRequestParameters
|
|
48
49
|
)
|
|
49
50
|
const response = http.request(
|
|
50
51
|
'GET',
|
|
51
|
-
|
|
52
|
+
k6url.toString(),
|
|
52
53
|
undefined,
|
|
53
54
|
mergedRequestParameters
|
|
54
55
|
)
|
|
@@ -62,6 +63,7 @@ export class SimpleAPIClient {
|
|
|
62
63
|
return {
|
|
63
64
|
response,
|
|
64
65
|
data,
|
|
66
|
+
operationId: 'getItemById',
|
|
65
67
|
}
|
|
66
68
|
}
|
|
67
69
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Automatically generated by @grafana/openapi-to-k6: 0.
|
|
2
|
+
* Automatically generated by @grafana/openapi-to-k6: 0.4.1
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Simple API
|
|
5
5
|
* An API with a single GET request that takes a path parameter
|
|
@@ -36,15 +36,16 @@ export class SimpleAPIClient {
|
|
|
36
36
|
): {
|
|
37
37
|
response: Response
|
|
38
38
|
data: GetItemById200
|
|
39
|
+
operationId: string
|
|
39
40
|
} {
|
|
40
|
-
const
|
|
41
|
+
const k6url = new URL(this.cleanBaseUrl + `/items/${id}`)
|
|
41
42
|
const mergedRequestParameters = this._mergeRequestParameters(
|
|
42
43
|
requestParameters || {},
|
|
43
44
|
this.commonRequestParameters
|
|
44
45
|
)
|
|
45
46
|
const response = http.request(
|
|
46
47
|
'GET',
|
|
47
|
-
|
|
48
|
+
k6url.toString(),
|
|
48
49
|
undefined,
|
|
49
50
|
mergedRequestParameters
|
|
50
51
|
)
|
|
@@ -58,6 +59,7 @@ export class SimpleAPIClient {
|
|
|
58
59
|
return {
|
|
59
60
|
response,
|
|
60
61
|
data,
|
|
62
|
+
operationId: 'getItemById',
|
|
61
63
|
}
|
|
62
64
|
}
|
|
63
65
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Automatically generated by @grafana/openapi-to-k6: 0.
|
|
2
|
+
* Automatically generated by @grafana/openapi-to-k6: 0.4.1
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Simple API
|
|
5
5
|
* An API with a single GET request that takes a path parameter
|
|
@@ -36,15 +36,16 @@ export class DefaultClient {
|
|
|
36
36
|
): {
|
|
37
37
|
response: Response
|
|
38
38
|
data: GetItemById200
|
|
39
|
+
operationId: string
|
|
39
40
|
} {
|
|
40
|
-
const
|
|
41
|
+
const k6url = new URL(this.cleanBaseUrl + `/items/${id}`)
|
|
41
42
|
const mergedRequestParameters = this._mergeRequestParameters(
|
|
42
43
|
requestParameters || {},
|
|
43
44
|
this.commonRequestParameters
|
|
44
45
|
)
|
|
45
46
|
const response = http.request(
|
|
46
47
|
'GET',
|
|
47
|
-
|
|
48
|
+
k6url.toString(),
|
|
48
49
|
undefined,
|
|
49
50
|
mergedRequestParameters
|
|
50
51
|
)
|
|
@@ -58,6 +59,7 @@ export class DefaultClient {
|
|
|
58
59
|
return {
|
|
59
60
|
response,
|
|
60
61
|
data,
|
|
62
|
+
operationId: 'getItemById',
|
|
61
63
|
}
|
|
62
64
|
}
|
|
63
65
|
|