@entifix/core 0.1.2 → 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.
@@ -0,0 +1,2 @@
1
+ export * from './link-targets.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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,3 @@
1
+ export * from './link-targets.js';
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -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/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';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index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C,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@entifix/core",
3
- "version": "0.1.2",
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": {