@fabricorg/platform 0.12.1 → 1.0.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 (110) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +7 -8
  3. package/dist/actions/index.cjs +7 -27
  4. package/dist/actions/index.d.cts +9 -7
  5. package/dist/actions/index.d.ts +9 -7
  6. package/dist/actions/index.js +1 -1
  7. package/dist/{chunk-LAZL2GDT.cjs → chunk-35LADVKK.cjs} +48 -104
  8. package/dist/chunk-35LADVKK.cjs.map +1 -0
  9. package/dist/chunk-4QOA3VU5.js +47 -0
  10. package/dist/chunk-4QOA3VU5.js.map +1 -0
  11. package/dist/chunk-53VEUYCS.cjs +40 -0
  12. package/dist/chunk-53VEUYCS.cjs.map +1 -0
  13. package/dist/{chunk-X7WC4AYC.js → chunk-ATWWZTRC.js} +32 -74
  14. package/dist/chunk-ATWWZTRC.js.map +1 -0
  15. package/dist/chunk-BFQNKQJE.cjs +53 -0
  16. package/dist/{chunk-4RMKUYRX.js.map → chunk-BFQNKQJE.cjs.map} +1 -1
  17. package/dist/{chunk-OC4ZFJKD.cjs → chunk-CBY6GRJP.cjs} +16 -17
  18. package/dist/chunk-CBY6GRJP.cjs.map +1 -0
  19. package/dist/chunk-CQSA3BII.js +38 -0
  20. package/dist/chunk-CQSA3BII.js.map +1 -0
  21. package/dist/{chunk-HL77HWWP.js → chunk-CRAGTJ3B.js} +3 -3
  22. package/dist/{chunk-HL77HWWP.js.map → chunk-CRAGTJ3B.js.map} +1 -1
  23. package/dist/{chunk-FSUYD4F4.js → chunk-J5LS5BSI.js} +19 -17
  24. package/dist/chunk-J5LS5BSI.js.map +1 -0
  25. package/dist/{chunk-ZZGSS65W.cjs → chunk-JFMNLJLY.cjs} +6 -6
  26. package/dist/{chunk-ZZGSS65W.cjs.map → chunk-JFMNLJLY.cjs.map} +1 -1
  27. package/dist/{chunk-6ER62UUN.js → chunk-JFVEPAED.js} +31 -40
  28. package/dist/chunk-JFVEPAED.js.map +1 -0
  29. package/dist/{chunk-7SHNYYGI.cjs → chunk-M5FGWXT3.cjs} +19 -20
  30. package/dist/chunk-M5FGWXT3.cjs.map +1 -0
  31. package/dist/{chunk-4MMMXV4Q.js → chunk-NETLRKDS.js} +16 -15
  32. package/dist/chunk-NETLRKDS.js.map +1 -0
  33. package/dist/chunk-OWSSGFNY.js +45 -0
  34. package/dist/chunk-OWSSGFNY.js.map +1 -0
  35. package/dist/{chunk-35SDMFCR.js → chunk-T5ESIJ4K.js} +42 -99
  36. package/dist/chunk-T5ESIJ4K.js.map +1 -0
  37. package/dist/{chunk-NJL3US7H.cjs → chunk-VZ6C4LXC.cjs} +31 -43
  38. package/dist/chunk-VZ6C4LXC.cjs.map +1 -0
  39. package/dist/chunk-WAI4UNWQ.cjs +48 -0
  40. package/dist/chunk-WAI4UNWQ.cjs.map +1 -0
  41. package/dist/{chunk-YQEXO3IQ.cjs → chunk-X3GHYMAJ.cjs} +32 -74
  42. package/dist/chunk-X3GHYMAJ.cjs.map +1 -0
  43. package/dist/events/index.cjs +3 -27
  44. package/dist/events/index.d.cts +13 -13
  45. package/dist/events/index.d.ts +13 -13
  46. package/dist/events/index.js +1 -1
  47. package/dist/index.cjs +88 -193
  48. package/dist/index.d.cts +8 -9
  49. package/dist/index.d.ts +8 -9
  50. package/dist/index.js +10 -11
  51. package/dist/manifest/index.cjs +11 -15
  52. package/dist/manifest/index.d.cts +0 -1
  53. package/dist/manifest/index.d.ts +0 -1
  54. package/dist/manifest/index.js +5 -9
  55. package/dist/modules/index.cjs +15 -15
  56. package/dist/modules/index.d.cts +16 -23
  57. package/dist/modules/index.d.ts +16 -23
  58. package/dist/modules/index.js +4 -8
  59. package/dist/objects/index.cjs +5 -13
  60. package/dist/objects/index.d.cts +7 -4
  61. package/dist/objects/index.d.ts +7 -4
  62. package/dist/objects/index.js +1 -1
  63. package/dist/policies/index.cjs +12 -24
  64. package/dist/policies/index.d.cts +10 -5
  65. package/dist/policies/index.d.ts +10 -5
  66. package/dist/policies/index.js +1 -1
  67. package/dist/privacy/index.cjs +10 -10
  68. package/dist/privacy/index.d.cts +16 -5
  69. package/dist/privacy/index.d.ts +16 -5
  70. package/dist/privacy/index.js +1 -1
  71. package/dist/projections/index.cjs +6 -18
  72. package/dist/projections/index.d.cts +8 -5
  73. package/dist/projections/index.d.ts +8 -5
  74. package/dist/projections/index.js +1 -1
  75. package/dist/state-machines/index.cjs +5 -21
  76. package/dist/state-machines/index.d.cts +17 -31
  77. package/dist/state-machines/index.d.ts +17 -31
  78. package/dist/state-machines/index.js +1 -1
  79. package/package.json +1 -11
  80. package/dist/chunk-35SDMFCR.js.map +0 -1
  81. package/dist/chunk-3O4GMCCE.js +0 -55
  82. package/dist/chunk-3O4GMCCE.js.map +0 -1
  83. package/dist/chunk-4MMMXV4Q.js.map +0 -1
  84. package/dist/chunk-4RMKUYRX.js +0 -59
  85. package/dist/chunk-6ER62UUN.js.map +0 -1
  86. package/dist/chunk-7RV5REPT.cjs +0 -63
  87. package/dist/chunk-7RV5REPT.cjs.map +0 -1
  88. package/dist/chunk-7SHNYYGI.cjs.map +0 -1
  89. package/dist/chunk-EO4VSB2O.cjs +0 -99
  90. package/dist/chunk-EO4VSB2O.cjs.map +0 -1
  91. package/dist/chunk-FSUYD4F4.js.map +0 -1
  92. package/dist/chunk-JOATYJXQ.cjs +0 -70
  93. package/dist/chunk-JOATYJXQ.cjs.map +0 -1
  94. package/dist/chunk-LAZL2GDT.cjs.map +0 -1
  95. package/dist/chunk-NJL3US7H.cjs.map +0 -1
  96. package/dist/chunk-O5WVBQ7P.js +0 -89
  97. package/dist/chunk-O5WVBQ7P.js.map +0 -1
  98. package/dist/chunk-OC4ZFJKD.cjs.map +0 -1
  99. package/dist/chunk-T2JLSZN6.js +0 -67
  100. package/dist/chunk-T2JLSZN6.js.map +0 -1
  101. package/dist/chunk-UV252FLT.cjs +0 -74
  102. package/dist/chunk-UV252FLT.cjs.map +0 -1
  103. package/dist/chunk-X7WC4AYC.js.map +0 -1
  104. package/dist/chunk-YQEXO3IQ.cjs.map +0 -1
  105. package/dist/displays/index.cjs +0 -24
  106. package/dist/displays/index.cjs.map +0 -1
  107. package/dist/displays/index.d.cts +0 -34
  108. package/dist/displays/index.d.ts +0 -34
  109. package/dist/displays/index.js +0 -3
  110. package/dist/displays/index.js.map +0 -1
