@temporal-contract/client 0.0.7 → 0.1.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/README.md +8 -7
- package/dist/index.d.cts +0 -1
- package/dist/index.d.mts +0 -1
- package/package.json +14 -12
package/README.md
CHANGED
|
@@ -13,16 +13,17 @@ pnpm add @temporal-contract/client @temporal-contract/contract @temporalio/clien
|
|
|
13
13
|
## Quick Example
|
|
14
14
|
|
|
15
15
|
```typescript
|
|
16
|
-
import { TypedClient } from
|
|
17
|
-
import { Connection } from
|
|
16
|
+
import { TypedClient } from "@temporal-contract/client";
|
|
17
|
+
import { Connection, Client } from "@temporalio/client";
|
|
18
18
|
|
|
19
|
-
const connection = await Connection.connect({ address:
|
|
20
|
-
const
|
|
19
|
+
const connection = await Connection.connect({ address: "localhost:7233" });
|
|
20
|
+
const temporalClient = new Client({ connection });
|
|
21
|
+
const client = TypedClient.create(myContract, temporalClient);
|
|
21
22
|
|
|
22
23
|
// Execute workflow (fully typed!)
|
|
23
|
-
const result = await client.executeWorkflow(
|
|
24
|
-
workflowId:
|
|
25
|
-
args: { orderId:
|
|
24
|
+
const result = await client.executeWorkflow("processOrder", {
|
|
25
|
+
workflowId: "order-123",
|
|
26
|
+
args: { orderId: "ORD-123" },
|
|
26
27
|
});
|
|
27
28
|
```
|
|
28
29
|
|
package/dist/index.d.cts
CHANGED
|
@@ -4,7 +4,6 @@ import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
|
4
4
|
import { Future, Result } from "@swan-io/boxed";
|
|
5
5
|
|
|
6
6
|
//#region src/types.d.ts
|
|
7
|
-
|
|
8
7
|
/**
|
|
9
8
|
* Infer input type from a definition (client perspective)
|
|
10
9
|
* Client sends the input type (before input schema parsing/transformation)
|
package/dist/index.d.mts
CHANGED
|
@@ -4,7 +4,6 @@ import { ActivityDefinition, AnySchema, ContractDefinition, QueryDefinition, Sig
|
|
|
4
4
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
5
5
|
|
|
6
6
|
//#region src/types.d.ts
|
|
7
|
-
|
|
8
7
|
/**
|
|
9
8
|
* Infer input type from a definition (client perspective)
|
|
10
9
|
* Client sends the input type (before input schema parsing/transformation)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@temporal-contract/client",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Client utilities with Result/Future pattern for consuming temporal-contract workflows",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"client",
|
|
@@ -44,26 +44,28 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@standard-schema/spec": "1.1.0",
|
|
46
46
|
"@swan-io/boxed": "3.2.1",
|
|
47
|
-
"@temporal-contract/contract": "0.0
|
|
47
|
+
"@temporal-contract/contract": "0.1.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@temporalio/client": "1.14.
|
|
51
|
-
"@temporalio/worker": "1.14.
|
|
52
|
-
"@temporalio/workflow": "1.14.
|
|
53
|
-
"@types/node": "25.0.
|
|
54
|
-
"@vitest/coverage-v8": "4.0.
|
|
55
|
-
"tsdown": "0.
|
|
50
|
+
"@temporalio/client": "1.14.1",
|
|
51
|
+
"@temporalio/worker": "1.14.1",
|
|
52
|
+
"@temporalio/workflow": "1.14.1",
|
|
53
|
+
"@types/node": "25.0.9",
|
|
54
|
+
"@vitest/coverage-v8": "4.0.17",
|
|
55
|
+
"tsdown": "0.20.0-beta.4",
|
|
56
56
|
"typescript": "5.9.3",
|
|
57
|
-
"vitest": "4.0.
|
|
58
|
-
"zod": "4.
|
|
59
|
-
"@temporal-contract/testing": "0.0
|
|
60
|
-
"@temporal-contract/tsconfig": "0.0
|
|
57
|
+
"vitest": "4.0.17",
|
|
58
|
+
"zod": "4.3.5",
|
|
59
|
+
"@temporal-contract/testing": "0.1.0",
|
|
60
|
+
"@temporal-contract/tsconfig": "0.1.0",
|
|
61
|
+
"@temporal-contract/typedoc": "0.1.0"
|
|
61
62
|
},
|
|
62
63
|
"peerDependencies": {
|
|
63
64
|
"@temporalio/client": "^1"
|
|
64
65
|
},
|
|
65
66
|
"scripts": {
|
|
66
67
|
"build": "tsdown src/index.ts --format cjs,esm --dts --clean",
|
|
68
|
+
"build:docs": "typedoc",
|
|
67
69
|
"dev": "tsdown src/index.ts --format cjs,esm --dts --watch",
|
|
68
70
|
"test": "vitest run --project unit",
|
|
69
71
|
"test:integration": "vitest run --project integration",
|