Skip to content

Commit 6dfaf44

Browse files
authored
feat(js): client common (#99)
1 parent 67dcaa9 commit 6dfaf44

File tree

136 files changed

+218
-5508
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+218
-5508
lines changed

.github/actions/cache/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ runs:
2626
key: ${{ runner.os }}-${{ inputs.spec }}-specs-${{ hashFiles(format('specs/{0}/**', inputs.spec)) }}
2727

2828
# restore clients
29+
- name: Restore built JavaScript common client
30+
uses: actions/cache@v2
31+
with:
32+
path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/client-common/dist
33+
key: ${{ runner.os }}-1-js-client-common-${{ hashFiles('clients/common-client-javascript/client-common/**') }}
34+
2935
- name: Restore built JavaScript search client
3036
if: ${{ inputs.job == 'cts' }}
3137
uses: actions/cache@v2

clients/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Clients
22

3-
This folder hosts the generated clients and their utils.
3+
This folder hosts the generated clients.
44

55
## Generated clients
66

@@ -20,4 +20,4 @@ This folder hosts the generated clients and their utils.
2020

2121
#### Utils
2222

23-
- [JavaScript](./algoliasearch-client-javascript/utils/): The JavaScript clients utils.
23+
- [JavaScript](./algoliasearch-client-javascript/client-common/): The JavaScript clients common files.

clients/algoliasearch-client-javascript/client-abtesting/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@
99
"main": "dist/api.js",
1010
"types": "dist/api.d.ts",
1111
"scripts": {
12-
"clean": "rm -Rf node_modules/ *.js",
1312
"build": "tsc",
14-
"test": "yarn build && node dist/client.js"
13+
"clean": "rm -rf dist/"
1514
},
1615
"engines": {
1716
"node": "^16.0.0",
1817
"yarn": "^3.0.0"
1918
},
19+
"dependencies": {
20+
"@algolia/client-common": "5.0.0"
21+
},
2022
"devDependencies": {
2123
"@types/node": "16.11.11",
2224
"typescript": "4.5.4"

clients/algoliasearch-client-javascript/client-abtesting/src/abtestingApi.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1+
import { Transporter } from '@algolia/client-common';
2+
import type {
3+
Headers,
4+
Requester,
5+
Host,
6+
Request,
7+
RequestOptions,
8+
} from '@algolia/client-common';
9+
110
import type { ABTest } from '../model/aBTest';
211
import type { ABTestResponse } from '../model/aBTestResponse';
312
import type { AddABTestsRequest } from '../model/addABTestsRequest';
413
import type { ListABTestsResponse } from '../model/listABTestsResponse';
5-
import { Transporter } from '../utils/Transporter';
6-
import type { Requester } from '../utils/requester/Requester';
7-
import type { Headers, Host, Request, RequestOptions } from '../utils/types';
814

915
export class AbtestingApi {
1016
protected authentications = {
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { AbtestingApi } from './abtestingApi';
22

33
export * from './abtestingApi';
4-
export * from '../utils/errors';
5-
export { EchoRequester } from '../utils/requester/EchoRequester';
6-
export { EchoResponse } from '../utils/types';
4+
export * from '@algolia/client-common';
75

86
export const APIS = [AbtestingApi];

clients/algoliasearch-client-javascript/client-analytics/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@
99
"main": "dist/api.js",
1010
"types": "dist/api.d.ts",
1111
"scripts": {
12-
"clean": "rm -Rf node_modules/ *.js",
1312
"build": "tsc",
14-
"test": "yarn build && node dist/client.js"
13+
"clean": "rm -rf dist/"
1514
},
1615
"engines": {
1716
"node": "^16.0.0",
1817
"yarn": "^3.0.0"
1918
},
19+
"dependencies": {
20+
"@algolia/client-common": "5.0.0"
21+
},
2022
"devDependencies": {
2123
"@types/node": "16.11.11",
2224
"typescript": "4.5.4"

clients/algoliasearch-client-javascript/client-analytics/src/analyticsApi.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
import { Transporter } from '@algolia/client-common';
2+
import type {
3+
Headers,
4+
Requester,
5+
Host,
6+
Request,
7+
RequestOptions,
8+
} from '@algolia/client-common';
9+
110
import type { GetAverageClickPositionResponse } from '../model/getAverageClickPositionResponse';
211
import type { GetClickPositionsResponse } from '../model/getClickPositionsResponse';
312
import type { GetClickThroughRateResponse } from '../model/getClickThroughRateResponse';
@@ -17,9 +26,6 @@ import type { GetTopHitsResponseWithAnalytics } from '../model/getTopHitsRespons
1726
import type { GetTopSearchesResponse } from '../model/getTopSearchesResponse';
1827
import type { GetTopSearchesResponseWithAnalytics } from '../model/getTopSearchesResponseWithAnalytics';
1928
import type { GetUsersCountResponse } from '../model/getUsersCountResponse';
20-
import { Transporter } from '../utils/Transporter';
21-
import type { Requester } from '../utils/requester/Requester';
22-
import type { Headers, Host, Request, RequestOptions } from '../utils/types';
2329

2430
export class AnalyticsApi {
2531
protected authentications = {
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { AnalyticsApi } from './analyticsApi';
22

33
export * from './analyticsApi';
4-
export * from '../utils/errors';
5-
export { EchoRequester } from '../utils/requester/EchoRequester';
6-
export { EchoResponse } from '../utils/types';
4+
export * from '@algolia/client-common';
75

86
export const APIS = [AnalyticsApi];

clients/algoliasearch-client-javascript/client-analytics/utils/Response.ts

Lines changed: 0 additions & 23 deletions
This file was deleted.

clients/algoliasearch-client-javascript/client-analytics/utils/StatefulHost.ts

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)