@usenadia/node 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -4
- package/dist/index.d.mts +1983 -361
- package/dist/index.d.ts +1983 -361
- package/dist/index.js +326 -48
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +296 -44
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -46,6 +46,22 @@ try {
|
|
|
46
46
|
This block is run as is against the real API by the smoke test
|
|
47
47
|
(`test/smoke.test.mjs`): if it stops working, the release stops.
|
|
48
48
|
|
|
49
|
+
## Uploading a file
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
const media = await nadia.upload('./reel.mp4'); // a path, or upload(blob, 'reel.mp4')
|
|
53
|
+
media.path; // what a post takes as image[].path
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
An MP4, JPEG, PNG, WebP or GIF goes in parts of 20 MB straight to the
|
|
57
|
+
storage, four at a time: a part cut by the network is sent again, and so are
|
|
58
|
+
the parts the server says are missing, before it confirms. Up to 500 MB.
|
|
59
|
+
A server without the upload in parts, or another type (HEIC, MOV, which the
|
|
60
|
+
server converts), gets the whole file in one request, as before. In one
|
|
61
|
+
request the server takes an image up to 10 MB, a MOV up to 1 GB, and an MP4
|
|
62
|
+
up to 25 MB only (`413 FILE_TOO_LARGE` beyond: a recent server takes it in
|
|
63
|
+
parts).
|
|
64
|
+
|
|
49
65
|
## The content board
|
|
50
66
|
|
|
51
67
|
Every card of the board in the app is reachable: create one from anywhere
|
|
@@ -144,7 +160,7 @@ pass `request.headers` and the buffer the same way. With the Fetch API
|
|
|
144
160
|
is the primitive underneath: it returns a boolean and checks the timestamp
|
|
145
161
|
only when `tolerance` (seconds) is given. Both are tested against the
|
|
146
162
|
fixture the server signs with
|
|
147
|
-
(`
|
|
163
|
+
(`apps/server/contract/signed-delivery.json`).
|
|
148
164
|
|
|
149
165
|
## Errors
|
|
150
166
|
|
|
@@ -184,7 +200,7 @@ A tag publishes; nothing is published from a laptop.
|
|
|
184
200
|
```bash
|
|
185
201
|
# 1. bump "version" in apps/sdk/node/package.json, commit, push main
|
|
186
202
|
# 2. tag it — the tag must equal the version
|
|
187
|
-
git tag node-v0.
|
|
203
|
+
git tag node-v0.2.0 && git push origin node-v0.2.0
|
|
188
204
|
```
|
|
189
205
|
|
|
190
206
|
`.github/workflows/publish-npm.yml` refuses a tag that does not match
|
|
@@ -192,5 +208,5 @@ git tag node-v0.1.1 && git push origin node-v0.1.1
|
|
|
192
208
|
the real API**, and publishes only if all are green (npm Trusted Publisher,
|
|
193
209
|
no token).
|
|
194
210
|
|
|
195
|
-
`openapi.public.json` itself is
|
|
196
|
-
|
|
211
|
+
`openapi.public.json` itself is held by hand at the repo root; the server's
|
|
212
|
+
tests hold every public answer to it (`pnpm openapi:check`). Plan: `docs/roadmap/done/19-sdk-public-api.md`.
|