@algolia/client-abtesting 5.0.0-alpha.73 → 5.0.0-alpha.76
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/dist/client-abtesting.cjs.js +29 -31
- package/dist/client-abtesting.esm.browser.js +29 -29
- package/dist/client-abtesting.esm.node.js +29 -29
- package/dist/client-abtesting.umd.js +2 -2
- package/dist/model/aBTest.d.ts +8 -12
- package/dist/model/aBTest.d.ts.map +1 -1
- package/dist/model/aBTestResponse.d.ts +3 -3
- package/dist/model/abTestsVariant.d.ts +3 -3
- package/dist/model/addABTestsRequest.d.ts +3 -3
- package/dist/model/addABTestsRequest.d.ts.map +1 -1
- package/dist/model/clientMethodProps.d.ts +16 -16
- package/dist/model/customSearchParams.d.ts +3 -0
- package/dist/model/customSearchParams.d.ts.map +1 -1
- package/dist/model/listABTestsResponse.d.ts +3 -3
- package/dist/model/variant.d.ts +14 -14
- package/dist/src/abtestingClient.d.ts +27 -27
- package/model/aBTest.ts +8 -13
- package/model/aBTestResponse.ts +3 -3
- package/model/abTestsVariant.ts +3 -3
- package/model/addABTestsRequest.ts +3 -3
- package/model/clientMethodProps.ts +16 -16
- package/model/customSearchParams.ts +3 -0
- package/model/listABTestsResponse.ts +3 -3
- package/model/variant.ts +14 -14
- package/package.json +8 -7
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var clientCommon = require('@algolia/client-common');
|
|
6
4
|
var requesterNodeHttp = require('@algolia/requester-node-http');
|
|
7
5
|
|
|
8
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.
|
|
9
|
-
const apiClientVersion = '5.0.0-alpha.
|
|
7
|
+
const apiClientVersion = '5.0.0-alpha.76';
|
|
10
8
|
const REGIONS = ['de', 'us'];
|
|
11
9
|
function getDefaultHosts(region) {
|
|
12
10
|
const url = !region
|
|
@@ -66,9 +64,9 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
66
64
|
transporter.algoliaAgent.add({ segment, version });
|
|
67
65
|
},
|
|
68
66
|
/**
|
|
69
|
-
* Creates
|
|
67
|
+
* Creates an A/B test.
|
|
70
68
|
*
|
|
71
|
-
* @summary Create
|
|
69
|
+
* @summary Create an A/B test.
|
|
72
70
|
* @param addABTestsRequest - The addABTestsRequest object.
|
|
73
71
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
74
72
|
*/
|
|
@@ -79,8 +77,8 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
79
77
|
if (!addABTestsRequest.name) {
|
|
80
78
|
throw new Error('Parameter `addABTestsRequest.name` is required when calling `addABTests`.');
|
|
81
79
|
}
|
|
82
|
-
if (!addABTestsRequest.
|
|
83
|
-
throw new Error('Parameter `addABTestsRequest.
|
|
80
|
+
if (!addABTestsRequest.variants) {
|
|
81
|
+
throw new Error('Parameter `addABTestsRequest.variants` is required when calling `addABTests`.');
|
|
84
82
|
}
|
|
85
83
|
if (!addABTestsRequest.endAt) {
|
|
86
84
|
throw new Error('Parameter `addABTestsRequest.endAt` is required when calling `addABTests`.');
|
|
@@ -102,8 +100,8 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
102
100
|
*
|
|
103
101
|
* @summary Send requests to the Algolia REST API.
|
|
104
102
|
* @param del - The del object.
|
|
105
|
-
* @param del.path -
|
|
106
|
-
* @param del.parameters - Query parameters to
|
|
103
|
+
* @param del.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
104
|
+
* @param del.parameters - Query parameters to apply to the current query.
|
|
107
105
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
108
106
|
*/
|
|
109
107
|
del({ path, parameters }, requestOptions) {
|
|
@@ -122,11 +120,11 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
122
120
|
return transporter.request(request, requestOptions);
|
|
123
121
|
},
|
|
124
122
|
/**
|
|
125
|
-
* Delete
|
|
123
|
+
* Delete an A/B test. To determine the `id` for an A/B test, use the [`listABTests` operation](#tag/abtest/operation/listABTests).
|
|
126
124
|
*
|
|
127
|
-
* @summary Delete
|
|
125
|
+
* @summary Delete an A/B test.
|
|
128
126
|
* @param deleteABTest - The deleteABTest object.
|
|
129
|
-
* @param deleteABTest.id -
|
|
127
|
+
* @param deleteABTest.id - Unique A/B test ID.
|
|
130
128
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
131
129
|
*/
|
|
132
130
|
deleteABTest({ id }, requestOptions) {
|
|
@@ -149,8 +147,8 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
149
147
|
*
|
|
150
148
|
* @summary Send requests to the Algolia REST API.
|
|
151
149
|
* @param get - The get object.
|
|
152
|
-
* @param get.path -
|
|
153
|
-
* @param get.parameters - Query parameters to
|
|
150
|
+
* @param get.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
151
|
+
* @param get.parameters - Query parameters to apply to the current query.
|
|
154
152
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
155
153
|
*/
|
|
156
154
|
get({ path, parameters }, requestOptions) {
|
|
@@ -169,11 +167,11 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
169
167
|
return transporter.request(request, requestOptions);
|
|
170
168
|
},
|
|
171
169
|
/**
|
|
172
|
-
*
|
|
170
|
+
* Get specific details for an A/B test. To determine the `id` for an A/B test, use the [`listABTests` operation](#tag/abtest/operation/listABTests).
|
|
173
171
|
*
|
|
174
|
-
* @summary Get
|
|
172
|
+
* @summary Get A/B test details.
|
|
175
173
|
* @param getABTest - The getABTest object.
|
|
176
|
-
* @param getABTest.id -
|
|
174
|
+
* @param getABTest.id - Unique A/B test ID.
|
|
177
175
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
178
176
|
*/
|
|
179
177
|
getABTest({ id }, requestOptions) {
|
|
@@ -192,14 +190,14 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
192
190
|
return transporter.request(request, requestOptions);
|
|
193
191
|
},
|
|
194
192
|
/**
|
|
195
|
-
*
|
|
193
|
+
* List all A/B tests.
|
|
196
194
|
*
|
|
197
|
-
* @summary List all tests.
|
|
195
|
+
* @summary List all A/B tests.
|
|
198
196
|
* @param listABTests - The listABTests object.
|
|
199
197
|
* @param listABTests.offset - Position of the starting record. Used for paging. 0 is the first record.
|
|
200
|
-
* @param listABTests.limit - Number of records to return
|
|
201
|
-
* @param listABTests.indexPrefix -
|
|
202
|
-
* @param listABTests.indexSuffix -
|
|
198
|
+
* @param listABTests.limit - Number of records to return (page size).
|
|
199
|
+
* @param listABTests.indexPrefix - Only return A/B tests for indices starting with this prefix.
|
|
200
|
+
* @param listABTests.indexSuffix - Only return A/B tests for indices ending with this suffix.
|
|
203
201
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
204
202
|
*/
|
|
205
203
|
listABTests({ offset, limit, indexPrefix, indexSuffix } = {}, requestOptions = undefined) {
|
|
@@ -231,9 +229,9 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
231
229
|
*
|
|
232
230
|
* @summary Send requests to the Algolia REST API.
|
|
233
231
|
* @param post - The post object.
|
|
234
|
-
* @param post.path -
|
|
235
|
-
* @param post.parameters - Query parameters to
|
|
236
|
-
* @param post.body -
|
|
232
|
+
* @param post.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
233
|
+
* @param post.parameters - Query parameters to apply to the current query.
|
|
234
|
+
* @param post.body - Parameters to send with the custom request.
|
|
237
235
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
238
236
|
*/
|
|
239
237
|
post({ path, parameters, body }, requestOptions) {
|
|
@@ -257,9 +255,9 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
257
255
|
*
|
|
258
256
|
* @summary Send requests to the Algolia REST API.
|
|
259
257
|
* @param put - The put object.
|
|
260
|
-
* @param put.path -
|
|
261
|
-
* @param put.parameters - Query parameters to
|
|
262
|
-
* @param put.body -
|
|
258
|
+
* @param put.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
259
|
+
* @param put.parameters - Query parameters to apply to the current query.
|
|
260
|
+
* @param put.body - Parameters to send with the custom request.
|
|
263
261
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
264
262
|
*/
|
|
265
263
|
put({ path, parameters, body }, requestOptions) {
|
|
@@ -279,11 +277,11 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
279
277
|
return transporter.request(request, requestOptions);
|
|
280
278
|
},
|
|
281
279
|
/**
|
|
282
|
-
*
|
|
280
|
+
* If stopped, the test is over and can\'t be restarted. There is now only one index, receiving 100% of all search requests. The data gathered for stopped A/B tests is retained. To determine the `id` for an A/B test, use the [`listABTests` operation](#tag/abtest/operation/listABTests).
|
|
283
281
|
*
|
|
284
|
-
* @summary Stop
|
|
282
|
+
* @summary Stop an A/B test.
|
|
285
283
|
* @param stopABTest - The stopABTest object.
|
|
286
|
-
* @param stopABTest.id -
|
|
284
|
+
* @param stopABTest.id - Unique A/B test ID.
|
|
287
285
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
288
286
|
*/
|
|
289
287
|
stopABTest({ id }, requestOptions) {
|
|
@@ -662,7 +662,7 @@ function createXhrRequester() {
|
|
|
662
662
|
}
|
|
663
663
|
|
|
664
664
|
// 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.
|
|
665
|
-
const apiClientVersion = '5.0.0-alpha.
|
|
665
|
+
const apiClientVersion = '5.0.0-alpha.76';
|
|
666
666
|
const REGIONS = ['de', 'us'];
|
|
667
667
|
function getDefaultHosts(region) {
|
|
668
668
|
const url = !region
|
|
@@ -722,9 +722,9 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
722
722
|
transporter.algoliaAgent.add({ segment, version });
|
|
723
723
|
},
|
|
724
724
|
/**
|
|
725
|
-
* Creates
|
|
725
|
+
* Creates an A/B test.
|
|
726
726
|
*
|
|
727
|
-
* @summary Create
|
|
727
|
+
* @summary Create an A/B test.
|
|
728
728
|
* @param addABTestsRequest - The addABTestsRequest object.
|
|
729
729
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
730
730
|
*/
|
|
@@ -735,8 +735,8 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
735
735
|
if (!addABTestsRequest.name) {
|
|
736
736
|
throw new Error('Parameter `addABTestsRequest.name` is required when calling `addABTests`.');
|
|
737
737
|
}
|
|
738
|
-
if (!addABTestsRequest.
|
|
739
|
-
throw new Error('Parameter `addABTestsRequest.
|
|
738
|
+
if (!addABTestsRequest.variants) {
|
|
739
|
+
throw new Error('Parameter `addABTestsRequest.variants` is required when calling `addABTests`.');
|
|
740
740
|
}
|
|
741
741
|
if (!addABTestsRequest.endAt) {
|
|
742
742
|
throw new Error('Parameter `addABTestsRequest.endAt` is required when calling `addABTests`.');
|
|
@@ -758,8 +758,8 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
758
758
|
*
|
|
759
759
|
* @summary Send requests to the Algolia REST API.
|
|
760
760
|
* @param del - The del object.
|
|
761
|
-
* @param del.path -
|
|
762
|
-
* @param del.parameters - Query parameters to
|
|
761
|
+
* @param del.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
762
|
+
* @param del.parameters - Query parameters to apply to the current query.
|
|
763
763
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
764
764
|
*/
|
|
765
765
|
del({ path, parameters }, requestOptions) {
|
|
@@ -778,11 +778,11 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
778
778
|
return transporter.request(request, requestOptions);
|
|
779
779
|
},
|
|
780
780
|
/**
|
|
781
|
-
* Delete
|
|
781
|
+
* Delete an A/B test. To determine the `id` for an A/B test, use the [`listABTests` operation](#tag/abtest/operation/listABTests).
|
|
782
782
|
*
|
|
783
|
-
* @summary Delete
|
|
783
|
+
* @summary Delete an A/B test.
|
|
784
784
|
* @param deleteABTest - The deleteABTest object.
|
|
785
|
-
* @param deleteABTest.id -
|
|
785
|
+
* @param deleteABTest.id - Unique A/B test ID.
|
|
786
786
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
787
787
|
*/
|
|
788
788
|
deleteABTest({ id }, requestOptions) {
|
|
@@ -805,8 +805,8 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
805
805
|
*
|
|
806
806
|
* @summary Send requests to the Algolia REST API.
|
|
807
807
|
* @param get - The get object.
|
|
808
|
-
* @param get.path -
|
|
809
|
-
* @param get.parameters - Query parameters to
|
|
808
|
+
* @param get.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
809
|
+
* @param get.parameters - Query parameters to apply to the current query.
|
|
810
810
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
811
811
|
*/
|
|
812
812
|
get({ path, parameters }, requestOptions) {
|
|
@@ -825,11 +825,11 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
825
825
|
return transporter.request(request, requestOptions);
|
|
826
826
|
},
|
|
827
827
|
/**
|
|
828
|
-
*
|
|
828
|
+
* Get specific details for an A/B test. To determine the `id` for an A/B test, use the [`listABTests` operation](#tag/abtest/operation/listABTests).
|
|
829
829
|
*
|
|
830
|
-
* @summary Get
|
|
830
|
+
* @summary Get A/B test details.
|
|
831
831
|
* @param getABTest - The getABTest object.
|
|
832
|
-
* @param getABTest.id -
|
|
832
|
+
* @param getABTest.id - Unique A/B test ID.
|
|
833
833
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
834
834
|
*/
|
|
835
835
|
getABTest({ id }, requestOptions) {
|
|
@@ -848,14 +848,14 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
848
848
|
return transporter.request(request, requestOptions);
|
|
849
849
|
},
|
|
850
850
|
/**
|
|
851
|
-
*
|
|
851
|
+
* List all A/B tests.
|
|
852
852
|
*
|
|
853
|
-
* @summary List all tests.
|
|
853
|
+
* @summary List all A/B tests.
|
|
854
854
|
* @param listABTests - The listABTests object.
|
|
855
855
|
* @param listABTests.offset - Position of the starting record. Used for paging. 0 is the first record.
|
|
856
|
-
* @param listABTests.limit - Number of records to return
|
|
857
|
-
* @param listABTests.indexPrefix -
|
|
858
|
-
* @param listABTests.indexSuffix -
|
|
856
|
+
* @param listABTests.limit - Number of records to return (page size).
|
|
857
|
+
* @param listABTests.indexPrefix - Only return A/B tests for indices starting with this prefix.
|
|
858
|
+
* @param listABTests.indexSuffix - Only return A/B tests for indices ending with this suffix.
|
|
859
859
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
860
860
|
*/
|
|
861
861
|
listABTests({ offset, limit, indexPrefix, indexSuffix } = {}, requestOptions = undefined) {
|
|
@@ -887,9 +887,9 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
887
887
|
*
|
|
888
888
|
* @summary Send requests to the Algolia REST API.
|
|
889
889
|
* @param post - The post object.
|
|
890
|
-
* @param post.path -
|
|
891
|
-
* @param post.parameters - Query parameters to
|
|
892
|
-
* @param post.body -
|
|
890
|
+
* @param post.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
891
|
+
* @param post.parameters - Query parameters to apply to the current query.
|
|
892
|
+
* @param post.body - Parameters to send with the custom request.
|
|
893
893
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
894
894
|
*/
|
|
895
895
|
post({ path, parameters, body }, requestOptions) {
|
|
@@ -913,9 +913,9 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
913
913
|
*
|
|
914
914
|
* @summary Send requests to the Algolia REST API.
|
|
915
915
|
* @param put - The put object.
|
|
916
|
-
* @param put.path -
|
|
917
|
-
* @param put.parameters - Query parameters to
|
|
918
|
-
* @param put.body -
|
|
916
|
+
* @param put.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
917
|
+
* @param put.parameters - Query parameters to apply to the current query.
|
|
918
|
+
* @param put.body - Parameters to send with the custom request.
|
|
919
919
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
920
920
|
*/
|
|
921
921
|
put({ path, parameters, body }, requestOptions) {
|
|
@@ -935,11 +935,11 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
935
935
|
return transporter.request(request, requestOptions);
|
|
936
936
|
},
|
|
937
937
|
/**
|
|
938
|
-
*
|
|
938
|
+
* If stopped, the test is over and can\'t be restarted. There is now only one index, receiving 100% of all search requests. The data gathered for stopped A/B tests is retained. To determine the `id` for an A/B test, use the [`listABTests` operation](#tag/abtest/operation/listABTests).
|
|
939
939
|
*
|
|
940
|
-
* @summary Stop
|
|
940
|
+
* @summary Stop an A/B test.
|
|
941
941
|
* @param stopABTest - The stopABTest object.
|
|
942
|
-
* @param stopABTest.id -
|
|
942
|
+
* @param stopABTest.id - Unique A/B test ID.
|
|
943
943
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
944
944
|
*/
|
|
945
945
|
stopABTest({ id }, requestOptions) {
|
|
@@ -2,7 +2,7 @@ import { createAuth, createTransporter, getAlgoliaAgent, DEFAULT_CONNECT_TIMEOUT
|
|
|
2
2
|
import { createHttpRequester } from '@algolia/requester-node-http';
|
|
3
3
|
|
|
4
4
|
// 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.
|
|
5
|
-
const apiClientVersion = '5.0.0-alpha.
|
|
5
|
+
const apiClientVersion = '5.0.0-alpha.76';
|
|
6
6
|
const REGIONS = ['de', 'us'];
|
|
7
7
|
function getDefaultHosts(region) {
|
|
8
8
|
const url = !region
|
|
@@ -62,9 +62,9 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
62
62
|
transporter.algoliaAgent.add({ segment, version });
|
|
63
63
|
},
|
|
64
64
|
/**
|
|
65
|
-
* Creates
|
|
65
|
+
* Creates an A/B test.
|
|
66
66
|
*
|
|
67
|
-
* @summary Create
|
|
67
|
+
* @summary Create an A/B test.
|
|
68
68
|
* @param addABTestsRequest - The addABTestsRequest object.
|
|
69
69
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
70
70
|
*/
|
|
@@ -75,8 +75,8 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
75
75
|
if (!addABTestsRequest.name) {
|
|
76
76
|
throw new Error('Parameter `addABTestsRequest.name` is required when calling `addABTests`.');
|
|
77
77
|
}
|
|
78
|
-
if (!addABTestsRequest.
|
|
79
|
-
throw new Error('Parameter `addABTestsRequest.
|
|
78
|
+
if (!addABTestsRequest.variants) {
|
|
79
|
+
throw new Error('Parameter `addABTestsRequest.variants` is required when calling `addABTests`.');
|
|
80
80
|
}
|
|
81
81
|
if (!addABTestsRequest.endAt) {
|
|
82
82
|
throw new Error('Parameter `addABTestsRequest.endAt` is required when calling `addABTests`.');
|
|
@@ -98,8 +98,8 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
98
98
|
*
|
|
99
99
|
* @summary Send requests to the Algolia REST API.
|
|
100
100
|
* @param del - The del object.
|
|
101
|
-
* @param del.path -
|
|
102
|
-
* @param del.parameters - Query parameters to
|
|
101
|
+
* @param del.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
102
|
+
* @param del.parameters - Query parameters to apply to the current query.
|
|
103
103
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
104
104
|
*/
|
|
105
105
|
del({ path, parameters }, requestOptions) {
|
|
@@ -118,11 +118,11 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
118
118
|
return transporter.request(request, requestOptions);
|
|
119
119
|
},
|
|
120
120
|
/**
|
|
121
|
-
* Delete
|
|
121
|
+
* Delete an A/B test. To determine the `id` for an A/B test, use the [`listABTests` operation](#tag/abtest/operation/listABTests).
|
|
122
122
|
*
|
|
123
|
-
* @summary Delete
|
|
123
|
+
* @summary Delete an A/B test.
|
|
124
124
|
* @param deleteABTest - The deleteABTest object.
|
|
125
|
-
* @param deleteABTest.id -
|
|
125
|
+
* @param deleteABTest.id - Unique A/B test ID.
|
|
126
126
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
127
127
|
*/
|
|
128
128
|
deleteABTest({ id }, requestOptions) {
|
|
@@ -145,8 +145,8 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
145
145
|
*
|
|
146
146
|
* @summary Send requests to the Algolia REST API.
|
|
147
147
|
* @param get - The get object.
|
|
148
|
-
* @param get.path -
|
|
149
|
-
* @param get.parameters - Query parameters to
|
|
148
|
+
* @param get.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
149
|
+
* @param get.parameters - Query parameters to apply to the current query.
|
|
150
150
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
151
151
|
*/
|
|
152
152
|
get({ path, parameters }, requestOptions) {
|
|
@@ -165,11 +165,11 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
165
165
|
return transporter.request(request, requestOptions);
|
|
166
166
|
},
|
|
167
167
|
/**
|
|
168
|
-
*
|
|
168
|
+
* Get specific details for an A/B test. To determine the `id` for an A/B test, use the [`listABTests` operation](#tag/abtest/operation/listABTests).
|
|
169
169
|
*
|
|
170
|
-
* @summary Get
|
|
170
|
+
* @summary Get A/B test details.
|
|
171
171
|
* @param getABTest - The getABTest object.
|
|
172
|
-
* @param getABTest.id -
|
|
172
|
+
* @param getABTest.id - Unique A/B test ID.
|
|
173
173
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
174
174
|
*/
|
|
175
175
|
getABTest({ id }, requestOptions) {
|
|
@@ -188,14 +188,14 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
188
188
|
return transporter.request(request, requestOptions);
|
|
189
189
|
},
|
|
190
190
|
/**
|
|
191
|
-
*
|
|
191
|
+
* List all A/B tests.
|
|
192
192
|
*
|
|
193
|
-
* @summary List all tests.
|
|
193
|
+
* @summary List all A/B tests.
|
|
194
194
|
* @param listABTests - The listABTests object.
|
|
195
195
|
* @param listABTests.offset - Position of the starting record. Used for paging. 0 is the first record.
|
|
196
|
-
* @param listABTests.limit - Number of records to return
|
|
197
|
-
* @param listABTests.indexPrefix -
|
|
198
|
-
* @param listABTests.indexSuffix -
|
|
196
|
+
* @param listABTests.limit - Number of records to return (page size).
|
|
197
|
+
* @param listABTests.indexPrefix - Only return A/B tests for indices starting with this prefix.
|
|
198
|
+
* @param listABTests.indexSuffix - Only return A/B tests for indices ending with this suffix.
|
|
199
199
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
200
200
|
*/
|
|
201
201
|
listABTests({ offset, limit, indexPrefix, indexSuffix } = {}, requestOptions = undefined) {
|
|
@@ -227,9 +227,9 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
227
227
|
*
|
|
228
228
|
* @summary Send requests to the Algolia REST API.
|
|
229
229
|
* @param post - The post object.
|
|
230
|
-
* @param post.path -
|
|
231
|
-
* @param post.parameters - Query parameters to
|
|
232
|
-
* @param post.body -
|
|
230
|
+
* @param post.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
231
|
+
* @param post.parameters - Query parameters to apply to the current query.
|
|
232
|
+
* @param post.body - Parameters to send with the custom request.
|
|
233
233
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
234
234
|
*/
|
|
235
235
|
post({ path, parameters, body }, requestOptions) {
|
|
@@ -253,9 +253,9 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
253
253
|
*
|
|
254
254
|
* @summary Send requests to the Algolia REST API.
|
|
255
255
|
* @param put - The put object.
|
|
256
|
-
* @param put.path -
|
|
257
|
-
* @param put.parameters - Query parameters to
|
|
258
|
-
* @param put.body -
|
|
256
|
+
* @param put.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
257
|
+
* @param put.parameters - Query parameters to apply to the current query.
|
|
258
|
+
* @param put.body - Parameters to send with the custom request.
|
|
259
259
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
260
260
|
*/
|
|
261
261
|
put({ path, parameters, body }, requestOptions) {
|
|
@@ -275,11 +275,11 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
275
275
|
return transporter.request(request, requestOptions);
|
|
276
276
|
},
|
|
277
277
|
/**
|
|
278
|
-
*
|
|
278
|
+
* If stopped, the test is over and can\'t be restarted. There is now only one index, receiving 100% of all search requests. The data gathered for stopped A/B tests is retained. To determine the `id` for an A/B test, use the [`listABTests` operation](#tag/abtest/operation/listABTests).
|
|
279
279
|
*
|
|
280
|
-
* @summary Stop
|
|
280
|
+
* @summary Stop an A/B test.
|
|
281
281
|
* @param stopABTest - The stopABTest object.
|
|
282
|
-
* @param stopABTest.id -
|
|
282
|
+
* @param stopABTest.id - Unique A/B test ID.
|
|
283
283
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
284
284
|
*/
|
|
285
285
|
stopABTest({ id }, requestOptions) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! client-abtesting.umd.js | 5.0.0-alpha.
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/client-abtesting"]={})}(this,(function(e){"use strict";function t(e){let t;const r=`algolia-client-js-${e.key}`;function s(){return void 0===t&&(t=e.localStorage||window.localStorage),t}function a(){return JSON.parse(s().getItem(r)||"{}")}return{get:(e,t,r={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>{const r=JSON.stringify(e),s=a()[r];return Promise.all([s||t(),void 0!==s])})).then((([e,t])=>Promise.all([e,t||r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve().then((()=>{const n=a();return n[JSON.stringify(e)]=t,s().setItem(r,JSON.stringify(n)),t})),delete:e=>Promise.resolve().then((()=>{const t=a();delete t[JSON.stringify(e)],s().setItem(r,JSON.stringify(t))})),clear:()=>Promise.resolve().then((()=>{s().removeItem(r)}))}}function r(e){const t=[...e.caches],s=t.shift();return void 0===s?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then((e=>Promise.all([e,r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,a,n={miss:()=>Promise.resolve()})=>s.get(e,a,n).catch((()=>r({caches:t}).get(e,a,n))),set:(e,a)=>s.set(e,a).catch((()=>r({caches:t}).set(e,a))),delete:e=>s.delete(e).catch((()=>r({caches:t}).delete(e))),clear:()=>s.clear().catch((()=>r({caches:t}).clear()))}}function s(e={serializable:!0}){let t={};return{get(r,s,a={miss:()=>Promise.resolve()}){const n=JSON.stringify(r);if(n in t)return Promise.resolve(e.serializable?JSON.parse(t[n]):t[n]);const o=s();return o.then((e=>a.miss(e))).then((()=>o))},set:(r,s)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(s):s,Promise.resolve(s)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}const a=12e4;function n(e,t="up"){const r=Date.now();return{...e,status:t,lastUpdate:r,isUp:function(){return"up"===t||Date.now()-r>a},isTimedOut:function(){return"timed out"===t&&Date.now()-r<=a}}}function o(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var s=r.call(e,t||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class i extends Error{constructor(e,t){super(e),o(this,"name","AlgoliaError"),t&&(this.name=t)}}class c extends i{constructor(e,t,r){super(e,r),o(this,"stackTrace",void 0),this.stackTrace=t}}class u extends c{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",e,"RetryError")}}class l extends c{constructor(e,t,r,s="ApiError"){super(e,r,s),o(this,"status",void 0),this.status=t}}class d extends i{constructor(e,t){super(e,"DeserializationError"),o(this,"response",void 0),this.response=t}}class h extends l{constructor(e,t,r,s){super(e,t,s,"DetailedApiError"),o(this,"error",void 0),this.error=r}}function m(e,t,r){const s=function(e){const t=e=>"[object Object]"===Object.prototype.toString.call(e)||"[object Array]"===Object.prototype.toString.call(e);return Object.keys(e).map((r=>`${r}=${encodeURIComponent(t(e[r])?JSON.stringify(e[r]):e[r])}`)).join("&")}(r);let a=`${e.protocol}://${e.url}/${"/"===t.charAt(0)?t.substr(1):t}`;return s.length&&(a+=`?${s}`),a}function p(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function f({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:s,algoliaAgent:a,timeouts:o,requester:i,requestsCache:c,responsesCache:f}){async function g(c,f,g=!0){const y=[],P=function(e,t){if("GET"===e.method||void 0===e.data&&void 0===t.data)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}(c,f),w=function(e,t,r){const s={Accept:"application/json",...e,...t,...r},a={};return Object.keys(s).forEach((e=>{const t=s[e];a[e.toLowerCase()]=t})),a}(r,c.headers,f.headers),q="GET"===c.method?{...c.data,...f.data}:{},v={...s,...c.queryParameters,...q};if(a.value&&(v["x-algolia-agent"]=a.value),f&&f.queryParameters)for(const e of Object.keys(f.queryParameters))f.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(f.queryParameters[e])?v[e]=f.queryParameters[e].toString():v[e]=f.queryParameters[e];let T=0;const b=async(e,r)=>{const s=e.pop();if(void 0===s)throw new u(function(e){return e.map((e=>p(e)))}(y));let a=f.timeout;void 0===a&&(a=g?o.read:o.write);const q={data:P,headers:w,method:c.method,url:m(s,c.path,v),connectTimeout:r(T,o.connect),responseTimeout:r(T,a)},O=t=>{const r={request:q,response:t,host:s,triesLeft:e.length};return y.push(r),r},A=await i.send(q);if(function({isTimedOut:e,status:t}){return e||function({isTimedOut:e,status:t}){return!e&&0==~~t}({isTimedOut:e,status:t})||2!=~~(t/100)&&4!=~~(t/100)}(A)){const a=O(A);return A.isTimedOut&&T++,console.log("Retryable failure",p(a)),await t.set(s,n(s,A.isTimedOut?"timed out":"down")),b(e,r)}if(function({status:e}){return 2==~~(e/100)}(A))return function(e){try{return JSON.parse(e.content)}catch(t){throw new d(t.message,e)}}(A);throw O(A),function({content:e,status:t},r){try{const s=JSON.parse(e);return"error"in s?new h(s.message,t,s.error,r):new l(s.message,t,r)}catch(e){}return new l(e,t,r)}(A,y)},O=e.filter((e=>"readWrite"===e.accept||(g?"read"===e.accept:"write"===e.accept))),A=await async function(e){const r=await Promise.all(e.map((e=>t.get(e,(()=>Promise.resolve(n(e))))))),s=r.filter((e=>e.isUp())),a=r.filter((e=>e.isTimedOut())),o=[...s,...a];return{hosts:o.length>0?o:e,getTimeout:(e,t)=>(0===a.length&&0===e?1:a.length+3+e)*t}}(O);return b([...A.hosts].reverse(),A.getTimeout)}return{hostsCache:t,requester:i,timeouts:o,algoliaAgent:a,baseHeaders:r,baseQueryParameters:s,hosts:e,request:function(e,t={}){const a=e.useReadTransporter||"GET"===e.method;if(!a)return g(e,t,a);const n=()=>g(e,t);if(!0!==(t.cacheable||e.cacheable))return n();const o={request:e,requestOptions:t,transporter:{queryParameters:s,headers:r}};return f.get(o,(()=>c.get(o,(()=>c.set(o,n()).then((e=>Promise.all([c.delete(o),e])),(e=>Promise.all([c.delete(o),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>f.set(o,e)})},requestsCache:c,responsesCache:f}}function g({algoliaAgents:e,client:t,version:r}){const s=function(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}(r).add({segment:t,version:r});return e.forEach((e=>s.add(e))),s}const y="5.0.0-alpha.73",P=["de","us"];e.abtestingClient=function(e,a,n,o){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!a||"string"!=typeof a)throw new Error("`apiKey` is missing.");if(n&&("string"!=typeof n||!P.includes(n)))throw new Error(`\`region\` must be one of the following: ${P.join(", ")}`);return function({appId:e,apiKey:t,authMode:r,algoliaAgents:s,region:a,...n}){const o=function(e,t,r="WithinHeaders"){const s={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===r?s:{},queryParameters:()=>"WithinQueryParameters"===r?s:{}}}(e,t,r),i=f({hosts:(c=a,[{url:c?"analytics.{region}.algolia.com".replace("{region}",c):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]),...n,algoliaAgent:g({algoliaAgents:s,client:"Abtesting",version:y}),baseHeaders:{"content-type":"text/plain",...o.headers(),...n.baseHeaders},baseQueryParameters:{...o.queryParameters(),...n.baseQueryParameters}});var c;return{transporter:i,appId:e,clearCache:()=>Promise.all([i.requestsCache.clear(),i.responsesCache.clear()]).then((()=>{})),get _ua(){return i.algoliaAgent.value},addAlgoliaAgent(e,t){i.algoliaAgent.add({segment:e,version:t})},addABTests(e,t){if(!e)throw new Error("Parameter `addABTestsRequest` is required when calling `addABTests`.");if(!e.name)throw new Error("Parameter `addABTestsRequest.name` is required when calling `addABTests`.");if(!e.variant)throw new Error("Parameter `addABTestsRequest.variant` is required when calling `addABTests`.");if(!e.endAt)throw new Error("Parameter `addABTestsRequest.endAt` is required when calling `addABTests`.");const r={method:"POST",path:"/2/abtests",queryParameters:{},headers:{},data:e};return i.request(r,t)},del({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `del`.");const s={method:"DELETE",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(s,r)},deleteABTest({id:e},t){if(!e)throw new Error("Parameter `id` is required when calling `deleteABTest`.");const r={method:"DELETE",path:"/2/abtests/{id}".replace("{id}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},get({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `get`.");const s={method:"GET",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(s,r)},getABTest({id:e},t){if(!e)throw new Error("Parameter `id` is required when calling `getABTest`.");const r={method:"GET",path:"/2/abtests/{id}".replace("{id}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},listABTests({offset:e,limit:t,indexPrefix:r,indexSuffix:s}={},a=undefined){const n={};void 0!==e&&(n.offset=e.toString()),void 0!==t&&(n.limit=t.toString()),void 0!==r&&(n.indexPrefix=r.toString()),void 0!==s&&(n.indexSuffix=s.toString());const o={method:"GET",path:"/2/abtests",queryParameters:n,headers:{}};return i.request(o,a)},post({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `post`.");const a={method:"POST",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return i.request(a,s)},put({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `put`.");const a={method:"PUT",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return i.request(a,s)},stopABTest({id:e},t){if(!e)throw new Error("Parameter `id` is required when calling `stopABTest`.");const r={method:"POST",path:"/2/abtests/{id}/stop".replace("{id}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)}}}({appId:e,apiKey:a,region:n,timeouts:{connect:1e3,read:2e3,write:3e4},requester:{send:function(e){return new Promise((t=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((t=>r.setRequestHeader(t,e.headers[t])));const s=(e,s)=>setTimeout((()=>{r.abort(),t({status:0,content:s,isTimedOut:!0})}),e),a=s(e.connectTimeout,"Connection timeout");let n;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===n&&(clearTimeout(a),n=s(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(a),clearTimeout(n),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(a),clearTimeout(n),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:s(),requestsCache:s({serializable:!1}),hostsCache:r({caches:[t({key:`${y}-${e}`}),s()]}),...o})},e.apiClientVersion=y}));
|
|
1
|
+
/*! client-abtesting.umd.js | 5.0.0-alpha.76 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/client-abtesting"]={})}(this,(function(e){"use strict";function t(e){let t;const r=`algolia-client-js-${e.key}`;function s(){return void 0===t&&(t=e.localStorage||window.localStorage),t}function a(){return JSON.parse(s().getItem(r)||"{}")}return{get:(e,t,r={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>{const r=JSON.stringify(e),s=a()[r];return Promise.all([s||t(),void 0!==s])})).then((([e,t])=>Promise.all([e,t||r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve().then((()=>{const n=a();return n[JSON.stringify(e)]=t,s().setItem(r,JSON.stringify(n)),t})),delete:e=>Promise.resolve().then((()=>{const t=a();delete t[JSON.stringify(e)],s().setItem(r,JSON.stringify(t))})),clear:()=>Promise.resolve().then((()=>{s().removeItem(r)}))}}function r(e){const t=[...e.caches],s=t.shift();return void 0===s?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then((e=>Promise.all([e,r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,a,n={miss:()=>Promise.resolve()})=>s.get(e,a,n).catch((()=>r({caches:t}).get(e,a,n))),set:(e,a)=>s.set(e,a).catch((()=>r({caches:t}).set(e,a))),delete:e=>s.delete(e).catch((()=>r({caches:t}).delete(e))),clear:()=>s.clear().catch((()=>r({caches:t}).clear()))}}function s(e={serializable:!0}){let t={};return{get(r,s,a={miss:()=>Promise.resolve()}){const n=JSON.stringify(r);if(n in t)return Promise.resolve(e.serializable?JSON.parse(t[n]):t[n]);const o=s();return o.then((e=>a.miss(e))).then((()=>o))},set:(r,s)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(s):s,Promise.resolve(s)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}const a=12e4;function n(e,t="up"){const r=Date.now();return{...e,status:t,lastUpdate:r,isUp:function(){return"up"===t||Date.now()-r>a},isTimedOut:function(){return"timed out"===t&&Date.now()-r<=a}}}function o(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var s=r.call(e,t||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class i extends Error{constructor(e,t){super(e),o(this,"name","AlgoliaError"),t&&(this.name=t)}}class c extends i{constructor(e,t,r){super(e,r),o(this,"stackTrace",void 0),this.stackTrace=t}}class u extends c{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",e,"RetryError")}}class l extends c{constructor(e,t,r,s="ApiError"){super(e,r,s),o(this,"status",void 0),this.status=t}}class d extends i{constructor(e,t){super(e,"DeserializationError"),o(this,"response",void 0),this.response=t}}class h extends l{constructor(e,t,r,s){super(e,t,s,"DetailedApiError"),o(this,"error",void 0),this.error=r}}function m(e,t,r){const s=function(e){const t=e=>"[object Object]"===Object.prototype.toString.call(e)||"[object Array]"===Object.prototype.toString.call(e);return Object.keys(e).map((r=>`${r}=${encodeURIComponent(t(e[r])?JSON.stringify(e[r]):e[r])}`)).join("&")}(r);let a=`${e.protocol}://${e.url}/${"/"===t.charAt(0)?t.substr(1):t}`;return s.length&&(a+=`?${s}`),a}function p(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function f({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:s,algoliaAgent:a,timeouts:o,requester:i,requestsCache:c,responsesCache:f}){async function g(c,f,g=!0){const y=[],P=function(e,t){if("GET"===e.method||void 0===e.data&&void 0===t.data)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}(c,f),w=function(e,t,r){const s={Accept:"application/json",...e,...t,...r},a={};return Object.keys(s).forEach((e=>{const t=s[e];a[e.toLowerCase()]=t})),a}(r,c.headers,f.headers),v="GET"===c.method?{...c.data,...f.data}:{},q={...s,...c.queryParameters,...v};if(a.value&&(q["x-algolia-agent"]=a.value),f&&f.queryParameters)for(const e of Object.keys(f.queryParameters))f.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(f.queryParameters[e])?q[e]=f.queryParameters[e].toString():q[e]=f.queryParameters[e];let T=0;const b=async(e,r)=>{const s=e.pop();if(void 0===s)throw new u(function(e){return e.map((e=>p(e)))}(y));let a=f.timeout;void 0===a&&(a=g?o.read:o.write);const v={data:P,headers:w,method:c.method,url:m(s,c.path,q),connectTimeout:r(T,o.connect),responseTimeout:r(T,a)},O=t=>{const r={request:v,response:t,host:s,triesLeft:e.length};return y.push(r),r},A=await i.send(v);if(function({isTimedOut:e,status:t}){return e||function({isTimedOut:e,status:t}){return!e&&0==~~t}({isTimedOut:e,status:t})||2!=~~(t/100)&&4!=~~(t/100)}(A)){const a=O(A);return A.isTimedOut&&T++,console.log("Retryable failure",p(a)),await t.set(s,n(s,A.isTimedOut?"timed out":"down")),b(e,r)}if(function({status:e}){return 2==~~(e/100)}(A))return function(e){try{return JSON.parse(e.content)}catch(t){throw new d(t.message,e)}}(A);throw O(A),function({content:e,status:t},r){try{const s=JSON.parse(e);return"error"in s?new h(s.message,t,s.error,r):new l(s.message,t,r)}catch(e){}return new l(e,t,r)}(A,y)},O=e.filter((e=>"readWrite"===e.accept||(g?"read"===e.accept:"write"===e.accept))),A=await async function(e){const r=await Promise.all(e.map((e=>t.get(e,(()=>Promise.resolve(n(e))))))),s=r.filter((e=>e.isUp())),a=r.filter((e=>e.isTimedOut())),o=[...s,...a];return{hosts:o.length>0?o:e,getTimeout:(e,t)=>(0===a.length&&0===e?1:a.length+3+e)*t}}(O);return b([...A.hosts].reverse(),A.getTimeout)}return{hostsCache:t,requester:i,timeouts:o,algoliaAgent:a,baseHeaders:r,baseQueryParameters:s,hosts:e,request:function(e,t={}){const a=e.useReadTransporter||"GET"===e.method;if(!a)return g(e,t,a);const n=()=>g(e,t);if(!0!==(t.cacheable||e.cacheable))return n();const o={request:e,requestOptions:t,transporter:{queryParameters:s,headers:r}};return f.get(o,(()=>c.get(o,(()=>c.set(o,n()).then((e=>Promise.all([c.delete(o),e])),(e=>Promise.all([c.delete(o),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>f.set(o,e)})},requestsCache:c,responsesCache:f}}function g({algoliaAgents:e,client:t,version:r}){const s=function(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}(r).add({segment:t,version:r});return e.forEach((e=>s.add(e))),s}const y="5.0.0-alpha.76",P=["de","us"];e.abtestingClient=function(e,a,n,o){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!a||"string"!=typeof a)throw new Error("`apiKey` is missing.");if(n&&("string"!=typeof n||!P.includes(n)))throw new Error(`\`region\` must be one of the following: ${P.join(", ")}`);return function({appId:e,apiKey:t,authMode:r,algoliaAgents:s,region:a,...n}){const o=function(e,t,r="WithinHeaders"){const s={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===r?s:{},queryParameters:()=>"WithinQueryParameters"===r?s:{}}}(e,t,r),i=f({hosts:(c=a,[{url:c?"analytics.{region}.algolia.com".replace("{region}",c):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]),...n,algoliaAgent:g({algoliaAgents:s,client:"Abtesting",version:y}),baseHeaders:{"content-type":"text/plain",...o.headers(),...n.baseHeaders},baseQueryParameters:{...o.queryParameters(),...n.baseQueryParameters}});var c;return{transporter:i,appId:e,clearCache:()=>Promise.all([i.requestsCache.clear(),i.responsesCache.clear()]).then((()=>{})),get _ua(){return i.algoliaAgent.value},addAlgoliaAgent(e,t){i.algoliaAgent.add({segment:e,version:t})},addABTests(e,t){if(!e)throw new Error("Parameter `addABTestsRequest` is required when calling `addABTests`.");if(!e.name)throw new Error("Parameter `addABTestsRequest.name` is required when calling `addABTests`.");if(!e.variants)throw new Error("Parameter `addABTestsRequest.variants` is required when calling `addABTests`.");if(!e.endAt)throw new Error("Parameter `addABTestsRequest.endAt` is required when calling `addABTests`.");const r={method:"POST",path:"/2/abtests",queryParameters:{},headers:{},data:e};return i.request(r,t)},del({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `del`.");const s={method:"DELETE",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(s,r)},deleteABTest({id:e},t){if(!e)throw new Error("Parameter `id` is required when calling `deleteABTest`.");const r={method:"DELETE",path:"/2/abtests/{id}".replace("{id}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},get({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `get`.");const s={method:"GET",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(s,r)},getABTest({id:e},t){if(!e)throw new Error("Parameter `id` is required when calling `getABTest`.");const r={method:"GET",path:"/2/abtests/{id}".replace("{id}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},listABTests({offset:e,limit:t,indexPrefix:r,indexSuffix:s}={},a=void 0){const n={};void 0!==e&&(n.offset=e.toString()),void 0!==t&&(n.limit=t.toString()),void 0!==r&&(n.indexPrefix=r.toString()),void 0!==s&&(n.indexSuffix=s.toString());const o={method:"GET",path:"/2/abtests",queryParameters:n,headers:{}};return i.request(o,a)},post({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `post`.");const a={method:"POST",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return i.request(a,s)},put({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `put`.");const a={method:"PUT",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return i.request(a,s)},stopABTest({id:e},t){if(!e)throw new Error("Parameter `id` is required when calling `stopABTest`.");const r={method:"POST",path:"/2/abtests/{id}/stop".replace("{id}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)}}}({appId:e,apiKey:a,region:n,timeouts:{connect:1e3,read:2e3,write:3e4},requester:{send:function(e){return new Promise((t=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((t=>r.setRequestHeader(t,e.headers[t])));const s=(e,s)=>setTimeout((()=>{r.abort(),t({status:0,content:s,isTimedOut:!0})}),e),a=s(e.connectTimeout,"Connection timeout");let n;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===n&&(clearTimeout(a),n=s(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(a),clearTimeout(n),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(a),clearTimeout(n),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:s(),requestsCache:s({serializable:!1}),hostsCache:r({caches:[t({key:`${y}-${e}`}),s()]}),...o})},e.apiClientVersion=y}));
|
package/dist/model/aBTest.d.ts
CHANGED
|
@@ -1,27 +1,23 @@
|
|
|
1
1
|
import type { Variant } from './variant';
|
|
2
2
|
export type ABTest = {
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Unique A/B test ID.
|
|
5
5
|
*/
|
|
6
6
|
abTestID: number;
|
|
7
7
|
/**
|
|
8
|
-
* A/B test significance based on click data.
|
|
8
|
+
* [A/B test significance](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing/in-depth/how-ab-test-scores-are-calculated/#statistical-significance-or-chance) based on click data. A value of 0.95 or over is considered to be _significant_.
|
|
9
9
|
*/
|
|
10
10
|
clickSignificance: number;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* End date timestamp in [ISO-8601](https://wikipedia.org/wiki/ISO_8601) format.
|
|
13
13
|
*/
|
|
14
|
-
conversionSignificance:
|
|
14
|
+
conversionSignificance: string;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
*/
|
|
18
|
-
endAt: string;
|
|
19
|
-
/**
|
|
20
|
-
* Update date for the A/B test expressed as YYYY-MM-DDThh:mm:ssZ.
|
|
16
|
+
* Update date timestamp in [ISO-8601](https://wikipedia.org/wiki/ISO_8601) format.
|
|
21
17
|
*/
|
|
22
18
|
updatedAt: string;
|
|
23
19
|
/**
|
|
24
|
-
* Creation date
|
|
20
|
+
* Creation date timestamp in [ISO-8601](https://wikipedia.org/wiki/ISO_8601) format.
|
|
25
21
|
*/
|
|
26
22
|
createdAt: string;
|
|
27
23
|
/**
|
|
@@ -29,11 +25,11 @@ export type ABTest = {
|
|
|
29
25
|
*/
|
|
30
26
|
name: string;
|
|
31
27
|
/**
|
|
32
|
-
*
|
|
28
|
+
* A/B test status.
|
|
33
29
|
*/
|
|
34
30
|
status: string;
|
|
35
31
|
/**
|
|
36
|
-
*
|
|
32
|
+
* A/B test variants.
|
|
37
33
|
*/
|
|
38
34
|
variants: Variant[];
|
|
39
35
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aBTest.d.ts","sourceRoot":"","sources":["../../model/aBTest.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,MAAM,MAAM,GAAG;IACnB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,sBAAsB,EAAE,MAAM,CAAC;IAE/B;;OAEG;IACH,
|
|
1
|
+
{"version":3,"file":"aBTest.d.ts","sourceRoot":"","sources":["../../model/aBTest.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,MAAM,MAAM,GAAG;IACnB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,sBAAsB,EAAE,MAAM,CAAC;IAE/B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export type ABTestResponse = {
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* A/B test index.
|
|
4
4
|
*/
|
|
5
5
|
index: string;
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Unique A/B test ID.
|
|
8
8
|
*/
|
|
9
9
|
abTestID: number;
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Unique identifier of a task. A successful API response means that a task was added to a queue. It might not run immediately. You can check the task\'s progress with the `task` operation and this `taskID`.
|
|
12
12
|
*/
|
|
13
13
|
taskID: number;
|
|
14
14
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export type AbTestsVariant = {
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* A/B test index.
|
|
4
4
|
*/
|
|
5
5
|
index: string;
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* A/B test traffic percentage.
|
|
8
8
|
*/
|
|
9
9
|
trafficPercentage: number;
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* A/B test description.
|
|
12
12
|
*/
|
|
13
13
|
description?: string;
|
|
14
14
|
};
|
|
@@ -5,11 +5,11 @@ export type AddABTestsRequest = {
|
|
|
5
5
|
*/
|
|
6
6
|
name: string;
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* A/B test variants.
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
variants: AddABTestsVariant[];
|
|
11
11
|
/**
|
|
12
|
-
* End date
|
|
12
|
+
* End date timestamp in [ISO-8601](https://wikipedia.org/wiki/ISO_8601) format.
|
|
13
13
|
*/
|
|
14
14
|
endAt: string;
|
|
15
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addABTestsRequest.d.ts","sourceRoot":"","sources":["../../model/addABTestsRequest.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,
|
|
1
|
+
{"version":3,"file":"addABTestsRequest.d.ts","sourceRoot":"","sources":["../../model/addABTestsRequest.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAE9B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
|