@fabricorg/platform 0.1.1 → 0.2.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 (122) hide show
  1. package/dist/actions/index.cjs +48 -0
  2. package/dist/actions/index.cjs.map +1 -0
  3. package/dist/actions/index.d.cts +116 -0
  4. package/dist/actions/index.js +1 -57
  5. package/dist/actions/index.js.map +1 -1
  6. package/dist/adapters/index.cjs +28 -0
  7. package/dist/adapters/index.cjs.map +1 -0
  8. package/dist/adapters/index.d.cts +83 -0
  9. package/dist/adapters/index.js +1 -99
  10. package/dist/adapters/index.js.map +1 -1
  11. package/dist/chunk-3A6FU3KV.js +67 -0
  12. package/dist/chunk-3A6FU3KV.js.map +1 -0
  13. package/dist/chunk-3F6FKQZA.js +89 -0
  14. package/dist/chunk-3F6FKQZA.js.map +1 -0
  15. package/dist/chunk-3ZW5USXF.js +101 -0
  16. package/dist/chunk-3ZW5USXF.js.map +1 -0
  17. package/dist/chunk-4YQOGV7H.js +55 -0
  18. package/dist/chunk-4YQOGV7H.js.map +1 -0
  19. package/dist/chunk-6FMW4NF6.js +59 -0
  20. package/dist/chunk-6FMW4NF6.js.map +1 -0
  21. package/dist/chunk-7KJHGAZY.cjs +99 -0
  22. package/dist/chunk-7KJHGAZY.cjs.map +1 -0
  23. package/dist/chunk-GB2PSZ33.cjs +74 -0
  24. package/dist/chunk-GB2PSZ33.cjs.map +1 -0
  25. package/dist/chunk-I35B576X.js +30 -0
  26. package/dist/chunk-I35B576X.js.map +1 -0
  27. package/dist/chunk-IFMZPLM4.js +27 -0
  28. package/dist/chunk-IFMZPLM4.js.map +1 -0
  29. package/dist/chunk-JAXDEK5Z.cjs +63 -0
  30. package/dist/chunk-JAXDEK5Z.cjs.map +1 -0
  31. package/dist/chunk-JSTGOT6P.js +181 -0
  32. package/dist/chunk-JSTGOT6P.js.map +1 -0
  33. package/dist/chunk-KOC4A7A4.js +544 -0
  34. package/dist/chunk-KOC4A7A4.js.map +1 -0
  35. package/dist/chunk-KQEBNUZI.cjs +70 -0
  36. package/dist/chunk-KQEBNUZI.cjs.map +1 -0
  37. package/dist/chunk-LHCSVEFT.cjs +8 -0
  38. package/dist/chunk-LHCSVEFT.cjs.map +1 -0
  39. package/dist/chunk-LYX73U3P.cjs +195 -0
  40. package/dist/chunk-LYX73U3P.cjs.map +1 -0
  41. package/dist/chunk-LZSE6QGQ.cjs +60 -0
  42. package/dist/chunk-LZSE6QGQ.cjs.map +1 -0
  43. package/dist/chunk-N24NLCZ6.js +6 -0
  44. package/dist/chunk-N24NLCZ6.js.map +1 -0
  45. package/dist/chunk-NPVIFZQV.cjs +107 -0
  46. package/dist/chunk-NPVIFZQV.cjs.map +1 -0
  47. package/dist/chunk-OZLZHISS.js +3 -0
  48. package/dist/chunk-OZLZHISS.js.map +1 -0
  49. package/dist/chunk-PG5LYTUX.cjs +4 -0
  50. package/dist/chunk-PG5LYTUX.cjs.map +1 -0
  51. package/dist/chunk-PXMKCAQI.js +187 -0
  52. package/dist/chunk-PXMKCAQI.js.map +1 -0
  53. package/dist/chunk-Q3WYIWCN.cjs +183 -0
  54. package/dist/chunk-Q3WYIWCN.cjs.map +1 -0
  55. package/dist/chunk-QETQGAXJ.cjs +35 -0
  56. package/dist/chunk-QETQGAXJ.cjs.map +1 -0
  57. package/dist/chunk-RALMUSOX.js +55 -0
  58. package/dist/chunk-RALMUSOX.js.map +1 -0
  59. package/dist/chunk-SDXDHVTV.cjs +555 -0
  60. package/dist/chunk-SDXDHVTV.cjs.map +1 -0
  61. package/dist/chunk-YZKUEC2J.cjs +31 -0
  62. package/dist/chunk-YZKUEC2J.cjs.map +1 -0
  63. package/dist/displays/index.cjs +24 -0
  64. package/dist/displays/index.cjs.map +1 -0
  65. package/dist/displays/index.d.cts +34 -0
  66. package/dist/displays/index.js +1 -87
  67. package/dist/displays/index.js.map +1 -1
  68. package/dist/events/index.cjs +36 -0
  69. package/dist/events/index.cjs.map +1 -0
  70. package/dist/events/index.d.cts +35 -0
  71. package/dist/events/index.js +1 -53
  72. package/dist/events/index.js.map +1 -1
  73. package/dist/evidence/index.cjs +6 -0
  74. package/dist/evidence/index.cjs.map +1 -0
  75. package/dist/evidence/index.d.cts +43 -0
  76. package/dist/evidence/index.js +1 -1
  77. package/dist/ids/index.cjs +24 -0
  78. package/dist/ids/index.cjs.map +1 -0
  79. package/dist/ids/index.d.cts +19 -0
  80. package/dist/ids/index.js +1 -53
  81. package/dist/ids/index.js.map +1 -1
  82. package/dist/index.cjs +268 -0
  83. package/dist/index.cjs.map +1 -0
  84. package/dist/index.d.cts +13 -0
  85. package/dist/index.js +13 -1355
  86. package/dist/index.js.map +1 -1
  87. package/dist/modules/index.cjs +42 -0
  88. package/dist/modules/index.cjs.map +1 -0
  89. package/dist/modules/index.d.cts +73 -0
  90. package/dist/modules/index.js +7 -373
  91. package/dist/modules/index.js.map +1 -1
  92. package/dist/objects/index.cjs +24 -0
  93. package/dist/objects/index.cjs.map +1 -0
  94. package/dist/objects/index.d.cts +7 -0
  95. package/dist/objects/index.js +1 -28
  96. package/dist/objects/index.js.map +1 -1
  97. package/dist/policies/index.cjs +48 -0
  98. package/dist/policies/index.cjs.map +1 -0
  99. package/dist/policies/index.d.cts +143 -0
  100. package/dist/policies/index.js +1 -542
  101. package/dist/policies/index.js.map +1 -1
  102. package/dist/privacy/index.cjs +12 -0
  103. package/dist/privacy/index.cjs.map +1 -0
  104. package/dist/privacy/index.d.cts +77 -0
  105. package/dist/privacy/index.js +1 -4
  106. package/dist/privacy/index.js.map +1 -1
  107. package/dist/projections/index.cjs +12 -0
  108. package/dist/projections/index.cjs.map +1 -0
  109. package/dist/projections/index.d.cts +52 -0
  110. package/dist/projections/index.js +1 -179
  111. package/dist/projections/index.js.map +1 -1
  112. package/dist/state-machines/index.cjs +32 -0
  113. package/dist/state-machines/index.cjs.map +1 -0
  114. package/dist/state-machines/index.d.cts +60 -0
  115. package/dist/state-machines/index.js +1 -65
  116. package/dist/state-machines/index.js.map +1 -1
  117. package/dist/testing/index.cjs +21 -0
  118. package/dist/testing/index.cjs.map +1 -0
  119. package/dist/testing/index.d.cts +19 -0
  120. package/dist/testing/index.js +2 -56
  121. package/dist/testing/index.js.map +1 -1
  122. package/package.json +196 -111
