@resonatehq/sdk 0.3.7 → 0.5.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.
Files changed (55) hide show
  1. package/README.md +24 -130
  2. package/dist/async.d.ts +99 -49
  3. package/dist/async.d.ts.map +1 -1
  4. package/dist/async.js +173 -100
  5. package/dist/async.js.map +1 -1
  6. package/dist/core/execution.d.ts +13 -10
  7. package/dist/core/execution.d.ts.map +1 -1
  8. package/dist/core/execution.js +174 -69
  9. package/dist/core/execution.js.map +1 -1
  10. package/dist/core/future.d.ts +6 -4
  11. package/dist/core/future.d.ts.map +1 -1
  12. package/dist/core/future.js +7 -1
  13. package/dist/core/future.js.map +1 -1
  14. package/dist/core/invocation.d.ts +6 -5
  15. package/dist/core/invocation.d.ts.map +1 -1
  16. package/dist/core/invocation.js +40 -14
  17. package/dist/core/invocation.js.map +1 -1
  18. package/dist/core/options.d.ts +32 -11
  19. package/dist/core/options.d.ts.map +1 -1
  20. package/dist/core/options.js +3 -3
  21. package/dist/core/options.js.map +1 -1
  22. package/dist/core/promises/promises.d.ts +4 -3
  23. package/dist/core/promises/promises.d.ts.map +1 -1
  24. package/dist/core/promises/promises.js +7 -3
  25. package/dist/core/promises/promises.js.map +1 -1
  26. package/dist/core/promises/types.d.ts.map +1 -1
  27. package/dist/core/promises/types.js +2 -5
  28. package/dist/core/promises/types.js.map +1 -1
  29. package/dist/core/schedules/schedules.d.ts +22 -0
  30. package/dist/core/schedules/schedules.d.ts.map +1 -0
  31. package/dist/core/schedules/schedules.js +29 -0
  32. package/dist/core/schedules/schedules.js.map +1 -0
  33. package/dist/core/store.d.ts +5 -2
  34. package/dist/core/store.d.ts.map +1 -1
  35. package/dist/core/stores/local.d.ts +1 -1
  36. package/dist/core/stores/local.d.ts.map +1 -1
  37. package/dist/core/stores/local.js +7 -5
  38. package/dist/core/stores/local.js.map +1 -1
  39. package/dist/core/stores/remote.d.ts +7 -7
  40. package/dist/core/stores/remote.d.ts.map +1 -1
  41. package/dist/core/stores/remote.js +30 -23
  42. package/dist/core/stores/remote.js.map +1 -1
  43. package/dist/generator.d.ts +39 -18
  44. package/dist/generator.d.ts.map +1 -1
  45. package/dist/generator.js +72 -73
  46. package/dist/generator.js.map +1 -1
  47. package/dist/index.d.ts +23 -3
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +38 -6
  50. package/dist/index.js.map +1 -1
  51. package/dist/resonate.d.ts +109 -32
  52. package/dist/resonate.d.ts.map +1 -1
  53. package/dist/resonate.js +144 -60
  54. package/dist/resonate.js.map +1 -1
  55. package/package.json +1 -1