@@ -25,6 +25,8 @@ interface PolicyContext<TDb = unknown> {
25
25
  * globals. The shape is opaque to the platform — adapters narrow it.
26
26
  */
27
27
  services?: FabricRuntimeServices;
28
+ /** Explicit code-policy catalog for this runtime; absence fails closed. */
29
+ resolveCodePolicy?: (policyId: PolicyId) => PolicyEvaluator | undefined;
28
30
  }
29
31
  interface PolicyFact {
30
32
  name: string;
@@ -201,14 +203,17 @@ interface PolicyDispatchEvidence {
201
203
  metadata?: Record<string, unknown>;
202
204
  };
203
205
  }
204
- declare function registerPolicy(evaluator: PolicyEvaluator): void;
205
- declare function registerPolicyIfMissing(evaluator: PolicyEvaluator): void;
206
- declare function resolvePolicy(policyId: PolicyId): PolicyEvaluator | undefined;
207
- declare function getRegisteredPolicyIds(): PolicyId[];
206
+ interface PolicyRegistry {
207
+ register(evaluator: PolicyEvaluator): void;
208
+ registerIfMissing(evaluator: PolicyEvaluator): void;
209
+ resolve(policyId: PolicyId): PolicyEvaluator | undefined;
210
+ ids(): PolicyId[];
211
+ }
212
+ declare function createPolicyRegistry(evaluators?: readonly PolicyEvaluator[]): PolicyRegistry;
208
213
  declare function evaluateRegisteredPolicies(policyIds: PolicyId[], ctx: PolicyContext): Promise<PolicyOutcome[]>;
209
214
  declare function evaluatePolicyDefinitions(policies: RuntimePolicyDefinition[], ctx: PolicyContext): Promise<PolicyOutcome[]>;
210
215
  declare function evaluatePolicyDefinition(policy: RuntimePolicyDefinition, ctx: PolicyContext): Promise<PolicyOutcome>;
211
216
  declare function validateDataPolicyDefinition(definition: DataPolicyDefinition): DataPolicyValidationResult;
212
217
  declare function aggregatePolicyOutcomes(outcomes: PolicyOutcome[]): PolicyOutcome | undefined;
213
218
 
214
- export { type DataPolicyComparisonOperator, type DataPolicyCondition, type DataPolicyConditionResult, type DataPolicyDefinition, type DataPolicyLiteral, type DataPolicySource, type DataPolicySourceReference, type DataPolicyValidationResult, type PolicyContext, type PolicyCorrectiveAction, type PolicyCorrectiveActionBase, type PolicyCorrectiveActionKind, type PolicyDispatchEvidence, type PolicyEvaluationMode, type PolicyEvaluationResult, type PolicyEvaluator, type PolicyFact, type PolicyFallbackDefinition, type PolicyFallbackTrigger, type PolicyGuidance, type PolicyGuidanceValidationResult, type PolicyId, type PolicyInvokeActionCorrectiveAction, type PolicyKind, type PolicyManualCorrectiveAction, type PolicyNavigateCorrectiveAction, type PolicyOutcome, type RuntimePolicyDefinition, aggregatePolicyOutcomes, assertPolicyId, evaluatePolicyDefinition, evaluatePolicyDefinitions, evaluateRegisteredPolicies, getRegisteredPolicyIds, registerPolicy, registerPolicyIfMissing, resolvePolicy, validateDataPolicyDefinition, validatePolicyGuidance };
219
+ export { type DataPolicyComparisonOperator, type DataPolicyCondition, type DataPolicyConditionResult, type DataPolicyDefinition, type DataPolicyLiteral, type DataPolicySource, type DataPolicySourceReference, type DataPolicyValidationResult, type PolicyContext, type PolicyCorrectiveAction, type PolicyCorrectiveActionBase, type PolicyCorrectiveActionKind, type PolicyDispatchEvidence, type PolicyEvaluationMode, type PolicyEvaluationResult, type PolicyEvaluator, type PolicyFact, type PolicyFallbackDefinition, type PolicyFallbackTrigger, type PolicyGuidance, type PolicyGuidanceValidationResult, type PolicyId, type PolicyInvokeActionCorrectiveAction, type PolicyKind, type PolicyManualCorrectiveAction, type PolicyNavigateCorrectiveAction, type PolicyOutcome, type PolicyRegistry, type RuntimePolicyDefinition, aggregatePolicyOutcomes, assertPolicyId, createPolicyRegistry, evaluatePolicyDefinition, evaluatePolicyDefinitions, evaluateRegisteredPolicies, validateDataPolicyDefinition, validatePolicyGuidance };
@@ -25,6 +25,8 @@ interface PolicyContext<TDb = unknown> {
25
25
  * globals. The shape is opaque to the platform — adapters narrow it.
26
26
  */
27
27
  services?: FabricRuntimeServices;
28
+ /** Explicit code-policy catalog for this runtime; absence fails closed. */
29
+ resolveCodePolicy?: (policyId: PolicyId) => PolicyEvaluator | undefined;
28
30
  }
