@resonatehq/sdk 0.3.6 → 0.5.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.
Files changed (55) hide show
  1. package/README.md +24 -123
  2. package/dist/async.d.ts +95 -49
  3. package/dist/async.d.ts.map +1 -1
  4. package/dist/async.js +167 -100
  5. package/dist/async.js.map +1 -1
  6. package/dist/core/execution.d.ts +12 -10
  7. package/dist/core/execution.d.ts.map +1 -1
  8. package/dist/core/execution.js +124 -65
  9. package/dist/core/execution.js.map +1 -1
  10. package/dist/core/future.d.ts +3 -1
  11. package/dist/core/future.d.ts.map +1 -1
  12. package/dist/core/future.js +6 -0
  13. package/dist/core/future.js.map +1 -1
  14. package/dist/core/invocation.d.ts +5 -4
  15. package/dist/core/invocation.d.ts.map +1 -1
  16. package/dist/core/invocation.js +39 -13
  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 +3 -2
  23. package/dist/core/promises/promises.d.ts.map +1 -1
  24. package/dist/core/promises/promises.js +4 -1
  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 +36 -18
  44. package/dist/generator.d.ts.map +1 -1
  45. package/dist/generator.js +66 -73
  46. package/dist/generator.js.map +1 -1
  47. package/dist/index.d.ts +2 -2
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +5 -26
  50. package/dist/index.js.map +1 -1
  51. package/dist/resonate.d.ts +108 -31
  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
@@ -32,147 +32,48 @@
32
32
  <br /><br />
33
33
  </div>
34
34
 
35
- An SDK for writing simple and elegant distributed async await applications.
35
+ ## Distributed Async Await
36
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.
37
+ 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.
39
38
 
40
- ## What is Distributed Async Await?
39
+ ## Why Resonate?
41
40
 
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.
41
+ - **Cloud Computing Made Dead Simple**: Resonate offers a dead simple programming model that simplifies coding for the cloud using an intuitive paradigm you already know async await.
43
42
 
44
- ## Features
43
+ - **Single Binary**: Resonate simplifies your deployment and operations with a single binary.
45
44
 
46
- Available now:
47
- - retries
48
- - recovery
49
- - schedules
50
- - tracing
51
- - logging
52
- - local promise store
53
- - remote promise store
45
+ - **Incremental Adoption and No Vendor Lock-In**: Resonate was designed to allow for incremental adoption without vendor lock-in ever.
54
46
 
55
- Coming soon:
56
- - rate limiting
57
- - metrics
47
+ - **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.
58
48
 
