@algolia/client-abtesting 5.2.4 → 5.3.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.
Files changed (77) hide show
  1. package/dist/browser.d.ts +582 -0
  2. package/dist/builds/browser.js +401 -0
  3. package/dist/builds/browser.js.map +1 -0
  4. package/dist/builds/browser.min.js +2 -0
  5. package/dist/builds/browser.min.js.map +1 -0
  6. package/dist/builds/browser.umd.js +12 -0
  7. package/dist/builds/node.cjs +419 -0
  8. package/dist/builds/node.cjs.map +1 -0
  9. package/dist/builds/node.js +399 -0
  10. package/dist/builds/node.js.map +1 -0
  11. package/dist/node.d.cts +582 -0
  12. package/dist/node.d.ts +582 -0
  13. package/dist/src/abtestingClient.cjs +386 -0
  14. package/dist/src/abtestingClient.cjs.map +1 -0
  15. package/dist/src/abtestingClient.js +359 -0
  16. package/dist/src/abtestingClient.js.map +1 -0
  17. package/index.d.ts +1 -1
  18. package/index.js +1 -1
  19. package/package.json +28 -25
  20. package/dist/builds/browser.d.ts +0 -26
  21. package/dist/builds/browser.d.ts.map +0 -1
  22. package/dist/builds/node.d.ts +0 -26
  23. package/dist/builds/node.d.ts.map +0 -1
  24. package/dist/client-abtesting.cjs +0 -376
  25. package/dist/client-abtesting.esm.browser.js +0 -1050
  26. package/dist/client-abtesting.esm.node.js +0 -373
  27. package/dist/client-abtesting.umd.js +0 -2
  28. package/dist/model/aBTest.d.ts +0 -37
  29. package/dist/model/aBTest.d.ts.map +0 -1
  30. package/dist/model/aBTestConfiguration.d.ts +0 -12
  31. package/dist/model/aBTestConfiguration.d.ts.map +0 -1
  32. package/dist/model/aBTestResponse.d.ts +0 -15
  33. package/dist/model/aBTestResponse.d.ts.map +0 -1
  34. package/dist/model/abTestsVariant.d.ts +0 -15
  35. package/dist/model/abTestsVariant.d.ts.map +0 -1
  36. package/dist/model/abTestsVariantSearchParams.d.ts +0 -4
  37. package/dist/model/abTestsVariantSearchParams.d.ts.map +0 -1
  38. package/dist/model/addABTestsRequest.d.ts +0 -16
  39. package/dist/model/addABTestsRequest.d.ts.map +0 -1
  40. package/dist/model/addABTestsVariant.d.ts +0 -4
  41. package/dist/model/addABTestsVariant.d.ts.map +0 -1
  42. package/dist/model/clientMethodProps.d.ts +0 -109
  43. package/dist/model/clientMethodProps.d.ts.map +0 -1
  44. package/dist/model/currency.d.ts +0 -19
  45. package/dist/model/currency.d.ts.map +0 -1
  46. package/dist/model/customSearchParams.d.ts +0 -7
  47. package/dist/model/customSearchParams.d.ts.map +0 -1
  48. package/dist/model/effect.d.ts +0 -5
  49. package/dist/model/effect.d.ts.map +0 -1
  50. package/dist/model/emptySearch.d.ts +0 -10
  51. package/dist/model/emptySearch.d.ts.map +0 -1
  52. package/dist/model/emptySearchFilter.d.ts +0 -14
  53. package/dist/model/emptySearchFilter.d.ts.map +0 -1
  54. package/dist/model/errorBase.d.ts +0 -7
  55. package/dist/model/errorBase.d.ts.map +0 -1
  56. package/dist/model/filterEffects.d.ts +0 -10
  57. package/dist/model/filterEffects.d.ts.map +0 -1
  58. package/dist/model/index.d.ts +0 -24
  59. package/dist/model/index.d.ts.map +0 -1
  60. package/dist/model/listABTestsResponse.d.ts +0 -16
  61. package/dist/model/listABTestsResponse.d.ts.map +0 -1
  62. package/dist/model/minimumDetectableEffect.d.ts +0 -12
  63. package/dist/model/minimumDetectableEffect.d.ts.map +0 -1
  64. package/dist/model/outliers.d.ts +0 -10
  65. package/dist/model/outliers.d.ts.map +0 -1
  66. package/dist/model/outliersFilter.d.ts +0 -14
  67. package/dist/model/outliersFilter.d.ts.map +0 -1
  68. package/dist/model/scheduleABTestResponse.d.ts +0 -7
  69. package/dist/model/scheduleABTestResponse.d.ts.map +0 -1
  70. package/dist/model/scheduleABTestsRequest.d.ts +0 -20
  71. package/dist/model/scheduleABTestsRequest.d.ts.map +0 -1
  72. package/dist/model/status.d.ts +0 -5
  73. package/dist/model/status.d.ts.map +0 -1
  74. package/dist/model/variant.d.ts +0 -82
  75. package/dist/model/variant.d.ts.map +0 -1
  76. package/dist/src/abtestingClient.d.ts +0 -141
  77. package/dist/src/abtestingClient.d.ts.map +0 -1
