@entifix/business 0.23.23 → 0.23.25
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/flow/slip.d.ts +9 -3
- package/dist/flow/slip.d.ts.map +1 -1
- package/dist/flow/slip.js +8 -1
- package/dist/flow/slip.js.map +1 -1
- package/package.json +2 -2
package/dist/flow/slip.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { Effect, Schema } from 'effect';
|
|
|
5
5
|
* flow that started under one grammar finishes under that grammar even after
|
|
6
6
|
* the next one ships.
|
|
7
7
|
*/
|
|
8
|
-
export declare const SLIP_VERSION:
|
|
8
|
+
export declare const SLIP_VERSION: 4;
|
|
9
9
|
/**
|
|
10
10
|
* Every grammar version a stored slip may be written in. A flow started under
|
|
11
11
|
* an earlier one still decodes and finishes under it.
|
|
@@ -18,8 +18,14 @@ export declare const SLIP_VERSION: 3;
|
|
|
18
18
|
* forward: a technical failure suspends it, a durable clock waits, and it is
|
|
19
19
|
* dispatched again until it answers or its bound is spent and the flow
|
|
20
20
|
* strands; a business refusal there strands it at once.
|
|
21
|
+
* - `4` — the same walk, and doubt is resolved before and at the commit
|
|
22
|
+
* point: a step whose call failed for a technical reason is asked again
|
|
23
|
+
* under its own idempotency key on a durable clock until it answers, and
|
|
24
|
+
* the walk goes on from that answer — a write that landed is never undone
|
|
25
|
+
* as if it had not, nor a pivot rolled back; an undoing that fails that way
|
|
26
|
+
* is tried again within the step's bound before the flow stops `failed`.
|
|
21
27
|
*/
|
|
22
|
-
export declare const SLIP_VERSIONS: readonly [1, 2, 3];
|
|
28
|
+
export declare const SLIP_VERSIONS: readonly [1, 2, 3, 4];
|
|
23
29
|
/**
|
|
24
30
|
* Tags that place a step in a segment of the flow: whose lines, which payment.
|
|
25
31
|
* `entitlements` are the facts verified for the party the segment acts for —
|
|
@@ -130,7 +136,7 @@ export type SlipResolution = typeof SlipResolution.Type;
|
|
|
130
136
|
* flow that has already started.
|
|
131
137
|
*/
|
|
132
138
|
export declare const Slip: Schema.Struct<{
|
|
133
|
-
readonly slipVersion: Schema.Literals<readonly [1, 2, 3]>;
|
|
139
|
+
readonly slipVersion: Schema.Literals<readonly [1, 2, 3, 4]>;
|
|
134
140
|
readonly flowId: Schema.String;
|
|
135
141
|
readonly recipe: Schema.String;
|
|
136
142
|
/** The recipe demands a commit point even with no retriable step (a checkout). */
|
package/dist/flow/slip.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slip.d.ts","sourceRoot":"","sources":["../../src/flow/slip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAExC;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAG,CAAU,CAAC;AAEvC
|
|
1
|
+
{"version":3,"file":"slip.d.ts","sourceRoot":"","sources":["../../src/flow/slip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAExC;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAG,CAAU,CAAC;AAEvC;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,aAAa,uBAAmC,CAAC;AAO9D;;;;;GAKG;AACH,eAAO,MAAM,WAAW;;;;EAItB,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC,IAAI,CAAC;AAElD;;;;;GAKG;AACH,eAAO,MAAM,SAAS;IACpB,sDAAsD;;;EAGtD,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC,IAAI,CAAC;AAE9C,4EAA4E;AAC5E,eAAO,MAAM,QAAQ;IACnB,uDAAuD;;IAEvD,gFAAgF;;;;;;;;IAIhF,uEAAuE;;;;;;;;;;;IAKvE,sEAAsE;;;QAnBtE,sDAAsD;;;;EAsBtD,CAAC;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC,IAAI,CAAC;AAE5C,eAAO,MAAM,SAAS;;;QAjBpB,uDAAuD;;QAEvD,gFAAgF;;;;;;;;QAIhF,uEAAuE;;;;;;;;;;;QAKvE,sEAAsE;;;YAnBtE,sDAAsD;;;;;EA4BtD,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC,IAAI,CAAC;AAE9C,yEAAyE;AACzE,eAAO,MAAM,iBAAiB;;;;EAI5B,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAC,IAAI,CAAC;AAE9D,kEAAkE;AAClE,eAAO,MAAM,cAAc;;;;EAIzB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC,IAAI,CAAC;AAExD;;;;GAIG;AACH,eAAO,MAAM,IAAI;;;;IAIf,kFAAkF;;;;;YAhDlF,uDAAuD;;YAEvD,gFAAgF;;;;;;;;YAIhF,uEAAuE;;;;;;;;;;;YAKvE,sEAAsE;;;gBAnBtE,sDAAsD;;;;;;;;;;;;IA6DtD;;;OAGG;;;;;;EAEH,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,OAAO,IAAI,CAAC,IAAI,CAAC;AAEpC;;;;GAIG;AACH,eAAO,MAAM,UAAU,GACrB,OAAO,OAAO,KACb,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAQnC,CAAC;AAEJ,4DAA4D;AAC5D,eAAO,MAAM,UAAU,GAAI,MAAM,IAAI,KAAG,OACT,CAAC;AAEhC,kDAAkD;AAClD,eAAO,MAAM,SAAS,GAAI,MAAM,IAAI,KAAG,SAAS,QAAQ,EACb,CAAC"}
|
package/dist/flow/slip.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Effect, Schema } from 'effect';
|
|
|
4
4
|
* The grammar version a slip is written in. An interpreter branches on it, so a
|
|
5
5
|
* flow that started under one grammar finishes under that grammar even after
|
|
6
6
|
* the next one ships.
|
|
7
|
-
*/ export const SLIP_VERSION =
|
|
7
|
+
*/ export const SLIP_VERSION = 4;
|
|
8
8
|
/**
|
|
9
9
|
* Every grammar version a stored slip may be written in. A flow started under
|
|
10
10
|
* an earlier one still decodes and finishes under it.
|
|
@@ -17,9 +17,16 @@ import { Effect, Schema } from 'effect';
|
|
|
17
17
|
* forward: a technical failure suspends it, a durable clock waits, and it is
|
|
18
18
|
* dispatched again until it answers or its bound is spent and the flow
|
|
19
19
|
* strands; a business refusal there strands it at once.
|
|
20
|
+
* - `4` — the same walk, and doubt is resolved before and at the commit
|
|
21
|
+
* point: a step whose call failed for a technical reason is asked again
|
|
22
|
+
* under its own idempotency key on a durable clock until it answers, and
|
|
23
|
+
* the walk goes on from that answer — a write that landed is never undone
|
|
24
|
+
* as if it had not, nor a pivot rolled back; an undoing that fails that way
|
|
25
|
+
* is tried again within the step's bound before the flow stops `failed`.
|
|
20
26
|
*/ export const SLIP_VERSIONS = [
|
|
21
27
|
1,
|
|
22
28
|
2,
|
|
29
|
+
3,
|
|
23
30
|
SLIP_VERSION
|
|
24
31
|
];
|
|
25
32
|
const Call = Schema.Struct({
|
package/dist/flow/slip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/flow/slip.ts"],"sourcesContent":["import { ProtocolFailure } from '@entifix/core';\nimport { Effect, Schema } from 'effect';\n\n/**\n * The grammar version a slip is written in. An interpreter branches on it, so a\n * flow that started under one grammar finishes under that grammar even after\n * the next one ships.\n */\nexport const SLIP_VERSION =
|
|
1
|
+
{"version":3,"sources":["../../src/flow/slip.ts"],"sourcesContent":["import { ProtocolFailure } from '@entifix/core';\nimport { Effect, Schema } from 'effect';\n\n/**\n * The grammar version a slip is written in. An interpreter branches on it, so a\n * flow that started under one grammar finishes under that grammar even after\n * the next one ships.\n */\nexport const SLIP_VERSION = 4 as const;\n\n/**\n * Every grammar version a stored slip may be written in. A flow started under\n * an earlier one still decodes and finishes under it.\n *\n * - `1` — the walk as first shipped.\n * - `2` — the same walk, and a wait past the commit point announces\n * `flow.waiting`: the caller's write has landed and what is left is someone\n * else's, so a browser holding the write pending can let it go.\n * - `3` — the same walk, and a step that fails past the commit point rolls\n * forward: a technical failure suspends it, a durable clock waits, and it is\n * dispatched again until it answers or its bound is spent and the flow\n * strands; a business refusal there strands it at once.\n * - `4` — the same walk, and doubt is resolved before and at the commit\n * point: a step whose call failed for a technical reason is asked again\n * under its own idempotency key on a durable clock until it answers, and\n * the walk goes on from that answer — a write that landed is never undone\n * as if it had not, nor a pivot rolled back; an undoing that fails that way\n * is tried again within the step's bound before the flow stops `failed`.\n */\nexport const SLIP_VERSIONS = [1, 2, 3, SLIP_VERSION] as const;\n\nconst Call = Schema.Struct({\n method: Schema.Literals(['GET', 'POST', 'PUT', 'PATCH', 'DELETE']),\n path: Schema.String,\n});\n\n/**\n * Tags that place a step in a segment of the flow: whose lines, which payment.\n * `entitlements` are the facts verified for the party the segment acts for —\n * a vendor's provisioning, never the caller's — and a segment's steps are\n * checked against them beside the flow's context.\n */\nexport const SlipSegment = Schema.Struct({\n vendor: Schema.optionalKey(Schema.String),\n paymentMethod: Schema.optionalKey(Schema.String),\n entitlements: Schema.optionalKey(Schema.Array(Schema.String)),\n});\nexport type SlipSegment = typeof SlipSegment.Type;\n\n/**\n * A step that runs only when an earlier wait was answered with one of\n * `outcomes` — the one branch a slip can take, decided by what the wait was\n * told rather than by anything known at composition. A step guarded on a wait\n * that was itself skipped is skipped too.\n */\nexport const SlipGuard = Schema.Struct({\n /** The step name of the wait, earlier in the slip. */\n wait: Schema.String,\n outcomes: Schema.Array(Schema.String),\n});\nexport type SlipGuard = typeof SlipGuard.Type;\n\n/** One pinned step: a fragment reference and everything resolved for it. */\nexport const SlipStep = Schema.Struct({\n /** `id@version`, pinned when the slip was composed. */\n ref: Schema.String,\n /** Unique within the slip; what an Activity is named after (`segment:step`). */\n step: Schema.String,\n cardinality: Schema.Literals(['one', 'perVendor', 'perLine']),\n segment: Schema.optionalKey(SlipSegment),\n /** The line a `perLine` step was expanded for, by the recipe's key. */\n line: Schema.optionalKey(Schema.String),\n participant: Schema.optionalKey(Schema.String),\n call: Schema.optionalKey(Call),\n compensation: Schema.optionalKey(Call),\n /** Configuration pinned at composition — a hold's expiry, a limit. */\n parameters: Schema.optionalKey(Schema.Record(Schema.String, Schema.Unknown)),\n guard: Schema.optionalKey(SlipGuard),\n});\nexport type SlipStep = typeof SlipStep.Type;\n\nexport const SlipStage = Schema.Struct({\n name: Schema.String,\n steps: Schema.Array(SlipStep),\n});\nexport type SlipStage = typeof SlipStage.Type;\n\n/** Who may receive what the flow announces — the envelope's audience. */\nexport const SlipAudienceEntry = Schema.Struct({\n kind: Schema.Literals(['organization', 'party', 'flow']),\n id: Schema.String,\n digest: Schema.optionalKey(Schema.String),\n});\nexport type SlipAudienceEntry = typeof SlipAudienceEntry.Type;\n\n/** Which variant each use case resolved to, and by which rule. */\nexport const SlipResolution = Schema.Struct({\n useCase: Schema.String,\n variant: Schema.String,\n rule: Schema.Number,\n});\nexport type SlipResolution = typeof SlipResolution.Type;\n\n/**\n * A routing slip: ordered stages of pinned steps, composed once at start and\n * stored as the flow's payload. Changing a recipe or a fragment never changes a\n * flow that has already started.\n */\nexport const Slip = Schema.Struct({\n slipVersion: Schema.Literals(SLIP_VERSIONS),\n flowId: Schema.String,\n recipe: Schema.String,\n /** The recipe demands a commit point even with no retriable step (a checkout). */\n requiresCommitPoint: Schema.optionalKey(Schema.Boolean),\n stages: Schema.Array(SlipStage),\n resolution: Schema.Array(SlipResolution),\n composedAt: Schema.String,\n /**\n * Who the flow's `flow.*` events reach beside the flow itself — the\n * organizations and parties it acts for, pinned when it was composed.\n */\n audience: Schema.optionalKey(Schema.Array(SlipAudienceEntry)),\n});\nexport type Slip = typeof Slip.Type;\n\n/**\n * Decodes a stored or received slip. An unknown `slipVersion`, like any shape\n * the grammar does not describe, is a protocol failure: an interpreter must\n * never guess at a grammar it was not built for.\n */\nexport const decodeSlip = (\n input: unknown,\n): Effect.Effect<Slip, ProtocolFailure> =>\n Schema.decodeUnknownEffect(Slip)(input).pipe(\n Effect.mapError(\n error =>\n new ProtocolFailure({\n reason: `the slip does not decode: ${error.message}`,\n }),\n ),\n );\n\n/** Encodes a slip as the workflow payload it travels as. */\nexport const encodeSlip = (slip: Slip): unknown =>\n Schema.encodeSync(Slip)(slip);\n\n/** Every step of a slip, in the order it runs. */\nexport const slipSteps = (slip: Slip): readonly SlipStep[] =>\n slip.stages.flatMap(stage => stage.steps);\n"],"names":["ProtocolFailure","Effect","Schema","SLIP_VERSION","SLIP_VERSIONS","Call","Struct","method","Literals","path","String","SlipSegment","vendor","optionalKey","paymentMethod","entitlements","Array","SlipGuard","wait","outcomes","SlipStep","ref","step","cardinality","segment","line","participant","call","compensation","parameters","Record","Unknown","guard","SlipStage","name","steps","SlipAudienceEntry","kind","id","digest","SlipResolution","useCase","variant","rule","Number","Slip","slipVersion","flowId","recipe","requiresCommitPoint","Boolean","stages","resolution","composedAt","audience","decodeSlip","input","decodeUnknownEffect","pipe","mapError","error","reason","message","encodeSlip","slip","encodeSync","slipSteps","flatMap","stage"],"mappings":"AAAA,SAASA,eAAe,QAAQ,gBAAgB;AAChD,SAASC,MAAM,EAAEC,MAAM,QAAQ,SAAS;AAExC;;;;CAIC,GACD,OAAO,MAAMC,eAAe,EAAW;AAEvC;;;;;;;;;;;;;;;;;;CAkBC,GACD,OAAO,MAAMC,gBAAgB;IAAC;IAAG;IAAG;IAAGD;CAAa,CAAU;AAE9D,MAAME,OAAOH,OAAOI,MAAM,CAAC;IACzBC,QAAQL,OAAOM,QAAQ,CAAC;QAAC;QAAO;QAAQ;QAAO;QAAS;KAAS;IACjEC,MAAMP,OAAOQ,MAAM;AACrB;AAEA;;;;;CAKC,GACD,OAAO,MAAMC,cAAcT,OAAOI,MAAM,CAAC;IACvCM,QAAQV,OAAOW,WAAW,CAACX,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AOQ,MAAM;AAC1C,GAAG;AAGH,gEAAgE,GAChE,OAAO,MAAM8B,iBAAiBtC,OAAOI,MAAM,CAAC;IAC1CmC,SAASvC,OAAOQ,MAAM;IACtBgC,SAASxC,OAAOQ,MAAM;IACtBiC,MAAMzC,OAAO0C,MAAM;AACrB,GAAG;AAGH;;;;CAIC,GACD,OAAO,MAAMC,OAAO3C,OAAOI,MAAM,CAAC;IAChCwC,aAAa5C,OAAOM,QAAQ,CAACJ;IAC7B2C,QAAQ7C,OAAOQ,MAAM;IACrBsC,QAAQ9C,OAAOQ,MAAM;IACrB,gFAAgF,GAChFuC,qBAAqB/C,OAAOW,WAAW,CAACX,OAAOgD,OAAO;IACtDC,QAAQjD,OAAOc,KAAK,CAACiB;IACrBmB,YAAYlD,OAAOc,KAAK,CAACwB;IACzBa,YAAYnD,OAAOQ,MAAM;IACzB;;;GAGC,GACD4C,UAAUpD,OAAOW,WAAW,CAACX,OAAOc,KAAK,CAACoB;AAC5C,GAAG;AAGH;;;;CAIC,GACD,OAAO,MAAMmB,aAAa,CACxBC,QAEAtD,OAAOuD,mBAAmB,CAACZ,MAAMW,OAAOE,IAAI,CAC1CzD,OAAO0D,QAAQ,CACbC,CAAAA,QACE,IAAI5D,gBAAgB;YAClB6D,QAAQ,CAAC,0BAA0B,EAAED,MAAME,OAAO,EAAE;QACtD,KAEJ;AAEJ,0DAA0D,GAC1D,OAAO,MAAMC,aAAa,CAACC,OACzB9D,OAAO+D,UAAU,CAACpB,MAAMmB,MAAM;AAEhC,gDAAgD,GAChD,OAAO,MAAME,YAAY,CAACF,OACxBA,KAAKb,MAAM,CAACgB,OAAO,CAACC,CAAAA,QAASA,MAAMjC,KAAK,EAAE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@entifix/business",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.25",
|
|
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": {
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"@swc/helpers": "0.5.23",
|
|
69
|
-
"@entifix/core": "0.23.
|
|
69
|
+
"@entifix/core": "0.23.25"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
72
|
"effect": "^4.0.7"
|