@entifix/business 0.4.2 → 0.5.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.
@@ -1,6 +1,5 @@
1
1
  import { type Entity, type EntityConstructor, type EntityLinkResolver } from '@entifix/core';
2
2
  import { Context } from 'effect';
3
- import { ConfigurationRepositoryTag } from './config.repository.js';
4
3
  import { EntityRepositoryTag } from './entity.repository.js';
5
4
  declare const EntityLinkResolverTag_base: Context.ServiceClass<EntityLinkResolverTag, "EntityLinkResolverTag", EntityLinkResolver>;
6
5
  /**
@@ -19,9 +18,8 @@ export type EntityLinkRegistration = readonly [
19
18
  ];
20
19
  /**
21
20
  * Assembles an {@link EntityLinkResolverTag} context from repository adapters
22
- * that already exist. Each registration's `get` is closed over the
23
- * configuration context, so the resulting resolver effects have no outstanding
24
- * requirements.
21
+ * that already exist. A repository requires nothing from its environment, so
22
+ * neither does the resolver built from them.
25
23
  *
26
24
  * It lives here, beside the tag, rather than with React's `useEntityLinkResolver`
27
25
  * — which is only a `useMemo` around it — because nothing about it is React.
@@ -29,6 +27,6 @@ export type EntityLinkRegistration = readonly [
29
27
  * package's whole barrel, hooks included, and Next rejects `useState` reaching
30
28
  * a server module. Framework-free code belongs at a framework-free layer.
31
29
  */
32
- export declare function createEntityLinkResolver(configurationStore: Context.Context<ConfigurationRepositoryTag>, registrations: ReadonlyArray<EntityLinkRegistration>): Context.Context<EntityLinkResolverTag>;
30
+ export declare function createEntityLinkResolver(registrations: ReadonlyArray<EntityLinkRegistration>): Context.Context<EntityLinkResolverTag>;
33
31
  export {};
34
32
  //# sourceMappingURL=entity-link-resolver.repository.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"entity-link-resolver.repository.d.ts","sourceRoot":"","sources":["../../src/repository/entity-link-resolver.repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,MAAM,EACX,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACxB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAU,MAAM,QAAQ,CAAC;AAEzC,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;;AAE7D;;;;;;GAMG;AACH,qBAAa,qBAAsB,SAAQ,0BAGf;CAAG;AAE/B,8EAA8E;AAC9E,MAAM,MAAM,sBAAsB,GAAG,SAAS;IAC5C,iBAAiB,CAAC,MAAM,CAAC;IACzB,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC;CACrC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CACtC,kBAAkB,EAAE,OAAO,CAAC,OAAO,CAAC,0BAA0B,CAAC,EAC/D,aAAa,EAAE,aAAa,CAAC,sBAAsB,CAAC,GACnD,OAAO,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAiCxC"}
1
+ {"version":3,"file":"entity-link-resolver.repository.d.ts","sourceRoot":"","sources":["../../src/repository/entity-link-resolver.repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,MAAM,EACX,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACxB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAU,MAAM,QAAQ,CAAC;AAEzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;;AAE7D;;;;;;GAMG;AACH,qBAAa,qBAAsB,SAAQ,0BAGf;CAAG;AAE/B,8EAA8E;AAC9E,MAAM,MAAM,sBAAsB,GAAG,SAAS;IAC5C,iBAAiB,CAAC,MAAM,CAAC;IACzB,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC;CACrC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,aAAa,CAAC,sBAAsB,CAAC,GACnD,OAAO,CAAC,OAAO,CAAC,qBAAqB,CAAC,CA8BxC"}
@@ -11,16 +11,15 @@ import { EntityRepositoryTag } from './entity.repository.js';
11
11
  }
