@coji/durably 0.6.0 → 0.7.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.
@@ -1,9 +1,6 @@
1
- // src/plugins/index.ts
2
- function withLogPersistence() {
3
- throw new Error(
4
- "durably is not yet implemented. This is a placeholder package. See https://github.com/coji/durably for updates."
5
- );
6
- }
1
+ import {
2
+ withLogPersistence
3
+ } from "../chunk-UCUP6NMJ.js";
7
4
  export {
8
5
  withLogPersistence
9
6
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/plugins/index.ts"],"sourcesContent":["/**\n * durably plugins\n *\n * This package is under development. See https://github.com/coji/durably for updates.\n */\n\nexport function withLogPersistence(): unknown {\n throw new Error(\n 'durably is not yet implemented. This is a placeholder package. See https://github.com/coji/durably for updates.',\n )\n}\n"],"mappings":";AAMO,SAAS,qBAA8B;AAC5C,QAAM,IAAI;AAAA,IACR;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/docs/llms.md CHANGED
@@ -145,8 +145,15 @@ if (run?.status === 'completed') {
145
145
  console.log(run.output.syncedCount)
146
146
  }
147
147
 
148
- // Via durably instance (cross-job)
148
+ // Via durably instance (untyped)
149
149
  const run = await durably.getRun(runId)
150
+
151
+ // Via durably instance (typed with generic parameter)
152
+ type MyRun = Run & {
153
+ payload: { userId: string }
154
+ output: { count: number } | null
155
+ }
156
+ const typedRun = await durably.getRun<MyRun>(runId)
150
157
  ```
151
158
 
152
159
  ### Query Runs
@@ -162,6 +169,13 @@ const runs = await durably.getRuns({
162
169
  limit: 10,
163
170
  offset: 0,
164
171
  })
172
+
173
+ // Typed getRuns with generic parameter
174
+ type MyRun = Run & {
175
+ payload: { userId: string }
176
+ output: { count: number } | null
177
+ }
178
+ const typedRuns = await durably.getRuns<MyRun>({ jobName: 'my-job' })
165
179
  ```
166
180
 
167
181
  ### Retry Failed Runs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coji/durably",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Step-oriented resumable batch execution for Node.js and browsers using SQLite",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",