Skip to content

Commit 3afbd28

Browse files
authored
port to native fetch (#302)
* port to native fetch - zero deps up from now * fix readme * remove node 16 test * rm request types, update ts
1 parent 96c78ca commit 3afbd28

File tree

10 files changed

+2596
-2036
lines changed

10 files changed

+2596
-2036
lines changed

.github/workflows/test-and-release.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ${{ matrix.os }}
1919
strategy:
2020
matrix:
21-
node-version: [12.x, 14.x, 16.x]
21+
node-version: [18.x, 20.x, 22.x]
2222
os: [ubuntu-latest, windows-latest, macos-latest]
2323
steps:
2424
- uses: actions/checkout@v1
@@ -45,16 +45,12 @@ jobs:
4545
startsWith(github.ref, 'refs/tags/v')
4646
4747
runs-on: ubuntu-latest
48-
strategy:
49-
matrix:
50-
node-version: [12.x]
51-
5248
steps:
5349
- uses: actions/checkout@v1
5450
- name: Use Node.js ${{ matrix.node-version }}
5551
uses: actions/setup-node@v1
5652
with:
57-
node-version: ${{ matrix.node-version }}
53+
node-version-file: '.nvmrc'
5854

5955
- name: Install package
6056
run: npm i

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![Downloads](https://img.shields.io/npm/dm/bring-shopping.svg)](https://www.npmjs.com/package/bring-shopping)
44
![Build Status](https://github.com/foxriver76/node-bring-api/workflows/Test%20and%20Release/badge.svg)
55

6-
A node module for Bring! shopping lists entirely written in TypeScript.
6+
A __zero dependency__ node module for Bring! shopping lists __entirely written in TypeScript__.
77

88
## Disclaimer
99
The developers of this module are in no way endorsed by or affiliated with
@@ -46,6 +46,9 @@ More important methods are `getItems(listUUID)`, `getItemsDetails(listUUID)`, `s
4646
`moveToRecentList(listUuid, itemName)` and `getAllUsersFromList(listUuid)`.
4747

4848
## Changelog
49+
### 2.0.0 (2024-11-27)
50+
* (@foxriver76) ported to native `fetch` module (BREAKING: Requires Node.js 18 or above)
51+
4952
### 1.5.1 (2022-10-31)
5053
* (foxriver76) updated types
5154
* (foxriver76) fixed `removeItemImage` as headers were missing

build/bring.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ declare class Bring {
119119
*
120120
* @param itemUuid The itemUUID which will be updated
121121
* @param image The image you want to link to the item
122-
* returns an imageUrl and answerHttpStatus should contain 204. If not -> error
122+
* @return returns an imageUrl and answerHttpStatus should contain 204. If not -> error
123123
*/
124124
saveItemImage(itemUuid: string, image: Image): Promise<{
125125
imageUrl: string;
@@ -129,22 +129,22 @@ declare class Bring {
129129
*
130130
* @param listUuid The listUUID you want to remove a item from
131131
* @param itemName Name of the item you want to delete from you shopping list
132-
* should return an empty string and $answerHttpStatus should contain 204. If not -> error
132+
* @return should return an empty string and $answerHttpStatus should contain 204. If not -> error
133133
*/
134134
removeItem(listUuid: string, itemName: string): Promise<string>;
135135
/**
136136
* Remove the image from your item
137137
*
138138
* @param itemUuid The itemUUID you want to remove the image from
139-
* returns an empty string and answerHttpStatus should contain 204. If not -> error
139+
* @return returns an empty string and answerHttpStatus should contain 204. If not -> error
140140
*/
141141
removeItemImage(itemUuid: string): Promise<string>;
142142
/**
143-
* move an item to recent items list
143+
* Move an item to recent items list
144144
*
145145
* @param itemName Name of the item you want to delete from you shopping list
146146
* @param listUuid The lisUUID you want to receive a list of users from.
147-
* should return an empty string and $answerHttpStatus should contain 204. If not -> error
147+
* @return Should return an empty string and $answerHttpStatus should contain 204. If not -> error
148148
*/
149149
moveToRecentList(listUuid: string, itemName: string): Promise<string>;
150150
/**
@@ -163,7 +163,7 @@ declare class Bring {
163163
*/
164164
loadTranslations(locale: string): Promise<Record<string, string>>;
165165
/**
166-
* Load translation file e. g. via 'de-DE'
166+
* Load translation file e.g. via 'de-DE'
167167
* @param locale from which country translations will be loaded
168168
*/
169169
loadCatalog(locale: string): Promise<LoadCatalogResponse>;

build/bring.js

Lines changed: 45 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)