@algolia/client-abtesting 5.0.0-alpha.99 → 5.0.0-beta.10
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/LICENSE +21 -0
- package/dist/builds/browser.d.ts +22 -3
- package/dist/builds/browser.d.ts.map +1 -1
- package/dist/builds/node.d.ts +22 -3
- package/dist/builds/node.d.ts.map +1 -1
- package/dist/client-abtesting.cjs +51 -42
- package/dist/client-abtesting.esm.browser.js +47 -50
- package/dist/client-abtesting.esm.node.js +51 -42
- package/dist/client-abtesting.umd.js +2 -2
- package/dist/model/aBTest.d.ts +14 -29
- package/dist/model/aBTest.d.ts.map +1 -1
- package/dist/model/aBTestConfiguration.d.ts +12 -0
- package/dist/model/aBTestConfiguration.d.ts.map +1 -0
- package/dist/model/aBTestResponse.d.ts +3 -3
- package/dist/model/abTestsVariant.d.ts +3 -3
- package/dist/model/addABTestsRequest.d.ts +1 -1
- package/dist/model/clientMethodProps.d.ts +7 -7
- package/dist/model/{currenciesValue.d.ts → currency.d.ts} +2 -2
- package/dist/model/currency.d.ts.map +1 -0
- package/dist/model/customSearchParams.d.ts +1 -1
- package/dist/model/effect.d.ts +5 -0
- package/dist/model/effect.d.ts.map +1 -0
- package/dist/model/emptySearch.d.ts +10 -0
- package/dist/model/emptySearch.d.ts.map +1 -0
- package/dist/model/index.d.ts +7 -1
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/listABTestsResponse.d.ts +2 -2
- package/dist/model/listABTestsResponse.d.ts.map +1 -1
- package/dist/model/minimumDetectableEffect.d.ts +12 -0
- package/dist/model/minimumDetectableEffect.d.ts.map +1 -0
- package/dist/model/outliers.d.ts +10 -0
- package/dist/model/outliers.d.ts.map +1 -0
- package/dist/model/status.d.ts +5 -0
- package/dist/model/status.d.ts.map +1 -0
- package/dist/model/variant.d.ts +29 -25
- package/dist/model/variant.d.ts.map +1 -1
- package/dist/src/abtestingClient.d.ts +28 -26
- package/dist/src/abtestingClient.d.ts.map +1 -1
- package/model/aBTest.ts +15 -29
- package/model/aBTestConfiguration.ts +16 -0
- package/model/aBTestResponse.ts +3 -3
- package/model/abTestsVariant.ts +3 -3
- package/model/addABTestsRequest.ts +1 -1
- package/model/clientMethodProps.ts +7 -7
- package/model/{currenciesValue.ts → currency.ts} +1 -1
- package/model/customSearchParams.ts +1 -1
- package/model/effect.ts +10 -0
- package/model/emptySearch.ts +11 -0
- package/model/index.ts +7 -1
- package/model/listABTestsResponse.ts +2 -2
- package/model/minimumDetectableEffect.ts +15 -0
- package/model/outliers.ts +11 -0
- package/model/status.ts +6 -0
- package/model/variant.ts +30 -25
- package/package.json +11 -8
- package/dist/model/currenciesValue.d.ts.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2013-Present Algolia
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/builds/browser.d.ts
CHANGED
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
import type { ClientOptions } from '@algolia/client-common';
|
|
2
|
-
import type {
|
|
3
|
-
export { apiClientVersion,
|
|
2
|
+
import type { Region } from '../src/abtestingClient';
|
|
3
|
+
export { apiClientVersion, Region } from '../src/abtestingClient';
|
|
4
4
|
export * from '../model';
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* The client type.
|
|
7
|
+
*/
|
|
8
|
+
export type AbtestingClient = ReturnType<typeof abtestingClient>;
|
|
9
|
+
export declare function abtestingClient(appId: string, apiKey: string, region?: Region, options?: ClientOptions): {
|
|
10
|
+
transporter: import("@algolia/client-common").Transporter;
|
|
11
|
+
appId: string;
|
|
12
|
+
clearCache(): Promise<void>;
|
|
13
|
+
readonly _ua: string;
|
|
14
|
+
addAlgoliaAgent(segment: string, version?: string): void;
|
|
15
|
+
addABTests(addABTestsRequest: import("../model").AddABTestsRequest, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").ABTestResponse>;
|
|
16
|
+
customDelete({ path, parameters }: import("../model").CustomDeleteProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
|
|
17
|
+
customGet({ path, parameters }: import("../model").CustomGetProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
|
|
18
|
+
customPost({ path, parameters, body }: import("../model").CustomPostProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
|
|
19
|
+
customPut({ path, parameters, body }: import("../model").CustomPutProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
|
|
20
|
+
deleteABTest({ id }: import("../model").DeleteABTestProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").ABTestResponse>;
|
|
21
|
+
getABTest({ id }: import("../model").GetABTestProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").ABTest>;
|
|
22
|
+
listABTests({ offset, limit, indexPrefix, indexSuffix }?: import("../model").ListABTestsProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("../model").ListABTestsResponse>;
|
|
23
|
+
stopABTest({ id }: import("../model").StopABTestProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").ABTestResponse>;
|
|
24
|
+
};
|
|
6
25
|
//# sourceMappingURL=browser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../builds/browser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAW5D,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../builds/browser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAW5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAOrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAClE,cAAc,UAAU,CAAC;AAEzB;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAGjE,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,aAAa;;;;;;;;;;;;;;;EAsCxB"}
|
package/dist/builds/node.d.ts
CHANGED
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
import type { ClientOptions } from '@algolia/client-common';
|
|
2
|
-
import type {
|
|
3
|
-
export { apiClientVersion,
|
|
2
|
+
import type { Region } from '../src/abtestingClient';
|
|
3
|
+
export { apiClientVersion, Region } from '../src/abtestingClient';
|
|
4
4
|
export * from '../model';
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* The client type.
|
|
7
|
+
*/
|
|
8
|
+
export type AbtestingClient = ReturnType<typeof abtestingClient>;
|
|
9
|
+
export declare function abtestingClient(appId: string, apiKey: string, region?: Region, options?: ClientOptions): {
|
|
10
|
+
transporter: import("@algolia/client-common").Transporter;
|
|
11
|
+
appId: string;
|
|
12
|
+
clearCache(): Promise<void>;
|
|
13
|
+
_ua: string;
|
|
14
|
+
addAlgoliaAgent(segment: string, version?: string): void;
|
|
15
|
+
addABTests(addABTestsRequest: import("../model").AddABTestsRequest, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").ABTestResponse>;
|
|
16
|
+
customDelete({ path, parameters }: import("../model").CustomDeleteProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
|
|
17
|
+
customGet({ path, parameters }: import("../model").CustomGetProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
|
|
18
|
+
customPost({ path, parameters, body }: import("../model").CustomPostProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
|
|
19
|
+
customPut({ path, parameters, body }: import("../model").CustomPutProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
|
|
20
|
+
deleteABTest({ id }: import("../model").DeleteABTestProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").ABTestResponse>;
|
|
21
|
+
getABTest({ id }: import("../model").GetABTestProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").ABTest>;
|
|
22
|
+
listABTests({ offset, limit, indexPrefix, indexSuffix }?: import("../model").ListABTestsProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("../model").ListABTestsResponse>;
|
|
23
|
+
stopABTest({ id }: import("../model").StopABTestProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").ABTestResponse>;
|
|
24
|
+
};
|
|
6
25
|
//# sourceMappingURL=node.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../builds/node.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAU5D,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../builds/node.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAU5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAClE,cAAc,UAAU,CAAC;AAEzB;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAGjE,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,aAAa;;;;;;;;;;;;;;;EAkCxB"}
|
|
@@ -4,7 +4,7 @@ var clientCommon = require('@algolia/client-common');
|
|
|
4
4
|
var requesterNodeHttp = require('@algolia/requester-node-http');
|
|
5
5
|
|
|
6
6
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
|
7
|
-
const apiClientVersion = '5.0.0-
|
|
7
|
+
const apiClientVersion = '5.0.0-beta.10';
|
|
8
8
|
const REGIONS = ['de', 'us'];
|
|
9
9
|
function getDefaultHosts(region) {
|
|
10
10
|
const url = !region
|
|
@@ -64,9 +64,11 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
64
64
|
transporter.algoliaAgent.add({ segment, version });
|
|
65
65
|
},
|
|
66
66
|
/**
|
|
67
|
-
* Creates
|
|
67
|
+
* Creates a new A/B test.
|
|
68
|
+
*
|
|
69
|
+
* Required API Key ACLs:
|
|
70
|
+
* - editSettings.
|
|
68
71
|
*
|
|
69
|
-
* @summary Create an A/B test.
|
|
70
72
|
* @param addABTestsRequest - The addABTestsRequest object.
|
|
71
73
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
72
74
|
*/
|
|
@@ -98,7 +100,6 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
98
100
|
/**
|
|
99
101
|
* This method allow you to send requests to the Algolia REST API.
|
|
100
102
|
*
|
|
101
|
-
* @summary Send requests to the Algolia REST API.
|
|
102
103
|
* @param customDelete - The customDelete object.
|
|
103
104
|
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
104
105
|
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
@@ -108,7 +109,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
108
109
|
if (!path) {
|
|
109
110
|
throw new Error('Parameter `path` is required when calling `customDelete`.');
|
|
110
111
|
}
|
|
111
|
-
const requestPath = '/
|
|
112
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
112
113
|
const headers = {};
|
|
113
114
|
const queryParameters = parameters ? parameters : {};
|
|
114
115
|
const request = {
|
|
@@ -122,7 +123,6 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
122
123
|
/**
|
|
123
124
|
* This method allow you to send requests to the Algolia REST API.
|
|
124
125
|
*
|
|
125
|
-
* @summary Send requests to the Algolia REST API.
|
|
126
126
|
* @param customGet - The customGet object.
|
|
127
127
|
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
128
128
|
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
@@ -132,7 +132,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
132
132
|
if (!path) {
|
|
133
133
|
throw new Error('Parameter `path` is required when calling `customGet`.');
|
|
134
134
|
}
|
|
135
|
-
const requestPath = '/
|
|
135
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
136
136
|
const headers = {};
|
|
137
137
|
const queryParameters = parameters ? parameters : {};
|
|
138
138
|
const request = {
|
|
@@ -146,7 +146,6 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
146
146
|
/**
|
|
147
147
|
* This method allow you to send requests to the Algolia REST API.
|
|
148
148
|
*
|
|
149
|
-
* @summary Send requests to the Algolia REST API.
|
|
150
149
|
* @param customPost - The customPost object.
|
|
151
150
|
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
152
151
|
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
@@ -157,7 +156,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
157
156
|
if (!path) {
|
|
158
157
|
throw new Error('Parameter `path` is required when calling `customPost`.');
|
|
159
158
|
}
|
|
160
|
-
const requestPath = '/
|
|
159
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
161
160
|
const headers = {};
|
|
162
161
|
const queryParameters = parameters ? parameters : {};
|
|
163
162
|
const request = {
|
|
@@ -172,7 +171,6 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
172
171
|
/**
|
|
173
172
|
* This method allow you to send requests to the Algolia REST API.
|
|
174
173
|
*
|
|
175
|
-
* @summary Send requests to the Algolia REST API.
|
|
176
174
|
* @param customPut - The customPut object.
|
|
177
175
|
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
178
176
|
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
@@ -183,7 +181,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
183
181
|
if (!path) {
|
|
184
182
|
throw new Error('Parameter `path` is required when calling `customPut`.');
|
|
185
183
|
}
|
|
186
|
-
const requestPath = '/
|
|
184
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
187
185
|
const headers = {};
|
|
188
186
|
const queryParameters = parameters ? parameters : {};
|
|
189
187
|
const request = {
|
|
@@ -196,11 +194,13 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
196
194
|
return transporter.request(request, requestOptions);
|
|
197
195
|
},
|
|
198
196
|
/**
|
|
199
|
-
*
|
|
197
|
+
* Deletes an A/B test by its ID.
|
|
198
|
+
*
|
|
199
|
+
* Required API Key ACLs:
|
|
200
|
+
* - editSettings.
|
|
200
201
|
*
|
|
201
|
-
* @summary Delete an A/B test.
|
|
202
202
|
* @param deleteABTest - The deleteABTest object.
|
|
203
|
-
* @param deleteABTest.id - Unique A/B test
|
|
203
|
+
* @param deleteABTest.id - Unique A/B test identifier.
|
|
204
204
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
205
205
|
*/
|
|
206
206
|
deleteABTest({ id }, requestOptions) {
|
|
@@ -219,11 +219,13 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
219
219
|
return transporter.request(request, requestOptions);
|
|
220
220
|
},
|
|
221
221
|
/**
|
|
222
|
-
*
|
|
222
|
+
* Retrieves the details for an A/B test by its ID.
|
|
223
|
+
*
|
|
224
|
+
* Required API Key ACLs:
|
|
225
|
+
* - analytics.
|
|
223
226
|
*
|
|
224
|
-
* @summary Get A/B test details.
|
|
225
227
|
* @param getABTest - The getABTest object.
|
|
226
|
-
* @param getABTest.id - Unique A/B test
|
|
228
|
+
* @param getABTest.id - Unique A/B test identifier.
|
|
227
229
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
228
230
|
*/
|
|
229
231
|
getABTest({ id }, requestOptions) {
|
|
@@ -242,14 +244,16 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
242
244
|
return transporter.request(request, requestOptions);
|
|
243
245
|
},
|
|
244
246
|
/**
|
|
245
|
-
*
|
|
247
|
+
* Lists all A/B tests you configured for this application.
|
|
248
|
+
*
|
|
249
|
+
* Required API Key ACLs:
|
|
250
|
+
* - analytics.
|
|
246
251
|
*
|
|
247
|
-
* @summary List all A/B tests.
|
|
248
252
|
* @param listABTests - The listABTests object.
|
|
249
|
-
* @param listABTests.offset - Position of the
|
|
250
|
-
* @param listABTests.limit - Number of
|
|
251
|
-
* @param listABTests.indexPrefix - Only
|
|
252
|
-
* @param listABTests.indexSuffix - Only
|
|
253
|
+
* @param listABTests.offset - Position of the first item to return.
|
|
254
|
+
* @param listABTests.limit - Number of items to return.
|
|
255
|
+
* @param listABTests.indexPrefix - Index name prefix. Only A/B tests for indices starting with this string are included in the response.
|
|
256
|
+
* @param listABTests.indexSuffix - Index name suffix. Only A/B tests for indices ending with this string are included in the response.
|
|
253
257
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
254
258
|
*/
|
|
255
259
|
listABTests({ offset, limit, indexPrefix, indexSuffix } = {}, requestOptions = undefined) {
|
|
@@ -277,11 +281,13 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
277
281
|
return transporter.request(request, requestOptions);
|
|
278
282
|
},
|
|
279
283
|
/**
|
|
280
|
-
*
|
|
284
|
+
* Stops an A/B test by its ID. You can\'t restart stopped A/B tests.
|
|
285
|
+
*
|
|
286
|
+
* Required API Key ACLs:
|
|
287
|
+
* - editSettings.
|
|
281
288
|
*
|
|
282
|
-
* @summary Stop an A/B test.
|
|
283
289
|
* @param stopABTest - The stopABTest object.
|
|
284
|
-
* @param stopABTest.id - Unique A/B test
|
|
290
|
+
* @param stopABTest.id - Unique A/B test identifier.
|
|
285
291
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
286
292
|
*/
|
|
287
293
|
stopABTest({ id }, requestOptions) {
|
|
@@ -303,6 +309,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
303
309
|
}
|
|
304
310
|
|
|
305
311
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
|
312
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
306
313
|
function abtestingClient(appId, apiKey, region, options) {
|
|
307
314
|
if (!appId || typeof appId !== 'string') {
|
|
308
315
|
throw new Error('`appId` is missing.');
|
|
@@ -313,22 +320,24 @@ function abtestingClient(appId, apiKey, region, options) {
|
|
|
313
320
|
if (region && (typeof region !== 'string' || !REGIONS.includes(region))) {
|
|
314
321
|
throw new Error(`\`region\` must be one of the following: ${REGIONS.join(', ')}`);
|
|
315
322
|
}
|
|
316
|
-
return
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
323
|
+
return {
|
|
324
|
+
...createAbtestingClient({
|
|
325
|
+
appId,
|
|
326
|
+
apiKey,
|
|
327
|
+
region,
|
|
328
|
+
timeouts: {
|
|
329
|
+
connect: clientCommon.DEFAULT_CONNECT_TIMEOUT_NODE,
|
|
330
|
+
read: clientCommon.DEFAULT_READ_TIMEOUT_NODE,
|
|
331
|
+
write: clientCommon.DEFAULT_WRITE_TIMEOUT_NODE,
|
|
332
|
+
},
|
|
333
|
+
requester: requesterNodeHttp.createHttpRequester(),
|
|
334
|
+
algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
|
|
335
|
+
responsesCache: clientCommon.createNullCache(),
|
|
336
|
+
requestsCache: clientCommon.createNullCache(),
|
|
337
|
+
hostsCache: clientCommon.createMemoryCache(),
|
|
338
|
+
...options,
|
|
339
|
+
}),
|
|
340
|
+
};
|
|
332
341
|
}
|
|
333
342
|
|
|
334
343
|
exports.abtestingClient = abtestingClient;
|
|
@@ -195,6 +195,14 @@ function createStatefulHost(host, status = 'up') {
|
|
|
195
195
|
};
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
+
function _defineProperty(e, r, t) {
|
|
199
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
200
|
+
value: t,
|
|
201
|
+
enumerable: !0,
|
|
202
|
+
configurable: !0,
|
|
203
|
+
writable: !0
|
|
204
|
+
}) : e[r] = t, e;
|
|
205
|
+
}
|
|
198
206
|
function _toPrimitive(t, r) {
|
|
199
207
|
if ("object" != typeof t || !t) return t;
|
|
200
208
|
var e = t[Symbol.toPrimitive];
|
|
@@ -207,21 +215,7 @@ function _toPrimitive(t, r) {
|
|
|
207
215
|
}
|
|
208
216
|
function _toPropertyKey(t) {
|
|
209
217
|
var i = _toPrimitive(t, "string");
|
|
210
|
-
return "symbol" == typeof i ? i :
|
|
211
|
-
}
|
|
212
|
-
function _defineProperty(obj, key, value) {
|
|
213
|
-
key = _toPropertyKey(key);
|
|
214
|
-
if (key in obj) {
|
|
215
|
-
Object.defineProperty(obj, key, {
|
|
216
|
-
value: value,
|
|
217
|
-
enumerable: true,
|
|
218
|
-
configurable: true,
|
|
219
|
-
writable: true
|
|
220
|
-
});
|
|
221
|
-
} else {
|
|
222
|
-
obj[key] = value;
|
|
223
|
-
}
|
|
224
|
-
return obj;
|
|
218
|
+
return "symbol" == typeof i ? i : i + "";
|
|
225
219
|
}
|
|
226
220
|
|
|
227
221
|
class AlgoliaError extends Error {
|
|
@@ -243,7 +237,7 @@ class ErrorWithStackTrace extends AlgoliaError {
|
|
|
243
237
|
}
|
|
244
238
|
class RetryError extends ErrorWithStackTrace {
|
|
245
239
|
constructor(stackTrace) {
|
|
246
|
-
super('Unreachable hosts - your application id may be incorrect. If the error persists, please
|
|
240
|
+
super('Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.', stackTrace, 'RetryError');
|
|
247
241
|
}
|
|
248
242
|
}
|
|
249
243
|
class ApiError extends ErrorWithStackTrace {
|
|
@@ -270,15 +264,14 @@ class DetailedApiError extends ApiError {
|
|
|
270
264
|
}
|
|
271
265
|
function serializeUrl(host, path, queryParameters) {
|
|
272
266
|
const queryParametersAsString = serializeQueryParameters(queryParameters);
|
|
273
|
-
let url = `${host.protocol}://${host.url}/${path.charAt(0) === '/' ? path.
|
|
267
|
+
let url = `${host.protocol}://${host.url}${host.port ? `:${host.port}` : ''}/${path.charAt(0) === '/' ? path.substring(1) : path}`;
|
|
274
268
|
if (queryParametersAsString.length) {
|
|
275
269
|
url += `?${queryParametersAsString}`;
|
|
276
270
|
}
|
|
277
271
|
return url;
|
|
278
272
|
}
|
|
279
273
|
function serializeQueryParameters(parameters) {
|
|
280
|
-
|
|
281
|
-
return Object.keys(parameters).map(key => `${key}=${encodeURIComponent(isObjectOrArray(parameters[key]) ? JSON.stringify(parameters[key]) : parameters[key])}`).join('&');
|
|
274
|
+
return Object.keys(parameters).filter(key => parameters[key] !== undefined).sort().map(key => `${key}=${encodeURIComponent(Object.prototype.toString.call(parameters[key]) === '[object Array]' ? parameters[key].join(',') : parameters[key]).replaceAll('+', '%20')}`).join('&');
|
|
282
275
|
}
|
|
283
276
|
function serializeData(request, requestOptions) {
|
|
284
277
|
if (request.method === 'GET' || request.data === undefined && requestOptions.data === undefined) {
|
|
@@ -449,16 +442,13 @@ function createTransporter({
|
|
|
449
442
|
if (host === undefined) {
|
|
450
443
|
throw new RetryError(stackTraceWithoutCredentials(stackTrace));
|
|
451
444
|
}
|
|
452
|
-
let responseTimeout = requestOptions.
|
|
453
|
-
if (responseTimeout === undefined) {
|
|
454
|
-
responseTimeout = isRead ? timeouts.read : timeouts.write;
|
|
455
|
-
}
|
|
445
|
+
let responseTimeout = isRead ? requestOptions.timeouts?.read || timeouts.read : requestOptions.timeouts?.write || timeouts.write;
|
|
456
446
|
const payload = {
|
|
457
447
|
data,
|
|
458
448
|
headers,
|
|
459
449
|
method: request.method,
|
|
460
450
|
url: serializeUrl(host, request.path, queryParameters),
|
|
461
|
-
connectTimeout: getTimeout(timeoutsCount, timeouts.connect),
|
|
451
|
+
connectTimeout: getTimeout(timeoutsCount, requestOptions.timeouts?.connect || timeouts.connect),
|
|
462
452
|
responseTimeout: getTimeout(timeoutsCount, responseTimeout)
|
|
463
453
|
};
|
|
464
454
|
/**
|
|
@@ -686,7 +676,7 @@ function createXhrRequester() {
|
|
|
686
676
|
}
|
|
687
677
|
|
|
688
678
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
|
689
|
-
const apiClientVersion = '5.0.0-
|
|
679
|
+
const apiClientVersion = '5.0.0-beta.10';
|
|
690
680
|
const REGIONS = ['de', 'us'];
|
|
691
681
|
function getDefaultHosts(region) {
|
|
692
682
|
const url = !region
|
|
@@ -746,9 +736,11 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
746
736
|
transporter.algoliaAgent.add({ segment, version });
|
|
747
737
|
},
|
|
748
738
|
/**
|
|
749
|
-
* Creates
|
|
739
|
+
* Creates a new A/B test.
|
|
740
|
+
*
|
|
741
|
+
* Required API Key ACLs:
|
|
742
|
+
* - editSettings.
|
|
750
743
|
*
|
|
751
|
-
* @summary Create an A/B test.
|
|
752
744
|
* @param addABTestsRequest - The addABTestsRequest object.
|
|
753
745
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
754
746
|
*/
|
|
@@ -780,7 +772,6 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
780
772
|
/**
|
|
781
773
|
* This method allow you to send requests to the Algolia REST API.
|
|
782
774
|
*
|
|
783
|
-
* @summary Send requests to the Algolia REST API.
|
|
784
775
|
* @param customDelete - The customDelete object.
|
|
785
776
|
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
786
777
|
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
@@ -790,7 +781,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
790
781
|
if (!path) {
|
|
791
782
|
throw new Error('Parameter `path` is required when calling `customDelete`.');
|
|
792
783
|
}
|
|
793
|
-
const requestPath = '/
|
|
784
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
794
785
|
const headers = {};
|
|
795
786
|
const queryParameters = parameters ? parameters : {};
|
|
796
787
|
const request = {
|
|
@@ -804,7 +795,6 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
804
795
|
/**
|
|
805
796
|
* This method allow you to send requests to the Algolia REST API.
|
|
806
797
|
*
|
|
807
|
-
* @summary Send requests to the Algolia REST API.
|
|
808
798
|
* @param customGet - The customGet object.
|
|
809
799
|
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
810
800
|
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
@@ -814,7 +804,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
814
804
|
if (!path) {
|
|
815
805
|
throw new Error('Parameter `path` is required when calling `customGet`.');
|
|
816
806
|
}
|
|
817
|
-
const requestPath = '/
|
|
807
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
818
808
|
const headers = {};
|
|
819
809
|
const queryParameters = parameters ? parameters : {};
|
|
820
810
|
const request = {
|
|
@@ -828,7 +818,6 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
828
818
|
/**
|
|
829
819
|
* This method allow you to send requests to the Algolia REST API.
|
|
830
820
|
*
|
|
831
|
-
* @summary Send requests to the Algolia REST API.
|
|
832
821
|
* @param customPost - The customPost object.
|
|
833
822
|
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
834
823
|
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
@@ -839,7 +828,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
839
828
|
if (!path) {
|
|
840
829
|
throw new Error('Parameter `path` is required when calling `customPost`.');
|
|
841
830
|
}
|
|
842
|
-
const requestPath = '/
|
|
831
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
843
832
|
const headers = {};
|
|
844
833
|
const queryParameters = parameters ? parameters : {};
|
|
845
834
|
const request = {
|
|
@@ -854,7 +843,6 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
854
843
|
/**
|
|
855
844
|
* This method allow you to send requests to the Algolia REST API.
|
|
856
845
|
*
|
|
857
|
-
* @summary Send requests to the Algolia REST API.
|
|
858
846
|
* @param customPut - The customPut object.
|
|
859
847
|
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
860
848
|
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
@@ -865,7 +853,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
865
853
|
if (!path) {
|
|
866
854
|
throw new Error('Parameter `path` is required when calling `customPut`.');
|
|
867
855
|
}
|
|
868
|
-
const requestPath = '/
|
|
856
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
869
857
|
const headers = {};
|
|
870
858
|
const queryParameters = parameters ? parameters : {};
|
|
871
859
|
const request = {
|
|
@@ -878,11 +866,13 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
878
866
|
return transporter.request(request, requestOptions);
|
|
879
867
|
},
|
|
880
868
|
/**
|
|
881
|
-
*
|
|
869
|
+
* Deletes an A/B test by its ID.
|
|
870
|
+
*
|
|
871
|
+
* Required API Key ACLs:
|
|
872
|
+
* - editSettings.
|
|
882
873
|
*
|
|
883
|
-
* @summary Delete an A/B test.
|
|
884
874
|
* @param deleteABTest - The deleteABTest object.
|
|
885
|
-
* @param deleteABTest.id - Unique A/B test
|
|
875
|
+
* @param deleteABTest.id - Unique A/B test identifier.
|
|
886
876
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
887
877
|
*/
|
|
888
878
|
deleteABTest({ id }, requestOptions) {
|
|
@@ -901,11 +891,13 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
901
891
|
return transporter.request(request, requestOptions);
|
|
902
892
|
},
|
|
903
893
|
/**
|
|
904
|
-
*
|
|
894
|
+
* Retrieves the details for an A/B test by its ID.
|
|
895
|
+
*
|
|
896
|
+
* Required API Key ACLs:
|
|
897
|
+
* - analytics.
|
|
905
898
|
*
|
|
906
|
-
* @summary Get A/B test details.
|
|
907
899
|
* @param getABTest - The getABTest object.
|
|
908
|
-
* @param getABTest.id - Unique A/B test
|
|
900
|
+
* @param getABTest.id - Unique A/B test identifier.
|
|
909
901
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
910
902
|
*/
|
|
911
903
|
getABTest({ id }, requestOptions) {
|
|
@@ -924,14 +916,16 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
924
916
|
return transporter.request(request, requestOptions);
|
|
925
917
|
},
|
|
926
918
|
/**
|
|
927
|
-
*
|
|
919
|
+
* Lists all A/B tests you configured for this application.
|
|
920
|
+
*
|
|
921
|
+
* Required API Key ACLs:
|
|
922
|
+
* - analytics.
|
|
928
923
|
*
|
|
929
|
-
* @summary List all A/B tests.
|
|
930
924
|
* @param listABTests - The listABTests object.
|
|
931
|
-
* @param listABTests.offset - Position of the
|
|
932
|
-
* @param listABTests.limit - Number of
|
|
933
|
-
* @param listABTests.indexPrefix - Only
|
|
934
|
-
* @param listABTests.indexSuffix - Only
|
|
925
|
+
* @param listABTests.offset - Position of the first item to return.
|
|
926
|
+
* @param listABTests.limit - Number of items to return.
|
|
927
|
+
* @param listABTests.indexPrefix - Index name prefix. Only A/B tests for indices starting with this string are included in the response.
|
|
928
|
+
* @param listABTests.indexSuffix - Index name suffix. Only A/B tests for indices ending with this string are included in the response.
|
|
935
929
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
936
930
|
*/
|
|
937
931
|
listABTests({ offset, limit, indexPrefix, indexSuffix } = {}, requestOptions = undefined) {
|
|
@@ -959,11 +953,13 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
959
953
|
return transporter.request(request, requestOptions);
|
|
960
954
|
},
|
|
961
955
|
/**
|
|
962
|
-
*
|
|
956
|
+
* Stops an A/B test by its ID. You can\'t restart stopped A/B tests.
|
|
957
|
+
*
|
|
958
|
+
* Required API Key ACLs:
|
|
959
|
+
* - editSettings.
|
|
963
960
|
*
|
|
964
|
-
* @summary Stop an A/B test.
|
|
965
961
|
* @param stopABTest - The stopABTest object.
|
|
966
|
-
* @param stopABTest.id - Unique A/B test
|
|
962
|
+
* @param stopABTest.id - Unique A/B test identifier.
|
|
967
963
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
968
964
|
*/
|
|
969
965
|
stopABTest({ id }, requestOptions) {
|
|
@@ -985,6 +981,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
985
981
|
}
|
|
986
982
|
|
|
987
983
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
|
984
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
988
985
|
function abtestingClient(appId, apiKey, region, options) {
|
|
989
986
|
if (!appId || typeof appId !== 'string') {
|
|
990
987
|
throw new Error('`appId` is missing.');
|