12
12
  /**
13
13
  * Assembles an {@link EntityLinkResolverTag} context from repository adapters
14
- * that already exist. Each registration's `get` is closed over the
15
- * configuration context, so the resulting resolver effects have no outstanding
16
- * requirements.
14
+ * that already exist. A repository requires nothing from its environment, so
15
+ * neither does the resolver built from them.
17
16
  *
18
17
  * It lives here, beside the tag, rather than with React's `useEntityLinkResolver`
19
18
  * — which is only a `useMemo` around it — because nothing about it is React.
20
19
  * A server component that imported it from the React package would pull that
21
20
  * package's whole barrel, hooks included, and Next rejects `useState` reaching
22
21
  * a server module. Framework-free code belongs at a framework-free layer.
23
- */ export function createEntityLinkResolver(configurationStore, registrations) {
22
+ */ export function createEntityLinkResolver(registrations) {
24
23
  const repositoryByConstructor = new Map(registrations.map(([entityConstructor, repositoryContext])=>[
25
24
  entityConstructor,
26
25
  Context.get(repositoryContext, EntityRepositoryTag)
@@ -33,7 +32,7 @@ import { EntityRepositoryTag } from './entity.repository.js';
33
32
  entity: entityConstructor.name
34
33
  }));
35
34
  }
36
- return Effect.provide(repository.get(id), configurationStore);
35
+ return repository.get(id);
37
36
  }
38
37
  };
39
38
  return Context.make(EntityLinkResolverTag, resolver);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/repository/entity-link-resolver.repository.ts"],"sourcesContent":["import {\n type EntifixError,\n EntifixLogicError,\n type Entity,\n type EntityConstructor,\n type EntityLinkResolver,\n} from '@entifix/core';\nimport { Context, Effect } from 'effect';\n\nimport { ConfigurationRepositoryTag } from './config.repository.js';\nimport { EntityRepositoryTag } from './entity.repository.js';\n\n/**\n * DI tag for the {@link EntityLinkResolver} an environment provides so entity\n * links can materialize their targets. The composition root supplies a resolver\n * backed by the appropriate adapters (REST on the web, Mongo on the backend),\n * and use-cases that follow links yield this tag rather than depending on any\n * concrete repository.\n */\nexport class EntityLinkResolverTag extends Context.Service<\n EntityLinkResolverTag,\n EntityLinkResolver\n>()('EntityLinkResolverTag') {}\n\n/** Maps a link target constructor to the repository adapter that loads it. */\nexport type EntityLinkRegistration = readonly [\n EntityConstructor<Entity>,\n Context.Context<EntityRepositoryTag>,\n];\n\n/**\n * Assembles an {@link EntityLinkResolverTag} context from repository adapters\n * that already exist. Each registration's `get` is closed over the\n * configuration context, so the resulting resolver effects have no outstanding\n * requirements.\n *\n * It lives here, beside the tag, rather than with React's `useEntityLinkResolver`\n * — which is only a `useMemo` around it — because nothing about it is React.\n * A server component that imported it from the React package would pull that\n * package's whole barrel, hooks included, and Next rejects `useState` reaching\n * a server module. Framework-free code belongs at a framework-free layer.\n */\nexport function createEntityLinkResolver(\n configurationStore: Context.Context<ConfigurationRepositoryTag>,\n registrations: ReadonlyArray<EntityLinkRegistration>,\n): Context.Context<EntityLinkResolverTag> {\n const repositoryByConstructor = new Map(\n registrations.map(\n ([entityConstructor, repositoryContext]) =>\n [\n entityConstructor,\n Context.get(repositoryContext, EntityRepositoryTag),\n ] as const,\n ),\n );\n\n const resolver: EntityLinkResolver = {\n resolve(entityConstructor, id) {\n const repository = repositoryByConstructor.get(\n entityConstructor as EntityConstructor<Entity>,\n );\n if (!repository) {\n return Effect.fail(\n new EntifixLogicError(\n `No link resolver registered for entity \"${entityConstructor.name}\"`,\n undefined,\n { entity: entityConstructor.name },\n ),\n );\n }\n return Effect.provide(\n repository.get(id),\n configurationStore,\n ) as Effect.Effect<never, EntifixError>;\n },\n };\n\n return Context.make(EntityLinkResolverTag, resolver);\n}\n"],"names":["EntifixLogicError","Context","Effect","EntityRepositoryTag","EntityLinkResolverTag","Service","createEntityLinkResolver","configurationStore","registrations","repositoryByConstructor","Map","map","entityConstructor","repositoryContext","get","resolver","resolve","id","repository","fail","name","undefined","entity","provide","make"],"mappings":"AAAA,SAEEA,iBAAiB,QAIZ,gBAAgB;AACvB,SAASC,OAAO,EAAEC,MAAM,QAAQ,SAAS;AAGzC,SAASC,mBAAmB,QAAQ,yBAAyB;AAE7D;;;;;;CAMC,GACD,OAAO,MAAMC,8BAA8BH,QAAQI,OAAO,GAGtD;AAA0B;AAQ9B;;;;;;;;;;;CAWC,GACD,OAAO,SAASC,yBACdC,kBAA+D,EAC/DC,aAAoD;IAEpD,MAAMC,0BAA0B,IAAIC,IAClCF,cAAcG,GAAG,CACf,CAAC,CAACC,mBAAmBC,kBAAkB,GACrC;YACED;YACAX,QAAQa,GAAG,CAACD,mBAAmBV;SAChC;IAIP,MAAMY,WAA+B;QACnCC,SAAQJ,iBAAiB,EAAEK,EAAE;YAC3B,MAAMC,aAAaT,wBAAwBK,GAAG,CAC5CF;YAEF,IAAI,CAACM,YAAY;gBACf,OAAOhB,OAAOiB,IAAI,CAChB,IAAInB,kBACF,CAAC,wCAAwC,EAAEY,kBAAkBQ,IAAI,CAAC,CAAC,CAAC,EACpEC,WACA;oBAAEC,QAAQV,kBAAkBQ,IAAI;gBAAC;YAGvC;YACA,OAAOlB,OAAOqB,OAAO,CACnBL,WAAWJ,GAAG,CAACG,KACfV;QAEJ;IACF;IAEA,OAAON,QAAQuB,IAAI,CAACpB,uBAAuBW;AAC7C"}
