Skip to content

Commit

Permalink
chore(deps): dependencies 2024-08-19 (generated)
Browse files Browse the repository at this point in the history
algolia/api-clients-automation#3530

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Algolia Bot <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: shortcuts <[email protected]>
Co-authored-by: Pierre Millot <[email protected]>
  • Loading branch information
5 people committed Aug 26, 2024
1 parent 49d6ea9 commit 643ae08
Show file tree
Hide file tree
Showing 151 changed files with 1,380 additions and 3,292 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.16.0
22.7.0
2 changes: 0 additions & 2 deletions .prettierignore

This file was deleted.

4 changes: 0 additions & 4 deletions .prettierrc

This file was deleted.

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@
},
"devDependencies": {
"@babel/core": "7.25.2",
"@babel/plugin-transform-class-properties": "7.24.7",
"@babel/plugin-transform-runtime": "7.24.7",
"@babel/preset-env": "7.25.3",
"@babel/runtime": "7.25.0",
"@babel/plugin-transform-class-properties": "7.25.4",
"@babel/plugin-transform-runtime": "7.25.4",
"@babel/preset-env": "7.25.4",
"@babel/runtime": "7.25.4",
"@rollup/plugin-babel": "6.0.4",
"@rollup/plugin-node-resolve": "15.2.3",
"@rollup/plugin-terser": "0.4.4",
"@types/jest": "29.5.12",
"@types/node": "20.14.14",
"@types/node": "22.5.0",
"@types/rollup-plugin-node-globals": "1.4.4",
"@types/semver": "7.5.8",
"bundlesize": "0.18.2",
"execa": "9.3.0",
"execa": "9.3.1",
"lerna": "8.1.8",
"nx": "19.5.7",
"rollup": "4.20.0",
"nx": "19.6.2",
"rollup": "4.21.0",
"rollup-plugin-node-globals": "1.4.0",
"rollup-plugin-typescript2": "0.36.0",
"semver": "7.6.3",
Expand Down
30 changes: 11 additions & 19 deletions packages/algoliasearch/__tests__/algoliasearch.browser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('api', () => {
})) as unknown as EchoResponse;

expect(req.algoliaAgent).toMatchInlineSnapshot(
`"Algolia%20for%20JavaScript%20(${apiClientVersion})%3B%20Search%20(${apiClientVersion})%3B%20Browser"`
`"Algolia%20for%20JavaScript%20(${apiClientVersion})%3B%20Search%20(${apiClientVersion})%3B%20Browser"`,
);
});

Expand All @@ -47,9 +47,7 @@ describe('api', () => {
describe('_ua', () => {
it('provides a backward compatible `_ua` variable at the root of the client', () => {
expect(client._ua).toEqual(
expect.stringContaining(
`Algolia for JavaScript (${apiClientVersion}); Search (${apiClientVersion});`
)
expect.stringContaining(`Algolia for JavaScript (${apiClientVersion}); Search (${apiClientVersion});`),
);
});

Expand All @@ -58,9 +56,7 @@ describe('api', () => {

client.addAlgoliaAgent('Jest', '0.0.1');

expect(client._ua).toEqual(
expect.stringMatching(/.*; Jest \(0\.0\.1\)$/g)
);
expect(client._ua).toEqual(expect.stringMatching(/.*; Jest \(0\.0\.1\)$/g));
});
});

Expand All @@ -69,9 +65,7 @@ describe('api', () => {
expect(client.transporter).toEqual({
algoliaAgent: {
add: expect.any(Function),
value: expect.stringContaining(
`Algolia for JavaScript (${apiClientVersion}); Search (${apiClientVersion});`
),
value: expect.stringContaining(`Algolia for JavaScript (${apiClientVersion}); Search (${apiClientVersion});`),
},
baseHeaders: {
'content-type': 'text/plain',
Expand Down Expand Up @@ -171,19 +165,19 @@ describe('api', () => {
expect.objectContaining({
'x-algolia-application-id': 'APP_ID',
'x-algolia-api-key': 'API_KEY',
})
}),
);
expect(res2.searchParams).toEqual(
expect.objectContaining({
'x-algolia-application-id': 'APP_ID',
'x-algolia-api-key': 'API_KEY',
})
}),
);
expect(res3.searchParams).toEqual(
expect.objectContaining({
'x-algolia-application-id': 'APP_ID',
'x-algolia-api-key': 'API_KEY',
})
}),
);
});

