@algolia/client-abtesting 5.6.1 → 5.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/fetch.d.ts CHANGED
@@ -49,7 +49,7 @@ type ABTestConfiguration = {
49
49
  /**
50
50
  * A/B test status. - `active`. The A/B test is live and search traffic is split between the two variants. - `stopped`. You stopped the A/B test. The A/B test data is still available for analysis. - `expired`. The A/B test was automatically stopped after reaching its end date. - `failed`. Creating the A/B test failed.
51
51
  */
52
- type Status = 'active' | 'expired' | 'failed' | 'stopped';
52
+ type Status = 'active' | 'stopped' | 'expired' | 'failed';
53
53
 
54
54
  type Currency = {
55
55
  /**
@@ -138,7 +138,9 @@ type Variant = {
138
138
  /**
139
139
  * A/B test currencies.
140
140
  */
141
- currencies?: Record<string, Currency>;
141
+ currencies?: {
142
+ [key: string]: Currency;
143
+ };
142
144
  /**
143
145
  * Description for this variant.
144
146
  */
@@ -195,7 +197,9 @@ type ABTest = {
195
197
  conversionSignificance?: number | null;
196
198
  addToCartSignificance?: number | null;
197
199
  purchaseSignificance?: number | null;
198
- revenueSignificance?: Record<string, number> | null;
200
+ revenueSignificance?: {
201
+ [key: string]: number;
202
+ } | null;
199
203
  /**
200
204
  * Date and time when the A/B test was last updated, in RFC 3339 format.
201
205
  */
@@ -216,7 +220,7 @@ type ABTest = {
216
220
  /**
217
221
  * A/B test variants. The first variant is your _control_ index, typically your production index. The second variant is an index with changed settings that you want to test against the control.
218
222
  */
219
- variants: Variant[];
223
+ variants: Array<Variant>;
220
224
  configuration?: ABTestConfiguration;
221
225
  };
222
226
 
@@ -269,7 +273,48 @@ type AddABTestsRequest = {
269
273
  /**
270
274
  * A/B test variants.
271
275
  */
272
- variants: AddABTestsVariant[];
276
+ variants: Array<AddABTestsVariant>;
277
+ /**
278
+ * End date and time of the A/B test, in RFC 3339 format.
279
+ */
280
+ endAt: string;
281
+ };
282
+
283
+ type ListABTestsResponse = {
284
+ /**
285
+ * A/B tests.
286
+ */
287
+ abtests: Array<ABTest> | null;
288
+ /**
289
+ * Number of A/B tests.
290
+ */
291
+ count: number;
292
+ /**
293
+ * Number of retrievable A/B tests.
294
+ */
295
+ total: number;
296
+ };
297
+
298
+ type ScheduleABTestResponse = {
299
+ /**
300
+ * Unique scheduled A/B test identifier.
301
+ */
302
+ abTestScheduleID: number;
303
+ };
304
+
305
+ type ScheduleABTestsRequest = {
306
+ /**
307
+ * A/B test name.
308
+ */
309
+ name: string;
310
+ /**
311
+ * A/B test variants.
312
+ */
313
+ variants: Array<AddABTestsVariant>;
314
+ /**
315
+ * Date and time when the A/B test is scheduled to start, in RFC 3339 format.
316
+ */
317
+ scheduledAt: string;
273
318
  /**
274
319
  * End date and time of the A/B test, in RFC 3339 format.
275
320
  */
@@ -287,7 +332,9 @@ type CustomDeleteProps = {
287
332
  /**
288
333
  * Query parameters to apply to the current query.
289
334
  */
290
- parameters?: Record<string, any>;
335
+ parameters?: {
336
+ [key: string]: any;
337
+ };
291
338
  };
292
339
  /**
293
340
  * Properties for the `customGet` method.
@@ -300,7 +347,9 @@ type CustomGetProps = {
300
347
  /**
301
348
  * Query parameters to apply to the current query.
302
349
  */
303
- parameters?: Record<string, any>;
350
+ parameters?: {
351
+ [key: string]: any;
352
+ };
304
353
  };
305
354
  /**
306
355
  * Properties for the `customPost` method.
@@ -313,7 +362,9 @@ type CustomPostProps = {
313
362
  /**
314
363
  * Query parameters to apply to the current query.
315
364
  */
316
- parameters?: Record<string, any>;
365
+ parameters?: {
366
+ [key: string]: any;
367
+ };
317
368
  /**
318
369
  * Parameters to send with the custom request.
319
370
  */
@@ -330,7 +381,9 @@ type CustomPutProps = {
330
381
  /**
331
382
  * Query parameters to apply to the current query.
332
383
  */
333
- parameters?: Record<string, any>;
384
+ parameters?: {
385
+ [key: string]: any;
386
+ };
334
387
  /**
335
388
  * Parameters to send with the custom request.
336
389
  */
@@ -385,48 +438,7 @@ type StopABTestProps = {
385
438
  id: number;
386
439
  };
387
440
 
388
- type ListABTestsResponse = {
389
- /**
390
- * A/B tests.
391
- */
392
- abtests: ABTest[] | null;
393
- /**
394
- * Number of A/B tests.
395
- */
396
- count: number;
397
- /**
398
- * Number of retrievable A/B tests.
399
- */
400
- total: number;
401
- };
402
-
403
- type ScheduleABTestResponse = {
404
- /**
405
- * Unique scheduled A/B test identifier.
406
- */
407
- abTestScheduleID: number;
408
- };
409
-
410
- type ScheduleABTestsRequest = {
411
- /**
412
- * A/B test name.
413
- */
414
- name: string;
415
- /**
416
- * A/B test variants.
417
- */
418
- variants: AddABTestsVariant[];
419
- /**
420
- * Date and time when the A/B test is scheduled to start, in RFC 3339 format.
421
- */
422
- scheduledAt: string;
423
- /**
424
- * End date and time of the A/B test, in RFC 3339 format.
425
- */
426
- endAt: string;
427
- };
428
-
429
- declare const apiClientVersion = "5.6.1";
441
+ declare const apiClientVersion = "5.8.0";
430
442
  declare const REGIONS: readonly ["de", "us"];
431
443
  type Region = (typeof REGIONS)[number];
432
444
  declare function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }: CreateClientOptions & {
@@ -465,15 +477,13 @@ declare function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOptio
465
477
  * Creates a new A/B test.
466
478
  *
467
479
  * Required API Key ACLs:
468
- * - editSettings.
469
- *
480
+ * - editSettings
470
481
  * @param addABTestsRequest - The addABTestsRequest object.
471
482
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
472
483
  */
473
484
  addABTests(addABTestsRequest: AddABTestsRequest, requestOptions?: RequestOptions): Promise<ABTestResponse>;
474
485
  /**
475
486
  * This method allow you to send requests to the Algolia REST API.
476
- *
477
487
  * @param customDelete - The customDelete object.
478
488
  * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
479
489
  * @param customDelete.parameters - Query parameters to apply to the current query.
@@ -482,7 +492,6 @@ declare function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOptio
482
492
  customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
483
493
  /**
484
494
  * This method allow you to send requests to the Algolia REST API.
485
- *
486
495
  * @param customGet - The customGet object.
487
496
  * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
488
497
  * @param customGet.parameters - Query parameters to apply to the current query.
@@ -491,7 +500,6 @@ declare function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOptio
491
500
  customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
492
501
  /**
493
502
  * This method allow you to send requests to the Algolia REST API.
494
- *
495
503
  * @param customPost - The customPost object.
496
504
  * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
497
505
  * @param customPost.parameters - Query parameters to apply to the current query.
@@ -501,7 +509,6 @@ declare function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOptio
501
509
  customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
502
510
  /**
503
511
  * This method allow you to send requests to the Algolia REST API.
504
- *
505
512
  * @param customPut - The customPut object.
506
513
  * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
507
514
  * @param customPut.parameters - Query parameters to apply to the current query.
@@ -513,8 +520,7 @@ declare function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOptio
513
520
  * Deletes an A/B test by its ID.
514
521
  *
515
522
  * Required API Key ACLs:
516
- * - editSettings.
517
- *
523
+ * - editSettings
518
524
  * @param deleteABTest - The deleteABTest object.
519
525
  * @param deleteABTest.id - Unique A/B test identifier.
520
526
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -524,8 +530,7 @@ declare function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOptio
524
530
  * Retrieves the details for an A/B test by its ID.
525
531
  *
526
532
  * Required API Key ACLs:
527
- * - analytics.
528
- *
533
+ * - analytics
529
534
  * @param getABTest - The getABTest object.
530
535
  * @param getABTest.id - Unique A/B test identifier.
531
536
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -535,8 +540,7 @@ declare function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOptio
535
540
  * Lists all A/B tests you configured for this application.
536
541
  *
537
542
  * Required API Key ACLs:
538
- * - analytics.
539
- *
543
+ * - analytics
540
544
  * @param listABTests - The listABTests object.
541
545
  * @param listABTests.offset - Position of the first item to return.
542
546
  * @param listABTests.limit - Number of items to return.
@@ -549,8 +553,7 @@ declare function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOptio
549
553
  * Schedule an A/B test to be started at a later time.
550
554
  *
551
555
  * Required API Key ACLs:
552
- * - editSettings.
553
- *
556
+ * - editSettings
554
557
  * @param scheduleABTestsRequest - The scheduleABTestsRequest object.
555
558
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
556
559
  */
@@ -559,8 +562,7 @@ declare function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOptio
559
562
  * Stops an A/B test by its ID. You can\'t restart stopped A/B tests.
560
563
  *
561
564
  * Required API Key ACLs:
562
- * - editSettings.
563
- *
565
+ * - editSettings
564
566
  * @param stopABTest - The stopABTest object.
565
567
  * @param stopABTest.id - Unique A/B test identifier.
566
568
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
package/dist/node.d.cts CHANGED
@@ -49,7 +49,7 @@ type ABTestConfiguration = {
49
49
  /**
50
50
  * A/B test status. - `active`. The A/B test is live and search traffic is split between the two variants. - `stopped`. You stopped the A/B test. The A/B test data is still available for analysis. - `expired`. The A/B test was automatically stopped after reaching its end date. - `failed`. Creating the A/B test failed.
51
51
  */
52
- type Status = 'active' | 'expired' | 'failed' | 'stopped';
52
+ type Status = 'active' | 'stopped' | 'expired' | 'failed';
53
53
 
54
54
  type Currency = {
55
55
  /**
@@ -138,7 +138,9 @@ type Variant = {
138
138
  /**
139
139
  * A/B test currencies.
140
140
  */
141
- currencies?: Record<string, Currency>;
141
+ currencies?: {
142
+ [key: string]: Currency;
143
+ };
142
144
  /**
143
145
  * Description for this variant.
144
146
  */
@@ -195,7 +197,9 @@ type ABTest = {
195
197
  conversionSignificance?: number | null;
196
198
  addToCartSignificance?: number | null;
197
199
  purchaseSignificance?: number | null;
198
- revenueSignificance?: Record<string, number> | null;
200
+ revenueSignificance?: {
201
+ [key: string]: number;
202
+ } | null;
199
203
  /**
200
204
  * Date and time when the A/B test was last updated, in RFC 3339 format.
201
205
  */
@@ -216,7 +220,7 @@ type ABTest = {
216
220
  /**
217
221
  * A/B test variants. The first variant is your _control_ index, typically your production index. The second variant is an index with changed settings that you want to test against the control.
218
222
  */
219
- variants: Variant[];
223
+ variants: Array<Variant>;
220
224
  configuration?: ABTestConfiguration;
221
225
  };
222
226
 
@@ -269,7 +273,48 @@ type AddABTestsRequest = {
269
273
  /**
270
274
  * A/B test variants.
271
275
  */
272
- variants: AddABTestsVariant[];
276
+ variants: Array<AddABTestsVariant>;
277
+ /**
278
+ * End date and time of the A/B test, in RFC 3339 format.
279
+ */
280
+ endAt: string;
281
+ };
282
+
283
+ type ListABTestsResponse = {
284
+ /**
285
+ * A/B tests.
286
+ */
287
+ abtests: Array<ABTest> | null;
288
+ /**
289
+ * Number of A/B tests.
290
+ */
291
+ count: number;
292
+ /**
293
+ * Number of retrievable A/B tests.
294
+ */
295
+ total: number;
296
+ };
297
+
298
+ type ScheduleABTestResponse = {
299
+ /**
300
+ * Unique scheduled A/B test identifier.
301
+ */
302
+ abTestScheduleID: number;
303
+ };
304
+
305
+ type ScheduleABTestsRequest = {
306
+ /**
307
+ * A/B test name.
308
+ */
309
+ name: string;
310
+ /**
311
+ * A/B test variants.
312
+ */
313
+ variants: Array<AddABTestsVariant>;
314
+ /**
315
+ * Date and time when the A/B test is scheduled to start, in RFC 3339 format.
316
+ */
317
+ scheduledAt: string;
273
318
  /**
274
319
  * End date and time of the A/B test, in RFC 3339 format.
275
320
  */
@@ -287,7 +332,9 @@ type CustomDeleteProps = {
287
332
  /**
288
333
  * Query parameters to apply to the current query.
289
334
  */
290
- parameters?: Record<string, any>;
335
+ parameters?: {
336
+ [key: string]: any;
337
+ };
291
338
  };
292
339
  /**
293
340
  * Properties for the `customGet` method.
@@ -300,7 +347,9 @@ type CustomGetProps = {
300
347
  /**
301
348
  * Query parameters to apply to the current query.
302
349
  */
303
- parameters?: Record<string, any>;
350
+ parameters?: {
351
+ [key: string]: any;
352
+ };
304
353
  };
305
354
  /**
306
355
  * Properties for the `customPost` method.
@@ -313,7 +362,9 @@ type CustomPostProps = {
313
362
  /**
314
363
  * Query parameters to apply to the current query.
315
364
  */
316
- parameters?: Record<string, any>;
365
+ parameters?: {
366
+ [key: string]: any;
367
+ };
317
368
  /**
318
369
  * Parameters to send with the custom request.
319
370
  */
@@ -330,7 +381,9 @@ type CustomPutProps = {
330
381
  /**
331
382
  * Query parameters to apply to the current query.
332
383
  */
333
- parameters?: Record<string, any>;
384
+ parameters?: {
385
+ [key: string]: any;
386
+ };
334
387
  /**
335
388
  * Parameters to send with the custom request.
336
389
  */
@@ -385,48 +438,7 @@ type StopABTestProps = {
385
438
  id: number;
386
439
  };
387
440
 
388
- type ListABTestsResponse = {
389
- /**
390
- * A/B tests.
391
- */
392
- abtests: ABTest[] | null;
393
- /**
394
- * Number of A/B tests.
395
- */
396
- count: number;
397
- /**
398
- * Number of retrievable A/B tests.
399
- */
400
- total: number;
401
- };
402
-
403
- type ScheduleABTestResponse = {
404
- /**
405
- * Unique scheduled A/B test identifier.
406
- */
407
- abTestScheduleID: number;
408
- };
409
-
410
- type ScheduleABTestsRequest = {
411
- /**
412
- * A/B test name.
413
- */
414
- name: string;
415
- /**
416
- * A/B test variants.
417
- */
418
- variants: AddABTestsVariant[];
419
- /**
420
- * Date and time when the A/B test is scheduled to start, in RFC 3339 format.
421
- */
422
- scheduledAt: string;
423
- /**
424
- * End date and time of the A/B test, in RFC 3339 format.
425
- */
426
- endAt: string;
427
- };
428
-
429
- declare const apiClientVersion = "5.6.1";
441
+ declare const apiClientVersion = "5.8.0";
430
442
  declare const REGIONS: readonly ["de", "us"];
431
443
  type Region = (typeof REGIONS)[number];
432
444
  declare function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }: CreateClientOptions & {
@@ -465,15 +477,13 @@ declare function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOptio
465
477
  * Creates a new A/B test.
466
478
  *
467
479
  * Required API Key ACLs:
468
- * - editSettings.
469
- *
480
+ * - editSettings
470
481
  * @param addABTestsRequest - The addABTestsRequest object.
471
482
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
472
483
  */
473
484
  addABTests(addABTestsRequest: AddABTestsRequest, requestOptions?: RequestOptions): Promise<ABTestResponse>;
474
485
  /**
475
486
  * This method allow you to send requests to the Algolia REST API.
476
- *
477
487
  * @param customDelete - The customDelete object.
478
488
  * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
479
489
  * @param customDelete.parameters - Query parameters to apply to the current query.
@@ -482,7 +492,6 @@ declare function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOptio
482
492
  customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
483
493
  /**
484
494
  * This method allow you to send requests to the Algolia REST API.
485
- *
486
495
  * @param customGet - The customGet object.
487
496
  * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
488
497
  * @param customGet.parameters - Query parameters to apply to the current query.
@@ -491,7 +500,6 @@ declare function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOptio
491
500
  customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
492
501
  /**
493
502
  * This method allow you to send requests to the Algolia REST API.
494
- *
495
503
  * @param customPost - The customPost object.
496
504
  * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
497
505
  * @param customPost.parameters - Query parameters to apply to the current query.
@@ -501,7 +509,6 @@ declare function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOptio
501
509
  customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
502
510
  /**
503
511
  * This method allow you to send requests to the Algolia REST API.
504
- *
505
512
  * @param customPut - The customPut object.
506
513
  * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
507
514
  * @param customPut.parameters - Query parameters to apply to the current query.
@@ -513,8 +520,7 @@ declare function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOptio
513
520
  * Deletes an A/B test by its ID.
514
521
  *
515
522
  * Required API Key ACLs:
516
- * - editSettings.
517
- *
523
+ * - editSettings
518
524
  * @param deleteABTest - The deleteABTest object.
519
525
  * @param deleteABTest.id - Unique A/B test identifier.
520
526
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -524,8 +530,7 @@ declare function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOptio
524
530
  * Retrieves the details for an A/B test by its ID.
525
531
  *
526
532
  * Required API Key ACLs:
527
- * - analytics.
528
- *
533
+ * - analytics
529
534
  * @param getABTest - The getABTest object.
530
535
  * @param getABTest.id - Unique A/B test identifier.
531
536
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -535,8 +540,7 @@ declare function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOptio
535
540
  * Lists all A/B tests you configured for this application.
536
541
  *
537
542
  * Required API Key ACLs:
538
- * - analytics.
539
- *
543
+ * - analytics
540
544
  * @param listABTests - The listABTests object.
541
545
  * @param listABTests.offset - Position of the first item to return.
542
546
  * @param listABTests.limit - Number of items to return.
@@ -549,8 +553,7 @@ declare function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOptio
549
553
  * Schedule an A/B test to be started at a later time.
550
554
  *
551
555
  * Required API Key ACLs:
552
- * - editSettings.
553
- *
556
+ * - editSettings
554
557
  * @param scheduleABTestsRequest - The scheduleABTestsRequest object.
555
558
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
556
559
  */
@@ -559,8 +562,7 @@ declare function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOptio
559
562
  * Stops an A/B test by its ID. You can\'t restart stopped A/B tests.
560
563
  *
561
564
  * Required API Key ACLs:
562
- * - editSettings.
563
- *
565
+ * - editSettings
564
566
  * @param stopABTest - The stopABTest object.
565
567
  * @param stopABTest.id - Unique A/B test identifier.
566
568
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.