@npora/request 1.23.4 → 1.23.5
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 +21 -25
- package/package.json +2 -6
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
[](package.json)
|
|
7
7
|
[](LICENSE)
|
|
8
8
|
|
|
9
|
-
[Website & live playground](https://
|
|
9
|
+
[Website & live playground](https://request.npora.live/) ·
|
|
10
10
|
[API reference](https://github.com/npora/request/blob/main/docs/api.md) ·
|
|
11
11
|
[Changelog](https://github.com/npora/request/blob/main/CHANGELOG.md)
|
|
12
12
|
|
|
@@ -20,8 +20,8 @@ has zero runtime dependencies.
|
|
|
20
20
|
| Goal | Documentation |
|
|
21
21
|
| --- | --- |
|
|
22
22
|
| Send the first request | [Quick start](#quick-start) |
|
|
23
|
-
| Try real requests in the browser | [Live playground](https://
|
|
24
|
-
| Develop or deploy the website | [Cloudflare
|
|
23
|
+
| Try real requests in the browser | [Live playground](https://request.npora.live/#playground) |
|
|
24
|
+
| Develop or deploy the website | [Online site and Cloudflare guide](https://github.com/npora/online/tree/main/request) |
|
|
25
25
|
| Move an existing Axios client | [Axios migration guide](https://github.com/npora/request/blob/main/docs/axios-migration.md) |
|
|
26
26
|
| Consume SSE or NDJSON | [Streaming responses](#streaming-responses) |
|
|
27
27
|
| Run a complete session workflow | [Session example](https://github.com/npora/request/blob/main/docs/workflows.md#build-a-session-client) |
|
|
@@ -35,10 +35,12 @@ has zero runtime dependencies.
|
|
|
35
35
|
|
|
36
36
|
## Live playground
|
|
37
37
|
|
|
38
|
-
Try the library at **[
|
|
39
|
-
The console
|
|
40
|
-
same-origin requests to Cloudflare Pages Functions. Its displayed
|
|
41
|
-
from the package manifest.
|
|
38
|
+
Try the library at **[request.npora.live](https://request.npora.live/#playground)**.
|
|
39
|
+
The console builds the request client from a pinned commit in this repository
|
|
40
|
+
and makes real same-origin requests to Cloudflare Pages Functions. Its displayed
|
|
41
|
+
version comes from the package manifest. Existing examples using `https://www.npora.live/api`
|
|
42
|
+
remain supported through the Npora site's compatibility endpoint. Use
|
|
43
|
+
`https://request.npora.live/api` for new examples.
|
|
42
44
|
|
|
43
45
|
| Scenario | What to observe |
|
|
44
46
|
| --- | --- |
|
|
@@ -59,10 +61,13 @@ use server arrival times; a separate, clearly labelled probe makes
|
|
|
59
61
|
`Retry-After` recovery observable even when a slow connection never exceeds
|
|
60
62
|
the real limit. Mock users and tokens are demonstration data.
|
|
61
63
|
|
|
62
|
-
The website
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
The website, Cloudflare Pages Functions, state Worker, deployment configuration,
|
|
65
|
+
and website tests are maintained in [npora/online](https://github.com/npora/online/tree/main/request).
|
|
66
|
+
This repository contains the reusable request library, its API documentation,
|
|
67
|
+
package tests, and release workflow. Installing `@npora/request` adds no
|
|
68
|
+
runtime dependencies or website server code. See the
|
|
69
|
+
[website operations guide](https://github.com/npora/online/tree/main/request)
|
|
70
|
+
for local setup, API routes, bindings, preview, and deployment.
|
|
66
71
|
|
|
67
72
|
## Install
|
|
68
73
|
|
|
@@ -87,7 +92,7 @@ To try a real response before connecting your own backend, save this as
|
|
|
87
92
|
import { createClient } from '@npora/request/core'
|
|
88
93
|
|
|
89
94
|
const api = createClient({
|
|
90
|
-
baseURL: 'https://
|
|
95
|
+
baseURL: 'https://request.npora.live/api',
|
|
91
96
|
timeout: 5000
|
|
92
97
|
})
|
|
93
98
|
|
|
@@ -706,8 +711,8 @@ allowlist, and size budgets.
|
|
|
706
711
|
|
|
707
712
|
## Documentation
|
|
708
713
|
|
|
709
|
-
- [Live playground](https://
|
|
710
|
-
- [Website development and Cloudflare deployment](https://github.com/npora/
|
|
714
|
+
- [Live playground](https://request.npora.live/#playground)
|
|
715
|
+
- [Website development and Cloudflare deployment](https://github.com/npora/online/tree/main/request)
|
|
711
716
|
- [Configuration reference](https://github.com/npora/request/blob/main/docs/configuration.md)
|
|
712
717
|
- [API reference](https://github.com/npora/request/blob/main/docs/api.md)
|
|
713
718
|
- [Architecture](https://github.com/npora/request/blob/main/docs/architecture.md)
|
|
@@ -739,17 +744,8 @@ See the
|
|
|
739
744
|
[testing and release gates](https://github.com/npora/request/blob/main/docs/testing.md)
|
|
740
745
|
for the complete matrix.
|
|
741
746
|
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
```sh
|
|
745
|
-
npm ci --prefix website --ignore-scripts
|
|
746
|
-
pnpm website:build
|
|
747
|
-
pnpm website:dev
|
|
748
|
-
```
|
|
749
|
-
|
|
750
|
-
Open `http://127.0.0.1:8787`. The development command starts Pages and its local
|
|
751
|
-
state Worker. Website checks are `pnpm test:website` and
|
|
752
|
-
`pnpm test:website:browser`; they do not deploy or publish anything.
|
|
747
|
+
For the website's local setup, API and browser regression checks, see the
|
|
748
|
+
[request playground and deployment files in npora/online](https://github.com/npora/online/tree/main/request).
|
|
753
749
|
|
|
754
750
|
## Versioning
|
|
755
751
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@npora/request",
|
|
3
|
-
"version": "1.23.
|
|
3
|
+
"version": "1.23.5",
|
|
4
4
|
"description": "A modern, TypeScript-first HTTP client powered by the Fetch API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"npora",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"circuit-breaker",
|
|
21
21
|
"web-worker"
|
|
22
22
|
],
|
|
23
|
-
"homepage": "https://
|
|
23
|
+
"homepage": "https://request.npora.live/",
|
|
24
24
|
"repository": {
|
|
25
25
|
"type": "git",
|
|
26
26
|
"url": "git+https://github.com/npora/request.git"
|
|
@@ -153,10 +153,6 @@
|
|
|
153
153
|
"vitest": "^4.1.12"
|
|
154
154
|
},
|
|
155
155
|
"scripts": {
|
|
156
|
-
"website:build": "npm --prefix website run build",
|
|
157
|
-
"website:dev": "npm --prefix website run dev",
|
|
158
|
-
"test:website": "npm --prefix website test",
|
|
159
|
-
"test:website:browser": "playwright test --config=website/playwright.config.ts",
|
|
160
156
|
"clean": "node scripts/clean.mjs",
|
|
161
157
|
"clean:dry-run": "node scripts/clean.mjs --dry-run",
|
|
162
158
|
"dev": "tsdown --watch",
|