Expand Down Expand Up @@ -216,19 +210,19 @@ describe('api', () => {
expect.objectContaining({
'x-algolia-application-id': 'appId1',
'x-algolia-api-key': 'apiKey1',
})
}),
);
expect(res2.searchParams).toEqual(
expect.objectContaining({
'x-algolia-application-id': 'appId2',
'x-algolia-api-key': 'apiKey2',
})
}),
);
expect(res3.searchParams).toEqual(
expect.objectContaining({
'x-algolia-application-id': 'appId3',
'x-algolia-api-key': 'apiKey3',
})
}),
);
});
});
Expand Down Expand Up @@ -274,9 +268,7 @@ describe('search with legacy signature', () => {
expect(req.path).toEqual('/1/indexes/*/queries');
expect(req.method).toEqual('POST');
expect(req.data).toEqual({
requests: [
{ indexName: 'theIndexName', type: 'facet', facet: 'theFacet' },
],
requests: [{ indexName: 'theIndexName', type: 'facet', facet: 'theFacet' }],
});
expect(req.searchParams).toStrictEqual({
'x-algolia-api-key': 'API_KEY',
Expand Down
34 changes: 12 additions & 22 deletions packages/algoliasearch/__tests__/algoliasearch.node.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('api', () => {
})) as unknown as EchoResponse;

expect(req.algoliaAgent).toMatchInlineSnapshot(
`"Algolia%20for%20JavaScript%20(${apiClientVersion})%3B%20Search%20(${apiClientVersion})%3B%20Node.js%20(${process.versions.node})"`
`"Algolia%20for%20JavaScript%20(${apiClientVersion})%3B%20Search%20(${apiClientVersion})%3B%20Node.js%20(${process.versions.node})"`,
);
});

Expand All @@ -47,22 +47,16 @@ describe('api', () => {
describe('_ua', () => {
it('provides a backward compatible `_ua` variable at the root of the client', () => {
expect(client._ua).toEqual(
expect.stringContaining(
`Algolia for JavaScript (${apiClientVersion}); Search (${apiClientVersion});`
)
expect.stringContaining(`Algolia for JavaScript (${apiClientVersion}); Search (${apiClientVersion});`),
);
});

it('keeps `_ua` updated with the transporter algolia agent', () => {
expect(client._ua).toEqual(
expect.stringMatching(/.*; Node\.js \(.*\)$/g)
);
expect(client._ua).toEqual(expect.stringMatching(/.*; Node\.js \(.*\)$/g));

client.addAlgoliaAgent('Jest', '0.0.1');

expect(client._ua).toEqual(
expect.stringMatching(/.*; Jest \(0\.0\.1\)$/g)
);
expect(client._ua).toEqual(expect.stringMatching(/.*; Jest \(0\.0\.1\)$/g));
});
});

Expand All @@ -71,9 +65,7 @@ describe('api', () => {
expect(client.transporter).toEqual({
algoliaAgent: {
add: expect.any(Function),
value: expect.stringContaining(
`Algolia for JavaScript (${apiClientVersion}); Search (${apiClientVersion});`
),
value: expect.stringContaining(`Algolia for JavaScript (${apiClientVersion}); Search (${apiClientVersion});`),
},
baseHeaders: {
'content-type': 'text/plain',
Expand Down Expand Up @@ -172,19 +164,19 @@ describe('api', () => {
expect.objectContaining({
'x-algolia-application-id': 'APP_ID',
'x-algolia-api-key': 'API_KEY',
})
}),
);
expect(res2.headers).toEqual(
expect.objectContaining({
'x-algolia-application-id': 'APP_ID',
'x-algolia-api-key': 'API_KEY',
})
}),
);
expect(res3.headers).toEqual(
expect.objectContaining({
'x-algolia-application-id': 'APP_ID',
'x-algolia-api-key': 'API_KEY',
})
}),
);
});

Expand Down Expand Up @@ -217,19 +209,19 @@ describe('api', () => {
expect.objectContaining({
'x-algolia-application-id': 'appId1',
'x-algolia-api-key': 'apiKey1',
})
}),
);
expect(res2.headers).toEqual(
expect.objectContaining({
'x-algolia-application-id': 'appId2',
'x-algolia-api-key': 'apiKey2',
})
}),
);
expect(res3.headers).toEqual(
expect.objectContaining({
'x-algolia-application-id': 'appId3',
'x-algolia-api-key': 'apiKey3',
})
}),
);
});
});
Expand Down Expand Up @@ -272,9 +264,7 @@ describe('search with legacy signature', () => {
expect(req.path).toEqual('/1/indexes/*/queries');
expect(req.method).toEqual('POST');
expect(req.data).toEqual({
requests: [
{ indexName: 'theIndexName', type: 'facet', facet: 'theFacet' },
],
requests: [{ indexName: 'theIndexName', type: 'facet', facet: 'theFacet' }],
});
expect(req.searchParams).toStrictEqual(undefined);
});
Expand Down
63 changes: 15 additions & 48 deletions packages/algoliasearch/builds/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@

