@entifix/business 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.
Files changed (73) hide show
  1. package/dist/compose/compose.d.ts +107 -0
  2. package/dist/compose/compose.d.ts.map +1 -0
  3. package/dist/compose/compose.js +146 -0
  4. package/dist/compose/compose.js.map +1 -0
  5. package/dist/compose/index.d.ts +2 -0
  6. package/dist/compose/index.d.ts.map +1 -0
  7. package/dist/compose/index.js +3 -0
  8. package/dist/compose/index.js.map +1 -0
  9. package/dist/entity-api/entity-api.d.ts +137 -0
  10. package/dist/entity-api/entity-api.d.ts.map +1 -0
  11. package/dist/entity-api/entity-api.js +17 -0
  12. package/dist/entity-api/entity-api.js.map +1 -0
  13. package/dist/entity-api/index.d.ts +2 -0
  14. package/dist/entity-api/index.d.ts.map +1 -0
  15. package/dist/entity-api/index.js +3 -0
  16. package/dist/entity-api/index.js.map +1 -0
  17. package/dist/flow/catalog.d.ts +51 -0
  18. package/dist/flow/catalog.d.ts.map +1 -0
  19. package/dist/flow/catalog.js +63 -0
  20. package/dist/flow/catalog.js.map +1 -0
  21. package/dist/flow/fragment.d.ts +105 -0
  22. package/dist/flow/fragment.d.ts.map +1 -0
  23. package/dist/flow/fragment.js +77 -0
  24. package/dist/flow/fragment.js.map +1 -0
  25. package/dist/flow/index.d.ts +5 -0
  26. package/dist/flow/index.d.ts.map +1 -0
  27. package/dist/flow/index.js +6 -0
  28. package/dist/flow/index.js.map +1 -0
  29. package/dist/flow/slip.d.ts +141 -0
  30. package/dist/flow/slip.d.ts.map +1 -0
  31. package/dist/flow/slip.js +81 -0
  32. package/dist/flow/slip.js.map +1 -0
  33. package/dist/flow/validate.d.ts +70 -0
  34. package/dist/flow/validate.d.ts.map +1 -0
  35. package/dist/flow/validate.js +145 -0
  36. package/dist/flow/validate.js.map +1 -0
  37. package/dist/idempotency/idempotency-store.d.ts +53 -0
  38. package/dist/idempotency/idempotency-store.d.ts.map +1 -0
  39. package/dist/idempotency/idempotency-store.js +5 -0
  40. package/dist/idempotency/idempotency-store.js.map +1 -0
  41. package/dist/idempotency/index.d.ts +2 -0
  42. package/dist/idempotency/index.d.ts.map +1 -0
  43. package/dist/idempotency/index.js +3 -0
  44. package/dist/idempotency/index.js.map +1 -0
  45. package/dist/index.d.ts +4 -0
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +4 -0
  48. package/dist/index.js.map +1 -1
  49. package/dist/request/index.d.ts +2 -0
  50. package/dist/request/index.d.ts.map +1 -0
  51. package/dist/request/index.js +3 -0
  52. package/dist/request/index.js.map +1 -0
  53. package/dist/request/request-context.d.ts +86 -0
  54. package/dist/request/request-context.d.ts.map +1 -0
  55. package/dist/request/request-context.js +23 -0
  56. package/dist/request/request-context.js.map +1 -0
  57. package/dist/resolve/index.d.ts +3 -0
  58. package/dist/resolve/index.d.ts.map +1 -0
  59. package/dist/resolve/index.js +4 -0
  60. package/dist/resolve/index.js.map +1 -0
  61. package/dist/resolve/resolve.d.ts +70 -0
  62. package/dist/resolve/resolve.d.ts.map +1 -0
  63. package/dist/resolve/resolve.js +69 -0
  64. package/dist/resolve/resolve.js.map +1 -0
  65. package/dist/resolve/verified-context.d.ts +45 -0
  66. package/dist/resolve/verified-context.d.ts.map +1 -0
  67. package/dist/resolve/verified-context.js +8 -0
  68. package/dist/resolve/verified-context.js.map +1 -0
  69. package/dist/verified/index.d.ts +10 -0
  70. package/dist/verified/index.d.ts.map +1 -0
  71. package/dist/verified/index.js +10 -0
  72. package/dist/verified/index.js.map +1 -0
  73. package/package.json +17 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/flow/validate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAEL,KAAK,YAAY,EACjB,KA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,2EAA2E;AAC3E,eAAO,MAAM,qBAAqB,GAChC,YAAY,SAAS,aAAa,EAAE,KACnC,OAEkE,CAAC;AAEtE;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAC1B,MAAM,IAAI,EACV,SAAS,eAAe,EACxB,UAAS,mBAAwB,KAChC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,kBAAkB,GAAG,qBAAqB,CAQhE,CAAC"}