1
+ {"version":3,"sources":["../../src/repository/entity-link-resolver.repository.ts"],"sourcesContent":["import {\n type EntifixError,\n EntifixLogicError,\n type Entity,\n type EntityConstructor,\n type EntityLinkResolver,\n} from '@entifix/core';\nimport { Context, Effect } from 'effect';\n\nimport { EntityRepositoryTag } from './entity.repository.js';\n\n/**\n * DI tag for the {@link EntityLinkResolver} an environment provides so entity\n * links can materialize their targets. The composition root supplies a resolver\n * backed by the appropriate adapters (REST on the web, Mongo on the backend),\n * and use-cases that follow links yield this tag rather than depending on any\n * concrete repository.\n */\nexport class EntityLinkResolverTag extends Context.Service<\n EntityLinkResolverTag,\n EntityLinkResolver\n>()('EntityLinkResolverTag') {}\n\n/** Maps a link target constructor to the repository adapter that loads it. */\nexport type EntityLinkRegistration = readonly [\n EntityConstructor<Entity>,\n Context.Context<EntityRepositoryTag>,\n];\n\n/**\n * Assembles an {@link EntityLinkResolverTag} context from repository adapters\n * that already exist. A repository requires nothing from its environment, so\n * neither does the resolver built from them.\n *\n * It lives here, beside the tag, rather than with React's `useEntityLinkResolver`\n * — which is only a `useMemo` around it — because nothing about it is React.\n * A server component that imported it from the React package would pull that\n * package's whole barrel, hooks included, and Next rejects `useState` reaching\n * a server module. Framework-free code belongs at a framework-free layer.\n */\nexport function createEntityLinkResolver(\n registrations: ReadonlyArray<EntityLinkRegistration>,\n): Context.Context<EntityLinkResolverTag> {\n const repositoryByConstructor = new Map(\n registrations.map(\n ([entityConstructor, repositoryContext]) =>\n [\n entityConstructor,\n Context.get(repositoryContext, EntityRepositoryTag),\n ] as const,\n ),\n );\n\n const resolver: EntityLinkResolver = {\n resolve(entityConstructor, id) {\n const repository = repositoryByConstructor.get(\n entityConstructor as EntityConstructor<Entity>,\n );\n if (!repository) {\n return Effect.fail(\n new EntifixLogicError(\n `No link resolver registered for entity \"${entityConstructor.name}\"`,\n undefined,\n { entity: entityConstructor.name },\n ),\n );\n }\n return repository.get(id) as Effect.Effect<never, EntifixError>;\n },\n };\n\n return Context.make(EntityLinkResolverTag, resolver);\n}\n"],"names":["EntifixLogicError","Context","Effect","EntityRepositoryTag","EntityLinkResolverTag","Service","createEntityLinkResolver","registrations","repositoryByConstructor","Map","map","entityConstructor","repositoryContext","get","resolver","resolve","id","repository","fail","name","undefined","entity","make"],"mappings":"AAAA,SAEEA,iBAAiB,QAIZ,gBAAgB;AACvB,SAASC,OAAO,EAAEC,MAAM,QAAQ,SAAS;AAEzC,SAASC,mBAAmB,QAAQ,yBAAyB;AAE7D;;;;;;CAMC,GACD,OAAO,MAAMC,8BAA8BH,QAAQI,OAAO,GAGtD;AAA0B;AAQ9B;;;;;;;;;;CAUC,GACD,OAAO,SAASC,yBACdC,aAAoD;IAEpD,MAAMC,0BAA0B,IAAIC,IAClCF,cAAcG,GAAG,CACf,CAAC,CAACC,mBAAmBC,kBAAkB,GACrC;YACED;YACAV,QAAQY,GAAG,CAACD,mBAAmBT;SAChC;IAIP,MAAMW,WAA+B;QACnCC,SAAQJ,iBAAiB,EAAEK,EAAE;YAC3B,MAAMC,aAAaT,wBAAwBK,GAAG,CAC5CF;YAEF,IAAI,CAACM,YAAY;gBACf,OAAOf,OAAOgB,IAAI,CAChB,IAAIlB,kBACF,CAAC,wCAAwC,EAAEW,kBAAkBQ,IAAI,CAAC,CAAC,CAAC,EACpEC,WACA;oBAAEC,QAAQV,kBAAkBQ,IAAI;gBAAC;YAGvC;YACA,OAAOF,WAAWJ,GAAG,CAACG;QACxB;IACF;IAEA,OAAOf,QAAQqB,IAAI,CAAClB,uBAAuBU;AAC7C"}
@@ -1,12 +1,21 @@
1
1
  import type { EntifixError, Entity, EntityId, EntityLoadRequest, EntityPage } from '@entifix/core';
