@temporal-contract/worker 0.2.0 → 2.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/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@temporal-contract/worker",
3
- "version": "0.2.0",
4
- "description": "Worker utilities with Result/Future pattern for implementing temporal-contract workflows and activities",
3
+ "version": "2.0.0",
4
+ "description": "Worker utilities with neverthrow Result/ResultAsync for implementing temporal-contract workflows and activities",
5
5
  "keywords": [
6
6
  "contract",
7
- "future",
7
+ "neverthrow",
8
8
  "result",
9
9
  "temporal",
10
10
  "typescript",
@@ -14,13 +14,16 @@
14
14
  "bugs": {
15
15
  "url": "https://github.com/btravers/temporal-contract/issues"
16
16
  },
17
+ "license": "MIT",
18
+ "author": "Benoit TRAVERS <benoit.travers.fr@gmail.com>",
17
19
  "repository": {
18
20
  "type": "git",
19
21
  "url": "https://github.com/btravers/temporal-contract.git",
20
22
  "directory": "packages/worker"
21
23
  },
22
- "license": "MIT",
23
- "author": "Benoit TRAVERS <benoit.travers.fr@gmail.com>",
24
+ "files": [
25
+ "dist"
26
+ ],
24
27
  "type": "module",
25
28
  "exports": {
26
29
  "./activity": {
@@ -55,38 +58,34 @@
55
58
  }
56
59
  }
57
60
  },
58
- "main": "./dist/index.cjs",
59
- "module": "./dist/index.mjs",
60
- "types": "./dist/index.d.mts",
61
- "files": [
62
- "dist"
63
- ],
64
61
  "dependencies": {
65
62
  "@standard-schema/spec": "1.1.0",
66
- "@swan-io/boxed": "3.2.1",
67
- "@temporal-contract/boxed": "0.2.0",
68
- "@temporal-contract/contract": "0.2.0"
63
+ "@temporal-contract/contract": "2.0.0"
69
64
  },
70
65
  "devDependencies": {
71
- "@temporalio/client": "1.14.1",
72
- "@temporalio/worker": "1.14.1",
73
- "@temporalio/workflow": "1.14.1",
74
- "@types/node": "25.2.3",
75
- "@vitest/coverage-v8": "4.0.18",
76
- "tsdown": "0.20.3",
77
- "typedoc": "0.28.17",
78
- "typedoc-plugin-markdown": "4.10.0",
79
- "typescript": "5.9.3",
80
- "vitest": "4.0.18",
81
- "zod": "4.3.6",
82
- "@temporal-contract/client": "0.2.0",
83
- "@temporal-contract/testing": "0.2.0",
84
- "@temporal-contract/tsconfig": "0.2.0",
66
+ "@temporalio/client": "1.17.0",
67
+ "@temporalio/common": "1.17.0",
68
+ "@temporalio/worker": "1.17.0",
69
+ "@temporalio/workflow": "1.17.0",
70
+ "@types/node": "24.12.2",
71
+ "@vitest/coverage-v8": "4.1.5",
72
+ "neverthrow": "8.2.0",
73
+ "tsdown": "0.21.10",
74
+ "typedoc": "0.28.19",
75
+ "typedoc-plugin-markdown": "4.11.0",
76
+ "typescript": "6.0.3",
77
+ "vitest": "4.1.5",
78
+ "zod": "4.4.3",
79
+ "@temporal-contract/client": "2.0.0",
80
+ "@temporal-contract/testing": "2.0.0",
81
+ "@temporal-contract/tsconfig": "1.0.0",
85
82
  "@temporal-contract/typedoc": "0.1.0"
86
83
  },
87
84
  "peerDependencies": {
85
+ "@temporalio/common": "^1",
88
86
  "@temporalio/worker": "^1",
89
- "@temporalio/workflow": "^1"
87
+ "@temporalio/workflow": "^1",
88
+ "neverthrow": "^8"
90
89
  },
