@stonyx/rest-server 0.2.1-beta.150 → 0.2.1-beta.152

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.
Files changed (2) hide show
  1. package/README.md +18 -0
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -15,6 +15,24 @@ REST server module for the [Stonyx framework](https://github.com/abofs/stonyx),
15
15
  * **Singleton server:** Only one RestServer instance runs, preventing accidental multiple listeners.
16
16
  * **Framework integration:** Works seamlessly as part of the Stonyx framework—auto-initialized with the rest of your modules.
17
17
 
18
+ ## Exports
19
+
20
+ | Import path | What it exports |
21
+ | :--- | :--- |
22
+ | `@stonyx/rest-server` | `RestServer` (default), `Request` (named) |
23
+
24
+ There are no subpath exports.
25
+
26
+ ## Samples
27
+
28
+ The sample request classes in [`test/sample/`](https://github.com/abofs/stonyx-rest-server/tree/dev/test/sample) are the canonical usage reference for the runtime API of a JavaScript consumer: extending `Request`, declaring `handlers`, `auth` and middleware. The integration tests run against them. They are not included in the npm package.
29
+
30
+ They are not yet a TypeScript reference. Their type imports (`RequestState` and `RouteHandlers` from `../../../src/request.js`, and `express`) resolve only inside this repo, and some handlers are deliberately invalid or failing because the tests exercise those paths. Rewriting the samples for consumers is tracked in [stonyx#121](https://github.com/abofs/stonyx/issues/121) (part C).
31
+
32
+ ## Security notes
33
+
34
+ [`docs/security.md`](https://github.com/abofs/stonyx-rest-server/blob/dev/docs/security.md) covers the security-relevant behaviour: what an `auth` return value allows (any falsy value, including `0`, lets the request through; a Promise does not), unchecked `state.redirect` targets, the `'*'` CORS default, `trustProxy`, and the `X-Powered-By` header. Read it before you write an `auth` hook or deploy.
35
+
18
36
  ## RestServer
19
37
 
20
38
  The `RestServer` class wraps an Express.js instance to provide:
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "stonyx-async",
5
5
  "stonyx-module"
6
6
  ],
7
- "version": "0.2.1-beta.150",
7
+ "version": "0.2.1-beta.152",
8
8
  "description": "Rest Server Module for Stonyx Framework",
9
9
  "repository": {
10
10
  "type": "git",
@@ -36,10 +36,10 @@
36
36
  "dependencies": {
37
37
  "cors": "^2.8.5",
38
38
  "express": "^5.1.0",
39
- "stonyx": "0.2.3-beta.100"
39
+ "stonyx": "0.2.3-beta.101"
40
40
  },
41
41
  "devDependencies": {
42
- "@stonyx/utils": "0.2.3-beta.27",
42
+ "@stonyx/utils": "0.2.3-beta.28",
43
43
  "@types/cors": "^2.8.17",
44
44
  "@types/express": "^5.0.6",
45
45
  "@types/node": "^25.5.2",