29
31
  interface PolicyFact {
30
32
  name: string;
@@ -201,14 +203,17 @@ interface PolicyDispatchEvidence {
201
203
  metadata?: Record<string, unknown>;
202
204
  };
203
205
  }
204
- declare function registerPolicy(evaluator: PolicyEvaluator): void;
205
- declare function registerPolicyIfMissing(evaluator: PolicyEvaluator): void;
206
- declare function resolvePolicy(policyId: PolicyId): PolicyEvaluator | undefined;
207
- declare function getRegisteredPolicyIds(): PolicyId[];
206
+ interface PolicyRegistry {
207
+ register(evaluator: PolicyEvaluator): void;
208
+ registerIfMissing(evaluator: PolicyEvaluator): void;
209
+ resolve(policyId: PolicyId): PolicyEvaluator | undefined;
210
+ ids(): PolicyId[];
211
+ }
212
+ declare function createPolicyRegistry(evaluators?: readonly PolicyEvaluator[]): PolicyRegistry;
208
213
  declare function evaluateRegisteredPolicies(policyIds: PolicyId[], ctx: PolicyContext): Promise<PolicyOutcome[]>;
209
214
  declare function evaluatePolicyDefinitions(policies: RuntimePolicyDefinition[], ctx: PolicyContext): Promise<PolicyOutcome[]>;
210
215
  declare function evaluatePolicyDefinition(policy: RuntimePolicyDefinition, ctx: PolicyContext): Promise<PolicyOutcome>;
211
216
  declare function validateDataPolicyDefinition(definition: DataPolicyDefinition): DataPolicyValidationResult;
212
217
  declare function aggregatePolicyOutcomes(outcomes: PolicyOutcome[]): PolicyOutcome | undefined;
213
218
 
214
- export { type DataPolicyComparisonOperator, type DataPolicyCondition, type DataPolicyConditionResult, type DataPolicyDefinition, type DataPolicyLiteral, type DataPolicySource, type DataPolicySourceReference, type DataPolicyValidationResult, type PolicyContext, type PolicyCorrectiveAction, type PolicyCorrectiveActionBase, type PolicyCorrectiveActionKind, type PolicyDispatchEvidence, type PolicyEvaluationMode, type PolicyEvaluationResult, type PolicyEvaluator, type PolicyFact, type PolicyFallbackDefinition, type PolicyFallbackTrigger, type PolicyGuidance, type PolicyGuidanceValidationResult, type PolicyId, type PolicyInvokeActionCorrectiveAction, type PolicyKind, type PolicyManualCorrectiveAction, type PolicyNavigateCorrectiveAction, type PolicyOutcome, type RuntimePolicyDefinition, aggregatePolicyOutcomes, assertPolicyId, evaluatePolicyDefinition, evaluatePolicyDefinitions, evaluateRegisteredPolicies, getRegisteredPolicyIds, registerPolicy, registerPolicyIfMissing, resolvePolicy, validateDataPolicyDefinition, validatePolicyGuidance };
219
+ export { type DataPolicyComparisonOperator, type DataPolicyCondition, type DataPolicyConditionResult, type DataPolicyDefinition, type DataPolicyLiteral, type DataPolicySource, type DataPolicySourceReference, type DataPolicyValidationResult, type PolicyContext, type PolicyCorrectiveAction, type PolicyCorrectiveActionBase, type PolicyCorrectiveActionKind, type PolicyDispatchEvidence, type PolicyEvaluationMode, type PolicyEvaluationResult, type PolicyEvaluator, type PolicyFact, type PolicyFallbackDefinition, type PolicyFallbackTrigger, type PolicyGuidance, type PolicyGuidanceValidationResult, type PolicyId, type PolicyInvokeActionCorrectiveAction, type PolicyKind, type PolicyManualCorrectiveAction, type PolicyNavigateCorrectiveAction, type PolicyOutcome, type PolicyRegistry, type RuntimePolicyDefinition, aggregatePolicyOutcomes, assertPolicyId, createPolicyRegistry, evaluatePolicyDefinition, evaluatePolicyDefinitions, evaluateRegisteredPolicies, validateDataPolicyDefinition, validatePolicyGuidance };
@@ -1,3 +1,3 @@
1
- export { aggregatePolicyOutcomes, assertPolicyId, evaluatePolicyDefinition, evaluatePolicyDefinitions, evaluateRegisteredPolicies, getRegisteredPolicyIds, registerPolicy, registerPolicyIfMissing, resolvePolicy, validateDataPolicyDefinition, validatePolicyGuidance } from '../chunk-6ER62UUN.js';
1
+ export { aggregatePolicyOutcomes, assertPolicyId, createPolicyRegistry, evaluatePolicyDefinition, evaluatePolicyDefinitions, evaluateRegisteredPolicies, validateDataPolicyDefinition, validatePolicyGuidance } from '../chunk-JFVEPAED.js';
2
2
  //# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map
@@ -1,44 +1,44 @@
1
1
  'use strict';
2
2
 
3
- var chunkYQEXO3IQ_cjs = require('../chunk-YQEXO3IQ.cjs');
3
+ var chunkX3GHYMAJ_cjs = require('../chunk-X3GHYMAJ.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "ANONYMIZATION_POLICY_VERSION", {
8
8
  enumerable: true,
9
- get: function () { return chunkYQEXO3IQ_cjs.ANONYMIZATION_POLICY_VERSION; }
9
+ get: function () { return chunkX3GHYMAJ_cjs.ANONYMIZATION_POLICY_VERSION; }
10
10
  });
11
11
  Object.defineProperty(exports, "AnonymizationEngine", {
12
12
  enumerable: true,
13
- get: function () { return chunkYQEXO3IQ_cjs.AnonymizationEngine; }
13
+ get: function () { return chunkX3GHYMAJ_cjs.AnonymizationEngine; }
14
14
  });
