@aws/durable-execution-sdk-js 1.0.0 → 1.0.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 +3 -50
- package/dist/index.mjs +1874 -2017
- package/dist/index.mjs.map +1 -1
- package/dist-cjs/index.js +1873 -2016
- package/dist-cjs/index.js.map +1 -1
- package/dist-types/context/durable-context/durable-context.d.ts +0 -6
- package/dist-types/context/durable-context/durable-context.d.ts.map +1 -1
- package/dist-types/errors/durable-error/durable-error.d.ts +6 -0
- package/dist-types/errors/durable-error/durable-error.d.ts.map +1 -1
- package/dist-types/errors/step-errors/step-errors.d.ts +1 -0
- package/dist-types/errors/step-errors/step-errors.d.ts.map +1 -1
- package/dist-types/handlers/callback-handler/callback-promise.d.ts +2 -2
- package/dist-types/handlers/callback-handler/callback-promise.d.ts.map +1 -1
- package/dist-types/handlers/callback-handler/callback.d.ts +1 -2
- package/dist-types/handlers/callback-handler/callback.d.ts.map +1 -1
- package/dist-types/handlers/concurrent-execution-handler/concurrent-execution-handler.d.ts +1 -0
- package/dist-types/handlers/concurrent-execution-handler/concurrent-execution-handler.d.ts.map +1 -1
- package/dist-types/handlers/invoke-handler/invoke-handler.d.ts +1 -2
- package/dist-types/handlers/invoke-handler/invoke-handler.d.ts.map +1 -1
- package/dist-types/handlers/run-in-child-context-handler/run-in-child-context-handler.d.ts.map +1 -1
- package/dist-types/handlers/step-handler/step-handler.d.ts +1 -9
- package/dist-types/handlers/step-handler/step-handler.d.ts.map +1 -1
- package/dist-types/handlers/wait-for-condition-handler/wait-for-condition-handler.d.ts +1 -6
- package/dist-types/handlers/wait-for-condition-handler/wait-for-condition-handler.d.ts.map +1 -1
- package/dist-types/handlers/wait-handler/wait-handler-comparison.test.d.ts +2 -0
- package/dist-types/handlers/wait-handler/wait-handler-comparison.test.d.ts.map +1 -0
- package/dist-types/handlers/wait-handler/wait-handler.d.ts +1 -2
- package/dist-types/handlers/wait-handler/wait-handler.d.ts.map +1 -1
- package/dist-types/testing/create-test-checkpoint-manager.d.ts.map +1 -1
- package/dist-types/testing/create-test-durable-context.d.ts.map +1 -1
- package/dist-types/testing/mock-checkpoint-manager.d.ts +0 -1
- package/dist-types/testing/mock-checkpoint-manager.d.ts.map +1 -1
- package/dist-types/testing/mock-checkpoint.d.ts +1 -0
- package/dist-types/testing/mock-checkpoint.d.ts.map +1 -1
- package/dist-types/types/batch.d.ts +8 -0
- package/dist-types/types/batch.d.ts.map +1 -1
- package/dist-types/types/core.d.ts +1 -3
- package/dist-types/types/core.d.ts.map +1 -1
- package/dist-types/types/durable-context.d.ts +8 -6
- package/dist-types/types/durable-context.d.ts.map +1 -1
- package/dist-types/types/index.d.ts +2 -0
- package/dist-types/types/index.d.ts.map +1 -1
- package/dist-types/types/operation-lifecycle-state.d.ts +27 -0
- package/dist-types/types/operation-lifecycle-state.d.ts.map +1 -0
- package/dist-types/types/operation-lifecycle.d.ts +27 -0
- package/dist-types/types/operation-lifecycle.d.ts.map +1 -0
- package/dist-types/utils/checkpoint/checkpoint-ancestor.test.d.ts +2 -0
- package/dist-types/utils/checkpoint/checkpoint-ancestor.test.d.ts.map +1 -0
- package/dist-types/utils/checkpoint/checkpoint-central-termination.test.d.ts +2 -0
- package/dist-types/utils/checkpoint/checkpoint-central-termination.test.d.ts.map +1 -0
- package/dist-types/utils/checkpoint/checkpoint-helper.d.ts +37 -0
- package/dist-types/utils/checkpoint/checkpoint-helper.d.ts.map +1 -1
- package/dist-types/utils/checkpoint/checkpoint-manager.d.ts +37 -12
- package/dist-types/utils/checkpoint/checkpoint-manager.d.ts.map +1 -1
- package/dist-types/utils/constants/constants.d.ts +0 -1
- package/dist-types/utils/constants/constants.d.ts.map +1 -1
- package/dist-types/utils/durable-execution-invocation-input/durable-execution-invocation-input.d.ts +3 -1
- package/dist-types/utils/durable-execution-invocation-input/durable-execution-invocation-input.d.ts.map +1 -1
- package/dist-types/utils/durable-execution-invocation-input/durable-execution-invocation-input.test.d.ts +2 -0
- package/dist-types/utils/durable-execution-invocation-input/durable-execution-invocation-input.test.d.ts.map +1 -0
- package/dist-types/utils/termination-helper/termination-helper.d.ts +0 -9
- package/dist-types/utils/termination-helper/termination-helper.d.ts.map +1 -1
- package/dist-types/with-durable-execution.d.ts.map +1 -1
- package/package.json +8 -3
- package/dist-types/utils/checkpoint/checkpoint-ancestor-checking.test.d.ts +0 -2
- package/dist-types/utils/checkpoint/checkpoint-ancestor-checking.test.d.ts.map +0 -1
- package/dist-types/utils/termination-helper/active-operations-tracker.d.ts +0 -31
- package/dist-types/utils/termination-helper/active-operations-tracker.d.ts.map +0 -1
- package/dist-types/utils/termination-helper/active-operations-tracker.test.d.ts +0 -2
- package/dist-types/utils/termination-helper/active-operations-tracker.test.d.ts.map +0 -1
- package/dist-types/utils/wait-before-continue/wait-before-continue.d.ts +0 -35
- package/dist-types/utils/wait-before-continue/wait-before-continue.d.ts.map +0 -1
- package/dist-types/utils/wait-before-continue/wait-before-continue.test.d.ts +0 -2
- package/dist-types/utils/wait-before-continue/wait-before-continue.test.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -49,8 +49,9 @@ export const lambdaHandler = withDurableExecution(handler);
|
|
|
49
49
|
|
|
50
50
|
This README provides a quick reference for the SDK's main features. For more detailed information:
|
|
51
51
|
|
|
52
|
+
- **[API Reference](../../docs/api-reference/durable-execution-sdk-js.md)** - Complete technical reference with detailed type definitions and operation specifications
|
|
52
53
|
- **[Concepts and Use Cases](src/documents/CONCEPTS.md)** - Learn about the replay model, best practices, and real-world examples including GenAI agents, human-in-the-loop workflows, and saga patterns
|
|
53
|
-
- **[
|
|
54
|
+
- **[Contributing](../../CONTRIBUTING.md)** - Learn about contributing to the AWS Durable Execution SDK for JavaScript
|
|
54
55
|
|
|
55
56
|
## Core Concepts
|
|
56
57
|
|
|
@@ -106,7 +107,7 @@ const orderResult = await context.runInChildContext(
|
|
|
106
107
|
|
|
107
108
|
### Invoking Other Functions
|
|
108
109
|
|
|
109
|
-
Call
|
|
110
|
+
Call another AWS Lambda function and wait for it complete:
|
|
110
111
|
|
|
111
112
|
```typescript
|
|
112
113
|
const result = await context.invoke(
|
|
@@ -266,16 +267,6 @@ const results = await context.promise.allSettled([operation1(), operation2()]);
|
|
|
266
267
|
|
|
267
268
|
### Retry Strategies
|
|
268
269
|
|
|
269
|
-
Built-in retry presets:
|
|
270
|
-
|
|
271
|
-
```typescript
|
|
272
|
-
import { retryPresets } from "@aws/durable-execution-sdk-js";
|
|
273
|
-
|
|
274
|
-
await context.step("api-call", async () => callExternalAPI(), {
|
|
275
|
-
retryStrategy: retryPresets.exponentialBackoff(),
|
|
276
|
-
});
|
|
277
|
-
```
|
|
278
|
-
|
|
279
270
|
Custom retry strategy:
|
|
280
271
|
|
|
281
272
|
```typescript
|
|
@@ -287,32 +278,6 @@ await context.step("custom-retry", async () => riskyOperation(), {
|
|
|
287
278
|
});
|
|
288
279
|
```
|
|
289
280
|
|
|
290
|
-
### Serialization
|
|
291
|
-
|
|
292
|
-
Custom serialization for complex types:
|
|
293
|
-
|
|
294
|
-
```typescript
|
|
295
|
-
import {
|
|
296
|
-
createClassSerdes,
|
|
297
|
-
createClassSerdesWithDates,
|
|
298
|
-
} from "@aws/durable-execution-sdk-js";
|
|
299
|
-
|
|
300
|
-
class User {
|
|
301
|
-
constructor(
|
|
302
|
-
public name: string,
|
|
303
|
-
public createdAt: Date,
|
|
304
|
-
) {}
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
const result = await context.step(
|
|
308
|
-
"create-user",
|
|
309
|
-
async () => new User("Alice", new Date()),
|
|
310
|
-
{
|
|
311
|
-
serdes: createClassSerdesWithDates(User, ["createdAt"]),
|
|
312
|
-
},
|
|
313
|
-
);
|
|
314
|
-
```
|
|
315
|
-
|
|
316
281
|
### Step Semantics
|
|
317
282
|
|
|
318
283
|
Control execution guarantees:
|
|
@@ -395,18 +360,6 @@ context.configureLogger({
|
|
|
395
360
|
context.configureLogger({ modeAware: false });
|
|
396
361
|
```
|
|
397
362
|
|
|
398
|
-
## Testing Locally
|
|
399
|
-
|
|
400
|
-
Run durable functions locally for development:
|
|
401
|
-
|
|
402
|
-
```bash
|
|
403
|
-
# Basic example
|
|
404
|
-
npm run run-locally src/demo/usage-example.ts
|
|
405
|
-
|
|
406
|
-
# With invocation ID
|
|
407
|
-
npm run run-locally src/demo/retry-config.ts invocation001
|
|
408
|
-
```
|
|
409
|
-
|
|
410
363
|
## License
|
|
411
364
|
|
|
412
365
|
This project is licensed under the Apache-2.0 License.
|