@fabricorg/gen-conformance 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/memory.js CHANGED
@@ -1,89 +1,94 @@
1
- // memory.ts
2
1
  import { createModuleRegistry } from "@fabricorg/platform";
3
- import { createGovernedActionHost, digestParameters, MemoryPlatformHostStore } from "@fabricorg/platform-host";
4
- var DEFAULT_SCOPE = {
5
- tenantId: "conformance-tenant",
6
- spaceId: "conformance-space",
7
- actorId: "conformance-actor",
8
- actorType: "natural_person"
2
+ import { MemoryPlatformHostStore, createGovernedActionHost, digestParameters } from "@fabricorg/platform-host";
3
+ //#region memory.ts
4
+ const DEFAULT_SCOPE = {
5
+ tenantId: "conformance-tenant",
6
+ spaceId: "conformance-space",
7
+ actorId: "conformance-actor",
8
+ actorType: "natural_person"
9
9
  };
10
+ /**
11
+ * Reference harness: a governed host over an in-memory store, so a generated suite
12
+ * runs with no database, queue or network. Execution authority is withdrawable so
13
+ * the offline-replay check has something real to be refused by.
14
+ */
10
15
  function createMemoryConformanceHarness(options) {
11
- const scope = { ...DEFAULT_SCOPE, ...options.scope };
12
- const registry = createModuleRegistry(options.modules);
13
- const store = new MemoryPlatformHostStore(options.db);
14
- const revoked = /* @__PURE__ */ new Set();
15
- const host = createGovernedActionHost({
16
- store,
17
- registry,
18
- authorization: {
19
- checkEntitlement: async () => true,
20
- // Capture-time authority always holds; only execution-time authority is withdrawable.
21
- authorize: async () => true,
22
- authorizeExecution: async (input) => !revoked.has(input.actionId)
23
- }
24
- });
25
- const parameters = (actionId) => options.parameters?.[actionId] ?? {};
26
- return {
27
- scope,
28
- parameters,
29
- async submit(input) {
30
- const binding = input.authorizationBinding;
31
- const result = await host.submitAction({
32
- actionId: input.actionId,
33
- parameters: input.parameters,
34
- tenantId: scope.tenantId,
35
- spaceId: scope.spaceId,
36
- actorId: scope.actorId,
37
- actorType: scope.actorType,
38
- ...input.idempotencyKey ? { idempotencyKey: input.idempotencyKey } : {},
39
- ...input.correlationId ? { correlationId: input.correlationId } : {},
40
- ...input.provenance ? { provenance: input.provenance } : {},
41
- ...input.executionReason ? { executionReason: input.executionReason } : {},
42
- ...binding ? {
43
- authorizationBinding: {
44
- id: `conformance-binding-${input.actionId}`,
45
- tenantId: scope.tenantId,
46
- actorId: scope.actorId,
47
- actionId: input.actionId,
48
- parameterDigest: digestParameters(input.parameters),
49
- capturedAt: binding.capturedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
50
- ...binding.expiresAt ? { expiresAt: binding.expiresAt } : {},
51
- governingMoment: binding.governingMoment
52
- }
53
- } : {}
54
- });
55
- return {
56
- actionInvocationId: result.actionInvocationId,
57
- status: result.status,
58
- ...result.reconciliation ? { reconciliation: { kind: result.reconciliation.kind } } : {}
59
- };
60
- },
61
- async events() {
62
- return (await store.listEvents(scope.tenantId, scope.spaceId)).map((event) => ({ ...event }));
63
- },
64
- async revokeAuthority(actionId) {
65
- revoked.add(actionId);
66
- },
67
- async acceptsEnvelope(envelope) {
68
- const consumers = options.modules.flatMap((module) => module.views ?? []).filter((view) => view.consumes.some((consumption) => consumption.eventType === envelope.eventType));
69
- for (const view of consumers) {
70
- try {
71
- await view.applyEvent(view.initialState, envelope);
72
- } catch {
73
- return false;
74
- }
75
- }
76
- return true;
77
- },
78
- async sideEffects(actionId) {
79
- const invocations = await store.listActionInvocations({ tenantId: scope.tenantId, spaceId: scope.spaceId });
80
- const ours = new Set(invocations.filter((invocation) => invocation.actionId === actionId).map((invocation) => invocation.id));
81
- const events = await store.listEvents(scope.tenantId, scope.spaceId);
82
- return events.filter((event) => event.actionInvocationId !== void 0 && ours.has(event.actionInvocationId)).length;
83
- }
84
- };
16
+ const scope = {
17
+ ...DEFAULT_SCOPE,
18
+ ...options.scope
19
+ };
20
+ const registry = createModuleRegistry(options.modules);
21
+ const store = new MemoryPlatformHostStore(options.db);
22
+ const revoked = /* @__PURE__ */ new Set();
23
+ const host = createGovernedActionHost({
24
+ store,
25
+ registry,
26
+ authorization: {
27
+ checkEntitlement: async () => true,
28
+ authorize: async () => true,
29
+ authorizeExecution: async (input) => !revoked.has(input.actionId)
30
+ }
31
+ });
32
+ const parameters = (actionId) => options.parameters?.[actionId] ?? {};
33
+ return {
34
+ scope,
35
+ parameters,
36
+ async submit(input) {
37
+ const binding = input.authorizationBinding;
38
+ const result = await host.submitAction({
39
+ actionId: input.actionId,
40
+ parameters: input.parameters,
41
+ tenantId: scope.tenantId,
42
+ spaceId: scope.spaceId,
43
+ actorId: scope.actorId,
44
+ actorType: scope.actorType,
45
+ ...input.idempotencyKey ? { idempotencyKey: input.idempotencyKey } : {},
46
+ ...input.correlationId ? { correlationId: input.correlationId } : {},
47
+ ...input.provenance ? { provenance: input.provenance } : {},
48
+ ...input.executionReason ? { executionReason: input.executionReason } : {},
49
+ ...binding ? { authorizationBinding: {
50
+ id: `conformance-binding-${input.actionId}`,
51
+ tenantId: scope.tenantId,
52
+ actorId: scope.actorId,
53
+ actionId: input.actionId,
54
+ parameterDigest: digestParameters(input.parameters),
55
+ capturedAt: binding.capturedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
56
+ ...binding.expiresAt ? { expiresAt: binding.expiresAt } : {},
57
+ governingMoment: binding.governingMoment
58
+ } } : {}
59
+ });
60
+ return {
61
+ actionInvocationId: result.actionInvocationId,
62
+ status: result.status,
63
+ ...result.reconciliation ? { reconciliation: { kind: result.reconciliation.kind } } : {}
64
+ };
65
+ },
66
+ async events() {
67
+ return (await store.listEvents(scope.tenantId, scope.spaceId)).map((event) => ({ ...event }));
68
+ },
69
+ async revokeAuthority(actionId) {
70
+ revoked.add(actionId);
71
+ },
72
+ async acceptsEnvelope(envelope) {
73
+ const consumers = options.modules.flatMap((module) => module.views ?? []).filter((view) => view.consumes.some((consumption) => consumption.eventType === envelope.eventType));
74
+ for (const view of consumers) try {
75
+ await view.applyEvent(view.initialState, envelope);
76
+ } catch {
77
+ return false;
78
+ }
79
+ return true;
80
+ },
81
+ async sideEffects(actionId) {
82
+ const invocations = await store.listActionInvocations({
83
+ tenantId: scope.tenantId,
84
+ spaceId: scope.spaceId
85
+ });
86
+ const ours = new Set(invocations.filter((invocation) => invocation.actionId === actionId).map((invocation) => invocation.id));
87
+ return (await store.listEvents(scope.tenantId, scope.spaceId)).filter((event) => event.actionInvocationId !== void 0 && ours.has(event.actionInvocationId)).length;
88
+ }
89
+ };
85
90
  }
86
- export {
87
- createMemoryConformanceHarness
88
- };
91
+ //#endregion
92
+ export { createMemoryConformanceHarness };
93
+
89
94
  //# sourceMappingURL=memory.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../memory.ts"],"sourcesContent":["import { createModuleRegistry, type FabricModule } from \"@fabricorg/platform\";\nimport { createGovernedActionHost, digestParameters, MemoryPlatformHostStore } from \"@fabricorg/platform-host\";\nimport type { ConformanceEventEnvelope, ConformanceHarness, ConformanceScope, ConformanceSubmitInput } from \"./index\";\n\nexport interface MemoryConformanceHarnessOptions<TDb = undefined> {\n\tmodules: FabricModule<TDb>[];\n\t/** Representative parameters per actionId. Actions without an entry receive `{}`. */\n\tparameters?: Record<string, Record<string, unknown>>;\n\tdb?: TDb;\n\tscope?: Partial<ConformanceScope>;\n}\n\nconst DEFAULT_SCOPE: ConformanceScope = {\n\ttenantId: \"conformance-tenant\",\n\tspaceId: \"conformance-space\",\n\tactorId: \"conformance-actor\",\n\tactorType: \"natural_person\",\n};\n\n/**\n * Reference harness: a governed host over an in-memory store, so a generated suite\n * runs with no database, queue or network. Execution authority is withdrawable so\n * the offline-replay check has something real to be refused by.\n */\nexport function createMemoryConformanceHarness<TDb = undefined>(\n\toptions: MemoryConformanceHarnessOptions<TDb>,\n): ConformanceHarness {\n\tconst scope: ConformanceScope = { ...DEFAULT_SCOPE, ...options.scope };\n\tconst registry = createModuleRegistry(options.modules);\n\tconst store = new MemoryPlatformHostStore<TDb>(options.db as TDb);\n\tconst revoked = new Set<string>();\n\tconst host = createGovernedActionHost<TDb>({\n\t\tstore,\n\t\tregistry,\n\t\tauthorization: {\n\t\t\tcheckEntitlement: async () => true,\n\t\t\t// Capture-time authority always holds; only execution-time authority is withdrawable.\n\t\t\tauthorize: async () => true,\n\t\t\tauthorizeExecution: async (input) => !revoked.has(input.actionId),\n\t\t},\n\t});\n\n\tconst parameters = (actionId: string): Record<string, unknown> => options.parameters?.[actionId] ?? {};\n\n\treturn {\n\t\tscope,\n\t\tparameters,\n\t\tasync submit(input: ConformanceSubmitInput) {\n\t\t\tconst binding = input.authorizationBinding;\n\t\t\tconst result = await host.submitAction({\n\t\t\t\tactionId: input.actionId as `${string}.${string}`,\n\t\t\t\tparameters: input.parameters,\n\t\t\t\ttenantId: scope.tenantId,\n\t\t\t\tspaceId: scope.spaceId,\n\t\t\t\tactorId: scope.actorId,\n\t\t\t\tactorType: scope.actorType as \"natural_person\",\n\t\t\t\t...(input.idempotencyKey ? { idempotencyKey: input.idempotencyKey } : {}),\n\t\t\t\t...(input.correlationId ? { correlationId: input.correlationId } : {}),\n\t\t\t\t...(input.provenance ? { provenance: input.provenance as never } : {}),\n\t\t\t\t...(input.executionReason ? { executionReason: input.executionReason } : {}),\n\t\t\t\t...(binding\n\t\t\t\t\t? {\n\t\t\t\t\t\tauthorizationBinding: {\n\t\t\t\t\t\t\tid: `conformance-binding-${input.actionId}`,\n\t\t\t\t\t\t\ttenantId: scope.tenantId,\n\t\t\t\t\t\t\tactorId: scope.actorId,\n\t\t\t\t\t\t\tactionId: input.actionId,\n\t\t\t\t\t\t\tparameterDigest: digestParameters(input.parameters),\n\t\t\t\t\t\t\tcapturedAt: binding.capturedAt ?? new Date().toISOString(),\n\t\t\t\t\t\t\t...(binding.expiresAt ? { expiresAt: binding.expiresAt } : {}),\n\t\t\t\t\t\t\tgoverningMoment: binding.governingMoment,\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t\t: {}),\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tactionInvocationId: result.actionInvocationId,\n\t\t\t\tstatus: result.status,\n\t\t\t\t...(result.reconciliation ? { reconciliation: { kind: result.reconciliation.kind } } : {}),\n\t\t\t};\n\t\t},\n\t\tasync events() {\n\t\t\t// Widen the known envelope into the tolerant shape the contract describes:\n\t\t\t// a conformance consumer must cope with fields it does not recognise.\n\t\t\treturn (await store.listEvents(scope.tenantId, scope.spaceId)).map((event) => ({ ...event }) as ConformanceEventEnvelope);\n\t\t},\n\t\tasync revokeAuthority(actionId: string) {\n\t\t\trevoked.add(actionId);\n\t\t},\n\t\tasync acceptsEnvelope(envelope: ConformanceEventEnvelope) {\n\t\t\t// A view reducer is a real consumer: fold the envelope and see whether it survives.\n\t\t\tconst consumers = options.modules.flatMap((module) => module.views ?? [])\n\t\t\t\t.filter((view) => view.consumes.some((consumption) => consumption.eventType === envelope.eventType));\n\t\t\tfor (const view of consumers) {\n\t\t\t\ttry {\n\t\t\t\t\tawait view.applyEvent(view.initialState as never, envelope as never);\n\t\t\t\t} catch {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\t\tasync sideEffects(actionId: string) {\n\t\t\t// Events are the observable effect of a governed handler running.\n\t\t\tconst invocations = await store.listActionInvocations({ tenantId: scope.tenantId, spaceId: scope.spaceId });\n\t\t\tconst ours = new Set(invocations.filter((invocation) => invocation.actionId === actionId).map((invocation) => invocation.id));\n\t\t\tconst events = await store.listEvents(scope.tenantId, scope.spaceId);\n\t\t\treturn events.filter((event) => event.actionInvocationId !== undefined && ours.has(event.actionInvocationId)).length;\n\t\t},\n\t};\n}\n"],"mappings":";AAAA,SAAS,4BAA+C;AACxD,SAAS,0BAA0B,kBAAkB,+BAA+B;AAWpF,IAAM,gBAAkC;AAAA,EACvC,UAAU;AAAA,EACV,SAAS;AAAA,EACT,SAAS;AAAA,EACT,WAAW;AACZ;AAOO,SAAS,+BACf,SACqB;AACrB,QAAM,QAA0B,EAAE,GAAG,eAAe,GAAG,QAAQ,MAAM;AACrE,QAAM,WAAW,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;AAAA,IAC/G;AAAA,EACD;AACD;","names":[]}
1
+ {"version":3,"file":"memory.js","names":[],"sources":["../memory.ts"],"sourcesContent":["import { createModuleRegistry, type FabricModule } from \"@fabricorg/platform\";\nimport { createGovernedActionHost, digestParameters, MemoryPlatformHostStore } from \"@fabricorg/platform-host\";\nimport type { ConformanceEventEnvelope, ConformanceHarness, ConformanceScope, ConformanceSubmitInput } from \"./index\";\n\nexport interface MemoryConformanceHarnessOptions<TDb = undefined> {\n\tmodules: FabricModule<TDb>[];\n\t/** Representative parameters per actionId. Actions without an entry receive `{}`. */\n\tparameters?: Record<string, Record<string, unknown>>;\n\tdb?: TDb;\n\tscope?: Partial<ConformanceScope>;\n}\n\nconst DEFAULT_SCOPE: ConformanceScope = {\n\ttenantId: \"conformance-tenant\",\n\tspaceId: \"conformance-space\",\n\tactorId: \"conformance-actor\",\n\tactorType: \"natural_person\",\n};\n\n/**\n * Reference harness: a governed host over an in-memory store, so a generated suite\n * runs with no database, queue or network. Execution authority is withdrawable so\n * the offline-replay check has something real to be refused by.\n */\nexport function createMemoryConformanceHarness<TDb = undefined>(\n\toptions: MemoryConformanceHarnessOptions<TDb>,\n): ConformanceHarness {\n\tconst scope: ConformanceScope = { ...DEFAULT_SCOPE, ...options.scope };\n\tconst registry = createModuleRegistry(options.modules);\n\tconst store = new MemoryPlatformHostStore<TDb>(options.db as TDb);\n\tconst revoked = new Set<string>();\n\tconst host = createGovernedActionHost<TDb>({\n\t\tstore,\n\t\tregistry,\n\t\tauthorization: {\n\t\t\tcheckEntitlement: async () => true,\n\t\t\t// Capture-time authority always holds; only execution-time authority is withdrawable.\n\t\t\tauthorize: async () => true,\n\t\t\tauthorizeExecution: async (input) => !revoked.has(input.actionId),\n\t\t},\n\t});\n\n\tconst parameters = (actionId: string): Record<string, unknown> => options.parameters?.[actionId] ?? {};\n\n\treturn {\n\t\tscope,\n\t\tparameters,\n\t\tasync submit(input: ConformanceSubmitInput) {\n\t\t\tconst binding = input.authorizationBinding;\n\t\t\tconst result = await host.submitAction({\n\t\t\t\tactionId: input.actionId as `${string}.${string}`,\n\t\t\t\tparameters: input.parameters,\n\t\t\t\ttenantId: scope.tenantId,\n\t\t\t\tspaceId: scope.spaceId,\n\t\t\t\tactorId: scope.actorId,\n\t\t\t\tactorType: scope.actorType as \"natural_person\",\n\t\t\t\t...(input.idempotencyKey ? { idempotencyKey: input.idempotencyKey } : {}),\n\t\t\t\t...(input.correlationId ? { correlationId: input.correlationId } : {}),\n\t\t\t\t...(input.provenance ? { provenance: input.provenance as never } : {}),\n\t\t\t\t...(input.executionReason ? { executionReason: input.executionReason } : {}),\n\t\t\t\t...(binding\n\t\t\t\t\t? {\n\t\t\t\t\t\tauthorizationBinding: {\n\t\t\t\t\t\t\tid: `conformance-binding-${input.actionId}`,\n\t\t\t\t\t\t\ttenantId: scope.tenantId,\n\t\t\t\t\t\t\tactorId: scope.actorId,\n\t\t\t\t\t\t\tactionId: input.actionId,\n\t\t\t\t\t\t\tparameterDigest: digestParameters(input.parameters),\n\t\t\t\t\t\t\tcapturedAt: binding.capturedAt ?? new Date().toISOString(),\n\t\t\t\t\t\t\t...(binding.expiresAt ? { expiresAt: binding.expiresAt } : {}),\n\t\t\t\t\t\t\tgoverningMoment: binding.governingMoment,\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t\t: {}),\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tactionInvocationId: result.actionInvocationId,\n\t\t\t\tstatus: result.status,\n\t\t\t\t...(result.reconciliation ? { reconciliation: { kind: result.reconciliation.kind } } : {}),\n\t\t\t};\n\t\t},\n\t\tasync events() {\n\t\t\t// Widen the known envelope into the tolerant shape the contract describes:\n\t\t\t// a conformance consumer must cope with fields it does not recognise.\n\t\t\treturn (await store.listEvents(scope.tenantId, scope.spaceId)).map((event) => ({ ...event }) as ConformanceEventEnvelope);\n\t\t},\n\t\tasync revokeAuthority(actionId: string) {\n\t\t\trevoked.add(actionId);\n\t\t},\n\t\tasync acceptsEnvelope(envelope: ConformanceEventEnvelope) {\n\t\t\t// A view reducer is a real consumer: fold the envelope and see whether it survives.\n\t\t\tconst consumers = options.modules.flatMap((module) => module.views ?? [])\n\t\t\t\t.filter((view) => view.consumes.some((consumption) => consumption.eventType === envelope.eventType));\n\t\t\tfor (const view of consumers) {\n\t\t\t\ttry {\n\t\t\t\t\tawait view.applyEvent(view.initialState as never, envelope as never);\n\t\t\t\t} catch {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\t\tasync sideEffects(actionId: string) {\n\t\t\t// Events are the observable effect of a governed handler running.\n\t\t\tconst invocations = await store.listActionInvocations({ tenantId: scope.tenantId, spaceId: scope.spaceId });\n\t\t\tconst ours = new Set(invocations.filter((invocation) => invocation.actionId === actionId).map((invocation) => invocation.id));\n\t\t\tconst events = await store.listEvents(scope.tenantId, scope.spaceId);\n\t\t\treturn events.filter((event) => event.actionInvocationId !== undefined && ours.has(event.actionInvocationId)).length;\n\t\t},\n\t};\n}\n"],"mappings":";;;AAYA,MAAM,gBAAkC;CACvC,UAAU;CACV,SAAS;CACT,SAAS;CACT,WAAW;AACZ;;;;;;AAOA,SAAgB,+BACf,SACqB;CACrB,MAAM,QAA0B;EAAE,GAAG;EAAe,GAAG,QAAQ;CAAM;CACrE,MAAM,WAAW,qBAAqB,QAAQ,OAAO;CACrD,MAAM,QAAQ,IAAI,wBAA6B,QAAQ,EAAS;CAChE,MAAM,0BAAU,IAAI,IAAY;CAChC,MAAM,OAAO,yBAA8B;EAC1C;EACA;EACA,eAAe;GACd,kBAAkB,YAAY;GAE9B,WAAW,YAAY;GACvB,oBAAoB,OAAO,UAAU,CAAC,QAAQ,IAAI,MAAM,QAAQ;EACjE;CACD,CAAC;CAED,MAAM,cAAc,aAA8C,QAAQ,aAAa,aAAa,CAAC;CAErG,OAAO;EACN;EACA;EACA,MAAM,OAAO,OAA+B;GAC3C,MAAM,UAAU,MAAM;GACtB,MAAM,SAA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AM,QAAQ,WAClB,IAAI;IACH,MAAM,KAAK,WAAW,KAAK,cAAuB,QAAiB;GACpE,QAAQ;IACP,OAAO;GACR;GAED,OAAO;EACR;EACA,MAAM,YAAY,UAAkB;GAEnC,MAAM,cAAc,MAAM,MAAM,sBAAsB;IAAE,UAAU,MAAM;IAAU,SAAS,MAAM;GAAQ,CAAC;GAC1G,MAAM,OAAO,IAAI,IAAI,YAAY,QAAQ,eAAe,WAAW,aAAa,QAAQ,CAAC,CAAC,KAAK,eAAe,WAAW,EAAE,CAAC;GAE5H,QAAO,MADc,MAAM,WAAW,MAAM,UAAU,MAAM,OAAO,EAAA,CACrD,QAAQ,UAAU,MAAM,uBAAuB,KAAA,KAAa,KAAK,IAAI,MAAM,kBAAkB,CAAC,CAAC,CAAC;EAC/G;CACD;AACD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fabricorg/gen-conformance",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Deterministic Phase 1 capability conformance plans and certification evidence.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -43,15 +43,16 @@
43
43
  "LICENSE"
44
44
  ],
45
45
  "dependencies": {
46
- "@fabricorg/compiler": "^2.2.8"
46
+ "@fabricorg/compiler": "^2.2.9"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@types/node": "^22.10.0",
50
- "tsup": "^8.5.0",
50
+ "tsdown": "^0.23.1",
51
51
  "typescript": "^5.7.3",
52
52
  "vitest": "^4.1.5",
53
- "@fabricorg/platform": "^1.10.0",
54
- "@fabricorg/platform-host": "^7.6.0"
53
+ "@fabric-platform/bundling": "0.0.0",
54
+ "@fabricorg/platform": "^1.10.1",
55
+ "@fabricorg/platform-host": "^8.0.0"
55
56
  },
56
57
  "engines": {
57
58
  "node": ">=20"
@@ -60,13 +61,13 @@
60
61
  "access": "public"
61
62
  },
62
63
  "peerDependencies": {
63
- "@fabricorg/platform-host": "^7.0.0",
64
- "@fabricorg/platform": "^1.10.0"
64
+ "@fabricorg/platform-host": "^7.0.0 || ^8.0.0",
65
+ "@fabricorg/platform": "^1.10.1"
65
66
  },
66
67
  "scripts": {
67
68
  "clean": "rm -rf dist tsconfig.tsbuildinfo",
68
- "build": "tsup",
69
- "type-check": "tsc --noEmit",
69
+ "build": "tsdown",
70
+ "type-check": "tsgo --noEmit",
70
71
  "test": "vitest run"
71
72
  }
72
73
  }