@entifix/rest 0.8.0 → 0.10.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 +7 -3
- package/dist/adapters/entity-metadata/make-entity-metadata-source/make-entity-metadata-source.d.ts.map +1 -1
- package/dist/adapters/entity-metadata/make-entity-metadata-source/make-entity-metadata-source.js +6 -9
- package/dist/adapters/entity-metadata/make-entity-metadata-source/make-entity-metadata-source.js.map +1 -1
- package/dist/adapters/entity-rest/build-entity-rest-adapter-delete/build-entity-rest-adapter-delete.d.ts +1 -1
- package/dist/adapters/entity-rest/build-entity-rest-adapter-delete/build-entity-rest-adapter-delete.d.ts.map +1 -1
- package/dist/adapters/entity-rest/build-entity-rest-adapter-delete/build-entity-rest-adapter-delete.js +2 -4
- package/dist/adapters/entity-rest/build-entity-rest-adapter-delete/build-entity-rest-adapter-delete.js.map +1 -1
- package/dist/adapters/entity-rest/build-entity-rest-adapter-facets/build-entity-rest-adapter-facets.d.ts +11 -0
- package/dist/adapters/entity-rest/build-entity-rest-adapter-facets/build-entity-rest-adapter-facets.d.ts.map +1 -0
- package/dist/adapters/entity-rest/build-entity-rest-adapter-facets/build-entity-rest-adapter-facets.js +25 -0
- package/dist/adapters/entity-rest/build-entity-rest-adapter-facets/build-entity-rest-adapter-facets.js.map +1 -0
- package/dist/adapters/entity-rest/build-entity-rest-adapter-facets/index.d.ts +2 -0
- package/dist/adapters/entity-rest/build-entity-rest-adapter-facets/index.d.ts.map +1 -0
- package/dist/adapters/entity-rest/build-entity-rest-adapter-facets/index.js +3 -0
- package/dist/adapters/entity-rest/build-entity-rest-adapter-facets/index.js.map +1 -0
- package/dist/adapters/entity-rest/build-entity-rest-adapter-get/build-entity-rest-adapter-get.d.ts +1 -1
- package/dist/adapters/entity-rest/build-entity-rest-adapter-get/build-entity-rest-adapter-get.d.ts.map +1 -1
- package/dist/adapters/entity-rest/build-entity-rest-adapter-load/build-entity-rest-adapter-load.d.ts +1 -1
- package/dist/adapters/entity-rest/build-entity-rest-adapter-load/build-entity-rest-adapter-load.d.ts.map +1 -1
- package/dist/adapters/entity-rest/build-entity-rest-adapter-save/build-entity-rest-adapter-save.d.ts +1 -1
- package/dist/adapters/entity-rest/build-entity-rest-adapter-save/build-entity-rest-adapter-save.d.ts.map +1 -1
- package/dist/adapters/transaction-status/build-transaction-status-reader/build-transaction-status-reader.d.ts +0 -17
- package/dist/adapters/transaction-status/build-transaction-status-reader/build-transaction-status-reader.d.ts.map +1 -1
- package/dist/adapters/transaction-status/build-transaction-status-reader/build-transaction-status-reader.js +8 -5
- package/dist/adapters/transaction-status/build-transaction-status-reader/build-transaction-status-reader.js.map +1 -1
- package/dist/clients/fetch/fetch-client.d.ts +2 -2
- package/dist/clients/fetch/fetch-client.d.ts.map +1 -1
- package/dist/clients/fetch/fetch-client.js +59 -29
- package/dist/clients/fetch/fetch-client.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -27,14 +27,18 @@ const repository = Context.make(EntityRepositoryTag, {
|
|
|
27
27
|
delete: buildEntityRestAdapterDelete(Book, options),
|
|
28
28
|
});
|
|
29
29
|
|
|
30
|
+
const counter = Context.make(EntityFacetCounterTag, {
|
|
31
|
+
count: buildEntityRestAdapterFacets(Book, options), // GET <entity>/$facets
|
|
32
|
+
});
|
|
33
|
+
|
|
30
34
|
const status = buildTransactionStatusReader(options); // a TransactionStatusReader
|
|
31
35
|
```
|
|
32
36
|
|
|
33
37
|
## Entry points
|
|
34
38
|
|
|
35
|
-
| Import | What it holds
|
|
36
|
-
| --------------- |
|
|
37
|
-
| `@entifix/rest` | `buildEntityRestAdapterGet` / `Load` / `Save` / `Delete`, `makeEntityMetadataSource`, `buildTransactionStatusReader`, `performHttpRequestThroughFetch` |
|
|
39
|
+
| Import | What it holds |
|
|
40
|
+
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
41
|
+
| `@entifix/rest` | `buildEntityRestAdapterGet` / `Load` / `Save` / `Delete` / `Facets`, `makeEntityMetadataSource`, `buildTransactionStatusReader`, `performHttpRequestThroughFetch` |
|
|
38
42
|
|
|
39
43
|
---
|
|
40
44
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"make-entity-metadata-source.d.ts","sourceRoot":"","sources":["../../../../src/adapters/entity-metadata/make-entity-metadata-source/make-entity-metadata-source.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,oBAAoB,
|
|
1
|
+
{"version":3,"file":"make-entity-metadata-source.d.ts","sourceRoot":"","sources":["../../../../src/adapters/entity-metadata/make-entity-metadata-source/make-entity-metadata-source.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,oBAAoB,EAK1B,MAAM,eAAe,CAAC;AAGvB,MAAM,WAAW,2BAA2B;IAC1C;;;;;;;;OAQG;IACH,GAAG,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,CAAC;CACrC;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,GAAI,UAEtC,2BAA2B,KAAG,oBAwC/B,CAAC"}
|
package/dist/adapters/entity-metadata/make-entity-metadata-source/make-entity-metadata-source.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { decodeProblem, envelopeEntityName, ProtocolFailure, readEntityMetadataEnvelope, Unavailable } from '@entifix/core';
|
|
2
2
|
import { Effect } from 'effect';
|
|
3
3
|
/**
|
|
4
4
|
* Fetches an entity's {@link EntityMetadataDocument} over HTTP.
|
|
@@ -17,8 +17,8 @@ import { Effect } from 'effect';
|
|
|
17
17
|
Accept: 'application/json'
|
|
18
18
|
}
|
|
19
19
|
}),
|
|
20
|
-
catch: (
|
|
21
|
-
|
|
20
|
+
catch: ()=>new Unavailable({
|
|
21
|
+
dependency: name
|
|
22
22
|
})
|
|
23
23
|
});
|
|
24
24
|
if (!response.ok) {
|
|
@@ -26,15 +26,12 @@ import { Effect } from 'effect';
|
|
|
26
26
|
// readable, or not hosted" — the endpoint refuses to distinguish the
|
|
27
27
|
// two so it cannot be walked to enumerate the model. Either way the
|
|
28
28
|
// caller has no affordances, so it is an error, not an empty document.
|
|
29
|
-
return yield* Effect.fail(
|
|
30
|
-
entity: name,
|
|
31
|
-
status: response.status
|
|
32
|
-
}));
|
|
29
|
+
return yield* Effect.fail(decodeProblem((yield* Effect.promise(()=>response.json().catch(()=>undefined))), response.status));
|
|
33
30
|
}
|
|
34
31
|
const body = yield* Effect.tryPromise({
|
|
35
32
|
try: ()=>response.json(),
|
|
36
|
-
catch: (
|
|
37
|
-
|
|
33
|
+
catch: ()=>new ProtocolFailure({
|
|
34
|
+
reason: `metadata for "${name}" was not JSON`
|
|
38
35
|
})
|
|
39
36
|
});
|
|
40
37
|
return yield* readEntityMetadataEnvelope(entityConstructor, body);
|
package/dist/adapters/entity-metadata/make-entity-metadata-source/make-entity-metadata-source.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/adapters/entity-metadata/make-entity-metadata-source/make-entity-metadata-source.ts"],"sourcesContent":["import {\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/adapters/entity-metadata/make-entity-metadata-source/make-entity-metadata-source.ts"],"sourcesContent":["import {\n decodeProblem,\n type Entity,\n type EntityConstructor,\n type EntityMetadataDocument,\n type EntityMetadataSource,\n envelopeEntityName,\n ProtocolFailure,\n readEntityMetadataEnvelope,\n Unavailable,\n} from '@entifix/core';\nimport { Effect } from 'effect';\n\nexport interface EntityMetadataSourceOptions {\n /**\n * Where this entity's document lives, given its envelope name.\n *\n * A builder rather than the adapters' `BuildEntityRestOptions`, because the\n * two consumers resolve their base differently: the catalog goes through\n * `buildEntityBaseUrl`'s config-driven `compose` mode, while a Next shell with\n * hand-written same-origin routes has no adapters context at all. Both can\n * write one arrow function.\n */\n url: (entityName: string) => string;\n}\n\n/**\n * Fetches an entity's {@link EntityMetadataDocument} over HTTP.\n *\n * The response is permission-filtered by the service against the *verified*\n * principal, so nothing here re-checks anything: this reads what the caller was\n * told they may do. Cookies ride along by `fetch`'s same-origin default, which\n * is what carries the session on a Next shell's own `/api` route.\n */\nexport const makeEntityMetadataSource = ({\n url,\n}: EntityMetadataSourceOptions): EntityMetadataSource => ({\n fetchMetadata: <TEntity extends Entity>(\n entityConstructor: EntityConstructor<TEntity>,\n ): Promise<EntityMetadataDocument> => {\n const name = envelopeEntityName(entityConstructor);\n return Effect.runPromise(\n Effect.gen(function* () {\n const response = yield* Effect.tryPromise({\n try: () =>\n fetch(url(name), { headers: { Accept: 'application/json' } }),\n catch: () => new Unavailable({ dependency: name }),\n });\n\n if (!response.ok) {\n // A `404` here is deliberate on the service side and means \"not\n // readable, or not hosted\" — the endpoint refuses to distinguish the\n // two so it cannot be walked to enumerate the model. Either way the\n // caller has no affordances, so it is an error, not an empty document.\n return yield* Effect.fail(\n decodeProblem(\n yield* Effect.promise(() =>\n response.json().catch(() => undefined),\n ),\n response.status,\n ),\n );\n }\n\n const body = yield* Effect.tryPromise({\n try: () => response.json() as Promise<unknown>,\n catch: () =>\n new ProtocolFailure({\n reason: `metadata for \"${name}\" was not JSON`,\n }),\n });\n\n return yield* readEntityMetadataEnvelope(entityConstructor, body);\n }),\n );\n },\n});\n"],"names":["decodeProblem","envelopeEntityName","ProtocolFailure","readEntityMetadataEnvelope","Unavailable","Effect","makeEntityMetadataSource","url","fetchMetadata","entityConstructor","name","runPromise","gen","response","tryPromise","try","fetch","headers","Accept","catch","dependency","ok","fail","promise","json","undefined","status","body","reason"],"mappings":"AAAA,SACEA,aAAa,EAKbC,kBAAkB,EAClBC,eAAe,EACfC,0BAA0B,EAC1BC,WAAW,QACN,gBAAgB;AACvB,SAASC,MAAM,QAAQ,SAAS;AAehC;;;;;;;CAOC,GACD,OAAO,MAAMC,2BAA2B,CAAC,EACvCC,GAAG,EACyB,GAA4B,CAAA;QACxDC,eAAe,CACbC;YAEA,MAAMC,OAAOT,mBAAmBQ;YAChC,OAAOJ,OAAOM,UAAU,CACtBN,OAAOO,GAAG,CAAC;gBACT,MAAMC,WAAW,OAAOR,OAAOS,UAAU,CAAC;oBACxCC,KAAK,IACHC,MAAMT,IAAIG,OAAO;4BAAEO,SAAS;gCAAEC,QAAQ;4BAAmB;wBAAE;oBAC7DC,OAAO,IAAM,IAAIf,YAAY;4BAAEgB,YAAYV;wBAAK;gBAClD;gBAEA,IAAI,CAACG,SAASQ,EAAE,EAAE;oBAChB,gEAAgE;oBAChE,qEAAqE;oBACrE,oEAAoE;oBACpE,uEAAuE;oBACvE,OAAO,OAAOhB,OAAOiB,IAAI,CACvBtB,cACE,CAAA,OAAOK,OAAOkB,OAAO,CAAC,IACpBV,SAASW,IAAI,GAAGL,KAAK,CAAC,IAAMM,WAC9B,GACAZ,SAASa,MAAM;gBAGrB;gBAEA,MAAMC,OAAO,OAAOtB,OAAOS,UAAU,CAAC;oBACpCC,KAAK,IAAMF,SAASW,IAAI;oBACxBL,OAAO,IACL,IAAIjB,gBAAgB;4BAClB0B,QAAQ,CAAC,cAAc,EAAElB,KAAK,cAAc,CAAC;wBAC/C;gBACJ;gBAEA,OAAO,OAAOP,2BAA2BM,mBAAmBkB;YAC9D;QAEJ;IACF,CAAA,EAAG"}
|
|
@@ -8,5 +8,5 @@ import { BuildEntityRestOptions } from '../types.js';
|
|
|
8
8
|
* envelope rather than a bare `204`: the shared fetch client always parses the
|
|
9
9
|
* response as JSON, and an empty body would fail that parse.
|
|
10
10
|
*/
|
|
11
|
-
export declare const buildEntityRestAdapterDelete: <TEntity extends Entity>(entityConstructor: EntityConstructor<TEntity>, { uriConfig, configuration }: BuildEntityRestOptions) => <TEntity_1 extends Entity>(entityOrId: EntityId | TEntity_1) => Effect.Effect<undefined, import("@entifix/core").EntifixBuildError | import("@entifix/core").
|
|
11
|
+
export declare const buildEntityRestAdapterDelete: <TEntity extends Entity>(entityConstructor: EntityConstructor<TEntity>, { uriConfig, configuration }: BuildEntityRestOptions) => <TEntity_1 extends Entity>(entityOrId: EntityId | TEntity_1) => Effect.Effect<undefined, import("@entifix/core").EntifixBuildError | import("@entifix/core").EntifixFailure<string, string, import("@entifix/core").FailureCategory>, never>;
|
|
12
12
|
//# sourceMappingURL=build-entity-rest-adapter-delete.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-entity-rest-adapter-delete.d.ts","sourceRoot":"","sources":["../../../../src/adapters/entity-rest/build-entity-rest-adapter-delete/build-entity-rest-adapter-delete.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"build-entity-rest-adapter-delete.d.ts","sourceRoot":"","sources":["../../../../src/adapters/entity-rest/build-entity-rest-adapter-delete/build-entity-rest-adapter-delete.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,iBAAiB,EACjB,QAAQ,EAGT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AASrD;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,GACtC,OAAO,SAAS,MAAM,EACrB,mBAAmB,iBAAiB,CAAC,OAAO,CAAC,EAC7C,8BAA8B,sBAAsB,MAErD,SAAO,SAAS,MAAM,EAAE,YAAY,QAAQ,GAAG,SAAO,iLAmBnD,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { extractMetaEntity, Internal } from '@entifix/core';
|
|
2
2
|
import { Effect } from 'effect';
|
|
3
3
|
import { performHttpRequestThroughFetch } from '../../../clients/fetch/index.js';
|
|
4
4
|
import { buildEntityRestAdapterMixins as adapterMixins } from '../build-entity-rest-adapter-mixins/index.js';
|
|
@@ -16,9 +16,7 @@ import { buildEntityRestAdapterMixins as adapterMixins } from '../build-entity-r
|
|
|
16
16
|
const metaEntity = extractMetaEntity(entityConstructor);
|
|
17
17
|
const id = toEntityId(entityOrId);
|
|
18
18
|
if (id == null) {
|
|
19
|
-
return yield* Effect.fail(new
|
|
20
|
-
entity: entityConstructor.name
|
|
21
|
-
}));
|
|
19
|
+
return yield* Effect.fail(new Internal());
|
|
22
20
|
}
|
|
23
21
|
const url = yield* adapterMixins.buildEntityBaseUrl(configuration, {
|
|
24
22
|
uriConfig
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/adapters/entity-rest/build-entity-rest-adapter-delete/build-entity-rest-adapter-delete.ts"],"sourcesContent":["import {\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/adapters/entity-rest/build-entity-rest-adapter-delete/build-entity-rest-adapter-delete.ts"],"sourcesContent":["import {\n Entity,\n EntityConstructor,\n EntityId,\n extractMetaEntity,\n Internal,\n} from '@entifix/core';\nimport { Effect } from 'effect';\n\nimport { performHttpRequestThroughFetch } from '../../../clients/fetch/index.js';\nimport { buildEntityRestAdapterMixins as adapterMixins } from '../build-entity-rest-adapter-mixins/index.js';\nimport { BuildEntityRestOptions } from '../types.js';\n\n/** Accepts either an id or a whole entity, mirroring the repository contract. */\nfunction toEntityId(entityOrId: EntityId | Entity): EntityId {\n return entityOrId != null && typeof entityOrId === 'object'\n ? (entityOrId as Entity).id\n : (entityOrId as EntityId);\n}\n\n/**\n * Deletes an entity over HTTP.\n *\n * The response body is discarded, but the service still answers with an\n * envelope rather than a bare `204`: the shared fetch client always parses the\n * response as JSON, and an empty body would fail that parse.\n */\nexport const buildEntityRestAdapterDelete =\n <TEntity extends Entity>(\n entityConstructor: EntityConstructor<TEntity>,\n { uriConfig, configuration }: BuildEntityRestOptions,\n ) =>\n <TEntity extends Entity>(entityOrId: EntityId | TEntity) =>\n Effect.gen(function* () {\n const metaEntity = extractMetaEntity(entityConstructor);\n const id = toEntityId(entityOrId);\n\n if (id == null) {\n return yield* Effect.fail(new Internal());\n }\n\n const url = yield* adapterMixins.buildEntityBaseUrl(\n configuration,\n { uriConfig },\n metaEntity.key ?? metaEntity.name,\n String(id),\n );\n\n yield* performHttpRequestThroughFetch(\n adapterMixins.buildEntityRequest({ method: 'DELETE', url }),\n );\n });\n"],"names":["extractMetaEntity","Internal","Effect","performHttpRequestThroughFetch","buildEntityRestAdapterMixins","adapterMixins","toEntityId","entityOrId","id","buildEntityRestAdapterDelete","entityConstructor","uriConfig","configuration","gen","metaEntity","fail","url","buildEntityBaseUrl","key","name","String","buildEntityRequest","method"],"mappings":"AAAA,SAIEA,iBAAiB,EACjBC,QAAQ,QACH,gBAAgB;AACvB,SAASC,MAAM,QAAQ,SAAS;AAEhC,SAASC,8BAA8B,QAAQ,kCAAkC;AACjF,SAASC,gCAAgCC,aAAa,QAAQ,+CAA+C;AAG7G,+EAA+E,GAC/E,SAASC,WAAWC,UAA6B;IAC/C,OAAOA,cAAc,QAAQ,OAAOA,eAAe,WAC/C,AAACA,WAAsBC,EAAE,GACxBD;AACP;AAEA;;;;;;CAMC,GACD,OAAO,MAAME,+BACX,CACEC,mBACA,EAAEC,SAAS,EAAEC,aAAa,EAA0B,GAEtD,CAAyBL,aACvBL,OAAOW,GAAG,CAAC;gBAWPC;YAVF,MAAMA,aAAad,kBAAkBU;YACrC,MAAMF,KAAKF,WAAWC;YAEtB,IAAIC,MAAM,MAAM;gBACd,OAAO,OAAON,OAAOa,IAAI,CAAC,IAAId;YAChC;YAEA,MAAMe,MAAM,OAAOX,cAAcY,kBAAkB,CACjDL,eACA;gBAAED;YAAU,IACZG,kBAAAA,WAAWI,GAAG,YAAdJ,kBAAkBA,WAAWK,IAAI,EACjCC,OAAOZ;YAGT,OAAOL,+BACLE,cAAcgB,kBAAkB,CAAC;gBAAEC,QAAQ;gBAAUN;YAAI;QAE7D,GAAG"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Entity, type EntityConstructor, type EntityFacetQuery } from '@entifix/core';
|
|
2
|
+
import { Effect } from 'effect';
|
|
3
|
+
import { BuildEntityRestOptions } from '../types.js';
|
|
4
|
+
/**
|
|
5
|
+
* The `count` of an `EntityFacetCounter`, over a service's
|
|
6
|
+
* `GET <entity>/$facets` — the load adapter's sibling, on the same base URL and
|
|
7
|
+
* the same query protocol, so what this composes is what the service parses
|
|
8
|
+
* back. The caller binds it to the port, as it binds `load` to the repository.
|
|
9
|
+
*/
|
|
10
|
+
export declare const buildEntityRestAdapterFacets: <TEntity extends Entity>(entityConstructor: EntityConstructor<TEntity>, { uriConfig, configuration }: BuildEntityRestOptions) => <T extends Entity>(queries: readonly EntityFacetQuery<T>[]) => Effect.Effect<Readonly<Record<string, readonly import("@entifix/core").EntityFacetValue[]>>, import("@entifix/core").EntifixBuildError | import("@entifix/core").EntifixFailure<string, string, import("@entifix/core").FailureCategory>, never>;
|
|
11
|
+
//# sourceMappingURL=build-entity-rest-adapter-facets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-entity-rest-adapter-facets.d.ts","sourceRoot":"","sources":["../../../../src/adapters/entity-rest/build-entity-rest-adapter-facets/build-entity-rest-adapter-facets.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EACX,KAAK,iBAAiB,EAEtB,KAAK,gBAAgB,EAItB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,GACtC,OAAO,SAAS,MAAM,EACrB,mBAAmB,iBAAiB,CAAC,OAAO,CAAC,EAC7C,8BAA8B,sBAAsB,MAErD,CAAC,SAAS,MAAM,EAAE,SAAS,SAAS,gBAAgB,CAAC,CAAC,CAAC,EAAE,qPAoBtD,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { envelopeEntityName, readEntityFacetsEnvelope, serializeFacetQueryParams } from '@entifix/core';
|
|
2
|
+
import { Effect } from 'effect';
|
|
3
|
+
import { performHttpRequestThroughFetch } from '../../../clients/fetch/index.js';
|
|
4
|
+
import { buildEntityRestAdapterMixins as adapterMixins } from '../build-entity-rest-adapter-mixins/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* The `count` of an `EntityFacetCounter`, over a service's
|
|
7
|
+
* `GET <entity>/$facets` — the load adapter's sibling, on the same base URL and
|
|
8
|
+
* the same query protocol, so what this composes is what the service parses
|
|
9
|
+
* back. The caller binds it to the port, as it binds `load` to the repository.
|
|
10
|
+
*/ export const buildEntityRestAdapterFacets = (entityConstructor, { uriConfig, configuration })=>(queries)=>Effect.gen(function*() {
|
|
11
|
+
// Asking for nothing is answered without a round trip; the service
|
|
12
|
+
// would refuse an empty request.
|
|
13
|
+
if (queries.length === 0) return {};
|
|
14
|
+
const baseUrl = yield* adapterMixins.buildEntityBaseUrl(configuration, {
|
|
15
|
+
uriConfig
|
|
16
|
+
}, envelopeEntityName(entityConstructor));
|
|
17
|
+
const query = serializeFacetQueryParams(queries).toString();
|
|
18
|
+
const response = yield* performHttpRequestThroughFetch(adapterMixins.buildEntityRequest({
|
|
19
|
+
method: 'GET',
|
|
20
|
+
url: `${baseUrl}/$facets?${query}`
|
|
21
|
+
}));
|
|
22
|
+
return yield* readEntityFacetsEnvelope(entityConstructor, response.body);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=build-entity-rest-adapter-facets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/adapters/entity-rest/build-entity-rest-adapter-facets/build-entity-rest-adapter-facets.ts"],"sourcesContent":["import {\n type Entity,\n type EntityConstructor,\n type EntityFacetCounts,\n type EntityFacetQuery,\n envelopeEntityName,\n readEntityFacetsEnvelope,\n serializeFacetQueryParams,\n} from '@entifix/core';\nimport { Effect } from 'effect';\n\nimport { performHttpRequestThroughFetch } from '../../../clients/fetch/index.js';\nimport { buildEntityRestAdapterMixins as adapterMixins } from '../build-entity-rest-adapter-mixins/index.js';\nimport { BuildEntityRestOptions } from '../types.js';\n\n/**\n * The `count` of an `EntityFacetCounter`, over a service's\n * `GET <entity>/$facets` — the load adapter's sibling, on the same base URL and\n * the same query protocol, so what this composes is what the service parses\n * back. The caller binds it to the port, as it binds `load` to the repository.\n */\nexport const buildEntityRestAdapterFacets =\n <TEntity extends Entity>(\n entityConstructor: EntityConstructor<TEntity>,\n { uriConfig, configuration }: BuildEntityRestOptions,\n ) =>\n <T extends Entity>(queries: readonly EntityFacetQuery<T>[]) =>\n Effect.gen(function* () {\n // Asking for nothing is answered without a round trip; the service\n // would refuse an empty request.\n if (queries.length === 0) return {} as EntityFacetCounts;\n\n const baseUrl = yield* adapterMixins.buildEntityBaseUrl(\n configuration,\n { uriConfig },\n envelopeEntityName(entityConstructor),\n );\n\n const query = serializeFacetQueryParams(queries).toString();\n const response = yield* performHttpRequestThroughFetch(\n adapterMixins.buildEntityRequest({\n method: 'GET',\n url: `${baseUrl}/$facets?${query}`,\n }),\n );\n return yield* readEntityFacetsEnvelope(entityConstructor, response.body);\n });\n"],"names":["envelopeEntityName","readEntityFacetsEnvelope","serializeFacetQueryParams","Effect","performHttpRequestThroughFetch","buildEntityRestAdapterMixins","adapterMixins","buildEntityRestAdapterFacets","entityConstructor","uriConfig","configuration","queries","gen","length","baseUrl","buildEntityBaseUrl","query","toString","response","buildEntityRequest","method","url","body"],"mappings":"AAAA,SAKEA,kBAAkB,EAClBC,wBAAwB,EACxBC,yBAAyB,QACpB,gBAAgB;AACvB,SAASC,MAAM,QAAQ,SAAS;AAEhC,SAASC,8BAA8B,QAAQ,kCAAkC;AACjF,SAASC,gCAAgCC,aAAa,QAAQ,+CAA+C;AAG7G;;;;;CAKC,GACD,OAAO,MAAMC,+BACX,CACEC,mBACA,EAAEC,SAAS,EAAEC,aAAa,EAA0B,GAEtD,CAAmBC,UACjBR,OAAOS,GAAG,CAAC;YACT,mEAAmE;YACnE,iCAAiC;YACjC,IAAID,QAAQE,MAAM,KAAK,GAAG,OAAO,CAAC;YAElC,MAAMC,UAAU,OAAOR,cAAcS,kBAAkB,CACrDL,eACA;gBAAED;YAAU,GACZT,mBAAmBQ;YAGrB,MAAMQ,QAAQd,0BAA0BS,SAASM,QAAQ;YACzD,MAAMC,WAAW,OAAOd,+BACtBE,cAAca,kBAAkB,CAAC;gBAC/BC,QAAQ;gBACRC,KAAK,GAAGP,QAAQ,SAAS,EAAEE,OAAO;YACpC;YAEF,OAAO,OAAOf,yBAAyBO,mBAAmBU,SAASI,IAAI;QACzE,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/adapters/entity-rest/build-entity-rest-adapter-facets/index.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/adapters/entity-rest/build-entity-rest-adapter-facets/index.ts"],"sourcesContent":["export * from './build-entity-rest-adapter-facets.js';\n"],"names":[],"mappings":"AAAA,cAAc,wCAAwC"}
|
package/dist/adapters/entity-rest/build-entity-rest-adapter-get/build-entity-rest-adapter-get.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Entity, EntityConstructor } from '@entifix/core';
|
|
2
2
|
import { Effect } from 'effect';
|
|
3
3
|
import { BuildEntityRestOptions } from '../types.js';
|
|
4
|
-
export declare const buildEntityRestAdapterGet: <TEntity extends Entity>(entityConstructor: EntityConstructor<TEntity>, { uriConfig, configuration }: BuildEntityRestOptions) => <TEntity_1 extends Entity>(entityId: string) => Effect.Effect<TEntity_1, import("@entifix/core").EntifixBuildError | import("@entifix/core").
|
|
4
|
+
export declare const buildEntityRestAdapterGet: <TEntity extends Entity>(entityConstructor: EntityConstructor<TEntity>, { uriConfig, configuration }: BuildEntityRestOptions) => <TEntity_1 extends Entity>(entityId: string) => Effect.Effect<TEntity_1, import("@entifix/core").EntifixBuildError | import("@entifix/core").EntifixFailure<string, string, import("@entifix/core").FailureCategory>, never>;
|
|
5
5
|
//# sourceMappingURL=build-entity-rest-adapter-get.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-entity-rest-adapter-get.d.ts","sourceRoot":"","sources":["../../../../src/adapters/entity-rest/build-entity-rest-adapter-get/build-entity-rest-adapter-get.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,iBAAiB,EAGlB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD,eAAO,MAAM,yBAAyB,GACnC,OAAO,SAAS,MAAM,EACrB,mBAAmB,iBAAiB,CAAC,OAAO,CAAC,EAC7C,8BAA8B,sBAAsB,MAErD,SAAO,SAAS,MAAM,EAAE,UAAU,MAAM,
|
|
1
|
+
{"version":3,"file":"build-entity-rest-adapter-get.d.ts","sourceRoot":"","sources":["../../../../src/adapters/entity-rest/build-entity-rest-adapter-get/build-entity-rest-adapter-get.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,iBAAiB,EAGlB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD,eAAO,MAAM,yBAAyB,GACnC,OAAO,SAAS,MAAM,EACrB,mBAAmB,iBAAiB,CAAC,OAAO,CAAC,EAC7C,8BAA8B,sBAAsB,MAErD,SAAO,SAAS,MAAM,EAAE,UAAU,MAAM,iLAoBrC,CAAC"}
|
package/dist/adapters/entity-rest/build-entity-rest-adapter-load/build-entity-rest-adapter-load.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Entity, EntityConstructor, EntityLoadRequest, EntityPage } from '@entifix/core';
|
|
2
2
|
import { Effect } from 'effect';
|
|
3
3
|
import { BuildEntityRestOptions } from '../types.js';
|
|
4
|
-
export declare const buildEntityRestAdapterLoad: <TEntity extends Entity>(entityConstructor: EntityConstructor<TEntity>, { uriConfig, configuration }: BuildEntityRestOptions) => <TEntity_1 extends Entity>(request: EntityLoadRequest<TEntity_1>) => Effect.Effect<EntityPage<TEntity_1>, import("@entifix/core").EntifixBuildError | import("@entifix/core").
|
|
4
|
+
export declare const buildEntityRestAdapterLoad: <TEntity extends Entity>(entityConstructor: EntityConstructor<TEntity>, { uriConfig, configuration }: BuildEntityRestOptions) => <TEntity_1 extends Entity>(request: EntityLoadRequest<TEntity_1>) => Effect.Effect<EntityPage<TEntity_1>, import("@entifix/core").EntifixBuildError | import("@entifix/core").EntifixFailure<string, string, import("@entifix/core").FailureCategory>, never>;
|
|
5
5
|
//# sourceMappingURL=build-entity-rest-adapter-load.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-entity-rest-adapter-load.d.ts","sourceRoot":"","sources":["../../../../src/adapters/entity-rest/build-entity-rest-adapter-load/build-entity-rest-adapter-load.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EAIX,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD,eAAO,MAAM,0BAA0B,GACpC,OAAO,SAAS,MAAM,EACrB,mBAAmB,iBAAiB,CAAC,OAAO,CAAC,EAC7C,8BAA8B,sBAAsB,MAErD,SAAO,SAAS,MAAM,EAAE,SAAS,iBAAiB,CAAC,SAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"build-entity-rest-adapter-load.d.ts","sourceRoot":"","sources":["../../../../src/adapters/entity-rest/build-entity-rest-adapter-load/build-entity-rest-adapter-load.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EAIX,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD,eAAO,MAAM,0BAA0B,GACpC,OAAO,SAAS,MAAM,EACrB,mBAAmB,iBAAiB,CAAC,OAAO,CAAC,EAC7C,8BAA8B,sBAAsB,MAErD,SAAO,SAAS,MAAM,EAAE,SAAS,iBAAiB,CAAC,SAAO,CAAC,6LA8BxD,CAAC"}
|
package/dist/adapters/entity-rest/build-entity-rest-adapter-save/build-entity-rest-adapter-save.d.ts
CHANGED
|
@@ -20,5 +20,5 @@ import { BuildEntityRestOptions } from '../types.js';
|
|
|
20
20
|
* adapter parsed the `202` as an entity envelope, failed, and reported an error
|
|
21
21
|
* for a create that was in fact about to succeed.
|
|
22
22
|
*/
|
|
23
|
-
export declare const buildEntityRestAdapterSave: <TEntity extends Entity>(entityConstructor: EntityConstructor<TEntity>, { uriConfig, create, configuration }: BuildEntityRestOptions) => <TInput extends Entity>(entity: TInput) => Effect.Effect<TInput, import("@entifix/core").
|
|
23
|
+
export declare const buildEntityRestAdapterSave: <TEntity extends Entity>(entityConstructor: EntityConstructor<TEntity>, { uriConfig, create, configuration }: BuildEntityRestOptions) => <TInput extends Entity>(entity: TInput) => Effect.Effect<TInput, import("@entifix/core").EntifixBuildError | import("@entifix/core").EntifixFailure<string, string, import("@entifix/core").FailureCategory>, never>;
|
|
24
24
|
//# sourceMappingURL=build-entity-rest-adapter-save.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-entity-rest-adapter-save.d.ts","sourceRoot":"","sources":["../../../../src/adapters/entity-rest/build-entity-rest-adapter-save/build-entity-rest-adapter-save.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,iBAAiB,EAKlB,MAAM,eAAe,CAAC;AAOvB,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAC;AAIxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,0BAA0B,GACpC,OAAO,SAAS,MAAM,EACrB,mBAAmB,iBAAiB,CAAC,OAAO,CAAC,EAC7C,sCAAiD,sBAAsB,MAKxE,MAAM,SAAS,MAAM,EAAE,QAAQ,MAAM,
|
|
1
|
+
{"version":3,"file":"build-entity-rest-adapter-save.d.ts","sourceRoot":"","sources":["../../../../src/adapters/entity-rest/build-entity-rest-adapter-save/build-entity-rest-adapter-save.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,iBAAiB,EAKlB,MAAM,eAAe,CAAC;AAOvB,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAC;AAIxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,0BAA0B,GACpC,OAAO,SAAS,MAAM,EACrB,mBAAmB,iBAAiB,CAAC,OAAO,CAAC,EAC7C,sCAAiD,sBAAsB,MAKxE,MAAM,SAAS,MAAM,EAAE,QAAQ,MAAM,8KAiFlC,CAAC"}
|
|
@@ -1,21 +1,4 @@
|
|
|
1
1
|
import { type TransactionStatusReader } from '@entifix/transactions';
|
|
2
2
|
import type { BuildEntityRestOptions } from '../../entity-rest/types.js';
|
|
3
|
-
/**
|
|
4
|
-
* Reads one transaction's record over HTTP, for a browser reconciling a write it
|
|
5
|
-
* started.
|
|
6
|
-
*
|
|
7
|
-
* ⚠️ **A `404` answers `undefined`, and that is not a failure.** `accepted`
|
|
8
|
-
* reaches the tracker over the bus, so with the broker down the entity write
|
|
9
|
-
* commits — the outbox is in the same Mongo transaction — while no event is ever
|
|
10
|
-
* published and the tracker holds no record at all. A caller that treated this
|
|
11
|
-
* as terminal would un-render a healthy write during a broker outage, which is
|
|
12
|
-
* the moment nobody can tell a UI bug from an outage. The route also
|
|
13
|
-
* answers `404` for another tenant's record, deliberately, so it cannot be
|
|
14
|
-
* walked to probe ids that are also primary keys — indistinguishable here, and
|
|
15
|
-
* correctly so: neither is a record this caller may reconcile against.
|
|
16
|
-
*
|
|
17
|
-
* Every other status stays an error, so an unreachable service is not quietly
|
|
18
|
-
* read as "no such transaction".
|
|
19
|
-
*/
|
|
20
3
|
export declare const buildTransactionStatusReader: (options: Pick<BuildEntityRestOptions, "uriConfig" | "configuration">) => TransactionStatusReader;
|
|
21
4
|
//# sourceMappingURL=build-transaction-status-reader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-transaction-status-reader.d.ts","sourceRoot":"","sources":["../../../../src/adapters/transaction-status/build-transaction-status-reader/build-transaction-status-reader.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,uBAAuB,CAAC;AAK/B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"build-transaction-status-reader.d.ts","sourceRoot":"","sources":["../../../../src/adapters/transaction-status/build-transaction-status-reader/build-transaction-status-reader.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,uBAAuB,CAAC;AAK/B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAqCzE,eAAO,MAAM,4BAA4B,GACvC,SAAS,IAAI,CAAC,sBAAsB,EAAE,WAAW,GAAG,eAAe,CAAC,KACnE,uBA0BF,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isTag } from '@entifix/core';
|
|
1
2
|
import { readTransactionRecordEnvelope } from '@entifix/transactions';
|
|
2
3
|
import { Effect } from 'effect';
|
|
3
4
|
import { performHttpRequestThroughFetch } from '../../../clients/fetch/index.js';
|
|
@@ -24,7 +25,12 @@ import { buildEntityRestAdapterMixins as adapterMixins } from '../../entity-rest
|
|
|
24
25
|
*
|
|
25
26
|
* Every other status stays an error, so an unreachable service is not quietly
|
|
26
27
|
* read as "no such transaction".
|
|
27
|
-
*/
|
|
28
|
+
*/ /**
|
|
29
|
+
* A `404`, however it arrived: a tracker that answers a problem body says
|
|
30
|
+
* `NotFound`; one that answers no body at all is a protocol failure that
|
|
31
|
+
* still carries the status.
|
|
32
|
+
*/ const isNotFound = (error)=>isTag('NotFound')(error) || isTag('ProtocolFailure')(error) && error.upstreamStatus === 404;
|
|
33
|
+
export const buildTransactionStatusReader = (options)=>{
|
|
28
34
|
const { configuration } = options;
|
|
29
35
|
return {
|
|
30
36
|
read: (transactionId)=>Effect.gen(function*() {
|
|
@@ -34,10 +40,7 @@ import { buildEntityRestAdapterMixins as adapterMixins } from '../../entity-rest
|
|
|
34
40
|
url
|
|
35
41
|
}));
|
|
36
42
|
return yield* readTransactionRecordEnvelope(response.body);
|
|
37
|
-
}).pipe(Effect.catch((error)=>
|
|
38
|
-
var _error_details;
|
|
39
|
-
return ((_error_details = error.details) == null ? void 0 : _error_details['status']) === 404 ? Effect.succeed(undefined) : Effect.fail(error);
|
|
40
|
-
}))
|
|
43
|
+
}).pipe(Effect.catch((error)=>isNotFound(error) ? Effect.succeed(undefined) : Effect.fail(error)))
|
|
41
44
|
};
|
|
42
45
|
};
|
|
43
46
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/adapters/transaction-status/build-transaction-status-reader/build-transaction-status-reader.ts"],"sourcesContent":["import type
|
|
1
|
+
{"version":3,"sources":["../../../../src/adapters/transaction-status/build-transaction-status-reader/build-transaction-status-reader.ts"],"sourcesContent":["import { isTag, type TransitionalFailure } from '@entifix/core';\nimport {\n readTransactionRecordEnvelope,\n type TransactionRecord,\n type TransactionStatusReader,\n} from '@entifix/transactions';\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 type { BuildEntityRestOptions } from '../../entity-rest/types.js';\n\n/**\n * The tracker's own path segment. It is not an entity — nothing decorates a\n * `TransactionRecord` — but the URL is composed the same way every entity URL\n * is, so `buildEntityBaseUrl` (already generic over an arbitrary name) needs no\n * transaction-shaped sibling.\n */\nconst TRANSACTION_PATH = 'transaction';\n\n/**\n * Reads one transaction's record over HTTP, for a browser reconciling a write it\n * started.\n *\n * ⚠️ **A `404` answers `undefined`, and that is not a failure.** `accepted`\n * reaches the tracker over the bus, so with the broker down the entity write\n * commits — the outbox is in the same Mongo transaction — while no event is ever\n * published and the tracker holds no record at all. A caller that treated this\n * as terminal would un-render a healthy write during a broker outage, which is\n * the moment nobody can tell a UI bug from an outage. The route also\n * answers `404` for another tenant's record, deliberately, so it cannot be\n * walked to probe ids that are also primary keys — indistinguishable here, and\n * correctly so: neither is a record this caller may reconcile against.\n *\n * Every other status stays an error, so an unreachable service is not quietly\n * read as \"no such transaction\".\n */\n/**\n * A `404`, however it arrived: a tracker that answers a problem body says\n * `NotFound`; one that answers no body at all is a protocol failure that\n * still carries the status.\n */\nconst isNotFound = (error: unknown): boolean =>\n isTag('NotFound')(error) ||\n (isTag('ProtocolFailure')(error) &&\n (error as { readonly upstreamStatus?: unknown }).upstreamStatus === 404);\n\nexport const buildTransactionStatusReader = (\n options: Pick<BuildEntityRestOptions, 'uriConfig' | 'configuration'>,\n): TransactionStatusReader => {\n const { configuration } = options;\n\n return {\n read: (\n transactionId: string,\n ): Effect.Effect<TransactionRecord | undefined, TransitionalFailure> =>\n Effect.gen(function* () {\n const url = yield* adapterMixins.buildEntityBaseUrl(\n configuration,\n options,\n TRANSACTION_PATH,\n transactionId,\n );\n\n const response = yield* performHttpRequestThroughFetch(\n adapterMixins.buildEntityRequest({ method: 'GET', url }),\n );\n\n return yield* readTransactionRecordEnvelope(response.body);\n }).pipe(\n Effect.catch(error =>\n isNotFound(error) ? Effect.succeed(undefined) : Effect.fail(error),\n ),\n ),\n };\n};\n"],"names":["isTag","readTransactionRecordEnvelope","Effect","performHttpRequestThroughFetch","buildEntityRestAdapterMixins","adapterMixins","TRANSACTION_PATH","isNotFound","error","upstreamStatus","buildTransactionStatusReader","options","configuration","read","transactionId","gen","url","buildEntityBaseUrl","response","buildEntityRequest","method","body","pipe","catch","succeed","undefined","fail"],"mappings":"AAAA,SAASA,KAAK,QAAkC,gBAAgB;AAChE,SACEC,6BAA6B,QAGxB,wBAAwB;AAC/B,SAASC,MAAM,QAAQ,SAAS;AAEhC,SAASC,8BAA8B,QAAQ,kCAAkC;AACjF,SAASC,gCAAgCC,aAAa,QAAQ,8DAA8D;AAG5H;;;;;CAKC,GACD,MAAMC,mBAAmB;AAEzB;;;;;;;;;;;;;;;;CAgBC,GACD;;;;CAIC,GACD,MAAMC,aAAa,CAACC,QAClBR,MAAM,YAAYQ,UACjBR,MAAM,mBAAmBQ,UACxB,AAACA,MAAgDC,cAAc,KAAK;AAExE,OAAO,MAAMC,+BAA+B,CAC1CC;IAEA,MAAM,EAAEC,aAAa,EAAE,GAAGD;IAE1B,OAAO;QACLE,MAAM,CACJC,gBAEAZ,OAAOa,GAAG,CAAC;gBACT,MAAMC,MAAM,OAAOX,cAAcY,kBAAkB,CACjDL,eACAD,SACAL,kBACAQ;gBAGF,MAAMI,WAAW,OAAOf,+BACtBE,cAAcc,kBAAkB,CAAC;oBAAEC,QAAQ;oBAAOJ;gBAAI;gBAGxD,OAAO,OAAOf,8BAA8BiB,SAASG,IAAI;YAC3D,GAAGC,IAAI,CACLpB,OAAOqB,KAAK,CAACf,CAAAA,QACXD,WAAWC,SAASN,OAAOsB,OAAO,CAACC,aAAavB,OAAOwB,IAAI,CAAClB;IAGpE;AACF,EAAE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type EntifixFailure } from '@entifix/core';
|
|
2
2
|
import { Effect } from 'effect';
|
|
3
3
|
import { HttpRequest, HttpResponse } from '../types.js';
|
|
4
|
-
export declare const performHttpRequestThroughFetch: <TResponseBody>(request: HttpRequest<unknown>) => Effect.Effect<HttpResponse<TResponseBody>,
|
|
4
|
+
export declare const performHttpRequestThroughFetch: <TResponseBody>(request: HttpRequest<unknown>) => Effect.Effect<HttpResponse<TResponseBody>, EntifixFailure<string, string, import("@entifix/core").FailureCategory>, never>;
|
|
5
5
|
//# sourceMappingURL=fetch-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-client.d.ts","sourceRoot":"","sources":["../../../src/clients/fetch/fetch-client.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"fetch-client.d.ts","sourceRoot":"","sources":["../../../src/clients/fetch/fetch-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,cAAc,EAMpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AA6CxD,eAAO,MAAM,8BAA8B,GAAI,aAAa,EAC1D,SAAS,WAAW,CAAC,OAAO,CAAC,+HAuD3B,CAAC"}
|
|
@@ -1,44 +1,74 @@
|
|
|
1
1
|
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
2
|
-
import {
|
|
2
|
+
import { currentRemainingMs, DEADLINE_HEADER, decodeProblem, Overloaded, PROBLEM_CONTENT_TYPE, ProtocolFailure, Timeout, Unavailable } from '@entifix/core';
|
|
3
3
|
import { Effect } from 'effect';
|
|
4
|
+
/** The host a request went to, which is what a failure names as its dependency. */ const dependencyOf = (url)=>{
|
|
5
|
+
try {
|
|
6
|
+
return new URL(url).host;
|
|
7
|
+
} catch (unused) {
|
|
8
|
+
return url;
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* The failure a non-2xx answer carries. `Retry-After` in seconds is copied
|
|
13
|
+
* onto an `Overloaded` that did not say itself when to come back.
|
|
14
|
+
*/ const failureOf = (response, request)=>Effect.gen(function*() {
|
|
15
|
+
var _response_headers_get;
|
|
16
|
+
const text = yield* Effect.promise(()=>response.text());
|
|
17
|
+
const isProblem = ((_response_headers_get = response.headers.get('content-type')) == null ? void 0 : _response_headers_get.startsWith(PROBLEM_CONTENT_TYPE)) === true;
|
|
18
|
+
if (!isProblem) return new ProtocolFailure({
|
|
19
|
+
reason: `${request.method} ${request.url} answered ${String(response.status)} without a problem body`,
|
|
20
|
+
upstreamStatus: response.status
|
|
21
|
+
});
|
|
22
|
+
const failure = decodeProblem(parseOr(text), response.status);
|
|
23
|
+
const retryAfter = Number(response.headers.get('retry-after'));
|
|
24
|
+
return failure._tag === 'Overloaded' && !('retryAfterSeconds' in failure) && Number.isFinite(retryAfter) && retryAfter > 0 ? new Overloaded({
|
|
25
|
+
retryAfterSeconds: retryAfter
|
|
26
|
+
}) : failure;
|
|
27
|
+
});
|
|
28
|
+
const parseOr = (text)=>{
|
|
29
|
+
try {
|
|
30
|
+
return JSON.parse(text);
|
|
31
|
+
} catch (unused) {
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
4
35
|
export const performHttpRequestThroughFetch = (request)=>Effect.gen(function*() {
|
|
5
|
-
//
|
|
36
|
+
// The caller's remaining budget travels on, minus what is already spent,
|
|
37
|
+
// and a budget already spent is not worth a round trip (ADR 0014).
|
|
38
|
+
const remaining = yield* currentRemainingMs;
|
|
39
|
+
if (remaining === 0) return yield* Effect.fail(new Timeout({
|
|
40
|
+
dependency: request.url
|
|
41
|
+
}));
|
|
42
|
+
// The signal is tied to this fiber: a caller that goes away interrupts it,
|
|
43
|
+
// and the request below is aborted rather than left to finish.
|
|
6
44
|
const response = yield* Effect.tryPromise({
|
|
7
|
-
try: ()=>fetch(request.url, {
|
|
45
|
+
try: (signal)=>fetch(request.url, {
|
|
8
46
|
method: request.method,
|
|
9
|
-
headers: request.headers,
|
|
10
|
-
|
|
47
|
+
headers: _extends({}, request.headers, remaining === undefined ? {} : {
|
|
48
|
+
[DEADLINE_HEADER]: String(remaining)
|
|
49
|
+
}),
|
|
50
|
+
body: request.body ? JSON.stringify(request.body) : undefined,
|
|
51
|
+
signal
|
|
11
52
|
}),
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
53
|
+
// Only reached without an answer: a network error or a refused
|
|
54
|
+
// connection. An interruption aborts through the signal instead.
|
|
55
|
+
catch: ()=>new Unavailable({
|
|
56
|
+
dependency: dependencyOf(request.url)
|
|
15
57
|
})
|
|
16
58
|
});
|
|
17
|
-
//
|
|
59
|
+
// A failure answers as the failure that was sent: a problem body decodes
|
|
60
|
+
// into its registered class with its typed fields, so a business `409`
|
|
61
|
+
// reaches the browser as the refusal it is and never as a connection
|
|
62
|
+
// error. A body that is not a problem — a proxy's, a host route that still
|
|
63
|
+
// writes its own — decodes as `ProtocolFailure` carrying the status.
|
|
18
64
|
if (!response.ok) {
|
|
19
|
-
|
|
20
|
-
// `code` into `details` is what lets the browser render a translated
|
|
21
|
-
// message instead of the service's English `error` string. A body that is
|
|
22
|
-
// not JSON is not itself a failure — the status already is one.
|
|
23
|
-
const failure = yield* Effect.promise(()=>response.json().then((parsed)=>parsed, ()=>({})));
|
|
24
|
-
const code = failure['code'];
|
|
25
|
-
yield* Effect.fail(new EntifixConnError(`HTTP request failed with status ${response.status}: ${response.statusText}`, undefined, _extends({
|
|
26
|
-
status: response.status,
|
|
27
|
-
statusText: response.statusText,
|
|
28
|
-
url: request.url,
|
|
29
|
-
method: request.method
|
|
30
|
-
}, typeof code === 'string' ? {
|
|
31
|
-
code
|
|
32
|
-
} : {})));
|
|
65
|
+
return yield* Effect.fail((yield* failureOf(response, request)));
|
|
33
66
|
}
|
|
34
|
-
// Parse the response body as JSON. If parse fails, fail with an EntifixExternalError with details about the failure.
|
|
35
67
|
const body = yield* Effect.tryPromise({
|
|
36
68
|
try: ()=>response.json(),
|
|
37
|
-
catch: (
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
status: response.status,
|
|
41
|
-
statusText: response.statusText
|
|
69
|
+
catch: ()=>new ProtocolFailure({
|
|
70
|
+
reason: `${request.method} ${request.url} answered a body that is not JSON`,
|
|
71
|
+
upstreamStatus: response.status
|
|
42
72
|
})
|
|
43
73
|
});
|
|
44
74
|
// Return the HttpResponse object
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/clients/fetch/fetch-client.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../../src/clients/fetch/fetch-client.ts"],"sourcesContent":["import {\n currentRemainingMs,\n DEADLINE_HEADER,\n decodeProblem,\n type EntifixFailure,\n Overloaded,\n PROBLEM_CONTENT_TYPE,\n ProtocolFailure,\n Timeout,\n Unavailable,\n} from '@entifix/core';\nimport { Effect } from 'effect';\n\nimport { HttpRequest, HttpResponse } from '../types.js';\n\n/** The host a request went to, which is what a failure names as its dependency. */\nconst dependencyOf = (url: string): string => {\n try {\n return new URL(url).host;\n } catch {\n return url;\n }\n};\n\n/**\n * The failure a non-2xx answer carries. `Retry-After` in seconds is copied\n * onto an `Overloaded` that did not say itself when to come back.\n */\nconst failureOf = (response: Response, request: HttpRequest<unknown>) =>\n Effect.gen(function* () {\n const text = yield* Effect.promise(() => response.text());\n const isProblem =\n response.headers.get('content-type')?.startsWith(PROBLEM_CONTENT_TYPE) ===\n true;\n if (!isProblem)\n return new ProtocolFailure({\n reason: `${request.method} ${request.url} answered ${String(response.status)} without a problem body`,\n upstreamStatus: response.status,\n }) as EntifixFailure;\n\n const failure = decodeProblem(parseOr(text), response.status);\n const retryAfter = Number(response.headers.get('retry-after'));\n return failure._tag === 'Overloaded' &&\n !('retryAfterSeconds' in failure) &&\n Number.isFinite(retryAfter) &&\n retryAfter > 0\n ? new Overloaded({ retryAfterSeconds: retryAfter })\n : failure;\n });\n\nconst parseOr = (text: string): unknown => {\n try {\n return JSON.parse(text) as unknown;\n } catch {\n return undefined;\n }\n};\n\nexport const performHttpRequestThroughFetch = <TResponseBody>(\n request: HttpRequest<unknown>,\n) =>\n Effect.gen(function* () {\n // The caller's remaining budget travels on, minus what is already spent,\n // and a budget already spent is not worth a round trip (ADR 0014).\n const remaining = yield* currentRemainingMs;\n if (remaining === 0)\n return yield* Effect.fail(new Timeout({ dependency: request.url }));\n\n // The signal is tied to this fiber: a caller that goes away interrupts it,\n // and the request below is aborted rather than left to finish.\n const response = yield* Effect.tryPromise({\n try: signal =>\n fetch(request.url, {\n method: request.method,\n headers: {\n ...request.headers,\n ...(remaining === undefined\n ? {}\n : { [DEADLINE_HEADER]: String(remaining) }),\n },\n body: request.body ? JSON.stringify(request.body) : undefined,\n signal,\n }),\n // Only reached without an answer: a network error or a refused\n // connection. An interruption aborts through the signal instead.\n catch: () => new Unavailable({ dependency: dependencyOf(request.url) }),\n });\n\n // A failure answers as the failure that was sent: a problem body decodes\n // into its registered class with its typed fields, so a business `409`\n // reaches the browser as the refusal it is and never as a connection\n // error. A body that is not a problem — a proxy's, a host route that still\n // writes its own — decodes as `ProtocolFailure` carrying the status.\n if (!response.ok) {\n return yield* Effect.fail(yield* failureOf(response, request));\n }\n\n const body = yield* Effect.tryPromise({\n try: () => response.json() as Promise<TResponseBody>,\n catch: () =>\n new ProtocolFailure({\n reason: `${request.method} ${request.url} answered a body that is not JSON`,\n upstreamStatus: response.status,\n }),\n });\n\n // Return the HttpResponse object\n const httpResponse: HttpResponse<TResponseBody> = {\n status: response.status,\n headers: Object.fromEntries(response.headers.entries()),\n body,\n };\n\n return httpResponse;\n });\n"],"names":["currentRemainingMs","DEADLINE_HEADER","decodeProblem","Overloaded","PROBLEM_CONTENT_TYPE","ProtocolFailure","Timeout","Unavailable","Effect","dependencyOf","url","URL","host","failureOf","response","request","gen","text","promise","isProblem","headers","get","startsWith","reason","method","String","status","upstreamStatus","failure","parseOr","retryAfter","Number","_tag","isFinite","retryAfterSeconds","JSON","parse","undefined","performHttpRequestThroughFetch","remaining","fail","dependency","tryPromise","try","signal","fetch","body","stringify","catch","ok","json","httpResponse","Object","fromEntries","entries"],"mappings":";AAAA,SACEA,kBAAkB,EAClBC,eAAe,EACfC,aAAa,EAEbC,UAAU,EACVC,oBAAoB,EACpBC,eAAe,EACfC,OAAO,EACPC,WAAW,QACN,gBAAgB;AACvB,SAASC,MAAM,QAAQ,SAAS;AAIhC,iFAAiF,GACjF,MAAMC,eAAe,CAACC;IACpB,IAAI;QACF,OAAO,IAAIC,IAAID,KAAKE,IAAI;IAC1B,EAAE,eAAM;QACN,OAAOF;IACT;AACF;AAEA;;;CAGC,GACD,MAAMG,YAAY,CAACC,UAAoBC,UACrCP,OAAOQ,GAAG,CAAC;YAGPF;QAFF,MAAMG,OAAO,OAAOT,OAAOU,OAAO,CAAC,IAAMJ,SAASG,IAAI;QACtD,MAAME,YACJL,EAAAA,wBAAAA,SAASM,OAAO,CAACC,GAAG,CAAC,oCAArBP,sBAAsCQ,UAAU,CAAClB,2BACjD;QACF,IAAI,CAACe,WACH,OAAO,IAAId,gBAAgB;YACzBkB,QAAQ,GAAGR,QAAQS,MAAM,CAAC,CAAC,EAAET,QAAQL,GAAG,CAAC,UAAU,EAAEe,OAAOX,SAASY,MAAM,EAAE,uBAAuB,CAAC;YACrGC,gBAAgBb,SAASY,MAAM;QACjC;QAEF,MAAME,UAAU1B,cAAc2B,QAAQZ,OAAOH,SAASY,MAAM;QAC5D,MAAMI,aAAaC,OAAOjB,SAASM,OAAO,CAACC,GAAG,CAAC;QAC/C,OAAOO,QAAQI,IAAI,KAAK,gBACtB,CAAE,CAAA,uBAAuBJ,OAAM,KAC/BG,OAAOE,QAAQ,CAACH,eAChBA,aAAa,IACX,IAAI3B,WAAW;YAAE+B,mBAAmBJ;QAAW,KAC/CF;IACN;AAEF,MAAMC,UAAU,CAACZ;IACf,IAAI;QACF,OAAOkB,KAAKC,KAAK,CAACnB;IACpB,EAAE,eAAM;QACN,OAAOoB;IACT;AACF;AAEA,OAAO,MAAMC,iCAAiC,CAC5CvB,UAEAP,OAAOQ,GAAG,CAAC;QACT,yEAAyE;QACzE,mEAAmE;QACnE,MAAMuB,YAAY,OAAOvC;QACzB,IAAIuC,cAAc,GAChB,OAAO,OAAO/B,OAAOgC,IAAI,CAAC,IAAIlC,QAAQ;YAAEmC,YAAY1B,QAAQL,GAAG;QAAC;QAElE,2EAA2E;QAC3E,+DAA+D;QAC/D,MAAMI,WAAW,OAAON,OAAOkC,UAAU,CAAC;YACxCC,KAAKC,CAAAA,SACHC,MAAM9B,QAAQL,GAAG,EAAE;oBACjBc,QAAQT,QAAQS,MAAM;oBACtBJ,SAAS,aACJL,QAAQK,OAAO,EACdmB,cAAcF,YACd,CAAC,IACD;wBAAE,CAACpC,gBAAgB,EAAEwB,OAAOc;oBAAW;oBAE7CO,MAAM/B,QAAQ+B,IAAI,GAAGX,KAAKY,SAAS,CAAChC,QAAQ+B,IAAI,IAAIT;oBACpDO;gBACF;YACF,+DAA+D;YAC/D,iEAAiE;YACjEI,OAAO,IAAM,IAAIzC,YAAY;oBAAEkC,YAAYhC,aAAaM,QAAQL,GAAG;gBAAE;QACvE;QAEA,yEAAyE;QACzE,uEAAuE;QACvE,qEAAqE;QACrE,2EAA2E;QAC3E,qEAAqE;QACrE,IAAI,CAACI,SAASmC,EAAE,EAAE;YAChB,OAAO,OAAOzC,OAAOgC,IAAI,CAAC,CAAA,OAAO3B,UAAUC,UAAUC,QAAO;QAC9D;QAEA,MAAM+B,OAAO,OAAOtC,OAAOkC,UAAU,CAAC;YACpCC,KAAK,IAAM7B,SAASoC,IAAI;YACxBF,OAAO,IACL,IAAI3C,gBAAgB;oBAClBkB,QAAQ,GAAGR,QAAQS,MAAM,CAAC,CAAC,EAAET,QAAQL,GAAG,CAAC,iCAAiC,CAAC;oBAC3EiB,gBAAgBb,SAASY,MAAM;gBACjC;QACJ;QAEA,iCAAiC;QACjC,MAAMyB,eAA4C;YAChDzB,QAAQZ,SAASY,MAAM;YACvBN,SAASgC,OAAOC,WAAW,CAACvC,SAASM,OAAO,CAACkC,OAAO;YACpDR;QACF;QAEA,OAAOK;IACT,GAAG"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './adapters/entity-metadata/make-entity-metadata-source/index.js';
|
|
2
2
|
export * from './adapters/entity-rest/build-entity-rest-adapter-delete/index.js';
|
|
3
|
+
export * from './adapters/entity-rest/build-entity-rest-adapter-facets/index.js';
|
|
3
4
|
export * from './adapters/entity-rest/build-entity-rest-adapter-get/index.js';
|
|
4
5
|
export * from './adapters/entity-rest/build-entity-rest-adapter-load/index.js';
|
|
5
6
|
export * from './adapters/entity-rest/build-entity-rest-adapter-save/index.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iEAAiE,CAAC;AAChF,cAAc,kEAAkE,CAAC;AACjF,cAAc,+DAA+D,CAAC;AAC9E,cAAc,gEAAgE,CAAC;AAC/E,cAAc,gEAAgE,CAAC;AAC/E,cAAc,iCAAiC,CAAC;AAChD,cAAc,wEAAwE,CAAC;AACvF,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iCAAiC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iEAAiE,CAAC;AAChF,cAAc,kEAAkE,CAAC;AACjF,cAAc,kEAAkE,CAAC;AACjF,cAAc,+DAA+D,CAAC;AAC9E,cAAc,gEAAgE,CAAC;AAC/E,cAAc,gEAAgE,CAAC;AAC/E,cAAc,iCAAiC,CAAC;AAChD,cAAc,wEAAwE,CAAC;AACvF,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iCAAiC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './adapters/entity-metadata/make-entity-metadata-source/index.js';
|
|
2
2
|
export * from './adapters/entity-rest/build-entity-rest-adapter-delete/index.js';
|
|
3
|
+
export * from './adapters/entity-rest/build-entity-rest-adapter-facets/index.js';
|
|
3
4
|
export * from './adapters/entity-rest/build-entity-rest-adapter-get/index.js';
|
|
4
5
|
export * from './adapters/entity-rest/build-entity-rest-adapter-load/index.js';
|
|
5
6
|
export * from './adapters/entity-rest/build-entity-rest-adapter-save/index.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './adapters/entity-metadata/make-entity-metadata-source/index.js';\nexport * from './adapters/entity-rest/build-entity-rest-adapter-delete/index.js';\nexport * from './adapters/entity-rest/build-entity-rest-adapter-get/index.js';\nexport * from './adapters/entity-rest/build-entity-rest-adapter-load/index.js';\nexport * from './adapters/entity-rest/build-entity-rest-adapter-save/index.js';\nexport * from './adapters/entity-rest/types.js';\nexport * from './adapters/transaction-status/build-transaction-status-reader/index.js';\nexport * from './clients/fetch/index.js';\nexport * from './clients/types.js';\nexport * from './configuration-client/index.js';\n"],"names":[],"mappings":"AAAA,cAAc,kEAAkE;AAChF,cAAc,mEAAmE;AACjF,cAAc,gEAAgE;AAC9E,cAAc,iEAAiE;AAC/E,cAAc,iEAAiE;AAC/E,cAAc,kCAAkC;AAChD,cAAc,yEAAyE;AACvF,cAAc,2BAA2B;AACzC,cAAc,qBAAqB;AACnC,cAAc,kCAAkC"}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './adapters/entity-metadata/make-entity-metadata-source/index.js';\nexport * from './adapters/entity-rest/build-entity-rest-adapter-delete/index.js';\nexport * from './adapters/entity-rest/build-entity-rest-adapter-facets/index.js';\nexport * from './adapters/entity-rest/build-entity-rest-adapter-get/index.js';\nexport * from './adapters/entity-rest/build-entity-rest-adapter-load/index.js';\nexport * from './adapters/entity-rest/build-entity-rest-adapter-save/index.js';\nexport * from './adapters/entity-rest/types.js';\nexport * from './adapters/transaction-status/build-transaction-status-reader/index.js';\nexport * from './clients/fetch/index.js';\nexport * from './clients/types.js';\nexport * from './configuration-client/index.js';\n"],"names":[],"mappings":"AAAA,cAAc,kEAAkE;AAChF,cAAc,mEAAmE;AACjF,cAAc,mEAAmE;AACjF,cAAc,gEAAgE;AAC9E,cAAc,iEAAiE;AAC/E,cAAc,iEAAiE;AAC/E,cAAc,kCAAkC;AAChD,cAAc,yEAAyE;AACvF,cAAc,2BAA2B;AACzC,cAAc,qBAAqB;AACnC,cAAc,kCAAkC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@entifix/rest",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
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": {
|
|
@@ -51,14 +51,14 @@
|
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@swc/helpers": "0.5.23",
|
|
54
|
-
"@entifix/core": "0.
|
|
55
|
-
"@entifix/transactions": "0.
|
|
54
|
+
"@entifix/core": "0.10.0",
|
|
55
|
+
"@entifix/transactions": "0.10.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"effect": "4.0.
|
|
59
|
-
"@entifix/testing-unit": "0.
|
|
58
|
+
"effect": "4.0.6",
|
|
59
|
+
"@entifix/testing-unit": "0.10.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
|
-
"effect": "^4.0.
|
|
62
|
+
"effect": "^4.0.6"
|
|
63
63
|
}
|
|
64
64
|
}
|