@@ -0,0 +1,145 @@
1
+ import { Failure } from '@entifix/core';
2
+ import { Effect, Schema } from 'effect';
3
+ import { jsonSchemaOf } from './fragment.js';
4
+ import { slipSteps } from './slip.js';
5
+ const sameSchema = (a, b)=>a === b || JSON.stringify(jsonSchemaOf(a)) === JSON.stringify(jsonSchemaOf(b));
6
+ /** The requirements `facts` do not meet, described; empty when all are met. */ export const unmetRequirements = (requires, facts)=>{
7
+ var _requires_entitlements, _facts_entitlements, _requires_roles, _facts_roles, _facts_partyRole, _facts_channel;
8
+ const missing = [];
9
+ for (const entitlement of (_requires_entitlements = requires.entitlements) != null ? _requires_entitlements : [])if (!((_facts_entitlements = facts.entitlements) != null ? _facts_entitlements : []).includes(entitlement)) missing.push(`entitlement '${entitlement}'`);
10
+ for (const role of (_requires_roles = requires.roles) != null ? _requires_roles : [])if (!((_facts_roles = facts.roles) != null ? _facts_roles : []).includes(role)) missing.push(`role '${role}'`);
11
+ if (requires.partyRoles !== undefined && !requires.partyRoles.includes((_facts_partyRole = facts.partyRole) != null ? _facts_partyRole : '')) missing.push(`party role in ${requires.partyRoles.join(', ')}`);
12
+ if (requires.channels !== undefined && !requires.channels.includes((_facts_channel = facts.channel) != null ? _facts_channel : '')) missing.push(`channel in ${requires.channels.join(', ')}`);
13
+ return missing;
14
+ };
15
+ /**
16
+ * Checks a slip against its catalog and returns **every** violation, one tag
17
+ * per rule, rather than throwing at the first — so a CI job enumerating every
18
+ * composition reports them all in one run. Pure: no clock, no I/O.
19
+ */ export const validateSlip = (slip, catalog, options = {})=>{
20
+ var _options_start;
21
+ const violations = [];
22
+ const resolved = [];
23
+ for (const step of slipSteps(slip)){
24
+ const fragment = catalog.get(step.ref);
25
+ if (fragment === undefined) violations.push({
26
+ tag: 'UnknownFragment',
27
+ step: step.step,
28
+ detail: `'${step.ref}' is not in the catalog`
29
+ });
30
+ else resolved.push({
31
+ step,
32
+ fragment
33
+ });
34
+ }
35
+ const pivots = resolved.filter(({ fragment })=>fragment.kind === 'pivot');
36
+ if (pivots.length > 1) violations.push({
37
+ tag: 'TooManyPivots',
38
+ detail: `the slip has ${String(pivots.length)} pivots (${pivots.map(({ step })=>step.step).join(', ')}); a flow has one point of no return`
39
+ });
40
+ const commitAt = resolved.findIndex(({ fragment })=>fragment.kind === 'pivot');
41
+ const hasRetriable = resolved.some(({ fragment })=>fragment.kind === 'retriable');
42
+ if (commitAt === -1 && (hasRetriable || slip.requiresCommitPoint === true)) violations.push({
43
+ tag: 'MissingCommitPoint',
44
+ detail: 'the slip needs one commit point — a pivot, or flow.commit@1 — before its first retriable step'
45
+ });
46
+ const provided = new Map(Object.entries((_options_start = options.start) != null ? _options_start : {}));
47
+ resolved.forEach(({ step, fragment }, index)=>{
48
+ var _fragment_excludedFrom, _fragment_consumes, _fragment_provides;
49
+ const beforeCommit = commitAt === -1 || index < commitAt;
50
+ const afterCommit = commitAt !== -1 && index > commitAt;
51
+ if (fragment.kind === 'retriable' && commitAt !== -1 && index < commitAt) violations.push({
52
+ tag: 'RetriableBeforeCommit',
53
+ step: step.step,
54
+ detail: `'${step.ref}' is retriable and runs before the commit point, where a failure must compensate`
55
+ });
56
+ if (fragment.kind === 'compensatable' && afterCommit) violations.push({
57
+ tag: 'CompensatableAfterCommit',
58
+ step: step.step,
59
+ detail: `'${step.ref}' is compensatable and runs after the commit point, where nothing is undone`
60
+ });
61
+ if (fragment.irreversible === true && fragment.kind !== 'pivot' && beforeCommit) violations.push({
62
+ tag: 'IrreversibleBeforeCommit',
63
+ step: step.step,
64
+ detail: `'${step.ref}' cannot be undone and runs before the commit point`
65
+ });
66
+ if (fragment.kind === 'wait' && beforeCommit) violations.push({
67
+ tag: 'WaitBeforeCommit',
68
+ step: step.step,
69
+ detail: `'${step.ref}' waits before the commit point, holding uncommitted state for as long as it waits`
70
+ });
71
+ for (const [tag, values] of Object.entries((_fragment_excludedFrom = fragment.excludedFrom) != null ? _fragment_excludedFrom : {})){
72
+ var _step_segment;
73
+ const value = (_step_segment = step.segment) == null ? void 0 : _step_segment[tag];
74
+ if (value !== undefined && values.includes(value)) violations.push({
75
+ tag: 'ExcludedFromSegment',
76
+ step: step.step,
77
+ detail: `'${step.ref}' may not run in a segment whose ${tag} is '${value}'`
78
+ });
79
+ }
80
+ for (const [key, schema] of Object.entries((_fragment_consumes = fragment.consumes) != null ? _fragment_consumes : {})){
81
+ const earlier = provided.get(key);
82
+ if (earlier === undefined) violations.push({
83
+ tag: 'UnsatisfiedInput',
84
+ step: step.step,
85
+ detail: `'${step.ref}' consumes '${key}', which nothing before it provides`
86
+ });
87
+ else if (!sameSchema(earlier, schema)) violations.push({
88
+ tag: 'UnsatisfiedInput',
89
+ step: step.step,
90
+ detail: `'${step.ref}' consumes '${key}' with a schema other than the one provided`
91
+ });
92
+ }
93
+ for (const [key, schema] of Object.entries((_fragment_provides = fragment.provides) != null ? _fragment_provides : {}))provided.set(key, schema);
94
+ if (options.context !== undefined && fragment.requires !== undefined) {
95
+ const missing = unmetRequirements(fragment.requires, options.context);
96
+ if (missing.length > 0) violations.push({
97
+ tag: 'UnmetRequirement',
98
+ step: step.step,
99
+ detail: `'${step.ref}' requires ${missing.join(', ')}`
100
+ });
101
+ }
102
+ });
103
+ return violations;
104
+ };
105
+ const SlipViolationSchema = Schema.Struct({
106
+ tag: Schema.String,
107
+ step: Schema.optionalKey(Schema.String),
108
+ detail: Schema.String
109
+ });
110
+ /**
111
+ * A flow that cannot be composed for this caller: the slip broke at least one
112
+ * rule. Every violation travels with it.
113
+ */ export class CompositionRefused extends Failure.declined()('CompositionRefused', 'flowNotComposable', {
114
+ violations: Schema.Array(SlipViolationSchema)
115
+ }, {
116
+ message: ({ violations })=>`the flow cannot be composed: ${violations.map((v)=>v.tag).join(', ')}`
117
+ }) {
118
+ }
119
+ /**
120
+ * A flow this caller is not offered: every rule the slip broke is a step's
121
+ * requirement — an entitlement, a role, a party role or a channel — that the
122
+ * verified context lacks. The recipe is sound; the caller may not run it, so
123
+ * it is `forbidden` rather than a slip that could not be built.
124
+ */ export class FlowRequirementsUnmet extends Failure.forbidden()('FlowRequirementsUnmet', 'flowRequirementsUnmet', {
125
+ violations: Schema.Array(SlipViolationSchema)
126
+ }, {
127
+ message: ({ violations })=>`the flow is not offered to this caller: ${violations.map((v)=>v.detail).join('; ')}`
128
+ }) {
129
+ }
130
+ /** Every violation is a requirement the caller lacks, and there is one. */ export const onlyUnmetRequirements = (violations)=>violations.length > 0 && violations.every((violation)=>violation.tag === 'UnmetRequirement');
131
+ /**
132
+ * Validates a slip, failing on any violation: with {@link FlowRequirementsUnmet}
133
+ * when the caller lacks only what steps require, and otherwise with
134
+ * {@link CompositionRefused}, which carries every violation.
135
+ */ export const assertValidSlip = (slip, catalog, options = {})=>{
136
+ const violations = validateSlip(slip, catalog, options);
137
+ if (violations.length === 0) return Effect.succeed(slip);
138
+ return Effect.fail(onlyUnmetRequirements(violations) ? new FlowRequirementsUnmet({
139
+ violations
140
+ }) : new CompositionRefused({
141
+ violations
142
+ }));
143
+ };
144
+
145
+ //# sourceMappingURL=validate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/flow/validate.ts"],"sourcesContent":["import { Failure } from '@entifix/core';\nimport { Effect, Schema } from 'effect';\n\nimport type { FragmentCatalog } from './catalog.js';\nimport {\n type FragmentDescriptor,\n type FragmentKeys,\n type FragmentRequirements,\n jsonSchemaOf,\n} from './fragment.js';\nimport { type Slip, type SlipStep, slipSteps } from './slip.js';\n\n/** One rule a slip broke, named by its tag. */\nexport interface SlipViolation {\n readonly tag:\n | 'UnknownFragment'\n | 'TooManyPivots'\n | 'MissingCommitPoint'\n | 'RetriableBeforeCommit'\n | 'CompensatableAfterCommit'\n | 'IrreversibleBeforeCommit'\n | 'WaitBeforeCommit'\n | 'ExcludedFromSegment'\n | 'UnsatisfiedInput'\n | 'UnmetRequirement';\n /** The step that broke it, when one step did. */\n readonly step?: string;\n readonly detail: string;\n}\n\n/** The facts of a verified context a slip's requirements are checked against. */\nexport interface RequirementFacts {\n readonly entitlements?: readonly string[];\n readonly roles?: readonly string[];\n readonly partyRole?: string;\n readonly channel?: string;\n}\n\nexport interface ValidateSlipOptions {\n /** The facts the caller was verified with; requirements go unchecked without them. */\n readonly context?: RequirementFacts;\n /** Keys the flow's start input provides, with their schemas. */\n readonly start?: FragmentKeys;\n}\n\nconst sameSchema = (\n a: Schema.Codec<unknown, unknown>,\n b: Schema.Codec<unknown, unknown>,\n): boolean =>\n a === b ||\n JSON.stringify(jsonSchemaOf(a)) === JSON.stringify(jsonSchemaOf(b));\n\n/** The requirements `facts` do not meet, described; empty when all are met. */\nexport const unmetRequirements = (\n requires: FragmentRequirements,\n facts: RequirementFacts,\n): string[] => {\n const missing: string[] = [];\n for (const entitlement of requires.entitlements ?? [])\n if (!(facts.entitlements ?? []).includes(entitlement))\n missing.push(`entitlement '${entitlement}'`);\n for (const role of requires.roles ?? [])\n if (!(facts.roles ?? []).includes(role)) missing.push(`role '${role}'`);\n if (\n requires.partyRoles !== undefined &&\n !requires.partyRoles.includes(facts.partyRole ?? '')\n )\n missing.push(`party role in ${requires.partyRoles.join(', ')}`);\n if (\n requires.channels !== undefined &&\n !requires.channels.includes(facts.channel ?? '')\n )\n missing.push(`channel in ${requires.channels.join(', ')}`);\n return missing;\n};\n\n/**\n * Checks a slip against its catalog and returns **every** violation, one tag\n * per rule, rather than throwing at the first — so a CI job enumerating every\n * composition reports them all in one run. Pure: no clock, no I/O.\n */\nexport const validateSlip = (\n slip: Slip,\n catalog: FragmentCatalog,\n options: ValidateSlipOptions = {},\n): readonly SlipViolation[] => {\n const violations: SlipViolation[] = [];\n const resolved: {\n readonly step: SlipStep;\n readonly fragment: FragmentDescriptor;\n }[] = [];\n\n for (const step of slipSteps(slip)) {\n const fragment = catalog.get(step.ref);\n if (fragment === undefined)\n violations.push({\n tag: 'UnknownFragment',\n step: step.step,\n detail: `'${step.ref}' is not in the catalog`,\n });\n else resolved.push({ step, fragment });\n }\n\n const pivots = resolved.filter(({ fragment }) => fragment.kind === 'pivot');\n if (pivots.length > 1)\n violations.push({\n tag: 'TooManyPivots',\n detail: `the slip has ${String(pivots.length)} pivots (${pivots\n .map(({ step }) => step.step)\n .join(', ')}); a flow has one point of no return`,\n });\n\n const commitAt = resolved.findIndex(\n ({ fragment }) => fragment.kind === 'pivot',\n );\n const hasRetriable = resolved.some(\n ({ fragment }) => fragment.kind === 'retriable',\n );\n if (commitAt === -1 && (hasRetriable || slip.requiresCommitPoint === true))\n violations.push({\n tag: 'MissingCommitPoint',\n detail:\n 'the slip needs one commit point — a pivot, or flow.commit@1 — before its first retriable step',\n });\n\n const provided = new Map<string, Schema.Codec<unknown, unknown>>(\n Object.entries(options.start ?? {}),\n );\n\n resolved.forEach(({ step, fragment }, index) => {\n const beforeCommit = commitAt === -1 || index < commitAt;\n const afterCommit = commitAt !== -1 && index > commitAt;\n\n if (fragment.kind === 'retriable' && commitAt !== -1 && index < commitAt)\n violations.push({\n tag: 'RetriableBeforeCommit',\n step: step.step,\n detail: `'${step.ref}' is retriable and runs before the commit point, where a failure must compensate`,\n });\n if (fragment.kind === 'compensatable' && afterCommit)\n violations.push({\n tag: 'CompensatableAfterCommit',\n step: step.step,\n detail: `'${step.ref}' is compensatable and runs after the commit point, where nothing is undone`,\n });\n if (\n fragment.irreversible === true &&\n fragment.kind !== 'pivot' &&\n beforeCommit\n )\n violations.push({\n tag: 'IrreversibleBeforeCommit',\n step: step.step,\n detail: `'${step.ref}' cannot be undone and runs before the commit point`,\n });\n if (fragment.kind === 'wait' && beforeCommit)\n violations.push({\n tag: 'WaitBeforeCommit',\n step: step.step,\n detail: `'${step.ref}' waits before the commit point, holding uncommitted state for as long as it waits`,\n });\n\n for (const [tag, values] of Object.entries(fragment.excludedFrom ?? {})) {\n const value = (\n step.segment as Record<string, string | undefined> | undefined\n )?.[tag];\n if (value !== undefined && values.includes(value))\n violations.push({\n tag: 'ExcludedFromSegment',\n step: step.step,\n detail: `'${step.ref}' may not run in a segment whose ${tag} is '${value}'`,\n });\n }\n\n for (const [key, schema] of Object.entries(fragment.consumes ?? {})) {\n const earlier = provided.get(key);\n if (earlier === undefined)\n violations.push({\n tag: 'UnsatisfiedInput',\n step: step.step,\n detail: `'${step.ref}' consumes '${key}', which nothing before it provides`,\n });\n else if (!sameSchema(earlier, schema))\n violations.push({\n tag: 'UnsatisfiedInput',\n step: step.step,\n detail: `'${step.ref}' consumes '${key}' with a schema other than the one provided`,\n });\n }\n for (const [key, schema] of Object.entries(fragment.provides ?? {}))\n provided.set(key, schema);\n\n if (options.context !== undefined && fragment.requires !== undefined) {\n const missing = unmetRequirements(fragment.requires, options.context);\n if (missing.length > 0)\n violations.push({\n tag: 'UnmetRequirement',\n step: step.step,\n detail: `'${step.ref}' requires ${missing.join(', ')}`,\n });\n }\n });\n\n return violations;\n};\n\nconst SlipViolationSchema = Schema.Struct({\n tag: Schema.String,\n step: Schema.optionalKey(Schema.String),\n detail: Schema.String,\n});\n\n/**\n * A flow that cannot be composed for this caller: the slip broke at least one\n * rule. Every violation travels with it.\n */\nexport class CompositionRefused extends Failure.declined<CompositionRefused>()(\n 'CompositionRefused',\n 'flowNotComposable',\n { violations: Schema.Array(SlipViolationSchema) },\n {\n message: ({ violations }) =>\n `the flow cannot be composed: ${violations.map(v => v.tag).join(', ')}`,\n },\n) {}\n\n/**\n * A flow this caller is not offered: every rule the slip broke is a step's\n * requirement — an entitlement, a role, a party role or a channel — that the\n * verified context lacks. The recipe is sound; the caller may not run it, so\n * it is `forbidden` rather than a slip that could not be built.\n */\nexport class FlowRequirementsUnmet extends Failure.forbidden<FlowRequirementsUnmet>()(\n 'FlowRequirementsUnmet',\n 'flowRequirementsUnmet',\n { violations: Schema.Array(SlipViolationSchema) },\n {\n message: ({ violations }) =>\n `the flow is not offered to this caller: ${violations.map(v => v.detail).join('; ')}`,\n },\n) {}\n\n/** Every violation is a requirement the caller lacks, and there is one. */\nexport const onlyUnmetRequirements = (\n violations: readonly SlipViolation[],\n): boolean =>\n violations.length > 0 &&\n violations.every(violation => violation.tag === 'UnmetRequirement');\n\n/**\n * Validates a slip, failing on any violation: with {@link FlowRequirementsUnmet}\n * when the caller lacks only what steps require, and otherwise with\n * {@link CompositionRefused}, which carries every violation.\n */\nexport const assertValidSlip = (\n slip: Slip,\n catalog: FragmentCatalog,\n options: ValidateSlipOptions = {},\n): Effect.Effect<Slip, CompositionRefused | FlowRequirementsUnmet> => {\n const violations = validateSlip(slip, catalog, options);\n if (violations.length === 0) return Effect.succeed(slip);\n return Effect.fail(\n onlyUnmetRequirements(violations)\n ? new FlowRequirementsUnmet({ violations })\n : new CompositionRefused({ violations }),\n );\n};\n"],"names":["Failure","Effect","Schema","jsonSchemaOf","slipSteps","sameSchema","a","b","JSON","stringify","unmetRequirements","requires","facts","missing","entitlement","entitlements","includes","push","role","roles","partyRoles","undefined","partyRole","join","channels","channel","validateSlip","slip","catalog","options","violations","resolved","step","fragment","get","ref","tag","detail","pivots","filter","kind","length","String","map","commitAt","findIndex","hasRetriable","some","requiresCommitPoint","provided","Map","Object","entries","start","forEach","index","beforeCommit","afterCommit","irreversible","values","excludedFrom","value","segment","key","schema","consumes","earlier","provides","set","context","SlipViolationSchema","Struct","optionalKey","CompositionRefused","declined","Array","message","v","FlowRequirementsUnmet","forbidden","onlyUnmetRequirements","every","violation","assertValidSlip","succeed","fail"],"mappings":"AAAA,SAASA,OAAO,QAAQ,gBAAgB;AACxC,SAASC,MAAM,EAAEC,MAAM,QAAQ,SAAS;AAGxC,SAIEC,YAAY,QACP,gBAAgB;AACvB,SAAmCC,SAAS,QAAQ,YAAY;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AAM9B,OAAOsE,WAAW,CAACtE,OAAOwC,MAAM;IACtCL,QAAQnC,OAAOwC,MAAM;AACvB;AAEA;;;CAGC,GACD,OAAO,MAAM+B,2BAA2BzE,QAAQ0E,QAAQ,GACtD,sBACA,qBACA;IAAE5C,YAAY5B,OAAOyE,KAAK,CAACL;AAAqB,GAChD;IACEM,SAAS,CAAC,EAAE9C,UAAU,EAAE,GACtB,CAAC,6BAA6B,EAAEA,WAAWa,GAAG,CAACkC,CAAAA,IAAKA,EAAEzC,GAAG,EAAEb,IAAI,CAAC,OAAO;AAC3E;AACC;AAEH;;;;;CAKC,GACD,OAAO,MAAMuD,8BAA8B9E,QAAQ+E,SAAS,GAC1D,yBACA,yBACA;IAAEjD,YAAY5B,OAAOyE,KAAK,CAACL;AAAqB,GAChD;IACEM,SAAS,CAAC,EAAE9C,UAAU,EAAE,GACtB,CAAC,wCAAwC,EAAEA,WAAWa,GAAG,CAACkC,CAAAA,IAAKA,EAAExC,MAAM,EAAEd,IAAI,CAAC,OAAO;AACzF;AACC;AAEH,yEAAyE,GACzE,OAAO,MAAMyD,wBAAwB,CACnClD,aAEAA,WAAWW,MAAM,GAAG,KACpBX,WAAWmD,KAAK,CAACC,CAAAA,YAAaA,UAAU9C,GAAG,KAAK,oBAAoB;AAEtE;;;;CAIC,GACD,OAAO,MAAM+C,kBAAkB,CAC7BxD,MACAC,SACAC,UAA+B,CAAC,CAAC;IAEjC,MAAMC,aAAaJ,aAAaC,MAAMC,SAASC;IAC/C,IAAIC,WAAWW,MAAM,KAAK,GAAG,OAAOxC,OAAOmF,OAAO,CAACzD;IACnD,OAAO1B,OAAOoF,IAAI,CAChBL,sBAAsBlD,cAClB,IAAIgD,sBAAsB;QAAEhD;IAAW,KACvC,IAAI2C,mBAAmB;QAAE3C;IAAW;AAE5C,EAAE"}
@@ -0,0 +1,53 @@
1
+ import type { StoreFailure } from '@entifix/core';
2
+ import { Context, type Effect } from 'effect';
3
+ /** A response as it is replayed: status, content type and body text. */
4
+ export interface StoredResponse {
5
+ readonly status: number;
6
+ readonly contentType?: string;
7
+ readonly body: string;
8
+ }
9
+ /**
10
+ * One request's claim on its `Idempotency-Key`. The dedup key is the caller,
11
+ * the route and the key together, so two callers — or two routes — choosing
12
+ * the same key never collide; the fingerprint is what tells a retry from a
13
+ * different request reusing a key.
14
+ */
15
+ export interface IdempotencyRecord {
16
+ readonly dedupKey: string;
17
+ readonly fingerprint: string;
18
+ readonly state: 'inFlight' | 'completed';
19
+ readonly response?: StoredResponse;
20
+ /** ISO-8601. Past it, the record is treated as absent. */
21
+ readonly expiresAt: string;
22
+ }
23
+ /** What a claim found: nothing, so this request owns the key, or a live record. */
24
+ export type IdempotencyClaim = {
25
+ readonly _tag: 'claimed';
26
+ } | {
27
+ readonly _tag: 'existing';
28
+ readonly record: IdempotencyRecord;
29
+ };
30
+ /**
31
+ * Where a route remembers the requests it has answered under an
32
+ * `Idempotency-Key` — what makes a redelivered command, or a client's retry,
33
+ * answer what the first one did instead of acting twice.
34
+ *
35
+ * Retention is the implementation's, passed by the composition root: a record
36
+ * is kept until `expiresAt`, and an expired one is treated as never written.
37
+ */
38
+ export interface IdempotencyStore {
39
+ /** Claims `dedupKey` atomically: exactly one concurrent caller gets `claimed`. */
40
+ readonly claim: (dedupKey: string, fingerprint: string) => Effect.Effect<IdempotencyClaim, StoreFailure>;
41
+ /** Records the answer, so a completed duplicate replays it. */
42
+ readonly complete: (dedupKey: string, response: StoredResponse) => Effect.Effect<void, StoreFailure>;
43
+ /**
44
+ * Gives the key back after a failure that was not an answer — an outage —
45
+ * so a retry is allowed to try again rather than being told it is in flight.
46
+ */
47
+ readonly release: (dedupKey: string) => Effect.Effect<void, StoreFailure>;
48
+ }
49
+ declare const IdempotencyStoreTag_base: Context.ServiceClass<IdempotencyStoreTag, "@entifix/business/IdempotencyStore", IdempotencyStore>;
50
+ export declare class IdempotencyStoreTag extends IdempotencyStoreTag_base {
51
+ }
52
+ export {};
53
+ //# sourceMappingURL=idempotency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,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IACvC;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;CAC3E;;AAED,qBAAa,mBAAoB,SAAQ,wBAGA;CAAG"}
@@ -0,0 +1,5 @@
1
+ import { Context } from 'effect';
2
+ export class IdempotencyStoreTag extends Context.Service()('@entifix/business/IdempotencyStore') {
3
+ }
4
+
5
+ //# sourceMappingURL=idempotency-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/idempotency/idempotency-store.ts"],"sourcesContent":["import type { StoreFailure } from '@entifix/core';\nimport { Context, type Effect } from 'effect';\n\n/** A response as it is replayed: status, content type and body text. */\nexport interface StoredResponse {\n readonly status: number;\n readonly contentType?: string;\n readonly body: string;\n}\n\n/**\n * One request's claim on its `Idempotency-Key`. The dedup key is the caller,\n * the route and the key together, so two callers — or two routes — choosing\n * the same key never collide; the fingerprint is what tells a retry from a\n * different request reusing a key.\n */\nexport interface IdempotencyRecord {\n readonly dedupKey: string;\n readonly fingerprint: string;\n readonly state: 'inFlight' | 'completed';\n readonly response?: StoredResponse;\n /** ISO-8601. Past it, the record is treated as absent. */\n readonly expiresAt: string;\n}\n\n/** What a claim found: nothing, so this request owns the key, or a live record. */\nexport type IdempotencyClaim =\n | { readonly _tag: 'claimed' }\n | { readonly _tag: 'existing'; readonly record: IdempotencyRecord };\n\n/**\n * Where a route remembers the requests it has answered under an\n * `Idempotency-Key` — what makes a redelivered command, or a client's retry,\n * answer what the first one did instead of acting twice.\n *\n * Retention is the implementation's, passed by the composition root: a record\n * is kept until `expiresAt`, and an expired one is treated as never written.\n */\nexport interface IdempotencyStore {\n /** Claims `dedupKey` atomically: exactly one concurrent caller gets `claimed`. */\n readonly claim: (\n dedupKey: string,\n fingerprint: string,\n ) => Effect.Effect<IdempotencyClaim, StoreFailure>;\n /** Records the answer, so a completed duplicate replays it. */\n readonly complete: (\n dedupKey: string,\n response: StoredResponse,\n ) => Effect.Effect<void, StoreFailure>;\n /**\n * Gives the key back after a failure that was not an answer — an outage —\n * so a retry is allowed to try again rather than being told it is in flight.\n */\n readonly release: (dedupKey: string) => Effect.Effect<void, StoreFailure>;\n}\n\nexport class IdempotencyStoreTag extends Context.Service<\n IdempotencyStoreTag,\n IdempotencyStore\n>()('@entifix/business/IdempotencyStore') {}\n"],"names":["Context","IdempotencyStoreTag","Service"],"mappings":"AACA,SAASA,OAAO,QAAqB,SAAS;AAuD9C,OAAO,MAAMC,4BAA4BD,QAAQE,OAAO,GAGpD;AAAuC"}
@@ -0,0 +1,2 @@
1
+ export * from './idempotency-store.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/idempotency/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './idempotency-store.js';
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/idempotency/index.ts"],"sourcesContent":["export * from './idempotency-store.js';\n"],"names":[],"mappings":"AAAA,cAAc,yBAAyB"}
package/dist/index.d.ts CHANGED
@@ -1,10 +1,14 @@
1
+ export * from './entity-api/index.js';
1
2
  export * from './health/health-registry.js';
