@@ -25,15 +25,9 @@ const contract = defineContract({
2525 taskQueue: " my-queue" ,
2626 workflows: {
2727 myWorkflow: {
28- input: z .object ({
29- /* ... */
30- }),
31- output: z .object ({
32- /* ... */
33- }),
34- activities: {
35- /* ... */
36- },
28+ input: z .object ({/* ... */ }),
29+ output: z .object ({/* ... */ }),
30+ activities: {/* ... */ },
3731 },
3832 },
3933});
@@ -90,9 +84,7 @@ const contract = defineContract({
9084 success: z .boolean (),
9185 transactionId: z .string (),
9286 }),
93- activities: {
94- /* ... */
95- },
87+ activities: {/* ... */ },
9688 },
9789 },
9890});
@@ -177,9 +169,7 @@ const contract = defineContract({
177169 },
178170 },
179171
180- workflows: {
181- /* ... */
182- },
172+ workflows: {/* ... */ },
183173});
184174```
185175
@@ -287,18 +277,14 @@ const emailActivities = {
287277const ordersContract = defineContract ({
288278 taskQueue: " orders" ,
289279 activities: emailActivities ,
290- workflows: {
291- /* ... */
292- },
280+ workflows: {/* ... */ },
293281});
294282
295283// Contract 2 (reusing activities)
296284const shipmentsContract = defineContract ({
297285 taskQueue: " shipments" ,
298286 activities: emailActivities ,
299- workflows: {
300- /* ... */
301- },
287+ workflows: {/* ... */ },
302288});
303289```
304290
@@ -313,28 +299,18 @@ Define focused contracts for specific domains:
313299const ordersContract = defineContract ({
314300 taskQueue: " orders" ,
315301 workflows: {
316- processOrder: {
317- /* ... */
318- },
319- cancelOrder: {
320- /* ... */
321- },
302+ processOrder: {/* ... */ },
303+ cancelOrder: {/* ... */ },
322304 },
323305});
324306
325307// ❌ Avoid - too broad
326308const everythingContract = defineContract ({
327309 taskQueue: " everything" ,
328310 workflows: {
329- processOrder: {
330- /* ... */
331- },
332- sendEmail: {
333- /* ... */
334- },
335- updateInventory: {
336- /* ... */
337- },
311+ processOrder: {/* ... */ },
312+ sendEmail: {/* ... */ },
313+ updateInventory: {/* ... */ },
338314 // ... 50 more workflows
339315 },
340316});
0 commit comments