@noy-db/hub 0.2.0-pre.30 → 0.2.0-pre.31

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 (143) hide show
  1. package/dist/adapter/index.d.ts +9 -0
  2. package/dist/adapter/index.js +14 -0
  3. package/dist/attestation/index.d.ts +1 -1
  4. package/dist/attestation/index.js +3 -3
  5. package/dist/blobs/index.d.ts +3 -3
  6. package/dist/bundle/index.d.ts +3 -3
  7. package/dist/bundle/index.js +1 -1
  8. package/dist/{chunk-Y6YUWZTS.js → chunk-L5HHBOMS.js} +2 -2
  9. package/dist/{chunk-BVKLJBJJ.js → chunk-W5NVNJDX.js} +2 -1
  10. package/dist/{chunk-BVKLJBJJ.js.map → chunk-W5NVNJDX.js.map} +1 -1
  11. package/dist/consent/index.d.ts +2 -2
  12. package/dist/{decrypt-partition-Mhjh6nnG.d.ts → decrypt-partition-CXS5KopB.d.ts} +1 -1
  13. package/dist/derivations/index.d.ts +3 -3
  14. package/dist/{dev-unlock-DJ3IhgY9.d.ts → dev-unlock-CnHTTVea.d.ts} +1 -1
  15. package/dist/guards/index.d.ts +3 -3
  16. package/dist/{hash-DLwkYf1d.d.ts → hash-oc5paYl0.d.ts} +1 -1
  17. package/dist/history/index.d.ts +3 -3
  18. package/dist/i18n/index.d.ts +2 -2
  19. package/dist/{index-CMRIx_zx.d.ts → index-BmhGztUi.d.ts} +1 -1
  20. package/dist/index.d.ts +11 -11
  21. package/dist/index.js +2 -2
  22. package/dist/kernel/index.d.ts +2 -2
  23. package/dist/materialized-views/index.d.ts +3 -3
  24. package/dist/{mime-magic-CacDBwYp.d.ts → mime-magic-JeLKHRng.d.ts} +1 -1
  25. package/dist/{noydb-5MIBD77B.js → noydb-NAU2DTFP.js} +2 -2
  26. package/dist/noydb-NAU2DTFP.js.map +1 -0
  27. package/dist/overlay-views/index.d.ts +3 -3
  28. package/dist/periods/index.d.ts +2 -2
  29. package/dist/session/index.d.ts +3 -3
  30. package/dist/shadow/index.d.ts +2 -2
  31. package/dist/snapshots/index.d.ts +2 -2
  32. package/dist/store/index.d.ts +2 -2
  33. package/dist/sync/index.d.ts +1 -1
  34. package/dist/team/index.d.ts +2 -2
  35. package/dist/{transition-guard-J04-jime.d.ts → transition-guard-Dy3NioQr.d.ts} +1 -1
  36. package/dist/tx/index.d.ts +2 -2
  37. package/dist/{with-materialized-view-DNfzC5lH.d.ts → with-materialized-view-DIVeez0W.d.ts} +1 -1
  38. package/dist/{with-overlayed-view-qk3lbhOd.d.ts → with-overlayed-view-DVZrc5Hb.d.ts} +1 -1
  39. package/dist/{with-rollup-Dd3_ZG4b.d.ts → with-rollup-CbU-O4wP.d.ts} +1 -1
  40. package/package.json +62 -221
  41. package/dist/aggregate/index.cjs +0 -1144
  42. package/dist/aggregate/index.cjs.map +0 -1
  43. package/dist/aggregate/index.d.cts +0 -39
  44. package/dist/attestation/index.cjs +0 -305
  45. package/dist/attestation/index.cjs.map +0 -1
  46. package/dist/attestation/index.d.cts +0 -54
  47. package/dist/blobs/index.cjs +0 -1967
  48. package/dist/blobs/index.cjs.map +0 -1
  49. package/dist/blobs/index.d.cts +0 -48
  50. package/dist/bundle/index.cjs +0 -41045
  51. package/dist/bundle/index.cjs.map +0 -1
  52. package/dist/bundle/index.d.cts +0 -187
  53. package/dist/consent/index.cjs +0 -204
  54. package/dist/consent/index.cjs.map +0 -1
  55. package/dist/consent/index.d.cts +0 -27
  56. package/dist/crdt/index.cjs +0 -152
  57. package/dist/crdt/index.cjs.map +0 -1
  58. package/dist/crdt/index.d.cts +0 -30
  59. package/dist/decrypt-partition-C0iDpbSd.d.cts +0 -558
  60. package/dist/derivations/index.cjs +0 -469
  61. package/dist/derivations/index.cjs.map +0 -1
  62. package/dist/derivations/index.d.cts +0 -74
  63. package/dist/dev-unlock-0Z6yxfS7.d.cts +0 -263
  64. package/dist/discriminant-BN9REW3o.d.cts +0 -60
  65. package/dist/errors-BAWO5Z5a.d.cts +0 -1500
  66. package/dist/forget/index.cjs +0 -43
  67. package/dist/forget/index.cjs.map +0 -1
  68. package/dist/forget/index.d.cts +0 -1
  69. package/dist/guards/index.cjs +0 -455
  70. package/dist/guards/index.cjs.map +0 -1
  71. package/dist/guards/index.d.cts +0 -39
  72. package/dist/hash-Db8ncXGr.d.cts +0 -63
  73. package/dist/history/index.cjs +0 -1245
  74. package/dist/history/index.cjs.map +0 -1
  75. package/dist/history/index.d.cts +0 -65
  76. package/dist/i18n/index.cjs +0 -1280
  77. package/dist/i18n/index.cjs.map +0 -1
  78. package/dist/i18n/index.d.cts +0 -41
  79. package/dist/index-BMmajblo.d.cts +0 -362
  80. package/dist/index-C1SC1EPe.d.cts +0 -1325
  81. package/dist/index-xJEPkvMb.d.cts +0 -93
  82. package/dist/index.cjs +0 -48100
  83. package/dist/index.cjs.map +0 -1
  84. package/dist/index.d.cts +0 -1050
  85. package/dist/indexing/index.cjs +0 -803
  86. package/dist/indexing/index.cjs.map +0 -1
  87. package/dist/indexing/index.d.cts +0 -36
  88. package/dist/kernel/index.cjs +0 -751
  89. package/dist/kernel/index.cjs.map +0 -1
  90. package/dist/kernel/index.d.cts +0 -11
  91. package/dist/lazy-builder-eYZzLEL1.d.cts +0 -304
  92. package/dist/materialized-views/index.cjs +0 -1518
  93. package/dist/materialized-views/index.cjs.map +0 -1
  94. package/dist/materialized-views/index.d.cts +0 -187
  95. package/dist/mime-magic-sdMzsfVK.d.cts +0 -103
  96. package/dist/overlay-views/index.cjs +0 -399
  97. package/dist/overlay-views/index.cjs.map +0 -1
  98. package/dist/overlay-views/index.d.cts +0 -102
  99. package/dist/periods/index.cjs +0 -1041
  100. package/dist/periods/index.cjs.map +0 -1
  101. package/dist/periods/index.d.cts +0 -24
  102. package/dist/predicate-BmhBSPCH.d.cts +0 -267
  103. package/dist/query/index.cjs +0 -3480
  104. package/dist/query/index.cjs.map +0 -1
  105. package/dist/query/index.d.cts +0 -4
  106. package/dist/sealed-record/index.cjs +0 -139
  107. package/dist/sealed-record/index.cjs.map +0 -1
  108. package/dist/sealed-record/index.d.cts +0 -123
  109. package/dist/session/index.cjs +0 -495
  110. package/dist/session/index.cjs.map +0 -1
  111. package/dist/session/index.d.cts +0 -48
  112. package/dist/shadow/index.cjs +0 -133
  113. package/dist/shadow/index.cjs.map +0 -1
  114. package/dist/shadow/index.d.cts +0 -19
  115. package/dist/snapshots/index.cjs +0 -937
  116. package/dist/snapshots/index.cjs.map +0 -1
  117. package/dist/snapshots/index.d.cts +0 -30
  118. package/dist/store/index.cjs +0 -1091
  119. package/dist/store/index.cjs.map +0 -1
  120. package/dist/store/index.d.cts +0 -501
  121. package/dist/strategy-BSxFXGzb.d.cts +0 -110
  122. package/dist/strategy-mJExw4LQ.d.cts +0 -1069
  123. package/dist/sync/index.cjs +0 -1062
  124. package/dist/sync/index.cjs.map +0 -1
  125. package/dist/sync/index.d.cts +0 -45
  126. package/dist/team/index.cjs +0 -2805
  127. package/dist/team/index.cjs.map +0 -1
  128. package/dist/team/index.d.cts +0 -120
  129. package/dist/transition-guard-tWZIsaXe.d.cts +0 -165
  130. package/dist/tx/index.cjs +0 -614
  131. package/dist/tx/index.cjs.map +0 -1
  132. package/dist/tx/index.d.cts +0 -39
  133. package/dist/types-CdVfiQgt.d.cts +0 -15275
  134. package/dist/ulid-DRH25k3y.d.cts +0 -66
  135. package/dist/util/index.cjs +0 -237
  136. package/dist/util/index.cjs.map +0 -1
  137. package/dist/util/index.d.cts +0 -79
  138. package/dist/with-materialized-view-DfgPcvi9.d.cts +0 -27
  139. package/dist/with-overlayed-view-Cvfkx1lg.d.cts +0 -13
  140. package/dist/with-rollup-nIxo7h9z.d.cts +0 -47
  141. /package/dist/{noydb-5MIBD77B.js.map → adapter/index.js.map} +0 -0
  142. /package/dist/{chunk-Y6YUWZTS.js.map → chunk-L5HHBOMS.js.map} +0 -0
  143. /package/dist/{types-DHn9lEP0.d.ts → index-DHn9lEP0.d.ts} +0 -0
