@pepys/ingest 0.2.0 → 0.3.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.
package/README.md CHANGED
@@ -22,6 +22,22 @@ delivery, and appends the facts it reads to the fact log.
22
22
  bun add @pepys/ingest
23
23
  ```
24
24
 
25
+ Serve a deployment's routes from an entry file, with the S2 settings and each secret its routes
26
+ name:
27
+
28
+ ```ts
29
+ // serve-ingest.ts
30
+ import { serveIngest } from '@pepys/ingest';
31
+ import { deployment } from './deployment.ts';
32
+
33
+ await serveIngest({ deployment, environment: process.env });
34
+ ```
35
+
36
+ ```sh
37
+ export PEPYS_S2_ACCESS_TOKEN # the S2 access token, set in your shell beforehand
38
+ PEPYS_S2_ENDPOINT=http://127.0.0.1:8090 PEPYS_S2_BASIN=pepys bun serve-ingest.ts
39
+ ```
40
+
25
41
  ## Features
26
42
 
27
43
  - `serveIngest` and `createIngest`: the receive routes of a deployment.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pepys/ingest",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "pepys ingest: the receive routes, the fact log and the blob store",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -22,8 +22,8 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "@impz/client": "6.12.0",
25
- "@pepys/kit": "0.2.0",
26
- "@pepys/schema": "0.2.0",
25
+ "@pepys/kit": "0.3.0",
26
+ "@pepys/schema": "0.3.0",
27
27
  "@s2-dev/streamstore": "0.30.0",
28
28
  "@zgeoff/std": "0.4.3",
29
29
  "tiny-invariant": "1.3.3",
@@ -30,6 +30,7 @@ interface PullRunnerDependencies {
30
30
  append: BatchAppender;
31
31
  turns: StreamTurns;
32
32
  resyncMarks: ResyncMarks;
33
+ now: () => number;
33
34
  }
34
35
 
35
36
  // For a resync pull, removes each mark it was given that no tie set again since. A pull's fact is
@@ -54,7 +55,7 @@ export function makePullRunner(dependencies: PullRunnerDependencies): PullRunner
54
55
  env[name] = dependencies.secrets[name] ?? '';
55
56
  }
56
57
 
57
- const pulled = await path.pull(cursor, { env, marks });
58
+ const pulled = await path.pull(cursor, { env, marks, now: dependencies.now });
58
59
 
59
60
  if (pulled.kind !== 'batch') {
60
61
  return pulled;
@@ -98,6 +98,7 @@ export function createIngest(options: IngestOptions): Ingest {
98
98
  append,
99
99
  turns,
100
100
  resyncMarks: resync.marks,
101
+ now: options.now,
101
102
  }),
102
103
  };
103
104
  }