graphddb 0.5.2 → 0.5.3

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,7 @@ TypeScript types.
22
22
  - ✅ **CDC projection** —— `@cdcProjected()` + `fromChange` / `subscribe` parse CDC change events into typed records (sink delivery / idempotency stay with the consumer).
23
23
  - ✅ **Maintained access paths** —— keep embedded snapshots / aggregate counters synchronized atomically.
24
24
  - ✅ **CloudFormation generation** —— emit a CloudFormation template for the DynamoDB table(s) a model set maps onto (GSI union / Streams / TTL / PITR / TableClass / SSE / PROVISIONED / Auto Scaling).
25
+ - ✅ **Docs generation** —— generate a model specification (Markdown + Mermaid) from the TS models; templates are Handlebars and user-overridable.
25
26
 
26
27
  ## 🤔 Philosophy
27
28
 
@@ -214,6 +215,11 @@ Each capability is summarized here only. For details, operator lists, and proced
214
215
  - **CloudFormation generation** —— `graphddb generate cloudformation` emits a CloudFormation template for
215
216
  the DynamoDB table(s) a model set maps onto (GSI union / Streams / TTL / PITR / PROVISIONED / Auto
216
217
  Scaling). [`docs/cloudformation.md`](./docs/cloudformation.md).
218
+ - **Docs generation** —— `graphddb generate docs` renders a human-facing model specification (Table
219
+ Overview / ER diagram / Key Schema / Property Matrix / Entity Details / Access Patterns / Mutation
220
+ Contracts / Maintained Access Paths / CDC / CloudFormation) as Markdown + Mermaid. The layout is
221
+ defined by bundled Handlebars templates that users can customize with `--template-dir` (per-partial
222
+ override) and `--helpers` (extra helpers). [`docs/docs-generation.md`](./docs/docs-generation.md).
217
223
 
218
224
  ## 📚 Documentation
219
225
 
@@ -234,6 +240,7 @@ documentation available offline at hand. On GitHub, follow the links in the tabl
234
240
  | [CDC emulator](./docs/cdc-emulator.md) | A change-event emulator for differential aggregation patterns (dev/test). |
235
241
  | [CDC projection](./docs/cdc-projection.md) | The `@cdcProjected()` + `fromChange` / `subscribe` typed-consumer-IF: a contract that parses CDC change events into typed records. Boundary (parse→typed is graphddb; subscription, sink delivery, idempotency are the consumer's). |
236
242
  | [CloudFormation generation](./docs/cloudformation.md) | The `generate cloudformation` command: emit a CloudFormation template for the DynamoDB table(s) a model set maps onto (GSI union / Streams / TTL / PITR / TableClass / SSE / PROVISIONED / Auto Scaling). All options, derivation rules, and scope boundary. |
243
+ | [Docs generation](./docs/docs-generation.md) | The `generate docs` command: generate a model specification (Markdown + Mermaid) from the TS models. All options, output sections, and customizing the Handlebars templates with `--template-dir` / `--helpers`. |
237
244
  | [Benchmark](./benchmark/RESULTS.md) | Library comparison against hand-written AWS SDK, ElectroDB, DynamoDB Toolbox, and OneTable. |
238
245
 
239
246
  ## 💡 Examples
@@ -264,6 +271,7 @@ flowchart LR
264
271
  M --> PY["Python client + runtime"]
265
272
  M --> CQ["CQRS Contract"]
266
273
  M --> CFN["CloudFormation template"]
274
+ M --> DOC["Model docs (Markdown + Mermaid)"]
267
275
  ```
268
276
 
269
277
  ## 📄 License
@@ -0,0 +1,37 @@
1
+ export { C as CdcEmulator, M as MAINT_OUTBOX_PK_PREFIX, a as MaintenanceDrain, b as MaintenanceDrainOptions, c as createCdcEmulator, d as createMaintenanceDrain, e as createMaintenanceDrainHandler, p as parseChange } from '../from-change-DQK2Jm9R.js';
2
+ export { B as BatchResult, C as CdcEmulatorOptions, a as CdcMode, b as ChangeBatch, c as ChangeEvent, d as ChangeEventName, e as ChangeHandler, f as ClockMode, g as ConcurrentRecomputeRef, E as EventLog, F as FaultSpec, R as ReplayOptions, S as ShardId, h as StartingPosition, i as StreamViewType, j as SubscribeHandler, k as SubscribeHandlers, U as Unsubscribe, l as buildSubscribeHandler } from '../maintenance-view-adapter-D5t9taTE.js';
3
+ import '@aws-sdk/client-dynamodb';
4
+
5
+ /**
6
+ * Deterministic primitives for the CDC emulator (issue #72). All fault
7
+ * injection and shard assignment route through these so a given `seed`
8
+ * reproduces the exact same event ordering, duplicates, delays, and failures
9
+ * (spec §8, AC3).
10
+ */
11
+ /**
12
+ * mulberry32 — a small, fast, fully deterministic 32-bit PRNG. Given the same
13
+ * seed it produces the same sequence on every platform, which is what AC3
14
+ * ("…deterministically reproducible with a seed") requires.
15
+ */
16
+ declare class SeededRandom {
17
+ private state;
18
+ constructor(seed: number);
19
+ /** Next float in [0, 1). */
20
+ next(): number;
21
+ /** Integer in [min, max] inclusive. */
22
+ int(min: number, max: number): number;
23
+ /** Bernoulli trial: true with probability `p`. */
24
+ chance(p: number): boolean;
25
+ /** In-place Fisher–Yates shuffle, deterministic for the seed state. */
26
+ shuffle<T>(items: T[]): T[];
27
+ }
28
+ /**
29
+ * Stable 32-bit string hash (FNV-1a). Used for `shardId = hash(pk)` so the same
30
+ * partition key always lands in the same shard (spec §6), independent of the
31
+ * fault PRNG.
32
+ */
33
+ declare function hashString(value: string): number;
34
+ /** Compute the shard id for a partition key over `shardCount` shards. */
35
+ declare function shardIdFor(pk: string, shardCount: number): string;
36
+
37
+ export { SeededRandom, hashString, shardIdFor };
@@ -0,0 +1,29 @@
1
+ import {
2
+ CdcEmulator,
3
+ MAINT_OUTBOX_PK_PREFIX,
4
+ MaintenanceDrain,
5
+ SeededRandom,
6
+ createCdcEmulator,
7
+ createMaintenanceDrain,
8
+ createMaintenanceDrainHandler,
9
+ hashString,
10
+ shardIdFor
11
+ } from "../chunk-M6URQOAW.js";
12
+ import {
13
+ buildSubscribeHandler,
14
+ parseChange
15
+ } from "../chunk-CCIVET5K.js";
16
+ import "../chunk-PDUVTYC5.js";
17
+ export {
18
+ CdcEmulator,
19
+ MAINT_OUTBOX_PK_PREFIX,
20
+ MaintenanceDrain,
21
+ SeededRandom,
22
+ buildSubscribeHandler,
23
+ createCdcEmulator,
24
+ createMaintenanceDrain,
25
+ createMaintenanceDrainHandler,
26
+ hashString,
27
+ parseChange,
28
+ shardIdFor
29
+ };