@@ -0,0 +1,359 @@
1
+ // src/abtestingClient.ts
2
+ import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common";
3
+ var apiClientVersion = "5.3.0";
4
+ var REGIONS = ["de", "us"];
5
+ function getDefaultHosts(region) {
6
+ const url = !region ? "analytics.algolia.com" : "analytics.{region}.algolia.com".replace("{region}", region);
7
+ return [{ url, accept: "readWrite", protocol: "https" }];
8
+ }
9
+ function createAbtestingClient({
10
+ appId: appIdOption,
11
+ apiKey: apiKeyOption,
12
+ authMode,
13
+ algoliaAgents,
14
+ region: regionOption,
15
+ ...options
16
+ }) {
17
+ const auth = createAuth(appIdOption, apiKeyOption, authMode);
18
+ return {
19
+ transporter: createTransporter({
20
+ hosts: getDefaultHosts(regionOption),
21
+ ...options,
22
+ algoliaAgent: getAlgoliaAgent({
23
+ algoliaAgents,
24
+ client: "Abtesting",
25
+ version: apiClientVersion
26
+ }),
27
+ baseHeaders: {
28
+ "content-type": "text/plain",
29
+ ...auth.headers(),
30
+ ...options.baseHeaders
31
+ },
32
+ baseQueryParameters: {
33
+ ...auth.queryParameters(),
34
+ ...options.baseQueryParameters
35
+ }
36
+ }),
37
+ /**
38
+ * The `appId` currently in use.
39
+ */
40
+ appId: appIdOption,
41
+ /**
42
+ * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
43
+ */
44
+ clearCache() {
45
+ return Promise.all([this.transporter.requestsCache.clear(), this.transporter.responsesCache.clear()]).then(
46
+ () => void 0
47
+ );
48
+ },
49
+ /**
50
+ * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
51
+ */
52
+ get _ua() {
53
+ return this.transporter.algoliaAgent.value;
54
+ },
55
+ /**
56
+ * Adds a `segment` to the `x-algolia-agent` sent with every requests.
57
+ *
58
+ * @param segment - The algolia agent (user-agent) segment to add.
59
+ * @param version - The version of the agent.
60
+ */
61
+ addAlgoliaAgent(segment, version) {
62
+ this.transporter.algoliaAgent.add({ segment, version });
63
+ },
64
+ /**
65
+ * Helper method to switch the API key used to authenticate the requests.
66
+ *
67
+ * @param params - Method params.
68
+ * @param params.apiKey - The new API Key to use.
69
+ */
70
+ setClientApiKey({ apiKey }) {
71
+ this.transporter.baseHeaders["x-algolia-api-key"] = apiKey;
72
+ },
73
+ /**
74
+ * Creates a new A/B test.
75
+ *
76
+ * Required API Key ACLs:
77
+ * - editSettings.
78
+ *
79
+ * @param addABTestsRequest - The addABTestsRequest object.
80
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
81
+ */
82
+ addABTests(addABTestsRequest, requestOptions) {
83
+ if (!addABTestsRequest) {
84
+ throw new Error("Parameter `addABTestsRequest` is required when calling `addABTests`.");
85
+ }
86
+ if (!addABTestsRequest.name) {
87
+ throw new Error("Parameter `addABTestsRequest.name` is required when calling `addABTests`.");
88
+ }
89
+ if (!addABTestsRequest.variants) {
90
+ throw new Error("Parameter `addABTestsRequest.variants` is required when calling `addABTests`.");
91
+ }
92
+ if (!addABTestsRequest.endAt) {
93
+ throw new Error("Parameter `addABTestsRequest.endAt` is required when calling `addABTests`.");
94
+ }
95
+ const requestPath = "/2/abtests";
96
+ const headers = {};
97
+ const queryParameters = {};
98
+ const request = {
99
+ method: "POST",
100
+ path: requestPath,
101
+ queryParameters,
102
+ headers,
103
+ data: addABTestsRequest
104
+ };
105
+ return this.transporter.request(request, requestOptions);
106
+ },
107
+ /**
108
+ * This method allow you to send requests to the Algolia REST API.
109
+ *
110
+ * @param customDelete - The customDelete object.
111
+ * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
112
+ * @param customDelete.parameters - Query parameters to apply to the current query.
113
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
114
+ */
115
+ customDelete({ path, parameters }, requestOptions) {
116
+ if (!path) {
117
+ throw new Error("Parameter `path` is required when calling `customDelete`.");
118
+ }
119
+ const requestPath = "/{path}".replace("{path}", path);
120
+ const headers = {};
121
+ const queryParameters = parameters ? parameters : {};
122
+ const request = {
123
+ method: "DELETE",
124
+ path: requestPath,
125
+ queryParameters,
126
+ headers
127
+ };
128
+ return this.transporter.request(request, requestOptions);
129
+ },
130
+ /**
131
+ * This method allow you to send requests to the Algolia REST API.
132
+ *
133
+ * @param customGet - The customGet object.
134
+ * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
135
+ * @param customGet.parameters - Query parameters to apply to the current query.
136
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
137
+ */
138
+ customGet({ path, parameters }, requestOptions) {
139
+ if (!path) {
140
+ throw new Error("Parameter `path` is required when calling `customGet`.");
141
+ }
142
+ const requestPath = "/{path}".replace("{path}", path);
143
+ const headers = {};
144
+ const queryParameters = parameters ? parameters : {};
145
+ const request = {
146
+ method: "GET",
147
+ path: requestPath,
148
+ queryParameters,
149
+ headers
150
+ };
151
+ return this.transporter.request(request, requestOptions);
152
+ },
153
+ /**
154
+ * This method allow you to send requests to the Algolia REST API.
155
+ *
156
+ * @param customPost - The customPost object.
157
+ * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
158
+ * @param customPost.parameters - Query parameters to apply to the current query.
159
+ * @param customPost.body - Parameters to send with the custom request.
160
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
161
+ */
162
+ customPost({ path, parameters, body }, requestOptions) {
163
+ if (!path) {
164
+ throw new Error("Parameter `path` is required when calling `customPost`.");
165
+ }
166
+ const requestPath = "/{path}".replace("{path}", path);
167
+ const headers = {};
168
+ const queryParameters = parameters ? parameters : {};
169
+ const request = {
170
+ method: "POST",
171
+ path: requestPath,
172
+ queryParameters,
173
+ headers,
174
+ data: body ? body : {}
175
+ };
176
+ return this.transporter.request(request, requestOptions);
177
+ },
178
+ /**
179
+ * This method allow you to send requests to the Algolia REST API.
180
+ *
181
+ * @param customPut - The customPut object.
182
+ * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
183
+ * @param customPut.parameters - Query parameters to apply to the current query.
184
+ * @param customPut.body - Parameters to send with the custom request.
185
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
186
+ */
187
+ customPut({ path, parameters, body }, requestOptions) {
188
+ if (!path) {
189
+ throw new Error("Parameter `path` is required when calling `customPut`.");
190
+ }
191
+ const requestPath = "/{path}".replace("{path}", path);
192
+ const headers = {};
193
+ const queryParameters = parameters ? parameters : {};
194
+ const request = {
195
+ method: "PUT",
196
+ path: requestPath,
197
+ queryParameters,
198
+ headers,
199
+ data: body ? body : {}
200
+ };
201
+ return this.transporter.request(request, requestOptions);
202
+ },
203
+ /**
204
+ * Deletes an A/B test by its ID.
205
+ *
206
+ * Required API Key ACLs:
207
+ * - editSettings.
208
+ *
209
+ * @param deleteABTest - The deleteABTest object.
210
+ * @param deleteABTest.id - Unique A/B test identifier.
211
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
212
+ */
213
+ deleteABTest({ id }, requestOptions) {
214
+ if (!id) {
215
+ throw new Error("Parameter `id` is required when calling `deleteABTest`.");
216
+ }
217
+ const requestPath = "/2/abtests/{id}".replace("{id}", encodeURIComponent(id));
218
+ const headers = {};
219
+ const queryParameters = {};
220
+ const request = {
221
+ method: "DELETE",
222
+ path: requestPath,
223
+ queryParameters,
224
+ headers
225
+ };
226
+ return this.transporter.request(request, requestOptions);
227
+ },
228
+ /**
229
+ * Retrieves the details for an A/B test by its ID.
230
+ *
231
+ * Required API Key ACLs:
232
+ * - analytics.
233
+ *
234
+ * @param getABTest - The getABTest object.
235
+ * @param getABTest.id - Unique A/B test identifier.
236
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
237
+ */
238
+ getABTest({ id }, requestOptions) {
239
+ if (!id) {
240
+ throw new Error("Parameter `id` is required when calling `getABTest`.");
241
+ }
242
+ const requestPath = "/2/abtests/{id}".replace("{id}", encodeURIComponent(id));
243
+ const headers = {};
244
+ const queryParameters = {};
245
+ const request = {
246
+ method: "GET",
247
+ path: requestPath,
248
+ queryParameters,
249
+ headers
250
+ };
251
+ return this.transporter.request(request, requestOptions);
252
+ },
253
+ /**
254
+ * Lists all A/B tests you configured for this application.
255
+ *
256
+ * Required API Key ACLs:
257
+ * - analytics.
258
+ *
259
+ * @param listABTests - The listABTests object.
260
+ * @param listABTests.offset - Position of the first item to return.
261
+ * @param listABTests.limit - Number of items to return.
262
+ * @param listABTests.indexPrefix - Index name prefix. Only A/B tests for indices starting with this string are included in the response.
263
+ * @param listABTests.indexSuffix - Index name suffix. Only A/B tests for indices ending with this string are included in the response.
264
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
265
+ */
266
+ listABTests({ offset, limit, indexPrefix, indexSuffix } = {}, requestOptions = void 0) {
267
+ const requestPath = "/2/abtests";
268
+ const headers = {};
269
+ const queryParameters = {};
270
+ if (offset !== void 0) {
271
+ queryParameters.offset = offset.toString();
272
+ }
273
+ if (limit !== void 0) {
274
+ queryParameters.limit = limit.toString();
275
+ }
276
+ if (indexPrefix !== void 0) {
277
+ queryParameters.indexPrefix = indexPrefix.toString();
278
+ }
279
+ if (indexSuffix !== void 0) {
280
+ queryParameters.indexSuffix = indexSuffix.toString();
281
+ }
282
+ const request = {
283
+ method: "GET",
284
+ path: requestPath,
285
+ queryParameters,
286
+ headers
287
+ };
288
+ return this.transporter.request(request, requestOptions);
289
+ },
290
+ /**
291
+ * Schedule an A/B test to be started at a later time.
292
+ *
293
+ * Required API Key ACLs:
294
+ * - editSettings.
295
+ *
296
+ * @param scheduleABTestsRequest - The scheduleABTestsRequest object.
297
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
298
+ */
299
+ scheduleABTest(scheduleABTestsRequest, requestOptions) {
300
+ if (!scheduleABTestsRequest) {
301
+ throw new Error("Parameter `scheduleABTestsRequest` is required when calling `scheduleABTest`.");
302
+ }
303
+ if (!scheduleABTestsRequest.name) {
304
+ throw new Error("Parameter `scheduleABTestsRequest.name` is required when calling `scheduleABTest`.");
305
+ }
306
+ if (!scheduleABTestsRequest.variants) {
307
+ throw new Error("Parameter `scheduleABTestsRequest.variants` is required when calling `scheduleABTest`.");
308
+ }
309
+ if (!scheduleABTestsRequest.scheduledAt) {
310
+ throw new Error("Parameter `scheduleABTestsRequest.scheduledAt` is required when calling `scheduleABTest`.");
311
+ }
312
+ if (!scheduleABTestsRequest.endAt) {
313
+ throw new Error("Parameter `scheduleABTestsRequest.endAt` is required when calling `scheduleABTest`.");
314
+ }
315
+ const requestPath = "/2/abtests/schedule";
316
+ const headers = {};
317
+ const queryParameters = {};
318
+ const request = {
319
+ method: "POST",
320
+ path: requestPath,
321
+ queryParameters,
322
+ headers,
323
+ data: scheduleABTestsRequest
324
+ };
325
+ return this.transporter.request(request, requestOptions);
326
+ },
327
+ /**
328
+ * Stops an A/B test by its ID. You can\'t restart stopped A/B tests.
329
+ *
330
+ * Required API Key ACLs:
331
+ * - editSettings.
332
+ *
333
+ * @param stopABTest - The stopABTest object.
334
+ * @param stopABTest.id - Unique A/B test identifier.
335
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
336
+ */
337
+ stopABTest({ id }, requestOptions) {
338
+ if (!id) {
339
+ throw new Error("Parameter `id` is required when calling `stopABTest`.");
340
+ }
341
+ const requestPath = "/2/abtests/{id}/stop".replace("{id}", encodeURIComponent(id));
342
+ const headers = {};
343
+ const queryParameters = {};
344
+ const request = {
345
+ method: "POST",
346
+ path: requestPath,
347
+ queryParameters,
348
+ headers
349
+ };
350
+ return this.transporter.request(request, requestOptions);
351
+ }
352
+ };
353
+ }
354
+ export {
355
+ REGIONS,
356
+ apiClientVersion,
357
+ createAbtestingClient
358
+ };
359
+ //# sourceMappingURL=abtestingClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/abtestingClient.ts"],"sourcesContent":["// 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.\n\nimport { createAuth, createTransporter, getAlgoliaAgent } from '@algolia/client-common';\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\n\nimport type { ABTest } from '../model/aBTest';\nimport type { ABTestResponse } from '../model/aBTestResponse';\nimport type { AddABTestsRequest } from '../model/addABTestsRequest';\nimport type {\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteABTestProps,\n GetABTestProps,\n ListABTestsProps,\n StopABTestProps,\n} from '../model/clientMethodProps';\nimport type { ListABTestsResponse } from '../model/listABTestsResponse';\nimport type { ScheduleABTestResponse } from '../model/scheduleABTestResponse';\nimport type { ScheduleABTestsRequest } from '../model/scheduleABTestsRequest';\n\nexport const apiClientVersion = '5.3.0';\n\nexport const REGIONS = ['de', 'us'] as const;\nexport type Region = (typeof REGIONS)[number];\n\nfunction getDefaultHosts(region?: Region): Host[] {\n const url = !region ? 'analytics.algolia.com' : 'analytics.{region}.algolia.com'.replace('{region}', region);\n\n return [{ url, accept: 'readWrite', protocol: 'https' }];\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function createAbtestingClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n region: regionOption,\n ...options\n}: CreateClientOptions & { region?: Region }) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n\n return {\n transporter: createTransporter({\n hosts: getDefaultHosts(regionOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Abtesting',\n version: apiClientVersion,\n }),\n baseHeaders: {\n 'content-type': 'text/plain',\n ...auth.headers(),\n ...options.baseHeaders,\n },\n baseQueryParameters: {\n ...auth.queryParameters(),\n ...options.baseQueryParameters,\n },\n }),\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([this.transporter.requestsCache.clear(), this.transporter.responsesCache.clear()]).then(\n () => undefined,\n );\n },\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return this.transporter.algoliaAgent.value;\n },\n\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment: string, version?: string): void {\n this.transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * Helper method to switch the API key used to authenticate the requests.\n *\n * @param params - Method params.\n * @param params.apiKey - The new API Key to use.\n */\n setClientApiKey({ apiKey }: { apiKey: string }): void {\n this.transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n },\n\n /**\n * Creates a new A/B test.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param addABTestsRequest - The addABTestsRequest object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n addABTests(addABTestsRequest: AddABTestsRequest, requestOptions?: RequestOptions): Promise<ABTestResponse> {\n if (!addABTestsRequest) {\n throw new Error('Parameter `addABTestsRequest` is required when calling `addABTests`.');\n }\n\n if (!addABTestsRequest.name) {\n throw new Error('Parameter `addABTestsRequest.name` is required when calling `addABTests`.');\n }\n if (!addABTestsRequest.variants) {\n throw new Error('Parameter `addABTestsRequest.variants` is required when calling `addABTests`.');\n }\n if (!addABTestsRequest.endAt) {\n throw new Error('Parameter `addABTestsRequest.endAt` is required when calling `addABTests`.');\n }\n\n const requestPath = '/2/abtests';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: addABTestsRequest,\n };\n\n return this.transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customDelete.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customDelete(\n { path, parameters }: CustomDeleteProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customDelete`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return this.transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customGet.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customGet`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return this.transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return this.transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPut.parameters - Query parameters to apply to the current query.\n * @param customPut.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPut(\n { path, parameters, body }: CustomPutProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPut`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return this.transporter.request(request, requestOptions);\n },\n\n /**\n * Deletes an A/B test by its ID.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param deleteABTest - The deleteABTest object.\n * @param deleteABTest.id - Unique A/B test identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteABTest({ id }: DeleteABTestProps, requestOptions?: RequestOptions): Promise<ABTestResponse> {\n if (!id) {\n throw new Error('Parameter `id` is required when calling `deleteABTest`.');\n }\n\n const requestPath = '/2/abtests/{id}'.replace('{id}', encodeURIComponent(id));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return this.transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves the details for an A/B test by its ID.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param getABTest - The getABTest object.\n * @param getABTest.id - Unique A/B test identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getABTest({ id }: GetABTestProps, requestOptions?: RequestOptions): Promise<ABTest> {\n if (!id) {\n throw new Error('Parameter `id` is required when calling `getABTest`.');\n }\n\n const requestPath = '/2/abtests/{id}'.replace('{id}', encodeURIComponent(id));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return this.transporter.request(request, requestOptions);\n },\n\n /**\n * Lists all A/B tests you configured for this application.\n *\n * Required API Key ACLs:\n * - analytics.\n *\n * @param listABTests - The listABTests object.\n * @param listABTests.offset - Position of the first item to return.\n * @param listABTests.limit - Number of items to return.\n * @param listABTests.indexPrefix - Index name prefix. Only A/B tests for indices starting with this string are included in the response.\n * @param listABTests.indexSuffix - Index name suffix. Only A/B tests for indices ending with this string are included in the response.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n listABTests(\n { offset, limit, indexPrefix, indexSuffix }: ListABTestsProps = {},\n requestOptions: RequestOptions | undefined = undefined,\n ): Promise<ListABTestsResponse> {\n const requestPath = '/2/abtests';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n if (offset !== undefined) {\n queryParameters.offset = offset.toString();\n }\n if (limit !== undefined) {\n queryParameters.limit = limit.toString();\n }\n\n if (indexPrefix !== undefined) {\n queryParameters.indexPrefix = indexPrefix.toString();\n }\n if (indexSuffix !== undefined) {\n queryParameters.indexSuffix = indexSuffix.toString();\n }\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return this.transporter.request(request, requestOptions);\n },\n\n /**\n * Schedule an A/B test to be started at a later time.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param scheduleABTestsRequest - The scheduleABTestsRequest object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n scheduleABTest(\n scheduleABTestsRequest: ScheduleABTestsRequest,\n requestOptions?: RequestOptions,\n ): Promise<ScheduleABTestResponse> {\n if (!scheduleABTestsRequest) {\n throw new Error('Parameter `scheduleABTestsRequest` is required when calling `scheduleABTest`.');\n }\n\n if (!scheduleABTestsRequest.name) {\n throw new Error('Parameter `scheduleABTestsRequest.name` is required when calling `scheduleABTest`.');\n }\n if (!scheduleABTestsRequest.variants) {\n throw new Error('Parameter `scheduleABTestsRequest.variants` is required when calling `scheduleABTest`.');\n }\n if (!scheduleABTestsRequest.scheduledAt) {\n throw new Error('Parameter `scheduleABTestsRequest.scheduledAt` is required when calling `scheduleABTest`.');\n }\n if (!scheduleABTestsRequest.endAt) {\n throw new Error('Parameter `scheduleABTestsRequest.endAt` is required when calling `scheduleABTest`.');\n }\n\n const requestPath = '/2/abtests/schedule';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: scheduleABTestsRequest,\n };\n\n return this.transporter.request(request, requestOptions);\n },\n\n /**\n * Stops an A/B test by its ID. You can\\'t restart stopped A/B tests.\n *\n * Required API Key ACLs:\n * - editSettings.\n *\n * @param stopABTest - The stopABTest object.\n * @param stopABTest.id - Unique A/B test identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n stopABTest({ id }: StopABTestProps, requestOptions?: RequestOptions): Promise<ABTestResponse> {\n if (!id) {\n throw new Error('Parameter `id` is required when calling `stopABTest`.');\n }\n\n const requestPath = '/2/abtests/{id}/stop'.replace('{id}', encodeURIComponent(id));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return this.transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";AAEA,SAAS,YAAY,mBAAmB,uBAAuB;AA2BxD,IAAM,mBAAmB;AAEzB,IAAM,UAAU,CAAC,MAAM,IAAI;AAGlC,SAAS,gBAAgB,QAAyB;AAChD,QAAM,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,YAAM,UAAmB;AAAA,QACvB,QAAQ;AAAA,QACR,MAAM;AAAA,QACN;AAAA,QACA;AAAA,MACF;AAEA,aAAO,KAAK,YAAY,QAAQ,SAAS,cAAc;AAAA,IACzD;AAAA,EACF;AACF;","names":[]}
package/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // eslint-disable-next-line import/no-unresolved
2
- export * from './dist/builds/node';
2
+ export * from './dist/node';
package/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // eslint-disable-next-line import/no-commonjs,import/extensions
2
- module.exports = require('./dist/client-abtesting.cjs');
2
+ module.exports = require('./dist/builds/node.cjs');
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.2.4",
2
+ "version": "5.3.0",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/algolia/algoliasearch-client-javascript.git"
@@ -7,50 +7,53 @@
7
7
  "type": "module",
