@entifix/core 0.10.2 → 0.12.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/dist/endpoint/endpoint.d.ts +154 -0
- package/dist/endpoint/endpoint.d.ts.map +1 -0
- package/dist/endpoint/endpoint.js +61 -0
- package/dist/endpoint/endpoint.js.map +1 -0
- package/dist/endpoint/index.d.ts +2 -0
- package/dist/endpoint/index.d.ts.map +1 -0
- package/dist/endpoint/index.js +3 -0
- package/dist/endpoint/index.js.map +1 -0
- package/dist/entity-definition/decorators/use-case/use-case.d.ts.map +1 -1
- package/dist/entity-definition/decorators/use-case/use-case.js +2 -1
- package/dist/entity-definition/decorators/use-case/use-case.js.map +1 -1
- package/dist/entity-definition/describe/describe-entity-use-cases.d.ts +18 -0
- package/dist/entity-definition/describe/describe-entity-use-cases.d.ts.map +1 -1
- package/dist/entity-definition/describe/describe-entity-use-cases.js +3 -1
- package/dist/entity-definition/describe/describe-entity-use-cases.js.map +1 -1
- package/dist/entity-definition/helpers/entity-definition-helpers.d.ts +5 -0
- package/dist/entity-definition/helpers/entity-definition-helpers.d.ts.map +1 -1
- package/dist/entity-definition/helpers/entity-definition-helpers.js +10 -0
- package/dist/entity-definition/helpers/entity-definition-helpers.js.map +1 -1
- package/dist/entity-definition/meta-entities/meta-use-case/meta-use-case.d.ts +29 -0
- package/dist/entity-definition/meta-entities/meta-use-case/meta-use-case.d.ts.map +1 -1
- package/dist/entity-definition/meta-entities/meta-use-case/meta-use-case.js +5 -0
- package/dist/entity-definition/meta-entities/meta-use-case/meta-use-case.js.map +1 -1
- package/dist/envelope/codec.d.ts +123 -0
- package/dist/envelope/codec.d.ts.map +1 -0
- package/dist/envelope/codec.js +203 -0
- package/dist/envelope/codec.js.map +1 -0
- package/dist/envelope/index.d.ts +2 -0
- package/dist/envelope/index.d.ts.map +1 -1
- package/dist/envelope/index.js +2 -0
- package/dist/envelope/index.js.map +1 -1
- package/dist/envelope/read-envelope.d.ts +20 -37
- package/dist/envelope/read-envelope.d.ts.map +1 -1
- package/dist/envelope/read-envelope.js +37 -126
- package/dist/envelope/read-envelope.js.map +1 -1
- package/dist/envelope/registry.d.ts +45 -0
- package/dist/envelope/registry.d.ts.map +1 -0
- package/dist/envelope/registry.js +55 -0
- package/dist/envelope/registry.js.map +1 -0
- package/dist/envelope/types.d.ts +48 -33
- package/dist/envelope/types.d.ts.map +1 -1
- package/dist/envelope/types.js +1 -1
- package/dist/envelope/types.js.map +1 -1
- package/dist/idempotency/idempotency-key.d.ts +20 -0
- package/dist/idempotency/idempotency-key.d.ts.map +1 -0
- package/dist/idempotency/idempotency-key.js +42 -0
- package/dist/idempotency/idempotency-key.js.map +1 -0
- package/dist/idempotency/index.d.ts +2 -0
- package/dist/idempotency/index.d.ts.map +1 -0
- package/dist/idempotency/index.js +3 -0
- package/dist/idempotency/index.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/use-case-runner/index.d.ts +2 -0
- package/dist/use-case-runner/index.d.ts.map +1 -0
- package/dist/use-case-runner/index.js +3 -0
- package/dist/use-case-runner/index.js.map +1 -0
- package/dist/use-case-runner/use-case-runner.d.ts +29 -0
- package/dist/use-case-runner/use-case-runner.d.ts.map +1 -0
- package/dist/use-case-runner/use-case-runner.js +10 -0
- package/dist/use-case-runner/use-case-runner.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/idempotency/idempotency-key.ts"],"sourcesContent":["/**\n * The one idempotency header, browser to shell and coordinator to participant\n * (draft-ietf-httpapi-idempotency-key-header). Lower case, as a Node request\n * presents every header name.\n */\nexport const IDEMPOTENCY_KEY_HEADER = 'idempotency-key';\n\n/** Printable ASCII, the only characters an RFC 9651 String may hold. */\nconst PRINTABLE = /^[\\x20-\\x7e]*$/;\n\n/**\n * Formats a key as an RFC 9651 String item: quoted, with `\\` and `\"` escaped.\n * Refuses a key with a character a String cannot carry, rather than sending a\n * header the participant would refuse.\n */\nexport const formatIdempotencyKey = (key: string): string => {\n if (key === '' || !PRINTABLE.test(key))\n throw new Error(\n 'an Idempotency-Key is a non-empty run of printable ASCII characters',\n );\n return `\"${key.replace(/[\\\\\"]/g, char => `\\\\${char}`)}\"`;\n};\n\n/**\n * Parses an `Idempotency-Key` header as an RFC 9651 String item. Answers the\n * key, or `undefined` for a header that is absent, empty, unquoted, badly\n * escaped or carries anything after its closing quote — every one of which a\n * route treats as \"no key\".\n */\nexport const parseIdempotencyKey = (\n header: string | undefined,\n): string | undefined => {\n const value = header?.trim();\n if (value === undefined || value.length < 2 || !value.startsWith('\"'))\n return undefined;\n let key = '';\n for (let index = 1; index < value.length; index += 1) {\n const char = value.charAt(index);\n if (char === '\\\\') {\n const next = value.charAt(index + 1);\n if (next !== '\\\\' && next !== '\"') return undefined;\n key += next;\n index += 1;\n } else if (char === '\"') {\n return index === value.length - 1 && key !== '' ? key : undefined;\n } else if (!PRINTABLE.test(char)) {\n return undefined;\n } else {\n key += char;\n }\n }\n return undefined;\n};\n"],"names":["IDEMPOTENCY_KEY_HEADER","PRINTABLE","formatIdempotencyKey","key","test","Error","replace","char","parseIdempotencyKey","header","value","trim","undefined","length","startsWith","index","charAt","next"],"mappings":"AAAA;;;;CAIC,GACD,OAAO,MAAMA,yBAAyB,kBAAkB;AAExD,sEAAsE,GACtE,MAAMC,YAAY;AAElB;;;;CAIC,GACD,OAAO,MAAMC,uBAAuB,CAACC;IACnC,IAAIA,QAAQ,MAAM,CAACF,UAAUG,IAAI,CAACD,MAChC,MAAM,IAAIE,MACR;IAEJ,OAAO,CAAC,CAAC,EAAEF,IAAIG,OAAO,CAAC,UAAUC,CAAAA,OAAQ,CAAC,EAAE,EAAEA,MAAM,EAAE,CAAC,CAAC;AAC1D,EAAE;AAEF;;;;;CAKC,GACD,OAAO,MAAMC,sBAAsB,CACjCC;IAEA,MAAMC,QAAQD,0BAAAA,OAAQE,IAAI;IAC1B,IAAID,UAAUE,aAAaF,MAAMG,MAAM,GAAG,KAAK,CAACH,MAAMI,UAAU,CAAC,MAC/D,OAAOF;IACT,IAAIT,MAAM;IACV,IAAK,IAAIY,QAAQ,GAAGA,QAAQL,MAAMG,MAAM,EAAEE,SAAS,EAAG;QACpD,MAAMR,OAAOG,MAAMM,MAAM,CAACD;QAC1B,IAAIR,SAAS,MAAM;YACjB,MAAMU,OAAOP,MAAMM,MAAM,CAACD,QAAQ;YAClC,IAAIE,SAAS,QAAQA,SAAS,KAAK,OAAOL;YAC1CT,OAAOc;YACPF,SAAS;QACX,OAAO,IAAIR,SAAS,KAAK;YACvB,OAAOQ,UAAUL,MAAMG,MAAM,GAAG,KAAKV,QAAQ,KAAKA,MAAMS;QAC1D,OAAO,IAAI,CAACX,UAAUG,IAAI,CAACG,OAAO;YAChC,OAAOK;QACT,OAAO;YACLT,OAAOI;QACT;IACF;IACA,OAAOK;AACT,EAAE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/idempotency/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/idempotency/index.ts"],"sourcesContent":["export * from './idempotency-key.js';\n"],"names":[],"mappings":"AAAA,cAAc,uBAAuB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from './base-entities/configuration-client/index.js';
|
|
|
2
2
|
export * from './base-entities/entifix-error/index.js';
|
|
3
3
|
export * from './command-palette/index.js';
|
|
4
4
|
export * from './deadline/deadline.js';
|
|
5
|
+
export * from './endpoint/index.js';
|
|
5
6
|
export * from './entity-definition/decorators/accessor/index.js';
|
|
6
7
|
export * from './entity-definition/decorators/entity/index.js';
|
|
7
8
|
export * from './entity-definition/decorators/method/index.js';
|
|
@@ -30,6 +31,7 @@ export * from './i18n/format.js';
|
|
|
30
31
|
export * from './i18n/locales.js';
|
|
31
32
|
export * from './i18n/localized-text.js';
|
|
32
33
|
export * from './i18n/negotiate.js';
|
|
34
|
+
export * from './idempotency/index.js';
|
|
33
35
|
export * from './query/fold.js';
|
|
34
36
|
export * from './query/in-memory-query.js';
|
|
35
37
|
export * from './rsql/index.js';
|
|
@@ -47,5 +49,6 @@ export * from './types/EntitySorting.js';
|
|
|
47
49
|
export * from './types/Json.js';
|
|
48
50
|
export * from './types/StandardSchema.js';
|
|
49
51
|
export * from './types/UseCase.js';
|
|
52
|
+
export * from './use-case-runner/index.js';
|
|
50
53
|
export * from './wizard/index.js';
|
|
51
54
|
//# sourceMappingURL=index.d.ts.map
|
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,wBAAwB,CAAC;AACvC,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,uCAAuC,CAAC;AACtD,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,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,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,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,uCAAuC,CAAC;AACtD,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,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,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export * from './base-entities/configuration-client/index.js';
|
|
|
2
2
|
export * from './base-entities/entifix-error/index.js';
|
|
3
3
|
export * from './command-palette/index.js';
|
|
4
4
|
export * from './deadline/deadline.js';
|
|
5
|
+
export * from './endpoint/index.js';
|
|
5
6
|
export * from './entity-definition/decorators/accessor/index.js';
|
|
6
7
|
export * from './entity-definition/decorators/entity/index.js';
|
|
7
8
|
export * from './entity-definition/decorators/method/index.js';
|
|
@@ -30,6 +31,7 @@ export * from './i18n/format.js';
|
|
|
30
31
|
export * from './i18n/locales.js';
|
|
31
32
|
export * from './i18n/localized-text.js';
|
|
32
33
|
export * from './i18n/negotiate.js';
|
|
34
|
+
export * from './idempotency/index.js';
|
|
33
35
|
export * from './query/fold.js';
|
|
34
36
|
export * from './query/in-memory-query.js';
|
|
35
37
|
export * from './rsql/index.js';
|
|
@@ -47,6 +49,7 @@ export * from './types/EntitySorting.js';
|
|
|
47
49
|
export * from './types/Json.js';
|
|
48
50
|
export * from './types/StandardSchema.js';
|
|
49
51
|
export * from './types/UseCase.js';
|
|
52
|
+
export * from './use-case-runner/index.js';
|
|
50
53
|
export * from './wizard/index.js';
|
|
51
54
|
|
|
52
55
|
//# sourceMappingURL=index.js.map
|
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 './deadline/deadline.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 './entity-definition/validate/index.js';\nexport * from './envelope/index.js';\nexport * from './failure/index.js';\nexport * from './hierarchy/index.js';\nexport * from './http/session-cookies.js';\nexport * from './i18n/format.js';\nexport * from './i18n/locales.js';\nexport * from './i18n/localized-text.js';\nexport * from './i18n/negotiate.js';\nexport * from './query/fold.js';\nexport * from './query/in-memory-query.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/EntityFacets.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,yBAAyB;AACvC,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,wCAAwC;AACtD,cAAc,sBAAsB;AACpC,cAAc,qBAAqB;AACnC,cAAc,uBAAuB;AACrC,cAAc,4BAA4B;AAC1C,cAAc,mBAAmB;AACjC,cAAc,oBAAoB;AAClC,cAAc,2BAA2B;AACzC,cAAc,sBAAsB;AACpC,cAAc,kBAAkB;AAChC,cAAc,6BAA6B;AAC3C,cAAc,kBAAkB;AAChC,cAAc,yBAAyB;AACvC,cAAc,oBAAoB;AAClC,cAAc,0BAA0B;AACxC,cAAc,yBAAyB;AACvC,cAAc,0BAA0B;AACxC,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 './deadline/deadline.js';\nexport * from './endpoint/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 './entity-definition/validate/index.js';\nexport * from './envelope/index.js';\nexport * from './failure/index.js';\nexport * from './hierarchy/index.js';\nexport * from './http/session-cookies.js';\nexport * from './i18n/format.js';\nexport * from './i18n/locales.js';\nexport * from './i18n/localized-text.js';\nexport * from './i18n/negotiate.js';\nexport * from './idempotency/index.js';\nexport * from './query/fold.js';\nexport * from './query/in-memory-query.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/EntityFacets.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 './use-case-runner/index.js';\nexport * from './wizard/index.js';\n"],"names":[],"mappings":"AAAA,cAAc,gDAAgD;AAC9D,cAAc,yCAAyC;AACvD,cAAc,6BAA6B;AAC3C,cAAc,yBAAyB;AACvC,cAAc,sBAAsB;AACpC,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,wCAAwC;AACtD,cAAc,sBAAsB;AACpC,cAAc,qBAAqB;AACnC,cAAc,uBAAuB;AACrC,cAAc,4BAA4B;AAC1C,cAAc,mBAAmB;AACjC,cAAc,oBAAoB;AAClC,cAAc,2BAA2B;AACzC,cAAc,sBAAsB;AACpC,cAAc,yBAAyB;AACvC,cAAc,kBAAkB;AAChC,cAAc,6BAA6B;AAC3C,cAAc,kBAAkB;AAChC,cAAc,yBAAyB;AACvC,cAAc,oBAAoB;AAClC,cAAc,0BAA0B;AACxC,cAAc,yBAAyB;AACvC,cAAc,0BAA0B;AACxC,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,6BAA6B;AAC3C,cAAc,oBAAoB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/use-case-runner/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/use-case-runner/index.ts"],"sourcesContent":["export * from './use-case-runner.js';\n"],"names":[],"mappings":"AAAA,cAAc,uBAAuB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Effect } from 'effect';
|
|
2
|
+
import type { UseCaseDescriptor } from '../entity-definition/describe/describe-entity-use-cases.js';
|
|
3
|
+
import type { UseCaseBinding } from '../entity-definition/meta-entities/meta-use-case/meta-use-case.js';
|
|
4
|
+
import type { TransitionalFailure } from '../failure/failure.js';
|
|
5
|
+
import type { BulkOutcome } from '../types/BulkOutcome.js';
|
|
6
|
+
import type { Entity, EntityId } from '../types/Entity.js';
|
|
7
|
+
import type { EntitySelection } from '../types/EntitySelection.js';
|
|
8
|
+
/**
|
|
9
|
+
* The path a verb is served at, from its entity's key, its own key and its
|
|
10
|
+
* binding
|
|
11
|
+
* ([ADR 0020](../../../../../docs/adr/0020-endpoints-are-descriptors-and-the-shell-builds-an-httpapi.md)):
|
|
12
|
+
* a verb on one record is `POST /api/<entity>/:id/<verb>`, one on a selection
|
|
13
|
+
* or on nothing is `POST /api/<entity>/<verb>`. The shell serves it there and a
|
|
14
|
+
* client calls it there, so the two cannot disagree.
|
|
15
|
+
*/
|
|
16
|
+
export declare const verbPath: (entityKey: string, useCaseKey: string, binding: UseCaseBinding) => `/${string}`;
|
|
17
|
+
/**
|
|
18
|
+
* Runs an entity's verbs for a screen — over REST against the service that
|
|
19
|
+
* serves them, or in-process for a host whose records live in the browser.
|
|
20
|
+
* Chosen at composition, the way a repository is, so a generated screen runs
|
|
21
|
+
* a verb without knowing which.
|
|
22
|
+
*/
|
|
23
|
+
export interface EntityUseCaseRunner {
|
|
24
|
+
/** Runs a verb on one record, or on nothing for an unbound verb. */
|
|
25
|
+
run(useCase: UseCaseDescriptor, id?: EntityId): Effect.Effect<void, TransitionalFailure>;
|
|
26
|
+
/** Runs a collection verb on a selection, one outcome per record. */
|
|
27
|
+
bulk(useCase: UseCaseDescriptor, selection: EntitySelection<Entity>): Effect.Effect<readonly BulkOutcome[], TransitionalFailure>;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=use-case-runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-case-runner.d.ts","sourceRoot":"","sources":["../../src/use-case-runner/use-case-runner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4DAA4D,CAAC;AACpG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mEAAmE,CAAC;AACxG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEnE;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,GACnB,WAAW,MAAM,EACjB,YAAY,MAAM,EAClB,SAAS,cAAc,KACtB,IAAI,MAAM,EAG0B,CAAC;AAExC;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,oEAAoE;IACpE,GAAG,CACD,OAAO,EAAE,iBAAiB,EAC1B,EAAE,CAAC,EAAE,QAAQ,GACZ,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;IAC5C,qEAAqE;IACrE,IAAI,CACF,OAAO,EAAE,iBAAiB,EAC1B,SAAS,EAAE,eAAe,CAAC,MAAM,CAAC,GACjC,MAAM,CAAC,MAAM,CAAC,SAAS,WAAW,EAAE,EAAE,mBAAmB,CAAC,CAAC;CAC/D"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The path a verb is served at, from its entity's key, its own key and its
|
|
3
|
+
* binding
|
|
4
|
+
* ([ADR 0020](../../../../../docs/adr/0020-endpoints-are-descriptors-and-the-shell-builds-an-httpapi.md)):
|
|
5
|
+
* a verb on one record is `POST /api/<entity>/:id/<verb>`, one on a selection
|
|
6
|
+
* or on nothing is `POST /api/<entity>/<verb>`. The shell serves it there and a
|
|
7
|
+
* client calls it there, so the two cannot disagree.
|
|
8
|
+
*/ export const verbPath = (entityKey, useCaseKey, binding)=>binding === 'entity' ? `/api/${entityKey}/:id/${useCaseKey}` : `/api/${entityKey}/${useCaseKey}`;
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=use-case-runner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/use-case-runner/use-case-runner.ts"],"sourcesContent":["import type { Effect } from 'effect';\n\nimport type { UseCaseDescriptor } from '../entity-definition/describe/describe-entity-use-cases.js';\nimport type { UseCaseBinding } from '../entity-definition/meta-entities/meta-use-case/meta-use-case.js';\nimport type { TransitionalFailure } from '../failure/failure.js';\nimport type { BulkOutcome } from '../types/BulkOutcome.js';\nimport type { Entity, EntityId } from '../types/Entity.js';\nimport type { EntitySelection } from '../types/EntitySelection.js';\n\n/**\n * The path a verb is served at, from its entity's key, its own key and its\n * binding\n * ([ADR 0020](../../../../../docs/adr/0020-endpoints-are-descriptors-and-the-shell-builds-an-httpapi.md)):\n * a verb on one record is `POST /api/<entity>/:id/<verb>`, one on a selection\n * or on nothing is `POST /api/<entity>/<verb>`. The shell serves it there and a\n * client calls it there, so the two cannot disagree.\n */\nexport const verbPath = (\n entityKey: string,\n useCaseKey: string,\n binding: UseCaseBinding,\n): `/${string}` =>\n binding === 'entity'\n ? `/api/${entityKey}/:id/${useCaseKey}`\n : `/api/${entityKey}/${useCaseKey}`;\n\n/**\n * Runs an entity's verbs for a screen — over REST against the service that\n * serves them, or in-process for a host whose records live in the browser.\n * Chosen at composition, the way a repository is, so a generated screen runs\n * a verb without knowing which.\n */\nexport interface EntityUseCaseRunner {\n /** Runs a verb on one record, or on nothing for an unbound verb. */\n run(\n useCase: UseCaseDescriptor,\n id?: EntityId,\n ): Effect.Effect<void, TransitionalFailure>;\n /** Runs a collection verb on a selection, one outcome per record. */\n bulk(\n useCase: UseCaseDescriptor,\n selection: EntitySelection<Entity>,\n ): Effect.Effect<readonly BulkOutcome[], TransitionalFailure>;\n}\n"],"names":["verbPath","entityKey","useCaseKey","binding"],"mappings":"AASA;;;;;;;CAOC,GACD,OAAO,MAAMA,WAAW,CACtBC,WACAC,YACAC,UAEAA,YAAY,WACR,CAAC,KAAK,EAAEF,UAAU,KAAK,EAAEC,YAAY,GACrC,CAAC,KAAK,EAAED,UAAU,CAAC,EAAEC,YAAY,CAAC"}
|
package/package.json
CHANGED