@entifix/rest 0.23.26 → 0.23.28

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.
@@ -10,6 +10,14 @@ import type { BuildEntityRestOptions } from '../entity-rest/types.js';
10
10
  * body, so a screen shows the coded message rather than a generic error. A
11
11
  * verb that starts a flow answers `202 flowAccepted` and runs as pending; any
12
12
  * other success is settled with the `data` of what the service answered.
13
+ *
14
+ * ⚠️ **Every call carries its own `Idempotency-Key`.** A verb's route may be
15
+ * remembered at the edge (`idempotent: 'edge'`), and the shell refuses such a
16
+ * request without a key (`idempotencyKeyMissing`) — so a runner that sent none
17
+ * could reach no such verb at all, while a hermetic suite that stubs the
18
+ * service never noticed. The key is minted once per call, so a transport retry
19
+ * inside it is the same request; a second click is a second decision and gets
20
+ * a key of its own. A route that is not idempotent ignores the header.
13
21
  */
14
22
  export declare const makeEntityRestUseCaseRunner: <TEntity extends Entity>(entityConstructor: EntityConstructor<TEntity>, { uriConfig, configuration }: BuildEntityRestOptions) => EntityUseCaseRunner;
15
23
  //# sourceMappingURL=make-entity-rest-use-case-runner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"make-entity-rest-use-case-runner.d.ts","sourceRoot":"","sources":["../../../src/adapters/entity-use-case/make-entity-rest-use-case-runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,MAAM,EACX,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EAIzB,MAAM,eAAe,CAAC;AAMvB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEtE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,2BAA2B,GAAI,OAAO,SAAS,MAAM,EAChE,mBAAmB,iBAAiB,CAAC,OAAO,CAAC,EAC7C,8BAA8B,sBAAsB,KACnD,mBAuDF,CAAC"}