2
2
  import { Context } from 'effect';
3
3
  import { Effect } from 'effect/Effect';
4
- import { ConfigurationRepositoryTag } from './config.repository.js';
4
+ /**
5
+ * Where a use case reads and writes one entity's records.
6
+ *
7
+ * ⚠️ **Every method requires nothing from its environment.** An adapter that
8
+ * needs something to do its job — a REST client's base URL, a database handle —
9
+ * binds it when the adapter is built, so the port says only what every adapter
10
+ * has in common. A requirement here would be one adapter's mechanism leaked into
11
+ * every use case, and every caller of a static or in-memory adapter would have
12
+ * to provide a value it never reads.
13
+ */
5
14
  export interface EntityRepository {
6
- get<TEntity extends Entity>(id: EntityId): Effect<TEntity, EntifixError, ConfigurationRepositoryTag>;
7
- load<TEntity extends Entity>(request: EntityLoadRequest<TEntity>): Effect<EntityPage<TEntity>, EntifixError, ConfigurationRepositoryTag>;
8
- save<TEntity extends Entity>(entity: TEntity): Effect<TEntity, EntifixError, ConfigurationRepositoryTag>;
9
- delete<TEntity extends Entity>(entityOrId: EntityId | TEntity): Effect<void, EntifixError, ConfigurationRepositoryTag>;
15
+ get<TEntity extends Entity>(id: EntityId): Effect<TEntity, EntifixError>;
16
+ load<TEntity extends Entity>(request: EntityLoadRequest<TEntity>): Effect<EntityPage<TEntity>, EntifixError>;
17
+ save<TEntity extends Entity>(entity: TEntity): Effect<TEntity, EntifixError>;
18
+ delete<TEntity extends Entity>(entityOrId: EntityId | TEntity): Effect<void, EntifixError>;
10
19
  }