15
15
  Object.defineProperty(exports, "FieldRedactor", {
16
16
  enumerable: true,
17
- get: function () { return chunkYQEXO3IQ_cjs.FieldRedactor; }
17
+ get: function () { return chunkX3GHYMAJ_cjs.FieldRedactor; }
18
18
  });
19
19
  Object.defineProperty(exports, "PLATFORM_PRIVACY_POLICY_VERSION", {
20
20
  enumerable: true,
21
- get: function () { return chunkYQEXO3IQ_cjs.PLATFORM_PRIVACY_POLICY_VERSION; }
21
+ get: function () { return chunkX3GHYMAJ_cjs.PLATFORM_PRIVACY_POLICY_VERSION; }
22
22
  });
23
23
  Object.defineProperty(exports, "anonymizeAssetEventPayload", {
24
24
  enumerable: true,
25
- get: function () { return chunkYQEXO3IQ_cjs.anonymizeAssetEventPayload; }
25
+ get: function () { return chunkX3GHYMAJ_cjs.anonymizeAssetEventPayload; }
26
26
  });
27
27
  Object.defineProperty(exports, "anonymizeEvidencePacket", {
28
28
  enumerable: true,
29
- get: function () { return chunkYQEXO3IQ_cjs.anonymizeEvidencePacket; }
29
+ get: function () { return chunkX3GHYMAJ_cjs.anonymizeEvidencePacket; }
30
30
  });
31
31
  Object.defineProperty(exports, "anonymizeJsonValue", {
32
32
  enumerable: true,
33
- get: function () { return chunkYQEXO3IQ_cjs.anonymizeJsonValue; }
33
+ get: function () { return chunkX3GHYMAJ_cjs.anonymizeJsonValue; }
34
34
  });
35
35
  Object.defineProperty(exports, "buildAnonymizationLifecycleEvidence", {
36
36
  enumerable: true,
37
- get: function () { return chunkYQEXO3IQ_cjs.buildAnonymizationLifecycleEvidence; }
37
+ get: function () { return chunkX3GHYMAJ_cjs.buildAnonymizationLifecycleEvidence; }
38
38
  });
39
39
  Object.defineProperty(exports, "stableChecksum", {
40
40
  enumerable: true,
41
- get: function () { return chunkYQEXO3IQ_cjs.stableChecksum; }
41
+ get: function () { return chunkX3GHYMAJ_cjs.stableChecksum; }
42
42
  });
43
43
  //# sourceMappingURL=index.cjs.map
44
44
  //# sourceMappingURL=index.cjs.map
@@ -1,5 +1,14 @@
1
1
  declare const ANONYMIZATION_POLICY_VERSION = "adr-026-platform-anonymization-v1";
2
2
  type JsonObject = Record<string, unknown>;