@@ -1,58 +1,4 @@
1
- // adapters/index.ts
2
- function adapterKey(adapterType, operation) {
3
- return `${adapterType}:${operation}`;
4
- }
5
- var MissingAdapterRegistrationError = class extends Error {
6
- constructor(adapterType, operation) {
7
- super(`No adapter registered for adapterType "${adapterType}" and operation "${operation}"`);
8
- this.name = "MissingAdapterRegistrationError";
9
- }
10
- };
11
- var AdapterRegistry = class {
12
- adapters = /* @__PURE__ */ new Map();
13
- register(adapter) {
14
- const key = adapterKey(adapter.adapterType, adapter.operation);
15
- if (this.adapters.has(key)) {
16
- throw new Error(
17
- `Adapter already registered for adapterType "${adapter.adapterType}" and operation "${adapter.operation}"`
18
- );
19
- }
20
- this.adapters.set(key, adapter);
21
- }
22
- resolve(adapterType, operation) {
23
- return this.adapters.get(adapterKey(adapterType, operation));
24
- }
25
- require(adapterType, operation) {
26
- const adapter = this.resolve(adapterType, operation);
27
- if (!adapter) {
28
- throw new MissingAdapterRegistrationError(adapterType, operation);
29
- }
30
- return adapter;
31
- }
32
- };
33
-
34
- // testing/index.ts
35
- function createFakeActionContext(options = {}) {
36
- return {
37
- actionInvocationId: options.actionInvocationId ?? "act_test",
38
- tenantId: options.tenantId ?? "tenant-test",
39
- spaceId: options.spaceId ?? "space-test",
40
- actorId: options.actorId ?? "actor-test",
41
- actorType: options.actorType ?? "system",
42
- correlationId: options.correlationId ?? "corr-test",
43
- causationId: options.causationId,
44
- db: options.db ?? {},
45
- services: options.services ?? {}
46
- };
47
- }
48
- function createInMemoryAdapterRegistry() {
49
- return new AdapterRegistry();
50
- }
51
- function createDeterministicIdFactory(prefix = "test") {
52
- let sequence = 0;
53
- return () => `${prefix}_${String(++sequence).padStart(6, "0")}`;
54
- }
55
-
56
- export { createDeterministicIdFactory, createFakeActionContext, createInMemoryAdapterRegistry };
1
+ export { createDeterministicIdFactory, createFakeActionContext, createInMemoryAdapterRegistry } from '../chunk-IFMZPLM4.js';
2
+ import '../chunk-3ZW5USXF.js';
57
3
  //# sourceMappingURL=index.js.map