11
20
  declare const EntityRepositoryTag_base: Context.ServiceClass<EntityRepositoryTag, "EntityRepositoryTag", EntityRepository>;
12
21
  export declare class EntityRepositoryTag extends EntityRepositoryTag_base {
@@ -1 +1 @@
1
- {"version":3,"file":"entity.repository.d.ts","sourceRoot":"","sources":["../../src/repository/entity.repository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,iBAAiB,EACjB,UAAU,EACX,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAEpE,MAAM,WAAW,gBAAgB;IAC/B,GAAG,CAAC,OAAO,SAAS,MAAM,EACxB,EAAE,EAAE,QAAQ,GACX,MAAM,CAAC,OAAO,EAAE,YAAY,EAAE,0BAA0B,CAAC,CAAC;IAC7D,IAAI,CAAC,OAAO,SAAS,MAAM,EACzB,OAAO,EAAE,iBAAiB,CAAC,OAAO,CAAC,GAClC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,YAAY,EAAE,0BAA0B,CAAC,CAAC;IACzE,IAAI,CAAC,OAAO,SAAS,MAAM,EACzB,MAAM,EAAE,OAAO,GACd,MAAM,CAAC,OAAO,EAAE,YAAY,EAAE,0BAA0B,CAAC,CAAC;IAC7D,MAAM,CAAC,OAAO,SAAS,MAAM,EAC3B,UAAU,EAAE,QAAQ,GAAG,OAAO,GAC7B,MAAM,CAAC,IAAI,EAAE,YAAY,EAAE,0BAA0B,CAAC,CAAC;CAC3D;;AAED,qBAAa,mBAAoB,SAAQ,wBAGf;CAAG"}
1
+ {"version":3,"file":"entity.repository.d.ts","sourceRoot":"","sources":["../../src/repository/entity.repository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,iBAAiB,EACjB,UAAU,EACX,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC;;;;;;;;;GASG;AACH,MAAM,WAAW,gBAAgB;IAC/B,GAAG,CAAC,OAAO,SAAS,MAAM,EAAE,EAAE,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IACzE,IAAI,CAAC,OAAO,SAAS,MAAM,EACzB,OAAO,EAAE,iBAAiB,CAAC,OAAO,CAAC,GAClC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC,CAAC;IAC7C,IAAI,CAAC,OAAO,SAAS,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAC7E,MAAM,CAAC,OAAO,SAAS,MAAM,EAC3B,UAAU,EAAE,QAAQ,GAAG,OAAO,GAC7B,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;CAC/B;;AAED,qBAAa,mBAAoB,SAAQ,wBAGf;CAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/repository/entity.repository.ts"],"sourcesContent":["import type {\n EntifixError,\n Entity,\n EntityId,\n EntityLoadRequest,\n EntityPage,\n} from '@entifix/core';\nimport { Context } from 'effect';\nimport { Effect } from 'effect/Effect';\n\nimport { ConfigurationRepositoryTag } from './config.repository.js';\n\nexport interface EntityRepository {\n get<TEntity extends Entity>(\n id: EntityId,\n ): Effect<TEntity, EntifixError, ConfigurationRepositoryTag>;\n load<TEntity extends Entity>(\n request: EntityLoadRequest<TEntity>,\n ): Effect<EntityPage<TEntity>, EntifixError, ConfigurationRepositoryTag>;\n save<TEntity extends Entity>(\n entity: TEntity,\n ): Effect<TEntity, EntifixError, ConfigurationRepositoryTag>;\n delete<TEntity extends Entity>(\n entityOrId: EntityId | TEntity,\n ): Effect<void, EntifixError, ConfigurationRepositoryTag>;\n}\n\nexport class EntityRepositoryTag extends Context.Service<\n EntityRepositoryTag,\n EntityRepository\n>()('EntityRepositoryTag') {}\n"],"names":["Context","EntityRepositoryTag","Service"],"mappings":"AAOA,SAASA,OAAO,QAAQ,SAAS;AAoBjC,OAAO,MAAMC,4BAA4BD,QAAQE,OAAO,GAGpD;AAAwB"}
1
+ {"version":3,"sources":["../../src/repository/entity.repository.ts"],"sourcesContent":["import type {\n EntifixError,\n Entity,\n EntityId,\n EntityLoadRequest,\n EntityPage,\n} from '@entifix/core';\nimport { Context } from 'effect';\nimport { Effect } from 'effect/Effect';\n\n/**\n * Where a use case reads and writes one entity's records.\n *\n * ⚠️ **Every method requires nothing from its environment.** An adapter that\n * needs something to do its job — a REST client's base URL, a database handle —\n * binds it when the adapter is built, so the port says only what every adapter\n * has in common. A requirement here would be one adapter's mechanism leaked into\n * every use case, and every caller of a static or in-memory adapter would have\n * to provide a value it never reads.\n */\nexport interface EntityRepository {\n get<TEntity extends Entity>(id: EntityId): Effect<TEntity, EntifixError>;\n load<TEntity extends Entity>(\n request: EntityLoadRequest<TEntity>,\n ): Effect<EntityPage<TEntity>, EntifixError>;\n save<TEntity extends Entity>(entity: TEntity): Effect<TEntity, EntifixError>;\n delete<TEntity extends Entity>(\n entityOrId: EntityId | TEntity,\n ): Effect<void, EntifixError>;\n}\n\nexport class EntityRepositoryTag extends Context.Service<\n EntityRepositoryTag,\n EntityRepository\n>()('EntityRepositoryTag') {}\n"],"names":["Context","EntityRepositoryTag","Service"],"mappings":"AAOA,SAASA,OAAO,QAAQ,SAAS;AAwBjC,OAAO,MAAMC,4BAA4BD,QAAQE,OAAO,GAGpD;AAAwB"}
@@ -9,5 +9,5 @@ import { EntityIdTag } from '../../repository/entity-mixins.repository.js';
9
9
  * the only shape a caller ever has at the point of deletion (a table row, a
10
10
  * route param), so that is what this exposes.
11
11
  */
12
- export declare function deleteUCFactory<TEntity extends Entity>(): Effect.Effect<void, import("@entifix/core").EntifixError, import("../../index.js").ConfigurationRepositoryTag | EntityRepositoryTag | EntityIdTag>;
12
+ export declare function deleteUCFactory<TEntity extends Entity>(): Effect.Effect<void, import("@entifix/core").EntifixError, EntityRepositoryTag | EntityIdTag>;
13
13
  //# sourceMappingURL=delete.uc.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"delete.uc.d.ts","sourceRoot":"","sources":["../../../src/use-case/delete/delete.uc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,8CAA8C,CAAC;AAE3E;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,SAAS,MAAM,wJAOrD"}
1
+ {"version":3,"file":"delete.uc.d.ts","sourceRoot":"","sources":["../../../src/use-case/delete/delete.uc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,8CAA8C,CAAC;AAE3E;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,SAAS,MAAM,kGAOrD"}
@@ -8,5 +8,5 @@ import { EntityIdTag } from '../../repository/entity-mixins.repository.js';
8
8
  * The factory's type parameter is what makes the result usable without a cast
9
9
  * at the call site — {@link EntityIdTag} carries no entity type of its own.
10
10
  */
11
- export declare function getUCFactory<TEntity extends Entity>(): Effect.Effect<TEntity, import("@entifix/core").EntifixError, import("../../index.js").ConfigurationRepositoryTag | EntityRepositoryTag | EntityIdTag>;
11
+ export declare function getUCFactory<TEntity extends Entity>(): Effect.Effect<TEntity, import("@entifix/core").EntifixError, EntityRepositoryTag | EntityIdTag>;
12
12
  //# sourceMappingURL=get.uc.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get.uc.d.ts","sourceRoot":"","sources":["../../../src/use-case/get/get.uc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,8CAA8C,CAAC;AAE3E;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,SAAS,MAAM,2JASlD"}
1
+ {"version":3,"file":"get.uc.d.ts","sourceRoot":"","sources":["../../../src/use-case/get/get.uc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,8CAA8C,CAAC;AAE3E;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,SAAS,MAAM,qGASlD"}
@@ -15,5 +15,5 @@ export declare const LOAD_ALL_PAGE_SIZE = 100;
15
15
  * as large as can be counted works against an in-memory source, but a real
16
16
  * adapter would hand that size to its database.
17
17
  */
18
- export declare function loadAllUCFactory<TEntity extends Entity>(pageSize?: number): Effect.Effect<TEntity[], import("@entifix/core").EntifixError, import("../../index.js").ConfigurationRepositoryTag | EntityRepositoryTag | EntityLoadRequestTag>;
18
+ export declare function loadAllUCFactory<TEntity extends Entity>(pageSize?: number): Effect.Effect<TEntity[], import("@entifix/core").EntifixError, EntityRepositoryTag | EntityLoadRequestTag>;
19
19
  //# sourceMappingURL=load-all.uc.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"load-all.uc.d.ts","sourceRoot":"","sources":["../../../src/use-case/load/load-all.uc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AAEpF,4EAA4E;AAC5E,MAAM,MAAM,cAAc,CAAC,OAAO,SAAS,MAAM,IAAI,IAAI,CACvD,iBAAiB,CAAC,OAAO,CAAC,EAC1B,MAAM,GAAG,UAAU,CACpB,CAAC;AAEF,6EAA6E;AAC7E,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAEtC;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,SAAS,MAAM,EACrD,QAAQ,GAAE,MAA2B,oKAuBtC"}
1
+ {"version":3,"file":"load-all.uc.d.ts","sourceRoot":"","sources":["../../../src/use-case/load/load-all.uc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AAEpF,4EAA4E;AAC5E,MAAM,MAAM,cAAc,CAAC,OAAO,SAAS,MAAM,IAAI,IAAI,CACvD,iBAAiB,CAAC,OAAO,CAAC,EAC1B,MAAM,GAAG,UAAU,CACpB,CAAC;AAEF,6EAA6E;AAC7E,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAEtC;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,SAAS,MAAM,EACrD,QAAQ,GAAE,MAA2B,8GAuBtC"}
@@ -2,5 +2,5 @@ import { Entity } from '@entifix/core';
2
2
  import { Effect } from 'effect';
3
3
  import { EntityRepositoryTag } from '../../repository/entity.repository.js';
4
4
  import { EntityLoadRequestTag } from '../../repository/entity-mixins.repository.js';
5
- export declare function loadUCFactory<TEntity extends Entity>(): Effect.Effect<import("@entifix/core").EntityPage<TEntity>, import("@entifix/core").EntifixError, import("../../index.js").ConfigurationRepositoryTag | EntityRepositoryTag | EntityLoadRequestTag>;
5
+ export declare function loadUCFactory<TEntity extends Entity>(): Effect.Effect<import("@entifix/core").EntityPage<TEntity>, import("@entifix/core").EntifixError, EntityRepositoryTag | EntityLoadRequestTag>;
6
6
  //# sourceMappingURL=load.uc.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"load.uc.d.ts","sourceRoot":"","sources":["../../../src/use-case/load/load.uc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AAEpF,wBAAgB,aAAa,CAAC,OAAO,SAAS,MAAM,wMAenD"}
1
+ {"version":3,"file":"load.uc.d.ts","sourceRoot":"","sources":["../../../src/use-case/load/load.uc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AAEpF,wBAAgB,aAAa,CAAC,OAAO,SAAS,MAAM,kJAenD"}
@@ -12,5 +12,5 @@ import { EntityTag } from '../../repository/entity-mixins.repository.js';
12
12
  * taking them as arguments, so the same use-case saves over REST on the web and
13
13
  * over Mongo on a backend.
14
14
  */
15
- export declare function saveUCFactory<TEntity extends Entity>(): Effect.Effect<TEntity, [Effect.Effect<import("../../index.js").EntityRepository, never, EntityRepositoryTag> | Effect.Effect<Entity, never, EntityTag> | Effect.Effect<TEntity, import("@entifix/core").EntifixError, import("../../index.js").ConfigurationRepositoryTag>] extends [Effect.Effect<infer _A, infer E, infer _R>] ? E : never, [Effect.Effect<import("../../index.js").EntityRepository, never, EntityRepositoryTag> | Effect.Effect<Entity, never, EntityTag> | Effect.Effect<TEntity, import("@entifix/core").EntifixError, import("../../index.js").ConfigurationRepositoryTag>] extends [Effect.Effect<infer _A_1, infer _E, infer R>] ? R : never>;
15
+ export declare function saveUCFactory<TEntity extends Entity>(): Effect.Effect<TEntity, [Effect.Effect<import("../../index.js").EntityRepository, never, EntityRepositoryTag> | Effect.Effect<Entity, never, EntityTag> | Effect.Effect<TEntity, import("@entifix/core").EntifixError, never>] extends [Effect.Effect<infer _A, infer E, infer _R>] ? E : never, [Effect.Effect<import("../../index.js").EntityRepository, never, EntityRepositoryTag> | Effect.Effect<Entity, never, EntityTag> | Effect.Effect<TEntity, import("@entifix/core").EntifixError, never>] extends [Effect.Effect<infer _A_1, infer _E, infer R>] ? R : never>;
16
16
  //# sourceMappingURL=save.uc.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"save.uc.d.ts","sourceRoot":"","sources":["../../../src/use-case/save/save.uc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,8CAA8C,CAAC;AAEzE;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,OAAO,SAAS,MAAM,4oBAWnD"}
1
+ {"version":3,"file":"save.uc.d.ts","sourceRoot":"","sources":["../../../src/use-case/save/save.uc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,8CAA8C,CAAC;AAEzE;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,OAAO,SAAS,MAAM,gjBAWnD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@entifix/business",
3
- "version": "0.4.2",
3
+ "version": "0.5.0",
4
4
  "description": "The ports every adapter implements — repository, session, token, health — and the generic get, load, save and delete use-cases.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -51,7 +51,7 @@
51
51
  },
52
52
  "dependencies": {
53
53
  "@swc/helpers": "0.5.23",
54
- "@entifix/core": "0.4.2"
54
+ "@entifix/core": "0.5.0"
55
55
  },
56
56
  "peerDependencies": {
57
57
  "effect": "^4.0.5"