Skip to content

Commit 840e8c6

Browse files
committed
Merge branch 'chore/submodules' of github.com:algolia/api-clients-automation into chore/submodules
2 parents b33a683 + 5ba293d commit 840e8c6

File tree

30 files changed

+98
-48
lines changed

30 files changed

+98
-48
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"description": "JavaScript client for @algolia/client-abtesting",
55
"repository": "algolia/algoliasearch-client-javascript",
66
"author": "Algolia",
7-
"private": true,
87
"license": "MIT",
98
"main": "index.js",
109
"module": "dist/client-abtesting.esm.node.js",

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

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ function getDefaultHosts(region?: Region): Host[] {
2828
}
2929

3030
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
31-
export const createAbtestingApi = (
31+
export function createAbtestingApi(
3232
options: CreateClientOptions & { region?: Region }
33-
) => {
33+
) {
3434
const auth = createAuth(options.appId, options.apiKey, options.authMode);
3535
const transporter = new Transporter({
3636
hosts: options?.hosts ?? getDefaultHosts(options.region),
@@ -48,6 +48,10 @@ export const createAbtestingApi = (
4848
requester: options.requester,
4949
});
5050

51+
function addUserAgent(segment: string, version?: string): void {
52+
transporter.userAgent.add({ segment, version });
53+
}
54+
5155
/**
5256
* Creates a new A/B test with provided configuration. You can set an A/B test on two different indices with different settings, or on the same index with different search parameters by providing a customSearchParameters setting on one of the variants.
5357
*
@@ -222,8 +226,15 @@ export const createAbtestingApi = (
222226
});
223227
}
224228

225-
return { addABTests, deleteABTest, getABTest, listABTests, stopABTest };
226-
};
229+
return {
230+
addUserAgent,
231+
addABTests,
232+
deleteABTest,
233+
getABTest,
234+
listABTests,
235+
stopABTest,
236+
};
237+
}
227238

228239
export type AbtestingApi = ReturnType<typeof createAbtestingApi>;
229240

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"description": "JavaScript client for @algolia/client-analytics",
55
"repository": "algolia/algoliasearch-client-javascript",
66
"author": "Algolia",
7-
"private": true,
87
"license": "MIT",
98
"main": "index.js",
109
"module": "dist/client-analytics.esm.node.js",

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ function getDefaultHosts(region?: Region): Host[] {
4343
}
4444

4545
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
46-
export const createAnalyticsApi = (
46+
export function createAnalyticsApi(
4747
options: CreateClientOptions & { region?: Region }
48-
) => {
48+
) {
4949
const auth = createAuth(options.appId, options.apiKey, options.authMode);
5050
const transporter = new Transporter({
5151
hosts: options?.hosts ?? getDefaultHosts(options.region),
@@ -63,6 +63,10 @@ export const createAnalyticsApi = (
6363
requester: options.requester,
6464
});
6565

66+
function addUserAgent(segment: string, version?: string): void {
67+
transporter.userAgent.add({ segment, version });
68+
}
69+
6670
/**
6771
* Returns the average click position. The endpoint returns a value for the complete given time range, as well as a value per day.
6872
*
@@ -1104,6 +1108,7 @@ export const createAnalyticsApi = (
11041108
}
11051109

11061110
return {
1111+
addUserAgent,
11071112
getAverageClickPosition,
11081113
getClickPositions,
11091114
getClickThroughRate,
@@ -1122,7 +1127,7 @@ export const createAnalyticsApi = (
11221127
getTopSearches,
11231128
getUsersCount,
11241129
};
1125-
};
1130+
}
11261131

11271132
export type AnalyticsApi = ReturnType<typeof createAnalyticsApi>;
11281133

clients/algoliasearch-client-javascript/packages/client-common/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"description": "Common package for the Algolia JavaScript API client.",
55
"repository": "algolia/algoliasearch-client-javascript",
66
"author": "Algolia",
7-
"private": true,
87
"license": "MIT",
98
"main": "dist/client-common.cjs.node.js",
109
"module": "dist/client-common.esm.node.js",

clients/algoliasearch-client-javascript/packages/client-common/src/Transporter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class Transporter {
3333
private baseHeaders: Headers;
3434
private baseQueryParameters: QueryParameters;
3535
private hostsCache: Cache;
36-
private userAgent: UserAgent;
36+
userAgent: UserAgent;
3737
private timeouts: Timeouts;
3838
private requester: Requester;
3939

clients/algoliasearch-client-javascript/packages/client-insights/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"description": "JavaScript client for @algolia/client-insights",
55
"repository": "algolia/algoliasearch-client-javascript",
66
"author": "Algolia",
7-
"private": true,
87
"license": "MIT",
98
"main": "index.js",
109
"module": "dist/client-insights.esm.node.js",

clients/algoliasearch-client-javascript/packages/client-insights/src/insightsApi.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ function getDefaultHosts(region?: Region): Host[] {
2626
}
2727

2828
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
29-
export const createInsightsApi = (
29+
export function createInsightsApi(
3030
options: CreateClientOptions & { region?: Region }
31-
) => {
31+
) {
3232
const auth = createAuth(options.appId, options.apiKey, options.authMode);
3333
const transporter = new Transporter({
3434
hosts: options?.hosts ?? getDefaultHosts(options.region),
@@ -46,6 +46,10 @@ export const createInsightsApi = (
4646
requester: options.requester,
4747
});
4848

49+
function addUserAgent(segment: string, version?: string): void {
50+
transporter.userAgent.add({ segment, version });
51+
}
52+
4953
/**
5054
* This command pushes an array of events.
5155
*
@@ -83,7 +87,7 @@ export const createInsightsApi = (
8387
});
8488
}
8589

86-
return { pushEvents };
87-
};
90+
return { addUserAgent, pushEvents };
91+
}
8892

8993
export type InsightsApi = ReturnType<typeof createInsightsApi>;

clients/algoliasearch-client-javascript/packages/client-personalization/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"description": "JavaScript client for @algolia/client-personalization",
55
"repository": "algolia/algoliasearch-client-javascript",
66
"author": "Algolia",
7-
"private": true,
87
"license": "MIT",
98
"main": "index.js",
109
"module": "dist/client-personalization.esm.node.js",

clients/algoliasearch-client-javascript/packages/client-personalization/src/personalizationApi.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ function getDefaultHosts(region: Region): Host[] {
2626
}
2727

2828
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
29-
export const createPersonalizationApi = (
29+
export function createPersonalizationApi(
3030
options: CreateClientOptions & { region: Region }
31-
) => {
31+
) {
3232
const auth = createAuth(options.appId, options.apiKey, options.authMode);
3333
const transporter = new Transporter({
3434
hosts: options?.hosts ?? getDefaultHosts(options.region),
@@ -46,6 +46,10 @@ export const createPersonalizationApi = (
4646
requester: options.requester,
4747
});
4848

49+
function addUserAgent(segment: string, version?: string): void {
50+
transporter.userAgent.add({ segment, version });
51+
}
52+
4953
/**
5054
* Returns, as part of the response, a date until which the data can safely be considered as deleted for the given user. This means that if you send events for the given user before this date, they will be ignored. Any data received after the deletedUntil date will start building a new user profile. It might take a couple hours before for the deletion request to be fully processed.
5155
*
@@ -183,12 +187,13 @@ export const createPersonalizationApi = (
183187
}
184188

185189
return {
190+
addUserAgent,
186191
deleteUserProfile,
187192
getPersonalizationStrategy,
188193
getUserTokenProfile,
189194
setPersonalizationStrategy,
190195
};
191-
};
196+
}
192197

193198
export type PersonalizationApi = ReturnType<typeof createPersonalizationApi>;
194199

clients/algoliasearch-client-javascript/packages/client-predict/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"description": "JavaScript client for @algolia/client-predict",
55
"repository": "algolia/algoliasearch-client-javascript",
66
"author": "Algolia",
7-
"private": true,
87
"license": "MIT",
98
"main": "index.js",
109
"module": "dist/client-predict.esm.node.js",

clients/algoliasearch-client-javascript/packages/client-predict/src/predictApi.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function getDefaultHosts(): Host[] {
2222
}
2323

2424
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
25-
export const createPredictApi = (options: CreateClientOptions) => {
25+
export function createPredictApi(options: CreateClientOptions) {
2626
const auth = createAuth(options.appId, options.apiKey, options.authMode);
2727
const transporter = new Transporter({
2828
hosts: options?.hosts ?? getDefaultHosts(),
@@ -40,6 +40,10 @@ export const createPredictApi = (options: CreateClientOptions) => {
4040
requester: options.requester,
4141
});
4242

43+
function addUserAgent(segment: string, version?: string): void {
44+
transporter.userAgent.add({ segment, version });
45+
}
46+
4347
/**
4448
* Get predictions, properties (raw, computed or custom) and segments (computed or custom) for a user profile.
4549
*
@@ -83,8 +87,8 @@ export const createPredictApi = (options: CreateClientOptions) => {
8387
});
8488
}
8589

86-
return { fetchUserProfile };
87-
};
90+
return { addUserAgent, fetchUserProfile };
91+
}
8892

8993
export type PredictApi = ReturnType<typeof createPredictApi>;
9094

clients/algoliasearch-client-javascript/packages/client-query-suggestions/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"description": "JavaScript client for @algolia/client-query-suggestions",
55
"repository": "algolia/algoliasearch-client-javascript",
66
"author": "Algolia",
7-
"private": true,
87
"license": "MIT",
98
"main": "index.js",
109
"module": "dist/client-query-suggestions.esm.node.js",

clients/algoliasearch-client-javascript/packages/client-query-suggestions/src/querySuggestionsApi.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ function getDefaultHosts(region: Region): Host[] {
2828
}
2929

3030
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
31-
export const createQuerySuggestionsApi = (
31+
export function createQuerySuggestionsApi(
3232
options: CreateClientOptions & { region: Region }
33-
) => {
33+
) {
3434
const auth = createAuth(options.appId, options.apiKey, options.authMode);
3535
const transporter = new Transporter({
3636
hosts: options?.hosts ?? getDefaultHosts(options.region),
@@ -48,6 +48,10 @@ export const createQuerySuggestionsApi = (
4848
requester: options.requester,
4949
});
5050

51+
function addUserAgent(segment: string, version?: string): void {
52+
transporter.userAgent.add({ segment, version });
53+
}
54+
5155
/**
5256
* Create a configuration of a Query Suggestions index. There\'s a limit of 100 configurations per application.
5357
*
@@ -284,6 +288,7 @@ export const createQuerySuggestionsApi = (
284288
}
285289

286290
return {
291+
addUserAgent,
287292
createConfig,
288293
deleteConfig,
289294
getAllConfigs,
@@ -292,7 +297,7 @@ export const createQuerySuggestionsApi = (
292297
getLogFile,
293298
updateConfig,
294299
};
295-
};
300+
}
296301

297302
export type QuerySuggestionsApi = ReturnType<typeof createQuerySuggestionsApi>;
298303

clients/algoliasearch-client-javascript/packages/client-search/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"description": "JavaScript client for @algolia/client-search",
55
"repository": "algolia/algoliasearch-client-javascript",
66
"author": "Algolia",
7-
"private": true,
87
"license": "MIT",
98
"main": "index.js",
109
"module": "dist/client-search.esm.node.js",

clients/algoliasearch-client-javascript/packages/client-search/src/searchApi.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ function getDefaultHosts(appId: string): Host[] {
106106
}
107107

108108
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
109-
export const createSearchApi = (options: CreateClientOptions) => {
109+
export function createSearchApi(options: CreateClientOptions) {
110110
const auth = createAuth(options.appId, options.apiKey, options.authMode);
111111
const transporter = new Transporter({
112112
hosts: options?.hosts ?? getDefaultHosts(options.appId),
@@ -124,6 +124,10 @@ export const createSearchApi = (options: CreateClientOptions) => {
124124
requester: options.requester,
125125
});
126126

127+
function addUserAgent(segment: string, version?: string): void {
128+
transporter.userAgent.add({ segment, version });
129+
}
130+
127131
/**
128132
* Add a new API Key with specific permissions/restrictions.
129133
*
@@ -2393,6 +2397,7 @@ export const createSearchApi = (options: CreateClientOptions) => {
23932397
}
23942398

23952399
return {
2400+
addUserAgent,
23962401
addApiKey,
23972402
addOrUpdateObject,
23982403
appendSource,
@@ -2451,7 +2456,7 @@ export const createSearchApi = (options: CreateClientOptions) => {
24512456
setSettings,
24522457
updateApiKey,
24532458
};
2454-
};
2459+
}
24552460

24562461
export type SearchApi = ReturnType<typeof createSearchApi>;
24572462

clients/algoliasearch-client-javascript/packages/client-sources/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"description": "JavaScript client for @algolia/client-sources",
55
"repository": "algolia/algoliasearch-client-javascript",
66
"author": "Algolia",
7-
"private": true,
87
"license": "MIT",
98
"main": "index.js",
109
"module": "dist/client-sources.esm.node.js",

clients/algoliasearch-client-javascript/packages/client-sources/src/sourcesApi.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ function getDefaultHosts(region: Region): Host[] {
2424
}
2525

2626
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
27-
export const createSourcesApi = (
27+
export function createSourcesApi(
2828
options: CreateClientOptions & { region: Region }
29-
) => {
29+
) {
3030
const auth = createAuth(options.appId, options.apiKey, options.authMode);
3131
const transporter = new Transporter({
3232
hosts: options?.hosts ?? getDefaultHosts(options.region),
@@ -44,6 +44,10 @@ export const createSourcesApi = (
4444
requester: options.requester,
4545
});
4646

47+
function addUserAgent(segment: string, version?: string): void {
48+
transporter.userAgent.add({ segment, version });
49+
}
50+
4751
/**
4852
* Add an ingestion job that will fetch data from an URL.
4953
*
@@ -91,7 +95,7 @@ export const createSourcesApi = (
9195
});
9296
}
9397

94-
return { postIngestUrl };
95-
};
98+
return { addUserAgent, postIngestUrl };
99+
}
96100

97101
export type SourcesApi = ReturnType<typeof createSourcesApi>;

clients/algoliasearch-client-javascript/packages/recommend/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"description": "JavaScript client for @algolia/recommend",
55
"repository": "algolia/algoliasearch-client-javascript",
66
"author": "Algolia",
7-
"private": true,
87
"license": "MIT",
98
"main": "index.js",
109
"module": "dist/recommend.esm.node.js",

0 commit comments

Comments
 (0)