Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: algolia/algoliasearch-client-javascript
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 5.3.1
Choose a base ref
...
head repository: algolia/algoliasearch-client-javascript
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 57295d4076691d6343f012c6314761b41c761be1
Choose a head ref
  • 2 commits
  • 30 files changed
  • 2 contributors

Commits on Sep 9, 2024

  1. fix(javascript): use transporter directly (generated)

    algolia/api-clients-automation#3682
    
    Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com>
    Co-authored-by: Clément Vannicatte <vannicattec@gmail.com>
    algolia-bot and shortcuts committed Sep 9, 2024
    Copy the full SHA
    95b871f View commit details
  2. chore: release 5.3.2

    Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com>
    Co-authored-by: Clément Vannicatte <vannicattec@gmail.com>
    algolia-bot and shortcuts committed Sep 9, 2024
    Copy the full SHA
    57295d4 View commit details
Showing with 633 additions and 636 deletions.
  1. +4 −0 CHANGELOG.md
  2. +4 −2 packages/algoliasearch/builds/browser.ts
  3. +4 −2 packages/algoliasearch/builds/node.ts
  4. +28 −29 packages/algoliasearch/lite/src/liteClient.ts
  5. +9 −9 packages/algoliasearch/package.json
  6. +4 −4 packages/client-abtesting/package.json
  7. +37 −37 packages/client-abtesting/src/abtestingClient.ts
  8. +4 −4 packages/client-analytics/package.json
  9. +65 −63 packages/client-analytics/src/analyticsClient.ts
  10. +1 −1 packages/client-common/package.json
  11. +4 −4 packages/client-insights/package.json
  12. +31 −32 packages/client-insights/src/insightsClient.ts
  13. +4 −4 packages/client-personalization/package.json
  14. +33 −34 packages/client-personalization/src/personalizationClient.ts
  15. +4 −4 packages/client-query-suggestions/package.json
  16. +36 −37 packages/client-query-suggestions/src/querySuggestionsClient.ts
  17. +4 −4 packages/client-search/package.json
  18. +93 −92 packages/client-search/src/searchClient.ts
  19. +4 −4 packages/client-usage/package.json
  20. +31 −33 packages/client-usage/src/usageClient.ts
  21. +4 −4 packages/ingestion/package.json
  22. +90 −96 packages/ingestion/src/ingestionClient.ts
  23. +4 −4 packages/monitoring/package.json
  24. +38 −39 packages/monitoring/src/monitoringClient.ts
  25. +4 −4 packages/recommend/package.json
  26. +34 −35 packages/recommend/src/recommendClient.ts
  27. +2 −2 packages/requester-browser-xhr/package.json
  28. +2 −2 packages/requester-fetch/package.json
  29. +2 −2 packages/requester-node-http/package.json
  30. +49 −49 yarn.lock
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [5.3.2](https://github.com/algolia/algoliasearch-client-javascript/compare/5.3.1...5.3.2)

- [0a433cc7a](https://github.com/algolia/api-clients-automation/commit/0a433cc7a) fix(javascript): use transporter directly ([#3682](https://github.com/algolia/api-clients-automation/pull/3682)) by [@shortcuts](https://github.com/shortcuts/)

## [5.3.1](https://github.com/algolia/algoliasearch-client-javascript/compare/5.3.0...5.3.1)

- [50bd07392](https://github.com/algolia/api-clients-automation/commit/50bd07392) fix(javascript): assert helpers and fix setClientApiKey helper ([#3663](https://github.com/algolia/api-clients-automation/pull/3663)) by [@shortcuts](https://github.com/shortcuts/)
6 changes: 4 additions & 2 deletions packages/algoliasearch/builds/browser.ts
Original file line number Diff line number Diff line change
@@ -34,13 +34,15 @@ export function algoliasearch(appId: string, apiKey: string, options?: ClientOpt
throw new Error('`apiKey` is missing.');
}

const client = searchClient(appId, apiKey, options);

return {
...searchClient(appId, apiKey, options),
...client,
/**
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
*/
get _ua(): string {
return this.transporter.algoliaAgent.value;
return client.transporter.algoliaAgent.value;
},
initRecommend: (initOptions: InitClientOptions = {}): RecommendClient => {
return recommendClient(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);
6 changes: 4 additions & 2 deletions packages/algoliasearch/builds/node.ts
Original file line number Diff line number Diff line change
@@ -34,13 +34,15 @@ export function algoliasearch(appId: string, apiKey: string, options?: ClientOpt
throw new Error('`apiKey` is missing.');
}

const client = searchClient(appId, apiKey, options);

return {
...searchClient(appId, apiKey, options),
...client,
/**
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
*/
get _ua(): string {
return this.transporter.algoliaAgent.value;
return client.transporter.algoliaAgent.value;
},
initRecommend: (initOptions: InitClientOptions = {}): RecommendClient => {
return recommendClient(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);
57 changes: 28 additions & 29 deletions packages/algoliasearch/lite/src/liteClient.ts
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ import type { SearchMethodParams } from '../model/searchMethodParams';
import type { SearchResponse } from '../model/searchResponse';
import type { SearchResponses } from '../model/searchResponses';

export const apiClientVersion = '5.3.1';
export const apiClientVersion = '5.3.2';

function getDefaultHosts(appId: string): Host[] {
return (
@@ -68,26 +68,27 @@ export function createLiteClient({
...options
}: CreateClientOptions) {
const auth = createAuth(appIdOption, apiKeyOption, authMode);
const transporter = createTransporter({
hosts: getDefaultHosts(appIdOption),
...options,
algoliaAgent: getAlgoliaAgent({
algoliaAgents,
client: 'Lite',
version: apiClientVersion,
}),
baseHeaders: {
'content-type': 'text/plain',
...auth.headers(),
...options.baseHeaders,
},
baseQueryParameters: {
...auth.queryParameters(),
...options.baseQueryParameters,
},
});

return {
transporter: createTransporter({
hosts: getDefaultHosts(appIdOption),
...options,
algoliaAgent: getAlgoliaAgent({
algoliaAgents,
client: 'Lite',
version: apiClientVersion,
}),
baseHeaders: {
'content-type': 'text/plain',
...auth.headers(),
...options.baseHeaders,
},
baseQueryParameters: {
...auth.queryParameters(),
...options.baseQueryParameters,
},
}),
transporter,

/**
* The `appId` currently in use.
@@ -98,16 +99,14 @@ export function createLiteClient({
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
*/
clearCache(): Promise<void> {
return Promise.all([this.transporter.requestsCache.clear(), this.transporter.responsesCache.clear()]).then(
() => undefined,
);
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);
},

/**
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
*/
get _ua(): string {
return this.transporter.algoliaAgent.value;
return transporter.algoliaAgent.value;
},

/**
@@ -117,7 +116,7 @@ export function createLiteClient({
* @param version - The version of the agent.
*/
addAlgoliaAgent(segment: string, version?: string): void {
this.transporter.algoliaAgent.add({ segment, version });
transporter.algoliaAgent.add({ segment, version });
},

/**
@@ -128,9 +127,9 @@ export function createLiteClient({
*/
setClientApiKey({ apiKey }: { apiKey: string }): void {
if (!authMode || authMode === 'WithinHeaders') {
this.transporter.baseHeaders['x-algolia-api-key'] = apiKey;
transporter.baseHeaders['x-algolia-api-key'] = apiKey;
} else {
this.transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;
transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;
}
},
/**
@@ -193,7 +192,7 @@ export function createLiteClient({
data: body ? body : {},
};

return this.transporter.request(request, requestOptions);
return transporter.request(request, requestOptions);
},

/**
@@ -240,7 +239,7 @@ export function createLiteClient({
cacheable: true,
};

return this.transporter.request(request, requestOptions);
return transporter.request(request, requestOptions);
},

/**
@@ -303,7 +302,7 @@ export function createLiteClient({
cacheable: true,
};

return this.transporter.request(request, requestOptions);
return transporter.request(request, requestOptions);
},
};
}
18 changes: 9 additions & 9 deletions packages/algoliasearch/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "5.3.1",
"version": "5.3.2",
"repository": {
"type": "git",
"url": "git+https://github.com/algolia/algoliasearch-client-javascript.git"
@@ -65,14 +65,14 @@
"lite.d.ts"
],
"dependencies": {
"@algolia/client-abtesting": "5.3.1",
"@algolia/client-analytics": "5.3.1",
"@algolia/client-common": "5.3.1",
"@algolia/client-personalization": "5.3.1",
"@algolia/client-search": "5.3.1",
"@algolia/recommend": "5.3.1",
"@algolia/requester-browser-xhr": "5.3.1",
"@algolia/requester-node-http": "5.3.1"
"@algolia/client-abtesting": "5.3.2",
"@algolia/client-analytics": "5.3.2",
"@algolia/client-common": "5.3.2",
"@algolia/client-personalization": "5.3.2",
"@algolia/client-search": "5.3.2",
"@algolia/recommend": "5.3.2",
"@algolia/requester-browser-xhr": "5.3.2",
"@algolia/requester-node-http": "5.3.2"
},
"devDependencies": {
"@arethetypeswrong/cli": "0.15.4",
8 changes: 4 additions & 4 deletions packages/client-abtesting/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "5.3.1",
"version": "5.3.2",
"repository": {
"type": "git",
"url": "git+https://github.com/algolia/algoliasearch-client-javascript.git"
@@ -44,9 +44,9 @@
"index.d.ts"
],
"dependencies": {
"@algolia/client-common": "5.3.1",
"@algolia/requester-browser-xhr": "5.3.1",
"@algolia/requester-node-http": "5.3.1"
"@algolia/client-common": "5.3.2",
"@algolia/requester-browser-xhr": "5.3.2",
"@algolia/requester-node-http": "5.3.2"
},
"devDependencies": {
"@arethetypeswrong/cli": "0.15.4",
Loading