Skip to content

Commit 386f5a9

Browse files
authored
Merge branch 'main' into feat/add-chopper-requester-package
2 parents 0463079 + 45e54bd commit 386f5a9

File tree

181 files changed

+3951
-4654
lines changed

Some content is hidden

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

181 files changed

+3951
-4654
lines changed

.github/workflows/check.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ jobs:
277277

278278
- name: Generate code snippets
279279
run: yarn cli snippets javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun }}
280-
280+
281281
- name: Build the snippets to check validity
282282
run: yarn cli build snippets javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun }}
283283

@@ -689,12 +689,7 @@ jobs:
689689
env:
690690
GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN }}
691691

692-
- name: Push specs and snippets to algolia/doc
693-
run: yarn workspace scripts pushToAlgoliaDoc
694-
env:
695-
GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN }}
696-
697-
- name: Push guides to algolia/AlgoliaWeb
698-
run: yarn workspace scripts pushToAlgoliaWeb
692+
- name: Push generated files to repositories
693+
run: yarn workspace scripts pushToRepository
699694
env:
700695
GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN }}

.github/workflows/push-to-algolia-doc.yml

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

.github/workflows/push-to-algolia-web.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Push generated files to the given repository
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
name:
7+
description: 'the name of the repository to push files to'
8+
required: true
9+
type: choice
10+
options:
11+
- AlgoliaWeb
12+
- doc
13+
14+
jobs:
15+
push:
16+
name: Push generated files to the given repository
17+
runs-on: ubuntu-22.04
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
ref: main
23+
24+
- name: Setup
25+
id: setup
26+
uses: ./.github/actions/setup
27+
with:
28+
type: minimal
29+
30+
- run: yarn workspace scripts pushToRepository ${{ inputs.name }}
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN }}
33+
FORCE: true
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
packages/algoliasearch/CHANGELOG.md

clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/internal/interceptors/RetryStrategy.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ private Response handleResponse(StatefulHost host, @Nonnull Response response) t
8484

8585
try {
8686
String message = response.body() != null ? response.body().string() : response.message();
87+
if (response.header("Content-Type", "application/json").contains("text/html")) {
88+
message = response.message();
89+
}
8790
throw isRetryable(response)
8891
? new AlgoliaRequestException(message, response.code())
8992
: new AlgoliaApiException(message, response.code());

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@
9393
"@types/node": "22.9.0",
9494
"jsdom": "25.0.1",
9595
"publint": "0.2.12",
96-
"rollup": "4.25.0",
96+
"rollup": "4.27.2",
9797
"tsup": "8.3.5",
9898
"typescript": "5.6.3",
99-
"vitest": "2.1.4",
99+
"vitest": "2.1.5",
100100
"vitest-environment-miniflare": "2.14.4"
101101
},
102102
"engines": {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"@arethetypeswrong/cli": "0.17.0",
5858
"@types/node": "22.9.0",
5959
"publint": "0.2.12",
60-
"rollup": "4.25.0",
60+
"rollup": "4.27.2",
6161
"tsup": "8.3.5",
6262
"typescript": "5.6.3"
6363
},

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"@arethetypeswrong/cli": "0.17.0",
5858
"@types/node": "22.9.0",
5959
"publint": "0.2.12",
60-
"rollup": "4.25.0",
60+
"rollup": "4.27.2",
6161
"tsup": "8.3.5",
6262
"typescript": "5.6.3"
6363
},

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

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,29 @@ export function deserializeSuccess<TObject>(response: Response): TObject {
8282
}
8383
}
8484

85+
const httpMessages: Record<number, string> = {
86+
400: 'Bad Request',
87+
401: 'Unauthorized',
88+
402: 'Payment Required',
89+
403: 'Forbidden',
90+
404: 'Not Found',
91+
405: 'Method Not Allowed',
92+
406: 'Not Acceptable',
93+
407: 'Proxy Authentication Required',
94+
408: 'Request Timeout',
95+
409: 'Conflict',
96+
410: 'Gone',
97+
411: 'Length Required',
98+
412: 'Precondition Required',
99+
413: 'Request Entry Too Large',
100+
414: 'Request-URI Too Long',
101+
415: 'Unsupported Media Type',
102+
416: 'Requested Range Not Satisfiable',
103+
417: 'Expectation Failed',
104+
418: "I'm a teapot",
105+
429: 'Too Many Requests',
106+
};
107+
85108
export function deserializeFailure({ content, status }: Response, stackFrame: StackFrame[]): Error {
86109
try {
87110
const parsed = JSON.parse(content);
@@ -92,5 +115,5 @@ export function deserializeFailure({ content, status }: Response, stackFrame: St
92115
} catch {
93116
// ..
94117
}
95-
return new ApiError(content, status, stackFrame);
118+
return new ApiError(status in httpMessages ? httpMessages[status] : content, status, stackFrame);
96119
}

0 commit comments

Comments
 (0)