package/README.md CHANGED
@@ -1,10 +1,3 @@
1
- > Resonate is in the **Design Phase**
2
- >
3
- > Our code base is constantly evolving as we are exploring Resonate's programming model. If you are passionate about a dead simple developer experience, join us on this journey of discovery and share your thoughts.
4
- >
5
- > [Join our slack](https://resonatehqcommunity.slack.com)
6
-
7
- <br /><br />
8
1
  <p align="center">
9
2
  <img height="170"src="https://raw.githubusercontent.com/resonatehq/resonate/main/docs/img/echo.png">
10
3
  </p>
@@ -32,147 +25,48 @@
32
25
  <br /><br />
33
26
  </div>
34
27
 
35
- An SDK for writing simple and elegant distributed async await applications.
36
-
37
- ## Why Resonate?
38
- Resonate offers a programming model that allows you to build distributed applications using an intuitive paradigm you already know — async await.
28
+ ## Distributed Async Await
39
29
 
40
- ## What is Distributed Async Await?
30
+ Resonate's Distributed Async Await is a new programming model that simplifies coding for the cloud. It ensures code completion even if hardware or software failures occur during execution. The programming model does this with just functions and promises, making it trivial to build `coordinated` and `reliable` distributed applications.
41
31
 
42
- Distributed Async Await extends the async await programming model beyond the boundaries of a single process and makes distributed computing a first-class citizen.
32
+ ## Why Resonate?
43
33
 
44
- ## Features
34
+ - **Cloud Computing Made Dead Simple**: Resonate simplifies coding for the cloud using an intuitive paradigm you already know — async await.
45
35
 
46
- Available now:
47
- - retries
48
- - recovery
49
- - schedules
50
- - tracing
51
- - logging
52
- - local promise store
53
- - remote promise store
36
+ - **Single Binary**: Resonate simplifies your deployment and operations with a single binary.
54
37
 
55
- Coming soon:
56
- - rate limiting
57
- - metrics
38
+ - **Incremental Adoption and No Vendor Lock-In**: Resonate was designed to allow for incremental adoption without vendor lock-in ever.
58
39
 
59
- Let us know [features](https://github.com/resonatehq/resonate-sdk-ts/issues) you would like Resonate to support.
40
+ - **Built on an Open Standard**: Resonate's programming model is built on top of [durable promises](https://github.com/resonatehq/durable-promise-specification), an open standard with an intentionally minimal API surface area.
60
41
 
61
- ## Install
62
- ```console
63
- npm install -g ts-node
64
- npm install @resonatehq/sdk
65
- npm install express @types/express
66
- ```
42
+ ## Getting Started
67
43
 
68
- ## What's New
44
+ 1. [Start building in just 30 seconds](https://docs.resonatehq.io/getting-started/quickstart) with our quickstart guide!
45
+ 2. [Explore in-depth code examples](https://github.com/resonatehq/quickstart-ts/tree/main) and get your hands dirty with our comprehensive repository.
46
+ 3. [Dive into the TypeScript SDK docs](https://docs.resonatehq.io/sdks/typescript) and learn how to leverage its full potential with our detailed documentation.
47
+ 4. [Explore the API reference](https://resonatehq.github.io/resonate-sdk-ts/index.html) of Resonate's TypeScript SDK.
48
+ 5. [Grasp the 4 core concepts](https://docs.resonatehq.io/getting-started/concepts) of distributed async/await applications by delving into our concepts page.
49
+
50
+ ## Core features
69
51
 
70
- Schedules! You can now invoke a function on a recurring schedule. Please note, this feature is experimental and bugs are expected. If encountered please [let us know](https://github.com/resonatehq/resonate-sdk-ts/issues/new).
52
+ The basic features Resonate offers to simplify the reliability and coordination of distributed processes are the following:
71
53
 
72
- ```ts
73
- import { Resonate, Context } from "@resonatehq/sdk";
54
+ - **Retries**: If a process fails while executing a durable promise due to a transient issue, such as network connectivity problems, it can be transparently retried, minimizing the impact of temporary failures.
74
55
 
75
- const resonate = new Resonate();
56
+ - **Recoverability**: If a process crashes while executing a durable promise, it can recover and continue from where it left off, ensuring your application remains resilient.
76
57
 
77
- resonate.schedule("everyMinute", "* * * * *", (ctx: Context) => {
78
- console.log("every minute", Date.now());
79
- });
58
+ - **Schedules**: Durable promises can be used to schedule statefule reminders using a simple HTTP/gRPC call.
80
59
 
81
- resonate.schedule("everyHour", "0 * * * *", (ctx: Context) => {
82
- console.log("every hour", Date.now());
83
- });
60
+ - **Task Framework**: Durable promises allow you to fan out tasks across multiple processes or machines, enabling parallel execution and load balancing, making your application more scalable.
84
61
 
85
- resonate.start();
86
- ```
62
+ - **Notifications**: When a durable promise is created or completed, it can trigger notifications to other processes or services that are interested in the result, enabling efficient communication and coordination.
87
63
 
88
- ## Getting Started
89
- ```ts
90
- import { Resonate, Context } from "@resonatehq/sdk";
91
- import express, { Request, Response } from "express";
92
-
93
- type User = {
94
- id: number;
95
- };
96
-
97
- type Song = {
98
- id: number;
99
- price: number;
100
- };
101
-
102
- type Status = {
103
- charged: boolean;
104
- granted: boolean;
105
- };
106
-
107
- async function purchase(ctx: Context, user: User, song: Song): Promise<Status> {
108
- const charged = await ctx.run(charge, user, song);
109
- const granted = await ctx.run(access, user, song);
110
-
111
- return { charged, granted };
112
- }
113
-
114
- async function charge(ctx: Context, user: User, song: Song): Promise<boolean> {
115
- console.log(`Charged user:${user.id} $${song.price}.`);
116
- return true;
117
- }
118
-
119
- async function access(ctx: Context, user: User, song: Song): Promise<boolean> {
120
- console.log(`Granted user:${user.id} access to song:${song.id}.`);
121
- return true;
122
- }
123
-
124
- // Initialize Resonate app
125
- const resonate = new Resonate();
126
- resonate.register("purchase", purchase);
127
-
128
- // Initialize Express app
129
- const app = express();
130
- app.use(express.json())
131
-
132
- app.post("/purchase", async (req: Request, res: Response) => {
133
- const user = { id: req.body?.user ?? 1 };
134
- const song = { id: req.body?.song ?? 1, price: 1.99 };
135
-
136
- // id uniquely identifies the purchase
137
- const id = `purchase-${user.id}-${song.id}`;
138
-
139
- try {
140
- res.send(await resonate.run("purchase", id, user, song));
141
- } catch (err) {
142
- res.status(500).send("Could not purchase song");
143
- }
144
- });
145
-
146
- app.listen(3000, () => {
147
- console.log("Listening on port 3000");
148
- });
149
- ```
150
-
151
- Start the server.
152
- ```console
153
- ts-node app.ts
154
- ```
155
-
156
- And call the endpoint providing a user and song id.
157
- ```console
158
- curl \
159
- -X POST \
160
- -H 'Content-Type: application/json' \
161
- -d '{"user": 1, "song": 1}' \
162
- http://localhost:3000/purchase
163
- ```
164
-
165
- See our [docs](https://docs.resonatehq.io) for more detailed information.
166
-
167
- ## Development
168
- ```console
169
- npm install
170
- npm run lint
171
- npm test
172
- ```
64
+ - **Human in the Loop**: Durable promises can seamlessly integrate human input into your automated workflows, allowing for manual intervention or approval steps when needed.
173
65
 
174
66
  ## Contributing
67
+
175
68
  See our [contribution guidelines](CONTRIBUTING.md).
176
69
 
177
70
  ## License
71
+
178
72
  The Resonate TypeScript SDK is available under the [Apache 2.0 License](LICENSE).
package/dist/async.d.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  import { ResonatePromise } from "./core/future";
2
2
  import { Invocation } from "./core/invocation";
3
3
  import { ResonateOptions, Options, PartialOptions } from "./core/options";
4
+ import { DurablePromise } from "./core/promises/promises";
5
+ import * as schedules from "./core/schedules/schedules";
4
6
  import { ResonateBase } from "./resonate";
5
- export type AFunc = (ctx: Context, ...args: any[]) => any;
6
- export type IFunc = (info: Info, ...args: any[]) => any;
7
+ export type Func = (ctx: Context, ...args: any[]) => any;
7
8
  export type Params<F> = F extends (ctx: any, ...args: infer P) => any ? P : never;
8
9
  export type Return<F> = F extends (...args: any[]) => infer T ? Awaited<T> : never;
9
10
  export declare class Resonate extends ResonateBase {
@@ -15,6 +16,7 @@ export declare class Resonate extends ResonateBase {
15
16
  * @param opts - A partial {@link ResonateOptions} object.
16
17
  */
17
18
  constructor(opts?: Partial<ResonateOptions>);
19
+ protected execute<F extends Func>(name: string, id: string, func: F, args: Params<F>, opts: Options, defaults: Options, durablePromise?: DurablePromise<any>): ResonatePromise<Return<F>>;
18
20
  /**
19
21
  * Register a function with Resonate. Registered functions can be invoked by calling {@link run}, or by the returned function.
20
22
  *
@@ -24,18 +26,7 @@ export declare class Resonate extends ResonateBase {
24
26
  * @param opts Resonate options, can be constructed by calling {@link options}.
25
27
  * @returns Resonate function
26
28
  */
27
- register<F extends AFunc>(name: string, func: F, opts?: Partial<Options>): (id: string, ...args: any) => ResonatePromise<Return<F>>;
28
- /**
29
- * Register a function with Resonate. Registered functions can be invoked by calling {@link run}, or by the returned function.
30
- *
31
- * @template F The type of the function.
32
- * @param name A unique name to identify the function.
33
- * @param version Version of the function.
34
- * @param func The function to register with Resonate.
35
- * @param opts Resonate options, can be constructed by calling {@link options}.
36
- * @returns Resonate function
37
- */
38
- register<F extends AFunc>(name: string, version: number, func: F, opts?: Partial<Options>): (id: string, ...args: any) => ResonatePromise<Return<F>>;
29
+ register<F extends Func>(name: string, func: F, opts?: Partial<Options>): (id: string, ...args: Params<F>) => ResonatePromise<Return<F>>;
39
30
  /**
40
31
  * Register a module with Resonate. Registered functions can be invoked by calling {@link run}.
41
32
  *
@@ -44,40 +35,44 @@ export declare class Resonate extends ResonateBase {
44
35
  * @param opts Resonate options, can be constructed by calling {@link options}.
45
36
  * @returns Resonate function
46
37
  */
47
- registerModule<F extends AFunc>(module: Record<string, F>, opts?: Partial<Options>): void;
48
- protected execute<F extends AFunc>(name: string, version: number, id: string, func: F, args: Params<F>, opts: Options): ResonatePromise<Return<F>>;
49
- }
50
- export declare class Info {
51
- private invocation;
52
- constructor(invocation: Invocation<any>);
53
- /**
54
- * The running count of function execution attempts.
55
- */
56
- get attempt(): number;
38
+ registerModule<F extends Func>(module: Record<string, F>, opts?: Partial<Options>): void;
57
39
  /**
58
- * Uniquely identifies the function invocation.
59
- */
60
- get id(): string;
61
- /**
62
- * Deduplicates function invocations with the same id.
40
+ * Schedule a resonate function.
41
+ *
42
+ * @param name The schedule name.
43
+ * @param cron The schedule cron expression.
44
+ * @param func The function to schedule.
45
+ * @param args The function arguments.
46
+ * @returns The schedule object.
63
47
  */
64
- get idempotencyKey(): string | undefined;
48
+ schedule<F extends Func>(name: string, cron: string, func: F, ...args: [...Params<F>, PartialOptions?]): Promise<schedules.Schedule>;
65
49
  /**
66
- * The timestamp in ms, once this time elapses the function invocation will timeout.
67
- */
68
- get timeout(): number;
69
- /**
70
- * The resonate function version.
50
+ * Schedule a resonate function that is already registered.
51
+ *
52
+ * @param name The schedule name.
53
+ * @param cron The schedule cron expression.
54
+ * @param func The registered function name.
55
+ * @param args The function arguments.
56
+ * @returns The schedule object.
71
57
  */
72
- get version(): number;
58
+ schedule(name: string, cron: string, func: string, ...args: [...any, PartialOptions?]): Promise<schedules.Schedule>;
73
59
  }
74
60
  export declare class Context {
61
+ private resonate;
75
62
  private invocation;
76
- constructor(invocation: Invocation<any>);
63
+ constructor(resonate: Resonate, invocation: Invocation<any>);
64
+ /**
65
+ * The running count of function execution attempts.
66
+ */
67
+ get attempt(): number;
77
68
  /**
78
69
  * The running count of child function invocations.
79
70
  */
80
71
  get counter(): number;
72
+ /**
73
+ * The time the invocation was created. Will use the durable promise creation time if available.
74
+ */
75
+ get createdOn(): number;
81
76
  /**
82
77
  * Uniquely identifies the function invocation.
83
78
  */
@@ -85,7 +80,11 @@ export declare class Context {
85
80
  /**
86
81
  * Deduplicates function invocations with the same id.
87
82
  */
88
- get idempotencyKey(): string | undefined;
83
+ get idempotencyKey(): string;
84
+ /**
85
+ * All configured options for this context.
86
+ */
87
+ get opts(): Options;
89
88
  /**
90
89
  * The timestamp in ms, once this time elapses the function invocation will timeout.
91
90
  */
@@ -102,7 +101,7 @@ export declare class Context {
102
101
  * @param args The function arguments, optionally followed by {@link options}.
103
102
  * @returns A promise that resolves to the return value of the function.
104
103
  */
105
- run<F extends AFunc>(func: F, ...args: [...Params<F>, PartialOptions?]): ResonatePromise<Return<F>>;
104
+ run<F extends Func>(func: F, ...args: [...Params<F>, PartialOptions?]): ResonatePromise<Return<F>>;
106
105
  /**
107
106
  * Invoke a remote function.
108
107
  *
@@ -123,22 +122,73 @@ export declare class Context {
123
122
  */
124
123
  run<T>(func: string, opts?: PartialOptions): ResonatePromise<T>;
125
124
  /**
126
- * Invoke an io function.
125
+ * Creates a Promise that is resolved with an array of results when all of the provided Promises
126
+ * resolve, or rejected when any Promise is rejected.
127
127
  *
128
- * @template F The type of the function.
129
- * @param func The function to invoke.
130
- * @param args The function arguments, optionally followed by {@link options}.
131
- * @returns A promise that resolves to the return value of the function.
128
+ * @param values An array of Promises.
129
+ * @param opts Optional {@link options}.
130
+ * @returns A new ResonatePromise.
131
+ */
132
+ all<T extends readonly unknown[] | []>(values: T, opts?: Partial<Options>): ResonatePromise<{
133
+ -readonly [P in keyof T]: Awaited<T[P]>;
134
+ }>;
135
+ /**
136
+ * Creates a Promise that is fulfilled by the first given promise to be fulfilled, or rejected
137
+ * with an AggregateError.
138
+ *
139
+ * @param values An array of Promises.
140
+ * @param opts Optional {@link options}.
141
+ * @returns A new ResonatePromise.
142
+ */
143
+ any<T extends readonly unknown[] | []>(values: T, opts?: Partial<Options>): ResonatePromise<Awaited<T[number]>>;
144
+ /**
145
+ * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
146
+ * or rejected.
147
+ *
148
+ * @param values An array of Promises.
149
+ * @param opts Optional {@link options}.
150
+ * @returns A new ResonatePromise.
151
+ */
152
+ race<T extends readonly unknown[] | []>(values: T, opts?: Partial<Options>): ResonatePromise<Awaited<T[number]>>;
153
+ /**
154
+ * Creates a Promise that is resolved with an array of results when all of the provided Promises
155
+ * resolve or reject.
156
+ *
157
+ * @param values An array of Promises.
158
+ * @param opts Optional {@link options}.
159
+ * @returns A new ResonatePromise.
160
+ */
161
+ allSettled<T extends readonly unknown[] | []>(values: T, opts?: Partial<Options>): ResonatePromise<{
162
+ -readonly [P in keyof T]: PromiseSettledResult<Awaited<T[P]>>;
163
+ }>;
164
+ /**
165
+ * Generate a deterministic random number.
166
+ *
167
+ * @returns A random number.
168
+ */
169
+ random(): ResonatePromise<number>;
170
+ /**
171
+ * Get a deterministic timestamp.
172
+ *
173
+ * @returns A timestamp in ms.
174
+ */
175
+ now(): ResonatePromise<number>;
176
+ /**
177
+ * Run a Resonate function in detached mode. Functions must first be registered with Resonate.
178
+ *
179
+ * @template T The return type of the function.
180
+ * @param id A unique id for the function invocation.
181
+ * @param name The function name.
182
+ * @param args The function arguments.
183
+ * @returns A ResonatePromise.
132
184
  */
133
- io<F extends IFunc>(func: F, ...args: [...Params<F>, PartialOptions?]): ResonatePromise<Return<F>>;
185
+ detached<T>(name: string, id: string, ...args: [...any, PartialOptions?]): ResonatePromise<T>;
134
186
  /**
135
187
  * Construct options.
136
188
  *
137
189
  * @param opts A partial {@link Options} object.
138
- * @returns Options with the __resonate flag set.
190
+ * @returns PartialOptions.
139
191
  */
140
- options(opts?: Partial<Options>): Partial<Options> & {
141
- __resonate: true;
142
- };
192
+ options(opts?: Partial<Options>): PartialOptions;
143
193
  }
144
194
  //# sourceMappingURL=async.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"async.d.ts","sourceRoot":"","sources":["../lib/async.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAG1E,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAM1C,MAAM,MAAM,KAAK,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AAE1D,MAAM,MAAM,KAAK,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AAExD,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC;AAElF,MAAM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