Skip to content

Commit 1eaba7c

Browse files
Update all the READMEs
1 parent b3b4b4b commit 1eaba7c

File tree

5 files changed

+57
-67
lines changed

5 files changed

+57
-67
lines changed

packages/restate-sdk-clients/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ const greeter = rs.serviceClient(Greeter);
2626
const greeting = await greeter.greet(name);
2727
```
2828

29+
To build Restate services using Typescript, checkout the SDK main package https://www.npmjs.com/package/@restatedev/restate-sdk.
30+
2931
## Community
3032

3133
* 🤗️ [Join our online community](https://discord.gg/skW3AZ6uGd) for help, sharing feedback and talking to the community.

packages/restate-sdk-core/README.md

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,13 @@
33
[![Discord](https://img.shields.io/discord/1128210118216007792?logo=discord)](https://discord.gg/skW3AZ6uGd)
44
[![Twitter](https://img.shields.io/twitter/follow/restatedev.svg?style=social&label=Follow)](https://twitter.com/intent/follow?screen_name=restatedev)
55

6-
# Restate Typescript SDK
6+
# Restate Typescript SDK - Core
77

88
[Restate](https://restate.dev/) is a system for easily building resilient applications using *distributed durable async/await*. This repository contains the Restate SDK for writing services in **Node.js / Typescript**.
99

10-
Restate applications are composed of *durably executed, stateful RPC handlers* that can run either
11-
as part of long-running processes, or as FaaS (AWS Lambda).
10+
This package contains the core types used in the several SDK modules.
1211

13-
```typescript
14-
import * as restate from "@restatedev/restate-sdk";
15-
16-
const greeter = restate.service({
17-
name: "greeter",
18-
handlers: {
19-
greet: async (ctx: restate.Context, name: string) => {
20-
return `Hello ${name}!`;
21-
},
22-
},
23-
});
24-
25-
restate.endpoint()
26-
.bind(greeter)
27-
.listen(9080);
28-
```
12+
For the SDK main package, checkout https://www.npmjs.com/package/@restatedev/restate-sdk.
2913

3014
## Community
3115

@@ -53,11 +37,13 @@ This library follows [Semantic Versioning](https://semver.org/).
5337

5438
The compatibility with Restate is described in the following table:
5539

56-
| Restate Server\sdk-typescript | 1.0/1.1/1.2/1.3 | 1.4 | 1.5 |
57-
|-------------------------------|------------------|-----|-----|
58-
| 1.0 ||||
59-
| 1.1 | ✅ <sup>(1)</sup> |||
60-
| 1.2 ||||
61-
| 1.3 ||||
40+
| Restate Server\sdk-typescript | 1.0 - 1.3 | 1.4 | 1.5 - 1.6 | 1.7 |
41+
|-------------------------------|------------------|-----|-----------|------------------|
42+
| 1.0 |||||
43+
| 1.1 | ✅ <sup>(1)</sup> ||||
44+
| 1.2 |||||
45+
| 1.3 |||| ✅ <sup>(2)</sup> |
46+
| 1.4 |||||
6247

63-
<sup>(1)</sup> **Only** when upgrading from 1.0 to 1.1 you MUST rediscover all the existing deployments using `restate dp register <address> --force`. You don't need to update the SDK, nor change the code.
48+
<sup>(1)</sup> **Only** when upgrading from 1.0 to 1.1 you MUST rediscover all the existing deployments using `restate dp register <address> --force`. You don't need to update the SDK, nor change the code.
49+
<sup>(2)</sup> **Note** the new `options` in service/object/workflow constructors, together with some of the new options in the `handler`s too, work only from Restate 1.4 onward. Check the in-code documentation for more details.

packages/restate-sdk-testcontainers/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
[![Discord](https://img.shields.io/discord/1128210118216007792?logo=discord)](https://discord.gg/skW3AZ6uGd)
44
[![Twitter](https://img.shields.io/twitter/follow/restatedev.svg?style=social&label=Follow)](https://twitter.com/intent/follow?screen_name=restatedev)
55

6-
# Restate Typescript SDK Test Containers
6+
# Restate Typescript SDK TestContainers
77

88
[Restate](https://restate.dev/) is a system for easily building resilient applications using *distributed durable async/await*.
99

1010
This package contains utilities to test Restate SDK services against a Restate server container.
11-
An usage example can be found in [`restate-sdk-examples/test/testcontainers.test.ts`](https://github.com/restatedev/sdk-typescript/blob/main/packages/restate-sdk-examples/test/testcontainers.test.ts)
11+
A usage example can be found in [`restate-sdk-examples/test/testcontainers.test.ts`](https://github.com/restatedev/sdk-typescript/blob/main/packages/restate-sdk-examples/test/testcontainers.test.ts)
12+
13+
For the SDK main package, checkout https://www.npmjs.com/package/@restatedev/restate-sdk.
1214

1315
## Community
1416

packages/restate-sdk-zod/README.md

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,43 @@
33
[![Discord](https://img.shields.io/discord/1128210118216007792?logo=discord)](https://discord.gg/skW3AZ6uGd)
44
[![Twitter](https://img.shields.io/twitter/follow/restatedev.svg?style=social&label=Follow)](https://twitter.com/intent/follow?screen_name=restatedev)
55

6-
# Restate Typescript SDK
6+
# Restate Typescript SDK Zod integration
77

8-
[Restate](https://restate.dev/) is a system for easily building resilient applications using *distributed durable async/await*. This repository contains the Restate SDK for writing services in **Node.js / Typescript**.
8+
[Restate](https://restate.dev/) is a system for easily building resilient applications using *distributed durable async/await*.
99

10-
Restate applications are composed of *durably executed, stateful RPC handlers* that can run either
11-
as part of long-running processes, or as FaaS (AWS Lambda).
10+
This package contains a zod integration, allowing to define input/output models of your handlers.
1211

1312
```typescript
1413
import * as restate from "@restatedev/restate-sdk";
14+
import { serde } from "@restatedev/restate-sdk-zod";
15+
import { z } from "zod";
16+
17+
const Greeting = z.object({
18+
name: z.string(),
19+
});
1520

