@boxxy/pepys 0.0.1 → 0.1.4

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 (63) hide show
  1. package/README.md +42 -5
  2. package/dist/boxxy-source.d.ts +636 -0
  3. package/dist/boxxy-work-plugin.d.ts +1 -0
  4. package/dist/build-boxxy-plugin.d.ts +181 -0
  5. package/dist/consumers/apply-scope.d.ts +5 -0
  6. package/dist/create-pepys-fact-sink.d.ts +9 -0
  7. package/dist/create-pepys-reader.d.ts +9 -0
  8. package/dist/generated/boxxy-work-boundary.d.ts +566 -0
  9. package/dist/index.d.ts +5 -0
  10. package/dist/queries/build-cost-to-land-query.d.ts +156 -0
  11. package/dist/queries/build-cost-to-land.d.ts +12 -0
  12. package/dist/queries/build-stage-time-query.d.ts +29 -0
  13. package/dist/queries/build-stage-time.d.ts +10 -0
  14. package/dist/queries/constants.d.ts +6 -0
  15. package/dist/queries/find-item-entity-id.d.ts +2 -0
  16. package/dist/queries/types.d.ts +109 -0
  17. package/dist/sink/is-outgoing-fact.d.ts +3 -0
  18. package/dist/sink/pick-sink-answer.d.ts +7 -0
  19. package/dist/sink/to-wire-fact.d.ts +5 -0
  20. package/dist/types.d.ts +6 -0
  21. package/dist/wire-fact-schemas.d.ts +319 -0
  22. package/dist/work/boxxy-work-consumer.d.ts +125 -0
  23. package/dist/work/constants.d.ts +3 -0
  24. package/dist/work/fold-work-facts.d.ts +2 -0
  25. package/dist/work/types.d.ts +147 -0
  26. package/package.json +51 -4
  27. package/src/boxxy-source.ts +25 -0
  28. package/src/boxxy-work-plugin.ts +11 -0
  29. package/src/build-boxxy-plugin.ts +18 -0
  30. package/src/consumers/apply-scope.ts +125 -0
  31. package/src/create-pepys-fact-sink.ts +64 -0
  32. package/src/create-pepys-reader.ts +79 -0
  33. package/src/generated/boxxy-work-boundary.ts +2923 -0
  34. package/src/generated/boxxy-work.sql +71 -0
  35. package/src/index.ts +17 -0
  36. package/src/queries/build-cost-to-land-query.ts +127 -0
  37. package/src/queries/build-cost-to-land.ts +226 -0
  38. package/src/queries/build-stage-time-query.ts +59 -0
  39. package/src/queries/build-stage-time.ts +195 -0
  40. package/src/queries/constants.ts +10 -0
  41. package/src/queries/find-item-entity-id.ts +16 -0
  42. package/src/queries/types.ts +168 -0
  43. package/src/sink/is-outgoing-fact.ts +19 -0
  44. package/src/sink/pick-sink-answer.ts +29 -0
  45. package/src/sink/to-wire-fact.ts +31 -0
  46. package/src/test-utils/build-foreign-stand-in.ts +139 -0
  47. package/src/test-utils/build-mock-applied-fact.ts +39 -0
  48. package/src/test-utils/build-mock-attempt-read-row.ts +17 -0
  49. package/src/test-utils/build-mock-binding-read-row.ts +12 -0
  50. package/src/test-utils/build-mock-item-facts.ts +149 -0
  51. package/src/test-utils/build-mock-request-read-row.ts +20 -0
  52. package/src/test-utils/build-mock-scope-fact.ts +13 -0
  53. package/src/test-utils/create-ingest-stand-in.ts +56 -0
  54. package/src/test-utils/create-query-stand-in.ts +51 -0
  55. package/src/test-utils/create-test-pepys.ts +228 -0
  56. package/src/test-utils/to-entity-id.ts +14 -0
  57. package/src/test-utils/to-scope-fact.ts +92 -0
  58. package/src/types.ts +14 -0
  59. package/src/wire-fact-schemas.ts +41 -0
  60. package/src/work/boxxy-work-consumer.ts +95 -0
  61. package/src/work/constants.ts +25 -0
  62. package/src/work/fold-work-facts.ts +490 -0
  63. package/src/work/types.ts +177 -0
package/README.md CHANGED
@@ -1,7 +1,44 @@
1
- # @boxxy/pepys
1
+ <div align="center">
2
+ <h1>@boxxy/pepys</h1>
2
3
 
3
- This version, 0.0.1, is a placeholder. It holds no code. It reserves the name on npm so that the
4
- boxxy release can publish every real version from CI with provenance.
4
+ <p>
5
+ <a href="https://www.npmjs.com/package/@boxxy/pepys"><img src="https://img.shields.io/npm/v/@boxxy/pepys" alt="npm version"></a>
6
+ <a href="./LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="MIT license"></a>
7
+ </p>
5
8
 
6
- Install a version above 0.0.1. The source lives in [`packages/pepys`](https://github.com/zgeoff/boxxy/tree/main/packages/pepys)
7
- of the [boxxy repo](https://github.com/zgeoff/boxxy).
9
+ <p>
10
+ <a href="../../docs/design/boxxy/v1-facts-and-pepys.md">Documentation</a>
11
+ </p>
12
+ </div>
13
+
14
+ The pepys plug-in of boxxy, with the fact sink that sends boxxy's facts to pepys and the reader that
15
+ asks pepys for boxxy's two reports.
16
+
17
+ A pepys deployment lists the plug-in, and the boxxy server builds the sink and the reader. The
18
+ plug-in folds boxxy's facts into the `boxxy_work` tables and answers two queries: what an item cost
19
+ to land, and how long it spent in each step.
20
+
21
+ ## Install
22
+
23
+ Install the package and the pepys kit it plugs into from
24
+ [npm](https://www.npmjs.com/package/@boxxy/pepys) with Bun:
25
+
26
+ ```bash
27
+ bun add @boxxy/pepys @pepys/kit zod
28
+ ```
29
+
30
+ `@pepys/kit` and `zod` are peer dependencies: the deployment's own copy is the one the plug-in uses.
31
+ The package runs on [Bun](https://bun.sh) 1.3 or newer.
32
+
33
+ ## Features
34
+
35
+ - `@boxxy/pepys`: the plug-in parts, `boxxySource`, `boxxyWorkConsumer` and `buildBoxxyPlugin`, and
36
+ the query types.
37
+ - `@boxxy/pepys/sink`: `createPepysFactSink`, the `FactSink` that sends a batch of facts to pepys
38
+ ingest.
39
+ - `@boxxy/pepys/reader`: `createPepysReader`, the `PepysReader` that runs the two queries.
40
+
41
+ ## Documentation
42
+
43
+ [Facts and pepys in v1](../../docs/design/boxxy/v1-facts-and-pepys.md) describes the outbox, the
44
+ fact catalog, the `boxxy_work` package and the two queries.