Skip to content

Commit bcbfc88

Browse files
authored
Merge branch 'main' into chore/build-js
2 parents 5e6f7ae + 0df4fb2 commit bcbfc88

File tree

6 files changed

+7
-8
lines changed

6 files changed

+7
-8
lines changed

clients/algoliasearch-client-javascript/packages/algoliasearch/__tests__/algoliasearch.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('api', () => {
2828
})) as unknown as EchoResponse;
2929

3030
expect(req.algoliaAgent).toMatchInlineSnapshot(
31-
`"Algolia%20for%20JavaScript%20(${apiClientVersion});%20Search%20(${apiClientVersion});%20Node.js%20(${process.versions.node})"`
31+
`"Algolia%20for%20JavaScript%20(${apiClientVersion})%3B%20Search%20(${apiClientVersion})%3B%20Node.js%20(${process.versions.node})"`
3232
);
3333
});
3434

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function createEchoRequester({
4444
data: request.data ? JSON.parse(request.data) : undefined,
4545
path,
4646
host,
47-
algoliaAgent: encodeURI(algoliaAgent),
47+
algoliaAgent: encodeURIComponent(algoliaAgent),
4848
searchParams,
4949
};
5050

clients/algoliasearch-client-javascript/packages/client-common/src/transporter/helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ export function serializeQueryParameters(parameters: QueryParameters): string {
4949
return Object.keys(parameters)
5050
.map(
5151
(key) =>
52-
`${key}=${
52+
`${key}=${encodeURIComponent(
5353
isObjectOrArray(parameters[key])
5454
? JSON.stringify(parameters[key])
5555
: parameters[key]
56-
}`
56+
)}`
5757
)
5858
.join('&');
5959
}

playground/javascript/node/predict.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ dotenv.config({ path: '../../.env' });
77
const appId = process.env.ALGOLIA_PREDICT_APP_ID || '**** APP_ID *****';
88
const apiKey =
99
process.env.ALGOLIA_PREDICT_API_KEY || '**** PREDICT_API_KEY *****';
10-
11-
const userId = 'user1';
10+
const userId = process.env.ALGOLIA_PREDICT_USER_ID || 'user1';
1211

1312
// Init client with appId and apiKey
1413
const client = predictClient(appId, apiKey, 'ew');

templates/javascript/tests/client/suite.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe('{{testType}}', () => {
3232
{{> client/step}}
3333

3434
{{#testUserAgent}}
35-
expect(decodeURI(result.algoliaAgent)).toMatch(/{{{match}}}/);
35+
expect(decodeURIComponent(result.algoliaAgent)).toMatch(/{{{match}}}/);
3636
{{/testUserAgent}}
3737
{{#testTimeouts}}
3838
expect(result).toEqual(expect.objectContaining({{{match.parameters}}}));

tests/output/javascript/yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3663,7 +3663,7 @@ __metadata:
36633663

36643664
"typescript@patch:[email protected]#~builtin<compat/typescript>":
36653665
version: 4.7.4
3666-
resolution: "typescript@patch:typescript@npm%3A4.7.4#~builtin<compat/typescript>::version=4.7.4&hash=f456af"
3666+
resolution: "typescript@patch:typescript@npm%3A4.7.4#~builtin<compat/typescript>::version=4.7.4&hash=a1c5e5"
36673667
bin:
36683668
tsc: bin/tsc
36693669
tsserver: bin/tsserver

0 commit comments

Comments
 (0)