3
+ export * from './idempotency/index.js';
2
4
  export * from './repository/config.repository.js';
3
5
  export * from './repository/entity.repository.js';
4
6
  export * from './repository/entity-facet-counter.js';
5
7
  export * from './repository/entity-link-resolver.repository.js';
6
8
  export * from './repository/entity-mixins.repository.js';
7
9
  export * from './repository/entity-repository-factory.js';
10
+ export * from './request/index.js';
11
+ export * from './resolve/index.js';
8
12
  export * from './sessions/one-time-token-store.js';
9
13
  export * from './sessions/session-store.js';
10
14
  export * from './shutdown/shutdown-registry.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AACrD,cAAc,iDAAiD,CAAC;AAChE,cAAc,0CAA0C,CAAC;AACzD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,oCAAoC,CAAC;AACnD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AACrD,cAAc,iDAAiD,CAAC;AAChE,cAAc,0CAA0C,CAAC;AACzD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oCAAoC,CAAC;AACnD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC"}
package/dist/index.js CHANGED
@@ -1,10 +1,14 @@
1
+ export * from './entity-api/index.js';
1
2
  export * from './health/health-registry.js';
3
+ export * from './idempotency/index.js';
2
4
  export * from './repository/config.repository.js';
3
5
  export * from './repository/entity.repository.js';
