@restatedev/restatectl 1.2.0-alpha.1
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 +125 -0
- package/lib/index.js +36 -0
- package/package.json +40 -0
- package/src/index.ts +39 -0
- package/tsconfig.json +12 -0
package/README.md
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
[](https://docs.restate.dev)
|
|
2
|
+
[](https://github.com/restatedev/examples)
|
|
3
|
+
[](https://discord.gg/skW3AZ6uGd)
|
|
4
|
+
[](https://twitter.com/intent/follow?screen_name=restatedev)
|
|
5
|
+
|
|
6
|
+
# Restate - Building resilient applications made easy!
|
|
7
|
+
|
|
8
|
+
<p align="center">
|
|
9
|
+
<picture>
|
|
10
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://restate.dev/poster_intro_dark.svg">
|
|
11
|
+
<source media="(prefers-color-scheme: light)" srcset="https://restate.dev/poster_intro_2.svg">
|
|
12
|
+
<img alt="Restate overview" src="https://restate.dev/poster_intro_2.svg" width="500">
|
|
13
|
+
</picture>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
Easily build workflows, event-driven applications, and distributed services in a fault-tolerant manner with durable async/await.
|
|
17
|
+
|
|
18
|
+
[Restate](https://restate.dev) is great at building:
|
|
19
|
+
|
|
20
|
+
* [Lambda Workflows as Code](https://restate.dev/blog/we-replaced-400-lines-of-stepfunctions-asl-with-40-lines-of-typescript-by-making-lambdas-suspendable/)
|
|
21
|
+
* [Transactional RPC Handlers](https://github.com/restatedev/examples/tree/main/end-to-end-applications/typescript/food-ordering)
|
|
22
|
+
* [Event Processing with Kafka](https://restate.dev/blog/restate--kafka-event-driven-apps-where-event-driven-is-an-implementation-detail/)
|
|
23
|
+
* [Much more](https://github.com/restatedev/examples)
|
|
24
|
+
|
|
25
|
+
## Get started with Restate
|
|
26
|
+
|
|
27
|
+
1. π [Check out our quickstart](https://docs.restate.dev/get_started/quickstart) to get up and running with Restate in 2 minutes!
|
|
28
|
+
1. π‘ [The tour of Restate](https://docs.restate.dev/get_started/tour) walks you through all features of Restate.
|
|
29
|
+
|
|
30
|
+
## SDKs
|
|
31
|
+
|
|
32
|
+
Restate supports the following SDKs:
|
|
33
|
+
|
|
34
|
+
* [Typescript](https://github.com/restatedev/sdk-typescript)
|
|
35
|
+
* [Java and Kotlin](https://github.com/restatedev/sdk-java)
|
|
36
|
+
* [Python](https://github.com/restatedev/sdk-python)
|
|
37
|
+
* [Go](https://github.com/restatedev/sdk-go)
|
|
38
|
+
* [Rust](https://github.com/restatedev/sdk-rust)
|
|
39
|
+
|
|
40
|
+
## Install
|
|
41
|
+
|
|
42
|
+
We offer pre-built binaries of the CLI and the server for MacOS and Linux.
|
|
43
|
+
|
|
44
|
+
### Install the server
|
|
45
|
+
|
|
46
|
+
Install via Homebrew:
|
|
47
|
+
```bash
|
|
48
|
+
brew install restatedev/tap/restate-server
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Run via npx:
|
|
52
|
+
```bash
|
|
53
|
+
npx @restatedev/restate-server
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Run via docker:
|
|
57
|
+
```bash
|
|
58
|
+
docker run --rm -it --network=host docker.io/restatedev/restate:latest
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Install the CLI
|
|
62
|
+
|
|
63
|
+
Install via Homebrew:
|
|
64
|
+
```bash
|
|
65
|
+
brew install restatedev/tap/restate
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Install via npm:
|
|
69
|
+
```bash
|
|
70
|
+
npm install --global @restatedev/restate
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Run via npx:
|
|
74
|
+
```bash
|
|
75
|
+
npx @restatedev/restate
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
You can also download the binaries from the [release page](https://github.com/restatedev/restate/releases) or our [download page](https://restate.dev/get-restate/).
|
|
79
|
+
|
|
80
|
+
## Community
|
|
81
|
+
|
|
82
|
+
* π€οΈ [Join our online community](https://discord.gg/skW3AZ6uGd) for help, sharing feedback and talking to the community.
|
|
83
|
+
* π [Check out our documentation](https://docs.restate.dev) to get quickly started!
|
|
84
|
+
* π£ [Follow us on Twitter](https://twitter.com/restatedev) for staying up to date.
|
|
85
|
+
* π [Create a GitHub issue](https://github.com/restatedev/restate/issues) for requesting a new feature or reporting a problem.
|
|
86
|
+
* π [Visit our GitHub org](https://github.com/restatedev) for exploring other repositories.
|
|
87
|
+
|
|
88
|
+
## Core primitives
|
|
89
|
+
|
|
90
|
+
The basic primitives Restate offers to simplify application development are the following:
|
|
91
|
+
|
|
92
|
+
* **Reliable Execution**: user code will always run to completion. Intermediate failures result in re-tries that use the durable execution mechanism to recover partial progress and not duplicate already executed steps.
|
|
93
|
+
* **Suspending User Code**: long-running user code suspends when awaiting on a promise and resume when that promise is resolved.
|
|
94
|
+
* **Reliable Communication**: user code communicates with exactly-once semantics. Restate reliably delivers messages and anchors both sender and receiver in the durable execution to ensure no losses or duplicates can happen.
|
|
95
|
+
* **Durable Timers**: user code can sleep (and suspend) or schedule calls for later.
|
|
96
|
+
* **Isolation**: user code can be keyed, which makes Restate scheduled them to obey single-writer-per-key semantics.
|
|
97
|
+
* **Consistent State**: keyed user code can attach key/value state, which is eagerly pushed into handlers during invocation, and written back upon completion. This is particularly efficient for FaaS deployments (stateful serverless, yay!).
|
|
98
|
+
* **Observability & Introspection**: Restate automatically generates Open Telemetry traces for the interactions between handlers and gives you a SQL shell to query the distributed state of the application.
|
|
99
|
+
|
|
100
|
+
## Contributing
|
|
101
|
+
|
|
102
|
+
Weβre excited if you join the Restate community and start contributing!
|
|
103
|
+
Whether it is feature requests, bug reports, ideas & feedback or PRs, we appreciate any and all contributions.
|
|
104
|
+
We know that your time is precious and, therefore, deeply value any effort to contribute!
|
|
105
|
+
|
|
106
|
+
Check out our [development guidelines](/docs/dev/development-guidelines.md) and [tips for local development](/docs/dev/local-development.md) to get started.
|
|
107
|
+
|
|
108
|
+
## Versions
|
|
109
|
+
|
|
110
|
+
Restate follows [Semantic Versioning](https://semver.org/).
|
|
111
|
+
|
|
112
|
+
You can safely upgrade from a Restate `x.y` to `x.(y+1)` release without performing any manual data migration, as Restate performs an automatic data migration for you.
|
|
113
|
+
|
|
114
|
+
For SDK compatibility, refer to the supported version matrix in the respective READMEs:
|
|
115
|
+
|
|
116
|
+
* [Restate Java SDK](https://github.com/restatedev/sdk-java#versions)
|
|
117
|
+
* [Restate TypeScript SDK](https://github.com/restatedev/sdk-typescript#versions)
|
|
118
|
+
* [Restate Go SDK](https://github.com/restatedev/sdk-go#versions)
|
|
119
|
+
* [Restate Python SDK](https://github.com/restatedev/sdk-python#versions)
|
|
120
|
+
* [Restate Rust SDK](https://github.com/restatedev/sdk-rust#versions)
|
|
121
|
+
|
|
122
|
+
### Building Restate locally
|
|
123
|
+
|
|
124
|
+
In order to build Restate locally [follow the build instructions](https://github.com/restatedev/restate/blob/main/docs/dev/local-development.md#building-restate).
|
|
125
|
+
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
/*
|
|
4
|
+
* Copyright (c) 2023 - 2025 Restate Software, Inc., Restate GmbH.
|
|
5
|
+
* All rights reserved.
|
|
6
|
+
*
|
|
7
|
+
* Use of this software is governed by the Business Source License
|
|
8
|
+
* included in the LICENSE file.
|
|
9
|
+
*
|
|
10
|
+
* As of the Change Date specified in that file, in accordance with
|
|
11
|
+
* the Business Source License, use of this software will be governed
|
|
12
|
+
* by the Apache License, Version 2.0.
|
|
13
|
+
*/
|
|
14
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const child_process_1 = require("child_process");
|
|
19
|
+
const node_os_1 = __importDefault(require("node:os"));
|
|
20
|
+
function getExePath() {
|
|
21
|
+
const arch = node_os_1.default.arch();
|
|
22
|
+
const op = node_os_1.default.platform();
|
|
23
|
+
try {
|
|
24
|
+
return require.resolve(`@restatedev/restatectl-${op}-${arch}/bin/restatectl`);
|
|
25
|
+
}
|
|
26
|
+
catch (e) {
|
|
27
|
+
throw new Error(`Couldn't find application binary inside node_modules for ${op}-${arch}`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function run() {
|
|
31
|
+
var _a;
|
|
32
|
+
const args = process.argv.slice(2);
|
|
33
|
+
const processResult = (0, child_process_1.spawnSync)(getExePath(), args, { stdio: "inherit" });
|
|
34
|
+
process.exit((_a = processResult.status) !== null && _a !== void 0 ? _a : 0);
|
|
35
|
+
}
|
|
36
|
+
run();
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@restatedev/restatectl",
|
|
3
|
+
"description": "Restate administration tools",
|
|
4
|
+
"version": "1.2.0-alpha.1",
|
|
5
|
+
"bin": "lib/index.js",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/restatedev/restate.git"
|
|
9
|
+
},
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"@restatedev:registry": "https://registry.npmjs.org"
|
|
12
|
+
},
|
|
13
|
+
"author": "Restate Developers",
|
|
14
|
+
"license": "BSL",
|
|
15
|
+
"email": "code@restate.dev",
|
|
16
|
+
"homepage": "https://github.com/restatedev/restate#readme",
|
|
17
|
+
"scripts": {
|
|
18
|
+
"typecheck": "tsc --noEmit",
|
|
19
|
+
"lint": "eslint .",
|
|
20
|
+
"lint:fix": "eslint . --fix",
|
|
21
|
+
"build": "tsc",
|
|
22
|
+
"dev": "npm run build && node lib/index.js"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@scarf/scarf": "^1.4.0"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@types/node": "^18.11.18",
|
|
29
|
+
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
|
30
|
+
"@typescript-eslint/parser": "^5.48.0",
|
|
31
|
+
"eslint": "^8.31.0",
|
|
32
|
+
"typescript": "^4.9.4"
|
|
33
|
+
},
|
|
34
|
+
"optionalDependencies": {
|
|
35
|
+
"@restatedev/restatectl-linux-x64": "1.2.0-alpha.1",
|
|
36
|
+
"@restatedev/restatectl-linux-arm64": "1.2.0-alpha.1",
|
|
37
|
+
"@restatedev/restatectl-darwin-x64": "1.2.0-alpha.1",
|
|
38
|
+
"@restatedev/restatectl-darwin-arm64": "1.2.0-alpha.1"
|
|
39
|
+
}
|
|
40
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Copyright (c) 2023 - 2025 Restate Software, Inc., Restate GmbH.
|
|
5
|
+
* All rights reserved.
|
|
6
|
+
*
|
|
7
|
+
* Use of this software is governed by the Business Source License
|
|
8
|
+
* included in the LICENSE file.
|
|
9
|
+
*
|
|
10
|
+
* As of the Change Date specified in that file, in accordance with
|
|
11
|
+
* the Business Source License, use of this software will be governed
|
|
12
|
+
* by the Apache License, Version 2.0.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { spawnSync } from "child_process";
|
|
16
|
+
import os from "node:os";
|
|
17
|
+
|
|
18
|
+
function getExePath() {
|
|
19
|
+
const arch = os.arch();
|
|
20
|
+
const op = os.platform();
|
|
21
|
+
|
|
22
|
+
try {
|
|
23
|
+
return require.resolve(
|
|
24
|
+
`@restatedev/restatectl-${op}-${arch}/bin/restatectl`,
|
|
25
|
+
);
|
|
26
|
+
} catch (e) {
|
|
27
|
+
throw new Error(
|
|
28
|
+
`Couldn't find application binary inside node_modules for ${op}-${arch}`,
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function run() {
|
|
34
|
+
const args = process.argv.slice(2);
|
|
35
|
+
const processResult = spawnSync(getExePath(), args, { stdio: "inherit" });
|
|
36
|
+
process.exit(processResult.status ?? 0);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
run();
|
package/tsconfig.json
ADDED