import type { AbtestingClient } from '@algolia/client-abtesting';
import type { Region as AbtestingRegion } from '@algolia/client-abtesting/src/abtestingClient';
import {
createAbtestingClient,
REGIONS as abtestingRegions,
} from '@algolia/client-abtesting/src/abtestingClient';
import { createAbtestingClient, REGIONS as abtestingRegions } from '@algolia/client-abtesting/src/abtestingClient';
import type { AnalyticsClient } from '@algolia/client-analytics';
import {
createAnalyticsClient,
REGIONS as analyticsRegions,
} from '@algolia/client-analytics/src/analyticsClient';
import { createAnalyticsClient, REGIONS as analyticsRegions } from '@algolia/client-analytics/src/analyticsClient';
import type { Region as AnalyticsRegion } from '@algolia/client-analytics/src/analyticsClient';
import {
DEFAULT_CONNECT_TIMEOUT_BROWSER,
Expand All @@ -20,20 +14,14 @@ import {
createFallbackableCache,
createMemoryCache,
} from '@algolia/client-common';
import type {
ClientOptions,
CreateClientOptions,
} from '@algolia/client-common';
import type { ClientOptions, CreateClientOptions } from '@algolia/client-common';
import type { PersonalizationClient } from '@algolia/client-personalization';
import type { Region as PersonalizationRegion } from '@algolia/client-personalization/src/personalizationClient';
import {
createPersonalizationClient,
REGIONS as personalizationRegions,
} from '@algolia/client-personalization/src/personalizationClient';
import {
createSearchClient,
apiClientVersion as searchClientVersion,
} from '@algolia/client-search/src/searchClient';
import { createSearchClient, apiClientVersion as searchClientVersion } from '@algolia/client-search/src/searchClient';
import type { RecommendClient } from '@algolia/recommend';
import { createRecommendClient } from '@algolia/recommend/src/recommendClient';
import { createXhrRequester } from '@algolia/requester-browser-xhr';
Expand All @@ -50,11 +38,7 @@ export const apiClientVersion = searchClientVersion;
export type Algoliasearch = ReturnType<typeof algoliasearch>;

// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
export function algoliasearch(
appId: string,
apiKey: string,
options?: ClientOptions
) {
export function algoliasearch(appId: string, apiKey: string, options?: ClientOptions) {
if (!appId || typeof appId !== 'string') {
throw new Error('`appId` is missing.');
}
Expand All @@ -76,10 +60,7 @@ export function algoliasearch(
responsesCache: createMemoryCache(),
requestsCache: createMemoryCache({ serializable: false }),
hostsCache: createFallbackableCache({
caches: [
createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }),
createMemoryCache(),
],
caches: [createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }), createMemoryCache()],
}),
...options,
};
Expand All @@ -92,17 +73,12 @@ export function algoliasearch(
});
}

function initAnalytics(
initOptions: InitClientOptions & InitClientRegion<AnalyticsRegion> = {}
): AnalyticsClient {
function initAnalytics(initOptions: InitClientOptions & InitClientRegion<AnalyticsRegion> = {}): AnalyticsClient {
if (
initOptions.region &&
(typeof initOptions.region !== 'string' ||
!analyticsRegions.includes(initOptions.region))
(typeof initOptions.region !== 'string' || !analyticsRegions.includes(initOptions.region))
) {
throw new Error(
`\`region\` must be one of the following: ${analyticsRegions.join(', ')}`
);
throw new Error(`\`region\` must be one of the following: ${analyticsRegions.join(', ')}`);
}

return createAnalyticsClient({
Expand All @@ -112,17 +88,12 @@ export function algoliasearch(
});
}

function initAbtesting(
initOptions: InitClientOptions & InitClientRegion<AbtestingRegion> = {}
): AbtestingClient {
function initAbtesting(initOptions: InitClientOptions & InitClientRegion<AbtestingRegion> = {}): AbtestingClient {
if (
initOptions.region &&
(typeof initOptions.region !== 'string' ||
!abtestingRegions.includes(initOptions.region))
(typeof initOptions.region !== 'string' || !abtestingRegions.includes(initOptions.region))
) {
throw new Error(
`\`region\` must be one of the following: ${abtestingRegions.join(', ')}`
);
throw new Error(`\`region\` must be one of the following: ${abtestingRegions.join(', ')}`);
}

return createAbtestingClient({
Expand All @@ -133,18 +104,14 @@ export function algoliasearch(
}

function initPersonalization(
initOptions: InitClientOptions &
Required<InitClientRegion<PersonalizationRegion>>
initOptions: InitClientOptions & Required<InitClientRegion<PersonalizationRegion>>,
): PersonalizationClient {
if (
!initOptions.region ||
(initOptions.region &&
(typeof initOptions.region !== 'string' ||
!personalizationRegions.includes(initOptions.region)))
(typeof initOptions.region !== 'string' || !personalizationRegions.includes(initOptions.region)))
) {
throw new Error(
`\`region\` is required and must be one of the following: ${personalizationRegions.join(', ')}`
);
throw new Error(`\`region\` is required and must be one of the following: ${personalizationRegions.join(', ')}`);
}

return createPersonalizationClient({
Expand Down
4 changes: 2 additions & 2 deletions packages/algoliasearch/builds/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
FacetFilters,
FacetOrdering,
Facets,
FacetsStats,
FacetStats,
HighlightResult,
HighlightResultOption,
IgnorePlurals,
Expand Down Expand Up @@ -119,7 +119,7 @@ export {
FacetFilters,
FacetOrdering,
Facets,
FacetsStats,
FacetStats,
HighlightResult,
HighlightResultOption,
IgnorePlurals,
Expand Down
Loading

0 comments on commit 643ae08

Please sign in to comment.