@forgezero/access 0.1.9 → 0.1.11

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 CHANGED
@@ -555,7 +555,7 @@ Each condition knows which statuses it can produce, so the set a route can answe
555
555
  ```text
556
556
  assertDeclaredRefusals({ routes: ROUTES, conditions: CONDITIONS });
557
557
  // Undeclared refusals:
558
- // api/wallet/withdraw can 409 (requireQuota) but does not declare it
558
+ // api/compute/allocate can 409 (requireQuota) but does not declare it
559
559
  ```
560
560
 
561
561
  ## Effects: what happens once it is decided
@@ -88,7 +88,7 @@ export interface RequireStateOptions<K extends string> extends Routes<K> {
88
88
  /**
89
89
  * The record is in a status this transition accepts, or 409.
90
90
  *
91
- * The guard that stops a withdrawal being approved twice, an invoice being
91
+ * The guard that stops a allocation being approved twice, an invoice being
92
92
  * settled after it was voided, a ceremony activating from a state it never
93
93
  * reached. Checking status inside the handler works right up to the second
94
94
  * concurrent request, and this at least fails them both loudly and with the
@@ -139,7 +139,7 @@ export interface RequireIdempotencyOptions<K extends string> extends Routes<K> {
139
139
  *
140
140
  * A retry after a timeout is not a client bug — it is what every HTTP client and
141
141
  * every mobile network does. Without a claim the second attempt places a second
142
- * order, and the user sees one confirmation for two withdrawals.
142
+ * order, and the user sees one confirmation for two allocations.
143
143
  *
144
144
  * A replay throws `Settled`, so the caller gets the ORIGINAL answer rather than
145
145
  * an error. A 409 would be defensible and useless: a retrying client still would
@@ -217,7 +217,7 @@ export interface RequireBalanceOptions<K extends string> extends Routes<K> {
217
217
  * finding that later.
218
218
  *
219
219
  * This checks AVAILABLE — free of holds — not total. A balance check against
220
- * total lets two concurrent withdrawals each pass and the second overdraws.
220
+ * total lets two concurrent allocations each pass and the second overdraws.
221
221
  */
222
222
  export declare function requireBalance<K extends string>(options: RequireBalanceOptions<K>): Condition<K>;
223
223
  export interface RequireQuotaOptions<K extends string> extends Routes<K> {
@@ -232,7 +232,7 @@ export interface RequireQuotaOptions<K extends string> extends Routes<K> {
232
232
  * A value cap over a window, which is NOT a rate limit.
233
233
  *
234
234
  * Rate limiting counts requests and protects the service; a quota counts value
235
- * and protects the account. One withdrawal of the entire balance passes every
235
+ * and protects the account. One allocation of the entire balance passes every
236
236
  * rate limit ever written. They also fail differently — 429 means slow down,
237
237
  * this means the answer will be the same until the window rolls — so they get
238
238
  * different codes and the reset time is in the payload.
@@ -252,7 +252,7 @@ export interface RequireApprovalOptions<K extends string> extends Routes<K> {
252
252
  *
253
253
  * Action factors make the actor prove themselves freshly. This makes a second
254
254
  * party sign off, and no amount of the first kind substitutes for the second:
255
- * that is the entire point of four-eyes on a large withdrawal or a custodian
255
+ * that is the entire point of four-eyes on a large allocation or a custodian
256
256
  * change. Two mechanisms because they answer different questions, and merging
257
257
  * them would let a sufficiently authenticated operator approve their own move.
258
258
  */
@@ -260,7 +260,7 @@ export declare function requireApproval<K extends string>(options: RequireApprov
260
260
  /**
261
261
  * Every status a route's conditions can throw is declared in its contract.
262
262
  *
263
- * The drift this catches: somebody adds `requireQuota` to a withdrawal route,
263
+ * The drift this catches: somebody adds `requireQuota` to a allocation route,
264
264
  * the generated client never learns 409 is possible, and the UI renders "an
265
265
  * unexpected error occurred" for the one refusal a user can actually act on.
266
266
  * Cheap to check, invisible until a customer hits it.
@@ -275,7 +275,7 @@ function impactOfDisabling(access, enabledAfter) {
275
275
  }
276
276
  return broken;
277
277
  }
278
- var VERSION = "0.1.9";
278
+ var VERSION = "0.1.11";
279
279
 
280
280
  // src/conditions.ts
281
281
  function define(condition, routes, refusals, run) {
package/dist/effects.d.ts CHANGED
@@ -10,7 +10,7 @@ import { type AfterHandler, type RequestContext } from './index';
10
10
  *
11
11
  * 1. **It cannot fail the request.** The pipeline queues after-handlers and
12
12
  * swallows throws, and these swallow their own too. An audit sink being down
13
- * must not turn a successful withdrawal into a 500 — the money already moved.
13
+ * must not turn a successful allocation into a 500 — the money already moved.
14
14
  *
15
15
  * 2. **It runs on refusals as well.** The pipeline calls the chain even when a
16
16
  * `before` threw, because a log missing every denied request is missing
@@ -160,7 +160,7 @@ export interface NotifyOptions<K extends string> extends Routes<K> {
160
160
  /**
161
161
  * Tell somebody. Queued like every effect, never awaited.
162
162
  *
163
- * `onDenied` exists for one real case: a failed sign-in or a refused withdrawal
163
+ * `onDenied` exists for one real case: a failed sign-in or a refused allocation
164
164
  * is exactly what the account holder wants to hear about, and it is the only
165
165
  * signal they get that somebody else has their password.
166
166
  */
package/dist/effects.js CHANGED
@@ -275,7 +275,7 @@ function impactOfDisabling(access, enabledAfter) {
275
275
  }
276
276
  return broken;
277
277
  }
278
- var VERSION = "0.1.9";
278
+ var VERSION = "0.1.11";
279
279
 
280
280
  // src/security.ts
281
281
  var HEX = Array.from({ length: 256 }, (_, index) => index.toString(16).padStart(2, "0"));
package/dist/elysia.js CHANGED
@@ -275,7 +275,7 @@ function impactOfDisabling(access, enabledAfter) {
275
275
  }
276
276
  return broken;
277
277
  }
278
- var VERSION = "0.1.9";
278
+ var VERSION = "0.1.11";
279
279
 
280
280
  // src/pipeline.ts
281
281
  function defineHandlers(routes, handlers) {
package/dist/fetch.js CHANGED
@@ -275,7 +275,7 @@ function impactOfDisabling(access, enabledAfter) {
275
275
  }
276
276
  return broken;
277
277
  }
278
- var VERSION = "0.1.9";
278
+ var VERSION = "0.1.11";
279
279
 
280
280
  // src/pipeline.ts
281
281
  function defineHandlers(routes, handlers) {
package/dist/header.js CHANGED
@@ -275,7 +275,7 @@ function impactOfDisabling(access, enabledAfter) {
275
275
  }
276
276
  return broken;
277
277
  }
278
- var VERSION = "0.1.9";
278
+ var VERSION = "0.1.11";
279
279
 
280
280
  // src/principal.ts
281
281
  var ATOM = /^[A-Za-z0-9][A-Za-z0-9_.:@/-]{0,255}$/;
package/dist/index.d.ts CHANGED
@@ -49,7 +49,7 @@ export declare class AccessError extends Error {
49
49
  * A condition refusing the request, with the status it deserves.
50
50
  *
51
51
  * Without this every guard in a `before` chain collapsed to 500, which is a lie:
52
- * "this withdrawal is already approved" is a 409 the client can act on, and a
52
+ * "this allocation is already approved" is a 409 the client can act on, and a
53
53
  * 500 tells it to retry — which is precisely the wrong thing to do with money.
54
54
  *
55
55
  * `retryable` is stated rather than inferred from the status. 409 is permanent
@@ -379,4 +379,4 @@ export declare function impactOfDisabling<R extends RouteRegistry>(access: Acces
379
379
  available: number;
380
380
  required: number;
381
381
  }[];
382
- export declare const VERSION = "0.1.9";
382
+ export declare const VERSION = "0.1.11";
package/dist/index.js CHANGED
@@ -275,7 +275,7 @@ function impactOfDisabling(access, enabledAfter) {
275
275
  }
276
276
  return broken;
277
277
  }
278
- var VERSION = "0.1.9";
278
+ var VERSION = "0.1.11";
279
279
  export {
280
280
  stemOf,
281
281
  resolveActionFactors,
package/dist/pipeline.js CHANGED
@@ -275,7 +275,7 @@ function impactOfDisabling(access, enabledAfter) {
275
275
  }
276
276
  return broken;
277
277
  }
278
- var VERSION = "0.1.9";
278
+ var VERSION = "0.1.11";
279
279
 
280
280
  // src/pipeline.ts
281
281
  function defineHandlers(routes, handlers) {
@@ -275,7 +275,7 @@ function impactOfDisabling(access, enabledAfter) {
275
275
  }
276
276
  return broken;
277
277
  }
278
- var VERSION = "0.1.9";
278
+ var VERSION = "0.1.11";
279
279
 
280
280
  // src/security.ts
281
281
  var HEX = Array.from({ length: 256 }, (_, index) => index.toString(16).padStart(2, "0"));
package/dist/principal.js CHANGED
@@ -275,7 +275,7 @@ function impactOfDisabling(access, enabledAfter) {
275
275
  }
276
276
  return broken;
277
277
  }
278
- var VERSION = "0.1.9";
278
+ var VERSION = "0.1.11";
279
279
 
280
280
  // src/principal.ts
281
281
  var ATOM = /^[A-Za-z0-9][A-Za-z0-9_.:@/-]{0,255}$/;
package/dist/testing.js CHANGED
@@ -275,7 +275,7 @@ function impactOfDisabling(access, enabledAfter) {
275
275
  }
276
276
  return broken;
277
277
  }
278
- var VERSION = "0.1.9";
278
+ var VERSION = "0.1.11";
279
279
 
280
280
  // src/testing.ts
281
281
  function nameOf(policies, route) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgezero/access",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",