@temporal-contract/worker 0.1.0 → 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.
@@ -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
- });