4
6
  export * from './repository/entity-facet-counter.js';
5
7
  export * from './repository/entity-link-resolver.repository.js';
6
8
  export * from './repository/entity-mixins.repository.js';
7
9
  export * from './repository/entity-repository-factory.js';
10
+ export * from './request/index.js';
11
+ export * from './resolve/index.js';
8
12
  export * from './sessions/one-time-token-store.js';
9
13
  export * from './sessions/session-store.js';
10
14
  export * from './shutdown/shutdown-registry.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './health/health-registry.js';\nexport * from './repository/config.repository.js';\nexport * from './repository/entity.repository.js';\nexport * from './repository/entity-facet-counter.js';\nexport * from './repository/entity-link-resolver.repository.js';\nexport * from './repository/entity-mixins.repository.js';\nexport * from './repository/entity-repository-factory.js';\nexport * from './sessions/one-time-token-store.js';\nexport * from './sessions/session-store.js';\nexport * from './shutdown/shutdown-registry.js';\nexport * from './tenancy/index.js';\nexport * from './tokens/token-failures.js';\nexport * from './tokens/token-service.js';\nexport * from './use-case/delete/index.js';\nexport * from './use-case/facets/index.js';\nexport * from './use-case/get/index.js';\nexport * from './use-case/load/index.js';\nexport * from './use-case/save/index.js';\nexport * from './wiring/wiring-registry.js';\n"],"names":[],"mappings":"AAAA,cAAc,8BAA8B;AAC5C,cAAc,oCAAoC;AAClD,cAAc,oCAAoC;AAClD,cAAc,uCAAuC;AACrD,cAAc,kDAAkD;AAChE,cAAc,2CAA2C;AACzD,cAAc,4CAA4C;AAC1D,cAAc,qCAAqC;AACnD,cAAc,8BAA8B;AAC5C,cAAc,kCAAkC;AAChD,cAAc,qBAAqB;AACnC,cAAc,6BAA6B;AAC3C,cAAc,4BAA4B;AAC1C,cAAc,6BAA6B;AAC3C,cAAc,6BAA6B;AAC3C,cAAc,0BAA0B;AACxC,cAAc,2BAA2B;AACzC,cAAc,2BAA2B;AACzC,cAAc,8BAA8B"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './entity-api/index.js';\nexport * from './health/health-registry.js';\nexport * from './idempotency/index.js';\nexport * from './repository/config.repository.js';\nexport * from './repository/entity.repository.js';\nexport * from './repository/entity-facet-counter.js';\nexport * from './repository/entity-link-resolver.repository.js';\nexport * from './repository/entity-mixins.repository.js';\nexport * from './repository/entity-repository-factory.js';\nexport * from './request/index.js';\nexport * from './resolve/index.js';\nexport * from './sessions/one-time-token-store.js';\nexport * from './sessions/session-store.js';\nexport * from './shutdown/shutdown-registry.js';\nexport * from './tenancy/index.js';\nexport * from './tokens/token-failures.js';\nexport * from './tokens/token-service.js';\nexport * from './use-case/delete/index.js';\nexport * from './use-case/facets/index.js';\nexport * from './use-case/get/index.js';\nexport * from './use-case/load/index.js';\nexport * from './use-case/save/index.js';\nexport * from './wiring/wiring-registry.js';\n"],"names":[],"mappings":"AAAA,cAAc,wBAAwB;AACtC,cAAc,8BAA8B;AAC5C,cAAc,yBAAyB;AACvC,cAAc,oCAAoC;AAClD,cAAc,oCAAoC;AAClD,cAAc,uCAAuC;AACrD,cAAc,kDAAkD;AAChE,cAAc,2CAA2C;AACzD,cAAc,4CAA4C;AAC1D,cAAc,qBAAqB;AACnC,cAAc,qBAAqB;AACnC,cAAc,qCAAqC;AACnD,cAAc,8BAA8B;AAC5C,cAAc,kCAAkC;AAChD,cAAc,qBAAqB;AACnC,cAAc,6BAA6B;AAC3C,cAAc,4BAA4B;AAC1C,cAAc,6BAA6B;AAC3C,cAAc,6BAA6B;AAC3C,cAAc,0BAA0B;AACxC,cAAc,2BAA2B;AACzC,cAAc,2BAA2B;AACzC,cAAc,8BAA8B"}
