@temporal-contract/worker 0.0.2 → 0.0.3

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@temporal-contract/worker",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "type": "module",
5
5
  "description": "Worker utilities for implementing temporal-contract workflows and activities",
6
6
  "homepage": "https://github.com/btravers/temporal-contract#readme",
@@ -46,9 +46,12 @@
46
46
  },
47
47
  "./package.json": "./package.json"
48
48
  },
49
+ "files": [
50
+ "dist"
51
+ ],
49
52
  "dependencies": {
50
53
  "@standard-schema/spec": "1.0.0",
51
- "@temporal-contract/contract": "0.0.2"
54
+ "@temporal-contract/contract": "0.0.3"
52
55
  },
53
56
  "devDependencies": {
54
57
  "@temporalio/workflow": "1.13.2",
@@ -58,7 +61,7 @@
58
61
  "typescript": "5.9.3",
59
62
  "vitest": "4.0.15",
60
63
  "zod": "4.1.13",
61
- "@temporal-contract/tsconfig": "0.0.2"
64
+ "@temporal-contract/tsconfig": "0.0.3"
62
65
  },
63
66
  "peerDependencies": {
64
67
  "@temporalio/workflow": ">=1.13.0 <2.0.0"
@@ -1,25 +0,0 @@
1
-
2
- > @temporal-contract/worker@0.0.2 build /home/runner/work/temporal-contract/temporal-contract/packages/worker
3
- > tsdown src/activity.ts src/workflow.ts --format cjs,esm --dts --clean
4
-
5
- ℹ tsdown v0.17.2 powered by rolldown v1.0.0-beta.53
6
- ℹ entry: src/activity.ts, src/workflow.ts
7
- ℹ tsconfig: tsconfig.json
8
- ℹ Build start
9
- ℹ [CJS] dist/workflow.cjs  0.75 kB │ gzip: 0.19 kB
10
- ℹ [CJS] dist/activity.cjs  0.55 kB │ gzip: 0.19 kB
11
- ℹ [CJS] dist/handler-Cc951VQp.cjs 16.80 kB │ gzip: 3.09 kB
12
- ℹ [CJS] 3 files, total: 18.10 kB
13
- ℹ [ESM] dist/workflow.mjs  0.56 kB │ gzip: 0.20 kB
14
- ℹ [ESM] dist/activity.mjs  0.42 kB │ gzip: 0.18 kB
15
- ℹ [ESM] dist/handler-BP9xAycT.mjs 15.01 kB │ gzip: 3.00 kB
16
- ℹ [ESM] dist/workflow.d.mts  0.92 kB │ gzip: 0.27 kB
17
- ℹ [ESM] dist/activity.d.mts  0.67 kB │ gzip: 0.23 kB
18
- ℹ [ESM] dist/errors-DgUMRes-.d.mts 13.22 kB │ gzip: 2.81 kB
19
- ℹ [ESM] 6 files, total: 30.79 kB
20
- ✔ Build complete in 4048ms
21
- ℹ [CJS] dist/workflow.d.cts  0.92 kB │ gzip: 0.27 kB
22
- ℹ [CJS] dist/activity.d.cts  0.67 kB │ gzip: 0.23 kB
23
- ℹ [CJS] dist/errors-B50uht6a.d.cts 13.22 kB │ gzip: 2.81 kB
24
- ℹ [CJS] 3 files, total: 14.80 kB
25
- ✔ Build complete in 4051ms
package/CHANGELOG.md DELETED
@@ -1,9 +0,0 @@
1
- # @temporal-contract/worker
2
-
3
- ## 0.0.2
4
-
5
- ### Patch Changes
6
-
7
- - Release version 0.0.2
8
- - Updated dependencies
9
- - @temporal-contract/contract@0.0.2
package/src/activity.ts DELETED
@@ -1,15 +0,0 @@
1
- // Entry point for activities
2
- export { declareActivitiesHandler } from "./handler.js";
3
- export type {
4
- RawActivityImplementation,
5
- ActivityImplementations,
6
- DeclareActivitiesHandlerOptions,
7
- ActivitiesHandler,
8
- } from "./handler.js";
9
- export {
10
- WorkerError,
11
- ActivityImplementationNotFoundError,
12
- ActivityDefinitionNotFoundError,
13
- ActivityInputValidationError,
14
- ActivityOutputValidationError,
15
- } from "./errors.js";
package/src/errors.ts DELETED
@@ -1,173 +0,0 @@
1
- import type { StandardSchemaV1 } from "@standard-schema/spec";
2
-
3
- /**
4
- * Base error class for worker errors
5
- */
6
- export class WorkerError extends Error {
7
- constructor(message: string) {
8
- super(message);
9
- this.name = "WorkerError";
10
- // Maintains proper stack trace for where our error was thrown (only available on V8)
11
- if (Error.captureStackTrace) {
12
- Error.captureStackTrace(this, this.constructor);
13
- }
14
- }
15
- }
16
-
17
- /**
18
- * Error thrown when an activity implementation is not found
19
- */
20
- export class ActivityImplementationNotFoundError extends WorkerError {
21
- constructor(
22
- public readonly activityName: string,
23
- public readonly availableActivities: readonly string[],
24
- ) {
25
- super(
26
- `Activity implementation not found for: "${activityName}". ` +
27
- `Available activities: ${availableActivities.length > 0 ? availableActivities.join(", ") : "none"}`,
28
- );
29
- this.name = "ActivityImplementationNotFoundError";
30
- }
31
- }
32
-
33
- /**
34
- * Error thrown when an activity definition is not found in the contract
35
- */
36
- export class ActivityDefinitionNotFoundError extends WorkerError {
37
- constructor(
38
- public readonly activityName: string,
39
- public readonly availableDefinitions: readonly string[],
40
- ) {
41
- super(
42
- `Activity definition not found in contract for: "${activityName}". ` +
43
- `Available definitions: ${availableDefinitions.length > 0 ? availableDefinitions.join(", ") : "none"}`,
44
- );
45
- this.name = "ActivityDefinitionNotFoundError";
46
- }
47
- }
48
-
49
- /**
50
- * Error thrown when activity input validation fails
51
- */
52
- export class ActivityInputValidationError extends WorkerError {
53
- constructor(
54
- public readonly activityName: string,
55
- public readonly issues: ReadonlyArray<StandardSchemaV1.Issue>,
56
- ) {
57
- const message = issues.map((issue) => issue.message).join("; ");
58
- super(`Activity "${activityName}" input validation failed: ${message}`);
59
- this.name = "ActivityInputValidationError";
60
- }
61
- }
62
-
63
- /**
64
- * Error thrown when activity output validation fails
65
- */
66
- export class ActivityOutputValidationError extends WorkerError {
67
- constructor(
68
- public readonly activityName: string,
69
- public readonly issues: ReadonlyArray<StandardSchemaV1.Issue>,
70
- ) {
71
- const message = issues.map((issue) => issue.message).join("; ");
72
- super(`Activity "${activityName}" output validation failed: ${message}`);
73
- this.name = "ActivityOutputValidationError";
74
- }
75
- }
76
-
77
- /**
78
- * Error thrown when workflow input validation fails
79
- */
80
- export class WorkflowInputValidationError extends WorkerError {
81
- constructor(
82
- public readonly workflowName: string,
83
- public readonly issues: ReadonlyArray<StandardSchemaV1.Issue>,
84
- ) {
85
- const message = issues.map((issue) => issue.message).join("; ");
86
- super(`Workflow "${workflowName}" input validation failed: ${message}`);
87
- this.name = "WorkflowInputValidationError";
88
- }
89
- }
90
-
91
- /**
92
- * Error thrown when workflow output validation fails
93
- */
94
- export class WorkflowOutputValidationError extends WorkerError {
95
- constructor(
96
- public readonly workflowName: string,
97
- public readonly issues: ReadonlyArray<StandardSchemaV1.Issue>,
98
- ) {
99
- const message = issues.map((issue) => issue.message).join("; ");
100
- super(`Workflow "${workflowName}" output validation failed: ${message}`);
101
- this.name = "WorkflowOutputValidationError";
102
- }
103
- }
104
-
105
- /**
106
- * Error thrown when signal input validation fails
107
- */
108
- export class SignalInputValidationError extends WorkerError {
109
- constructor(
110
- public readonly signalName: string,
111
- public readonly issues: ReadonlyArray<StandardSchemaV1.Issue>,
112
- ) {
113
- const message = issues.map((issue) => issue.message).join("; ");
114
- super(`Signal "${signalName}" input validation failed: ${message}`);
115
- this.name = "SignalInputValidationError";
116
- }
117
- }
118
-
119
- /**
120
- * Error thrown when query input validation fails
121
- */
122
- export class QueryInputValidationError extends WorkerError {
123
- constructor(
124
- public readonly queryName: string,
125
- public readonly issues: ReadonlyArray<StandardSchemaV1.Issue>,
126
- ) {
127
- const message = issues.map((issue) => issue.message).join("; ");
128
- super(`Query "${queryName}" input validation failed: ${message}`);
129
- this.name = "QueryInputValidationError";
130
- }
131
- }
132
-
133
- /**
134
- * Error thrown when query output validation fails
135
- */
136
- export class QueryOutputValidationError extends WorkerError {
137
- constructor(
138
- public readonly queryName: string,
139
- public readonly issues: ReadonlyArray<StandardSchemaV1.Issue>,
140
- ) {
141
- const message = issues.map((issue) => issue.message).join("; ");
142
- super(`Query "${queryName}" output validation failed: ${message}`);
143
- this.name = "QueryOutputValidationError";
144
- }
145
- }
146
-
147
- /**
148
- * Error thrown when update input validation fails
149
- */
150
- export class UpdateInputValidationError extends WorkerError {
151
- constructor(
152
- public readonly updateName: string,
153
- public readonly issues: ReadonlyArray<StandardSchemaV1.Issue>,
154
- ) {
155
- const message = issues.map((issue) => issue.message).join("; ");
156
- super(`Update "${updateName}" input validation failed: ${message}`);
157
- this.name = "UpdateInputValidationError";
158
- }
159
- }
160
-
161
- /**
162
- * Error thrown when update output validation fails
163
- */
164
- export class UpdateOutputValidationError extends WorkerError {
165
- constructor(
166
- public readonly updateName: string,
167
- public readonly issues: ReadonlyArray<StandardSchemaV1.Issue>,
168
- ) {
169
- const message = issues.map((issue) => issue.message).join("; ");
170
- super(`Update "${updateName}" output validation failed: ${message}`);
171
- this.name = "UpdateOutputValidationError";
172
- }
173
- }