1621
const greeter = restate.service({
17-
name: "greeter",
18-
handlers: {
19-
greet: async (ctx: restate.Context, name: string) => {
20-
return `Hello ${name}!`;
21-
},
22-
},
22+
name: "greeter",
23+
handlers: {
24+
greet: restate.handlers.handler(
25+
{
26+
input: serde.zod(Greeting),
27+
output: serde.zod(z.string()),
28+
},
29+
async (ctx, greeting) => {
30+
return `Hello ${greeting.name}!`;
31+
}
32+
),
33+
},
2334
});
2435

25-
restate.endpoint()
26-
.bind(greeter)
27-
.listen(9080);
36+
export type Greeter = typeof greeter;
37+
38+
restate.endpoint().bind(greeter).listen();
2839
```
2940

41+
For the SDK main package, checkout https://www.npmjs.com/package/@restatedev/restate-sdk.
42+
3043
## Community
3144

3245
* 🤗️ [Join our online community](https://discord.gg/skW3AZ6uGd) for help, sharing feedback and talking to the community.
@@ -35,29 +48,14 @@ restate.endpoint()
3548
* 🙋 [Create a GitHub issue](https://github.com/restatedev/sdk-typescript/issues) for requesting a new feature or reporting a problem.
3649
* 🏠 [Visit our GitHub org](https://github.com/restatedev) for exploring other repositories.
3750

38-
## Using the SDK
51+
## Using the library
3952

40-
To use this SDK, add the dependency to your project:
41-
```shell
42-
npm install @restatedev/restate-sdk
43-
```
53+
To use this library, add the dependency to your project:
4454

45-
For brand-new projects, we recommend using the [Restate Node Template](https://github.com/restatedev/node-template-generator):
4655
```shell
47-
npx -y @restatedev/create-app@latest
56+
npm install --save-dev @restatedev/restate-sdk-zod
4857
```
4958

5059
## Versions
5160

5261
This library follows [Semantic Versioning](https://semver.org/).
53-
54-
The compatibility with Restate is described in the following table:
55-
56-
| Restate Server\sdk-typescript | 1.0/1.1/1.2/1.3 | 1.4 | 1.5 |
57-
|-------------------------------|------------------|-----|-----|
58-
| 1.0 ||||
59-
| 1.1 | ✅ <sup>(1)</sup> |||
60-
| 1.2 ||||
61-
| 1.3 ||||
62-
63-
<sup>(1)</sup> **Only** when upgrading from 1.0 to 1.1 you MUST rediscover all the existing deployments using `restate dp register <address> --force`. You don't need to update the SDK, nor change the code.

packages/restate-sdk/README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,13 @@ This library follows [Semantic Versioning](https://semver.org/).
5353

5454
The compatibility with Restate is described in the following table:
5555

56-
| Restate Server\sdk-typescript | 1.0/1.1/1.2/1.3 | 1.4 | 1.5 |
57-
|-------------------------------|------------------|-----|-----|
58-
| 1.0 ||||
59-
| 1.1 | ✅ <sup>(1)</sup> |||
60-
| 1.2 ||||
61-
| 1.3 ||||
62-
63-
<sup>(1)</sup> **Only** when upgrading from 1.0 to 1.1 you MUST rediscover all the existing deployments using `restate dp register <address> --force`. You don't need to update the SDK, nor change the code.
56+
| Restate Server\sdk-typescript | 1.0 - 1.3 | 1.4 | 1.5 - 1.6 | 1.7 |
57+
|-------------------------------|------------------|-----|-----------|------------------|
58+
| 1.0 |||||
59+
| 1.1 | ✅ <sup>(1)</sup> ||||
60+
| 1.2 |||||
61+
| 1.3 |||| ✅ <sup>(2)</sup> |
62+
| 1.4 |||||
63+
64+
<sup>(1)</sup> **Only** when upgrading from 1.0 to 1.1 you MUST rediscover all the existing deployments using `restate dp register <address> --force`. You don't need to update the SDK, nor change the code.
65+
<sup>(2)</sup> **Note** the new `options` in service/object/workflow constructors, together with some of the new options in the `handler`s too, work only from Restate 1.4 onward. Check the in-code documentation for more details.

0 commit comments

Comments
 (0)