@@ -1,79 +0,0 @@
1
- export { i as isDiscriminant } from '../discriminant-BN9REW3o.cjs';
2
-
3
- /**
4
- * Target-profile aware filename sanitizer.
5
- *
6
- * Pure string in / string out. No filesystem access, no I/O. Use this
7
- * at the boundary where a user-supplied filename meets a storage
8
- * destination — local FS, ZIP archive, S3 key, URL path, SMB share —
9
- * to defuse the canonical 14-class footgun before it reaches that
10
- * destination.
11
- *
12
- * ## Threat model
13
- *
14
- * 1. Path injection — `..`, NUL bytes, `\` on POSIX, absolute paths.
15
- * 2. Windows reserved names — `CON`, `PRN`, `AUX`, `NUL`,
16
- * `COM1-9`, `LPT1-9`, with or without an extension.
17
- * 3. Windows reserved chars — `< > : " / \ | ? *` plus ASCII 0-31.
18
- * 4. Trailing `.` and ` ` on Windows / SMB.
19
- * 5. Unicode normalization drift — same display, different bytes →
20
- * "two files with the same name" sync ghosts.
21
- * 6. Bidi override spoofing — U+202E reversing `harmless.exe.txt`
22
- * into `harmless.txt.exe`.
23
- * 7. URL `+` ambiguity in S3 presigned URLs.
24
- * 8. ZIP general-purpose-flag bit 11 (UTF-8 filename) optional in
25
- * pre-2006 readers.
26
- * 9-14. Length caps, leading/trailing whitespace + controls,
27
- * `.DS_Store`-style hidden noise, etc.
28
- *
29
- * ## Always-on transforms (every profile)
30
- *
31
- * - NFC normalize (`String.prototype.normalize('NFC')`).
32
- * - Reject NUL — hard fail, not strip. Silent strip enables a
33
- * classic truncation bypass (`safe.txt\0.exe` → `safe.txt`).
34
- * - Strip bidi overrides (`U+202A..U+202E`, `U+2066..U+2069`).
35
- * - Trim leading/trailing whitespace and ASCII control chars.
36
- *
37
- * ## Non-goals (i18n boundary policy, )
38
- *
39
- * - No transliteration.
40
- * - No locale-aware slugging.
41
- * - No script-specific segmentation.
42
- *
43
- * @module
44
- */
45
- /**
46
- * One of seven storage destinations the sanitizer knows how to defang
47
- * for. Pick the most restrictive that covers your write site:
48
- * `'macos-smb'` is the safe default for "I don't know where these
49
- * files end up but they're going to a real filesystem somewhere."
50
- */
51
- type FilenameProfile = 'posix' | 'windows' | 'macos-smb' | 'zip' | 'url-path' | 's3-key' | 'opaque';
52
- interface SanitizeFilenameOptions {
53
- /** Target-destination profile. */
54
- readonly profile: FilenameProfile;
55
- /**
56
- * Override the per-profile length cap. Useful when leaving headroom
57
- * for a collision suffix — e.g. `maxBytes: 240` on a `posix` write
58
- * site that wants 15 bytes of slack for `-1`, `-2`, …
59
- */
60
- readonly maxBytes?: number;
61
- /**
62
- * Required when `profile === 'opaque'`. The opaque profile replaces
63
- * the entire input with `${opaqueId}.${ext}` (extension preserved
64
- * from the input when present).
65
- */
66
- readonly opaqueId?: string;
67
- }
68
- /**
69
- * Sanitize a filename for a target-destination profile. Pure: same
70
- * input + options always returns the same output, no I/O.
71
- *
72
- * Returns the sanitized name. Throws {@link FilenameSanitizationError}
73
- * when the input cannot be made safe at all (NUL byte, empty after
74
- * normalization, missing `opaqueId` for the opaque profile,
75
- * `..` segment that would fall out of any reasonable target).
76
- */
77
- declare function sanitizeFilename(name: string, opts: SanitizeFilenameOptions): string;
78
-
79
- export { type FilenameProfile, type SanitizeFilenameOptions, sanitizeFilename };
@@ -1,27 +0,0 @@
1
- import { aK as MaterializedViewStrategy, aL as MaterializedViewStrategyHandle } from './types-CdVfiQgt.cjs';
2
-
3
- /**
4
- * Register a materialized view: a declared query whose result is
5
- * persisted as a queryable collection and kept fresh as sources
6
- * change. Writes go through the standard `Collection.put` pipeline;
7
- * refresh-driven deletes route through `Collection._internalDelete` so
8
- * user `onDelete` guards on the output collection aren't tripped by
9
- * housekeeping.
10
- *
11
- * Two registration modes:
12
- * - **single-source** — declare `query: (db) => Query<TRow>`; the
13
- * dependency analyzer derives source collections from the plan.
14
- * - **UNION** — declare `unionSources: [{ collection, map }, ...]`
15
- * plus optional `groupBy` + `aggregate`; the executor reads each
16
- * arm, maps to the unified row shape, concatenates, then groups
17
- * and aggregates.
18
- *
19
- * The two modes are mutually exclusive — exactly one of `query` /
20
- * `unionSources` must be set at registration time.
21
- *
22
- * See docs/superpowers/specs/2026-05-20-dim14-mv-v2-design.md (single-source v2)
23
- * and docs/superpowers/specs/2026-05-21-dim14-mv-multikey-and-union.md (UNION).
24
- */
25
- declare function withMaterializedView<TRow extends Record<string, unknown>>(spec: MaterializedViewStrategy<TRow>): MaterializedViewStrategyHandle;
26
-
27
- export { withMaterializedView as w };
@@ -1,13 +0,0 @@
1
- import { aM as OverlayedViewStrategy, aR as OverlayedViewStrategyHandle } from './types-CdVfiQgt.cjs';
2
-
3
- /**
4
- * Register a read-shadow overlay: bind an MV-owned base collection to
5
- * a user-writable overlay so consumers can express operator-editable
6
- * lifecycles as one declarative block (MV v2 spec § Composition
7
- * with operator-editable lifecycle).
8
- *
9
- * See docs/superpowers/specs/2026-05-20-dim14-mv-v2-design.md.
10
- */
11
- declare function withOverlayedView(spec: OverlayedViewStrategy): OverlayedViewStrategyHandle;
12
-
13
- export { withOverlayedView as w };
@@ -1,47 +0,0 @@
1
- import { aC as DerivationStrategy, aG as DerivationStrategyHandle } from './types-CdVfiQgt.cjs';
2
-
3
- /**
4
- * Register a deterministic derivation: one source collection → one or
5
- * more typed outputs, computed by the user's `derive` function on
6
- * plaintext after DEK unwrap. Outputs are encrypted with the same DEK
7
- * as the source and written via the standard `Collection.put` path.
8
- *
9
- * See docs/superpowers/specs/2026-05-01-dim14-derivation-v1-design.md.
10
- */
11
- declare function withDerivation<TSource extends Record<string, unknown>, TOutputs extends Record<string, Record<string, unknown>>>(spec: DerivationStrategy<TSource, TOutputs>): DerivationStrategyHandle;
12
-
13
- /**
14
- * `withRollup` — aggregate many child records onto a single field of their
15
- * parent (#376 slice 2). The reverse of a join: instead of reading children
16
- * on demand, the parent carries a maintained summary.
17
- *
18
- * ```ts
19
- * withRollup<Sale, Buyer>({
20
- * from: 'sales', // child collection (the trigger)
21
- * key: 'buyerId', // FK on the child → parent id
22
- * into: 'buyers', // parent collection
23
- * field: 'revenueByYear', // field on the parent to maintain
24
- * compute: (sales) => groupSumByYear(sales, 'total'),
25
- * })
26
- * ```
27
- *
28
- * On every write OR delete of a `from` record, the parent at id `child[key]`
29
- * is recomputed: `compute(allChildren where child[key] === parentId)` is
30
- * patched onto `parent[field]`. A parent write also recomputes its own
31
- * aggregate (so a parent created after its children still fills in). Only the
32
- * `field` is touched — the rest of the parent record is never clobbered — and
33
- * a value-equality guard suppresses no-op writes. The aggregate is gap-free
34
- * with respect to child inserts, updates, and deletes.
35
- *
36
- * Desugars to a `withDerivation` strategy carrying a `rollup` marker; dispatch
37
- * handles it without invoking the executor. Eager-only in this slice.
38
- */
39
- declare function withRollup<TChild extends Record<string, unknown> = Record<string, unknown>, TParent extends Record<string, unknown> = Record<string, unknown>>(config: {
40
- from: string;
41
- key: keyof TChild & string;
42
- into: string;
43
- field: keyof TParent & string;
44
- compute: (children: TChild[]) => unknown;
45
- }): DerivationStrategyHandle;
46
-
47
- export { withRollup as a, withDerivation as w };