Commit 23aa437
refactor: Remove axios and node-fetch (#1221)
* Refactored the codebase to eliminate `axios` and `node-fetch` dependencies, transitioning to the native Node.js `fetch` API.
Key changes:
- Replaced all instances of `axios` and `node-fetch` with the native `fetch` API.
- Removed `axios` and `node-fetch` from all `package.json` files.
- Updated `pnpm-lock.yaml` files by running `npm run bootstrap`.
* fix(minimal-webhook): Use response.status instead of response.statusCode
The native fetch API returns a Response object that has a 'status' property, not a 'statusCode' property. This commit fixes the error in the minimal-webhook function by using the correct property.
* fix(taskqueues-backup-images): Use Readable.fromWeb to handle web stream
The native fetch API returns a web stream, which is not compatible with the Node.js stream API used by Firebase Storage. This commit fixes the issue by converting the web stream to a Node.js stream using `Readable.fromWeb` and then piping it to the destination using `pipeline`.
* fix(taskqueues-backup-images): Use Readable.fromWeb to handle web stream
The native fetch API returns a web stream, which is not compatible with the Node.js stream API used by Firebase Storage. This commit fixes the issue by converting the web stream to a Node.js stream using `Readable.fromWeb` and then piping it to the destination using `pipeline`.
This fix is applied to both the `Node` and `Node-1st-gen` versions of the `taskqueues-backup-images` function.
* fix(taskqueues-backup-images): Use buffer to save image
This commit fixes a CI error in the taskqueues-backup-images function by reading the image into a buffer and then writing the buffer to the file. This avoids the streaming type issues between web streams and Node.js streams. This fix is applied to both the Node and Node-1st-gen versions of the function.
* make CI happy
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Jeff Huleatt <3759507+jhuleatt@users.noreply.github.com>1 parent 8e99478 commit 23aa437
File tree
33 files changed
+19
-102
lines changed- Node-1st-gen
- github-to-slack/functions
- minimal-webhook/functions
- quickstarts/taskqueues-backup-images/functions
- remote-config-diff/functions
- testlab-to-slack/functions
- username-password-auth/functions
- Node
- alerts-to-discord/functions
- app-distribution-feedback-to-jira/functions
- remote-config-diff/functions
- taskqueues-backup-images/functions
- testlab-to-slack/functions
33 files changed
+19
-102
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
36 | | - | |
| 35 | + | |
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
| 7 | + | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
| |||
80 | 79 | | |
81 | 80 | | |
82 | 81 | | |
| 82 | + | |
| 83 | + | |
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
| 88 | + | |
93 | 89 | | |
94 | 90 | | |
95 | 91 | | |
| |||
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
| 21 | + | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| |||
Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
0 commit comments