diff --git a/.changeset/client-standalone-activities.md b/.changeset/pre/client-standalone-activities.md similarity index 100% rename from .changeset/client-standalone-activities.md rename to .changeset/pre/client-standalone-activities.md diff --git a/.changeset/worker-execute-activity.md b/.changeset/pre/worker-execute-activity.md similarity index 100% rename from .changeset/worker-execute-activity.md rename to .changeset/pre/worker-execute-activity.md diff --git a/packages/client/CHANGELOG.md b/packages/client/CHANGELOG.md index d3778689..ec38beff 100644 --- a/packages/client/CHANGELOG.md +++ b/packages/client/CHANGELOG.md @@ -1,5 +1,27 @@ # @temporal-contract/client +## 8.0.0-beta.14 + +### Minor Changes + +- 29c8bc3: Run a contract's global activity as a **standalone activity**, with no workflow around it (Temporal Server ≥ 1.32): + + ```ts + const result = await client.for(pdfContract).executeActivity("renderInvoice", { + activityId: `invoice-${invoiceId}`, + args: { invoiceId }, + }); + ``` + + `ContractClient` gains `startActivity`, `executeActivity` and `getActivityHandle`. The task queue comes from the contract, `args` is validated before the start, and the result is parsed against the output schema. The handle's `result()` decodes the activity's declared errors into typed `ContractError`s and reports the outcomes as first-class errors: `ActivityCancelledError`, `ActivityTerminatedError`, `ActivityTimeoutError`, otherwise `ActivityFailedError`. `describe`, `cancel` and `terminate` err with `ActivityExecutionNotFoundError`, and a duplicate start with `ActivityAlreadyStartedError`. The activity's contract-level `activityOptions` are the call's defaults, and the merged options need a per-attempt and a total bound. New pattern groups: `ACTIVITY_START_PATTERNS`, `ACTIVITY_RESULT_PATTERNS`, `ACTIVITY_EXECUTE_PATTERNS`. + + The worker side needs nothing new: `declareActivitiesHandler` already registers each activity under its name on the contract's queue. + +### Patch Changes + +- Updated dependencies [29c8bc3] + - @temporal-contract/contract@8.0.0-beta.14 + ## 8.0.0-beta.13 ### Patch Changes diff --git a/packages/client/package.json b/packages/client/package.json index d7d3a237..42bc46ac 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@temporal-contract/client", - "version": "8.0.0-beta.13", + "version": "8.0.0-beta.14", "description": "Client utilities with unthrown Result/AsyncResult for consuming temporal-contract workflows", "keywords": [ "client", @@ -70,7 +70,7 @@ "zod": "catalog:" }, "peerDependencies": { - "@temporal-contract/contract": "^8.0.0-beta.13", + "@temporal-contract/contract": "^8.0.0-beta.14", "@temporalio/client": "^1.24.0", "@temporalio/common": "^1.24.0", "unthrown": "^5.11.0" diff --git a/packages/contract/CHANGELOG.md b/packages/contract/CHANGELOG.md index 2cf03370..4e93da71 100644 --- a/packages/contract/CHANGELOG.md +++ b/packages/contract/CHANGELOG.md @@ -1,5 +1,22 @@ # @temporal-contract/contract +## 8.0.0-beta.14 + +### Patch Changes + +- 29c8bc3: Run a contract's global activity as a **standalone activity**, with no workflow around it (Temporal Server ≥ 1.32): + + ```ts + const result = await client.for(pdfContract).executeActivity("renderInvoice", { + activityId: `invoice-${invoiceId}`, + args: { invoiceId }, + }); + ``` + + `ContractClient` gains `startActivity`, `executeActivity` and `getActivityHandle`. The task queue comes from the contract, `args` is validated before the start, and the result is parsed against the output schema. The handle's `result()` decodes the activity's declared errors into typed `ContractError`s and reports the outcomes as first-class errors: `ActivityCancelledError`, `ActivityTerminatedError`, `ActivityTimeoutError`, otherwise `ActivityFailedError`. `describe`, `cancel` and `terminate` err with `ActivityExecutionNotFoundError`, and a duplicate start with `ActivityAlreadyStartedError`. The activity's contract-level `activityOptions` are the call's defaults, and the merged options need a per-attempt and a total bound. New pattern groups: `ACTIVITY_START_PATTERNS`, `ACTIVITY_RESULT_PATTERNS`, `ACTIVITY_EXECUTE_PATTERNS`. + + The worker side needs nothing new: `declareActivitiesHandler` already registers each activity under its name on the contract's queue. + ## 8.0.0-beta.13 No changes in this release. diff --git a/packages/contract/package.json b/packages/contract/package.json index 4c0c84ff..bb6a7f03 100644 --- a/packages/contract/package.json +++ b/packages/contract/package.json @@ -1,6 +1,6 @@ { "name": "@temporal-contract/contract", - "version": "8.0.0-beta.13", + "version": "8.0.0-beta.14", "description": "Contract builder for temporal-contract", "keywords": [ "contract", diff --git a/packages/testing/CHANGELOG.md b/packages/testing/CHANGELOG.md index b8992e32..31d877d2 100644 --- a/packages/testing/CHANGELOG.md +++ b/packages/testing/CHANGELOG.md @@ -1,5 +1,15 @@ # @temporal-contract/testing +## 8.0.0-beta.14 + +### Patch Changes + +- Updated dependencies [29c8bc3] +- Updated dependencies [29c8bc3] + - @temporal-contract/client@8.0.0-beta.14 + - @temporal-contract/contract@8.0.0-beta.14 + - @temporal-contract/worker@8.0.0-beta.14 + ## 8.0.0-beta.13 ### Patch Changes diff --git a/packages/testing/package.json b/packages/testing/package.json index bbc1e50c..99b0a1b6 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -1,6 +1,6 @@ { "name": "@temporal-contract/testing", - "version": "8.0.0-beta.13", + "version": "8.0.0-beta.14", "description": "Temporal testing utilities", "keywords": [ "contract", @@ -88,9 +88,9 @@ "zod": "catalog:" }, "peerDependencies": { - "@temporal-contract/client": "^8.0.0-beta.13", - "@temporal-contract/contract": "^8.0.0-beta.13", - "@temporal-contract/worker": "^8.0.0-beta.13", + "@temporal-contract/client": "^8.0.0-beta.14", + "@temporal-contract/contract": "^8.0.0-beta.14", + "@temporal-contract/worker": "^8.0.0-beta.14", "@temporalio/client": "^1.24.0", "@temporalio/testing": "^1.24.0", "@temporalio/worker": "^1.24.0", diff --git a/packages/worker/CHANGELOG.md b/packages/worker/CHANGELOG.md index 92580c1e..cd6407d2 100644 --- a/packages/worker/CHANGELOG.md +++ b/packages/worker/CHANGELOG.md @@ -1,5 +1,24 @@ # @temporal-contract/worker +## 8.0.0-beta.14 + +### Minor Changes + +- 29c8bc3: `context.executeActivity(contract, activityName, { args, ...options })` calls a global activity of any contract on **that contract's task queue**, typically an activity-only contract served by a dedicated worker pool: + + ```ts + const { url } = await propagateFailure( + context.executeActivity(pdfContract, "renderInvoice", { args: { invoiceId } }), + ); + ``` + + The queue name is written once, on the contract whose worker polls it, instead of in an `activityOptionsByName` entry per calling workflow (#452). The call validates and classifies like `context.activities.X`. Options merge `declareWorkflow`'s `activityOptions` → the activity's contract-level `activityOptions` → the per-call options, and must carry a per-attempt and a total bound. + +### Patch Changes + +- Updated dependencies [29c8bc3] + - @temporal-contract/contract@8.0.0-beta.14 + ## 8.0.0-beta.13 ### Patch Changes diff --git a/packages/worker/package.json b/packages/worker/package.json index 16afb25d..046f7e04 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,6 +1,6 @@ { "name": "@temporal-contract/worker", - "version": "8.0.0-beta.13", + "version": "8.0.0-beta.14", "description": "Worker utilities with unthrown Result/AsyncResult for implementing temporal-contract workflows and activities", "keywords": [ "contract", @@ -80,7 +80,7 @@ "zod": "catalog:" }, "peerDependencies": { - "@temporal-contract/contract": "^8.0.0-beta.13", + "@temporal-contract/contract": "^8.0.0-beta.14", "@temporalio/common": "^1.24.0", "@temporalio/worker": "^1.24.0", "@temporalio/workflow": "^1.24.0",