@rotorsoft/act-http 1.10.16 → 1.10.17
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/dist/.tsbuildinfo +1 -1
- package/dist/@types/api/in-flight.d.ts.map +1 -1
- package/dist/@types/receiver/start.d.ts.map +1 -1
- package/dist/api/index.js +2 -2
- package/dist/{chunk-FXVWAQ2D.js → chunk-EERALS5E.js} +10 -1
- package/dist/chunk-EERALS5E.js.map +1 -0
- package/dist/{chunk-IEIEJXV7.js → chunk-SAN4VJ7A.js} +4 -4
- package/dist/hono/index.cjs +9 -0
- package/dist/hono/index.cjs.map +1 -1
- package/dist/hono/index.js +3 -3
- package/dist/receiver/index.cjs +21 -4
- package/dist/receiver/index.cjs.map +1 -1
- package/dist/receiver/index.js +13 -5
- package/dist/receiver/index.js.map +1 -1
- package/dist/trpc/index.cjs +9 -0
- package/dist/trpc/index.cjs.map +1 -1
- package/dist/trpc/index.js +5 -5
- package/package.json +2 -2
- package/dist/chunk-FXVWAQ2D.js.map +0 -1
- /package/dist/{chunk-IEIEJXV7.js.map → chunk-SAN4VJ7A.js.map} +0 -0
package/dist/trpc/index.js
CHANGED
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
runSseSubscription,
|
|
5
5
|
toApiError,
|
|
6
6
|
withIdempotency
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import {
|
|
9
|
-
track_in_flight
|
|
10
|
-
} from "../chunk-FXVWAQ2D.js";
|
|
11
|
-
import "../chunk-MKD3SM3N.js";
|
|
7
|
+
} from "../chunk-SAN4VJ7A.js";
|
|
12
8
|
import {
|
|
13
9
|
external_exports
|
|
14
10
|
} from "../chunk-DLLWIJUQ.js";
|
|
11
|
+
import {
|
|
12
|
+
track_in_flight
|
|
13
|
+
} from "../chunk-EERALS5E.js";
|
|
14
|
+
import "../chunk-MKD3SM3N.js";
|
|
15
15
|
import "../chunk-PZ5AY32C.js";
|
|
16
16
|
|
|
17
17
|
// src/trpc/index.ts
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rotorsoft/act-http",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.10.
|
|
4
|
+
"version": "1.10.17",
|
|
5
5
|
"description": "HTTP integrations for act apps — webhooks and SSE",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"typescript",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
},
|
|
92
92
|
"peerDependencies": {
|
|
93
93
|
"@hono/node-server": "^2.1.3",
|
|
94
|
-
"@rotorsoft/act": "^1.32.
|
|
94
|
+
"@rotorsoft/act": "^1.32.11",
|
|
95
95
|
"@rotorsoft/act-ops": "^0.2.10",
|
|
96
96
|
"@trpc/server": ">=11.19.0",
|
|
97
97
|
"express": "^5.2.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api/in-flight.ts"],"sourcesContent":["/**\n * @module act-http/api/in-flight\n *\n * Tells a duplicate of a delivery that is still running apart from a\n * duplicate of one that already succeeded. An {@link IdempotencyStore}\n * can't: its `claim` returns `false` in both cases. Answering the first\n * \"accepted, stop retrying\" loses the delivery if the original then fails\n * and releases the key, so the receiver and the generated API both ask\n * the sender to retry while the original is in flight.\n *\n * Internal — not re-exported from the package. Process-local, which\n * matches `InMemoryIdempotencyStore`'s single-process scope.\n */\nimport type { IdempotencyStore } from \"@rotorsoft/act-ops/idempotency\";\n\n/** A wrapped store plus the in-flight check it maintains. @internal */\nexport type InFlightTracker = {\n /** Pass this to the code that claims, commits, and releases. */\n readonly store: IdempotencyStore;\n /**\n * True while a claim on `key` is pending, or was won and is not yet\n * committed or released. Read it after your own claim lost.\n */\n in_flight(key: string): boolean;\n};\n\n/**\n * Wraps `store` so claims are counted per key. A key is counted **before**\n * the claim is awaited, not when its reply arrives: with an async store\n * the loser's `false` can arrive before the winner's `true`, and marking\n * only on the winner's reply would leave the loser a window to see the key\n * unmarked and be answered as a settled duplicate. A claim that loses (or\n * throws) uncounts itself at once; a claim that wins stays counted until\n * its commit or release lands.\n *\n * A concurrent duplicate of an already-committed key can therefore read\n * as in flight while another duplicate's claim is pending. That costs one\n * extra retry, never a lost delivery.\n *\n * @internal\n */\nexport function track_in_flight(store: IdempotencyStore): InFlightTracker {\n const pending = new Map<string, number>();\n const up = (key: string) => pending.set(key, (pending.get(key) ?? 0) + 1);\n const down = (key: string) => {\n const left = (pending.get(key) ?? 0) - 1;\n if (left > 0) pending.set(key, left);\n else pending.delete(key);\n };\n const settle = (key: string, won: boolean) => {\n if (!won) down(key);\n return won;\n };\n return {\n in_flight: (key) => pending.has(key),\n store: {\n claim(key, now) {\n up(key);\n let won: boolean | Promise<boolean>;\n try {\n won = store.claim(key, now);\n } catch (err) {\n down(key);\n throw err;\n }\n return typeof won === \"boolean\"\n ? settle(key, won)\n : won.then(\n (w) => settle(key, w),\n (err: unknown) => {\n down(key);\n throw err;\n }\n );\n },\n async commit(key, now) {\n try {\n await store.commit(key, now);\n } finally {\n down(key);\n }\n },\n async release(key) {\n try {\n await store.release(key);\n } finally {\n down(key);\n }\n },\n },\n };\n}\n"],"mappings":";AAyCO,SAAS,gBAAgB,OAA0C;AACxE,QAAM,UAAU,oBAAI,IAAoB;AACxC,QAAM,KAAK,CAAC,QAAgB,QAAQ,IAAI,MAAM,QAAQ,IAAI,GAAG,KAAK,KAAK,CAAC;AACxE,QAAM,OAAO,CAAC,QAAgB;AAC5B,UAAM,QAAQ,QAAQ,IAAI,GAAG,KAAK,KAAK;AACvC,QAAI,OAAO,EAAG,SAAQ,IAAI,KAAK,IAAI;AAAA,QAC9B,SAAQ,OAAO,GAAG;AAAA,EACzB;AACA,QAAM,SAAS,CAAC,KAAa,QAAiB;AAC5C,QAAI,CAAC,IAAK,MAAK,GAAG;AAClB,WAAO;AAAA,EACT;AACA,SAAO;AAAA,IACL,WAAW,CAAC,QAAQ,QAAQ,IAAI,GAAG;AAAA,IACnC,OAAO;AAAA,MACL,MAAM,KAAK,KAAK;AACd,WAAG,GAAG;AACN,YAAI;AACJ,YAAI;AACF,gBAAM,MAAM,MAAM,KAAK,GAAG;AAAA,QAC5B,SAAS,KAAK;AACZ,eAAK,GAAG;AACR,gBAAM;AAAA,QACR;AACA,eAAO,OAAO,QAAQ,YAClB,OAAO,KAAK,GAAG,IACf,IAAI;AAAA,UACF,CAAC,MAAM,OAAO,KAAK,CAAC;AAAA,UACpB,CAAC,QAAiB;AAChB,iBAAK,GAAG;AACR,kBAAM;AAAA,UACR;AAAA,QACF;AAAA,MACN;AAAA,MACA,MAAM,OAAO,KAAK,KAAK;AACrB,YAAI;AACF,gBAAM,MAAM,OAAO,KAAK,GAAG;AAAA,QAC7B,UAAE;AACA,eAAK,GAAG;AAAA,QACV;AAAA,MACF;AAAA,MACA,MAAM,QAAQ,KAAK;AACjB,YAAI;AACF,gBAAM,MAAM,QAAQ,GAAG;AAAA,QACzB,UAAE;AACA,eAAK,GAAG;AAAA,QACV;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
|
File without changes
|