Skip to content

Commit 494c9a3

Browse files
algolia-botleonardogavaudanshortcuts
committed
feat(clients): add new abtesting-v3 package to clients + stabilize alpha js package (generated)
algolia/api-clients-automation#5157 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Leonardo Gavaudan <[email protected]> Co-authored-by: shortcuts <[email protected]>
1 parent 64b6d58 commit 494c9a3

File tree

17 files changed

+165
-52
lines changed

17 files changed

+165
-52
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"packages/*"
88
],
99
"scripts": {
10-
"build": "lerna run build --skip-nx-cache --scope '@algolia/requester-testing' --scope '@algolia/logger-console' --scope 'algoliasearch' --scope '@algolia/client-composition' --scope '@algolia/composition' --scope '@algolia/advanced-personalization' --scope '@algolia/abtesting' --include-dependencies ",
10+
"build": "lerna run build --skip-nx-cache --scope '@algolia/requester-testing' --scope '@algolia/logger-console' --scope 'algoliasearch' --scope '@algolia/client-composition' --scope '@algolia/composition' --scope '@algolia/advanced-personalization' --include-dependencies ",
1111
"clean": "lerna run clean",
1212
"release:publish": "tsc --project scripts/tsconfig.json && node scripts/dist/publish.js",
1313
"test": "lerna run test $*",

packages/abtesting/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,32 +41,32 @@ All of our clients comes with type definition, and are available for both browse
4141
### With a package manager
4242

4343
```bash
44-
yarn add @algolia/abtesting@0.0.1-alpha.6
44+
yarn add @algolia/abtesting@1.0.0
4545
# or
46-
npm install @algolia/abtesting@0.0.1-alpha.6
46+
npm install @algolia/abtesting@1.0.0
4747
# or
48-
pnpm add @algolia/abtesting@0.0.1-alpha.6
48+
pnpm add @algolia/abtesting@1.0.0
4949
```
5050

5151
### Without a package manager
5252

5353
Add the following JavaScript snippet to the <head> of your website:
5454

5555
```html
56-
<script src="https://cdn.jsdelivr.net/npm/@algolia/abtesting@0.0.1-alpha.6/dist/builds/browser.umd.js"></script>
56+
<script src="https://cdn.jsdelivr.net/npm/@algolia/abtesting@1.0.0/dist/builds/browser.umd.js"></script>
5757
```
5858

5959
### Usage
6060

6161
You can now import the Algolia API client in your project and play with it.
6262

6363
```js
64-
import { abtestingClient } from '@algolia/abtesting';
64+
import { abtestingV3Client } from '@algolia/abtesting';
6565

66-
const client = abtestingClient('YOUR_APP_ID', 'YOUR_API_KEY');
66+
const client = abtestingV3Client('YOUR_APP_ID', 'YOUR_API_KEY');
6767
```
6868

69-
For full documentation, visit the **[Algolia JavaScript API Client](https://www.algolia.com/doc/libraries/javascript/v5/methods/abtesting/)**.
69+
For full documentation, visit the **[Algolia JavaScript API Client](https://www.algolia.com/doc/libraries/javascript/v5/methods/abtesting-v3/)**.
7070

7171
## ❓ Troubleshooting
7272

packages/abtesting/builds/browser.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,23 @@ import {
1111

1212
import type { ClientOptions } from '@algolia/client-common';
1313

14-
import { apiClientVersion, createAbtestingClient } from '../src/abtestingClient';
14+
import { apiClientVersion, createAbtestingV3Client } from '../src/abtestingV3Client';
1515

16-
import type { Region } from '../src/abtestingClient';
17-
import { REGIONS } from '../src/abtestingClient';
16+
import type { Region } from '../src/abtestingV3Client';
17+
import { REGIONS } from '../src/abtestingV3Client';
1818

19-
export type { Region, RegionOptions } from '../src/abtestingClient';
19+
export type { Region, RegionOptions } from '../src/abtestingV3Client';
2020

21-
export { apiClientVersion } from '../src/abtestingClient';
21+
export { apiClientVersion } from '../src/abtestingV3Client';
2222

2323
export * from '../model';
2424

25-
export function abtestingClient(
25+
export function abtestingV3Client(
2626
appId: string,
2727
apiKey: string,
2828
region?: Region | undefined,
2929
options?: ClientOptions | undefined,
30-
): AbtestingClient {
30+
): AbtestingV3Client {
3131
if (!appId || typeof appId !== 'string') {
3232
throw new Error('`appId` is missing.');
3333
}
@@ -40,7 +40,7 @@ export function abtestingClient(
4040
throw new Error(`\`region\` must be one of the following: ${REGIONS.join(', ')}`);
4141
}
4242

43-
return createAbtestingClient({
43+
return createAbtestingV3Client({
4444
appId,
4545
apiKey,
4646
region,
@@ -62,4 +62,4 @@ export function abtestingClient(
6262
});
6363
}
6464

65-
export type AbtestingClient = ReturnType<typeof createAbtestingClient>;
65+
export type AbtestingV3Client = ReturnType<typeof createAbtestingV3Client>;

packages/abtesting/builds/fetch.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
// 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.
22

3-
export type AbtestingClient = ReturnType<typeof createAbtestingClient>;
3+
export type AbtestingV3Client = ReturnType<typeof createAbtestingV3Client>;
44

55
import { createMemoryCache, createNullCache, createNullLogger } from '@algolia/client-common';
66
import { createFetchRequester } from '@algolia/requester-fetch';
77

88
import type { ClientOptions } from '@algolia/client-common';
99

10-
import { createAbtestingClient } from '../src/abtestingClient';
10+
import { createAbtestingV3Client } from '../src/abtestingV3Client';
1111

12-
import type { Region } from '../src/abtestingClient';
13-
import { REGIONS } from '../src/abtestingClient';
12+
import type { Region } from '../src/abtestingV3Client';
13+
import { REGIONS } from '../src/abtestingV3Client';
1414

15-
export type { Region, RegionOptions } from '../src/abtestingClient';
15+
export type { Region, RegionOptions } from '../src/abtestingV3Client';
1616

17-
export { apiClientVersion } from '../src/abtestingClient';
17+
export { apiClientVersion } from '../src/abtestingV3Client';
1818

1919
export * from '../model';
2020

21-
export function abtestingClient(
21+
export function abtestingV3Client(
2222
appId: string,
2323
apiKey: string,
2424
region?: Region | undefined,
2525
options?: ClientOptions | undefined,
26-
): AbtestingClient {
26+
): AbtestingV3Client {
2727
if (!appId || typeof appId !== 'string') {
2828
throw new Error('`appId` is missing.');
2929
}
@@ -37,7 +37,7 @@ export function abtestingClient(
3737
}
3838

3939
return {
40-
...createAbtestingClient({
40+
...createAbtestingV3Client({
4141
appId,
4242
apiKey,
4343
region,

packages/abtesting/builds/node.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
// 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.
22

3-
export type AbtestingClient = ReturnType<typeof createAbtestingClient>;
3+
export type AbtestingV3Client = ReturnType<typeof createAbtestingV3Client>;
44

55
import { createHttpRequester } from '@algolia/requester-node-http';
66

77
import { createMemoryCache, createNullCache, createNullLogger } from '@algolia/client-common';
88

99
import type { ClientOptions } from '@algolia/client-common';
1010

11-
import { createAbtestingClient } from '../src/abtestingClient';
11+
import { createAbtestingV3Client } from '../src/abtestingV3Client';
1212

13-
import type { Region } from '../src/abtestingClient';
14-
import { REGIONS } from '../src/abtestingClient';
13+
import type { Region } from '../src/abtestingV3Client';
14+
import { REGIONS } from '../src/abtestingV3Client';
1515

16-
export type { Region, RegionOptions } from '../src/abtestingClient';
16+
export type { Region, RegionOptions } from '../src/abtestingV3Client';
1717

18-
export { apiClientVersion } from '../src/abtestingClient';
18+
export { apiClientVersion } from '../src/abtestingV3Client';
1919

2020
export * from '../model';
2121

22-
export function abtestingClient(
22+
export function abtestingV3Client(
2323
appId: string,
2424
apiKey: string,
2525
region?: Region | undefined,
2626
options?: ClientOptions | undefined,
27-
): AbtestingClient {
27+
): AbtestingV3Client {
2828
if (!appId || typeof appId !== 'string') {
2929
throw new Error('`appId` is missing.');
3030
}
@@ -38,7 +38,7 @@ export function abtestingClient(
3838
}
3939

4040
return {
41-
...createAbtestingClient({
41+
...createAbtestingV3Client({
4242
appId,
4343
apiKey,
4444
region,

packages/abtesting/builds/worker.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
// 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.
22

3-
export type AbtestingClient = ReturnType<typeof createAbtestingClient>;
3+
export type AbtestingV3Client = ReturnType<typeof createAbtestingV3Client>;
44

55
import { createMemoryCache, createNullCache, createNullLogger } from '@algolia/client-common';
66
import { createFetchRequester } from '@algolia/requester-fetch';
77

88
import type { ClientOptions } from '@algolia/client-common';
99

10-
import { createAbtestingClient } from '../src/abtestingClient';
10+
import { createAbtestingV3Client } from '../src/abtestingV3Client';
1111

12-
import type { Region } from '../src/abtestingClient';
13-
import { REGIONS } from '../src/abtestingClient';
12+
import type { Region } from '../src/abtestingV3Client';
13+
import { REGIONS } from '../src/abtestingV3Client';
1414

15-
export type { Region, RegionOptions } from '../src/abtestingClient';
15+
export type { Region, RegionOptions } from '../src/abtestingV3Client';
1616

17-
export { apiClientVersion } from '../src/abtestingClient';
17+
export { apiClientVersion } from '../src/abtestingV3Client';
1818

1919
export * from '../model';
2020

21-
export function abtestingClient(
21+
export function abtestingV3Client(
2222
appId: string,
2323
apiKey: string,
2424
region?: Region | undefined,
2525
options?: ClientOptions | undefined,
26-
): AbtestingClient {
26+
): AbtestingV3Client {
2727
if (!appId || typeof appId !== 'string') {
2828
throw new Error('`appId` is missing.');
2929
}
@@ -37,7 +37,7 @@ export function abtestingClient(
3737
}
3838

3939
return {
40-
...createAbtestingClient({
40+
...createAbtestingV3Client({
4141
appId,
4242
apiKey,
4343
region,

packages/abtesting/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "0.0.1-alpha.6",
2+
"version": "1.0.0",
33
"repository": {
44
"type": "git",
55
"url": "git+https://github.com/algolia/algoliasearch-client-javascript.git"

packages/abtesting/rollup.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default [
1010
format: 'umd',
1111
sourcemap: false,
1212
globals: {
13-
['abtestingClient']: 'abtestingClient',
13+
['abtestingV3Client']: 'abtestingV3Client',
1414
},
1515
},
1616
},

packages/abtesting/src/abtestingClient.ts renamed to packages/abtesting/src/abtestingV3Client.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import type {
3434
StopABTestProps,
3535
} from '../model/clientMethodProps';
3636

37-
export const apiClientVersion = '0.0.1-alpha.6';
37+
export const apiClientVersion = '1.0.0';
3838

3939
export const REGIONS = ['de', 'us'] as const;
4040
export type Region = (typeof REGIONS)[number];
@@ -46,7 +46,7 @@ function getDefaultHosts(region?: Region | undefined): Host[] {
4646
return [{ url, accept: 'readWrite', protocol: 'https' }];
4747
}
4848

49-
export function createAbtestingClient({
49+
export function createAbtestingV3Client({
5050
appId: appIdOption,
5151
apiKey: apiKeyOption,
5252
authMode,
@@ -60,7 +60,7 @@ export function createAbtestingClient({
6060
...options,
6161
algoliaAgent: getAlgoliaAgent({
6262
algoliaAgents,
63-
client: 'Abtesting',
63+
client: 'AbtestingV3',
6464
version: apiClientVersion,
6565
}),
6666
baseHeaders: {

packages/abtesting/tsup.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const nodeConfigs: Options[] = [
4242

4343
const browserOptions: Options = {
4444
...getBaseBrowserOptions(pkg, __dirname),
45-
globalName: 'abtestingClient',
45+
globalName: 'abtestingV3Client',
4646
};
4747

4848
const browserConfigs: Options[] = [

0 commit comments

Comments
 (0)