@entifix/core 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/entity-definition/links/link-targets/index.d.ts +2 -0
- package/dist/entity-definition/links/link-targets/index.d.ts.map +1 -0
- package/dist/entity-definition/links/link-targets/index.js +3 -0
- package/dist/entity-definition/links/link-targets/index.js.map +1 -0
- package/dist/entity-definition/links/link-targets/link-targets.d.ts +15 -0
- package/dist/entity-definition/links/link-targets/link-targets.d.ts.map +1 -0
- package/dist/entity-definition/links/link-targets/link-targets.js +24 -0
- package/dist/entity-definition/links/link-targets/link-targets.js.map +1 -0
- package/dist/envelope/types.d.ts +1 -1
- package/dist/envelope/types.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/dist/types/EntityAction.d.ts +2 -2
- package/dist/types/EntityAction.js +2 -2
- package/dist/types/EntityAction.js.map +1 -1
- package/package.json +1 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/entity-definition/links/link-targets/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/entity-definition/links/link-targets/index.ts"],"sourcesContent":["export * from './link-targets.js';\n"],"names":[],"mappings":"AAAA,cAAc,oBAAoB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Entity } from '../../../types/Entity.js';
|
|
2
|
+
import { EntityCollectionLink } from '../entity-collection-link/index.js';
|
|
3
|
+
import { EntityLink } from '../entity-link/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* The record a resolved link names, read without a cast.
|
|
6
|
+
*
|
|
7
|
+
* `value` is `undefined` until the link is resolved, so reading it means a
|
|
8
|
+
* non-null assertion at every call site. This reads it once, and a link
|
|
9
|
+
* nothing resolved fails here, naming it, rather than as an `undefined` deep
|
|
10
|
+
* in a render.
|
|
11
|
+
*/
|
|
12
|
+
export declare function targetOf<TEntity extends Entity>(link: EntityLink<TEntity>): TEntity;
|
|
13
|
+
/** The records a resolved collection names, in its order. */
|
|
14
|
+
export declare function targetsOf<TEntity extends Entity>(links: EntityCollectionLink<TEntity>): TEntity[];
|
|
15
|
+
//# sourceMappingURL=link-targets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-targets.d.ts","sourceRoot":"","sources":["../../../../src/entity-definition/links/link-targets/link-targets.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,OAAO,SAAS,MAAM,EAC7C,IAAI,EAAE,UAAU,CAAC,OAAO,CAAC,GACxB,OAAO,CAQT;AAED,6DAA6D;AAC7D,wBAAgB,SAAS,CAAC,OAAO,SAAS,MAAM,EAC9C,KAAK,EAAE,oBAAoB,CAAC,OAAO,CAAC,GACnC,OAAO,EAAE,CAQX"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { EntifixLogicError } from '../../../base-entities/entifix-error/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* The record a resolved link names, read without a cast.
|
|
4
|
+
*
|
|
5
|
+
* `value` is `undefined` until the link is resolved, so reading it means a
|
|
6
|
+
* non-null assertion at every call site. This reads it once, and a link
|
|
7
|
+
* nothing resolved fails here, naming it, rather than as an `undefined` deep
|
|
8
|
+
* in a render.
|
|
9
|
+
*/ export function targetOf(link) {
|
|
10
|
+
const { value } = link;
|
|
11
|
+
if (value === undefined) {
|
|
12
|
+
throw new EntifixLogicError(`The link to ${link.entityConstructor.name} ${String(link.id)} was read before it was resolved`);
|
|
13
|
+
}
|
|
14
|
+
return value;
|
|
15
|
+
}
|
|
16
|
+
/** The records a resolved collection names, in its order. */ export function targetsOf(links) {
|
|
17
|
+
const { values } = links;
|
|
18
|
+
if (values === undefined) {
|
|
19
|
+
throw new EntifixLogicError(`The links to ${links.entityConstructor.name} were read before they were resolved`);
|
|
20
|
+
}
|
|
21
|
+
return values;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=link-targets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/entity-definition/links/link-targets/link-targets.ts"],"sourcesContent":["import { EntifixLogicError } from '../../../base-entities/entifix-error/index.js';\nimport { Entity } from '../../../types/Entity.js';\nimport { EntityCollectionLink } from '../entity-collection-link/index.js';\nimport { EntityLink } from '../entity-link/index.js';\n\n/**\n * The record a resolved link names, read without a cast.\n *\n * `value` is `undefined` until the link is resolved, so reading it means a\n * non-null assertion at every call site. This reads it once, and a link\n * nothing resolved fails here, naming it, rather than as an `undefined` deep\n * in a render.\n */\nexport function targetOf<TEntity extends Entity>(\n link: EntityLink<TEntity>,\n): TEntity {\n const { value } = link;\n if (value === undefined) {\n throw new EntifixLogicError(\n `The link to ${link.entityConstructor.name} ${String(link.id)} was read before it was resolved`,\n );\n }\n return value;\n}\n\n/** The records a resolved collection names, in its order. */\nexport function targetsOf<TEntity extends Entity>(\n links: EntityCollectionLink<TEntity>,\n): TEntity[] {\n const { values } = links;\n if (values === undefined) {\n throw new EntifixLogicError(\n `The links to ${links.entityConstructor.name} were read before they were resolved`,\n );\n }\n return values;\n}\n"],"names":["EntifixLogicError","targetOf","link","value","undefined","entityConstructor","name","String","id","targetsOf","links","values"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,gDAAgD;AAKlF;;;;;;;CAOC,GACD,OAAO,SAASC,SACdC,IAAyB;IAEzB,MAAM,EAAEC,KAAK,EAAE,GAAGD;IAClB,IAAIC,UAAUC,WAAW;QACvB,MAAM,IAAIJ,kBACR,CAAC,YAAY,EAAEE,KAAKG,iBAAiB,CAACC,IAAI,CAAC,CAAC,EAAEC,OAAOL,KAAKM,EAAE,EAAE,gCAAgC,CAAC;IAEnG;IACA,OAAOL;AACT;AAEA,2DAA2D,GAC3D,OAAO,SAASM,UACdC,KAAoC;IAEpC,MAAM,EAAEC,MAAM,EAAE,GAAGD;IACnB,IAAIC,WAAWP,WAAW;QACxB,MAAM,IAAIJ,kBACR,CAAC,aAAa,EAAEU,MAAML,iBAAiB,CAACC,IAAI,CAAC,oCAAoC,CAAC;IAEtF;IACA,OAAOK;AACT"}
|
package/dist/envelope/types.d.ts
CHANGED
|
@@ -123,7 +123,7 @@ export interface DomainEvent<TData = unknown> extends EntifixEventMeta {
|
|
|
123
123
|
*
|
|
124
124
|
* It lives in core rather than beside the React `ReactiveChannel` that consumes
|
|
125
125
|
* it because both ends need it: the service maps a `TransactionEvent` onto it,
|
|
126
|
-
* and
|
|
126
|
+
* and the React packages sit above every tier that does the mapping.
|
|
127
127
|
*
|
|
128
128
|
* Deliberately **no** `transactionId`, timestamp or sequence: all three already
|
|
129
129
|
* exist one level up as `meta.event.correlationId`, `.at` and `.id`, and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/envelope/types.ts"],"sourcesContent":["import type { EntityMetadataDocument } from '../entity-definition/metadata/index.js';\nimport type { SerializedEntity } from '../entity-definition/serializer/index.js';\nimport type { Entity, EntityId } from '../types/Entity.js';\nimport type { EntityLoadRequest } from '../types/EntityLoadRequest.js';\n\n/**\n * Discriminates what {@link EntifixEnvelope.data} carries.\n *\n * `command` extends the contract for the transactions layer: a write is issued\n * as a `command`, whose `data` shape lives in `@entifix/transactions` —\n * core only owns the discriminant so every artifact agrees on it.\n *\n * `event` is what actually rides the bus, and it is deliberately not named\n * after one publisher's flow: once a message can be `catalog.published` as\n * easily as `transaction.completed`, `transactionEvent` would be the wrong\n * name for it.\n *\n * ⚠️ **The four transaction-shaped discriminants below are four because they\n * carry four shapes.** `transactionEvent` used to mean all of them, and a\n * discriminant that means several things asserts nothing when it is read —\n * which is what `readTransactionEventEnvelope` was doing on the `202`: checking\n * a name that the record route and the event type both also answered to\n * ([ADR 0055](../../../../../../docs/adr/0055-a-coordinator-resumes-from-its-own-record.md),\n * #176).\n *\n * - `transactionAccepted` — the `202` accept body, `{ transactionId, state }`.\n * Not a record: it has no `createdAt` and names no entity id yet.\n * - `transactionRecord` — the fold a client polls, a `TransactionRecord`.\n * - `sagaResult` — how a settled multi-step walk ended: which steps ran and\n * what each returned ([ADR 0052](../../../../../../docs/adr/0052-the-checkout-saga.md)).\n * - `sagaInstance` — the durable instance itself, which is what a resumable\n * coordinator reads and what `GET /api/saga/:id` serves. It differs from\n * `sagaResult` in carrying the inputs and the resume count, because those are\n * what an operator needs to answer *why is this one still here*.\n *\n * `entityMetadata` is the same extension made once more, for the action model:\n * its `data` is an {@link EntityMetadataDocument}, which core does own because\n * both the service that computes it and the controls that render it are already\n * below the layer that would otherwise host it.\n */\nexport type EntifixEnvelopeType =\n | 'entity'\n | 'entityCollection'\n | 'entityPage'\n | 'command'\n | 'event'\n | 'transactionAccepted'\n | 'transactionRecord'\n | 'sagaResult'\n | 'sagaInstance'\n | 'entityMetadata';\n\nexport type EntifixEnvelopeMethod = 'GET' | 'POST' | 'PUT' | 'DELETE';\n\n/**\n * A HATEOAS affordance: where the peer can go next from this message. Optional —\n * the envelope stands on its own without links, and only the artifact that owns\n * a route surface (today the REST service) is able to fill them in.\n */\nexport interface EntifixEnvelopeLink {\n rel: string;\n href: string;\n method?: EntifixEnvelopeMethod;\n}\n\n/**\n * The facts a message carries about *itself*, as opposed to about what\n * happened. Present only when the envelope is a bus message.\n *\n * The split rule: `meta` describes the message, `data` describes the\n * occurrence. So `correlationId` belongs here and an outcome's `code` does not.\n *\n * **`source` is never a consumer branch.** It is there for routing,\n * observability and audit. A handler that behaves differently depending on who\n * published re-couples the two services the bus decoupled — which is why .NET's\n * canonical `(sender, eventArgs)` types its sender as bare `object`, making the\n * dependency awkward on purpose. TypeScript cannot reproduce that friction, so\n * here it is a rule rather than a type.\n */\nexport interface EntifixEventMeta {\n /**\n * What happened, in the register's vocabulary: `catalog.published`,\n * `transaction.completed`. Declared in `tools/slices/*.slice.ts` as\n * `publishedEvents`/`subscriptions`, and used verbatim as the AMQP routing\n * key — which is what makes a subscriber's declared interest and its actual\n * queue binding the same string.\n */\n name: string;\n /**\n * Unique per message, and **the** deduplication key. Delivery is\n * at-least-once, so a consumer that must not fold twice keys on this.\n *\n * Not `correlationId`: one flow emits several messages, so correlating and\n * deduplicating are different questions. Keying dedup on the correlation id\n * makes a transaction's `completed` look like a duplicate of its `accepted`.\n */\n id: string;\n /** The emitting **slice** (ADR 0020's ownership noun), e.g. `marketplace-admin`. */\n source: string;\n /** ISO-8601 emission time. */\n at: string;\n /** Ties every message of one flow together — a transaction id, a saga id. */\n correlationId?: string;\n}\n\nexport interface EntifixEnvelopeMeta {\n type: EntifixEnvelopeType;\n /**\n * The target entity's `key` (falling back to its class name).\n *\n * Optional, because a bus message need not be about an entity at all —\n * `settlement.run.completed` is about a run. What a message *is* lives in\n * {@link EntifixEventMeta.name}; this stays the entity label the HTTP arm\n * routes on.\n */\n entity?: string;\n links?: EntifixEnvelopeLink[];\n /** Present only on a bus message. */\n event?: EntifixEventMeta;\n}\n\n/**\n * One message on the bus: its own metadata, plus the payload describing what\n * happened.\n *\n * Generic in the payload so a publisher keeps its own shape —\n * `DomainEvent<TransactionEvent>` today, `DomainEvent<PublishedOffering>` when\n * ADR 0009's projection event lands — without the transport learning either.\n */\nexport interface DomainEvent<TData = unknown> extends EntifixEventMeta {\n data: TData;\n}\n\n/**\n * A change to an entity that happened on the server, delivered out-of-band —\n * the `data` of a bus/stream `event` envelope rather than a framing of its own\n * (ADR 0036). `entity` is the `key ?? name` an adapter routes on, the same\n * string `entityQueryScope` uses, so a subscriber can invalidate exactly the\n * affected query keys.\n *\n * It lives in core rather than beside the React `ReactiveChannel` that consumes\n * it because both ends need it: the service maps a `TransactionEvent` onto it,\n * and
|
|
1
|
+
{"version":3,"sources":["../../src/envelope/types.ts"],"sourcesContent":["import type { EntityMetadataDocument } from '../entity-definition/metadata/index.js';\nimport type { SerializedEntity } from '../entity-definition/serializer/index.js';\nimport type { Entity, EntityId } from '../types/Entity.js';\nimport type { EntityLoadRequest } from '../types/EntityLoadRequest.js';\n\n/**\n * Discriminates what {@link EntifixEnvelope.data} carries.\n *\n * `command` extends the contract for the transactions layer: a write is issued\n * as a `command`, whose `data` shape lives in `@entifix/transactions` —\n * core only owns the discriminant so every artifact agrees on it.\n *\n * `event` is what actually rides the bus, and it is deliberately not named\n * after one publisher's flow: once a message can be `catalog.published` as\n * easily as `transaction.completed`, `transactionEvent` would be the wrong\n * name for it.\n *\n * ⚠️ **The four transaction-shaped discriminants below are four because they\n * carry four shapes.** `transactionEvent` used to mean all of them, and a\n * discriminant that means several things asserts nothing when it is read —\n * which is what `readTransactionEventEnvelope` was doing on the `202`: checking\n * a name that the record route and the event type both also answered to\n * ([ADR 0055](../../../../../../docs/adr/0055-a-coordinator-resumes-from-its-own-record.md),\n * #176).\n *\n * - `transactionAccepted` — the `202` accept body, `{ transactionId, state }`.\n * Not a record: it has no `createdAt` and names no entity id yet.\n * - `transactionRecord` — the fold a client polls, a `TransactionRecord`.\n * - `sagaResult` — how a settled multi-step walk ended: which steps ran and\n * what each returned ([ADR 0052](../../../../../../docs/adr/0052-the-checkout-saga.md)).\n * - `sagaInstance` — the durable instance itself, which is what a resumable\n * coordinator reads and what `GET /api/saga/:id` serves. It differs from\n * `sagaResult` in carrying the inputs and the resume count, because those are\n * what an operator needs to answer *why is this one still here*.\n *\n * `entityMetadata` is the same extension made once more, for the action model:\n * its `data` is an {@link EntityMetadataDocument}, which core does own because\n * both the service that computes it and the controls that render it are already\n * below the layer that would otherwise host it.\n */\nexport type EntifixEnvelopeType =\n | 'entity'\n | 'entityCollection'\n | 'entityPage'\n | 'command'\n | 'event'\n | 'transactionAccepted'\n | 'transactionRecord'\n | 'sagaResult'\n | 'sagaInstance'\n | 'entityMetadata';\n\nexport type EntifixEnvelopeMethod = 'GET' | 'POST' | 'PUT' | 'DELETE';\n\n/**\n * A HATEOAS affordance: where the peer can go next from this message. Optional —\n * the envelope stands on its own without links, and only the artifact that owns\n * a route surface (today the REST service) is able to fill them in.\n */\nexport interface EntifixEnvelopeLink {\n rel: string;\n href: string;\n method?: EntifixEnvelopeMethod;\n}\n\n/**\n * The facts a message carries about *itself*, as opposed to about what\n * happened. Present only when the envelope is a bus message.\n *\n * The split rule: `meta` describes the message, `data` describes the\n * occurrence. So `correlationId` belongs here and an outcome's `code` does not.\n *\n * **`source` is never a consumer branch.** It is there for routing,\n * observability and audit. A handler that behaves differently depending on who\n * published re-couples the two services the bus decoupled — which is why .NET's\n * canonical `(sender, eventArgs)` types its sender as bare `object`, making the\n * dependency awkward on purpose. TypeScript cannot reproduce that friction, so\n * here it is a rule rather than a type.\n */\nexport interface EntifixEventMeta {\n /**\n * What happened, in the register's vocabulary: `catalog.published`,\n * `transaction.completed`. Declared in `tools/slices/*.slice.ts` as\n * `publishedEvents`/`subscriptions`, and used verbatim as the AMQP routing\n * key — which is what makes a subscriber's declared interest and its actual\n * queue binding the same string.\n */\n name: string;\n /**\n * Unique per message, and **the** deduplication key. Delivery is\n * at-least-once, so a consumer that must not fold twice keys on this.\n *\n * Not `correlationId`: one flow emits several messages, so correlating and\n * deduplicating are different questions. Keying dedup on the correlation id\n * makes a transaction's `completed` look like a duplicate of its `accepted`.\n */\n id: string;\n /** The emitting **slice** (ADR 0020's ownership noun), e.g. `marketplace-admin`. */\n source: string;\n /** ISO-8601 emission time. */\n at: string;\n /** Ties every message of one flow together — a transaction id, a saga id. */\n correlationId?: string;\n}\n\nexport interface EntifixEnvelopeMeta {\n type: EntifixEnvelopeType;\n /**\n * The target entity's `key` (falling back to its class name).\n *\n * Optional, because a bus message need not be about an entity at all —\n * `settlement.run.completed` is about a run. What a message *is* lives in\n * {@link EntifixEventMeta.name}; this stays the entity label the HTTP arm\n * routes on.\n */\n entity?: string;\n links?: EntifixEnvelopeLink[];\n /** Present only on a bus message. */\n event?: EntifixEventMeta;\n}\n\n/**\n * One message on the bus: its own metadata, plus the payload describing what\n * happened.\n *\n * Generic in the payload so a publisher keeps its own shape —\n * `DomainEvent<TransactionEvent>` today, `DomainEvent<PublishedOffering>` when\n * ADR 0009's projection event lands — without the transport learning either.\n */\nexport interface DomainEvent<TData = unknown> extends EntifixEventMeta {\n data: TData;\n}\n\n/**\n * A change to an entity that happened on the server, delivered out-of-band —\n * the `data` of a bus/stream `event` envelope rather than a framing of its own\n * (ADR 0036). `entity` is the `key ?? name` an adapter routes on, the same\n * string `entityQueryScope` uses, so a subscriber can invalidate exactly the\n * affected query keys.\n *\n * It lives in core rather than beside the React `ReactiveChannel` that consumes\n * it because both ends need it: the service maps a `TransactionEvent` onto it,\n * and the React packages sit above every tier that does the mapping.\n *\n * Deliberately **no** `transactionId`, timestamp or sequence: all three already\n * exist one level up as `meta.event.correlationId`, `.at` and `.id`, and\n * duplicating them onto the payload is how two sources of the same fact drift.\n */\nexport interface EntityChangeEvent {\n entity: string;\n change: 'created' | 'updated' | 'deleted';\n id: EntityId;\n}\n\n/**\n * The standard message exchanged between entifix artifacts.\n *\n * Every request and response body is an envelope: `meta` describes the payload,\n * `data` is the payload. It is deliberately transport-free — it lives in `core`\n * and knows nothing about HTTP — so the same contract can carry entities over\n * REST today and amqp or websockets later.\n */\nexport interface EntifixEnvelope<TData = unknown> {\n meta: EntifixEnvelopeMeta;\n data: TData;\n}\n\n/**\n * `data` shape when `meta.type` is `entityPage`. Generic in the entity so the\n * echoed `request` keeps its `keyof TEntity` filter/sort types — `EntityLoadRequest`\n * is invariant in its entity, so a non-generic `EntityLoadRequest<Entity>` here\n * would not accept a caller's `EntityLoadRequest<Product>`.\n */\nexport interface SerializedEntityPage<TEntity extends Entity = Entity> {\n items: SerializedEntity[];\n total: number;\n request?: EntityLoadRequest<TEntity>;\n}\n\nexport type EntityEnvelope = EntifixEnvelope<SerializedEntity>;\nexport type EntityCollectionEnvelope = EntifixEnvelope<SerializedEntity[]>;\nexport type EntityPageEnvelope<TEntity extends Entity = Entity> =\n EntifixEnvelope<SerializedEntityPage<TEntity>>;\nexport type EntityMetadataEnvelope = EntifixEnvelope<EntityMetadataDocument>;\n\n/**\n * A bus message on the wire. `meta.event` is always populated, and\n * `readEventEnvelope` is what proves it before a consumer sees the payload.\n */\nexport type EventEnvelope<TData = unknown> = EntifixEnvelope<TData> & {\n meta: EntifixEnvelopeMeta & { event: EntifixEventMeta };\n};\n"],"names":[],"mappings":"AAyLA;;;CAGC,GACD,WAEE"}
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export * from './entity-definition/links/apply-entity-links/index.js';
|
|
|
12
12
|
export * from './entity-definition/links/entity-collection-link/index.js';
|
|
13
13
|
export * from './entity-definition/links/entity-link/index.js';
|
|
14
14
|
export * from './entity-definition/links/entity-link-source/index.js';
|
|
15
|
+
export * from './entity-definition/links/link-targets/index.js';
|
|
15
16
|
export * from './entity-definition/meta-entities/meta-accessor/index.js';
|
|
16
17
|
export * from './entity-definition/meta-entities/meta-entity/index.js';
|
|
17
18
|
export * from './entity-definition/meta-entities/meta-method/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,+CAA+C,CAAC;AAC9D,cAAc,wCAAwC,CAAC;AACvD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kDAAkD,CAAC;AACjE,cAAc,gDAAgD,CAAC;AAC/D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,kDAAkD,CAAC;AACjE,cAAc,uCAAuC,CAAC;AACtD,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AACrD,cAAc,uDAAuD,CAAC;AACtE,cAAc,2DAA2D,CAAC;AAC1E,cAAc,gDAAgD,CAAC;AAC/D,cAAc,uDAAuD,CAAC;AACtE,cAAc,0DAA0D,CAAC;AACzE,cAAc,wDAAwD,CAAC;AACvE,cAAc,wDAAwD,CAAC;AACvE,cAAc,0DAA0D,CAAC;AACzE,cAAc,uCAAuC,CAAC;AACtD,cAAc,0CAA0C,CAAC;AACzD,cAAc,yCAAyC,CAAC;AACxD,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,+CAA+C,CAAC;AAC9D,cAAc,wCAAwC,CAAC;AACvD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kDAAkD,CAAC;AACjE,cAAc,gDAAgD,CAAC;AAC/D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,kDAAkD,CAAC;AACjE,cAAc,uCAAuC,CAAC;AACtD,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AACrD,cAAc,uDAAuD,CAAC;AACtE,cAAc,2DAA2D,CAAC;AAC1E,cAAc,gDAAgD,CAAC;AAC/D,cAAc,uDAAuD,CAAC;AACtE,cAAc,iDAAiD,CAAC;AAChE,cAAc,0DAA0D,CAAC;AACzE,cAAc,wDAAwD,CAAC;AACvE,cAAc,wDAAwD,CAAC;AACvE,cAAc,0DAA0D,CAAC;AACzE,cAAc,uCAAuC,CAAC;AACtD,cAAc,0CAA0C,CAAC;AACzD,cAAc,yCAAyC,CAAC;AACxD,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -12,6 +12,7 @@ export * from './entity-definition/links/apply-entity-links/index.js';
|
|
|
12
12
|
export * from './entity-definition/links/entity-collection-link/index.js';
|
|
13
13
|
export * from './entity-definition/links/entity-link/index.js';
|
|
14
14
|
export * from './entity-definition/links/entity-link-source/index.js';
|
|
15
|
+
export * from './entity-definition/links/link-targets/index.js';
|
|
15
16
|
export * from './entity-definition/meta-entities/meta-accessor/index.js';
|
|
16
17
|
export * from './entity-definition/meta-entities/meta-entity/index.js';
|
|
17
18
|
export * from './entity-definition/meta-entities/meta-method/index.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './base-entities/configuration-client/index.js';\nexport * from './base-entities/entifix-error/index.js';\nexport * from './command-palette/index.js';\nexport * from './entity-definition/decorators/accessor/index.js';\nexport * from './entity-definition/decorators/entity/index.js';\nexport * from './entity-definition/decorators/method/index.js';\nexport * from './entity-definition/decorators/use-case/index.js';\nexport * from './entity-definition/describe/index.js';\nexport * from './entity-definition/field-path.js';\nexport * from './entity-definition/helpers/index.js';\nexport * from './entity-definition/links/apply-entity-links/index.js';\nexport * from './entity-definition/links/entity-collection-link/index.js';\nexport * from './entity-definition/links/entity-link/index.js';\nexport * from './entity-definition/links/entity-link-source/index.js';\nexport * from './entity-definition/meta-entities/meta-accessor/index.js';\nexport * from './entity-definition/meta-entities/meta-entity/index.js';\nexport * from './entity-definition/meta-entities/meta-method/index.js';\nexport * from './entity-definition/meta-entities/meta-use-case/index.js';\nexport * from './entity-definition/metadata/index.js';\nexport * from './entity-definition/reconstruct/index.js';\nexport * from './entity-definition/serializer/index.js';\nexport * from './envelope/index.js';\nexport * from './http/session-cookies.js';\nexport * from './i18n/format.js';\nexport * from './i18n/locales.js';\nexport * from './i18n/negotiate.js';\nexport * from './rsql/index.js';\nexport * from './types/BulkOutcome.js';\nexport * from './types/Entity.js';\nexport * from './types/EntityAction.js';\nexport * from './types/EntityDraft.js';\nexport * from './types/EntityFiltering.js';\nexport * from './types/EntityLoadRequest.js';\nexport * from './types/EntityPage.js';\nexport * from './types/EntityRowDraft.js';\nexport * from './types/EntitySelection.js';\nexport * from './types/EntitySorting.js';\nexport * from './types/Json.js';\nexport * from './types/StandardSchema.js';\nexport * from './types/UseCase.js';\nexport * from './wizard/index.js';\n"],"names":[],"mappings":"AAAA,cAAc,gDAAgD;AAC9D,cAAc,yCAAyC;AACvD,cAAc,6BAA6B;AAC3C,cAAc,mDAAmD;AACjE,cAAc,iDAAiD;AAC/D,cAAc,iDAAiD;AAC/D,cAAc,mDAAmD;AACjE,cAAc,wCAAwC;AACtD,cAAc,oCAAoC;AAClD,cAAc,uCAAuC;AACrD,cAAc,wDAAwD;AACtE,cAAc,4DAA4D;AAC1E,cAAc,iDAAiD;AAC/D,cAAc,wDAAwD;AACtE,cAAc,2DAA2D;AACzE,cAAc,yDAAyD;AACvE,cAAc,yDAAyD;AACvE,cAAc,2DAA2D;AACzE,cAAc,wCAAwC;AACtD,cAAc,2CAA2C;AACzD,cAAc,0CAA0C;AACxD,cAAc,sBAAsB;AACpC,cAAc,4BAA4B;AAC1C,cAAc,mBAAmB;AACjC,cAAc,oBAAoB;AAClC,cAAc,sBAAsB;AACpC,cAAc,kBAAkB;AAChC,cAAc,yBAAyB;AACvC,cAAc,oBAAoB;AAClC,cAAc,0BAA0B;AACxC,cAAc,yBAAyB;AACvC,cAAc,6BAA6B;AAC3C,cAAc,+BAA+B;AAC7C,cAAc,wBAAwB;AACtC,cAAc,4BAA4B;AAC1C,cAAc,6BAA6B;AAC3C,cAAc,2BAA2B;AACzC,cAAc,kBAAkB;AAChC,cAAc,4BAA4B;AAC1C,cAAc,qBAAqB;AACnC,cAAc,oBAAoB"}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './base-entities/configuration-client/index.js';\nexport * from './base-entities/entifix-error/index.js';\nexport * from './command-palette/index.js';\nexport * from './entity-definition/decorators/accessor/index.js';\nexport * from './entity-definition/decorators/entity/index.js';\nexport * from './entity-definition/decorators/method/index.js';\nexport * from './entity-definition/decorators/use-case/index.js';\nexport * from './entity-definition/describe/index.js';\nexport * from './entity-definition/field-path.js';\nexport * from './entity-definition/helpers/index.js';\nexport * from './entity-definition/links/apply-entity-links/index.js';\nexport * from './entity-definition/links/entity-collection-link/index.js';\nexport * from './entity-definition/links/entity-link/index.js';\nexport * from './entity-definition/links/entity-link-source/index.js';\nexport * from './entity-definition/links/link-targets/index.js';\nexport * from './entity-definition/meta-entities/meta-accessor/index.js';\nexport * from './entity-definition/meta-entities/meta-entity/index.js';\nexport * from './entity-definition/meta-entities/meta-method/index.js';\nexport * from './entity-definition/meta-entities/meta-use-case/index.js';\nexport * from './entity-definition/metadata/index.js';\nexport * from './entity-definition/reconstruct/index.js';\nexport * from './entity-definition/serializer/index.js';\nexport * from './envelope/index.js';\nexport * from './http/session-cookies.js';\nexport * from './i18n/format.js';\nexport * from './i18n/locales.js';\nexport * from './i18n/negotiate.js';\nexport * from './rsql/index.js';\nexport * from './types/BulkOutcome.js';\nexport * from './types/Entity.js';\nexport * from './types/EntityAction.js';\nexport * from './types/EntityDraft.js';\nexport * from './types/EntityFiltering.js';\nexport * from './types/EntityLoadRequest.js';\nexport * from './types/EntityPage.js';\nexport * from './types/EntityRowDraft.js';\nexport * from './types/EntitySelection.js';\nexport * from './types/EntitySorting.js';\nexport * from './types/Json.js';\nexport * from './types/StandardSchema.js';\nexport * from './types/UseCase.js';\nexport * from './wizard/index.js';\n"],"names":[],"mappings":"AAAA,cAAc,gDAAgD;AAC9D,cAAc,yCAAyC;AACvD,cAAc,6BAA6B;AAC3C,cAAc,mDAAmD;AACjE,cAAc,iDAAiD;AAC/D,cAAc,iDAAiD;AAC/D,cAAc,mDAAmD;AACjE,cAAc,wCAAwC;AACtD,cAAc,oCAAoC;AAClD,cAAc,uCAAuC;AACrD,cAAc,wDAAwD;AACtE,cAAc,4DAA4D;AAC1E,cAAc,iDAAiD;AAC/D,cAAc,wDAAwD;AACtE,cAAc,kDAAkD;AAChE,cAAc,2DAA2D;AACzE,cAAc,yDAAyD;AACvE,cAAc,yDAAyD;AACvE,cAAc,2DAA2D;AACzE,cAAc,wCAAwC;AACtD,cAAc,2CAA2C;AACzD,cAAc,0CAA0C;AACxD,cAAc,sBAAsB;AACpC,cAAc,4BAA4B;AAC1C,cAAc,mBAAmB;AACjC,cAAc,oBAAoB;AAClC,cAAc,sBAAsB;AACpC,cAAc,kBAAkB;AAChC,cAAc,yBAAyB;AACvC,cAAc,oBAAoB;AAClC,cAAc,0BAA0B;AACxC,cAAc,yBAAyB;AACvC,cAAc,6BAA6B;AAC3C,cAAc,+BAA+B;AAC7C,cAAc,wBAAwB;AACtC,cAAc,4BAA4B;AAC1C,cAAc,6BAA6B;AAC3C,cAAc,2BAA2B;AACzC,cAAc,kBAAkB;AAChC,cAAc,4BAA4B;AAC1C,cAAc,qBAAqB;AACnC,cAAc,oBAAoB"}
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* by construction, as opposed to a verb a domain declares with `@useCase()`.
|
|
4
4
|
*
|
|
5
5
|
* It lives in `core` rather than in the authorization vocabulary because two
|
|
6
|
-
*
|
|
6
|
+
* packages that may not import each other both need it. `@entifix/authz` owns
|
|
7
7
|
* the *permission* built from an action and re-exports these as `Actions` /
|
|
8
8
|
* `Action`; `@entifix/react-controls` reads the same triple off a served
|
|
9
9
|
* `EntityMetadataDocument` to decide whether to render Save and Delete, and
|
|
10
|
-
*
|
|
10
|
+
* a T3 package may not depend on `@entifix/authz` (T4)
|
|
11
11
|
* ([ADR 0026](../../../../../../docs/adr/0026-the-use-case-descriptor-and-served-entity-metadata.md)).
|
|
12
12
|
*/
|
|
13
13
|
export declare const ENTITY_ACTIONS: readonly ["read", "write", "delete"];
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* by construction, as opposed to a verb a domain declares with `@useCase()`.
|
|
4
4
|
*
|
|
5
5
|
* It lives in `core` rather than in the authorization vocabulary because two
|
|
6
|
-
*
|
|
6
|
+
* packages that may not import each other both need it. `@entifix/authz` owns
|
|
7
7
|
* the *permission* built from an action and re-exports these as `Actions` /
|
|
8
8
|
* `Action`; `@entifix/react-controls` reads the same triple off a served
|
|
9
9
|
* `EntityMetadataDocument` to decide whether to render Save and Delete, and
|
|
10
|
-
*
|
|
10
|
+
* a T3 package may not depend on `@entifix/authz` (T4)
|
|
11
11
|
* ([ADR 0026](../../../../../../docs/adr/0026-the-use-case-descriptor-and-served-entity-metadata.md)).
|
|
12
12
|
*/ export const ENTITY_ACTIONS = [
|
|
13
13
|
'read',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/EntityAction.ts"],"sourcesContent":["/**\n * What a caller wants to do with a resource: the CRUD triple every entity has\n * by construction, as opposed to a verb a domain declares with `@useCase()`.\n *\n * It lives in `core` rather than in the authorization vocabulary because two\n *
|
|
1
|
+
{"version":3,"sources":["../../src/types/EntityAction.ts"],"sourcesContent":["/**\n * What a caller wants to do with a resource: the CRUD triple every entity has\n * by construction, as opposed to a verb a domain declares with `@useCase()`.\n *\n * It lives in `core` rather than in the authorization vocabulary because two\n * packages that may not import each other both need it. `@entifix/authz` owns\n * the *permission* built from an action and re-exports these as `Actions` /\n * `Action`; `@entifix/react-controls` reads the same triple off a served\n * `EntityMetadataDocument` to decide whether to render Save and Delete, and\n * a T3 package may not depend on `@entifix/authz` (T4)\n * ([ADR 0026](../../../../../../docs/adr/0026-the-use-case-descriptor-and-served-entity-metadata.md)).\n */\nexport const ENTITY_ACTIONS = ['read', 'write', 'delete'] as const;\nexport type EntityAction = (typeof ENTITY_ACTIONS)[number];\n"],"names":["ENTITY_ACTIONS"],"mappings":"AAAA;;;;;;;;;;;CAWC,GACD,OAAO,MAAMA,iBAAiB;IAAC;IAAQ;IAAS;CAAS,CAAU"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@entifix/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "The entity system: decorators that make a class describe itself, entity serialization, the RSQL query protocol and the wire envelopes.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -31,9 +31,6 @@
|
|
|
31
31
|
],
|
|
32
32
|
"nx": {
|
|
33
33
|
"tags": [
|
|
34
|
-
"layer:entifix",
|
|
35
|
-
"scope:shared",
|
|
36
|
-
"entifix:core",
|
|
37
34
|
"tier:1"
|
|
38
35
|
],
|
|
39
36
|
"sourceRoot": "packages/ts/core/src",
|