8
8
  "license": "MIT",
9
9
  "author": "Algolia",
10
- "types": "./index.d.ts",
10
+ "scripts": {
11
+ "build": "yarn clean && yarn tsup && yarn rollup -c rollup.config.js",
12
+ "clean": "rm -rf ./dist || true",
13
+ "test:bundle": "publint . && attw --pack ."
14
+ },
11
15
  "name": "@algolia/client-abtesting",
12
16
  "description": "JavaScript client for client-abtesting",
13
- "jsdelivr": "./dist/client-abtesting.umd.js",
14
- "unpkg": "./dist/client-abtesting.umd.js",
15
- "browser": "./dist/client-abtesting.umd.js",
16
17
  "exports": {
17
18
  ".": {
18
19
  "node": {
19
- "import": "./dist/client-abtesting.esm.node.js",
20
- "module": "./dist/client-abtesting.esm.node.js",
21
- "require": "./dist/client-abtesting.cjs",
22
- "default": "./dist/client-abtesting.cjs",
23
- "types": "./dist/builds/node.d.ts"
20
+ "types": {
21
+ "import": "./dist/node.d.ts",
22
+ "module": "./dist/node.d.ts",
23
+ "require": "./dist/node.d.cts"
24
+ },
25
+ "import": "./dist/builds/node.js",
26
+ "module": "./dist/builds/node.js",
27
+ "require": "./dist/builds/node.cjs"
24
28
  },
25
- "browser": {
26
- "umd": "./dist/client-abtesting.umd.js",
27
- "module": "./dist/client-abtesting.esm.browser.js",
28
- "import": "./dist/client-abtesting.esm.browser.js",
29
- "default": "./dist/client-abtesting.umd.js",
30
- "types": "./dist/builds/browser.d.ts"
29
+ "default": {
30
+ "types": "./dist/browser.d.ts",
31
+ "module": "./dist/builds/browser.js",
32
+ "import": "./dist/builds/browser.js",
33
+ "default": "./dist/builds/browser.umd.js"
31
34
  }
32
35
  },
33
- "./src/*": "./src/*.ts",
34
- "./model": "./model/index.ts"
36
+ "./src/*": "./src/*.ts"
35
37
  },
38
+ "jsdelivr": "./dist/builds/browser.umd.js",
39
+ "unpkg": "./dist/builds/browser.umd.js",
36
40
  "files": [
37
41
  "dist",
38
42
  "model",
39
43
  "index.js",
40
44
  "index.d.ts"
41
45
  ],
42
- "scripts": {
43
- "build": "yarn clean && rollup --config",
44
- "clean": "rm -rf ./dist || true"
45
- },
46
46
  "dependencies": {
47
- "@algolia/client-common": "5.2.4",
48
- "@algolia/requester-browser-xhr": "5.2.4",
49
- "@algolia/requester-node-http": "5.2.4"
47
+ "@algolia/client-common": "5.3.0",
48
+ "@algolia/requester-browser-xhr": "5.3.0",
49
+ "@algolia/requester-node-http": "5.3.0"
50
50
  },
51
51
  "devDependencies": {
52
+ "@arethetypeswrong/cli": "0.15.4",
52
53
  "@types/node": "22.5.1",
54
+ "publint": "0.2.10",
53
55
  "rollup": "4.21.2",
56
+ "tsup": "8.2.4",
54
57
  "typescript": "5.5.4"
55
58
  },
56
59
  "engines": {
@@ -1,26 +0,0 @@
1
- import type { ClientOptions } from '@algolia/client-common';
2
- import type { Region } from '../src/abtestingClient';
3
- export { apiClientVersion, Region } from '../src/abtestingClient';
4
- export * from '../model';
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, unknown>>;
17
- customGet({ path, parameters }: import("../model").CustomGetProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, unknown>>;
18
- customPost({ path, parameters, body }: import("../model").CustomPostProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, unknown>>;
19
- customPut({ path, parameters, body }: import("../model").CustomPutProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, unknown>>;
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
- scheduleABTest(scheduleABTestsRequest: import("../model").ScheduleABTestsRequest, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").ScheduleABTestResponse>;
24
- stopABTest({ id }: import("../model").StopABTestProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").ABTestResponse>;
25
- };
26
- //# sourceMappingURL=browser.d.ts.map
@@ -1 +0,0 @@
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;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,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa;;;;;;;;;;;;;;;;EAgCtG"}
@@ -1,26 +0,0 @@
1
- import type { ClientOptions } from '@algolia/client-common';
2
- import type { Region } from '../src/abtestingClient';
3
- export { apiClientVersion, Region } from '../src/abtestingClient';
4
- export * from '../model';
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, unknown>>;
17
- customGet({ path, parameters }: import("../model").CustomGetProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, unknown>>;
18
- customPost({ path, parameters, body }: import("../model").CustomPostProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, unknown>>;
19
- customPut({ path, parameters, body }: import("../model").CustomPutProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, unknown>>;
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
- scheduleABTest(scheduleABTestsRequest: import("../model").ScheduleABTestsRequest, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").ScheduleABTestResponse>;
24
- stopABTest({ id }: import("../model").StopABTestProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").ABTestResponse>;
25
- };
26
- //# sourceMappingURL=node.d.ts.map
@@ -1 +0,0 @@
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,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa;;;;;;;;;;;;;;;;EA+BtG"}