@@ -0,0 +1,2 @@
1
+ export * from './request-context.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/request/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './request-context.js';
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/request/index.ts"],"sourcesContent":["export * from './request-context.js';\n"],"names":[],"mappings":"AAAA,cAAc,uBAAuB"}
@@ -0,0 +1,86 @@
1
+ import { Context } from 'effect';
2
+ import type { TokenClaims } from '../tokens/token-service.js';
3
+ /**
4
+ * The authenticated subject as a service sees it, rebuilt by the shell from a
5
+ * verified token and nothing else. It lives here rather than in the shell so a
6
+ * handler reads it through {@link RequestPrincipalTag} without importing the
7
+ * transport.
8
+ */
9
+ export interface RequestPrincipal {
10
+ readonly userId: TokenClaims['userId'];
11
+ readonly subject: string;
12
+ readonly sessionId: string;
13
+ readonly roles: readonly string[];
14
+ /**
15
+ * The organization this request acts for — the storage routing key, absent
16
+ * for a caller with no tenant scope (a buyer, or an operator). Kept out of
17
+ * `attributes` deliberately: attributes are policy inputs, this decides which
18
+ * database a handler reads.
19
+ */
20
+ readonly organizationId?: string;
21
+ /**
22
+ * Which population the caller belongs to — buyer, vendor staff, or platform
23
+ * staff. Carried so a handler never has to infer it from an absent
24
+ * `organizationId`, which a buyer and an operator share.
25
+ *
26
+ * Context, not a grant: what the caller may *do* still comes from `roles`
27
+ * through the policy decision port.
28
+ */
29
+ readonly partyRole?: string;
30
+ /**
31
+ * The party behind the account — the `Individual` id, absent for an account
32
+ * with no party record.
33
+ *
34
+ * Same rule as the two fields above: it comes from the verified token and
35
+ * never from anything the caller sets on the request. It says *whose* records
36
+ * these are, which is what a route scoping a read to its caller needs; it
37
+ * says nothing about what may be done with them.
38
+ */
39
+ readonly partyId?: string;
40
+ /**
41
+ * When the verified token stops being valid, as a Unix timestamp in seconds.
42
+ *
43
+ * Every REST route is already bounded by it implicitly — verification is
44
+ * stateless, so the next call after expiry simply fails. A **held-open**
45
+ * response has no next call, so a held-open stream reads it and closes the
46
+ * connection there. Absent when the token carries no
47
+ * `exp`, which a signed one always does; the guard is for the type, not for a
48
+ * case the fleet produces.
49
+ */
50
+ readonly expiresAt?: number;
51
+ /**
52
+ * What the caller's active organization was provisioned for, off the
53
+ * verified token. Context for a resolver, never a
54
+ * grant: a variant requires an entitlement before its predicate is read.
55
+ */
56
+ readonly entitlements?: readonly string[];
57
+ readonly attributes: Readonly<Record<string, unknown>>;
58
+ }
59
+ declare const RequestPrincipalTag_base: Context.ServiceClass<RequestPrincipalTag, "@entifix/business/RequestPrincipal", RequestPrincipal>;
60
+ /**
61
+ * The verified caller of the current request, provided by the shell's
62
+ * `session`, `permission` and `organization` guards
63
+ * ([ADR 0020](../../../../../docs/adr/0020-endpoints-are-descriptors-and-the-shell-builds-an-httpapi.md)).
64
+ * Absent on a `public`, `crossing` or `fleet` endpoint: no session was read.
65
+ */
66
+ export declare class RequestPrincipalTag extends RequestPrincipalTag_base {
67
+ }
68
+ declare const OrganizationIdTag_base: Context.ServiceClass<OrganizationIdTag, "@entifix/business/OrganizationId", string>;
69
+ /**
70
+ * The organization the current request acts for. From the session's active
71
+ * organization on an `organization` endpoint, and from `x-organization-id` on a
72
+ * `crossing` endpoint that lets the caller name it — never from a path, a query
73
+ * or a body.
74
+ */
75
+ export declare class OrganizationIdTag extends OrganizationIdTag_base {
76
+ }
77
+ declare const IdempotencyKeyTag_base: Context.ServiceClass<IdempotencyKeyTag, "@entifix/business/IdempotencyKey", string>;
78
+ /**
79
+ * The request's `Idempotency-Key`, decoded by the shell on an endpoint
80
+ * declared `idempotent: 'unit'`. The handler's unit of work claims it in the
81
+ * same transaction as its write.
82
+ */
83
+ export declare class IdempotencyKeyTag extends IdempotencyKeyTag_base {
84
+ }
85
+ export {};
86
+ //# sourceMappingURL=request-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request-context.d.ts","sourceRoot":"","sources":["../../src/request/request-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IACvC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC;;;;;OAKG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC;;;;;;;OAOG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;;;;;OAQG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;;;;;;OASG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACxD;;AAED;;;;;GAKG;AACH,qBAAa,mBAAoB,SAAQ,wBAGA;CAAG;;AAE5C;;;;;GAKG;AACH,qBAAa,iBAAkB,SAAQ,sBAGA;CAAG;;AAE1C;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,sBAGA;CAAG"}
@@ -0,0 +1,23 @@
1
+ import { Context } from 'effect';
2
+ /**
3
+ * The verified caller of the current request, provided by the shell's
4
+ * `session`, `permission` and `organization` guards
5
+ * ([ADR 0020](../../../../../docs/adr/0020-endpoints-are-descriptors-and-the-shell-builds-an-httpapi.md)).
6
+ * Absent on a `public`, `crossing` or `fleet` endpoint: no session was read.
7
+ */ export class RequestPrincipalTag extends Context.Service()('@entifix/business/RequestPrincipal') {
8
+ }
9
+ /**
10
+ * The organization the current request acts for. From the session's active
11
+ * organization on an `organization` endpoint, and from `x-organization-id` on a
12
+ * `crossing` endpoint that lets the caller name it — never from a path, a query
13
+ * or a body.
14
+ */ export class OrganizationIdTag extends Context.Service()('@entifix/business/OrganizationId') {
15
+ }
16
+ /**
17
+ * The request's `Idempotency-Key`, decoded by the shell on an endpoint
18
+ * declared `idempotent: 'unit'`. The handler's unit of work claims it in the
19
+ * same transaction as its write.
20
+ */ export class IdempotencyKeyTag extends Context.Service()('@entifix/business/IdempotencyKey') {
21
+ }
22
+
23
+ //# sourceMappingURL=request-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/request/request-context.ts"],"sourcesContent":["import { Context } from 'effect';\n\nimport type { TokenClaims } from '../tokens/token-service.js';\n\n/**\n * The authenticated subject as a service sees it, rebuilt by the shell from a\n * verified token and nothing else. It lives here rather than in the shell so a\n * handler reads it through {@link RequestPrincipalTag} without importing the\n * transport.\n */\nexport interface RequestPrincipal {\n readonly userId: TokenClaims['userId'];\n readonly subject: string;\n readonly sessionId: string;\n readonly roles: readonly string[];\n /**\n * The organization this request acts for — the storage routing key, absent\n * for a caller with no tenant scope (a buyer, or an operator). Kept out of\n * `attributes` deliberately: attributes are policy inputs, this decides which\n * database a handler reads.\n */\n readonly organizationId?: string;\n /**\n * Which population the caller belongs to — buyer, vendor staff, or platform\n * staff. Carried so a handler never has to infer it from an absent\n * `organizationId`, which a buyer and an operator share.\n *\n * Context, not a grant: what the caller may *do* still comes from `roles`\n * through the policy decision port.\n */\n readonly partyRole?: string;\n /**\n * The party behind the account — the `Individual` id, absent for an account\n * with no party record.\n *\n * Same rule as the two fields above: it comes from the verified token and\n * never from anything the caller sets on the request. It says *whose* records\n * these are, which is what a route scoping a read to its caller needs; it\n * says nothing about what may be done with them.\n */\n readonly partyId?: string;\n /**\n * When the verified token stops being valid, as a Unix timestamp in seconds.\n *\n * Every REST route is already bounded by it implicitly — verification is\n * stateless, so the next call after expiry simply fails. A **held-open**\n * response has no next call, so a held-open stream reads it and closes the\n * connection there. Absent when the token carries no\n * `exp`, which a signed one always does; the guard is for the type, not for a\n * case the fleet produces.\n */\n readonly expiresAt?: number;\n /**\n * What the caller's active organization was provisioned for, off the\n * verified token. Context for a resolver, never a\n * grant: a variant requires an entitlement before its predicate is read.\n */\n readonly entitlements?: readonly string[];\n readonly attributes: Readonly<Record<string, unknown>>;\n}\n\n/**\n * The verified caller of the current request, provided by the shell's\n * `session`, `permission` and `organization` guards\n * ([ADR 0020](../../../../../docs/adr/0020-endpoints-are-descriptors-and-the-shell-builds-an-httpapi.md)).\n * Absent on a `public`, `crossing` or `fleet` endpoint: no session was read.\n */\nexport class RequestPrincipalTag extends Context.Service<\n RequestPrincipalTag,\n RequestPrincipal\n>()('@entifix/business/RequestPrincipal') {}\n\n/**\n * The organization the current request acts for. From the session's active\n * organization on an `organization` endpoint, and from `x-organization-id` on a\n * `crossing` endpoint that lets the caller name it — never from a path, a query\n * or a body.\n */\nexport class OrganizationIdTag extends Context.Service<\n OrganizationIdTag,\n string\n>()('@entifix/business/OrganizationId') {}\n\n/**\n * The request's `Idempotency-Key`, decoded by the shell on an endpoint\n * declared `idempotent: 'unit'`. The handler's unit of work claims it in the\n * same transaction as its write.\n */\nexport class IdempotencyKeyTag extends Context.Service<\n IdempotencyKeyTag,\n string\n>()('@entifix/business/IdempotencyKey') {}\n"],"names":["Context","RequestPrincipalTag","Service","OrganizationIdTag","IdempotencyKeyTag"],"mappings":"AAAA,SAASA,OAAO,QAAQ,SAAS;AA6DjC;;;;;CAKC,GACD,OAAO,MAAMC,4BAA4BD,QAAQE,OAAO,GAGpD;AAAuC;AAE3C;;;;;CAKC,GACD,OAAO,MAAMC,0BAA0BH,QAAQE,OAAO,GAGlD;AAAqC;AAEzC;;;;CAIC,GACD,OAAO,MAAME,0BAA0BJ,QAAQE,OAAO,GAGlD;AAAqC"}
@@ -0,0 +1,3 @@
1
+ export * from './resolve.js';
2
+ export * from './verified-context.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resolve/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './resolve.js';
2
+ export * from './verified-context.js';
3
+
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/resolve/index.ts"],"sourcesContent":["export * from './resolve.js';\nexport * from './verified-context.js';\n"],"names":[],"mappings":"AAAA,cAAc,eAAe;AAC7B,cAAc,wBAAwB"}
@@ -0,0 +1,70 @@
1
+ import { Context, Effect, Schema } from 'effect';
2
+ import type { FragmentRequirements } from '../flow/fragment.js';
3
+ import { type VerifiedContext, VerifiedContextTag } from './verified-context.js';
4
+ /** One implementation of a use case, and what a caller must hold to be given it. */
5
+ export interface Variant<S> {
6
+ readonly name: string;
7
+ readonly requires?: FragmentRequirements;
8
+ readonly impl: S;
9
+ }
10
+ /** A predicate over the verified context. Never over request input. */
11
+ export type ContextPredicate = (context: VerifiedContext) => boolean;
12
+ /** One ordered rule: when the predicate holds, use the variant. */
13
+ export interface ResolutionRule<S> {
14
+ readonly when: ContextPredicate;
15
+ readonly variant: Variant<S>;
16
+ }
17
+ /** Starts a rule: `When(isVendor).use(counterSale)`. */
18
+ export declare const When: (when: ContextPredicate) => {
19
+ use: <S>(variant: Variant<S>) => ResolutionRule<S>;
20
+ };
21
+ /** The last rule: matches every context that met the variant's requirements. */
22
+ export declare const Otherwise: {
23
+ readonly use: <S>(variant: Variant<S>) => ResolutionRule<S>;
24
+ };
25
+ declare const Unresolvable_base: Schema.Class<Unresolvable, Schema.TaggedStruct<"Unresolvable", {
26
+ readonly useCase: Schema.String;
27
+ }>, import("effect/Cause").YieldableError & import("@entifix/core").FailureFacts<"variantUnavailable", "forbidden">>;
28
+ /**
29
+ * No rule chose an implementation for this caller — forbidden, because the
30
+ * caller is not entitled to any variant of the use case it asked for.
31
+ */
32
+ export declare class Unresolvable extends Unresolvable_base {
33
+ }
34
+ /** Which variant the rules would choose, and by which rule — without running it. */
35
+ export interface DryRun {
36
+ readonly variant: string;
37
+ readonly rule: number;
38
+ }
39
+ /**
40
+ * Walks the rules in order and answers the first whose variant the caller
41
+ * meets the requirements of **and** whose predicate holds. A variant's
42
+ * requirements are checked first: an unentitled variant is skipped, never
43
+ * chosen and then refused.
44
+ */
45
+ export declare const dryRun: <S>(rules: readonly ResolutionRule<S>[], context: VerifiedContext) => DryRun | undefined;
46
+ /**
47
+ * Resolves a use case's variant for a verified context, annotating the current
48
+ * span with `entifix.use_case` and `entifix.variant`.
49
+ */
50
+ export declare const resolve: <S>(useCase: string, rules: readonly ResolutionRule<S>[]) => (context: VerifiedContext) => Effect.Effect<Variant<S>, Unresolvable>;
51
+ /**
52
+ * A use case's variants and the rules that choose between them — a value,
53
+ * not a `Layer`, so the layer graph is built once at boot and the choice is
54
+ * made per request.
55
+ */
56
+ export interface DefinedVariants<I, S> {
57
+ readonly tag: Context.Key<I, S>;
58
+ readonly useCase: string;
59
+ readonly variants: readonly Variant<S>[];
60
+ readonly rules: readonly ResolutionRule<S>[];
61
+ }
62
+ export declare const defineVariants: <I, S>(tag: Context.Key<I, S>, rules: readonly ResolutionRule<S>[], useCase?: string) => DefinedVariants<I, S>;
63
+ /**
64
+ * Provides the variant the current request resolves to, through
65
+ * `Effect.provideService`: two requests with different contexts run different
66
+ * implementations over one layer graph.
67
+ */
68
+ export declare const provideResolved: <I, S>(defined: DefinedVariants<I, S>) => <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E | Unresolvable, Exclude<R, I> | VerifiedContextTag>;
69
+ export {};
70
+ //# sourceMappingURL=resolve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/resolve/resolve.ts"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