58
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../adapters/index.ts","../../testing/index.ts"],"names":[],"mappings":";AAiFA,SAAS,UAAA,CAAW,aAAqB,SAAA,EAA2B;AACnE,EAAA,OAAO,CAAA,EAAG,WAAW,CAAA,CAAA,EAAI,SAAS,CAAA,CAAA;AACnC;AAEO,IAAM,+BAAA,GAAN,cAA8C,KAAA,CAAM;AAAA,EAC1D,WAAA,CAAY,aAAqB,SAAA,EAAmB;AACnD,IAAA,KAAA,CAAM,CAAA,uCAAA,EAA0C,WAAW,CAAA,iBAAA,EAAoB,SAAS,CAAA,CAAA,CAAG,CAAA;AAC3F,IAAA,IAAA,CAAK,IAAA,GAAO,iCAAA;AAAA,EACb;AACD,CAAA;AAEO,IAAM,kBAAN,MAAsB;AAAA,EACX,QAAA,uBAAe,GAAA,EAAmC;AAAA,EAEnE,SAAS,OAAA,EAAsC;AAC9C,IAAA,MAAM,GAAA,GAAM,UAAA,CAAW,OAAA,CAAQ,WAAA,EAAa,QAAQ,SAAS,CAAA;AAC7D,IAAA,IAAI,IAAA,CAAK,QAAA,CAAS,GAAA,CAAI,GAAG,CAAA,EAAG;AAC3B,MAAA,MAAM,IAAI,KAAA;AAAA,QACT,CAAA,4CAAA,EAA+C,OAAA,CAAQ,WAAW,CAAA,iBAAA,EAAoB,QAAQ,SAAS,CAAA,CAAA;AAAA,OACxG;AAAA,IACD;AAEA,IAAA,IAAA,CAAK,QAAA,CAAS,GAAA,CAAI,GAAA,EAAK,OAAO,CAAA;AAAA,EAC/B;AAAA,EAEA,OAAA,CAAQ,aAAqB,SAAA,EAAsD;AAClF,IAAA,OAAO,KAAK,QAAA,CAAS,GAAA,CAAI,UAAA,CAAW,WAAA,EAAa,SAAS,CAAC,CAAA;AAAA,EAC5D;AAAA,EAEA,OAAA,CAAQ,aAAqB,SAAA,EAA0C;AACtE,IAAA,MAAM,OAAA,GAAU,IAAA,CAAK,OAAA,CAAQ,WAAA,EAAa,SAAS,CAAA;AACnD,IAAA,IAAI,CAAC,OAAA,EAAS;AACb,MAAA,MAAM,IAAI,+BAAA,CAAgC,WAAA,EAAa,SAAS,CAAA;AAAA,IACjE;AAEA,IAAA,OAAO,OAAA;AAAA,EACR;AACD,CAAA;;;ACvGO,SAAS,uBAAA,CACf,OAAA,GAAyC,EAAC,EACrB;AACrB,EAAA,OAAO;AAAA,IACN,kBAAA,EAAoB,QAAQ,kBAAA,IAAsB,UAAA;AAAA,IAClD,QAAA,EAAU,QAAQ,QAAA,IAAY,aAAA;AAAA,IAC9B,OAAA,EAAS,QAAQ,OAAA,IAAW,YAAA;AAAA,IAC5B,OAAA,EAAS,QAAQ,OAAA,IAAW,YAAA;AAAA,IAC5B,SAAA,EAAW,QAAQ,SAAA,IAAa,QAAA;AAAA,IAChC,aAAA,EAAe,QAAQ,aAAA,IAAiB,WAAA;AAAA,IACxC,aAAa,OAAA,CAAQ,WAAA;AAAA,IACrB,EAAA,EAAI,OAAA,CAAQ,EAAA,IAAO,EAAC;AAAA,IACpB,QAAA,EAAU,OAAA,CAAQ,QAAA,IAAY;AAAC,GAChC;AACD;AAEO,SAAS,6BAAA,GAAiD;AAChE,EAAA,OAAO,IAAI,eAAA,EAAgB;AAC5B;AAEO,SAAS,4BAAA,CAA6B,SAAS,MAAA,EAAsB;AAC3E,EAAA,IAAI,QAAA,GAAW,CAAA;AACf,EAAA,OAAO,MAAM,CAAA,EAAG,MAAM,CAAA,CAAA,EAAI,MAAA,CAAO,EAAE,QAAQ,CAAA,CAAE,QAAA,CAAS,CAAA,EAAG,GAAG,CAAC,CAAA,CAAA;AAC9D","file":"index.js","sourcesContent":["export interface AdapterExecutionContext {\n\ttenantId: string;\n\tspaceId: string;\n\tactionInvocationId: string;\n\tadapterInvocationId: string;\n\tcorrelationId: string;\n\tcausationId?: string;\n\tattempt: number;\n\tmaxAttempts: number;\n}\n\nexport interface AdapterExecutionResult {\n\tsuccess: boolean;\n\tcorrelationId?: string;\n\terror?: string;\n}\n\nexport type AdapterExecutor = (\n\tinput: Record<string, unknown>,\n\tcontext: AdapterExecutionContext,\n) => Promise<AdapterExecutionResult>;\n\nexport interface AdapterRetryPolicy {\n\t/** External calls must explicitly opt into retry by being idempotent. */\n\tidempotent: boolean;\n\t/** Total attempts including the first call. Non-idempotent policies are forced to 1. */\n\tmaxAttempts?: number;\n\t/** First backoff delay in milliseconds. */\n\tinitialDelayMs?: number;\n\t/** Exponential multiplier applied after each failed attempt. */\n\tbackoffMultiplier?: number;\n\t/** Upper bound for any single retry delay in milliseconds. */\n\tmaxDelayMs?: number;\n}\n\nexport interface ResolvedAdapterRetryPolicy {\n\tidempotent: boolean;\n\tmaxAttempts: number;\n\tinitialDelayMs: number;\n\tbackoffMultiplier: number;\n\tmaxDelayMs: number;\n}\n\nexport interface AdapterCircuitBreakerConfig {\n\tmode: \"monitor\" | \"enforce\";\n\tfailureThreshold: number;\n\twindowMs: number;\n\tcooldownMs: number;\n\tminimumSamples?: number;\n}\n\nexport interface AdapterImplementation {\n\tadapterType: string;\n\toperation: string;\n\tvendor: string;\n\t/** Whether this adapter operation can be safely retried by default. */\n\tidempotent: boolean;\n\tretryPolicy?: AdapterRetryPolicy;\n\t/** Defaults to monitor-only; enforce mode must be explicitly configured. */\n\tcircuitBreaker?: AdapterCircuitBreakerConfig;\n\texecute: AdapterExecutor;\n}\n\nexport interface AdapterAttempt<T> {\n\tattempt: number;\n\tresult?: T;\n\terror?: string;\n\twillRetry: boolean;\n\tnextDelayMs?: number;\n}\n\nexport interface ExecuteWithRetryOptions<T> {\n\tpolicy?: AdapterRetryPolicy;\n\tdefaultIdempotent: boolean;\n\texecute: (attempt: number, maxAttempts: number) => Promise<T>;\n\tisSuccessful: (result: T) => boolean;\n\tgetError: (result: T) => string | undefined;\n\tsleep?: (delayMs: number) => Promise<void>;\n\tonAttempt?: (attempt: AdapterAttempt<T>) => Promise<void> | void;\n}\n\nfunction adapterKey(adapterType: string, operation: string): string {\n\treturn `${adapterType}:${operation}`;\n}\n\nexport class MissingAdapterRegistrationError extends Error {\n\tconstructor(adapterType: string, operation: string) {\n\t\tsuper(`No adapter registered for adapterType \"${adapterType}\" and operation \"${operation}\"`);\n\t\tthis.name = \"MissingAdapterRegistrationError\";\n\t}\n}\n\nexport class AdapterRegistry {\n\tprivate readonly adapters = new Map<string, AdapterImplementation>();\n\n\tregister(adapter: AdapterImplementation): void {\n\t\tconst key = adapterKey(adapter.adapterType, adapter.operation);\n\t\tif (this.adapters.has(key)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Adapter already registered for adapterType \"${adapter.adapterType}\" and operation \"${adapter.operation}\"`,\n\t\t\t);\n\t\t}\n\n\t\tthis.adapters.set(key, adapter);\n\t}\n\n\tresolve(adapterType: string, operation: string): AdapterImplementation | undefined {\n\t\treturn this.adapters.get(adapterKey(adapterType, operation));\n\t}\n\n\trequire(adapterType: string, operation: string): AdapterImplementation {\n\t\tconst adapter = this.resolve(adapterType, operation);\n\t\tif (!adapter) {\n\t\t\tthrow new MissingAdapterRegistrationError(adapterType, operation);\n\t\t}\n\n\t\treturn adapter;\n\t}\n}\n\nconst DEFAULT_RETRY_POLICY: ResolvedAdapterRetryPolicy = {\n\tidempotent: true,\n\tmaxAttempts: 3,\n\tinitialDelayMs: 100,\n\tbackoffMultiplier: 2,\n\tmaxDelayMs: 1_000,\n};\n\nconst NO_RETRY_POLICY: ResolvedAdapterRetryPolicy = {\n\tidempotent: false,\n\tmaxAttempts: 1,\n\tinitialDelayMs: 0,\n\tbackoffMultiplier: 1,\n\tmaxDelayMs: 0,\n};\n\nexport function resolveAdapterRetryPolicy(\n\tpolicy: AdapterRetryPolicy | undefined,\n\tdefaultIdempotent: boolean,\n): ResolvedAdapterRetryPolicy {\n\tconst idempotent = policy?.idempotent ?? defaultIdempotent;\n\n\tif (!idempotent) {\n\t\treturn NO_RETRY_POLICY;\n\t}\n\n\treturn {\n\t\tidempotent: true,\n\t\tmaxAttempts: Math.max(1, Math.min(policy?.maxAttempts ?? DEFAULT_RETRY_POLICY.maxAttempts, 5)),\n\t\tinitialDelayMs: Math.max(0, policy?.initialDelayMs ?? DEFAULT_RETRY_POLICY.initialDelayMs),\n\t\tbackoffMultiplier: Math.max(\n\t\t\t1,\n\t\t\tpolicy?.backoffMultiplier ?? DEFAULT_RETRY_POLICY.backoffMultiplier,\n\t\t),\n\t\tmaxDelayMs: Math.max(0, policy?.maxDelayMs ?? DEFAULT_RETRY_POLICY.maxDelayMs),\n\t};\n}\n\nexport function getRetryDelayMs(attempt: number, policy: ResolvedAdapterRetryPolicy): number {\n\tconst exponentialDelay =\n\t\tpolicy.initialDelayMs * policy.backoffMultiplier ** Math.max(0, attempt - 1);\n\n\treturn Math.min(exponentialDelay, policy.maxDelayMs);\n}\n\nexport async function executeWithAdapterRetry<T>(options: ExecuteWithRetryOptions<T>): Promise<T> {\n\tconst policy = resolveAdapterRetryPolicy(options.policy, options.defaultIdempotent);\n\tconst sleep =\n\t\toptions.sleep ?? ((delayMs) => new Promise((resolve) => setTimeout(resolve, delayMs)));\n\tlet lastError: string | undefined;\n\n\tfor (let attempt = 1; attempt <= policy.maxAttempts; attempt++) {\n\t\ttry {\n\t\t\tconst result = await options.execute(attempt, policy.maxAttempts);\n\t\t\tif (options.isSuccessful(result)) {\n\t\t\t\tawait options.onAttempt?.({ attempt, result, willRetry: false });\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tlastError = options.getError(result) ?? \"Adapter returned unsuccessful result\";\n\t\t\tconst willRetry = policy.idempotent && attempt < policy.maxAttempts;\n\t\t\tconst nextDelayMs = willRetry ? getRetryDelayMs(attempt, policy) : undefined;\n\t\t\tawait options.onAttempt?.({ attempt, result, error: lastError, willRetry, nextDelayMs });\n\n\t\t\tif (!willRetry) {\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tawait sleep(nextDelayMs ?? 0);\n\t\t} catch (error) {\n\t\t\tlastError = error instanceof Error ? error.message : String(error);\n\t\t\tconst willRetry = policy.idempotent && attempt < policy.maxAttempts;\n\t\t\tconst nextDelayMs = willRetry ? getRetryDelayMs(attempt, policy) : undefined;\n\t\t\tawait options.onAttempt?.({ attempt, error: lastError, willRetry, nextDelayMs });\n\n\t\t\tif (!willRetry) {\n\t\t\t\tthrow error;\n\t\t\t}\n\n\t\t\tawait sleep(nextDelayMs ?? 0);\n\t\t}\n\t}\n\n\tthrow new Error(lastError ?? \"Adapter retry exhausted\");\n}\n","import { AdapterRegistry } from \"../adapters\";\nimport type { ActionContext, ActorType } from \"../actions\";\n\nexport interface FakeActionContextOptions<TDb = Record<string, never>> {\n\tactionInvocationId?: string;\n\ttenantId?: string;\n\tspaceId?: string;\n\tactorId?: string;\n\tactorType?: ActorType;\n\tcorrelationId?: string;\n\tcausationId?: string;\n\tdb?: TDb;\n\tservices?: Record<string, unknown>;\n}\n\nexport function createFakeActionContext<TDb = Record<string, never>>(\n\toptions: FakeActionContextOptions<TDb> = {},\n): ActionContext<TDb> {\n\treturn {\n\t\tactionInvocationId: options.actionInvocationId ?? \"act_test\",\n\t\ttenantId: options.tenantId ?? \"tenant-test\",\n\t\tspaceId: options.spaceId ?? \"space-test\",\n\t\tactorId: options.actorId ?? \"actor-test\",\n\t\tactorType: options.actorType ?? \"system\",\n\t\tcorrelationId: options.correlationId ?? \"corr-test\",\n\t\tcausationId: options.causationId,\n\t\tdb: options.db ?? ({} as TDb),\n\t\tservices: options.services ?? {},\n\t};\n}\n\nexport function createInMemoryAdapterRegistry(): AdapterRegistry {\n\treturn new AdapterRegistry();\n}\n\nexport function createDeterministicIdFactory(prefix = \"test\"): () => string {\n\tlet sequence = 0;\n\treturn () => `${prefix}_${String(++sequence).padStart(6, \"0\")}`;\n}\n"]}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
package/package.json CHANGED
@@ -1,112 +1,197 @@
1
1
  {
2
- "name": "@fabricorg/platform",
3
- "version": "0.1.1",
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
- "keywords": [
6
- "fabric",
7
- "ontology",
8
- "action-runtime",
9
- "event-sourcing",
10
- "saga",
11
- "state-machine",
12
- "policy-engine",
13
- "adapter-registry"
14
- ],
15
- "license": "MIT",
16
- "author": "Fabric",
17
- "repository": {
18
- "type": "git",
19
- "url": "https://github.com/Fabric-Pro/fabric-platform.git",
20
- "directory": "packages/platform"
21
- },
22
- "homepage": "https://github.com/Fabric-Pro/fabric-platform#readme",
23
- "bugs": {
24
- "url": "https://github.com/Fabric-Pro/fabric-platform/issues"
25
- },
26
- "type": "module",
27
- "sideEffects": false,
28
- "main": "./dist/index.js",
29
- "types": "./dist/index.d.ts",
30
- "exports": {
31
- ".": {
32
- "types": "./dist/index.d.ts",
33
- "import": "./dist/index.js"
34
- },
35
- "./actions": {
36
- "types": "./dist/actions/index.d.ts",
37
- "import": "./dist/actions/index.js"
38
- },
39
- "./adapters": {
40
- "types": "./dist/adapters/index.d.ts",
41
- "import": "./dist/adapters/index.js"
42
- },
43
- "./displays": {
44
- "types": "./dist/displays/index.d.ts",
45
- "import": "./dist/displays/index.js"
46
- },
47
- "./events": {
48
- "types": "./dist/events/index.d.ts",
49
- "import": "./dist/events/index.js"
50
- },
51
- "./evidence": {
52
- "types": "./dist/evidence/index.d.ts",
53
- "import": "./dist/evidence/index.js"
54
- },
55
- "./ids": {
56
- "types": "./dist/ids/index.d.ts",
57
- "import": "./dist/ids/index.js"
58
- },
59
- "./modules": {
60
- "types": "./dist/modules/index.d.ts",
61
- "import": "./dist/modules/index.js"
62
- },
63
- "./objects": {
64
- "types": "./dist/objects/index.d.ts",
65
- "import": "./dist/objects/index.js"
66
- },
67
- "./policies": {
68
- "types": "./dist/policies/index.d.ts",
69
- "import": "./dist/policies/index.js"
70
- },
71
- "./privacy": {
72
- "types": "./dist/privacy/index.d.ts",
73
- "import": "./dist/privacy/index.js"
74
- },
75
- "./projections": {
76
- "types": "./dist/projections/index.d.ts",
77
- "import": "./dist/projections/index.js"
78
- },
79
- "./state-machines": {
80
- "types": "./dist/state-machines/index.d.ts",
81
- "import": "./dist/state-machines/index.js"
82
- },
83
- "./testing": {
84
- "types": "./dist/testing/index.d.ts",
85
- "import": "./dist/testing/index.js"
86
- }
87
- },
88
- "files": [
89
- "dist",
90
- "README.md",
91
- "LICENSE"
92
- ],
93
- "dependencies": {},
94
- "devDependencies": {
95
- "@types/node": "^22.10.0",
96
- "tsup": "^8.5.0",
97
- "typescript": "^5.7.3",
98
- "vitest": "^4.1.5"
99
- },
100
- "engines": {
101
- "node": ">=20"
102
- },
103
- "publishConfig": {
104
- "access": "public"
105
- },
106
- "scripts": {
107
- "clean": "rm -rf dist tsconfig.tsbuildinfo",
108
- "build": "tsup",
109
- "type-check": "tsc --noEmit",
110
- "test": "vitest run --passWithNoTests"
111
- }
112
- }
2
+ "name": "@fabricorg/platform",
3
+ "version": "0.2.0",
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
+ "keywords": [
6
+ "fabric",
7
+ "ontology",
8
+ "action-runtime",
9
+ "event-sourcing",
10
+ "saga",
11
+ "state-machine",
12
+ "policy-engine",
13
+ "adapter-registry"
14
+ ],
15
+ "license": "MIT",
16
+ "author": "Fabric",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "https://github.com/Fabric-Pro/fabric-platform.git",
20
+ "directory": "packages/platform"
21
+ },
22
+ "homepage": "https://github.com/Fabric-Pro/fabric-platform#readme",
23
+ "bugs": {
24
+ "url": "https://github.com/Fabric-Pro/fabric-platform/issues"
25
+ },
26
+ "type": "module",
27
+ "sideEffects": false,
28
+ "main": "./dist/index.cjs",
29
+ "types": "./dist/index.d.ts",
30
+ "exports": {
31
+ ".": {
32
+ "import": {
33
+ "types": "./dist/index.d.ts",
34
+ "default": "./dist/index.js"
35
+ },
36
+ "require": {
37
+ "types": "./dist/index.d.cts",
38
+ "default": "./dist/index.cjs"
39
+ }
40
+ },
41
+ "./actions": {
42
+ "import": {
43
+ "types": "./dist/actions/index.d.ts",
44
+ "default": "./dist/actions/index.js"
45
+ },
46
+ "require": {
47
+ "types": "./dist/actions/index.d.cts",
48
+ "default": "./dist/actions/index.cjs"
49
+ }
50
+ },
51
+ "./adapters": {
52
+ "import": {
53
+ "types": "./dist/adapters/index.d.ts",
54
+ "default": "./dist/adapters/index.js"
55
+ },
56
+ "require": {
57
+ "types": "./dist/adapters/index.d.cts",
58
+ "default": "./dist/adapters/index.cjs"
59
+ }
60
+ },
61
+ "./displays": {
62
+ "import": {
63
+ "types": "./dist/displays/index.d.ts",
64
+ "default": "./dist/displays/index.js"
65
+ },
66
+ "require": {
67
+ "types": "./dist/displays/index.d.cts",
68
+ "default": "./dist/displays/index.cjs"
69
+ }
70
+ },
71
+ "./events": {
72
+ "import": {
73
+ "types": "./dist/events/index.d.ts",
74
+ "default": "./dist/events/index.js"
75
+ },
76
+ "require": {
77
+ "types": "./dist/events/index.d.cts",
78
+ "default": "./dist/events/index.cjs"
79
+ }
80
+ },
81
+ "./evidence": {
82
+ "import": {
83
+ "types": "./dist/evidence/index.d.ts",
84
+ "default": "./dist/evidence/index.js"
85
+ },
86
+ "require": {
87
+ "types": "./dist/evidence/index.d.cts",
88
+ "default": "./dist/evidence/index.cjs"
89
+ }
90
+ },
91
+ "./ids": {
92
+ "import": {
93
+ "types": "./dist/ids/index.d.ts",
94
+ "default": "./dist/ids/index.js"
95
+ },
96
+ "require": {
97
+ "types": "./dist/ids/index.d.cts",
98
+ "default": "./dist/ids/index.cjs"
99
+ }
100
+ },
101
+ "./modules": {
102
+ "import": {
103
+ "types": "./dist/modules/index.d.ts",
104
+ "default": "./dist/modules/index.js"
105
+ },
106
+ "require": {
107
+ "types": "./dist/modules/index.d.cts",
108
+ "default": "./dist/modules/index.cjs"
109
+ }
110
+ },
111
+ "./objects": {
112
+ "import": {
113
+ "types": "./dist/objects/index.d.ts",
114
+ "default": "./dist/objects/index.js"
115
+ },
116
+ "require": {
117
+ "types": "./dist/objects/index.d.cts",
118
+ "default": "./dist/objects/index.cjs"
119
+ }
120
+ },
121
+ "./policies": {
122
+ "import": {
123
+ "types": "./dist/policies/index.d.ts",
124
+ "default": "./dist/policies/index.js"
125
+ },
126
+ "require": {
127
+ "types": "./dist/policies/index.d.cts",
128
+ "default": "./dist/policies/index.cjs"
129
+ }
130
+ },
131
+ "./privacy": {
132
+ "import": {
133
+ "types": "./dist/privacy/index.d.ts",
134
+ "default": "./dist/privacy/index.js"
135
+ },
136
+ "require": {
137
+ "types": "./dist/privacy/index.d.cts",
138
+ "default": "./dist/privacy/index.cjs"
139
+ }
140
+ },
141
+ "./projections": {
142
+ "import": {
143
+ "types": "./dist/projections/index.d.ts",
144
+ "default": "./dist/projections/index.js"
145
+ },
146
+ "require": {
147
+ "types": "./dist/projections/index.d.cts",
148
+ "default": "./dist/projections/index.cjs"
149
+ }
150
+ },
151
+ "./state-machines": {
152
+ "import": {
153
+ "types": "./dist/state-machines/index.d.ts",
154
+ "default": "./dist/state-machines/index.js"
155
+ },
156
+ "require": {
157
+ "types": "./dist/state-machines/index.d.cts",
158
+ "default": "./dist/state-machines/index.cjs"
159
+ }
160
+ },
161
+ "./testing": {
162
+ "import": {
163
+ "types": "./dist/testing/index.d.ts",
164
+ "default": "./dist/testing/index.js"
165
+ },
166
+ "require": {
167
+ "types": "./dist/testing/index.d.cts",
168
+ "default": "./dist/testing/index.cjs"
169
+ }
170
+ }
171
+ },
172
+ "files": [
173
+ "dist",
174
+ "README.md",
175
+ "LICENSE"
176
+ ],
177
+ "scripts": {
178
+ "clean": "rm -rf dist tsconfig.tsbuildinfo",
179
+ "build": "tsup",
180
+ "type-check": "tsc --noEmit",
181
+ "test": "vitest run --passWithNoTests",
182
+ "prepublishOnly": "pnpm clean && pnpm build && pnpm test"
183
+ },
184
+ "dependencies": {},
185
+ "devDependencies": {
186
+ "@types/node": "^22.10.0",
187
+ "tsup": "^8.5.0",
188
+ "typescript": "^5.7.3",
189
+ "vitest": "^4.1.5"
190
+ },
191
+ "engines": {
192
+ "node": ">=20"
193
+ },
194
+ "publishConfig": {
195
+ "access": "public"
196
+ }
197
+ }