stable

Clone or download

Read-only

request #26737 Have a fork of tlp-fetch using neverthrow and Fault

No functional change expected in the new Artifact link field, when auto-completing artifact id. I did a fork of tlp-fetch because there were some (breaking) changes in the API I wanted to do: - it will auto encodeURI all URIs it receives in (tlp-fetch does not). - it will allow to retrieve JSON more easily. - it will by default set Content-Type to JSON for write operations (POST, PUT, PATCH). With tlp-fetch, we have to do it every time. - it will by default JSON.stringify the payload to send for write operations. With tlp-fetch, we have to do it every time. - it will not allow to pass fetch init options. It simplifies the API and we never use those options anyway. If needed, we can still use fetch directly or add the option later on. - it will handle decoding of Restler error message (or i18n_error_message) - it will return ResultAsync from neverthrow instead of a Promise. - it will return Faults for all errors. Change-Id: I31a26615fc65a72075c9fb8b9a57fbbf202557ba

Modified Files

Name
M lib/frontend/concurrency-limit-pool/src/concurrency-limit-pool.ts +1 −1 Go to diff View file
M lib/frontend/concurrency-limit-pool/tsconfig.json +0 −1 Go to diff View file
A lib/frontend/fetch-result/.gitignore +1 −0 Go to diff View file
A lib/frontend/fetch-result/README.md +202 −0 Go to diff View file
A lib/frontend/fetch-result/jest.config.js +26 −0 Go to diff View file
A lib/frontend/fetch-result/package.json +30 −0 Go to diff View file
A lib/frontend/fetch-result/pnpm-lock.yaml +21 −0 Go to diff View file
A lib/frontend/fetch-result/src/AllGetter.test.ts +200 −0 Go to diff View file
A lib/frontend/fetch-result/src/AllGetter.ts +160 −0 Go to diff View file
A lib/frontend/fetch-result/src/FetchInterface.ts +22 −0 Go to diff View file
A lib/frontend/fetch-result/src/JSONParseFault.test.ts +36 −0 Go to diff View file
A lib/frontend/fetch-result/src/JSONParseFault.ts +34 −0 Go to diff View file
A lib/frontend/fetch-result/src/NetworkFault.test.ts +36 −0 Go to diff View file
A lib/frontend/fetch-result/src/NetworkFault.ts +34 −0 Go to diff View file
A lib/frontend/fetch-result/src/ResponseRetriever.test.ts +160 −0 Go to diff View file
A lib/frontend/fetch-result/src/ResponseRetriever.ts +91 −0 Go to diff View file
A lib/frontend/fetch-result/src/ResultFetcher.test.ts +220 −0 Go to diff View file
A lib/frontend/fetch-result/src/ResultFetcher.ts +100 −0 Go to diff View file
A lib/frontend/fetch-result/src/TuleapAPIFault.test.ts +50 −0 Go to diff View file
A lib/frontend/fetch-result/src/TuleapAPIFault.ts +31 −0 Go to diff View file
A lib/frontend/fetch-result/src/auto-encoder.test.ts +57 −0 Go to diff View file
A lib/frontend/fetch-result/src/auto-encoder.ts +38 −0 Go to diff View file
A lib/frontend/fetch-result/src/constants.ts +43 −0 Go to diff View file
A lib/frontend/fetch-result/src/json-decoder.test.ts +59 −0 Go to diff View file
A lib/frontend/fetch-result/src/json-decoder.ts +27 −0 Go to diff View file
A lib/frontend/fetch-result/src/main.ts +181 −0 Go to diff View file
A lib/frontend/fetch-result/tests/helper/ResponseStub.ts +35 −0 Go to diff View file
A lib/frontend/fetch-result/tests/stubs/FetchInterfaceStub.ts +63 −0 Go to diff View file
A lib/frontend/fetch-result/tsconfig.json +9 −0 Go to diff View file
A lib/frontend/fetch-result/vite.config.ts +42 −0 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/package.json +1 −0 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/pnpm-lock.yaml +2 −0 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/REST/TuleapAPIClient.test.ts +5 −16 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/REST/TuleapAPIClient.ts +5 −7 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/rest/rest-service.test.ts +0 −18 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/rest/rest-service.ts +0 −7 Go to diff View file