@stamprally/server 0.14.0 → 0.16.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 +10 -3
- package/dist/index.cjs +719 -155
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +80 -11
- package/dist/index.d.ts +80 -11
- package/dist/index.js +713 -156
- package/dist/index.js.map +1 -1
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @stamprally/server
|
|
1
|
+
# @stamprally/server v0.16.0
|
|
2
2
|
|
|
3
3
|
Web Standard `Request` / `Response` handlers for server-authoritative check-ins and reward claims.
|
|
4
4
|
|
|
@@ -16,8 +16,15 @@ const response = await server.handle(request);
|
|
|
16
16
|
HTTP check-in and reward-claim responses include an operation status: `ACCEPTED`,
|
|
17
17
|
`REJECTED_PERMANENT`, or `RETRYABLE_ERROR`. Clients can pass the response directly
|
|
18
18
|
to an `OfflineQueue` sender; the queue removes accepted/permanent operations and
|
|
19
|
-
retains retryable failures. The SQL transaction contract and all-or-nothing
|
|
20
|
-
are exported as `
|
|
19
|
+
retains retryable failures. The SQL transaction contract and all-or-nothing examples
|
|
20
|
+
for check-ins and claims are exported as `executeCheckInTransaction` and
|
|
21
|
+
`executeClaimRewardTransaction` from `src/examples/transaction.ts`. Redis adapters
|
|
22
|
+
can use the exported `executeRedisTransaction` helper to wrap a MULTI/EXEC batch.
|
|
23
|
+
|
|
24
|
+
Configure `anonymousPolicy: "session_scoped"` to use the UUID v4 from the
|
|
25
|
+
`X-Anonymous-Session-Id` header as the anonymous identity, or `"reject"` to return
|
|
26
|
+
HTTP 401 when no authenticated identity is present. Request validation failures use
|
|
27
|
+
HTTP 400 with `{ error: "VALIDATION_FAILED", details: [...] }`.
|
|
21
28
|
|
|
22
29
|
Hono can mount the handler directly because it accepts the same Web Standard request and response types.
|
|
23
30
|
|