91
90
  "scripts": {
92
91
  "build": "tsdown src/activity.ts src/worker.ts src/workflow.ts --format cjs,esm --dts --clean",
@@ -1,68 +0,0 @@
1
- import { ActivityDefinition, ContractDefinition } from "@temporal-contract/contract";
2
-
3
- //#region src/activity-utils.d.ts
4
- /**
5
- * Extract activity definitions for a specific workflow from a contract
6
- *
7
- * This includes both:
8
- * - Workflow-specific activities defined under workflow.activities
9
- * - Global activities defined under contract.activities
10
- *
11
- * @param contract - The contract definition
12
- * @param workflowName - The name of the workflow
13
- * @returns Activity definitions for the workflow (workflow-specific + global activities merged)
14
- *
15
- * @example
16
- * ```ts
17
- * const orderWorkflowActivities = getWorkflowActivities(myContract, 'processOrder');
18
- * // Returns: { processPayment: ActivityDef, reserveInventory: ActivityDef, sendEmail: ActivityDef }
19
- * // where sendEmail is a global activity
20
- * ```
21
- */
22
- declare function getWorkflowActivities<TContract extends ContractDefinition, TWorkflowName extends keyof TContract["workflows"]>(contract: TContract, workflowName: TWorkflowName): Record<string, ActivityDefinition>;
23
- /**
24
- * Extract all activity names for a specific workflow from a contract
25
- *
26
- * @param contract - The contract definition
27
- * @param workflowName - The name of the workflow
28
- * @returns Array of activity names (strings) available for the workflow
29
- *
30
- * @example
31
- * ```ts
32
- * const activityNames = getWorkflowActivityNames(myContract, 'processOrder');
33
- * // Returns: ['processPayment', 'reserveInventory', 'sendEmail']
34
- * ```
35
- */
36
- declare function getWorkflowActivityNames<TContract extends ContractDefinition, TWorkflowName extends keyof TContract["workflows"]>(contract: TContract, workflowName: TWorkflowName): string[];
37
- /**
38
- * Check if an activity belongs to a specific workflow
39
- *
40
- * @param contract - The contract definition
41
- * @param workflowName - The name of the workflow
42
- * @param activityName - The name of the activity to check
43
- * @returns True if the activity is available for the workflow, false otherwise
44
- *
45
- * @example
46
- * ```ts
47
- * if (isWorkflowActivity(myContract, 'processOrder', 'processPayment')) {
48
- * // Activity is available for this workflow
49
- * }
50
- * ```
51
- */
52
- declare function isWorkflowActivity<TContract extends ContractDefinition, TWorkflowName extends keyof TContract["workflows"]>(contract: TContract, workflowName: TWorkflowName, activityName: string): boolean;
53
- /**
54
- * Get all workflow names from a contract
55
- *
56
- * @param contract - The contract definition
57
- * @returns Array of workflow names defined in the contract
58
- *
59
- * @example
60
- * ```ts
61
- * const workflows = getWorkflowNames(myContract);
62
- * // Returns: ['processOrder', 'processRefund']
63
- * ```
64
- */
65
- declare function getWorkflowNames<TContract extends ContractDefinition>(contract: TContract): Array<keyof TContract["workflows"]>;
66
- //#endregion
67
- export { isWorkflowActivity as i, getWorkflowActivityNames as n, getWorkflowNames as r, getWorkflowActivities as t };
68
- //# sourceMappingURL=activity-utils-B3vP03_P.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"activity-utils-B3vP03_P.d.mts","names":[],"sources":["../src/activity-utils.ts"],"mappings":";;;;;AAqBA;;;;;;;;;;;;;;;;iBAAgB,qBAAA,mBACI,kBAAA,8BACU,SAAA,cAAA,CAC5B,QAAA,EAAU,SAAA,EAAW,YAAA,EAAc,aAAA,GAAgB,MAAA,SAAe,kBAAA;;;;;;;AA2BpE;;;;;;;iBAAgB,wBAAA,mBACI,kBAAA,8BACU,SAAA,cAAA,CAC5B,QAAA,EAAU,SAAA,EAAW,YAAA,EAAc,aAAA;;;;;;;;;;;;AAoBrC;;;;iBAAgB,kBAAA,mBACI,kBAAA,8BACU,SAAA,cAAA,CAC5B,QAAA,EAAU,SAAA,EAAW,YAAA,EAAc,aAAA,EAAe,YAAA;;;;;;;;;;;;;iBAiBpC,gBAAA,mBAAmC,kBAAA,CAAA,CACjD,QAAA,EAAU,SAAA,GACT,KAAA,OAAY,SAAA"}
@@ -1,68 +0,0 @@
1
- import { ActivityDefinition, ContractDefinition } from "@temporal-contract/contract";
2
-
3
- //#region src/activity-utils.d.ts
4
- /**
5
- * Extract activity definitions for a specific workflow from a contract
6
- *
7
- * This includes both:
8
- * - Workflow-specific activities defined under workflow.activities
9
- * - Global activities defined under contract.activities
10
- *
11
- * @param contract - The contract definition
12
- * @param workflowName - The name of the workflow
13
- * @returns Activity definitions for the workflow (workflow-specific + global activities merged)
14
- *
15
- * @example
16
- * ```ts
17
- * const orderWorkflowActivities = getWorkflowActivities(myContract, 'processOrder');
18
- * // Returns: { processPayment: ActivityDef, reserveInventory: ActivityDef, sendEmail: ActivityDef }
19
- * // where sendEmail is a global activity
20
- * ```
21
- */
22
- declare function getWorkflowActivities<TContract extends ContractDefinition, TWorkflowName extends keyof TContract["workflows"]>(contract: TContract, workflowName: TWorkflowName): Record<string, ActivityDefinition>;
23
- /**
24
- * Extract all activity names for a specific workflow from a contract
25
- *
26
- * @param contract - The contract definition
27
- * @param workflowName - The name of the workflow
28
- * @returns Array of activity names (strings) available for the workflow
29
- *
30
- * @example
31
- * ```ts
32
- * const activityNames = getWorkflowActivityNames(myContract, 'processOrder');
33
- * // Returns: ['processPayment', 'reserveInventory', 'sendEmail']
34
- * ```
35
- */
36
- declare function getWorkflowActivityNames<TContract extends ContractDefinition, TWorkflowName extends keyof TContract["workflows"]>(contract: TContract, workflowName: TWorkflowName): string[];
37
- /**
38
- * Check if an activity belongs to a specific workflow
39
- *
40
- * @param contract - The contract definition
41
- * @param workflowName - The name of the workflow
42
- * @param activityName - The name of the activity to check
43
- * @returns True if the activity is available for the workflow, false otherwise
44
- *
45
- * @example
46
- * ```ts
47
- * if (isWorkflowActivity(myContract, 'processOrder', 'processPayment')) {
48
- * // Activity is available for this workflow
49
- * }
50
- * ```
51
- */
52
- declare function isWorkflowActivity<TContract extends ContractDefinition, TWorkflowName extends keyof TContract["workflows"]>(contract: TContract, workflowName: TWorkflowName, activityName: string): boolean;
53
- /**
54
- * Get all workflow names from a contract
55
- *
56
- * @param contract - The contract definition
57
- * @returns Array of workflow names defined in the contract
58
- *
59
- * @example
60
- * ```ts
61
- * const workflows = getWorkflowNames(myContract);
62
- * // Returns: ['processOrder', 'processRefund']
63
- * ```
64
- */
65
- declare function getWorkflowNames<TContract extends ContractDefinition>(contract: TContract): Array<keyof TContract["workflows"]>;
66
- //#endregion
67
- export { isWorkflowActivity as i, getWorkflowActivityNames as n, getWorkflowNames as r, getWorkflowActivities as t };
68
- //# sourceMappingURL=activity-utils-RsXOceIH.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"activity-utils-RsXOceIH.d.cts","names":[],"sources":["../src/activity-utils.ts"],"mappings":";;;;;AAqBA;;;;;;;;;;;;;;;;iBAAgB,qBAAA,mBACI,kBAAA,8BACU,SAAA,cAAA,CAC5B,QAAA,EAAU,SAAA,EAAW,YAAA,EAAc,aAAA,GAAgB,MAAA,SAAe,kBAAA;;;;;;;AA2BpE;;;;;;;iBAAgB,wBAAA,mBACI,kBAAA,8BACU,SAAA,cAAA,CAC5B,QAAA,EAAU,SAAA,EAAW,YAAA,EAAc,aAAA;;;;;;;;;;;;AAoBrC;;;;iBAAgB,kBAAA,mBACI,kBAAA,8BACU,SAAA,cAAA,CAC5B,QAAA,EAAU,SAAA,EAAW,YAAA,EAAc,aAAA,EAAe,YAAA;;;;;;;;;;;;;iBAiBpC,gBAAA,mBAAmC,kBAAA,CAAA,CACjD,QAAA,EAAU,SAAA,GACT,KAAA,OAAY,SAAA"}
@@ -1,156 +0,0 @@
1
- //#region src/errors.ts
2
- /**
3
- * Base error class for worker errors
4
- */
5
- var WorkerError = class extends Error {
6
- constructor(message, cause) {
7
- super(message, { cause });
8
- this.name = "WorkerError";
9
- if (Error.captureStackTrace) Error.captureStackTrace(this, this.constructor);
10
- }
11
- };
12
- /**
13
- * Error thrown when an activity definition is not found in the contract
14
- */
15
- var ActivityDefinitionNotFoundError = class extends WorkerError {
16
- constructor(activityName, availableDefinitions = []) {
17
- const available = availableDefinitions.length > 0 ? availableDefinitions.join(", ") : "none";
18
- super(`Activity definition not found for: "${activityName}". Available activities: ${available}`);
19
- this.activityName = activityName;
20
- this.availableDefinitions = availableDefinitions;
21
- this.name = "ActivityDefinitionNotFoundError";
22
- }
23
- };
24
- /**
25
- * Error thrown when activity input validation fails
26
- */
27
- var ActivityInputValidationError = class extends WorkerError {
28
- constructor(activityName, issues) {
29
- const message = issues.map((issue) => issue.message).join("; ");
30
- super(`Activity "${activityName}" input validation failed: ${message}`);
31
- this.activityName = activityName;
32
- this.issues = issues;
33
- this.name = "ActivityInputValidationError";
34
- }
35
- };
36
- /**
37
- * Error thrown when activity output validation fails
38
- */
39
- var ActivityOutputValidationError = class extends WorkerError {
40
- constructor(activityName, issues) {
41
- const message = issues.map((issue) => issue.message).join("; ");
42
- super(`Activity "${activityName}" output validation failed: ${message}`);
43
- this.activityName = activityName;
44
- this.issues = issues;
45
- this.name = "ActivityOutputValidationError";
46
- }
47
- };
48
- /**
49
- * Error thrown when workflow input validation fails
50
- */
51
- var WorkflowInputValidationError = class extends WorkerError {
52
- constructor(workflowName, issues) {
53
- const message = issues.map((issue) => issue.message).join("; ");
54
- super(`Workflow "${workflowName}" input validation failed: ${message}`);
55
- this.workflowName = workflowName;
56
- this.issues = issues;
57
- this.name = "WorkflowInputValidationError";
58
- }
59
- };
60
- /**
61
- * Error thrown when workflow output validation fails
62
- */
63
- var WorkflowOutputValidationError = class extends WorkerError {
64
- constructor(workflowName, issues) {
65
- const message = issues.map((issue) => issue.message).join("; ");
66
- super(`Workflow "${workflowName}" output validation failed: ${message}`);
67
- this.workflowName = workflowName;
68
- this.issues = issues;
69
- this.name = "WorkflowOutputValidationError";
70
- }
71
- };
72
- /**
73
- * Error thrown when signal input validation fails
74
- */
75
- var SignalInputValidationError = class extends WorkerError {
76
- constructor(signalName, issues) {
77
- const message = issues.map((issue) => issue.message).join("; ");
78
- super(`Signal "${signalName}" input validation failed: ${message}`);
79
- this.signalName = signalName;
80
- this.issues = issues;
81
- this.name = "SignalInputValidationError";
82
- }
83
- };
84
- /**
85
- * Error thrown when query input validation fails
86
- */
87
- var QueryInputValidationError = class extends WorkerError {
88
- constructor(queryName, issues) {
89
- const message = issues.map((issue) => issue.message).join("; ");
90
- super(`Query "${queryName}" input validation failed: ${message}`);
91
- this.queryName = queryName;
92
- this.issues = issues;
93
- this.name = "QueryInputValidationError";
94
- }
95
- };
96
- /**
97
- * Error thrown when query output validation fails
98
- */
99
- var QueryOutputValidationError = class extends WorkerError {
100
- constructor(queryName, issues) {
101
- const message = issues.map((issue) => issue.message).join("; ");
102
- super(`Query "${queryName}" output validation failed: ${message}`);
103
- this.queryName = queryName;
104
- this.issues = issues;
105
- this.name = "QueryOutputValidationError";
106
- }
107
- };
108
- /**
109
- * Error thrown when update input validation fails
110
- */
111
- var UpdateInputValidationError = class extends WorkerError {
112
- constructor(updateName, issues) {
113
- const message = issues.map((issue) => issue.message).join("; ");
114
- super(`Update "${updateName}" input validation failed: ${message}`);
115
- this.updateName = updateName;
116
- this.issues = issues;
117
- this.name = "UpdateInputValidationError";
118
- }
119
- };
120
- /**
121
- * Error thrown when update output validation fails
122
- */
123
- var UpdateOutputValidationError = class extends WorkerError {
124
- constructor(updateName, issues) {
125
- const message = issues.map((issue) => issue.message).join("; ");
126
- super(`Update "${updateName}" output validation failed: ${message}`);
127
- this.updateName = updateName;
128
- this.issues = issues;
129
- this.name = "UpdateOutputValidationError";
130
- }
131
- };
132
- /**
133
- * Error thrown when a child workflow is not found in the contract
134
- */
135
- var ChildWorkflowNotFoundError = class extends WorkerError {
136
- constructor(workflowName, availableWorkflows = []) {
137
- const available = availableWorkflows.length > 0 ? availableWorkflows.join(", ") : "none";
138
- super(`Child workflow not found: "${workflowName}". Available workflows: ${available}`);
139
- this.workflowName = workflowName;
140
- this.availableWorkflows = availableWorkflows;
141
- this.name = "ChildWorkflowNotFoundError";
142
- }
143
- };
144
- /**
145
- * Generic error for child workflow operations
146
- */
147
- var ChildWorkflowError = class extends WorkerError {
148
- constructor(message, cause) {
149
- super(message, cause);
150
- this.name = "ChildWorkflowError";
151
- }
152
- };
153
-
154
- //#endregion
155
- export { ChildWorkflowNotFoundError as a, SignalInputValidationError as c, WorkflowInputValidationError as d, WorkflowOutputValidationError as f, ChildWorkflowError as i, UpdateInputValidationError as l, ActivityInputValidationError as n, QueryInputValidationError as o, ActivityOutputValidationError as r, QueryOutputValidationError as s, ActivityDefinitionNotFoundError as t, UpdateOutputValidationError as u };
156
- //# sourceMappingURL=errors-Di6Ja4Rt.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors-Di6Ja4Rt.mjs","names":[],"sources":["../src/errors.ts"],"sourcesContent":["import type { StandardSchemaV1 } from \"@standard-schema/spec\";\n\n/**\n * Base error class for worker errors\n */\nabstract class WorkerError extends Error {\n protected constructor(message: string, cause?: unknown) {\n super(message, { cause });\n this.name = \"WorkerError\";\n // Maintains proper stack trace for where our error was thrown (only available on V8)\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n }\n}\n\n/**\n * Error thrown when an activity definition is not found in the contract\n */\nexport class ActivityDefinitionNotFoundError extends WorkerError {\n constructor(\n public readonly activityName: string,\n public readonly availableDefinitions: readonly string[] = [],\n ) {\n const available = availableDefinitions.length > 0 ? availableDefinitions.join(\", \") : \"none\";\n super(\n `Activity definition not found for: \"${activityName}\". Available activities: ${available}`,\n );\n this.name = \"ActivityDefinitionNotFoundError\";\n }\n}\n\n/**\n * Error thrown when activity input validation fails\n */\nexport class ActivityInputValidationError extends WorkerError {\n constructor(\n public readonly activityName: string,\n public readonly issues: ReadonlyArray<StandardSchemaV1.Issue>,\n ) {\n const message = issues.map((issue) => issue.message).join(\"; \");\n super(`Activity \"${activityName}\" input validation failed: ${message}`);\n this.name = \"ActivityInputValidationError\";\n }\n}\n\n/**\n * Error thrown when activity output validation fails\n */\nexport class ActivityOutputValidationError extends WorkerError {\n constructor(\n public readonly activityName: string,\n public readonly issues: ReadonlyArray<StandardSchemaV1.Issue>,\n ) {\n const message = issues.map((issue) => issue.message).join(\"; \");\n super(`Activity \"${activityName}\" output validation failed: ${message}`);\n this.name = \"ActivityOutputValidationError\";\n }\n}\n\n/**\n * Error thrown when workflow input validation fails\n */\nexport class WorkflowInputValidationError extends WorkerError {\n constructor(\n public readonly workflowName: string,\n public readonly issues: ReadonlyArray<StandardSchemaV1.Issue>,\n ) {\n const message = issues.map((issue) => issue.message).join(\"; \");\n super(`Workflow \"${workflowName}\" input validation failed: ${message}`);\n this.name = \"WorkflowInputValidationError\";\n }\n}\n\n/**\n * Error thrown when workflow output validation fails\n */\nexport class WorkflowOutputValidationError extends WorkerError {\n constructor(\n public readonly workflowName: string,\n public readonly issues: ReadonlyArray<StandardSchemaV1.Issue>,\n ) {\n const message = issues.map((issue) => issue.message).join(\"; \");\n super(`Workflow \"${workflowName}\" output validation failed: ${message}`);\n this.name = \"WorkflowOutputValidationError\";\n }\n}\n\n/**\n * Error thrown when signal input validation fails\n */\nexport class SignalInputValidationError extends WorkerError {\n constructor(\n public readonly signalName: string,\n public readonly issues: ReadonlyArray<StandardSchemaV1.Issue>,\n ) {\n const message = issues.map((issue) => issue.message).join(\"; \");\n super(`Signal \"${signalName}\" input validation failed: ${message}`);\n this.name = \"SignalInputValidationError\";\n }\n}\n\n/**\n * Error thrown when query input validation fails\n */\nexport class QueryInputValidationError extends WorkerError {\n constructor(\n public readonly queryName: string,\n public readonly issues: ReadonlyArray<StandardSchemaV1.Issue>,\n ) {\n const message = issues.map((issue) => issue.message).join(\"; \");\n super(`Query \"${queryName}\" input validation failed: ${message}`);\n this.name = \"QueryInputValidationError\";\n }\n}\n\n/**\n * Error thrown when query output validation fails\n */\nexport class QueryOutputValidationError extends WorkerError {\n constructor(\n public readonly queryName: string,\n public readonly issues: ReadonlyArray<StandardSchemaV1.Issue>,\n ) {\n const message = issues.map((issue) => issue.message).join(\"; \");\n super(`Query \"${queryName}\" output validation failed: ${message}`);\n this.name = \"QueryOutputValidationError\";\n }\n}\n\n/**\n * Error thrown when update input validation fails\n */\nexport class UpdateInputValidationError extends WorkerError {\n constructor(\n public readonly updateName: string,\n public readonly issues: ReadonlyArray<StandardSchemaV1.Issue>,\n ) {\n const message = issues.map((issue) => issue.message).join(\"; \");\n super(`Update \"${updateName}\" input validation failed: ${message}`);\n this.name = \"UpdateInputValidationError\";\n }\n}\n\n/**\n * Error thrown when update output validation fails\n */\nexport class UpdateOutputValidationError extends WorkerError {\n constructor(\n public readonly updateName: string,\n public readonly issues: ReadonlyArray<StandardSchemaV1.Issue>,\n ) {\n const message = issues.map((issue) => issue.message).join(\"; \");\n super(`Update \"${updateName}\" output validation failed: ${message}`);\n this.name = \"UpdateOutputValidationError\";\n }\n}\n\n/**\n * Error thrown when a child workflow is not found in the contract\n */\nexport class ChildWorkflowNotFoundError extends WorkerError {\n constructor(\n public readonly workflowName: string,\n public readonly availableWorkflows: readonly string[] = [],\n ) {\n const available = availableWorkflows.length > 0 ? availableWorkflows.join(\", \") : \"none\";\n super(`Child workflow not found: \"${workflowName}\". Available workflows: ${available}`);\n this.name = \"ChildWorkflowNotFoundError\";\n }\n}\n\n/**\n * Generic error for child workflow operations\n */\nexport class ChildWorkflowError extends WorkerError {\n constructor(message: string, cause?: unknown) {\n super(message, cause);\n this.name = \"ChildWorkflowError\";\n }\n}\n"],"mappings":"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"}
@@ -1,227 +0,0 @@
1
-
2
- //#region src/errors.ts
3
- /**
4
- * Base error class for worker errors
5
- */
6
- var WorkerError = class extends Error {
7
- constructor(message, cause) {
8
- super(message, { cause });
9
- this.name = "WorkerError";
10
- if (Error.captureStackTrace) Error.captureStackTrace(this, this.constructor);
11
- }
12
- };
13
- /**
14
- * Error thrown when an activity definition is not found in the contract
15
- */
16
- var ActivityDefinitionNotFoundError = class extends WorkerError {
17
- constructor(activityName, availableDefinitions = []) {
18
- const available = availableDefinitions.length > 0 ? availableDefinitions.join(", ") : "none";
19
- super(`Activity definition not found for: "${activityName}". Available activities: ${available}`);
20
- this.activityName = activityName;
21
- this.availableDefinitions = availableDefinitions;
22
- this.name = "ActivityDefinitionNotFoundError";
23
- }
24
- };
25
- /**
26
- * Error thrown when activity input validation fails
27
- */
28
- var ActivityInputValidationError = class extends WorkerError {
29
- constructor(activityName, issues) {
30
- const message = issues.map((issue) => issue.message).join("; ");
31
- super(`Activity "${activityName}" input validation failed: ${message}`);
32
- this.activityName = activityName;
33
- this.issues = issues;
34
- this.name = "ActivityInputValidationError";
35
- }
36
- };
37
- /**
38
- * Error thrown when activity output validation fails
39
- */
40
- var ActivityOutputValidationError = class extends WorkerError {
41
- constructor(activityName, issues) {
42
- const message = issues.map((issue) => issue.message).join("; ");
43
- super(`Activity "${activityName}" output validation failed: ${message}`);
44
- this.activityName = activityName;
45
- this.issues = issues;
46
- this.name = "ActivityOutputValidationError";
47
- }
48
- };
49
- /**
50
- * Error thrown when workflow input validation fails
51
- */
52
- var WorkflowInputValidationError = class extends WorkerError {
53
- constructor(workflowName, issues) {
54
- const message = issues.map((issue) => issue.message).join("; ");
55
- super(`Workflow "${workflowName}" input validation failed: ${message}`);
56
- this.workflowName = workflowName;
57
- this.issues = issues;
58
- this.name = "WorkflowInputValidationError";
59
- }
60
- };
61
- /**
62
- * Error thrown when workflow output validation fails
63
- */
64
- var WorkflowOutputValidationError = class extends WorkerError {
65
- constructor(workflowName, issues) {
66
- const message = issues.map((issue) => issue.message).join("; ");
67
- super(`Workflow "${workflowName}" output validation failed: ${message}`);
68
- this.workflowName = workflowName;
69
- this.issues = issues;
70
- this.name = "WorkflowOutputValidationError";
71
- }
72
- };
73
- /**
74
- * Error thrown when signal input validation fails
75
- */
76
- var SignalInputValidationError = class extends WorkerError {
77
- constructor(signalName, issues) {
78
- const message = issues.map((issue) => issue.message).join("; ");
79
- super(`Signal "${signalName}" input validation failed: ${message}`);
80
- this.signalName = signalName;
81
- this.issues = issues;
82
- this.name = "SignalInputValidationError";
83
- }
84
- };
85
- /**
86
- * Error thrown when query input validation fails
87
- */
88
- var QueryInputValidationError = class extends WorkerError {
89
- constructor(queryName, issues) {
90
- const message = issues.map((issue) => issue.message).join("; ");
91
- super(`Query "${queryName}" input validation failed: ${message}`);
92
- this.queryName = queryName;
93
- this.issues = issues;
94
- this.name = "QueryInputValidationError";
95
- }
96
- };
97
- /**
98
- * Error thrown when query output validation fails
99
- */
100
- var QueryOutputValidationError = class extends WorkerError {
101
- constructor(queryName, issues) {
102
- const message = issues.map((issue) => issue.message).join("; ");
103
- super(`Query "${queryName}" output validation failed: ${message}`);
104
- this.queryName = queryName;
105
- this.issues = issues;
106
- this.name = "QueryOutputValidationError";
107
- }
108
- };
109
- /**
110
- * Error thrown when update input validation fails
111
- */
112
- var UpdateInputValidationError = class extends WorkerError {
113
- constructor(updateName, issues) {
114
- const message = issues.map((issue) => issue.message).join("; ");
115
- super(`Update "${updateName}" input validation failed: ${message}`);
116
- this.updateName = updateName;
117
- this.issues = issues;
118
- this.name = "UpdateInputValidationError";
119
- }
120
- };
121
- /**
122
- * Error thrown when update output validation fails
123
- */
124
- var UpdateOutputValidationError = class extends WorkerError {
125
- constructor(updateName, issues) {
126
- const message = issues.map((issue) => issue.message).join("; ");
127
- super(`Update "${updateName}" output validation failed: ${message}`);
128
- this.updateName = updateName;
129
- this.issues = issues;
130
- this.name = "UpdateOutputValidationError";
131
- }
132
- };
133
- /**
134
- * Error thrown when a child workflow is not found in the contract
135
- */
136
- var ChildWorkflowNotFoundError = class extends WorkerError {
137
- constructor(workflowName, availableWorkflows = []) {
138
- const available = availableWorkflows.length > 0 ? availableWorkflows.join(", ") : "none";
139
- super(`Child workflow not found: "${workflowName}". Available workflows: ${available}`);
140
- this.workflowName = workflowName;
141
- this.availableWorkflows = availableWorkflows;
142
- this.name = "ChildWorkflowNotFoundError";
143
- }
144
- };
145
- /**
146
- * Generic error for child workflow operations
147
- */
148
- var ChildWorkflowError = class extends WorkerError {
149
- constructor(message, cause) {
150
- super(message, cause);
151
- this.name = "ChildWorkflowError";
152
- }
153
- };
154
-
155
- //#endregion
156
- Object.defineProperty(exports, 'ActivityDefinitionNotFoundError', {
157
- enumerable: true,
158
- get: function () {
159
- return ActivityDefinitionNotFoundError;
160
- }
161
- });
162
- Object.defineProperty(exports, 'ActivityInputValidationError', {
163
- enumerable: true,
164
- get: function () {
165
- return ActivityInputValidationError;
166
- }
167
- });
168
- Object.defineProperty(exports, 'ActivityOutputValidationError', {
169
- enumerable: true,
170
- get: function () {
171
- return ActivityOutputValidationError;
172
- }
173
- });
174
- Object.defineProperty(exports, 'ChildWorkflowError', {
175
- enumerable: true,
176
- get: function () {
177
- return ChildWorkflowError;
178
- }
179
- });
180
- Object.defineProperty(exports, 'ChildWorkflowNotFoundError', {
181
- enumerable: true,
182
- get: function () {
183
- return ChildWorkflowNotFoundError;
184
- }
185
- });
186
- Object.defineProperty(exports, 'QueryInputValidationError', {
187
- enumerable: true,
188
- get: function () {
189
- return QueryInputValidationError;
190
- }
191
- });
192
- Object.defineProperty(exports, 'QueryOutputValidationError', {
193
- enumerable: true,
194
- get: function () {
195
- return QueryOutputValidationError;
196
- }
197
- });
198
- Object.defineProperty(exports, 'SignalInputValidationError', {
199
- enumerable: true,
200
- get: function () {
201
- return SignalInputValidationError;
202
- }
203
- });
204
- Object.defineProperty(exports, 'UpdateInputValidationError', {
205
- enumerable: true,
206
- get: function () {
207
- return UpdateInputValidationError;
208
- }
209
- });
210
- Object.defineProperty(exports, 'UpdateOutputValidationError', {
211
- enumerable: true,
212
- get: function () {
213
- return UpdateOutputValidationError;
214
- }
215
- });
216
- Object.defineProperty(exports, 'WorkflowInputValidationError', {
217
- enumerable: true,
218
- get: function () {
219
- return WorkflowInputValidationError;
220
- }
221
- });
222
- Object.defineProperty(exports, 'WorkflowOutputValidationError', {
223
- enumerable: true,
224
- get: function () {
225
- return WorkflowOutputValidationError;
226
- }
227
- });