3
+ interface AnonymizationFieldPolicy {
4
+ method: RedactionMethod;
5
+ match: "key" | "path";
6
+ value: string;
7
+ }
8
+ interface AnonymizationPolicy {
9
+ fields: readonly AnonymizationFieldPolicy[];
10
+ preservedSemantics?: readonly string[];
11
+ }
3
12
  interface AssetEventLike {
4
13
  id: string;
5
14
  tenantId: string;
@@ -53,6 +62,8 @@ declare class FieldRedactor {
53
62
  generalize(value: unknown): unknown;
54
63
  }
55
64
  declare class AnonymizationEngine {
65
+ #private;
66
+ constructor(policy: AnonymizationPolicy);
56
67
  anonymizeJsonValue<TValue>(value: TValue, context: AnonymizationContext, dataClass: PlatformDataClass): AnonymizationResult<TValue>;
57
68
  anonymizeJsonValueAtPath<TValue>(value: TValue, context: AnonymizationContext, dataClass: PlatformDataClass, basePath: string): AnonymizationResult<TValue>;
58
69
  anonymizeAssetEventPayload(event: AssetEventLike, context: AnonymizationContext): AnonymizationResult<unknown>;
@@ -80,9 +91,9 @@ declare class AnonymizationEngine {
80
91
  declare const PLATFORM_PRIVACY_POLICY_VERSION = "fabric-platform-privacy-v1";
81
92
  type RedactionMethod = "nullify" | "mask" | "hash" | "tokenize" | "generalize" | "drop";
82
93
 
83
- declare function anonymizeJsonValue<TValue>(value: TValue, context: AnonymizationContext, dataClass: PlatformDataClass): AnonymizationResult<TValue>;
84
- declare function anonymizeAssetEventPayload(event: AssetEventLike, context: AnonymizationContext): AnonymizationResult<unknown>;
85
- declare function anonymizeEvidencePacket(packet: EvidencePacketLike, context: AnonymizationContext): AnonymizationResult<Pick<EvidencePacketLike, "packet" | "redactionMetadata" | "checksum">>;
94
+ declare function anonymizeJsonValue<TValue>(value: TValue, context: AnonymizationContext, dataClass: PlatformDataClass, policy: AnonymizationPolicy): AnonymizationResult<TValue>;
95
+ declare function anonymizeAssetEventPayload(event: AssetEventLike, context: AnonymizationContext, policy: AnonymizationPolicy): AnonymizationResult<unknown>;
96
+ declare function anonymizeEvidencePacket(packet: EvidencePacketLike, context: AnonymizationContext, policy: AnonymizationPolicy): AnonymizationResult<Pick<EvidencePacketLike, "packet" | "redactionMetadata" | "checksum">>;
86
97
  declare function buildAnonymizationLifecycleEvidence(input: {
87
98
  context: AnonymizationContext;
88
99
  assetEvents?: Array<{
@@ -100,7 +111,7 @@ declare function buildAnonymizationLifecycleEvidence(input: {
100
111
  packet: EvidencePacketLike;
101
112
  metadata: AnonymizationMetadata;
102
113
  }>;
103
- }): AnonymizationLifecycleEvidence;
114
+ }, policy: AnonymizationPolicy): AnonymizationLifecycleEvidence;
104
115
  type PlatformDataClass = "asset_event" | "read_model" | "raw_payload" | "evidence_packet" | "action_evidence" | "access_event";
105
116
  interface RedactionRule {
106
117
  fieldPath: string;
@@ -175,4 +186,4 @@ interface RetentionRule {
175
186
  legalHoldExempt?: boolean;
176
187
  }
177
188
 
178
- export { ANONYMIZATION_POLICY_VERSION, type AnalyticsDataContract, type AnalyticsDataContractSource, type AnalyticsEligibilityDecision, type AnonymizationContext, AnonymizationEngine, type AnonymizationFieldMetadata, type AnonymizationLifecycleEvidence, type AnonymizationMetadata, type AnonymizationResult, type AssetEventLike, type DataClassificationRule, type EvidencePacketLike, FieldRedactor, PLATFORM_PRIVACY_POLICY_VERSION, type PlatformDataClass, type RedactionMethod, type RedactionRule, type RetentionRule, anonymizeAssetEventPayload, anonymizeEvidencePacket, anonymizeJsonValue, buildAnonymizationLifecycleEvidence, stableChecksum };
189
+ export { ANONYMIZATION_POLICY_VERSION, type AnalyticsDataContract, type AnalyticsDataContractSource, type AnalyticsEligibilityDecision, type AnonymizationContext, AnonymizationEngine, type AnonymizationFieldMetadata, type AnonymizationFieldPolicy, type AnonymizationLifecycleEvidence, type AnonymizationMetadata, type AnonymizationPolicy, type AnonymizationResult, type AssetEventLike, type DataClassificationRule, type EvidencePacketLike, FieldRedactor, PLATFORM_PRIVACY_POLICY_VERSION, type PlatformDataClass, type RedactionMethod, type RedactionRule, type RetentionRule, anonymizeAssetEventPayload, anonymizeEvidencePacket, anonymizeJsonValue, buildAnonymizationLifecycleEvidence, stableChecksum };
@@ -1,5 +1,14 @@
1
1
  declare const ANONYMIZATION_POLICY_VERSION = "adr-026-platform-anonymization-v1";
2
2
  type JsonObject = Record<string, unknown>;
3
+ interface AnonymizationFieldPolicy {
4
+ method: RedactionMethod;
5
+ match: "key" | "path";
6
+ value: string;
7
+ }
8
+ interface AnonymizationPolicy {
9
+ fields: readonly AnonymizationFieldPolicy[];
10
+ preservedSemantics?: readonly string[];
11
+ }
3
12
  interface AssetEventLike {
4
13
  id: string;
5
14
  tenantId: string;
@@ -53,6 +62,8 @@ declare class FieldRedactor {
53
62
  generalize(value: unknown): unknown;
54
63
  }
55
64
  declare class AnonymizationEngine {
65
+ #private;
66
+ constructor(policy: AnonymizationPolicy);
56
67
  anonymizeJsonValue<TValue>(value: TValue, context: AnonymizationContext, dataClass: PlatformDataClass): AnonymizationResult<TValue>;
57
68
  anonymizeJsonValueAtPath<TValue>(value: TValue, context: AnonymizationContext, dataClass: PlatformDataClass, basePath: string): AnonymizationResult<TValue>;
58
69
  anonymizeAssetEventPayload(event: AssetEventLike, context: AnonymizationContext): AnonymizationResult<unknown>;
@@ -80,9 +91,9 @@ declare class AnonymizationEngine {
80
91
  declare const PLATFORM_PRIVACY_POLICY_VERSION = "fabric-platform-privacy-v1";
81
92
  type RedactionMethod = "nullify" | "mask" | "hash" | "tokenize" | "generalize" | "drop";
82
93
 
83
- declare function anonymizeJsonValue<TValue>(value: TValue, context: AnonymizationContext, dataClass: PlatformDataClass): AnonymizationResult<TValue>;
84
- declare function anonymizeAssetEventPayload(event: AssetEventLike, context: AnonymizationContext): AnonymizationResult<unknown>;
85
- declare function anonymizeEvidencePacket(packet: EvidencePacketLike, context: AnonymizationContext): AnonymizationResult<Pick<EvidencePacketLike, "packet" | "redactionMetadata" | "checksum">>;
94
+ declare function anonymizeJsonValue<TValue>(value: TValue, context: AnonymizationContext, dataClass: PlatformDataClass, policy: AnonymizationPolicy): AnonymizationResult<TValue>;
95
+ declare function anonymizeAssetEventPayload(event: AssetEventLike, context: AnonymizationContext, policy: AnonymizationPolicy): AnonymizationResult<unknown>;
96
+ declare function anonymizeEvidencePacket(packet: EvidencePacketLike, context: AnonymizationContext, policy: AnonymizationPolicy): AnonymizationResult<Pick<EvidencePacketLike, "packet" | "redactionMetadata" | "checksum">>;
86
97
  declare function buildAnonymizationLifecycleEvidence(input: {
87
98
  context: AnonymizationContext;
88
99
  assetEvents?: Array<{
@@ -100,7 +111,7 @@ declare function buildAnonymizationLifecycleEvidence(input: {
100
111
  packet: EvidencePacketLike;
101
112
  metadata: AnonymizationMetadata;
102
113
  }>;
103
- }): AnonymizationLifecycleEvidence;
114
+ }, policy: AnonymizationPolicy): AnonymizationLifecycleEvidence;
104
115
  type PlatformDataClass = "asset_event" | "read_model" | "raw_payload" | "evidence_packet" | "action_evidence" | "access_event";
105
116
  interface RedactionRule {
106
117
  fieldPath: string;
@@ -175,4 +186,4 @@ interface RetentionRule {
175
186
  legalHoldExempt?: boolean;
176
187
  }
177
188
 
178
- export { ANONYMIZATION_POLICY_VERSION, type AnalyticsDataContract, type AnalyticsDataContractSource, type AnalyticsEligibilityDecision, type AnonymizationContext, AnonymizationEngine, type AnonymizationFieldMetadata, type AnonymizationLifecycleEvidence, type AnonymizationMetadata, type AnonymizationResult, type AssetEventLike, type DataClassificationRule, type EvidencePacketLike, FieldRedactor, PLATFORM_PRIVACY_POLICY_VERSION, type PlatformDataClass, type RedactionMethod, type RedactionRule, type RetentionRule, anonymizeAssetEventPayload, anonymizeEvidencePacket, anonymizeJsonValue, buildAnonymizationLifecycleEvidence, stableChecksum };
189
+ export { ANONYMIZATION_POLICY_VERSION, type AnalyticsDataContract, type AnalyticsDataContractSource, type AnalyticsEligibilityDecision, type AnonymizationContext, AnonymizationEngine, type AnonymizationFieldMetadata, type AnonymizationFieldPolicy, type AnonymizationLifecycleEvidence, type AnonymizationMetadata, type AnonymizationPolicy, type AnonymizationResult, type AssetEventLike, type DataClassificationRule, type EvidencePacketLike, FieldRedactor, PLATFORM_PRIVACY_POLICY_VERSION, type PlatformDataClass, type RedactionMethod, type RedactionRule, type RetentionRule, anonymizeAssetEventPayload, anonymizeEvidencePacket, anonymizeJsonValue, buildAnonymizationLifecycleEvidence, stableChecksum };
@@ -1,3 +1,3 @@
1
- export { ANONYMIZATION_POLICY_VERSION, AnonymizationEngine, FieldRedactor, PLATFORM_PRIVACY_POLICY_VERSION, anonymizeAssetEventPayload, anonymizeEvidencePacket, anonymizeJsonValue, buildAnonymizationLifecycleEvidence, stableChecksum } from '../chunk-X7WC4AYC.js';
1
+ export { ANONYMIZATION_POLICY_VERSION, AnonymizationEngine, FieldRedactor, PLATFORM_PRIVACY_POLICY_VERSION, anonymizeAssetEventPayload, anonymizeEvidencePacket, anonymizeJsonValue, buildAnonymizationLifecycleEvidence, stableChecksum } from '../chunk-ATWWZTRC.js';
2
2
  //# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map
@@ -1,36 +1,24 @@
1
1
  'use strict';
2
2
 
3
- var chunk7SHNYYGI_cjs = require('../chunk-7SHNYYGI.cjs');
3
+ var chunkM5FGWXT3_cjs = require('../chunk-M5FGWXT3.cjs');
4
4
 
5
5
 
6
6
 
7
- Object.defineProperty(exports, "getRegisteredViewContractKeys", {
7
+ Object.defineProperty(exports, "createViewRegistry", {
8
8
  enumerable: true,
9
- get: function () { return chunk7SHNYYGI_cjs.getRegisteredViewContractKeys; }
10
- });
11
- Object.defineProperty(exports, "registerViewContract", {
12
- enumerable: true,
13
- get: function () { return chunk7SHNYYGI_cjs.registerViewContract; }
14
- });
15
- Object.defineProperty(exports, "registerViewContractIfMissing", {
16
- enumerable: true,
17
- get: function () { return chunk7SHNYYGI_cjs.registerViewContractIfMissing; }
9
+ get: function () { return chunkM5FGWXT3_cjs.createViewRegistry; }
18
10
  });
19
11
  Object.defineProperty(exports, "replayEvents", {
20
12
  enumerable: true,
21
- get: function () { return chunk7SHNYYGI_cjs.replayEvents; }
13
+ get: function () { return chunkM5FGWXT3_cjs.replayEvents; }
22
14
  });
23
15
  Object.defineProperty(exports, "replayView", {
24
16
  enumerable: true,
25
- get: function () { return chunk7SHNYYGI_cjs.replayView; }
26
- });
27
- Object.defineProperty(exports, "resolveViewContract", {
28
- enumerable: true,
29
- get: function () { return chunk7SHNYYGI_cjs.resolveViewContract; }
17
+ get: function () { return chunkM5FGWXT3_cjs.replayView; }
30
18
  });
31
19
  Object.defineProperty(exports, "viewContractKey", {
32
20
  enumerable: true,
33
- get: function () { return chunk7SHNYYGI_cjs.viewContractKey; }
21
+ get: function () { return chunkM5FGWXT3_cjs.viewContractKey; }
34
22
  });
35
23
  //# sourceMappingURL=index.cjs.map
36
24
  //# sourceMappingURL=index.cjs.map
@@ -49,10 +49,13 @@ interface ViewUsageMetadata {
49
49
  classification?: "public" | "internal" | "confidential" | "restricted";
50
50
  }
51
51
  declare function viewContractKey(view: Pick<ViewContract, "name" | "version">): string;
52
- declare function registerViewContract(view: ViewContract): void;
53
- declare function registerViewContractIfMissing(view: ViewContract): void;
54
- declare function resolveViewContract(name: string, version: string): ViewContract | undefined;
55
- declare function getRegisteredViewContractKeys(): string[];
52
+ interface ViewRegistry {
53
+ register(view: ViewContract): void;
54
+ registerIfMissing(view: ViewContract): void;
55
+ resolve(name: string, version: string): ViewContract | undefined;
56
+ keys(): string[];
57
+ }
58
+ declare function createViewRegistry(views?: readonly ViewContract[]): ViewRegistry;
56
59
  interface ReplayViewOptions<State, Event extends ReplayableAssetEvent = ReplayableAssetEvent> {
57
60
  view: ViewContract<State, Event>;
58
61
  events: Iterable<Event> | AsyncIterable<Event>;
@@ -110,4 +113,4 @@ interface ReplayEventsResult<State, Event extends ReplayableAssetEvent = Replaya
110
113
  }
111
114
  declare function replayEvents<State, Event extends ReplayableAssetEvent = ReplayableAssetEvent>({ events, scope, initialState, snapshot, applyEvent, eventsStartAfterSnapshot, }: ReplayEventsOptions<State, Event>): Promise<ReplayEventsResult<State, Event>>;
112
115
 
113
- export { type ReplayEventsOptions, type ReplayEventsResult, type ReplayScope, type ReplaySnapshot, type ReplayViewOptions, type ReplayWarning, type ReplayWarningCode, type ReplayableAssetEvent, type ViewContract, type ViewEventConsumption, type ViewUsageMetadata, getRegisteredViewContractKeys, registerViewContract, registerViewContractIfMissing, replayEvents, replayView, resolveViewContract, viewContractKey };
116
+ export { type ReplayEventsOptions, type ReplayEventsResult, type ReplayScope, type ReplaySnapshot, type ReplayViewOptions, type ReplayWarning, type ReplayWarningCode, type ReplayableAssetEvent, type ViewContract, type ViewEventConsumption, type ViewRegistry, type ViewUsageMetadata, createViewRegistry, replayEvents, replayView, viewContractKey };
@@ -49,10 +49,13 @@ interface ViewUsageMetadata {
49
49
  classification?: "public" | "internal" | "confidential" | "restricted";
50
50
  }
51
51
  declare function viewContractKey(view: Pick<ViewContract, "name" | "version">): string;
52
- declare function registerViewContract(view: ViewContract): void;
53
- declare function registerViewContractIfMissing(view: ViewContract): void;
54
- declare function resolveViewContract(name: string, version: string): ViewContract | undefined;
55
- declare function getRegisteredViewContractKeys(): string[];
52
+ interface ViewRegistry {
53
+ register(view: ViewContract): void;
54
+ registerIfMissing(view: ViewContract): void;
55
+ resolve(name: string, version: string): ViewContract | undefined;
56
+ keys(): string[];
57
+ }
58
+ declare function createViewRegistry(views?: readonly ViewContract[]): ViewRegistry;
56
59
  interface ReplayViewOptions<State, Event extends ReplayableAssetEvent = ReplayableAssetEvent> {
57
60
  view: ViewContract<State, Event>;
58
61
  events: Iterable<Event> | AsyncIterable<Event>;
@@ -110,4 +113,4 @@ interface ReplayEventsResult<State, Event extends ReplayableAssetEvent = Replaya
110
113
  }
111
114
  declare function replayEvents<State, Event extends ReplayableAssetEvent = ReplayableAssetEvent>({ events, scope, initialState, snapshot, applyEvent, eventsStartAfterSnapshot, }: ReplayEventsOptions<State, Event>): Promise<ReplayEventsResult<State, Event>>;
112
115
 
113
- export { type ReplayEventsOptions, type ReplayEventsResult, type ReplayScope, type ReplaySnapshot, type ReplayViewOptions, type ReplayWarning, type ReplayWarningCode, type ReplayableAssetEvent, type ViewContract, type ViewEventConsumption, type ViewUsageMetadata, getRegisteredViewContractKeys, registerViewContract, registerViewContractIfMissing, replayEvents, replayView, resolveViewContract, viewContractKey };
116
+ export { type ReplayEventsOptions, type ReplayEventsResult, type ReplayScope, type ReplaySnapshot, type ReplayViewOptions, type ReplayWarning, type ReplayWarningCode, type ReplayableAssetEvent, type ViewContract, type ViewEventConsumption, type ViewRegistry, type ViewUsageMetadata, createViewRegistry, replayEvents, replayView, viewContractKey };
@@ -1,3 +1,3 @@
1
- export { getRegisteredViewContractKeys, registerViewContract, registerViewContractIfMissing, replayEvents, replayView, resolveViewContract, viewContractKey } from '../chunk-FSUYD4F4.js';
1
+ export { createViewRegistry, replayEvents, replayView, viewContractKey } from '../chunk-J5LS5BSI.js';
2
2
  //# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map
@@ -1,32 +1,16 @@
1
1
  'use strict';
2
2
 
3
- var chunkUV252FLT_cjs = require('../chunk-UV252FLT.cjs');
3
+ var chunkWAI4UNWQ_cjs = require('../chunk-WAI4UNWQ.cjs');
4
4
 
5
5
 
6
6
 
7
- Object.defineProperty(exports, "getAllowedTransitions", {
7
+ Object.defineProperty(exports, "createStateMachineRegistry", {
8
8
  enumerable: true,
9
- get: function () { return chunkUV252FLT_cjs.getAllowedTransitions; }
9
+ get: function () { return chunkWAI4UNWQ_cjs.createStateMachineRegistry; }
10
10
  });
11
- Object.defineProperty(exports, "getEntityStateClass", {
11
+ Object.defineProperty(exports, "validateStateMachineTransition", {
12
12
  enumerable: true,
13
- get: function () { return chunkUV252FLT_cjs.getEntityStateClass; }
14
- });
15
- Object.defineProperty(exports, "registerStateMachine", {
16
- enumerable: true,
17
- get: function () { return chunkUV252FLT_cjs.registerStateMachine; }
18
- });
19
- Object.defineProperty(exports, "registerStateMachineIfMissing", {
20
- enumerable: true,
21
- get: function () { return chunkUV252FLT_cjs.registerStateMachineIfMissing; }
22
- });
23
- Object.defineProperty(exports, "resolveStateMachine", {
24
- enumerable: true,
25
- get: function () { return chunkUV252FLT_cjs.resolveStateMachine; }
26
- });
27
- Object.defineProperty(exports, "validateTransition", {
28
- enumerable: true,
29
- get: function () { return chunkUV252FLT_cjs.validateTransition; }
13
+ get: function () { return chunkWAI4UNWQ_cjs.validateStateMachineTransition; }
30
14
  });
31
15
  //# sourceMappingURL=index.cjs.map
32
16
  //# sourceMappingURL=index.cjs.map
@@ -16,39 +16,25 @@ interface TransitionContext<TDb = StateMachineDatabaseClient> {
16
16
  parameters: unknown;
17
17
  db: TDb;
18
18
  }
19
- /**
20
- * Register a state-machine definition for an entity type.
21
- * Throws if a definition for this entity type is already registered.
22
- */
23
- declare function registerStateMachine(def: StateMachineDefinition): void;
24
- /**
25
- * Register a state-machine definition only if one for this entity type
26
- * is not already registered. Idempotent — safe to call multiple times.
27
- */
28
- declare function registerStateMachineIfMissing(def: StateMachineDefinition): void;
29
- /**
30
- * Resolve a previously registered state-machine definition by entity type.
31
- */
32
- declare function resolveStateMachine(entityType: string): StateMachineDefinition | undefined;
33
- /**
34
- * Validate whether a transition is allowed for the given entity type,
35
- * from state, to state, and action ID.
36
- */
37
- declare function validateTransition(entityType: string, from: string, to: string, actionId: string): {
19
+ interface StateMachineRegistry {
20
+ register(definition: StateMachineDefinition): void;
21
+ registerIfMissing(definition: StateMachineDefinition): void;
22
+ resolve(entityType: string): StateMachineDefinition | undefined;
23
+ validateTransition(entityType: string, from: string, to: string, actionId: string): {
24
+ valid: boolean;
25
+ error?: string;
26
+ };
27
+ allowedTransitions(entityType: string, from: string): Array<{
28
+ to: string;
29
+ causedByAction: string;
30
+ }>;
31
+ stateClass(entityType: string, state: string): StateClass | undefined;
32
+ }
33
+ declare function validateStateMachineTransition(sm: StateMachineDefinition | undefined, entityType: string, from: string, to: string, actionId: string): {
38
34
  valid: boolean;
39
35
  error?: string;
40
36
  };
41
- /**
42
- * Get all allowed transitions from a given state for an entity type.
43
- */
44
- declare function getAllowedTransitions(entityType: string, from: string): Array<{
45
- to: string;
46
- causedByAction: string;
47
- }>;
48
- /**
49
- * Get the StateClass of a given state for an entity type.
50
- */
51
- declare function getEntityStateClass(entityType: string, state: string): StateClass | undefined;
37
+ declare function createStateMachineRegistry(definitions?: readonly StateMachineDefinition[]): StateMachineRegistry;
52
38
 
53
39
  type StateClass = "initial" | "active" | "action_required" | "waiting" | "terminal" | "exception";
54
40
  interface StateDefinition {
@@ -57,4 +43,4 @@ interface StateDefinition {
57
43
  stateClass: StateClass;
58
44
  }
59
45
 
60
- export { type StateClass, type StateDefinition, type StateMachineDatabaseClient, type StateMachineDefinition, type TransitionContext, getAllowedTransitions, getEntityStateClass, registerStateMachine, registerStateMachineIfMissing, resolveStateMachine, validateTransition };
46
+ export { type StateClass, type StateDefinition, type StateMachineDatabaseClient, type StateMachineDefinition, type StateMachineRegistry, type TransitionContext, createStateMachineRegistry, validateStateMachineTransition };
@@ -16,39 +16,25 @@ interface TransitionContext<TDb = StateMachineDatabaseClient> {
16
16
  parameters: unknown;
17
17
  db: TDb;
18
18
  }
19
- /**
20
- * Register a state-machine definition for an entity type.
21
- * Throws if a definition for this entity type is already registered.
22
- */
23
- declare function registerStateMachine(def: StateMachineDefinition): void;
24
- /**
25
- * Register a state-machine definition only if one for this entity type
26
- * is not already registered. Idempotent — safe to call multiple times.
27
- */
28
- declare function registerStateMachineIfMissing(def: StateMachineDefinition): void;
29
- /**
30
- * Resolve a previously registered state-machine definition by entity type.
31
- */
32
- declare function resolveStateMachine(entityType: string): StateMachineDefinition | undefined;
33
- /**
34
- * Validate whether a transition is allowed for the given entity type,
35
- * from state, to state, and action ID.
36
- */
37
- declare function validateTransition(entityType: string, from: string, to: string, actionId: string): {
19
+ interface StateMachineRegistry {
20
+ register(definition: StateMachineDefinition): void;
21
+ registerIfMissing(definition: StateMachineDefinition): void;
22
+ resolve(entityType: string): StateMachineDefinition | undefined;
23
+ validateTransition(entityType: string, from: string, to: string, actionId: string): {
24
+ valid: boolean;
25
+ error?: string;
26
+ };
27
+ allowedTransitions(entityType: string, from: string): Array<{
28
+ to: string;
29
+ causedByAction: string;
30
+ }>;
31
+ stateClass(entityType: string, state: string): StateClass | undefined;
32
+ }
33
+ declare function validateStateMachineTransition(sm: StateMachineDefinition | undefined, entityType: string, from: string, to: string, actionId: string): {
38
34
  valid: boolean;
39
35
  error?: string;
40
36
  };
41
- /**
42
- * Get all allowed transitions from a given state for an entity type.
43
- */
44
- declare function getAllowedTransitions(entityType: string, from: string): Array<{
45
- to: string;
46
- causedByAction: string;
47
- }>;
48
- /**
49
- * Get the StateClass of a given state for an entity type.
50
- */
51
- declare function getEntityStateClass(entityType: string, state: string): StateClass | undefined;
37
+ declare function createStateMachineRegistry(definitions?: readonly StateMachineDefinition[]): StateMachineRegistry;
52
38
 
53
39
  type StateClass = "initial" | "active" | "action_required" | "waiting" | "terminal" | "exception";
54
40
  interface StateDefinition {
@@ -57,4 +43,4 @@ interface StateDefinition {
57
43
  stateClass: StateClass;
58
44
  }
59
45
 
60
- export { type StateClass, type StateDefinition, type StateMachineDatabaseClient, type StateMachineDefinition, type TransitionContext, getAllowedTransitions, getEntityStateClass, registerStateMachine, registerStateMachineIfMissing, resolveStateMachine, validateTransition };
46
+ export { type StateClass, type StateDefinition, type StateMachineDatabaseClient, type StateMachineDefinition, type StateMachineRegistry, type TransitionContext, createStateMachineRegistry, validateStateMachineTransition };
@@ -1,3 +1,3 @@
1
- export { getAllowedTransitions, getEntityStateClass, registerStateMachine, registerStateMachineIfMissing, resolveStateMachine, validateTransition } from '../chunk-T2JLSZN6.js';
1
+ export { createStateMachineRegistry, validateStateMachineTransition } from '../chunk-OWSSGFNY.js';
2
2
  //# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fabricorg/platform",
3
- "version": "0.12.1",
3
+ "version": "1.0.0",
4
4
  "description": "Generic, vertical-agnostic runtime for ontology-based business applications. Provides actions, modules, events, policies, state machines, adapters, displays, projections, privacy, and evidence contracts. Zero runtime dependencies; portable across any database client and any vertical (lending, insurance, healthcare, legal, etc.).",
5
5
  "keywords": [
6
6
  "fabric",
@@ -68,16 +68,6 @@
68
68
  "default": "./dist/agent-hitl/index.cjs"
69
69
  }
70
70
  },
71
- "./displays": {
72
- "import": {
73
- "types": "./dist/displays/index.d.ts",
74
- "default": "./dist/displays/index.js"
75
- },
76
- "require": {
77
- "types": "./dist/displays/index.d.cts",
78
- "default": "./dist/displays/index.cjs"
79
- }
80
- },
81
71
  "./events": {
82
72
  "import": {
83
73
  "types": "./dist/events/index.d.ts",