1
+ {"version":3,"file":"make-entity-rest-use-case-runner.d.ts","sourceRoot":"","sources":["../../../src/adapters/entity-use-case/make-entity-rest-use-case-runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,MAAM,EACX,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EAMzB,MAAM,eAAe,CAAC;AAMvB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEtE;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,2BAA2B,GAAI,OAAO,SAAS,MAAM,EAChE,mBAAmB,iBAAiB,CAAC,OAAO,CAAC,EAC7C,8BAA8B,sBAAsB,KACnD,mBA4DF,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { _ as _extends } from "@swc/helpers/_/_extends";
2
- import { extractMetaEntity, ProtocolFailure, toWireSelection } from '@entifix/core';
2
+ import { extractMetaEntity, formatIdempotencyKey, IDEMPOTENCY_KEY_HEADER, ProtocolFailure, toWireSelection } from '@entifix/core';
3
3
  import { Effect } from 'effect';
4
4
  import { performHttpRequestThroughFetch } from '../../clients/fetch/index.js';
5
5
  import { buildEntityRestAdapterMixins as adapterMixins } from '../entity-rest/build-entity-rest-adapter-mixins/index.js';
@@ -14,6 +14,14 @@ import { readWriteResponse } from '../entity-rest/read-write-response.js';
14
14
  * body, so a screen shows the coded message rather than a generic error. A
15
15
  * verb that starts a flow answers `202 flowAccepted` and runs as pending; any
16
16
  * other success is settled with the `data` of what the service answered.
17
+ *
18
+ * ⚠️ **Every call carries its own `Idempotency-Key`.** A verb's route may be
19
+ * remembered at the edge (`idempotent: 'edge'`), and the shell refuses such a
20
+ * request without a key (`idempotencyKeyMissing`) — so a runner that sent none
21
+ * could reach no such verb at all, while a hermetic suite that stubs the
22
+ * service never noticed. The key is minted once per call, so a transport retry
23
+ * inside it is the same request; a second click is a second decision and gets
24
+ * a key of its own. A route that is not idempotent ignores the header.
17
25
  */ export const makeEntityRestUseCaseRunner = (entityConstructor, { uriConfig, configuration })=>{
18
26
  var _metaEntity_key;
19
27
  const metaEntity = extractMetaEntity(entityConstructor);
@@ -21,16 +29,21 @@ import { readWriteResponse } from '../entity-rest/read-write-response.js';
21
29
  const baseUrl = (id)=>adapterMixins.buildEntityBaseUrl(configuration, {
22
30
  uriConfig
23
31
  }, name, id);
32
+ const keyed = ()=>({
33
+ [IDEMPOTENCY_KEY_HEADER]: formatIdempotencyKey(globalThis.crypto.randomUUID())
34
+ });
24
35
  return {
25
36
  run: (useCase, id, payload)=>Effect.gen(function*() {
26
37
  const url = yield* baseUrl(useCase.binding === 'entity' && id != null ? String(id) : undefined);
27
38
  const response = yield* performHttpRequestThroughFetch(_extends({
28
39
  method: 'POST',
29
40
  url: `${url}/${useCase.key}`
30
- }, payload === undefined ? {} : {
31
- headers: {
41
+ }, payload === undefined ? {
42
+ headers: keyed()
43
+ } : {
44
+ headers: _extends({}, keyed(), {
32
45
  'Content-Type': 'application/json'
33
- },
46
+ }),
34
47
  body: payload
35
48
  }));
36
49
  return yield* readWriteResponse(response, ()=>{
@@ -46,9 +59,9 @@ import { readWriteResponse } from '../entity-rest/read-write-response.js';
46
59
  const response = yield* performHttpRequestThroughFetch({
47
60
  method: 'POST',
48
61
  url: `${url}/${useCase.key}`,
49
- headers: {
62
+ headers: _extends({}, keyed(), {
50
63
  'Content-Type': 'application/json'
51
- },
64
+ }),
52
65
  body: {
53
66
  selection: toWireSelection(selection)
54
67
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/adapters/entity-use-case/make-entity-rest-use-case-runner.ts"],"sourcesContent":["import {\n type BulkOutcome,\n type Entity,\n type EntityConstructor,\n type EntityUseCaseRunner,\n extractMetaEntity,\n ProtocolFailure,\n toWireSelection,\n} from '@entifix/core';\nimport { Effect } from 'effect';\n\nimport { performHttpRequestThroughFetch } from '../../clients/fetch/index.js';\nimport { buildEntityRestAdapterMixins as adapterMixins } from '../entity-rest/build-entity-rest-adapter-mixins/index.js';\nimport { readWriteResponse } from '../entity-rest/read-write-response.js';\nimport type { BuildEntityRestOptions } from '../entity-rest/types.js';\n\n/**\n * Runs an entity's verbs against the service that serves them, at the path the\n * shell derives from each verb's key and binding — under the same base URL the\n * entity's other adapters use, so a same-origin proxy is followed the same way\n * ([ADR 0020](../../../../../../docs/adr/0020-endpoints-are-descriptors-and-the-shell-builds-an-httpapi.md)).\n *\n * A refusal arrives as the failure the service sent, decoded from its problem\n * body, so a screen shows the coded message rather than a generic error. A\n * verb that starts a flow answers `202 flowAccepted` and runs as pending; any\n * other success is settled with the `data` of what the service answered.\n */\nexport const makeEntityRestUseCaseRunner = <TEntity extends Entity>(\n entityConstructor: EntityConstructor<TEntity>,\n { uriConfig, configuration }: BuildEntityRestOptions,\n): EntityUseCaseRunner => {\n const metaEntity = extractMetaEntity(entityConstructor);\n const name = metaEntity.key ?? metaEntity.name;\n const baseUrl = (id?: string) =>\n adapterMixins.buildEntityBaseUrl(configuration, { uriConfig }, name, id);\n\n return {\n run: (useCase, id, payload) =>\n Effect.gen(function* () {\n const url = yield* baseUrl(\n useCase.binding === 'entity' && id != null ? String(id) : undefined,\n );\n const response = yield* performHttpRequestThroughFetch<{\n readonly data?: unknown;\n }>({\n method: 'POST',\n url: `${url}/${useCase.key}`,\n // A verb's input travels as its JSON body; a verb that takes none\n // is posted empty, as it always was.\n ...(payload === undefined\n ? {}\n : {\n headers: { 'Content-Type': 'application/json' },\n body: payload,\n }),\n });\n return yield* readWriteResponse(response, () =>\n Effect.succeed(response.body?.data),\n );\n }),\n bulk: (useCase, selection) =>\n Effect.gen(function* () {\n const url = yield* baseUrl();\n // The wire form, never the selection itself: a `Set` serializes to\n // `{}`, so a selection sent raw would lose its ids.\n const response = yield* performHttpRequestThroughFetch<{\n readonly data?: unknown;\n }>({\n method: 'POST',\n url: `${url}/${useCase.key}`,\n headers: { 'Content-Type': 'application/json' },\n body: { selection: toWireSelection(selection) },\n });\n // A bulk answer is a `bulkOutcome` envelope, one outcome per record in\n // its `data`; anything else is a peer speaking something else.\n const outcomes = response.body?.data;\n if (!Array.isArray(outcomes)) {\n return yield* new ProtocolFailure({\n reason:\n 'a bulk answer carries its outcomes in a bulkOutcome envelope',\n });\n }\n return outcomes as readonly BulkOutcome[];\n }),\n };\n};\n"],"names":["extractMetaEntity","ProtocolFailure","toWireSelection","Effect","performHttpRequestThroughFetch","buildEntityRestAdapterMixins","adapterMixins","readWriteResponse","makeEntityRestUseCaseRunner","entityConstructor","uriConfig","configuration","metaEntity","name","key","baseUrl","id","buildEntityBaseUrl","run","useCase","payload","gen","url","binding","String","undefined","response","method","headers","body","succeed","data","bulk","selection","outcomes","Array","isArray","reason"],"mappings":";AAAA,SAKEA,iBAAiB,EACjBC,eAAe,EACfC,eAAe,QACV,gBAAgB;AACvB,SAASC,MAAM,QAAQ,SAAS;AAEhC,SAASC,8BAA8B,QAAQ,+BAA+B;AAC9E,SAASC,gCAAgCC,aAAa,QAAQ,2DAA2D;AACzH,SAASC,iBAAiB,QAAQ,wCAAwC;AAG1E;;;;;;;;;;CAUC,GACD,OAAO,MAAMC,8BAA8B,CACzCC,mBACA,EAAEC,SAAS,EAAEC,aAAa,EAA0B;QAGvCC;IADb,MAAMA,aAAaZ,kBAAkBS;IACrC,MAAMI,QAAOD,kBAAAA,WAAWE,GAAG,YAAdF,kBAAkBA,WAAWC,IAAI;IAC9C,MAAME,UAAU,CAACC,KACfV,cAAcW,kBAAkB,CAACN,eAAe;YAAED;QAAU,GAAGG,MAAMG;IAEvE,OAAO;QACLE,KAAK,CAACC,SAASH,IAAII,UACjBjB,OAAOkB,GAAG,CAAC;gBACT,MAAMC,MAAM,OAAOP,QACjBI,QAAQI,OAAO,KAAK,YAAYP,MAAM,OAAOQ,OAAOR,MAAMS;gBAE5D,MAAMC,WAAW,OAAOtB,+BAErB;oBACDuB,QAAQ;oBACRL,KAAK,GAAGA,IAAI,CAAC,EAAEH,QAAQL,GAAG,EAAE;mBAGxBM,YAAYK,YACZ,CAAC,IACD;oBACEG,SAAS;wBAAE,gBAAgB;oBAAmB;oBAC9CC,MAAMT;gBACR;gBAEN,OAAO,OAAOb,kBAAkBmB,UAAU;wBACzBA;2BAAfvB,OAAO2B,OAAO,EAACJ,iBAAAA,SAASG,IAAI,qBAAbH,eAAeK,IAAI;;YAEtC;QACFC,MAAM,CAACb,SAASc,YACd9B,OAAOkB,GAAG,CAAC;oBAcQK;gBAbjB,MAAMJ,MAAM,OAAOP;gBACnB,mEAAmE;gBACnE,oDAAoD;gBACpD,MAAMW,WAAW,OAAOtB,+BAErB;oBACDuB,QAAQ;oBACRL,KAAK,GAAGA,IAAI,CAAC,EAAEH,QAAQL,GAAG,EAAE;oBAC5Bc,SAAS;wBAAE,gBAAgB;oBAAmB;oBAC9CC,MAAM;wBAAEI,WAAW/B,gBAAgB+B;oBAAW;gBAChD;gBACA,uEAAuE;gBACvE,+DAA+D;gBAC/D,MAAMC,YAAWR,iBAAAA,SAASG,IAAI,qBAAbH,eAAeK,IAAI;gBACpC,IAAI,CAACI,MAAMC,OAAO,CAACF,WAAW;oBAC5B,OAAO,OAAO,IAAIjC,gBAAgB;wBAChCoC,QACE;oBACJ;gBACF;gBACA,OAAOH;YACT;IACJ;AACF,EAAE"}
1
+ {"version":3,"sources":["../../../src/adapters/entity-use-case/make-entity-rest-use-case-runner.ts"],"sourcesContent":["import {\n type BulkOutcome,\n type Entity,\n type EntityConstructor,\n type EntityUseCaseRunner,\n extractMetaEntity,\n formatIdempotencyKey,\n IDEMPOTENCY_KEY_HEADER,\n ProtocolFailure,\n toWireSelection,\n} from '@entifix/core';\nimport { Effect } from 'effect';\n\nimport { performHttpRequestThroughFetch } from '../../clients/fetch/index.js';\nimport { buildEntityRestAdapterMixins as adapterMixins } from '../entity-rest/build-entity-rest-adapter-mixins/index.js';\nimport { readWriteResponse } from '../entity-rest/read-write-response.js';\nimport type { BuildEntityRestOptions } from '../entity-rest/types.js';\n\n/**\n * Runs an entity's verbs against the service that serves them, at the path the\n * shell derives from each verb's key and binding — under the same base URL the\n * entity's other adapters use, so a same-origin proxy is followed the same way\n * ([ADR 0020](../../../../../../docs/adr/0020-endpoints-are-descriptors-and-the-shell-builds-an-httpapi.md)).\n *\n * A refusal arrives as the failure the service sent, decoded from its problem\n * body, so a screen shows the coded message rather than a generic error. A\n * verb that starts a flow answers `202 flowAccepted` and runs as pending; any\n * other success is settled with the `data` of what the service answered.\n *\n * ⚠️ **Every call carries its own `Idempotency-Key`.** A verb's route may be\n * remembered at the edge (`idempotent: 'edge'`), and the shell refuses such a\n * request without a key (`idempotencyKeyMissing`) — so a runner that sent none\n * could reach no such verb at all, while a hermetic suite that stubs the\n * service never noticed. The key is minted once per call, so a transport retry\n * inside it is the same request; a second click is a second decision and gets\n * a key of its own. A route that is not idempotent ignores the header.\n */\nexport const makeEntityRestUseCaseRunner = <TEntity extends Entity>(\n entityConstructor: EntityConstructor<TEntity>,\n { uriConfig, configuration }: BuildEntityRestOptions,\n): EntityUseCaseRunner => {\n const metaEntity = extractMetaEntity(entityConstructor);\n const name = metaEntity.key ?? metaEntity.name;\n const baseUrl = (id?: string) =>\n adapterMixins.buildEntityBaseUrl(configuration, { uriConfig }, name, id);\n const keyed = () => ({\n [IDEMPOTENCY_KEY_HEADER]: formatIdempotencyKey(\n globalThis.crypto.randomUUID(),\n ),\n });\n\n return {\n run: (useCase, id, payload) =>\n Effect.gen(function* () {\n const url = yield* baseUrl(\n useCase.binding === 'entity' && id != null ? String(id) : undefined,\n );\n const response = yield* performHttpRequestThroughFetch<{\n readonly data?: unknown;\n }>({\n method: 'POST',\n url: `${url}/${useCase.key}`,\n // A verb's input travels as its JSON body; a verb that takes none\n // is posted empty, as it always was.\n ...(payload === undefined\n ? { headers: keyed() }\n : {\n headers: { ...keyed(), 'Content-Type': 'application/json' },\n body: payload,\n }),\n });\n return yield* readWriteResponse(response, () =>\n Effect.succeed(response.body?.data),\n );\n }),\n bulk: (useCase, selection) =>\n Effect.gen(function* () {\n const url = yield* baseUrl();\n // The wire form, never the selection itself: a `Set` serializes to\n // `{}`, so a selection sent raw would lose its ids.\n const response = yield* performHttpRequestThroughFetch<{\n readonly data?: unknown;\n }>({\n method: 'POST',\n url: `${url}/${useCase.key}`,\n headers: { ...keyed(), 'Content-Type': 'application/json' },\n body: { selection: toWireSelection(selection) },\n });\n // A bulk answer is a `bulkOutcome` envelope, one outcome per record in\n // its `data`; anything else is a peer speaking something else.\n const outcomes = response.body?.data;\n if (!Array.isArray(outcomes)) {\n return yield* new ProtocolFailure({\n reason:\n 'a bulk answer carries its outcomes in a bulkOutcome envelope',\n });\n }\n return outcomes as readonly BulkOutcome[];\n }),\n };\n};\n"],"names":["extractMetaEntity","formatIdempotencyKey","IDEMPOTENCY_KEY_HEADER","ProtocolFailure","toWireSelection","Effect","performHttpRequestThroughFetch","buildEntityRestAdapterMixins","adapterMixins","readWriteResponse","makeEntityRestUseCaseRunner","entityConstructor","uriConfig","configuration","metaEntity","name","key","baseUrl","id","buildEntityBaseUrl","keyed","globalThis","crypto","randomUUID","run","useCase","payload","gen","url","binding","String","undefined","response","method","headers","body","succeed","data","bulk","selection","outcomes","Array","isArray","reason"],"mappings":";AAAA,SAKEA,iBAAiB,EACjBC,oBAAoB,EACpBC,sBAAsB,EACtBC,eAAe,EACfC,eAAe,QACV,gBAAgB;AACvB,SAASC,MAAM,QAAQ,SAAS;AAEhC,SAASC,8BAA8B,QAAQ,+BAA+B;AAC9E,SAASC,gCAAgCC,aAAa,QAAQ,2DAA2D;AACzH,SAASC,iBAAiB,QAAQ,wCAAwC;AAG1E;;;;;;;;;;;;;;;;;;CAkBC,GACD,OAAO,MAAMC,8BAA8B,CACzCC,mBACA,EAAEC,SAAS,EAAEC,aAAa,EAA0B;QAGvCC;IADb,MAAMA,aAAad,kBAAkBW;IACrC,MAAMI,QAAOD,kBAAAA,WAAWE,GAAG,YAAdF,kBAAkBA,WAAWC,IAAI;IAC9C,MAAME,UAAU,CAACC,KACfV,cAAcW,kBAAkB,CAACN,eAAe;YAAED;QAAU,GAAGG,MAAMG;IACvE,MAAME,QAAQ,IAAO,CAAA;YACnB,CAAClB,uBAAuB,EAAED,qBACxBoB,WAAWC,MAAM,CAACC,UAAU;QAEhC,CAAA;IAEA,OAAO;QACLC,KAAK,CAACC,SAASP,IAAIQ,UACjBrB,OAAOsB,GAAG,CAAC;gBACT,MAAMC,MAAM,OAAOX,QACjBQ,QAAQI,OAAO,KAAK,YAAYX,MAAM,OAAOY,OAAOZ,MAAMa;gBAE5D,MAAMC,WAAW,OAAO1B,+BAErB;oBACD2B,QAAQ;oBACRL,KAAK,GAAGA,IAAI,CAAC,EAAEH,QAAQT,GAAG,EAAE;mBAGxBU,YAAYK,YACZ;oBAAEG,SAASd;gBAAQ,IACnB;oBACEc,SAAS,aAAKd;wBAAS,gBAAgB;;oBACvCe,MAAMT;gBACR;gBAEN,OAAO,OAAOjB,kBAAkBuB,UAAU;wBACzBA;2BAAf3B,OAAO+B,OAAO,EAACJ,iBAAAA,SAASG,IAAI,qBAAbH,eAAeK,IAAI;;YAEtC;QACFC,MAAM,CAACb,SAASc,YACdlC,OAAOsB,GAAG,CAAC;oBAcQK;gBAbjB,MAAMJ,MAAM,OAAOX;gBACnB,mEAAmE;gBACnE,oDAAoD;gBACpD,MAAMe,WAAW,OAAO1B,+BAErB;oBACD2B,QAAQ;oBACRL,KAAK,GAAGA,IAAI,CAAC,EAAEH,QAAQT,GAAG,EAAE;oBAC5BkB,SAAS,aAAKd;wBAAS,gBAAgB;;oBACvCe,MAAM;wBAAEI,WAAWnC,gBAAgBmC;oBAAW;gBAChD;gBACA,uEAAuE;gBACvE,+DAA+D;gBAC/D,MAAMC,YAAWR,iBAAAA,SAASG,IAAI,qBAAbH,eAAeK,IAAI;gBACpC,IAAI,CAACI,MAAMC,OAAO,CAACF,WAAW;oBAC5B,OAAO,OAAO,IAAIrC,gBAAgB;wBAChCwC,QACE;oBACJ;gBACF;gBACA,OAAOH;YACT;IACJ;AACF,EAAE"}
@@ -7,6 +7,11 @@ export interface ParticipantAddress {
7
7
  /** The crossing token this caller presents to that participant. */
8
8
  readonly crossingToken: Redacted.Redacted<string>;
9
9
  }
10
+ /**
11
+ * Whether an `HttpClient` failure proves the request never left: a URL or a
12
+ * body that could not be built, or a socket error from {@link UNSENT_CODES}.
13
+ */
14
+ export declare const requestNeverSent: (error: unknown) => boolean;
10
15
  /**
11
16
  * Calls participants over HTTP, as the slip pinned each step's call
12
17
  * ([ADR 0016](../../../../../docs/adr/0016-a-flow-engine-port-and-a-durable-workflow-adapter.md)):
@@ -15,7 +20,7 @@ export interface ParticipantAddress {
15
20
  * themselves as a flat JSON body — what the participant's own route declares,
16
21
  * never a wrapper of the flow's. A refusal decodes into the failure the participant
17
22
  * sent, by its code; a body that is not a problem is `protocol`; no answer at
18
- * all is `unavailable`. A step with no call — the commit point that names no
23
+ * all is `unavailable`, with `sent: false` when the request provably never left. A step with no call — the commit point that names no
19
24
  * participant — answers at once.
20
25
  */
21
26
  export declare const makeHttpParticipantClient: (client: HttpClient.HttpClient, participants: Readonly<Record<string, ParticipantAddress>>) => ParticipantClient;
@@ -1 +1 @@
1
- {"version":3,"file":"participant-client.d.ts","sourceRoot":"","sources":["../../src/endpoint/participant-client.ts"],"names":[],"mappings":"AAaA,OAAO,EAEL,KAAK,iBAAiB,EACtB,oBAAoB,EACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAU,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,EAAE,UAAU,EAAqB,MAAM,aAAa,CAAC;AAE5D,gEAAgE;AAChE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,mEAAmE;IACnE,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;CACnD;AAqBD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,yBAAyB,GACpC,QAAQ,UAAU,CAAC,UAAU,EAC7B,cAAc,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC,KACzD,iBA8DD,CAAC;AAEH,gEAAgE;AAChE,eAAO,MAAM,0BAA0B,GACrC,cAAc,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC,oEAOzD,CAAC"}
1
+ {"version":3,"file":"participant-client.d.ts","sourceRoot":"","sources":["../../src/endpoint/participant-client.ts"],"names":[],"mappings":"AAaA,OAAO,EAEL,KAAK,iBAAiB,EACtB,oBAAoB,EACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAU,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,EAAE,UAAU,EAAqB,MAAM,aAAa,CAAC;AAE5D,gEAAgE;AAChE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,mEAAmE;IACnE,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;CACnD;AAgDD;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAI,OAAO,OAAO,KAAG,OAMjD,CAAC;AAQF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,yBAAyB,GACpC,QAAQ,UAAU,CAAC,UAAU,EAC7B,cAAc,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC,KACzD,iBAoED,CAAC;AAEH,gEAAgE;AAChE,eAAO,MAAM,0BAA0B,GACrC,cAAc,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC,oEAOzD,CAAC"}
@@ -12,6 +12,35 @@ const parse = (text)=>{
12
12
  return undefined;
13
13
  }
14
14
  };
15
+ /**
16
+ * Socket errors raised before a single byte of the request was written: the
17
+ * participant refused the connection, or its name or route does not exist.
18
+ * A reset or a timeout is not here — the request may have arrived.
19
+ */ const UNSENT_CODES = new Set([
20
+ 'ECONNREFUSED',
21
+ 'ENOTFOUND',
22
+ 'EAI_AGAIN',
23
+ 'ENETUNREACH',
24
+ 'EHOSTUNREACH'
25
+ ]);
26
+ /** The error codes along a cause chain, outermost first, a bounded walk. */ const codesOf = (error)=>{
27
+ const codes = [];
28
+ let current = error;
29
+ for(let depth = 0; depth < 8 && typeof current === 'object' && current !== null; depth++){
30
+ const { code, cause, reason } = current;
31
+ if (typeof code === 'string') codes.push(code);
32
+ current = reason != null ? reason : cause;
33
+ }
34
+ return codes;
35
+ };
36
+ /**
37
+ * Whether an `HttpClient` failure proves the request never left: a URL or a
38
+ * body that could not be built, or a socket error from {@link UNSENT_CODES}.
39
+ */ export const requestNeverSent = (error)=>{
40
+ const reason = error.reason;
41
+ if ((reason == null ? void 0 : reason._tag) === 'InvalidUrlError' || (reason == null ? void 0 : reason._tag) === 'EncodeError') return true;
42
+ return codesOf(error).some((code)=>UNSENT_CODES.has(code));
43
+ };
15
44
  /** The step's path with each `:name` taken from the call's inputs. */ const pathOf = (call, path)=>path.replace(/:([A-Za-z0-9_]+)/g, (_match, name)=>{
16
45
  var _call_inputs_name;
17
46
  return encodeURIComponent(String((_call_inputs_name = call.inputs[name]) != null ? _call_inputs_name : ''));
@@ -24,7 +53,7 @@ const parse = (text)=>{
24
53
  * themselves as a flat JSON body — what the participant's own route declares,
25
54
  * never a wrapper of the flow's. A refusal decodes into the failure the participant
26
55
  * sent, by its code; a body that is not a problem is `protocol`; no answer at
27
- * all is `unavailable`. A step with no call — the commit point that names no
56
+ * all is `unavailable`, with `sent: false` when the request provably never left. A step with no call — the commit point that names no
28
57
  * participant — answers at once.
29
58
  */ export const makeHttpParticipantClient = (client, participants)=>({
30
59
  call: (request)=>Effect.gen(function*() {
@@ -50,7 +79,10 @@ const parse = (text)=>{
50
79
  } : {}, remaining === undefined ? {} : {
51
80
  [DEADLINE_HEADER]: String(remaining)
52
81
  })), target.method === 'GET' ? (outgoing)=>outgoing : HttpClientRequest.bodyText(JSON.stringify(request.inputs), 'application/json'));
53
- const response = yield* client.execute(outgoing).pipe(Effect.mapError(()=>new Unavailable({
82
+ const response = yield* client.execute(outgoing).pipe(Effect.mapError((error)=>requestNeverSent(error) ? new Unavailable({
83
+ dependency,
84
+ sent: false
85
+ }) : new Unavailable({
54
86
  dependency
55
87
  })));
56
88
  const text = yield* response.text.pipe(Effect.mapError(()=>new Unavailable({
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/endpoint/participant-client.ts"],"sourcesContent":["import {\n currentRemainingMs,\n DEADLINE_HEADER,\n decodeProblem,\n type EntifixFailure,\n formatIdempotencyKey,\n IDEMPOTENCY_KEY_HEADER,\n Internal,\n PROBLEM_CONTENT_TYPE,\n ProtocolFailure,\n Timeout,\n Unavailable,\n} from '@entifix/core';\nimport {\n type ParticipantCall,\n type ParticipantClient,\n ParticipantClientTag,\n} from '@entifix/transactions';\nimport { Effect, Layer, Redacted } from 'effect';\nimport { HttpClient, HttpClientRequest } from 'effect/http';\n\n/** Where one participant is reached, and the token it takes. */\nexport interface ParticipantAddress {\n readonly baseUrl: string;\n /** The crossing token this caller presents to that participant. */\n readonly crossingToken: Redacted.Redacted<string>;\n}\n\n/** The header a crossing token travels in. */\nconst CROSSING_TOKEN_HEADER = 'x-crossing-token';\n/** The header a crossing names the organization it acts for in. */\nconst ORGANIZATION_HEADER = 'x-organization-id';\n\nconst parse = (text: string): unknown => {\n try {\n return JSON.parse(text) as unknown;\n } catch {\n return undefined;\n }\n};\n\n/** The step's path with each `:name` taken from the call's inputs. */\nconst pathOf = (call: ParticipantCall, path: string) =>\n path.replace(/:([A-Za-z0-9_]+)/g, (_match, name: string) =>\n encodeURIComponent(String(call.inputs[name] ?? '')),\n );\n\n/**\n * Calls participants over HTTP, as the slip pinned each step's call\n * ([ADR 0016](../../../../../docs/adr/0016-a-flow-engine-port-and-a-durable-workflow-adapter.md)):\n * the crossing token the participant takes, the step's `Idempotency-Key`, the\n * flow's remaining deadline, the organization the inputs name, and the inputs\n * themselves as a flat JSON body — what the participant's own route declares,\n * never a wrapper of the flow's. A refusal decodes into the failure the participant\n * sent, by its code; a body that is not a problem is `protocol`; no answer at\n * all is `unavailable`. A step with no call — the commit point that names no\n * participant — answers at once.\n */\nexport const makeHttpParticipantClient = (\n client: HttpClient.HttpClient,\n participants: Readonly<Record<string, ParticipantAddress>>,\n): ParticipantClient => ({\n call: request =>\n Effect.gen(function* () {\n const target =\n request.kind === 'action'\n ? request.step.call\n : request.step.compensation;\n if (target === undefined) return undefined;\n const name = request.step.participant ?? '';\n const address = participants[name];\n if (address === undefined)\n return yield* Effect.fail(new Internal() as EntifixFailure);\n const dependency = `${name} ${target.method} ${target.path}`;\n\n const remaining = yield* currentRemainingMs;\n if (remaining === 0)\n return yield* Effect.fail(new Timeout({ dependency }));\n\n const organizationId = request.inputs['organizationId'];\n const outgoing = HttpClientRequest.make(target.method)(\n `${address.baseUrl}${pathOf(request, target.path)}`,\n ).pipe(\n HttpClientRequest.setHeaders({\n accept: 'application/json',\n [CROSSING_TOKEN_HEADER]: Redacted.value(address.crossingToken),\n [IDEMPOTENCY_KEY_HEADER]: formatIdempotencyKey(\n request.idempotencyKey,\n ),\n ...(typeof organizationId === 'string'\n ? { [ORGANIZATION_HEADER]: organizationId }\n : {}),\n ...(remaining === undefined\n ? {}\n : { [DEADLINE_HEADER]: String(remaining) }),\n }),\n target.method === 'GET'\n ? (outgoing: HttpClientRequest.HttpClientRequest) => outgoing\n : HttpClientRequest.bodyText(\n JSON.stringify(request.inputs),\n 'application/json',\n ),\n );\n\n const response = yield* client\n .execute(outgoing)\n .pipe(Effect.mapError(() => new Unavailable({ dependency })));\n const text = yield* response.text.pipe(\n Effect.mapError(() => new Unavailable({ dependency })),\n );\n if (response.status < 400) return text === '' ? undefined : parse(text);\n const isProblem =\n response.headers['content-type']?.startsWith(PROBLEM_CONTENT_TYPE) ===\n true;\n return yield* Effect.fail(\n isProblem\n ? decodeProblem(parse(text), response.status)\n : new ProtocolFailure({\n reason: `${dependency} answered ${String(response.status)} without a problem body`,\n upstreamStatus: response.status,\n }),\n );\n }),\n});\n\n/** The HTTP participant client over the host's `HttpClient`. */\nexport const HttpParticipantClientLayer = (\n participants: Readonly<Record<string, ParticipantAddress>>,\n) =>\n Layer.effect(\n ParticipantClientTag,\n Effect.map(HttpClient.HttpClient, client =>\n makeHttpParticipantClient(client, participants),\n ),\n );\n"],"names":["currentRemainingMs","DEADLINE_HEADER","decodeProblem","formatIdempotencyKey","IDEMPOTENCY_KEY_HEADER","Internal","PROBLEM_CONTENT_TYPE","ProtocolFailure","Timeout","Unavailable","ParticipantClientTag","Effect","Layer","Redacted","HttpClient","HttpClientRequest","CROSSING_TOKEN_HEADER","ORGANIZATION_HEADER","parse","text","JSON","undefined","pathOf","call","path","replace","_match","name","encodeURIComponent","String","inputs","makeHttpParticipantClient","client","participants","request","gen","response","target","kind","step","compensation","participant","address","fail","dependency","method","remaining","organizationId","outgoing","make","baseUrl","pipe","setHeaders","accept","value","crossingToken","idempotencyKey","bodyText","stringify","execute","mapError","status","isProblem","headers","startsWith","reason","upstreamStatus","HttpParticipantClientLayer","effect","map"],"mappings":";AAAA,SACEA,kBAAkB,EAClBC,eAAe,EACfC,aAAa,EAEbC,oBAAoB,EACpBC,sBAAsB,EACtBC,QAAQ,EACRC,oBAAoB,EACpBC,eAAe,EACfC,OAAO,EACPC,WAAW,QACN,gBAAgB;AACvB,SAGEC,oBAAoB,QACf,wBAAwB;AAC/B,SAASC,MAAM,EAAEC,KAAK,EAAEC,QAAQ,QAAQ,SAAS;AACjD,SAASC,UAAU,EAAEC,iBAAiB,QAAQ,cAAc;AAS5D,4CAA4C,GAC5C,MAAMC,wBAAwB;AAC9B,iEAAiE,GACjE,MAAMC,sBAAsB;AAE5B,MAAMC,QAAQ,CAACC;IACb,IAAI;QACF,OAAOC,KAAKF,KAAK,CAACC;IACpB,EAAE,eAAM;QACN,OAAOE;IACT;AACF;AAEA,oEAAoE,GACpE,MAAMC,SAAS,CAACC,MAAuBC,OACrCA,KAAKC,OAAO,CAAC,qBAAqB,CAACC,QAAQC;YACfJ;eAA1BK,mBAAmBC,QAAON,oBAAAA,KAAKO,MAAM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,OAAOiB;gBAAW,KAE7CT,OAAOQ,MAAM,KAAK,QACd,CAACG,WAAkDA,WACnDjC,kBAAkB0C,QAAQ,CACxBrC,KAAKsC,SAAS,CAACxB,QAAQJ,MAAM,GAC7B;gBAIR,MAAMM,WAAW,OAAOJ,OACrB2B,OAAO,CAACX,UACRG,IAAI,CAACxC,OAAOiD,QAAQ,CAAC,IAAM,IAAInD,YAAY;wBAAEmC;oBAAW;gBAC3D,MAAMzB,OAAO,OAAOiB,SAASjB,IAAI,CAACgC,IAAI,CACpCxC,OAAOiD,QAAQ,CAAC,IAAM,IAAInD,YAAY;wBAAEmC;oBAAW;gBAErD,IAAIR,SAASyB,MAAM,GAAG,KAAK,OAAO1C,SAAS,KAAKE,YAAYH,MAAMC;gBAClE,MAAM2C,YACJ1B,EAAAA,gCAAAA,SAAS2B,OAAO,CAAC,eAAe,qBAAhC3B,8BAAkC4B,UAAU,CAAC1D,2BAC7C;gBACF,OAAO,OAAOK,OAAOgC,IAAI,CACvBmB,YACI5D,cAAcgB,MAAMC,OAAOiB,SAASyB,MAAM,IAC1C,IAAItD,gBAAgB;oBAClB0D,QAAQ,GAAGrB,WAAW,UAAU,EAAEf,OAAOO,SAASyB,MAAM,EAAE,uBAAuB,CAAC;oBAClFK,gBAAgB9B,SAASyB,MAAM;gBACjC;YAER;IACJ,CAAA,EAAG;AAEH,8DAA8D,GAC9D,OAAO,MAAMM,6BAA6B,CACxClC,eAEArB,MAAMwD,MAAM,CACV1D,sBACAC,OAAO0D,GAAG,CAACvD,WAAWA,UAAU,EAAEkB,CAAAA,SAChCD,0BAA0BC,QAAQC,gBAEpC"}
1
+ {"version":3,"sources":["../../src/endpoint/participant-client.ts"],"sourcesContent":["import {\n currentRemainingMs,\n DEADLINE_HEADER,\n decodeProblem,\n type EntifixFailure,\n formatIdempotencyKey,\n IDEMPOTENCY_KEY_HEADER,\n Internal,\n PROBLEM_CONTENT_TYPE,\n ProtocolFailure,\n Timeout,\n Unavailable,\n} from '@entifix/core';\nimport {\n type ParticipantCall,\n type ParticipantClient,\n ParticipantClientTag,\n} from '@entifix/transactions';\nimport { Effect, Layer, Redacted } from 'effect';\nimport { HttpClient, HttpClientRequest } from 'effect/http';\n\n/** Where one participant is reached, and the token it takes. */\nexport interface ParticipantAddress {\n readonly baseUrl: string;\n /** The crossing token this caller presents to that participant. */\n readonly crossingToken: Redacted.Redacted<string>;\n}\n\n/** The header a crossing token travels in. */\nconst CROSSING_TOKEN_HEADER = 'x-crossing-token';\n/** The header a crossing names the organization it acts for in. */\nconst ORGANIZATION_HEADER = 'x-organization-id';\n\nconst parse = (text: string): unknown => {\n try {\n return JSON.parse(text) as unknown;\n } catch {\n return undefined;\n }\n};\n\n/**\n * Socket errors raised before a single byte of the request was written: the\n * participant refused the connection, or its name or route does not exist.\n * A reset or a timeout is not here — the request may have arrived.\n */\nconst UNSENT_CODES = new Set([\n 'ECONNREFUSED',\n 'ENOTFOUND',\n 'EAI_AGAIN',\n 'ENETUNREACH',\n 'EHOSTUNREACH',\n]);\n\n/** The error codes along a cause chain, outermost first, a bounded walk. */\nconst codesOf = (error: unknown): readonly string[] => {\n const codes: string[] = [];\n let current: unknown = error;\n for (\n let depth = 0;\n depth < 8 && typeof current === 'object' && current !== null;\n depth++\n ) {\n const { code, cause, reason } = current as {\n readonly code?: unknown;\n readonly cause?: unknown;\n readonly reason?: unknown;\n };\n if (typeof code === 'string') codes.push(code);\n current = reason ?? cause;\n }\n return codes;\n};\n\n/**\n * Whether an `HttpClient` failure proves the request never left: a URL or a\n * body that could not be built, or a socket error from {@link UNSENT_CODES}.\n */\nexport const requestNeverSent = (error: unknown): boolean => {\n const reason = (error as { readonly reason?: { readonly _tag?: unknown } })\n .reason;\n if (reason?._tag === 'InvalidUrlError' || reason?._tag === 'EncodeError')\n return true;\n return codesOf(error).some(code => UNSENT_CODES.has(code));\n};\n\n/** The step's path with each `:name` taken from the call's inputs. */\nconst pathOf = (call: ParticipantCall, path: string) =>\n path.replace(/:([A-Za-z0-9_]+)/g, (_match, name: string) =>\n encodeURIComponent(String(call.inputs[name] ?? '')),\n );\n\n/**\n * Calls participants over HTTP, as the slip pinned each step's call\n * ([ADR 0016](../../../../../docs/adr/0016-a-flow-engine-port-and-a-durable-workflow-adapter.md)):\n * the crossing token the participant takes, the step's `Idempotency-Key`, the\n * flow's remaining deadline, the organization the inputs name, and the inputs\n * themselves as a flat JSON body — what the participant's own route declares,\n * never a wrapper of the flow's. A refusal decodes into the failure the participant\n * sent, by its code; a body that is not a problem is `protocol`; no answer at\n * all is `unavailable`, with `sent: false` when the request provably never left. A step with no call — the commit point that names no\n * participant — answers at once.\n */\nexport const makeHttpParticipantClient = (\n client: HttpClient.HttpClient,\n participants: Readonly<Record<string, ParticipantAddress>>,\n): ParticipantClient => ({\n call: request =>\n Effect.gen(function* () {\n const target =\n request.kind === 'action'\n ? request.step.call\n : request.step.compensation;\n if (target === undefined) return undefined;\n const name = request.step.participant ?? '';\n const address = participants[name];\n if (address === undefined)\n return yield* Effect.fail(new Internal() as EntifixFailure);\n const dependency = `${name} ${target.method} ${target.path}`;\n\n const remaining = yield* currentRemainingMs;\n if (remaining === 0)\n return yield* Effect.fail(new Timeout({ dependency }));\n\n const organizationId = request.inputs['organizationId'];\n const outgoing = HttpClientRequest.make(target.method)(\n `${address.baseUrl}${pathOf(request, target.path)}`,\n ).pipe(\n HttpClientRequest.setHeaders({\n accept: 'application/json',\n [CROSSING_TOKEN_HEADER]: Redacted.value(address.crossingToken),\n [IDEMPOTENCY_KEY_HEADER]: formatIdempotencyKey(\n request.idempotencyKey,\n ),\n ...(typeof organizationId === 'string'\n ? { [ORGANIZATION_HEADER]: organizationId }\n : {}),\n ...(remaining === undefined\n ? {}\n : { [DEADLINE_HEADER]: String(remaining) }),\n }),\n target.method === 'GET'\n ? (outgoing: HttpClientRequest.HttpClientRequest) => outgoing\n : HttpClientRequest.bodyText(\n JSON.stringify(request.inputs),\n 'application/json',\n ),\n );\n\n const response = yield* client\n .execute(outgoing)\n .pipe(\n Effect.mapError(error =>\n requestNeverSent(error)\n ? new Unavailable({ dependency, sent: false })\n : new Unavailable({ dependency }),\n ),\n );\n const text = yield* response.text.pipe(\n Effect.mapError(() => new Unavailable({ dependency })),\n );\n if (response.status < 400) return text === '' ? undefined : parse(text);\n const isProblem =\n response.headers['content-type']?.startsWith(PROBLEM_CONTENT_TYPE) ===\n true;\n return yield* Effect.fail(\n isProblem\n ? decodeProblem(parse(text), response.status)\n : new ProtocolFailure({\n reason: `${dependency} answered ${String(response.status)} without a problem body`,\n upstreamStatus: response.status,\n }),\n );\n }),\n});\n\n/** The HTTP participant client over the host's `HttpClient`. */\nexport const HttpParticipantClientLayer = (\n participants: Readonly<Record<string, ParticipantAddress>>,\n) =>\n Layer.effect(\n ParticipantClientTag,\n Effect.map(HttpClient.HttpClient, client =>\n makeHttpParticipantClient(client, participants),\n ),\n );\n"],"names":["currentRemainingMs","DEADLINE_HEADER","decodeProblem","formatIdempotencyKey","IDEMPOTENCY_KEY_HEADER","Internal","PROBLEM_CONTENT_TYPE","ProtocolFailure","Timeout","Unavailable","ParticipantClientTag","Effect","Layer","Redacted","HttpClient","HttpClientRequest","CROSSING_TOKEN_HEADER","ORGANIZATION_HEADER","parse","text","JSON","undefined","UNSENT_CODES","Set","codesOf","error","codes","current","depth","code","cause","reason","push","requestNeverSent","_tag","some","has","pathOf","call","path","replace","_match","name","encodeURIComponent","String","inputs","makeHttpParticipantClient","client","participants","request","gen","response","target","kind","step","compensation","participant","address","fail","dependency","method","remaining","organizationId","outgoing","make","baseUrl","pipe","setHeaders","accept","value","crossingToken","idempotencyKey","bodyText","stringify","execute","mapError","sent","status","isProblem","headers","startsWith","upstreamStatus","HttpParticipantClientLayer","effect","map"],"mappings":";AAAA,SACEA,kBAAkB,EAClBC,eAAe,EACfC,aAAa,EAEbC,oBAAoB,EACpBC,sBAAsB,EACtBC,QAAQ,EACRC,oBAAoB,EACpBC,eAAe,EACfC,OAAO,EACPC,WAAW,QACN,gBA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ACG,WAAkDA,WACnDhD,kBAAkByD,QAAQ,CACxBpD,KAAKqD,SAAS,CAACxB,QAAQJ,MAAM,GAC7B;gBAIR,MAAMM,WAAW,OAAOJ,OACrB2B,OAAO,CAACX,UACRG,IAAI,CACHvD,OAAOgE,QAAQ,CAAClD,CAAAA,QACdQ,iBAAiBR,SACb,IAAIhB,YAAY;wBAAEkD;wBAAYiB,MAAM;oBAAM,KAC1C,IAAInE,YAAY;wBAAEkD;oBAAW;gBAGvC,MAAMxC,OAAO,OAAOgC,SAAShC,IAAI,CAAC+C,IAAI,CACpCvD,OAAOgE,QAAQ,CAAC,IAAM,IAAIlE,YAAY;wBAAEkD;oBAAW;gBAErD,IAAIR,SAAS0B,MAAM,GAAG,KAAK,OAAO1D,SAAS,KAAKE,YAAYH,MAAMC;gBAClE,MAAM2D,YACJ3B,EAAAA,gCAAAA,SAAS4B,OAAO,CAAC,eAAe,qBAAhC5B,8BAAkC6B,UAAU,CAAC1E,2BAC7C;gBACF,OAAO,OAAOK,OAAO+C,IAAI,CACvBoB,YACI5E,cAAcgB,MAAMC,OAAOgC,SAAS0B,MAAM,IAC1C,IAAItE,gBAAgB;oBAClBwB,QAAQ,GAAG4B,WAAW,UAAU,EAAEf,OAAOO,SAAS0B,MAAM,EAAE,uBAAuB,CAAC;oBAClFI,gBAAgB9B,SAAS0B,MAAM;gBACjC;YAER;IACJ,CAAA,EAAG;AAEH,8DAA8D,GAC9D,OAAO,MAAMK,6BAA6B,CACxClC,eAEApC,MAAMuE,MAAM,CACVzE,sBACAC,OAAOyE,GAAG,CAACtE,WAAWA,UAAU,EAAEiC,CAAAA,SAChCD,0BAA0BC,QAAQC,gBAEpC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@entifix/rest",
3
- "version": "0.23.26",
3
+ "version": "0.23.28",
4
4
  "description": "HTTP entity adapter for the browser: get, load, save and delete against an entifix service, plus served metadata and transaction status.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -56,12 +56,12 @@
56
56
  },
57
57
  "dependencies": {
58
58
  "@swc/helpers": "0.5.23",
59
- "@entifix/core": "0.23.26",
60
- "@entifix/transactions": "0.23.26"
59
+ "@entifix/core": "0.23.28",
60
+ "@entifix/transactions": "0.23.28"
61
61
  },
62
62
  "devDependencies": {
63
63
  "effect": "4.0.7",
64
- "@entifix/testing-unit": "0.23.26"
64
+ "@entifix/testing-unit": "0.23.28"
65
65
  },
66
66
  "peerDependencies": {
67
67
  "effect": "^4.0.7"