@fabricorg/platform-temporal 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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,17 @@
1
+ # Changelog
2
+
3
+ ## 1.0.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Add the separately versioned Temporal binding for governed Platform actions and saga signals.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - Updated dependencies
13
+ - @fabricorg/platform@0.11.0
14
+
15
+ ## 0.1.0
16
+
17
+ - Add governed action activities, stable Temporal identities, saga signals, duplicate-start policy, and worker-version evidence.
package/LICENSE ADDED
@@ -0,0 +1,5 @@
1
+ MIT License
2
+
3
+ Copyright (c) Fabric
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software.
package/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # @fabricorg/platform-temporal
2
+
3
+ Host-side Temporal binding for governed Platform actions. Activities invoke the public governed Host boundary with stable workflow/step idempotency, carry workflow evidence, and map saga/approval messages to signals. Temporal supplies durable orchestration; Platform invocation and event records remain canonical audit evidence. This package does not call handlers or make Platform a workflow authority.
4
+
5
+ `temporalWorkflowStartClient()` adapts the official `@temporalio/client` `WorkflowClient`; all direct Temporal packages in an application must remain on the family-supported version line.
package/dist/index.cjs ADDED
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ assertWorkerVersionEvidence: () => assertWorkerVersionEvidence,
24
+ createGovernedActionActivities: () => createGovernedActionActivities,
25
+ createSagaSignalDispatcher: () => createSagaSignalDispatcher,
26
+ startGovernedWorkflow: () => startGovernedWorkflow,
27
+ temporalInvocationIdentity: () => temporalInvocationIdentity,
28
+ temporalWorkflowStartClient: () => temporalWorkflowStartClient
29
+ });
30
+ module.exports = __toCommonJS(index_exports);
31
+ function temporalInvocationIdentity(input) {
32
+ return { idempotencyKey: `temporal:${input.workflowId}:${input.stepId}`, correlationId: `temporal:${input.workflowId}` };
33
+ }
34
+ function createGovernedActionActivities(invoker) {
35
+ return {
36
+ invokeGovernedAction: async (input) => {
37
+ const identity = temporalInvocationIdentity(input);
38
+ return invoker.invoke({
39
+ actionId: input.actionId,
40
+ parameters: input.parameters,
41
+ tenantId: input.tenantId,
42
+ spaceId: input.spaceId,
43
+ actorId: input.actorId,
44
+ actorType: input.actorType,
45
+ ...identity,
46
+ ...input.parentInvocationId ? { causationId: input.parentInvocationId } : {},
47
+ executionEvidence: { temporalWorkflowId: input.workflowId, temporalRunId: input.runId, temporalStepId: input.stepId }
48
+ });
49
+ }
50
+ };
51
+ }
52
+ function createSagaSignalDispatcher(client) {
53
+ return (workflowId, envelope) => client.signal(workflowId, envelope.signal, envelope);
54
+ }
55
+ function startGovernedWorkflow(client, input) {
56
+ return client.start({ ...input, idConflictPolicy: "use_existing" });
57
+ }
58
+ function temporalWorkflowStartClient(client) {
59
+ return {
60
+ start: ({ workflowType, workflowId, taskQueue, args }) => client.start(workflowType, { workflowId, taskQueue, args, workflowIdConflictPolicy: "USE_EXISTING" })
61
+ };
62
+ }
63
+ function assertWorkerVersionEvidence(value) {
64
+ if (!value.buildId.trim() || !value.deploymentName.trim()) throw new Error("Temporal worker buildId and deploymentName are required for rollover evidence.");
65
+ }
66
+ // Annotate the CommonJS export names for ESM import in node:
67
+ 0 && (module.exports = {
68
+ assertWorkerVersionEvidence,
69
+ createGovernedActionActivities,
70
+ createSagaSignalDispatcher,
71
+ startGovernedWorkflow,
72
+ temporalInvocationIdentity,
73
+ temporalWorkflowStartClient
74
+ });
75
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../index.ts"],"sourcesContent":["import type { ActorType } from \"@fabricorg/platform\";\nimport type { WorkflowClient } from \"@temporalio/client\";\n\n/** Serializable input passed from deterministic workflows to a Platform activity. */\nexport interface GovernedActionActivityInput {\n\tactionId: string;\n\tparameters: Record<string, unknown>;\n\ttenantId: string;\n\tspaceId: string;\n\tactorId: string;\n\tactorType: ActorType;\n\tworkflowId: string;\n\trunId: string;\n\tstepId: string;\n\tparentInvocationId?: string;\n}\n\nexport interface GovernedActionInvoker {\n\tinvoke(input: {\n\t\tactionId: string; parameters: Record<string, unknown>;\n\t\ttenantId: string; spaceId: string; actorId: string; actorType: ActorType;\n\t\tidempotencyKey: string; correlationId: string; causationId?: string;\n\t\texecutionEvidence: { temporalWorkflowId: string; temporalRunId: string; temporalStepId: string };\n\t}): Promise<unknown>;\n}\n\nexport function temporalInvocationIdentity(input: Pick<GovernedActionActivityInput, \"workflowId\" | \"stepId\">) {\n\treturn { idempotencyKey: `temporal:${input.workflowId}:${input.stepId}`, correlationId: `temporal:${input.workflowId}` };\n}\n\n/** Activity implementation. It always enters through the governed Host; handlers are never called directly. */\nexport function createGovernedActionActivities(invoker: GovernedActionInvoker) {\n\treturn {\n\t\tinvokeGovernedAction: async (input: GovernedActionActivityInput) => {\n\t\t\tconst identity = temporalInvocationIdentity(input);\n\t\t\treturn invoker.invoke({\n\t\t\t\tactionId: input.actionId, parameters: input.parameters,\n\t\t\t\ttenantId: input.tenantId, spaceId: input.spaceId,\n\t\t\t\tactorId: input.actorId, actorType: input.actorType,\n\t\t\t\t...identity,\n\t\t\t\t...(input.parentInvocationId ? { causationId: input.parentInvocationId } : {}),\n\t\t\t\texecutionEvidence: { temporalWorkflowId: input.workflowId, temporalRunId: input.runId, temporalStepId: input.stepId },\n\t\t\t});\n\t\t},\n\t};\n}\n\nexport interface SagaSignalEnvelope<T = unknown> { sagaId: string; signal: string; payload: T; actorId: string; receivedAt: string }\nexport interface TemporalSignalClient { signal(workflowId: string, signalName: string, payload: unknown): Promise<void> }\nexport function createSagaSignalDispatcher(client: TemporalSignalClient) {\n\treturn (workflowId: string, envelope: SagaSignalEnvelope) => client.signal(workflowId, envelope.signal, envelope);\n}\n\nexport interface WorkflowStartClient<THandle = unknown> {\n\tstart(input: { workflowType: string; workflowId: string; taskQueue: string; args: unknown[]; idConflictPolicy: \"use_existing\" }): Promise<THandle>;\n}\nexport function startGovernedWorkflow<THandle>(client: WorkflowStartClient<THandle>, input: { workflowType: string; workflowId: string; taskQueue: string; args: unknown[] }) {\n\treturn client.start({ ...input, idConflictPolicy: \"use_existing\" });\n}\n\n/** Adapts the official Temporal TypeScript `WorkflowClient` to the narrow testable binding seam. */\nexport function temporalWorkflowStartClient(client: WorkflowClient): WorkflowStartClient {\n\treturn {\n\t\tstart: ({ workflowType, workflowId, taskQueue, args }) =>\n\t\t\tclient.start(workflowType, { workflowId, taskQueue, args, workflowIdConflictPolicy: \"USE_EXISTING\" }),\n\t};\n}\n\nexport interface WorkerVersionEvidence { buildId: string; deploymentName: string; rampPercent?: number }\nexport function assertWorkerVersionEvidence(value: WorkerVersionEvidence): void {\n\tif (!value.buildId.trim() || !value.deploymentName.trim()) throw new Error(\"Temporal worker buildId and deploymentName are required for rollover evidence.\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA0BO,SAAS,2BAA2B,OAAmE;AAC7G,SAAO,EAAE,gBAAgB,YAAY,MAAM,UAAU,IAAI,MAAM,MAAM,IAAI,eAAe,YAAY,MAAM,UAAU,GAAG;AACxH;AAGO,SAAS,+BAA+B,SAAgC;AAC9E,SAAO;AAAA,IACN,sBAAsB,OAAO,UAAuC;AACnE,YAAM,WAAW,2BAA2B,KAAK;AACjD,aAAO,QAAQ,OAAO;AAAA,QACrB,UAAU,MAAM;AAAA,QAAU,YAAY,MAAM;AAAA,QAC5C,UAAU,MAAM;AAAA,QAAU,SAAS,MAAM;AAAA,QACzC,SAAS,MAAM;AAAA,QAAS,WAAW,MAAM;AAAA,QACzC,GAAG;AAAA,QACH,GAAI,MAAM,qBAAqB,EAAE,aAAa,MAAM,mBAAmB,IAAI,CAAC;AAAA,QAC5E,mBAAmB,EAAE,oBAAoB,MAAM,YAAY,eAAe,MAAM,OAAO,gBAAgB,MAAM,OAAO;AAAA,MACrH,CAAC;AAAA,IACF;AAAA,EACD;AACD;AAIO,SAAS,2BAA2B,QAA8B;AACxE,SAAO,CAAC,YAAoB,aAAiC,OAAO,OAAO,YAAY,SAAS,QAAQ,QAAQ;AACjH;AAKO,SAAS,sBAA+B,QAAsC,OAAyF;AAC7K,SAAO,OAAO,MAAM,EAAE,GAAG,OAAO,kBAAkB,eAAe,CAAC;AACnE;AAGO,SAAS,4BAA4B,QAA6C;AACxF,SAAO;AAAA,IACN,OAAO,CAAC,EAAE,cAAc,YAAY,WAAW,KAAK,MACnD,OAAO,MAAM,cAAc,EAAE,YAAY,WAAW,MAAM,0BAA0B,eAAe,CAAC;AAAA,EACtG;AACD;AAGO,SAAS,4BAA4B,OAAoC;AAC/E,MAAI,CAAC,MAAM,QAAQ,KAAK,KAAK,CAAC,MAAM,eAAe,KAAK,EAAG,OAAM,IAAI,MAAM,gFAAgF;AAC5J;","names":[]}
@@ -0,0 +1,78 @@
1
+ import { ActorType } from '@fabricorg/platform';
2
+ import { WorkflowClient } from '@temporalio/client';
3
+
4
+ /** Serializable input passed from deterministic workflows to a Platform activity. */
5
+ interface GovernedActionActivityInput {
6
+ actionId: string;
7
+ parameters: Record<string, unknown>;
8
+ tenantId: string;
9
+ spaceId: string;
10
+ actorId: string;
11
+ actorType: ActorType;
12
+ workflowId: string;
13
+ runId: string;
14
+ stepId: string;
15
+ parentInvocationId?: string;
16
+ }
17
+ interface GovernedActionInvoker {
18
+ invoke(input: {
19
+ actionId: string;
20
+ parameters: Record<string, unknown>;
21
+ tenantId: string;
22
+ spaceId: string;
23
+ actorId: string;
24
+ actorType: ActorType;
25
+ idempotencyKey: string;
26
+ correlationId: string;
27
+ causationId?: string;
28
+ executionEvidence: {
29
+ temporalWorkflowId: string;
30
+ temporalRunId: string;
31
+ temporalStepId: string;
32
+ };
33
+ }): Promise<unknown>;
34
+ }
35
+ declare function temporalInvocationIdentity(input: Pick<GovernedActionActivityInput, "workflowId" | "stepId">): {
36
+ idempotencyKey: string;
37
+ correlationId: string;
38
+ };
39
+ /** Activity implementation. It always enters through the governed Host; handlers are never called directly. */
40
+ declare function createGovernedActionActivities(invoker: GovernedActionInvoker): {
41
+ invokeGovernedAction: (input: GovernedActionActivityInput) => Promise<unknown>;
42
+ };
43
+ interface SagaSignalEnvelope<T = unknown> {
44
+ sagaId: string;
45
+ signal: string;
46
+ payload: T;
47
+ actorId: string;
48
+ receivedAt: string;
49
+ }
50
+ interface TemporalSignalClient {
51
+ signal(workflowId: string, signalName: string, payload: unknown): Promise<void>;
52
+ }
53
+ declare function createSagaSignalDispatcher(client: TemporalSignalClient): (workflowId: string, envelope: SagaSignalEnvelope) => Promise<void>;
54
+ interface WorkflowStartClient<THandle = unknown> {
55
+ start(input: {
56
+ workflowType: string;
57
+ workflowId: string;
58
+ taskQueue: string;
59
+ args: unknown[];
60
+ idConflictPolicy: "use_existing";
61
+ }): Promise<THandle>;
62
+ }
63
+ declare function startGovernedWorkflow<THandle>(client: WorkflowStartClient<THandle>, input: {
64
+ workflowType: string;
65
+ workflowId: string;
66
+ taskQueue: string;
67
+ args: unknown[];
68
+ }): Promise<THandle>;
69
+ /** Adapts the official Temporal TypeScript `WorkflowClient` to the narrow testable binding seam. */
70
+ declare function temporalWorkflowStartClient(client: WorkflowClient): WorkflowStartClient;
71
+ interface WorkerVersionEvidence {
72
+ buildId: string;
73
+ deploymentName: string;
74
+ rampPercent?: number;
75
+ }
76
+ declare function assertWorkerVersionEvidence(value: WorkerVersionEvidence): void;
77
+
78
+ export { type GovernedActionActivityInput, type GovernedActionInvoker, type SagaSignalEnvelope, type TemporalSignalClient, type WorkerVersionEvidence, type WorkflowStartClient, assertWorkerVersionEvidence, createGovernedActionActivities, createSagaSignalDispatcher, startGovernedWorkflow, temporalInvocationIdentity, temporalWorkflowStartClient };
@@ -0,0 +1,78 @@
1
+ import { ActorType } from '@fabricorg/platform';
2
+ import { WorkflowClient } from '@temporalio/client';
3
+
4
+ /** Serializable input passed from deterministic workflows to a Platform activity. */
5
+ interface GovernedActionActivityInput {
6
+ actionId: string;
7
+ parameters: Record<string, unknown>;
8
+ tenantId: string;
9
+ spaceId: string;
10
+ actorId: string;
11
+ actorType: ActorType;
12
+ workflowId: string;
13
+ runId: string;
14
+ stepId: string;
15
+ parentInvocationId?: string;
16
+ }
17
+ interface GovernedActionInvoker {
18
+ invoke(input: {
19
+ actionId: string;
20
+ parameters: Record<string, unknown>;
21
+ tenantId: string;
22
+ spaceId: string;
23
+ actorId: string;
24
+ actorType: ActorType;
25
+ idempotencyKey: string;
26
+ correlationId: string;
27
+ causationId?: string;
28
+ executionEvidence: {
29
+ temporalWorkflowId: string;
30
+ temporalRunId: string;
31
+ temporalStepId: string;
32
+ };
33
+ }): Promise<unknown>;
34
+ }
35
+ declare function temporalInvocationIdentity(input: Pick<GovernedActionActivityInput, "workflowId" | "stepId">): {
36
+ idempotencyKey: string;
37
+ correlationId: string;
38
+ };
39
+ /** Activity implementation. It always enters through the governed Host; handlers are never called directly. */
40
+ declare function createGovernedActionActivities(invoker: GovernedActionInvoker): {
41
+ invokeGovernedAction: (input: GovernedActionActivityInput) => Promise<unknown>;
42
+ };
43
+ interface SagaSignalEnvelope<T = unknown> {
44
+ sagaId: string;
45
+ signal: string;
46
+ payload: T;
47
+ actorId: string;
48
+ receivedAt: string;
49
+ }
50
+ interface TemporalSignalClient {
51
+ signal(workflowId: string, signalName: string, payload: unknown): Promise<void>;
52
+ }
53
+ declare function createSagaSignalDispatcher(client: TemporalSignalClient): (workflowId: string, envelope: SagaSignalEnvelope) => Promise<void>;
54
+ interface WorkflowStartClient<THandle = unknown> {
55
+ start(input: {
56
+ workflowType: string;
57
+ workflowId: string;
58
+ taskQueue: string;
59
+ args: unknown[];
60
+ idConflictPolicy: "use_existing";
61
+ }): Promise<THandle>;
62
+ }
63
+ declare function startGovernedWorkflow<THandle>(client: WorkflowStartClient<THandle>, input: {
64
+ workflowType: string;
65
+ workflowId: string;
66
+ taskQueue: string;
67
+ args: unknown[];
68
+ }): Promise<THandle>;
69
+ /** Adapts the official Temporal TypeScript `WorkflowClient` to the narrow testable binding seam. */
70
+ declare function temporalWorkflowStartClient(client: WorkflowClient): WorkflowStartClient;
71
+ interface WorkerVersionEvidence {
72
+ buildId: string;
73
+ deploymentName: string;
74
+ rampPercent?: number;
75
+ }
76
+ declare function assertWorkerVersionEvidence(value: WorkerVersionEvidence): void;
77
+
78
+ export { type GovernedActionActivityInput, type GovernedActionInvoker, type SagaSignalEnvelope, type TemporalSignalClient, type WorkerVersionEvidence, type WorkflowStartClient, assertWorkerVersionEvidence, createGovernedActionActivities, createSagaSignalDispatcher, startGovernedWorkflow, temporalInvocationIdentity, temporalWorkflowStartClient };
package/dist/index.js ADDED
@@ -0,0 +1,45 @@
1
+ // index.ts
2
+ function temporalInvocationIdentity(input) {
3
+ return { idempotencyKey: `temporal:${input.workflowId}:${input.stepId}`, correlationId: `temporal:${input.workflowId}` };
4
+ }
5
+ function createGovernedActionActivities(invoker) {
6
+ return {
7
+ invokeGovernedAction: async (input) => {
8
+ const identity = temporalInvocationIdentity(input);
9
+ return invoker.invoke({
10
+ actionId: input.actionId,
11
+ parameters: input.parameters,
12
+ tenantId: input.tenantId,
13
+ spaceId: input.spaceId,
14
+ actorId: input.actorId,
15
+ actorType: input.actorType,
16
+ ...identity,
17
+ ...input.parentInvocationId ? { causationId: input.parentInvocationId } : {},
18
+ executionEvidence: { temporalWorkflowId: input.workflowId, temporalRunId: input.runId, temporalStepId: input.stepId }
19
+ });
20
+ }
21
+ };
22
+ }
23
+ function createSagaSignalDispatcher(client) {
24
+ return (workflowId, envelope) => client.signal(workflowId, envelope.signal, envelope);
25
+ }
26
+ function startGovernedWorkflow(client, input) {
27
+ return client.start({ ...input, idConflictPolicy: "use_existing" });
28
+ }
29
+ function temporalWorkflowStartClient(client) {
30
+ return {
31
+ start: ({ workflowType, workflowId, taskQueue, args }) => client.start(workflowType, { workflowId, taskQueue, args, workflowIdConflictPolicy: "USE_EXISTING" })
32
+ };
33
+ }
34
+ function assertWorkerVersionEvidence(value) {
35
+ if (!value.buildId.trim() || !value.deploymentName.trim()) throw new Error("Temporal worker buildId and deploymentName are required for rollover evidence.");
36
+ }
37
+ export {
38
+ assertWorkerVersionEvidence,
39
+ createGovernedActionActivities,
40
+ createSagaSignalDispatcher,
41
+ startGovernedWorkflow,
42
+ temporalInvocationIdentity,
43
+ temporalWorkflowStartClient
44
+ };
45
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../index.ts"],"sourcesContent":["import type { ActorType } from \"@fabricorg/platform\";\nimport type { WorkflowClient } from \"@temporalio/client\";\n\n/** Serializable input passed from deterministic workflows to a Platform activity. */\nexport interface GovernedActionActivityInput {\n\tactionId: string;\n\tparameters: Record<string, unknown>;\n\ttenantId: string;\n\tspaceId: string;\n\tactorId: string;\n\tactorType: ActorType;\n\tworkflowId: string;\n\trunId: string;\n\tstepId: string;\n\tparentInvocationId?: string;\n}\n\nexport interface GovernedActionInvoker {\n\tinvoke(input: {\n\t\tactionId: string; parameters: Record<string, unknown>;\n\t\ttenantId: string; spaceId: string; actorId: string; actorType: ActorType;\n\t\tidempotencyKey: string; correlationId: string; causationId?: string;\n\t\texecutionEvidence: { temporalWorkflowId: string; temporalRunId: string; temporalStepId: string };\n\t}): Promise<unknown>;\n}\n\nexport function temporalInvocationIdentity(input: Pick<GovernedActionActivityInput, \"workflowId\" | \"stepId\">) {\n\treturn { idempotencyKey: `temporal:${input.workflowId}:${input.stepId}`, correlationId: `temporal:${input.workflowId}` };\n}\n\n/** Activity implementation. It always enters through the governed Host; handlers are never called directly. */\nexport function createGovernedActionActivities(invoker: GovernedActionInvoker) {\n\treturn {\n\t\tinvokeGovernedAction: async (input: GovernedActionActivityInput) => {\n\t\t\tconst identity = temporalInvocationIdentity(input);\n\t\t\treturn invoker.invoke({\n\t\t\t\tactionId: input.actionId, parameters: input.parameters,\n\t\t\t\ttenantId: input.tenantId, spaceId: input.spaceId,\n\t\t\t\tactorId: input.actorId, actorType: input.actorType,\n\t\t\t\t...identity,\n\t\t\t\t...(input.parentInvocationId ? { causationId: input.parentInvocationId } : {}),\n\t\t\t\texecutionEvidence: { temporalWorkflowId: input.workflowId, temporalRunId: input.runId, temporalStepId: input.stepId },\n\t\t\t});\n\t\t},\n\t};\n}\n\nexport interface SagaSignalEnvelope<T = unknown> { sagaId: string; signal: string; payload: T; actorId: string; receivedAt: string }\nexport interface TemporalSignalClient { signal(workflowId: string, signalName: string, payload: unknown): Promise<void> }\nexport function createSagaSignalDispatcher(client: TemporalSignalClient) {\n\treturn (workflowId: string, envelope: SagaSignalEnvelope) => client.signal(workflowId, envelope.signal, envelope);\n}\n\nexport interface WorkflowStartClient<THandle = unknown> {\n\tstart(input: { workflowType: string; workflowId: string; taskQueue: string; args: unknown[]; idConflictPolicy: \"use_existing\" }): Promise<THandle>;\n}\nexport function startGovernedWorkflow<THandle>(client: WorkflowStartClient<THandle>, input: { workflowType: string; workflowId: string; taskQueue: string; args: unknown[] }) {\n\treturn client.start({ ...input, idConflictPolicy: \"use_existing\" });\n}\n\n/** Adapts the official Temporal TypeScript `WorkflowClient` to the narrow testable binding seam. */\nexport function temporalWorkflowStartClient(client: WorkflowClient): WorkflowStartClient {\n\treturn {\n\t\tstart: ({ workflowType, workflowId, taskQueue, args }) =>\n\t\t\tclient.start(workflowType, { workflowId, taskQueue, args, workflowIdConflictPolicy: \"USE_EXISTING\" }),\n\t};\n}\n\nexport interface WorkerVersionEvidence { buildId: string; deploymentName: string; rampPercent?: number }\nexport function assertWorkerVersionEvidence(value: WorkerVersionEvidence): void {\n\tif (!value.buildId.trim() || !value.deploymentName.trim()) throw new Error(\"Temporal worker buildId and deploymentName are required for rollover evidence.\");\n}\n"],"mappings":";AA0BO,SAAS,2BAA2B,OAAmE;AAC7G,SAAO,EAAE,gBAAgB,YAAY,MAAM,UAAU,IAAI,MAAM,MAAM,IAAI,eAAe,YAAY,MAAM,UAAU,GAAG;AACxH;AAGO,SAAS,+BAA+B,SAAgC;AAC9E,SAAO;AAAA,IACN,sBAAsB,OAAO,UAAuC;AACnE,YAAM,WAAW,2BAA2B,KAAK;AACjD,aAAO,QAAQ,OAAO;AAAA,QACrB,UAAU,MAAM;AAAA,QAAU,YAAY,MAAM;AAAA,QAC5C,UAAU,MAAM;AAAA,QAAU,SAAS,MAAM;AAAA,QACzC,SAAS,MAAM;AAAA,QAAS,WAAW,MAAM;AAAA,QACzC,GAAG;AAAA,QACH,GAAI,MAAM,qBAAqB,EAAE,aAAa,MAAM,mBAAmB,IAAI,CAAC;AAAA,QAC5E,mBAAmB,EAAE,oBAAoB,MAAM,YAAY,eAAe,MAAM,OAAO,gBAAgB,MAAM,OAAO;AAAA,MACrH,CAAC;AAAA,IACF;AAAA,EACD;AACD;AAIO,SAAS,2BAA2B,QAA8B;AACxE,SAAO,CAAC,YAAoB,aAAiC,OAAO,OAAO,YAAY,SAAS,QAAQ,QAAQ;AACjH;AAKO,SAAS,sBAA+B,QAAsC,OAAyF;AAC7K,SAAO,OAAO,MAAM,EAAE,GAAG,OAAO,kBAAkB,eAAe,CAAC;AACnE;AAGO,SAAS,4BAA4B,QAA6C;AACxF,SAAO;AAAA,IACN,OAAO,CAAC,EAAE,cAAc,YAAY,WAAW,KAAK,MACnD,OAAO,MAAM,cAAc,EAAE,YAAY,WAAW,MAAM,0BAA0B,eAAe,CAAC;AAAA,EACtG;AACD;AAGO,SAAS,4BAA4B,OAAoC;AAC/E,MAAI,CAAC,MAAM,QAAQ,KAAK,KAAK,CAAC,MAAM,eAAe,KAAK,EAAG,OAAM,IAAI,MAAM,gFAAgF;AAC5J;","names":[]}
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@fabricorg/platform-temporal",
3
+ "version": "1.0.0",
4
+ "description": "Temporal binding contracts for governed Fabric Platform actions and sagas.",
5
+ "type": "module",
6
+ "sideEffects": false,
7
+ "main": "./dist/index.cjs",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": {
12
+ "types": "./dist/index.d.ts",
13
+ "default": "./dist/index.js"
14
+ },
15
+ "require": {
16
+ "types": "./dist/index.d.cts",
17
+ "default": "./dist/index.cjs"
18
+ }
19
+ }
20
+ },
21
+ "files": [
22
+ "dist",
23
+ "README.md",
24
+ "CHANGELOG.md",
25
+ "LICENSE"
26
+ ],
27
+ "peerDependencies": {
28
+ "@fabricorg/platform": "^0.11.0",
29
+ "@temporalio/client": "^1.20.3"
30
+ },
31
+ "devDependencies": {
32
+ "@temporalio/client": "^1.20.3",
33
+ "@types/node": "^22.10.0",
34
+ "tsup": "^8.5.0",
35
+ "typescript": "^5.7.3",
36
+ "vitest": "^4.1.5",
37
+ "@fabricorg/platform": "0.11.0",
38
+ "@fabricorg/platform-host": "2.0.0"
39
+ },
40
+ "engines": {
41
+ "node": ">=20"
42
+ },
43
+ "publishConfig": {
44
+ "access": "public"
45
+ },
46
+ "license": "MIT",
47
+ "peerDependenciesMeta": {
48
+ "@temporalio/client": {
49
+ "optional": true
50
+ }
51
+ },
52
+ "scripts": {
53
+ "build": "tsup",
54
+ "type-check": "tsc --noEmit",
55
+ "test": "vitest run",
56
+ "clean": "rm -rf dist tsconfig.tsbuildinfo"
57
+ }
58
+ }