@teemill/split-tests 1.0.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.
- package/.openapi-generator/FILES +22 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +23 -0
- package/README.md +89 -0
- package/api.ts +469 -0
- package/base.ts +62 -0
- package/common.ts +161 -0
- package/configuration.ts +121 -0
- package/dist/api.d.ts +332 -0
- package/dist/api.js +242 -0
- package/dist/base.d.ts +42 -0
- package/dist/base.js +46 -0
- package/dist/common.d.ts +70 -0
- package/dist/common.js +172 -0
- package/dist/configuration.d.ts +98 -0
- package/dist/configuration.js +44 -0
- package/dist/esm/api.d.ts +332 -0
- package/dist/esm/api.js +235 -0
- package/dist/esm/base.d.ts +42 -0
- package/dist/esm/base.js +41 -0
- package/dist/esm/common.d.ts +70 -0
- package/dist/esm/common.js +159 -0
- package/dist/esm/configuration.d.ts +98 -0
- package/dist/esm/configuration.js +40 -0
- package/dist/esm/index.d.ts +13 -0
- package/dist/esm/index.js +15 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +31 -0
- package/docs/Error.md +20 -0
- package/docs/ListSplitTests200Response.md +20 -0
- package/docs/SplitTest.md +33 -0
- package/docs/SplitTestResultBreakdown.md +33 -0
- package/docs/SplitTestResultEvent.md +29 -0
- package/docs/SplitTestResultVariation.md +33 -0
- package/docs/SplitTestResults.md +29 -0
- package/docs/SplitTestVariation.md +27 -0
- package/docs/SplitTestsApi.md +130 -0
- package/git_push.sh +57 -0
- package/index.ts +18 -0
- package/package.json +33 -0
- package/tsconfig.esm.json +7 -0
- package/tsconfig.json +18 -0
package/dist/api.js
ADDED
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Split Tests
|
|
6
|
+
* Inspect split test definitions and performance results.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
16
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
18
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
19
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
20
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
21
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.ListSplitTestsStateEnum = exports.GetSplitTestResultsBreakdownEnum = exports.SplitTestsApi = exports.SplitTestsApiFactory = exports.SplitTestsApiFp = exports.SplitTestsApiAxiosParamCreator = void 0;
|
|
26
|
+
const axios_1 = require("axios");
|
|
27
|
+
// Some imports not used depending on template conditions
|
|
28
|
+
// @ts-ignore
|
|
29
|
+
const common_1 = require("./common");
|
|
30
|
+
// @ts-ignore
|
|
31
|
+
const base_1 = require("./base");
|
|
32
|
+
/**
|
|
33
|
+
* SplitTestsApi - axios parameter creator
|
|
34
|
+
*/
|
|
35
|
+
const SplitTestsApiAxiosParamCreator = function (configuration) {
|
|
36
|
+
return {
|
|
37
|
+
/**
|
|
38
|
+
* Get aggregate split test results and optional breakdowns.
|
|
39
|
+
* @summary Get split test results
|
|
40
|
+
* @param {string} project Project identifier used to scope split test data for the current integration context.
|
|
41
|
+
* @param {string} splitTestId UUID of the split test to fetch detailed results for.
|
|
42
|
+
* @param {GetSplitTestResultsBreakdownEnum} [breakdown] Optional dimension used to group variation metrics in `breakdowns`.
|
|
43
|
+
* @param {*} [options] Override http request option.
|
|
44
|
+
* @throws {RequiredError}
|
|
45
|
+
*/
|
|
46
|
+
getSplitTestResults: (project_1, splitTestId_1, breakdown_1, ...args_1) => __awaiter(this, [project_1, splitTestId_1, breakdown_1, ...args_1], void 0, function* (project, splitTestId, breakdown, options = {}) {
|
|
47
|
+
// verify required parameter 'project' is not null or undefined
|
|
48
|
+
(0, common_1.assertParamExists)('getSplitTestResults', 'project', project);
|
|
49
|
+
// verify required parameter 'splitTestId' is not null or undefined
|
|
50
|
+
(0, common_1.assertParamExists)('getSplitTestResults', 'splitTestId', splitTestId);
|
|
51
|
+
const localVarPath = `/v1/split-tests/{splitTestId}/results`
|
|
52
|
+
.replace('{splitTestId}', encodeURIComponent(String(splitTestId)));
|
|
53
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
54
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
55
|
+
let baseOptions;
|
|
56
|
+
if (configuration) {
|
|
57
|
+
baseOptions = configuration.baseOptions;
|
|
58
|
+
}
|
|
59
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
60
|
+
const localVarHeaderParameter = {};
|
|
61
|
+
const localVarQueryParameter = {};
|
|
62
|
+
// authentication session-oauth required
|
|
63
|
+
// oauth required
|
|
64
|
+
yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "session-oauth", [], configuration);
|
|
65
|
+
// authentication api-key required
|
|
66
|
+
yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
|
|
67
|
+
if (project !== undefined) {
|
|
68
|
+
localVarQueryParameter['project'] = project;
|
|
69
|
+
}
|
|
70
|
+
if (breakdown !== undefined) {
|
|
71
|
+
localVarQueryParameter['breakdown'] = breakdown;
|
|
72
|
+
}
|
|
73
|
+
localVarHeaderParameter['Accept'] = 'application/json';
|
|
74
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
75
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
76
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
77
|
+
return {
|
|
78
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
79
|
+
options: localVarRequestOptions,
|
|
80
|
+
};
|
|
81
|
+
}),
|
|
82
|
+
/**
|
|
83
|
+
* List split tests for inspector tooling.
|
|
84
|
+
* @summary List split tests
|
|
85
|
+
* @param {string} project Project identifier used to scope split test data for the current integration context.
|
|
86
|
+
* @param {string} [search] Case-insensitive search term matched against split test name and code.
|
|
87
|
+
* @param {ListSplitTestsStateEnum} [state] Filter for which split tests to return (`active` for currently running tests, `all` for every test).
|
|
88
|
+
* @param {*} [options] Override http request option.
|
|
89
|
+
* @throws {RequiredError}
|
|
90
|
+
*/
|
|
91
|
+
listSplitTests: (project_1, search_1, state_1, ...args_1) => __awaiter(this, [project_1, search_1, state_1, ...args_1], void 0, function* (project, search, state, options = {}) {
|
|
92
|
+
// verify required parameter 'project' is not null or undefined
|
|
93
|
+
(0, common_1.assertParamExists)('listSplitTests', 'project', project);
|
|
94
|
+
const localVarPath = `/v1/split-tests`;
|
|
95
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
96
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
97
|
+
let baseOptions;
|
|
98
|
+
if (configuration) {
|
|
99
|
+
baseOptions = configuration.baseOptions;
|
|
100
|
+
}
|
|
101
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
102
|
+
const localVarHeaderParameter = {};
|
|
103
|
+
const localVarQueryParameter = {};
|
|
104
|
+
// authentication session-oauth required
|
|
105
|
+
// oauth required
|
|
106
|
+
yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "session-oauth", [], configuration);
|
|
107
|
+
// authentication api-key required
|
|
108
|
+
yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
|
|
109
|
+
if (project !== undefined) {
|
|
110
|
+
localVarQueryParameter['project'] = project;
|
|
111
|
+
}
|
|
112
|
+
if (search !== undefined) {
|
|
113
|
+
localVarQueryParameter['search'] = search;
|
|
114
|
+
}
|
|
115
|
+
if (state !== undefined) {
|
|
116
|
+
localVarQueryParameter['state'] = state;
|
|
117
|
+
}
|
|
118
|
+
localVarHeaderParameter['Accept'] = 'application/json';
|
|
119
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
120
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
121
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
122
|
+
return {
|
|
123
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
124
|
+
options: localVarRequestOptions,
|
|
125
|
+
};
|
|
126
|
+
}),
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
exports.SplitTestsApiAxiosParamCreator = SplitTestsApiAxiosParamCreator;
|
|
130
|
+
/**
|
|
131
|
+
* SplitTestsApi - functional programming interface
|
|
132
|
+
*/
|
|
133
|
+
const SplitTestsApiFp = function (configuration) {
|
|
134
|
+
const localVarAxiosParamCreator = (0, exports.SplitTestsApiAxiosParamCreator)(configuration);
|
|
135
|
+
return {
|
|
136
|
+
/**
|
|
137
|
+
* Get aggregate split test results and optional breakdowns.
|
|
138
|
+
* @summary Get split test results
|
|
139
|
+
* @param {string} project Project identifier used to scope split test data for the current integration context.
|
|
140
|
+
* @param {string} splitTestId UUID of the split test to fetch detailed results for.
|
|
141
|
+
* @param {GetSplitTestResultsBreakdownEnum} [breakdown] Optional dimension used to group variation metrics in `breakdowns`.
|
|
142
|
+
* @param {*} [options] Override http request option.
|
|
143
|
+
* @throws {RequiredError}
|
|
144
|
+
*/
|
|
145
|
+
getSplitTestResults(project, splitTestId, breakdown, options) {
|
|
146
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
147
|
+
var _a, _b, _c;
|
|
148
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getSplitTestResults(project, splitTestId, breakdown, options);
|
|
149
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
150
|
+
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['SplitTestsApi.getSplitTestResults']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
151
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
152
|
+
});
|
|
153
|
+
},
|
|
154
|
+
/**
|
|
155
|
+
* List split tests for inspector tooling.
|
|
156
|
+
* @summary List split tests
|
|
157
|
+
* @param {string} project Project identifier used to scope split test data for the current integration context.
|
|
158
|
+
* @param {string} [search] Case-insensitive search term matched against split test name and code.
|
|
159
|
+
* @param {ListSplitTestsStateEnum} [state] Filter for which split tests to return (`active` for currently running tests, `all` for every test).
|
|
160
|
+
* @param {*} [options] Override http request option.
|
|
161
|
+
* @throws {RequiredError}
|
|
162
|
+
*/
|
|
163
|
+
listSplitTests(project, search, state, options) {
|
|
164
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
165
|
+
var _a, _b, _c;
|
|
166
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.listSplitTests(project, search, state, options);
|
|
167
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
168
|
+
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['SplitTestsApi.listSplitTests']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
169
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
170
|
+
});
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
exports.SplitTestsApiFp = SplitTestsApiFp;
|
|
175
|
+
/**
|
|
176
|
+
* SplitTestsApi - factory interface
|
|
177
|
+
*/
|
|
178
|
+
const SplitTestsApiFactory = function (configuration, basePath, axios) {
|
|
179
|
+
const localVarFp = (0, exports.SplitTestsApiFp)(configuration);
|
|
180
|
+
return {
|
|
181
|
+
/**
|
|
182
|
+
* Get aggregate split test results and optional breakdowns.
|
|
183
|
+
* @summary Get split test results
|
|
184
|
+
* @param {SplitTestsApiGetSplitTestResultsRequest} requestParameters Request parameters.
|
|
185
|
+
* @param {*} [options] Override http request option.
|
|
186
|
+
* @throws {RequiredError}
|
|
187
|
+
*/
|
|
188
|
+
getSplitTestResults(requestParameters, options) {
|
|
189
|
+
return localVarFp.getSplitTestResults(requestParameters.project, requestParameters.splitTestId, requestParameters.breakdown, options).then((request) => request(axios, basePath));
|
|
190
|
+
},
|
|
191
|
+
/**
|
|
192
|
+
* List split tests for inspector tooling.
|
|
193
|
+
* @summary List split tests
|
|
194
|
+
* @param {SplitTestsApiListSplitTestsRequest} requestParameters Request parameters.
|
|
195
|
+
* @param {*} [options] Override http request option.
|
|
196
|
+
* @throws {RequiredError}
|
|
197
|
+
*/
|
|
198
|
+
listSplitTests(requestParameters, options) {
|
|
199
|
+
return localVarFp.listSplitTests(requestParameters.project, requestParameters.search, requestParameters.state, options).then((request) => request(axios, basePath));
|
|
200
|
+
},
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
exports.SplitTestsApiFactory = SplitTestsApiFactory;
|
|
204
|
+
/**
|
|
205
|
+
* SplitTestsApi - object-oriented interface
|
|
206
|
+
*/
|
|
207
|
+
class SplitTestsApi extends base_1.BaseAPI {
|
|
208
|
+
/**
|
|
209
|
+
* Get aggregate split test results and optional breakdowns.
|
|
210
|
+
* @summary Get split test results
|
|
211
|
+
* @param {SplitTestsApiGetSplitTestResultsRequest} requestParameters Request parameters.
|
|
212
|
+
* @param {*} [options] Override http request option.
|
|
213
|
+
* @throws {RequiredError}
|
|
214
|
+
*/
|
|
215
|
+
getSplitTestResults(requestParameters, options) {
|
|
216
|
+
return (0, exports.SplitTestsApiFp)(this.configuration).getSplitTestResults(requestParameters.project, requestParameters.splitTestId, requestParameters.breakdown, options).then((request) => request(this.axios, this.basePath));
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* List split tests for inspector tooling.
|
|
220
|
+
* @summary List split tests
|
|
221
|
+
* @param {SplitTestsApiListSplitTestsRequest} requestParameters Request parameters.
|
|
222
|
+
* @param {*} [options] Override http request option.
|
|
223
|
+
* @throws {RequiredError}
|
|
224
|
+
*/
|
|
225
|
+
listSplitTests(requestParameters, options) {
|
|
226
|
+
return (0, exports.SplitTestsApiFp)(this.configuration).listSplitTests(requestParameters.project, requestParameters.search, requestParameters.state, options).then((request) => request(this.axios, this.basePath));
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
exports.SplitTestsApi = SplitTestsApi;
|
|
230
|
+
exports.GetSplitTestResultsBreakdownEnum = {
|
|
231
|
+
None: 'none',
|
|
232
|
+
Device: 'device',
|
|
233
|
+
Platform: 'platform',
|
|
234
|
+
Browser: 'browser',
|
|
235
|
+
Country: 'country',
|
|
236
|
+
Territory: 'territory',
|
|
237
|
+
Domain: 'domain',
|
|
238
|
+
};
|
|
239
|
+
exports.ListSplitTestsStateEnum = {
|
|
240
|
+
Active: 'active',
|
|
241
|
+
All: 'all',
|
|
242
|
+
};
|
package/dist/base.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Split Tests
|
|
3
|
+
* Inspect split test definitions and performance results.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import type { Configuration } from './configuration';
|
|
13
|
+
import type { AxiosInstance, RawAxiosRequestConfig } from 'axios';
|
|
14
|
+
export declare const BASE_PATH: string;
|
|
15
|
+
export declare const COLLECTION_FORMATS: {
|
|
16
|
+
csv: string;
|
|
17
|
+
ssv: string;
|
|
18
|
+
tsv: string;
|
|
19
|
+
pipes: string;
|
|
20
|
+
};
|
|
21
|
+
export interface RequestArgs {
|
|
22
|
+
url: string;
|
|
23
|
+
options: RawAxiosRequestConfig;
|
|
24
|
+
}
|
|
25
|
+
export declare class BaseAPI {
|
|
26
|
+
protected basePath: string;
|
|
27
|
+
protected axios: AxiosInstance;
|
|
28
|
+
protected configuration: Configuration | undefined;
|
|
29
|
+
constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
|
|
30
|
+
}
|
|
31
|
+
export declare class RequiredError extends Error {
|
|
32
|
+
field: string;
|
|
33
|
+
constructor(field: string, msg?: string);
|
|
34
|
+
}
|
|
35
|
+
interface ServerMap {
|
|
36
|
+
[key: string]: {
|
|
37
|
+
url: string;
|
|
38
|
+
description: string;
|
|
39
|
+
}[];
|
|
40
|
+
}
|
|
41
|
+
export declare const operationServerMap: ServerMap;
|
|
42
|
+
export {};
|
package/dist/base.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Split Tests
|
|
6
|
+
* Inspect split test definitions and performance results.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.operationServerMap = exports.RequiredError = exports.BaseAPI = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
|
|
17
|
+
const axios_1 = require("axios");
|
|
18
|
+
exports.BASE_PATH = "https://api.localhost:8080".replace(/\/+$/, "");
|
|
19
|
+
exports.COLLECTION_FORMATS = {
|
|
20
|
+
csv: ",",
|
|
21
|
+
ssv: " ",
|
|
22
|
+
tsv: "\t",
|
|
23
|
+
pipes: "|",
|
|
24
|
+
};
|
|
25
|
+
class BaseAPI {
|
|
26
|
+
constructor(configuration, basePath = exports.BASE_PATH, axios = axios_1.default) {
|
|
27
|
+
var _a;
|
|
28
|
+
this.basePath = basePath;
|
|
29
|
+
this.axios = axios;
|
|
30
|
+
if (configuration) {
|
|
31
|
+
this.configuration = configuration;
|
|
32
|
+
this.basePath = (_a = configuration.basePath) !== null && _a !== void 0 ? _a : basePath;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.BaseAPI = BaseAPI;
|
|
37
|
+
;
|
|
38
|
+
class RequiredError extends Error {
|
|
39
|
+
constructor(field, msg) {
|
|
40
|
+
super(msg);
|
|
41
|
+
this.field = field;
|
|
42
|
+
this.name = "RequiredError";
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.RequiredError = RequiredError;
|
|
46
|
+
exports.operationServerMap = {};
|
package/dist/common.d.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Split Tests
|
|
3
|
+
* Inspect split test definitions and performance results.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import type { Configuration } from "./configuration";
|
|
13
|
+
import type { RequestArgs } from "./base";
|
|
14
|
+
import type { AxiosInstance, AxiosResponse } from 'axios';
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @export
|
|
18
|
+
*/
|
|
19
|
+
export declare const DUMMY_BASE_URL = "https://example.com";
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* @throws {RequiredError}
|
|
23
|
+
* @export
|
|
24
|
+
*/
|
|
25
|
+
export declare const assertParamExists: (functionName: string, paramName: string, paramValue: unknown) => void;
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @export
|
|
29
|
+
*/
|
|
30
|
+
export declare const setApiKeyToObject: (object: any, keyParamName: string, configuration?: Configuration) => Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @export
|
|
34
|
+
*/
|
|
35
|
+
export declare const setBasicAuthToObject: (object: any, configuration?: Configuration) => void;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @export
|
|
39
|
+
*/
|
|
40
|
+
export declare const setBearerAuthToObject: (object: any, configuration?: Configuration) => Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
* @export
|
|
44
|
+
*/
|
|
45
|
+
export declare const setOAuthToObject: (object: any, name: string, scopes: string[], configuration?: Configuration) => Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @export
|
|
49
|
+
*/
|
|
50
|
+
export declare const setSearchParams: (url: URL, ...objects: any[]) => void;
|
|
51
|
+
/**
|
|
52
|
+
* JSON.stringify replacer used by generated API code (e.g. serializes Set as Array).
|
|
53
|
+
* @export
|
|
54
|
+
*/
|
|
55
|
+
export declare const replaceWithSerializableTypeIfNeeded: (_key: string, value: unknown) => unknown;
|
|
56
|
+
/**
|
|
57
|
+
*
|
|
58
|
+
* @export
|
|
59
|
+
*/
|
|
60
|
+
export declare const serializeDataIfNeeded: (value: any, requestOptions: any, configuration?: Configuration) => any;
|
|
61
|
+
/**
|
|
62
|
+
*
|
|
63
|
+
* @export
|
|
64
|
+
*/
|
|
65
|
+
export declare const toPathString: (url: URL) => string;
|
|
66
|
+
/**
|
|
67
|
+
*
|
|
68
|
+
* @export
|
|
69
|
+
*/
|
|
70
|
+
export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => <T = unknown, R = AxiosResponse<T>>(axios?: AxiosInstance, basePath?: string) => Promise<R>;
|
package/dist/common.js
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Split Tests
|
|
6
|
+
* Inspect split test definitions and performance results.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
16
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
18
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
19
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
20
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
21
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.replaceWithSerializableTypeIfNeeded = exports.setSearchParams = exports.setOAuthToObject = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
|
|
26
|
+
const base_1 = require("./base");
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* @export
|
|
30
|
+
*/
|
|
31
|
+
exports.DUMMY_BASE_URL = 'https://example.com';
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @throws {RequiredError}
|
|
35
|
+
* @export
|
|
36
|
+
*/
|
|
37
|
+
const assertParamExists = function (functionName, paramName, paramValue) {
|
|
38
|
+
if (paramValue === null || paramValue === undefined) {
|
|
39
|
+
throw new base_1.RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
exports.assertParamExists = assertParamExists;
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* @export
|
|
46
|
+
*/
|
|
47
|
+
const setApiKeyToObject = function (object, keyParamName, configuration) {
|
|
48
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
if (configuration && configuration.apiKey) {
|
|
50
|
+
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
|
|
51
|
+
? yield configuration.apiKey(keyParamName)
|
|
52
|
+
: yield configuration.apiKey;
|
|
53
|
+
object[keyParamName] = localVarApiKeyValue;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
exports.setApiKeyToObject = setApiKeyToObject;
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* @export
|
|
61
|
+
*/
|
|
62
|
+
const setBasicAuthToObject = function (object, configuration) {
|
|
63
|
+
if (configuration && (configuration.username || configuration.password)) {
|
|
64
|
+
object["auth"] = { username: configuration.username, password: configuration.password };
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
exports.setBasicAuthToObject = setBasicAuthToObject;
|
|
68
|
+
/**
|
|
69
|
+
*
|
|
70
|
+
* @export
|
|
71
|
+
*/
|
|
72
|
+
const setBearerAuthToObject = function (object, configuration) {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
if (configuration && configuration.accessToken) {
|
|
75
|
+
const accessToken = typeof configuration.accessToken === 'function'
|
|
76
|
+
? yield configuration.accessToken()
|
|
77
|
+
: yield configuration.accessToken;
|
|
78
|
+
object["Authorization"] = "Bearer " + accessToken;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
exports.setBearerAuthToObject = setBearerAuthToObject;
|
|
83
|
+
/**
|
|
84
|
+
*
|
|
85
|
+
* @export
|
|
86
|
+
*/
|
|
87
|
+
const setOAuthToObject = function (object, name, scopes, configuration) {
|
|
88
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
89
|
+
if (configuration && configuration.accessToken) {
|
|
90
|
+
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
|
|
91
|
+
? yield configuration.accessToken(name, scopes)
|
|
92
|
+
: yield configuration.accessToken;
|
|
93
|
+
object["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
exports.setOAuthToObject = setOAuthToObject;
|
|
98
|
+
function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
|
|
99
|
+
if (parameter == null)
|
|
100
|
+
return;
|
|
101
|
+
if (typeof parameter === "object") {
|
|
102
|
+
if (Array.isArray(parameter) || parameter instanceof Set) {
|
|
103
|
+
parameter.forEach(item => setFlattenedQueryParams(urlSearchParams, item, key !== '' ? `${key}[]` : key));
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
Object.keys(parameter).forEach(currentKey => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
if (urlSearchParams.has(key)) {
|
|
111
|
+
urlSearchParams.append(key, parameter);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
urlSearchParams.set(key, parameter);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
*
|
|
120
|
+
* @export
|
|
121
|
+
*/
|
|
122
|
+
const setSearchParams = function (url, ...objects) {
|
|
123
|
+
const searchParams = new URLSearchParams(url.search);
|
|
124
|
+
setFlattenedQueryParams(searchParams, objects);
|
|
125
|
+
url.search = searchParams.toString();
|
|
126
|
+
};
|
|
127
|
+
exports.setSearchParams = setSearchParams;
|
|
128
|
+
/**
|
|
129
|
+
* JSON.stringify replacer used by generated API code (e.g. serializes Set as Array).
|
|
130
|
+
* @export
|
|
131
|
+
*/
|
|
132
|
+
const replaceWithSerializableTypeIfNeeded = function (_key, value) {
|
|
133
|
+
if (value instanceof Set) {
|
|
134
|
+
return Array.from(value);
|
|
135
|
+
}
|
|
136
|
+
return value;
|
|
137
|
+
};
|
|
138
|
+
exports.replaceWithSerializableTypeIfNeeded = replaceWithSerializableTypeIfNeeded;
|
|
139
|
+
/**
|
|
140
|
+
*
|
|
141
|
+
* @export
|
|
142
|
+
*/
|
|
143
|
+
const serializeDataIfNeeded = function (value, requestOptions, configuration) {
|
|
144
|
+
const nonString = typeof value !== 'string';
|
|
145
|
+
const needsSerialization = nonString && configuration && configuration.isJsonMime
|
|
146
|
+
? configuration.isJsonMime(requestOptions.headers['Content-Type'])
|
|
147
|
+
: nonString;
|
|
148
|
+
return needsSerialization
|
|
149
|
+
? JSON.stringify(value !== undefined ? value : {}, exports.replaceWithSerializableTypeIfNeeded)
|
|
150
|
+
: (value || "");
|
|
151
|
+
};
|
|
152
|
+
exports.serializeDataIfNeeded = serializeDataIfNeeded;
|
|
153
|
+
/**
|
|
154
|
+
*
|
|
155
|
+
* @export
|
|
156
|
+
*/
|
|
157
|
+
const toPathString = function (url) {
|
|
158
|
+
return url.pathname + url.search + url.hash;
|
|
159
|
+
};
|
|
160
|
+
exports.toPathString = toPathString;
|
|
161
|
+
/**
|
|
162
|
+
*
|
|
163
|
+
* @export
|
|
164
|
+
*/
|
|
165
|
+
const createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
|
|
166
|
+
return (axios = globalAxios, basePath = BASE_PATH) => {
|
|
167
|
+
var _a;
|
|
168
|
+
const axiosRequestArgs = Object.assign(Object.assign({}, axiosArgs.options), { url: (axios.defaults.baseURL ? '' : (_a = configuration === null || configuration === void 0 ? void 0 : configuration.basePath) !== null && _a !== void 0 ? _a : basePath) + axiosArgs.url });
|
|
169
|
+
return axios.request(axiosRequestArgs);
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
exports.createRequestFunction = createRequestFunction;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Split Tests
|
|
3
|
+
* Inspect split test definitions and performance results.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
interface AWSv4Configuration {
|
|
13
|
+
options?: {
|
|
14
|
+
region?: string;
|
|
15
|
+
service?: string;
|
|
16
|
+
};
|
|
17
|
+
credentials?: {
|
|
18
|
+
accessKeyId?: string;
|
|
19
|
+
secretAccessKey?: string;
|
|
20
|
+
sessionToken?: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export interface ConfigurationParameters {
|
|
24
|
+
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
|
|
25
|
+
username?: string;
|
|
26
|
+
password?: string;
|
|
27
|
+
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
|
|
28
|
+
awsv4?: AWSv4Configuration;
|
|
29
|
+
basePath?: string;
|
|
30
|
+
serverIndex?: number;
|
|
31
|
+
baseOptions?: any;
|
|
32
|
+
formDataCtor?: new () => any;
|
|
33
|
+
}
|
|
34
|
+
export declare class Configuration {
|
|
35
|
+
/**
|
|
36
|
+
* parameter for apiKey security
|
|
37
|
+
* @param name security name
|
|
38
|
+
*/
|
|
39
|
+
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
|
|
40
|
+
/**
|
|
41
|
+
* parameter for basic security
|
|
42
|
+
*/
|
|
43
|
+
username?: string;
|
|
44
|
+
/**
|
|
45
|
+
* parameter for basic security
|
|
46
|
+
*/
|
|
47
|
+
password?: string;
|
|
48
|
+
/**
|
|
49
|
+
* parameter for oauth2 security
|
|
50
|
+
* @param name security name
|
|
51
|
+
* @param scopes oauth2 scope
|
|
52
|
+
*/
|
|
53
|
+
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
|
|
54
|
+
/**
|
|
55
|
+
* parameter for aws4 signature security
|
|
56
|
+
* @param {Object} AWS4Signature - AWS4 Signature security
|
|
57
|
+
* @param {string} options.region - aws region
|
|
58
|
+
* @param {string} options.service - name of the service.
|
|
59
|
+
* @param {string} credentials.accessKeyId - aws access key id
|
|
60
|
+
* @param {string} credentials.secretAccessKey - aws access key
|
|
61
|
+
* @param {string} credentials.sessionToken - aws session token
|
|
62
|
+
* @memberof Configuration
|
|
63
|
+
*/
|
|
64
|
+
awsv4?: AWSv4Configuration;
|
|
65
|
+
/**
|
|
66
|
+
* override base path
|
|
67
|
+
*/
|
|
68
|
+
basePath?: string;
|
|
69
|
+
/**
|
|
70
|
+
* override server index
|
|
71
|
+
*/
|
|
72
|
+
serverIndex?: number;
|
|
73
|
+
/**
|
|
74
|
+
* base options for axios calls
|
|
75
|
+
*/
|
|
76
|
+
baseOptions?: any;
|
|
77
|
+
/**
|
|
78
|
+
* The FormData constructor that will be used to create multipart form data
|
|
79
|
+
* requests. You can inject this here so that execution environments that
|
|
80
|
+
* do not support the FormData class can still run the generated client.
|
|
81
|
+
*
|
|
82
|
+
* @type {new () => FormData}
|
|
83
|
+
*/
|
|
84
|
+
formDataCtor?: new () => any;
|
|
85
|
+
constructor(param?: ConfigurationParameters);
|
|
86
|
+
/**
|
|
87
|
+
* Check if the given MIME is a JSON MIME.
|
|
88
|
+
* JSON MIME examples:
|
|
89
|
+
* application/json
|
|
90
|
+
* application/json; charset=UTF8
|
|
91
|
+
* APPLICATION/JSON
|
|
92
|
+
* application/vnd.company+json
|
|
93
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
94
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
95
|
+
*/
|
|
96
|
+
isJsonMime(mime: string): boolean;
|
|
97
|
+
}
|
|
98
|
+
export {};
|