@noy-db/hub 0.1.0-pre.10
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/LICENSE +21 -0
- package/README.md +197 -0
- package/dist/aggregate/index.cjs +476 -0
- package/dist/aggregate/index.cjs.map +1 -0
- package/dist/aggregate/index.d.cts +38 -0
- package/dist/aggregate/index.d.ts +38 -0
- package/dist/aggregate/index.js +53 -0
- package/dist/aggregate/index.js.map +1 -0
- package/dist/blobs/index.cjs +1480 -0
- package/dist/blobs/index.cjs.map +1 -0
- package/dist/blobs/index.d.cts +45 -0
- package/dist/blobs/index.d.ts +45 -0
- package/dist/blobs/index.js +48 -0
- package/dist/blobs/index.js.map +1 -0
- package/dist/bundle/index.cjs +496 -0
- package/dist/bundle/index.cjs.map +1 -0
- package/dist/bundle/index.d.cts +7 -0
- package/dist/bundle/index.d.ts +7 -0
- package/dist/bundle/index.js +51 -0
- package/dist/bundle/index.js.map +1 -0
- package/dist/chunk-2QR2PQTT.js +217 -0
- package/dist/chunk-2QR2PQTT.js.map +1 -0
- package/dist/chunk-72UIIX3E.js +1109 -0
- package/dist/chunk-72UIIX3E.js.map +1 -0
- package/dist/chunk-A4NFZKRW.js +722 -0
- package/dist/chunk-A4NFZKRW.js.map +1 -0
- package/dist/chunk-AOYCZP2H.js +793 -0
- package/dist/chunk-AOYCZP2H.js.map +1 -0
- package/dist/chunk-CIMZBAZB.js +72 -0
- package/dist/chunk-CIMZBAZB.js.map +1 -0
- package/dist/chunk-E3AGCGJ4.js +160 -0
- package/dist/chunk-E3AGCGJ4.js.map +1 -0
- package/dist/chunk-EKX3YVCI.js +97 -0
- package/dist/chunk-EKX3YVCI.js.map +1 -0
- package/dist/chunk-EMIGCR7X.js +39 -0
- package/dist/chunk-EMIGCR7X.js.map +1 -0
- package/dist/chunk-EMMRIE3C.js +72 -0
- package/dist/chunk-EMMRIE3C.js.map +1 -0
- package/dist/chunk-EUNIORPU.js +680 -0
- package/dist/chunk-EUNIORPU.js.map +1 -0
- package/dist/chunk-FZU343FL.js +32 -0
- package/dist/chunk-FZU343FL.js.map +1 -0
- package/dist/chunk-GHGXG53C.js +795 -0
- package/dist/chunk-GHGXG53C.js.map +1 -0
- package/dist/chunk-GKA4BGJN.js +79 -0
- package/dist/chunk-GKA4BGJN.js.map +1 -0
- package/dist/chunk-HG2OWBLX.js +430 -0
- package/dist/chunk-HG2OWBLX.js.map +1 -0
- package/dist/chunk-IGAROPKM.js +34 -0
- package/dist/chunk-IGAROPKM.js.map +1 -0
- package/dist/chunk-J66GRPNH.js +111 -0
- package/dist/chunk-J66GRPNH.js.map +1 -0
- package/dist/chunk-LVMMDXFT.js +275 -0
- package/dist/chunk-LVMMDXFT.js.map +1 -0
- package/dist/chunk-M5INGEFC.js +84 -0
- package/dist/chunk-M5INGEFC.js.map +1 -0
- package/dist/chunk-NBYQNDXA.js +557 -0
- package/dist/chunk-NBYQNDXA.js.map +1 -0
- package/dist/chunk-NPC4LFV5.js +132 -0
- package/dist/chunk-NPC4LFV5.js.map +1 -0
- package/dist/chunk-NSWHB5VQ.js +1285 -0
- package/dist/chunk-NSWHB5VQ.js.map +1 -0
- package/dist/chunk-OLM4LA6K.js +392 -0
- package/dist/chunk-OLM4LA6K.js.map +1 -0
- package/dist/chunk-UAFBZWFB.js +155 -0
- package/dist/chunk-UAFBZWFB.js.map +1 -0
- package/dist/chunk-UF3BUNQZ.js +1 -0
- package/dist/chunk-UF3BUNQZ.js.map +1 -0
- package/dist/chunk-UMMAVAYW.js +17 -0
- package/dist/chunk-UMMAVAYW.js.map +1 -0
- package/dist/chunk-UPY7WLBH.js +381 -0
- package/dist/chunk-UPY7WLBH.js.map +1 -0
- package/dist/chunk-W63BWEJH.js +311 -0
- package/dist/chunk-W63BWEJH.js.map +1 -0
- package/dist/chunk-WIGI5OJK.js +90 -0
- package/dist/chunk-WIGI5OJK.js.map +1 -0
- package/dist/chunk-XNL2TKKR.js +490 -0
- package/dist/chunk-XNL2TKKR.js.map +1 -0
- package/dist/chunk-XWNUJPIS.js +367 -0
- package/dist/chunk-XWNUJPIS.js.map +1 -0
- package/dist/chunk-YWKJZZGV.js +715 -0
- package/dist/chunk-YWKJZZGV.js.map +1 -0
- package/dist/consent/index.cjs +204 -0
- package/dist/consent/index.cjs.map +1 -0
- package/dist/consent/index.d.cts +24 -0
- package/dist/consent/index.d.ts +24 -0
- package/dist/consent/index.js +23 -0
- package/dist/consent/index.js.map +1 -0
- package/dist/crdt/index.cjs +152 -0
- package/dist/crdt/index.cjs.map +1 -0
- package/dist/crdt/index.d.cts +30 -0
- package/dist/crdt/index.d.ts +30 -0
- package/dist/crdt/index.js +24 -0
- package/dist/crdt/index.js.map +1 -0
- package/dist/crypto-6PNIHP7W.js +44 -0
- package/dist/crypto-6PNIHP7W.js.map +1 -0
- package/dist/delegation-WVIVMF73.js +17 -0
- package/dist/delegation-WVIVMF73.js.map +1 -0
- package/dist/dev-unlock-D4xB0_gs.d.cts +263 -0
- package/dist/dev-unlock-Dz8GEbd3.d.ts +263 -0
- package/dist/hash--EflSV65.d.cts +63 -0
- package/dist/hash-CRdXYnv3.d.ts +63 -0
- package/dist/history/index.cjs +1215 -0
- package/dist/history/index.cjs.map +1 -0
- package/dist/history/index.d.cts +62 -0
- package/dist/history/index.d.ts +62 -0
- package/dist/history/index.js +79 -0
- package/dist/history/index.js.map +1 -0
- package/dist/i18n/index.cjs +840 -0
- package/dist/i18n/index.cjs.map +1 -0
- package/dist/i18n/index.d.cts +38 -0
- package/dist/i18n/index.d.ts +38 -0
- package/dist/i18n/index.js +68 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/index-CD1VnONm.d.cts +415 -0
- package/dist/index-CLRxPs-W.d.cts +1960 -0
- package/dist/index-CUi9wfss.d.ts +415 -0
- package/dist/index-DtV93TMP.d.ts +1960 -0
- package/dist/index.cjs +17387 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +565 -0
- package/dist/index.d.ts +565 -0
- package/dist/index.js +7525 -0
- package/dist/index.js.map +1 -0
- package/dist/indexing/index.cjs +736 -0
- package/dist/indexing/index.cjs.map +1 -0
- package/dist/indexing/index.d.cts +36 -0
- package/dist/indexing/index.d.ts +36 -0
- package/dist/indexing/index.js +77 -0
- package/dist/indexing/index.js.map +1 -0
- package/dist/lazy-builder-BwEoBQZ9.d.ts +304 -0
- package/dist/lazy-builder-CZVLKh0Z.d.cts +304 -0
- package/dist/ledger-HBBH2NPZ.js +33 -0
- package/dist/ledger-HBBH2NPZ.js.map +1 -0
- package/dist/mime-magic-CBBSOkjm.d.cts +50 -0
- package/dist/mime-magic-CBBSOkjm.d.ts +50 -0
- package/dist/periods/index.cjs +1035 -0
- package/dist/periods/index.cjs.map +1 -0
- package/dist/periods/index.d.cts +21 -0
- package/dist/periods/index.d.ts +21 -0
- package/dist/periods/index.js +25 -0
- package/dist/periods/index.js.map +1 -0
- package/dist/predicate-SBHmi6D0.d.cts +161 -0
- package/dist/predicate-SBHmi6D0.d.ts +161 -0
- package/dist/public-envelope-TLQA6REO.js +31 -0
- package/dist/public-envelope-TLQA6REO.js.map +1 -0
- package/dist/query/index.cjs +1999 -0
- package/dist/query/index.cjs.map +1 -0
- package/dist/query/index.d.cts +3 -0
- package/dist/query/index.d.ts +3 -0
- package/dist/query/index.js +73 -0
- package/dist/query/index.js.map +1 -0
- package/dist/session/index.cjs +495 -0
- package/dist/session/index.cjs.map +1 -0
- package/dist/session/index.d.cts +45 -0
- package/dist/session/index.d.ts +45 -0
- package/dist/session/index.js +51 -0
- package/dist/session/index.js.map +1 -0
- package/dist/shadow/index.cjs +133 -0
- package/dist/shadow/index.cjs.map +1 -0
- package/dist/shadow/index.d.cts +16 -0
- package/dist/shadow/index.d.ts +16 -0
- package/dist/shadow/index.js +20 -0
- package/dist/shadow/index.js.map +1 -0
- package/dist/store/index.cjs +1083 -0
- package/dist/store/index.cjs.map +1 -0
- package/dist/store/index.d.cts +491 -0
- package/dist/store/index.d.ts +491 -0
- package/dist/store/index.js +37 -0
- package/dist/store/index.js.map +1 -0
- package/dist/strategy-BSxFXGzb.d.cts +110 -0
- package/dist/strategy-BSxFXGzb.d.ts +110 -0
- package/dist/strategy-D-SrOLCl.d.cts +548 -0
- package/dist/strategy-D-SrOLCl.d.ts +548 -0
- package/dist/sync/index.cjs +1062 -0
- package/dist/sync/index.cjs.map +1 -0
- package/dist/sync/index.d.cts +42 -0
- package/dist/sync/index.d.ts +42 -0
- package/dist/sync/index.js +28 -0
- package/dist/sync/index.js.map +1 -0
- package/dist/team/index.cjs +2606 -0
- package/dist/team/index.cjs.map +1 -0
- package/dist/team/index.d.cts +117 -0
- package/dist/team/index.d.ts +117 -0
- package/dist/team/index.js +106 -0
- package/dist/team/index.js.map +1 -0
- package/dist/tx/index.cjs +212 -0
- package/dist/tx/index.cjs.map +1 -0
- package/dist/tx/index.d.cts +20 -0
- package/dist/tx/index.d.ts +20 -0
- package/dist/tx/index.js +20 -0
- package/dist/tx/index.js.map +1 -0
- package/dist/types-DSFLtbKg.d.ts +9702 -0
- package/dist/types-zwwMOqkg.d.cts +9702 -0
- package/dist/ulid-COREQ2RQ.js +9 -0
- package/dist/ulid-COREQ2RQ.js.map +1 -0
- package/dist/util/index.cjs +230 -0
- package/dist/util/index.cjs.map +1 -0
- package/dist/util/index.d.cts +77 -0
- package/dist/util/index.d.ts +77 -0
- package/dist/util/index.js +190 -0
- package/dist/util/index.js.map +1 -0
- package/package.json +244 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Z as ConsentStrategy } from '../types-zwwMOqkg.cjs';
|
|
2
|
+
export { _ as CONSENT_AUDIT_COLLECTION, $ as ConsentAuditEntry, a0 as ConsentAuditFilter, a1 as ConsentContext, a2 as ConsentOp, a3 as loadConsentEntries, a4 as writeConsentEntry } from '../types-zwwMOqkg.cjs';
|
|
3
|
+
import '../lazy-builder-CZVLKh0Z.cjs';
|
|
4
|
+
import '../predicate-SBHmi6D0.cjs';
|
|
5
|
+
import '../strategy-D-SrOLCl.cjs';
|
|
6
|
+
import '../strategy-BSxFXGzb.cjs';
|
|
7
|
+
import '../index-CLRxPs-W.cjs';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Active consent strategy. Calling `withConsent()` returns a
|
|
11
|
+
* `ConsentStrategy` that delegates to the real
|
|
12
|
+
* `writeConsentEntry` / `loadConsentEntries` functions. Only
|
|
13
|
+
* reachable through the `@noy-db/hub/consent` subpath.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Build the default consent strategy. Pass into
|
|
18
|
+
* `createNoydb({ consentStrategy: withConsent() })` to enable
|
|
19
|
+
* per-operation audit writes into the reserved `_consent_audit`
|
|
20
|
+
* collection.
|
|
21
|
+
*/
|
|
22
|
+
declare function withConsent(): ConsentStrategy;
|
|
23
|
+
|
|
24
|
+
export { ConsentStrategy, withConsent };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Z as ConsentStrategy } from '../types-DSFLtbKg.js';
|
|
2
|
+
export { _ as CONSENT_AUDIT_COLLECTION, $ as ConsentAuditEntry, a0 as ConsentAuditFilter, a1 as ConsentContext, a2 as ConsentOp, a3 as loadConsentEntries, a4 as writeConsentEntry } from '../types-DSFLtbKg.js';
|
|
3
|
+
import '../lazy-builder-BwEoBQZ9.js';
|
|
4
|
+
import '../predicate-SBHmi6D0.js';
|
|
5
|
+
import '../strategy-D-SrOLCl.js';
|
|
6
|
+
import '../strategy-BSxFXGzb.js';
|
|
7
|
+
import '../index-DtV93TMP.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Active consent strategy. Calling `withConsent()` returns a
|
|
11
|
+
* `ConsentStrategy` that delegates to the real
|
|
12
|
+
* `writeConsentEntry` / `loadConsentEntries` functions. Only
|
|
13
|
+
* reachable through the `@noy-db/hub/consent` subpath.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Build the default consent strategy. Pass into
|
|
18
|
+
* `createNoydb({ consentStrategy: withConsent() })` to enable
|
|
19
|
+
* per-operation audit writes into the reserved `_consent_audit`
|
|
20
|
+
* collection.
|
|
21
|
+
*/
|
|
22
|
+
declare function withConsent(): ConsentStrategy;
|
|
23
|
+
|
|
24
|
+
export { ConsentStrategy, withConsent };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CONSENT_AUDIT_COLLECTION,
|
|
3
|
+
loadConsentEntries,
|
|
4
|
+
writeConsentEntry
|
|
5
|
+
} from "../chunk-EMMRIE3C.js";
|
|
6
|
+
import "../chunk-FZU343FL.js";
|
|
7
|
+
import "../chunk-LVMMDXFT.js";
|
|
8
|
+
import "../chunk-NBYQNDXA.js";
|
|
9
|
+
|
|
10
|
+
// src/consent/active.ts
|
|
11
|
+
function withConsent() {
|
|
12
|
+
return {
|
|
13
|
+
write: writeConsentEntry,
|
|
14
|
+
read: loadConsentEntries
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
CONSENT_AUDIT_COLLECTION,
|
|
19
|
+
loadConsentEntries,
|
|
20
|
+
withConsent,
|
|
21
|
+
writeConsentEntry
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/consent/active.ts"],"sourcesContent":["/**\n * Active consent strategy. Calling `withConsent()` returns a\n * `ConsentStrategy` that delegates to the real\n * `writeConsentEntry` / `loadConsentEntries` functions. Only\n * reachable through the `@noy-db/hub/consent` subpath.\n */\n\nimport { writeConsentEntry, loadConsentEntries } from './consent.js'\nimport type { ConsentStrategy } from './strategy.js'\n\n/**\n * Build the default consent strategy. Pass into\n * `createNoydb({ consentStrategy: withConsent() })` to enable\n * per-operation audit writes into the reserved `_consent_audit`\n * collection.\n */\nexport function withConsent(): ConsentStrategy {\n return {\n write: writeConsentEntry,\n read: loadConsentEntries,\n }\n}\n"],"mappings":";;;;;;;;;;AAgBO,SAAS,cAA+B;AAC7C,SAAO;AAAA,IACL,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AACF;","names":[]}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/crdt/index.ts
|
|
21
|
+
var crdt_exports = {};
|
|
22
|
+
__export(crdt_exports, {
|
|
23
|
+
buildLwwMapState: () => buildLwwMapState,
|
|
24
|
+
buildRgaState: () => buildRgaState,
|
|
25
|
+
mergeCrdtStates: () => mergeCrdtStates,
|
|
26
|
+
resolveCrdtSnapshot: () => resolveCrdtSnapshot,
|
|
27
|
+
withCrdt: () => withCrdt
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(crdt_exports);
|
|
30
|
+
|
|
31
|
+
// src/crdt/crdt.ts
|
|
32
|
+
function resolveCrdtSnapshot(state) {
|
|
33
|
+
switch (state._crdt) {
|
|
34
|
+
case "lww-map": {
|
|
35
|
+
const result = {};
|
|
36
|
+
for (const [field, reg] of Object.entries(state.fields)) {
|
|
37
|
+
result[field] = reg.v;
|
|
38
|
+
}
|
|
39
|
+
return result;
|
|
40
|
+
}
|
|
41
|
+
case "rga": {
|
|
42
|
+
const dead = new Set(state.tombstones);
|
|
43
|
+
return state.items.filter((i) => !dead.has(i.nid)).map((i) => i.v);
|
|
44
|
+
}
|
|
45
|
+
case "yjs":
|
|
46
|
+
return state.update;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function mergeCrdtStates(a, b) {
|
|
50
|
+
if (a._crdt !== b._crdt) return a;
|
|
51
|
+
switch (a._crdt) {
|
|
52
|
+
case "lww-map":
|
|
53
|
+
return mergeLwwMap(a, b);
|
|
54
|
+
case "rga":
|
|
55
|
+
return mergeRga(a, b);
|
|
56
|
+
case "yjs":
|
|
57
|
+
return a;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function mergeLwwMap(a, b) {
|
|
61
|
+
const merged = {};
|
|
62
|
+
const allFields = /* @__PURE__ */ new Set([...Object.keys(a.fields), ...Object.keys(b.fields)]);
|
|
63
|
+
for (const field of allFields) {
|
|
64
|
+
const fa = a.fields[field];
|
|
65
|
+
const fb = b.fields[field];
|
|
66
|
+
if (!fa) {
|
|
67
|
+
merged[field] = fb;
|
|
68
|
+
} else if (!fb) {
|
|
69
|
+
merged[field] = fa;
|
|
70
|
+
} else {
|
|
71
|
+
merged[field] = fa.ts >= fb.ts ? fa : fb;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return { _crdt: "lww-map", fields: merged };
|
|
75
|
+
}
|
|
76
|
+
function mergeRga(a, b) {
|
|
77
|
+
const allTombstones = /* @__PURE__ */ new Set([...a.tombstones, ...b.tombstones]);
|
|
78
|
+
const seenNids = new Set(a.items.map((i) => i.nid));
|
|
79
|
+
const merged = [
|
|
80
|
+
...a.items,
|
|
81
|
+
...b.items.filter((i) => !seenNids.has(i.nid))
|
|
82
|
+
];
|
|
83
|
+
return { _crdt: "rga", items: merged, tombstones: [...allTombstones] };
|
|
84
|
+
}
|
|
85
|
+
function buildLwwMapState(record, existing, now) {
|
|
86
|
+
const fields = {};
|
|
87
|
+
for (const [field, value] of Object.entries(record)) {
|
|
88
|
+
fields[field] = { v: value, ts: now };
|
|
89
|
+
}
|
|
90
|
+
if (existing) {
|
|
91
|
+
for (const [field, reg] of Object.entries(existing.fields)) {
|
|
92
|
+
if (!(field in fields)) {
|
|
93
|
+
fields[field] = reg;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return { _crdt: "lww-map", fields };
|
|
98
|
+
}
|
|
99
|
+
function buildRgaState(arr, existing, generateNid) {
|
|
100
|
+
const existingByValue = /* @__PURE__ */ new Map();
|
|
101
|
+
if (existing) {
|
|
102
|
+
for (const item of existing.items) {
|
|
103
|
+
const key = JSON.stringify(item.v);
|
|
104
|
+
if (!existingByValue.has(key)) existingByValue.set(key, item);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
const usedNids = /* @__PURE__ */ new Set();
|
|
108
|
+
const newItems = [];
|
|
109
|
+
for (const el of arr) {
|
|
110
|
+
const key = JSON.stringify(el);
|
|
111
|
+
const match = existingByValue.get(key);
|
|
112
|
+
if (match && !usedNids.has(match.nid)) {
|
|
113
|
+
newItems.push(match);
|
|
114
|
+
usedNids.add(match.nid);
|
|
115
|
+
} else {
|
|
116
|
+
const nid = generateNid();
|
|
117
|
+
newItems.push({ nid, v: el });
|
|
118
|
+
usedNids.add(nid);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
const tombstones = existing ? [...existing.tombstones] : [];
|
|
122
|
+
const extraItems = [];
|
|
123
|
+
if (existing) {
|
|
124
|
+
for (const item of existing.items) {
|
|
125
|
+
if (!usedNids.has(item.nid)) {
|
|
126
|
+
if (!tombstones.includes(item.nid)) tombstones.push(item.nid);
|
|
127
|
+
extraItems.push(item);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
const items = [...newItems, ...extraItems];
|
|
132
|
+
return { _crdt: "rga", items, tombstones };
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// src/crdt/active.ts
|
|
136
|
+
function withCrdt() {
|
|
137
|
+
return {
|
|
138
|
+
buildLwwMapState,
|
|
139
|
+
buildRgaState,
|
|
140
|
+
mergeCrdtStates,
|
|
141
|
+
resolveCrdtSnapshot
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
145
|
+
0 && (module.exports = {
|
|
146
|
+
buildLwwMapState,
|
|
147
|
+
buildRgaState,
|
|
148
|
+
mergeCrdtStates,
|
|
149
|
+
resolveCrdtSnapshot,
|
|
150
|
+
withCrdt
|
|
151
|
+
});
|
|
152
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/crdt/index.ts","../../src/crdt/crdt.ts","../../src/crdt/active.ts"],"sourcesContent":["/**\n * @noy-db/hub/crdt — opt-in CRDT (conflict-free replicated data type)\n * subsystem.\n *\n * @category capability\n *\n * Collaborative-editing primitives: LWW-Map, RGA (sequence CRDT), and\n * a Yjs bridge state shape. Enabled per-collection via\n * `collection(name, { crdt: 'lww-map' | 'rga' | 'yjs' })`. Apps that\n * stick to plain record-level last-write-wins can omit this subpath\n * and save ~221 LOC of state / merge / snapshot helpers.\n */\n\nexport { withCrdt } from './active.js'\nexport type { CrdtStrategy } from './strategy.js'\n\nexport {\n resolveCrdtSnapshot,\n mergeCrdtStates,\n buildLwwMapState,\n buildRgaState,\n} from './crdt.js'\nexport type {\n CrdtMode,\n CrdtState,\n LwwMapState,\n RgaState,\n YjsState,\n} from './crdt.js'\n","/**\n * CRDT state types, merge logic, and build helpers.\n * per-collection CRDT mode: 'lww-map' | 'rga' | 'yjs'\n *\n * The encrypted envelope wraps the CRDT state (not the resolved snapshot).\n * Adapters only ever see ciphertext. `collection.get(id)` returns the\n * resolved snapshot; `collection.getRaw(id)` returns the full CRDT state.\n */\n\n// ─── Mode ─────────────────────────────────────────────────────────────\n\n/** Per-collection CRDT mode. */\nexport type CrdtMode = 'lww-map' | 'rga' | 'yjs'\n\n// ─── State shapes ─────────────────────────────────────────────────────\n\n/**\n * Per-field last-write-wins registers.\n * Each field carries its latest value and the ISO timestamp of the last write.\n * Merge: for each field, keep the entry with the lexicographically higher `ts`.\n */\nexport interface LwwMapState {\n readonly _crdt: 'lww-map'\n readonly fields: Record<string, { readonly v: unknown; readonly ts: string }>\n}\n\n/**\n * Simplified Replicated Growable Array.\n * Items are assigned stable NID (noy-db id) strings on first insertion.\n * Deleted items are tracked as tombstones so concurrent removals commute.\n *\n * The resolved snapshot is the ordered list of non-tombstoned `v` values.\n */\nexport interface RgaState {\n readonly _crdt: 'rga'\n readonly items: ReadonlyArray<{ readonly nid: string; readonly v: unknown }>\n readonly tombstones: readonly string[]\n}\n\n/**\n * Yjs binary state marker. `update` is base64(Y.encodeStateAsUpdate()).\n * Core stores and retrieves the blob opaquely. `@noy-db/yjs` is responsible\n * for encoding, decoding, and merging via `Y.mergeUpdates`.\n * Core falls back to last-write-wins (higher `_v`) for conflict resolution.\n */\nexport interface YjsState {\n readonly _crdt: 'yjs'\n /** base64-encoded Y.encodeStateAsUpdate() bytes. */\n readonly update: string\n}\n\nexport type CrdtState = LwwMapState | RgaState | YjsState\n\n// ─── Snapshot resolution ──────────────────────────────────────────────\n\n/**\n * Resolve a CRDT state into the end-user record snapshot.\n *\n * - `lww-map` → `Record<string, unknown>` (field values extracted from registers)\n * - `rga` → `unknown[]` (non-tombstoned items in insertion order)\n * - `yjs` → `string` (base64 update blob; use @noy-db/yjs for a Y.Doc)\n */\nexport function resolveCrdtSnapshot(state: CrdtState): unknown {\n switch (state._crdt) {\n case 'lww-map': {\n const result: Record<string, unknown> = {}\n for (const [field, reg] of Object.entries(state.fields)) {\n result[field] = reg.v\n }\n return result\n }\n case 'rga': {\n const dead = new Set(state.tombstones)\n return state.items.filter(i => !dead.has(i.nid)).map(i => i.v)\n }\n case 'yjs':\n return state.update\n }\n}\n\n// ─── CRDT merge ───────────────────────────────────────────────────────\n\n/**\n * Merge two CRDT states produced by concurrent writes.\n * Called by the collection-level conflict resolver registered with SyncEngine.\n *\n * For `yjs`: core cannot merge Yjs without importing the `yjs` package.\n * The caller must handle that case by falling back to the higher-`_v` envelope.\n */\nexport function mergeCrdtStates(a: CrdtState, b: CrdtState): CrdtState {\n // Mismatched modes shouldn't happen in practice — same collection, same schema.\n if (a._crdt !== b._crdt) return a\n\n switch (a._crdt) {\n case 'lww-map':\n return mergeLwwMap(a, b as LwwMapState)\n case 'rga':\n return mergeRga(a, b as RgaState)\n case 'yjs':\n // Signal to caller that Yjs merge is needed externally\n return a\n }\n}\n\nfunction mergeLwwMap(a: LwwMapState, b: LwwMapState): LwwMapState {\n const merged: Record<string, { v: unknown; ts: string }> = {}\n const allFields = new Set([...Object.keys(a.fields), ...Object.keys(b.fields)])\n for (const field of allFields) {\n const fa = a.fields[field]\n const fb = b.fields[field]\n if (!fa) { merged[field] = fb! }\n else if (!fb) { merged[field] = fa }\n else { merged[field] = fa.ts >= fb.ts ? fa : fb }\n }\n return { _crdt: 'lww-map', fields: merged }\n}\n\nfunction mergeRga(a: RgaState, b: RgaState): RgaState {\n // Union tombstones from both sides\n const allTombstones = new Set([...a.tombstones, ...b.tombstones])\n // Union items by nid: start with a's ordering, append b-only items\n const seenNids = new Set(a.items.map(i => i.nid))\n const merged: Array<{ nid: string; v: unknown }> = [\n ...a.items,\n ...b.items.filter(i => !seenNids.has(i.nid)),\n ]\n return { _crdt: 'rga', items: merged, tombstones: [...allTombstones] }\n}\n\n// ─── Build helpers ────────────────────────────────────────────────────\n\n/**\n * Build (or update) an lww-map state from a new record.\n *\n * All fields in the new record win at timestamp `now`.\n * Fields present in the existing state but absent from the new record\n * are preserved (they were written by another device).\n */\nexport function buildLwwMapState(\n record: Record<string, unknown>,\n existing: LwwMapState | undefined,\n now: string,\n): LwwMapState {\n const fields: Record<string, { v: unknown; ts: string }> = {}\n\n // New record fields all get the current timestamp — this device wins for these\n for (const [field, value] of Object.entries(record)) {\n fields[field] = { v: value, ts: now }\n }\n\n // Preserve fields from the existing state that aren't in the new record\n if (existing) {\n for (const [field, reg] of Object.entries(existing.fields)) {\n if (!(field in fields)) {\n fields[field] = reg\n }\n }\n }\n\n return { _crdt: 'lww-map', fields }\n}\n\n/**\n * Build (or update) an RGA state from a new array.\n *\n * Existing items are matched to new elements by deep-equality of their `v`.\n * Unmatched existing items are tombstoned. New elements that have no existing\n * match get a fresh NID via `generateNid()`.\n */\nexport function buildRgaState(\n arr: unknown[],\n existing: RgaState | undefined,\n generateNid: () => string,\n): RgaState {\n // Build an index from JSON(v) → existing item so we can match by value\n const existingByValue = new Map<string, { nid: string; v: unknown }>()\n if (existing) {\n for (const item of existing.items) {\n // Only add first occurrence per value to avoid double-matching\n const key = JSON.stringify(item.v)\n if (!existingByValue.has(key)) existingByValue.set(key, item)\n }\n }\n\n const usedNids = new Set<string>()\n const newItems: Array<{ nid: string; v: unknown }> = []\n\n for (const el of arr) {\n const key = JSON.stringify(el)\n const match = existingByValue.get(key)\n if (match && !usedNids.has(match.nid)) {\n // Reuse existing NID to preserve cross-device identity\n newItems.push(match)\n usedNids.add(match.nid)\n } else {\n // New element — assign a fresh NID\n const nid = generateNid()\n newItems.push({ nid, v: el })\n usedNids.add(nid)\n }\n }\n\n // Elements in the existing state that aren't in the new array → tombstone.\n // Tombstoned items are kept in the items array to preserve ordering for\n // cross-device merge — the resolved snapshot filters them out.\n const tombstones: string[] = existing ? [...existing.tombstones] : []\n const extraItems: Array<{ nid: string; v: unknown }> = []\n if (existing) {\n for (const item of existing.items) {\n if (!usedNids.has(item.nid)) {\n if (!tombstones.includes(item.nid)) tombstones.push(item.nid)\n extraItems.push(item) // retain in items for ordering\n }\n }\n }\n\n // Final items: live items in new order, then tombstoned extras at the end\n const items = [...newItems, ...extraItems]\n\n return { _crdt: 'rga', items, tombstones }\n}\n","/**\n * Active CRDT strategy factory. Calling `withCrdt()` returns a\n * `CrdtStrategy` whose methods delegate to the real LWW-Map / RGA /\n * merge / snapshot helpers in `./crdt.ts`. Only reachable through\n * the `@noy-db/hub/crdt` subpath.\n */\n\nimport {\n buildLwwMapState,\n buildRgaState,\n mergeCrdtStates,\n resolveCrdtSnapshot,\n} from './crdt.js'\nimport type { CrdtStrategy } from './strategy.js'\n\n/**\n * Build the default CRDT strategy. Pass into\n * `createNoydb({ crdtStrategy: withCrdt() })` to enable collections\n * declared with `crdt: 'lww-map' | 'rga' | 'yjs'`.\n *\n * @example\n * ```ts\n * import { createNoydb } from '@noy-db/hub'\n * import { withCrdt } from '@noy-db/hub/crdt'\n *\n * const db = await createNoydb({\n * store, user, secret,\n * crdtStrategy: withCrdt(),\n * })\n * const notes = vault.collection('notes', { crdt: 'lww-map' })\n * ```\n */\nexport function withCrdt(): CrdtStrategy {\n return {\n buildLwwMapState,\n buildRgaState,\n mergeCrdtStates,\n resolveCrdtSnapshot,\n }\n}\n"],"mappings":"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","names":[]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { C as CrdtStrategy } from '../strategy-BSxFXGzb.cjs';
|
|
2
|
+
export { a as CrdtMode, b as CrdtState, L as LwwMapState, R as RgaState, Y as YjsState, c as buildLwwMapState, d as buildRgaState, m as mergeCrdtStates, r as resolveCrdtSnapshot } from '../strategy-BSxFXGzb.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Active CRDT strategy factory. Calling `withCrdt()` returns a
|
|
6
|
+
* `CrdtStrategy` whose methods delegate to the real LWW-Map / RGA /
|
|
7
|
+
* merge / snapshot helpers in `./crdt.ts`. Only reachable through
|
|
8
|
+
* the `@noy-db/hub/crdt` subpath.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Build the default CRDT strategy. Pass into
|
|
13
|
+
* `createNoydb({ crdtStrategy: withCrdt() })` to enable collections
|
|
14
|
+
* declared with `crdt: 'lww-map' | 'rga' | 'yjs'`.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { createNoydb } from '@noy-db/hub'
|
|
19
|
+
* import { withCrdt } from '@noy-db/hub/crdt'
|
|
20
|
+
*
|
|
21
|
+
* const db = await createNoydb({
|
|
22
|
+
* store, user, secret,
|
|
23
|
+
* crdtStrategy: withCrdt(),
|
|
24
|
+
* })
|
|
25
|
+
* const notes = vault.collection('notes', { crdt: 'lww-map' })
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
declare function withCrdt(): CrdtStrategy;
|
|
29
|
+
|
|
30
|
+
export { CrdtStrategy, withCrdt };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { C as CrdtStrategy } from '../strategy-BSxFXGzb.js';
|
|
2
|
+
export { a as CrdtMode, b as CrdtState, L as LwwMapState, R as RgaState, Y as YjsState, c as buildLwwMapState, d as buildRgaState, m as mergeCrdtStates, r as resolveCrdtSnapshot } from '../strategy-BSxFXGzb.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Active CRDT strategy factory. Calling `withCrdt()` returns a
|
|
6
|
+
* `CrdtStrategy` whose methods delegate to the real LWW-Map / RGA /
|
|
7
|
+
* merge / snapshot helpers in `./crdt.ts`. Only reachable through
|
|
8
|
+
* the `@noy-db/hub/crdt` subpath.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Build the default CRDT strategy. Pass into
|
|
13
|
+
* `createNoydb({ crdtStrategy: withCrdt() })` to enable collections
|
|
14
|
+
* declared with `crdt: 'lww-map' | 'rga' | 'yjs'`.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { createNoydb } from '@noy-db/hub'
|
|
19
|
+
* import { withCrdt } from '@noy-db/hub/crdt'
|
|
20
|
+
*
|
|
21
|
+
* const db = await createNoydb({
|
|
22
|
+
* store, user, secret,
|
|
23
|
+
* crdtStrategy: withCrdt(),
|
|
24
|
+
* })
|
|
25
|
+
* const notes = vault.collection('notes', { crdt: 'lww-map' })
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
declare function withCrdt(): CrdtStrategy;
|
|
29
|
+
|
|
30
|
+
export { CrdtStrategy, withCrdt };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildLwwMapState,
|
|
3
|
+
buildRgaState,
|
|
4
|
+
mergeCrdtStates,
|
|
5
|
+
resolveCrdtSnapshot
|
|
6
|
+
} from "../chunk-J66GRPNH.js";
|
|
7
|
+
|
|
8
|
+
// src/crdt/active.ts
|
|
9
|
+
function withCrdt() {
|
|
10
|
+
return {
|
|
11
|
+
buildLwwMapState,
|
|
12
|
+
buildRgaState,
|
|
13
|
+
mergeCrdtStates,
|
|
14
|
+
resolveCrdtSnapshot
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
buildLwwMapState,
|
|
19
|
+
buildRgaState,
|
|
20
|
+
mergeCrdtStates,
|
|
21
|
+
resolveCrdtSnapshot,
|
|
22
|
+
withCrdt
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/crdt/active.ts"],"sourcesContent":["/**\n * Active CRDT strategy factory. Calling `withCrdt()` returns a\n * `CrdtStrategy` whose methods delegate to the real LWW-Map / RGA /\n * merge / snapshot helpers in `./crdt.ts`. Only reachable through\n * the `@noy-db/hub/crdt` subpath.\n */\n\nimport {\n buildLwwMapState,\n buildRgaState,\n mergeCrdtStates,\n resolveCrdtSnapshot,\n} from './crdt.js'\nimport type { CrdtStrategy } from './strategy.js'\n\n/**\n * Build the default CRDT strategy. Pass into\n * `createNoydb({ crdtStrategy: withCrdt() })` to enable collections\n * declared with `crdt: 'lww-map' | 'rga' | 'yjs'`.\n *\n * @example\n * ```ts\n * import { createNoydb } from '@noy-db/hub'\n * import { withCrdt } from '@noy-db/hub/crdt'\n *\n * const db = await createNoydb({\n * store, user, secret,\n * crdtStrategy: withCrdt(),\n * })\n * const notes = vault.collection('notes', { crdt: 'lww-map' })\n * ```\n */\nexport function withCrdt(): CrdtStrategy {\n return {\n buildLwwMapState,\n buildRgaState,\n mergeCrdtStates,\n resolveCrdtSnapshot,\n }\n}\n"],"mappings":";;;;;;;;AAgCO,SAAS,WAAyB;AACvC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import {
|
|
2
|
+
base64ToBuffer,
|
|
3
|
+
bufferToBase64,
|
|
4
|
+
decrypt,
|
|
5
|
+
decryptBytes,
|
|
6
|
+
decryptBytesWithAAD,
|
|
7
|
+
decryptDeterministic,
|
|
8
|
+
deriveKey,
|
|
9
|
+
derivePresenceKey,
|
|
10
|
+
encrypt,
|
|
11
|
+
encryptBytes,
|
|
12
|
+
encryptBytesWithAAD,
|
|
13
|
+
encryptDeterministic,
|
|
14
|
+
generateDEK,
|
|
15
|
+
generateIV,
|
|
16
|
+
generateSalt,
|
|
17
|
+
hmacSha256Hex,
|
|
18
|
+
sha256Hex,
|
|
19
|
+
unwrapKey,
|
|
20
|
+
wrapKey
|
|
21
|
+
} from "./chunk-LVMMDXFT.js";
|
|
22
|
+
import "./chunk-NBYQNDXA.js";
|
|
23
|
+
export {
|
|
24
|
+
base64ToBuffer,
|
|
25
|
+
bufferToBase64,
|
|
26
|
+
decrypt,
|
|
27
|
+
decryptBytes,
|
|
28
|
+
decryptBytesWithAAD,
|
|
29
|
+
decryptDeterministic,
|
|
30
|
+
deriveKey,
|
|
31
|
+
derivePresenceKey,
|
|
32
|
+
encrypt,
|
|
33
|
+
encryptBytes,
|
|
34
|
+
encryptBytesWithAAD,
|
|
35
|
+
encryptDeterministic,
|
|
36
|
+
generateDEK,
|
|
37
|
+
generateIV,
|
|
38
|
+
generateSalt,
|
|
39
|
+
hmacSha256Hex,
|
|
40
|
+
sha256Hex,
|
|
41
|
+
unwrapKey,
|
|
42
|
+
wrapKey
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=crypto-6PNIHP7W.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DELEGATIONS_COLLECTION,
|
|
3
|
+
issueDelegation,
|
|
4
|
+
loadActiveDelegations,
|
|
5
|
+
revokeDelegation
|
|
6
|
+
} from "./chunk-EKX3YVCI.js";
|
|
7
|
+
import "./chunk-IGAROPKM.js";
|
|
8
|
+
import "./chunk-FZU343FL.js";
|
|
9
|
+
import "./chunk-LVMMDXFT.js";
|
|
10
|
+
import "./chunk-NBYQNDXA.js";
|
|
11
|
+
export {
|
|
12
|
+
DELEGATIONS_COLLECTION,
|
|
13
|
+
issueDelegation,
|
|
14
|
+
loadActiveDelegations,
|
|
15
|
+
revokeDelegation
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=delegation-WVIVMF73.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|