59
- Let us know [features](https://github.com/resonatehq/resonate-sdk-ts/issues) you would like Resonate to support.
49
+ ## Getting Started
60
50
 
61
- ## Install
62
- ```console
63
- npm install -g ts-node
64
- npm install @resonatehq/sdk
65
- npm install express @types/express
66
- ```
51
+ 1. [Start building in just 30 seconds](https://docs.resonatehq.io/getting-started/quickstart) with our quickstart guide!
52
+ 2. [Explore in-depth code examples](https://github.com/resonatehq/quickstart-ts/tree/main) and get your hands dirty with our comprehensive repository.
53
+ 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.
54
+ 4. [Explore the API reference](https://resonatehq.github.io/resonate-sdk-ts/index.html) of Resonate's TypeScript SDK.
55
+ 5. [Grasp the 4 core concepts](https://docs.resonatehq.io/getting-started/concepts) of distributed async/await applications by delving into our concepts page.
56
+
57
+ ## Core features
67
58
 
68
- ## What's New
59
+ The basic features Resonate offers to simplify the reliability and coordination of distributed processes are the following:
69
60
 
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).
61
+ - **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.
71
62
 
72
- ```ts
73
- import { Resonate, Context } from "@resonatehq/sdk";
63
+ - **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.
74
64
 
75
- const resonate = new Resonate();
65
+ - **Schedules**: Durable promises can be used to schedule statefule reminders using a simple HTTP/gRPC call.
76
66
 
77
- resonate.schedule("everyMinute", "* * * * *", (ctx: Context) => {
78
- console.log("every minute", Date.now());
79
- });
67
+ - **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.
80
68
 
81
- resonate.schedule("everyHour", "0 * * * *", (ctx: Context) => {
82
- console.log("every hour", Date.now());
83
- });
69
+ - **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.
84
70
 
85
- resonate.start();
86
- ```
87
-
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
- ```
71
+ - **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
72
 
174
73
  ## Contributing
74
+
175
75
  See our [contribution guidelines](CONTRIBUTING.md).
176
76
 
177
77
  ## License
78
+
178
79
  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,36 +35,36 @@ 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;
57
- /**
58
- * Uniquely identifies the function invocation.
59
- */
60
- get id(): string;
61
- /**
62
- * Deduplicates function invocations with the same id.
63
- */
64
- get idempotencyKey(): string | undefined;
38
+ registerModule<F extends Func>(module: Record<string, F>, opts?: Partial<Options>): void;
65
39
  /**
66
- * The timestamp in ms, once this time elapses the function invocation will timeout.
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.
67
47
  */
68
- get timeout(): number;
48
+ schedule<F extends Func>(name: string, cron: string, func: F, ...args: [...Params<F>, PartialOptions?]): Promise<schedules.Schedule>;
69
49
  /**
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
  */
@@ -85,7 +76,11 @@ export declare class Context {
85
76
  /**
86
77
  * Deduplicates function invocations with the same id.
87
78
  */
88
- get idempotencyKey(): string | undefined;
79
+ get idempotencyKey(): string;
80
+ /**
81
+ * All configured options for this context.
82
+ */
83
+ get opts(): Options;
89
84
  /**
90
85
  * The timestamp in ms, once this time elapses the function invocation will timeout.
91
86
  */
@@ -102,7 +97,7 @@ export declare class Context {
102
97
  * @param args The function arguments, optionally followed by {@link options}.
103
98
  * @returns A promise that resolves to the return value of the function.
104
99
  */
105
- run<F extends AFunc>(func: F, ...args: [...Params<F>, PartialOptions?]): ResonatePromise<Return<F>>;
100
+ run<F extends Func>(func: F, ...args: [...Params<F>, PartialOptions?]): ResonatePromise<Return<F>>;
106
101
  /**
107
102
  * Invoke a remote function.
108
103
  *
@@ -123,22 +118,73 @@ export declare class Context {
123
118
  */
124
119
  run<T>(func: string, opts?: PartialOptions): ResonatePromise<T>;
125
120
  /**
126
- * Invoke an io function.
121
+ * Creates a Promise that is resolved with an array of results when all of the provided Promises
122
+ * resolve, or rejected when any Promise is rejected.
127
123
  *
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.
124
+ * @param values An array of Promises.
125
+ * @param opts Optional {@link options}.
126
+ * @returns A new ResonatePromise.
127
+ */
128
+ all<T extends readonly unknown[] | []>(values: T, opts?: Partial<Options>): ResonatePromise<{
129
+ -readonly [P in keyof T]: Awaited<T[P]>;
130
+ }>;
131
+ /**
132
+ * Creates a Promise that is fulfilled by the first given promise to be fulfilled, or rejected
133
+ * with an AggregateError.
134
+ *
135
+ * @param values An array of Promises.
136
+ * @param opts Optional {@link options}.
137
+ * @returns A new ResonatePromise.
138
+ */
139
+ any<T extends readonly unknown[] | []>(values: T, opts?: Partial<Options>): ResonatePromise<Awaited<T[number]>>;
140
+ /**
141
+ * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
142
+ * or rejected.
143
+ *
144
+ * @param values An array of Promises.
145
+ * @param opts Optional {@link options}.
146
+ * @returns A new ResonatePromise.
147
+ */
148
+ race<T extends readonly unknown[] | []>(values: T, opts?: Partial<Options>): ResonatePromise<Awaited<T[number]>>;
149
+ /**
150
+ * Creates a Promise that is resolved with an array of results when all of the provided Promises
151
+ * resolve or reject.
152
+ *
153
+ * @param values An array of Promises.
154
+ * @param opts Optional {@link options}.
155
+ * @returns A new ResonatePromise.
156
+ */
157
+ allSettled<T extends readonly unknown[] | []>(values: T, opts?: Partial<Options>): ResonatePromise<{
158
+ -readonly [P in keyof T]: PromiseSettledResult<Awaited<T[P]>>;
159
+ }>;
160
+ /**
161
+ * Generate a deterministic random number.
162
+ *
163
+ * @returns A random number.
164
+ */
165
+ random(): ResonatePromise<number>;
166
+ /**
167
+ * Get a deterministic timestamp.
168
+ *
169
+ * @returns A timestamp in ms.
170
+ */
171
+ now(): ResonatePromise<number>;
172
+ /**
173
+ * Run a Resonate function in detached mode. Functions must first be registered with Resonate.
174
+ *
175
+ * @template T The return type of the function.
176
+ * @param id A unique id for the function invocation.
177
+ * @param name The function name.
178
+ * @param args The function arguments.
179
+ * @returns A ResonatePromise.
132
180
  */
133
- io<F extends IFunc>(func: F, ...args: [...Params<F>, PartialOptions?]): ResonatePromise<Return<F>>;
181
+ detached<T>(name: string, id: string, ...args: [...any, PartialOptions?]): ResonatePromise<T>;
134
182
  /**
135
183
  * Construct options.
136
184
  *
137
185
  * @param opts A partial {@link Options} object.
138
- * @returns Options with the __resonate flag set.
186
+ * @returns PartialOptions.
139
187
  */
140
- options(opts?: Partial<Options>): Partial<Options> & {
141
- __resonate: true;
142
- };
188
+ options(opts?: Partial<Options>): PartialOptions;
143
189
  }
144
190
  //# 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,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;AAMnF,qBAAa,QAAS,SAAQ,YAAY;IACxC,OAAO,CAAC,SAAS,CAAY;IAE7B;;;;;OAKG;gBACS,IAAI,GAAE,OAAO,CAAC,eAAe,CAAM;IAK/C;;;;;;;;OAQG;IACH,QAAQ,CAAC,CAAC,SAAS,KAAK,EACtB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,CAAC,EACP,IAAI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