@acornly/adapter-indexeddb 0.0.0-stage → 0.2.1
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/dist/index.d.ts +103 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +562 -0
- package/dist/index.js.map +1 -0
- package/package.json +28 -3
- package/README.md +0 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Free Solo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { type Annotation, type ChangeEvent, type ListQuery, type StorageAdapter, type ThreadStore, type Unsubscribe, type VersionStore } from "@acornly/core";
|
|
2
|
+
/** A search across every stored note, for a list of all pages' notes. */
|
|
3
|
+
export interface SearchQuery {
|
|
4
|
+
/**
|
|
5
|
+
* Words to look for, matched case-insensitively as one string against the bodies (text and
|
|
6
|
+
* summaries) and quoted text. Empty matches every note.
|
|
7
|
+
*/
|
|
8
|
+
text: string;
|
|
9
|
+
/** Only notes in this scope. */
|
|
10
|
+
scope?: string;
|
|
11
|
+
/** At most this many, newest first by `modified`. Defaults to 50. */
|
|
12
|
+
limit?: number;
|
|
13
|
+
}
|
|
14
|
+
/** A page of every stored note, for `listAll`. */
|
|
15
|
+
export interface ListAllQuery {
|
|
16
|
+
/** Only ids after this one. */
|
|
17
|
+
after?: string;
|
|
18
|
+
/** At most this many. Defaults to 500. */
|
|
19
|
+
limit?: number;
|
|
20
|
+
}
|
|
21
|
+
export interface IndexedDBAdapterOptions {
|
|
22
|
+
/** Database name. Defaults to `acornly`. */
|
|
23
|
+
name?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Awaited before the database is first opened, for work that must come first, such as copying
|
|
26
|
+
* data over from a database with another name.
|
|
27
|
+
*/
|
|
28
|
+
ready?: Promise<unknown>;
|
|
29
|
+
/** The IndexedDB factory to use. Defaults to the global `indexedDB`; tests pass a fake. */
|
|
30
|
+
indexedDB?: IDBFactory;
|
|
31
|
+
}
|
|
32
|
+
export declare const SCHEMA_VERSION: number;
|
|
33
|
+
/**
|
|
34
|
+
* Keeps annotations in IndexedDB, so they survive reloads and work offline. Each write reads
|
|
35
|
+
* and checks `ext.rev` in the same transaction as it writes, so concurrent tabs cannot both win
|
|
36
|
+
* an update. Thread writes check the parent and the children in that transaction too, so a
|
|
37
|
+
* reply never lands under a note another tab is deleting. Subscribers hear about changes made
|
|
38
|
+
* by any adapter on the same database in this browser profile, through a BroadcastChannel named
|
|
39
|
+
* after it.
|
|
40
|
+
*/
|
|
41
|
+
export declare class IndexedDBAdapter implements StorageAdapter {
|
|
42
|
+
readonly capabilities: {
|
|
43
|
+
realtime: boolean;
|
|
44
|
+
search: boolean;
|
|
45
|
+
offline: boolean;
|
|
46
|
+
};
|
|
47
|
+
private readonly name;
|
|
48
|
+
private readonly ready;
|
|
49
|
+
private readonly factory;
|
|
50
|
+
private opening;
|
|
51
|
+
private readonly listeners;
|
|
52
|
+
private channel;
|
|
53
|
+
readonly versions: VersionStore;
|
|
54
|
+
readonly threads: ThreadStore;
|
|
55
|
+
constructor(options?: IndexedDBAdapterOptions);
|
|
56
|
+
list(q: ListQuery): Promise<Annotation[]>;
|
|
57
|
+
get(id: string): Promise<Annotation | null>;
|
|
58
|
+
create(a: Annotation): Promise<Annotation>;
|
|
59
|
+
update(a: Annotation, expectedRev: number): Promise<Annotation>;
|
|
60
|
+
remove(id: string, expectedRev: number): Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* For a device that keeps synced copies: writes `next` over note `id` as it is, or removes the
|
|
63
|
+
* note (and its saved versions) when `next` is null, if the stored note is at `expectedRev` (null:
|
|
64
|
+
* nothing stored). None of `update`'s thread checks apply, since the copy comes from a store that
|
|
65
|
+
* made them; the stored rev is still this database's own, one past what was there. Subscribers
|
|
66
|
+
* hear it as any other write. Throws `ConflictError` when the note changed meanwhile.
|
|
67
|
+
*/
|
|
68
|
+
overwrite(id: string, next: Annotation | null, expectedRev: number | null): Promise<Annotation | null>;
|
|
69
|
+
/**
|
|
70
|
+
* Notes matching `q`, newest first. Reads every note from the newest until it has `limit`, so
|
|
71
|
+
* it suits a device's own notes, not a large shared store. Placeholders of deleted notes never
|
|
72
|
+
* match.
|
|
73
|
+
*/
|
|
74
|
+
search(q: SearchQuery): Promise<Annotation[]>;
|
|
75
|
+
/**
|
|
76
|
+
* Every stored note, placeholders of deleted notes included, in pages ordered by id: up to
|
|
77
|
+
* `limit` (default 500) with ids after `after`. For exporting a device's own notes.
|
|
78
|
+
*/
|
|
79
|
+
listAll(q?: ListAllQuery): Promise<Annotation[]>;
|
|
80
|
+
subscribe(q: Omit<ListQuery, "since">, onChange: (e: ChangeEvent) => void): Unsubscribe;
|
|
81
|
+
/** Closes the database connection and stops listening to other tabs. */
|
|
82
|
+
close(): void;
|
|
83
|
+
private db;
|
|
84
|
+
/**
|
|
85
|
+
* Runs `body` in one readwrite transaction over `stores` and resolves with its result once the
|
|
86
|
+
* transaction commits; subscribers then hear about what `body` passed to `told`. `body` may
|
|
87
|
+
* await only requests on `tx`: awaiting anything else would let the transaction commit early.
|
|
88
|
+
* If `body` throws, the transaction is aborted and nothing it wrote is kept.
|
|
89
|
+
*/
|
|
90
|
+
private transact;
|
|
91
|
+
/** Adds `a` at rev 1, failing if the id is taken. */
|
|
92
|
+
private insert;
|
|
93
|
+
/** Writes `a` over `existing` at the next rev. */
|
|
94
|
+
private put;
|
|
95
|
+
/** Removes `existing` and its saved versions. */
|
|
96
|
+
private drop;
|
|
97
|
+
private emit;
|
|
98
|
+
private deliver;
|
|
99
|
+
private openChannel;
|
|
100
|
+
private channelName;
|
|
101
|
+
private closeChannel;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAaL,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,YAAY,EAClB,MAAM,eAAe,CAAC;AAEvB,yEAAyE;AACzE,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,kDAAkD;AAClD,MAAM,WAAW,YAAY;IAC3B,+BAA+B;IAC/B,KAAK,CAAC,EAAE,M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E,UAAU,GAAG,IAAI,EACvB,WAAW,EAAE,MAAM,GAAG,IAAI,GACzB,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAgB7B;;;;OAIG;IACG,MAAM,CAAC,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAiCnD;;;OAGG;IACG,OAAO,CAAC,CAAC,GAAE,YAAiB,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IA0B1D,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,WAAW,KAAK,IAAI,GAAG,WAAW;IAUvF,wEAAwE;IACxE,KAAK,IAAI,IAAI;IAQb,OAAO,CAAC,EAAE;IAiCV;;;;;OAKG;YACW,QAAQ;IA8BtB,qDAAqD;YACvC,MAAM;IAiBpB,kDAAkD;YACpC,GAAG;IAejB,iDAAiD;YACnC,IAAI;IAWlB,OAAO,CAAC,IAAI;IAYZ,OAAO,CAAC,OAAO;IAcf,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,YAAY;CAIrB"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,562 @@
|
|
|
1
|
+
import { afterAnnotationPrefix, AudienceError, ConflictError, NotFoundError, ThreadError, checkChild, documentKeyOf, isPdfDocumentKey, isWithinAudience, parentIdOf, placeholderOf, threadRootOf, } from "@acornly/core";
|
|
2
|
+
const STORE = "annotations";
|
|
3
|
+
/** Earlier versions of edited annotations, keyed by id and rev. */
|
|
4
|
+
const VERSIONS = "versions";
|
|
5
|
+
/** Every saved version of one annotation. */
|
|
6
|
+
const VERSIONS_BY_ID = "by_id";
|
|
7
|
+
/** Serves `list`: one document's annotations within one scope, by `target.source`. */
|
|
8
|
+
const BY_SCOPE_DOCUMENT = "by_scope_document";
|
|
9
|
+
/**
|
|
10
|
+
* Serves `list` for a document keyed apart from its URL (a PDF's `ext.documentKey`, see
|
|
11
|
+
* `documentKeyOf`). Only notes with a key are in it.
|
|
12
|
+
*/
|
|
13
|
+
const BY_SCOPE_DOCUMENT_KEY = "by_scope_document_key";
|
|
14
|
+
/** For delta sync (not read yet), which reads everything modified after a point in time. */
|
|
15
|
+
const BY_MODIFIED = "by_modified";
|
|
16
|
+
/** Serves `listThread` and child lookups: every node below one root, within one scope. */
|
|
17
|
+
const BY_SCOPE_THREAD = "by_scope_thread";
|
|
18
|
+
/**
|
|
19
|
+
* Schema migrations, one per database version. Entry `i` upgrades version `i` to `i + 1`, so a
|
|
20
|
+
* new version appends an entry and never edits an old one.
|
|
21
|
+
*/
|
|
22
|
+
const MIGRATIONS = [
|
|
23
|
+
(db) => {
|
|
24
|
+
const store = db.createObjectStore(STORE, { keyPath: "id" });
|
|
25
|
+
store.createIndex(BY_SCOPE_DOCUMENT, ["ext.scope", "target.source"]);
|
|
26
|
+
store.createIndex(BY_MODIFIED, "modified");
|
|
27
|
+
},
|
|
28
|
+
// Reply threads and edit history (#87). Notes on pages have no `threadRoot`, so the index
|
|
29
|
+
// holds only nodes below a root.
|
|
30
|
+
(db, tx) => {
|
|
31
|
+
tx.objectStore(STORE).createIndex(BY_SCOPE_THREAD, ["ext.scope", "ext.threadRoot"]);
|
|
32
|
+
db.createObjectStore(VERSIONS, { keyPath: ["id", "ext.rev"] }).createIndex(VERSIONS_BY_ID, "id");
|
|
33
|
+
},
|
|
34
|
+
// Notes on PDFs, listed by the file's key (#403). Notes stored before without a key stay listed
|
|
35
|
+
// by their source; any stored with one are indexed under it as the index is built.
|
|
36
|
+
(_db, tx) => {
|
|
37
|
+
tx.objectStore(STORE).createIndex(BY_SCOPE_DOCUMENT_KEY, ["ext.scope", "ext.documentKey"]);
|
|
38
|
+
},
|
|
39
|
+
];
|
|
40
|
+
export const SCHEMA_VERSION = MIGRATIONS.length;
|
|
41
|
+
/**
|
|
42
|
+
* Keeps annotations in IndexedDB, so they survive reloads and work offline. Each write reads
|
|
43
|
+
* and checks `ext.rev` in the same transaction as it writes, so concurrent tabs cannot both win
|
|
44
|
+
* an update. Thread writes check the parent and the children in that transaction too, so a
|
|
45
|
+
* reply never lands under a note another tab is deleting. Subscribers hear about changes made
|
|
46
|
+
* by any adapter on the same database in this browser profile, through a BroadcastChannel named
|
|
47
|
+
* after it.
|
|
48
|
+
*/
|
|
49
|
+
export class IndexedDBAdapter {
|
|
50
|
+
capabilities = { realtime: true, search: true, offline: true };
|
|
51
|
+
name;
|
|
52
|
+
ready;
|
|
53
|
+
factory;
|
|
54
|
+
opening;
|
|
55
|
+
listeners = new Set();
|
|
56
|
+
channel;
|
|
57
|
+
versions = {
|
|
58
|
+
saveVersion: async (a) => {
|
|
59
|
+
await this.transact([VERSIONS], async (tx) => {
|
|
60
|
+
await request(tx.objectStore(VERSIONS).put(structuredClone(a)));
|
|
61
|
+
});
|
|
62
|
+
},
|
|
63
|
+
listVersions: async (id) => {
|
|
64
|
+
const db = await this.db();
|
|
65
|
+
const found = await request(db.transaction(VERSIONS, "readonly").objectStore(VERSIONS).index(VERSIONS_BY_ID).getAll(id));
|
|
66
|
+
return found.sort((x, y) => x.ext.rev - y.ext.rev);
|
|
67
|
+
},
|
|
68
|
+
clearVersions: async (id) => {
|
|
69
|
+
await this.transact([VERSIONS], async (tx) => {
|
|
70
|
+
await clearVersions(tx.objectStore(VERSIONS), id);
|
|
71
|
+
});
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
threads = {
|
|
75
|
+
listThread: async (q) => {
|
|
76
|
+
const db = await this.db();
|
|
77
|
+
const store = db.transaction(STORE, "readonly").objectStore(STORE);
|
|
78
|
+
const [root, below] = await Promise.all([
|
|
79
|
+
request(store.get(q.threadRoot)),
|
|
80
|
+
request(store.index(BY_SCOPE_THREAD).getAll([q.scope, q.threadRoot])),
|
|
81
|
+
]);
|
|
82
|
+
return root && root.ext.scope === q.scope ? [root, ...below] : below;
|
|
83
|
+
},
|
|
84
|
+
countChildren: async (ids) => {
|
|
85
|
+
const db = await this.db();
|
|
86
|
+
const store = db.transaction(STORE, "readonly").objectStore(STORE);
|
|
87
|
+
const counts = Object.fromEntries(ids.map((id) => [id, 0]));
|
|
88
|
+
// Children sit in their parent's thread and scope, so each thread is read once.
|
|
89
|
+
const threads = new Set();
|
|
90
|
+
for (const id of new Set(ids)) {
|
|
91
|
+
const a = await request(store.get(id));
|
|
92
|
+
if (a)
|
|
93
|
+
threads.add(JSON.stringify([a.ext.scope, threadRootOf(a)]));
|
|
94
|
+
}
|
|
95
|
+
for (const key of threads) {
|
|
96
|
+
const nodes = await request(store.index(BY_SCOPE_THREAD).getAll(JSON.parse(key)));
|
|
97
|
+
for (const a of nodes) {
|
|
98
|
+
const parent = safeParentId(a);
|
|
99
|
+
if (parent !== null && Object.hasOwn(counts, parent))
|
|
100
|
+
counts[parent]++;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return counts;
|
|
104
|
+
},
|
|
105
|
+
addChild: async (child) => {
|
|
106
|
+
const parentId = parentIdOf(child);
|
|
107
|
+
if (parentId === null)
|
|
108
|
+
throw new Error(`Annotation ${child.id} is not context on context`);
|
|
109
|
+
const stored = await this.transact([STORE], async (tx, told) => {
|
|
110
|
+
const store = tx.objectStore(STORE);
|
|
111
|
+
const parent = await request(store.get(parentId));
|
|
112
|
+
if (!parent)
|
|
113
|
+
throw new NotFoundError(parentId);
|
|
114
|
+
checkChild(child, parent);
|
|
115
|
+
return this.insert(store, child, told);
|
|
116
|
+
});
|
|
117
|
+
return structuredClone(stored);
|
|
118
|
+
},
|
|
119
|
+
deleteNode: async (id, expectedRev, now) => this.transact([STORE, VERSIONS], async (tx, told) => {
|
|
120
|
+
const store = tx.objectStore(STORE);
|
|
121
|
+
const versions = tx.objectStore(VERSIONS);
|
|
122
|
+
const target = await current(store, id, expectedRev);
|
|
123
|
+
if (await hasChildren(store, target)) {
|
|
124
|
+
const placeholder = await this.put(store, placeholderOf(target, now), target, told);
|
|
125
|
+
await clearVersions(versions, id);
|
|
126
|
+
return { placeholder: structuredClone(placeholder), removed: [] };
|
|
127
|
+
}
|
|
128
|
+
// Remove it, then each placeholder above it left with no children.
|
|
129
|
+
const removed = [];
|
|
130
|
+
let next = target;
|
|
131
|
+
while (next) {
|
|
132
|
+
await this.drop(store, versions, next, told);
|
|
133
|
+
removed.push(next.id);
|
|
134
|
+
const parentId = safeParentId(next);
|
|
135
|
+
const parent = parentId === null
|
|
136
|
+
? undefined
|
|
137
|
+
: await request(store.get(parentId));
|
|
138
|
+
next = parent?.ext.deleted && !(await hasChildren(store, parent)) ? parent : undefined;
|
|
139
|
+
}
|
|
140
|
+
return { removed };
|
|
141
|
+
}),
|
|
142
|
+
};
|
|
143
|
+
constructor(options = {}) {
|
|
144
|
+
this.name = options.name ?? "acornly";
|
|
145
|
+
this.ready = options.ready ?? Promise.resolve();
|
|
146
|
+
const factory = options.indexedDB ?? globalThis.indexedDB;
|
|
147
|
+
if (!factory)
|
|
148
|
+
throw new Error("IndexedDB is not available in this environment");
|
|
149
|
+
this.factory = factory;
|
|
150
|
+
}
|
|
151
|
+
async list(q) {
|
|
152
|
+
const db = await this.db();
|
|
153
|
+
const tx = db.transaction(STORE, "readonly");
|
|
154
|
+
const store = tx.objectStore(STORE);
|
|
155
|
+
const key = [q.scope, q.documentId];
|
|
156
|
+
// A PDF's key may also be a note's own source (one imported with it as its target).
|
|
157
|
+
const found = await Promise.all([
|
|
158
|
+
request(store.index(BY_SCOPE_DOCUMENT).getAll(key)),
|
|
159
|
+
isPdfDocumentKey(q.documentId)
|
|
160
|
+
? request(store.index(BY_SCOPE_DOCUMENT_KEY).getAll(key))
|
|
161
|
+
: [],
|
|
162
|
+
]);
|
|
163
|
+
const seen = new Set();
|
|
164
|
+
// A note with a key is not on the document its source names.
|
|
165
|
+
return found.flat().filter((a) => {
|
|
166
|
+
if (seen.has(a.id) || documentKeyOf(a) !== q.documentId)
|
|
167
|
+
return false;
|
|
168
|
+
seen.add(a.id);
|
|
169
|
+
return q.since === undefined || a.modified > q.since;
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
async get(id) {
|
|
173
|
+
const db = await this.db();
|
|
174
|
+
const found = await request(db.transaction(STORE, "readonly").objectStore(STORE).get(id));
|
|
175
|
+
return found ?? null;
|
|
176
|
+
}
|
|
177
|
+
async create(a) {
|
|
178
|
+
if (isAnnotationTarget(a.target.source)) {
|
|
179
|
+
throw new ThreadError(`Annotation ${a.id} targets an annotation; use threads.addChild`);
|
|
180
|
+
}
|
|
181
|
+
const stored = await this.transact([STORE], async (tx, told) => this.insert(tx.objectStore(STORE), a, told));
|
|
182
|
+
return structuredClone(stored);
|
|
183
|
+
}
|
|
184
|
+
async update(a, expectedRev) {
|
|
185
|
+
const stored = await this.transact([STORE], async (tx, told) => {
|
|
186
|
+
const store = tx.objectStore(STORE);
|
|
187
|
+
const existing = await current(store, a.id, expectedRev);
|
|
188
|
+
await checkTreeKept(store, a, existing);
|
|
189
|
+
return this.put(store, keepDocumentKey(a, existing), existing, told);
|
|
190
|
+
});
|
|
191
|
+
return structuredClone(stored);
|
|
192
|
+
}
|
|
193
|
+
async remove(id, expectedRev) {
|
|
194
|
+
await this.transact([STORE, VERSIONS], async (tx, told) => {
|
|
195
|
+
const store = tx.objectStore(STORE);
|
|
196
|
+
const existing = await current(store, id, expectedRev);
|
|
197
|
+
if (await hasChildren(store, existing)) {
|
|
198
|
+
throw new ThreadError(`Annotation ${id} has children; use threads.deleteNode`);
|
|
199
|
+
}
|
|
200
|
+
if (isAnnotationTarget(existing.target.source)) {
|
|
201
|
+
throw new ThreadError(`Annotation ${id} is context on context; use threads.deleteNode`);
|
|
202
|
+
}
|
|
203
|
+
await this.drop(store, tx.objectStore(VERSIONS), existing, told);
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* For a device that keeps synced copies: writes `next` over note `id` as it is, or removes the
|
|
208
|
+
* note (and its saved versions) when `next` is null, if the stored note is at `expectedRev` (null:
|
|
209
|
+
* nothing stored). None of `update`'s thread checks apply, since the copy comes from a store that
|
|
210
|
+
* made them; the stored rev is still this database's own, one past what was there. Subscribers
|
|
211
|
+
* hear it as any other write. Throws `ConflictError` when the note changed meanwhile.
|
|
212
|
+
*/
|
|
213
|
+
async overwrite(id, next, expectedRev) {
|
|
214
|
+
if (next && next.id !== id)
|
|
215
|
+
throw new Error(`Cannot write ${next.id} over ${id}`);
|
|
216
|
+
const stored = await this.transact([STORE, VERSIONS], async (tx, told) => {
|
|
217
|
+
const store = tx.objectStore(STORE);
|
|
218
|
+
const found = await request(store.get(id));
|
|
219
|
+
const rev = found?.ext.rev ?? null;
|
|
220
|
+
if (rev !== expectedRev)
|
|
221
|
+
throw new ConflictError(id, expectedRev ?? 0, rev ?? 0);
|
|
222
|
+
if (!next) {
|
|
223
|
+
if (found)
|
|
224
|
+
await this.drop(store, tx.objectStore(VERSIONS), found, told);
|
|
225
|
+
return null;
|
|
226
|
+
}
|
|
227
|
+
return found ? this.put(store, next, found, told) : this.insert(store, next, told);
|
|
228
|
+
});
|
|
229
|
+
return stored && structuredClone(stored);
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Notes matching `q`, newest first. Reads every note from the newest until it has `limit`, so
|
|
233
|
+
* it suits a device's own notes, not a large shared store. Placeholders of deleted notes never
|
|
234
|
+
* match.
|
|
235
|
+
*/
|
|
236
|
+
async search(q) {
|
|
237
|
+
const limit = q.limit ?? 50;
|
|
238
|
+
const text = q.text.toLowerCase();
|
|
239
|
+
const db = await this.db();
|
|
240
|
+
const tx = db.transaction(STORE, "readonly");
|
|
241
|
+
const index = tx.objectStore(STORE).index(BY_MODIFIED);
|
|
242
|
+
return new Promise((resolve, reject) => {
|
|
243
|
+
const found = [];
|
|
244
|
+
const req = index.openCursor(null, "prev");
|
|
245
|
+
req.onerror = () => reject(req.error);
|
|
246
|
+
tx.onabort = () => reject(tx.error ?? new Error("Search aborted"));
|
|
247
|
+
req.onsuccess = () => {
|
|
248
|
+
try {
|
|
249
|
+
const cursor = req.result;
|
|
250
|
+
if (!cursor || found.length >= limit)
|
|
251
|
+
return resolve(found);
|
|
252
|
+
const a = cursor.value;
|
|
253
|
+
if (!a.ext.deleted &&
|
|
254
|
+
(q.scope === undefined || a.ext.scope === q.scope) &&
|
|
255
|
+
searchText(a).includes(text)) {
|
|
256
|
+
found.push(a);
|
|
257
|
+
}
|
|
258
|
+
if (found.length >= limit)
|
|
259
|
+
resolve(found);
|
|
260
|
+
else
|
|
261
|
+
cursor.continue();
|
|
262
|
+
}
|
|
263
|
+
catch (err) {
|
|
264
|
+
// A record of the wrong shape: fail the search rather than leave it waiting.
|
|
265
|
+
reject(err);
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Every stored note, placeholders of deleted notes included, in pages ordered by id: up to
|
|
272
|
+
* `limit` (default 500) with ids after `after`. For exporting a device's own notes.
|
|
273
|
+
*/
|
|
274
|
+
async listAll(q = {}) {
|
|
275
|
+
const limit = q.limit ?? 500;
|
|
276
|
+
const db = await this.db();
|
|
277
|
+
const tx = db.transaction(STORE, "readonly");
|
|
278
|
+
return new Promise((resolve, reject) => {
|
|
279
|
+
const found = [];
|
|
280
|
+
const req = tx.objectStore(STORE).openCursor();
|
|
281
|
+
req.onerror = () => reject(req.error);
|
|
282
|
+
tx.onabort = () => reject(tx.error ?? new Error("Listing aborted"));
|
|
283
|
+
req.onsuccess = () => {
|
|
284
|
+
const cursor = req.result;
|
|
285
|
+
if (!cursor || found.length >= limit)
|
|
286
|
+
return resolve(found);
|
|
287
|
+
// Jump to the first id after `after` without IDBKeyRange, which a passed-in factory's
|
|
288
|
+
// realm may not share with the global one.
|
|
289
|
+
if (q.after !== undefined && this.factory.cmp(cursor.key, q.after) <= 0) {
|
|
290
|
+
if (this.factory.cmp(cursor.key, q.after) < 0)
|
|
291
|
+
cursor.continue(q.after);
|
|
292
|
+
else
|
|
293
|
+
cursor.continue();
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
found.push(cursor.value);
|
|
297
|
+
if (found.length >= limit)
|
|
298
|
+
resolve(found);
|
|
299
|
+
else
|
|
300
|
+
cursor.continue();
|
|
301
|
+
};
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
subscribe(q, onChange) {
|
|
305
|
+
const listener = { documentId: q.documentId, scope: q.scope, onChange };
|
|
306
|
+
this.listeners.add(listener);
|
|
307
|
+
this.openChannel();
|
|
308
|
+
return () => {
|
|
309
|
+
this.listeners.delete(listener);
|
|
310
|
+
if (this.listeners.size === 0)
|
|
311
|
+
this.closeChannel();
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
/** Closes the database connection and stops listening to other tabs. */
|
|
315
|
+
close() {
|
|
316
|
+
this.listeners.clear();
|
|
317
|
+
this.closeChannel();
|
|
318
|
+
const opening = this.opening;
|
|
319
|
+
this.opening = undefined;
|
|
320
|
+
void opening?.then((db) => db.close()).catch(() => undefined);
|
|
321
|
+
}
|
|
322
|
+
db() {
|
|
323
|
+
if (this.opening)
|
|
324
|
+
return this.opening;
|
|
325
|
+
const opening = this.ready
|
|
326
|
+
.then(() => new Promise((resolve, reject) => {
|
|
327
|
+
const req = this.factory.open(this.name, SCHEMA_VERSION);
|
|
328
|
+
req.onupgradeneeded = (e) => {
|
|
329
|
+
for (let v = e.oldVersion; v < SCHEMA_VERSION; v++) {
|
|
330
|
+
MIGRATIONS[v](req.result, req.transaction);
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
req.onsuccess = () => {
|
|
334
|
+
const db = req.result;
|
|
335
|
+
// Another tab wants a newer schema: step aside and reopen on the next call.
|
|
336
|
+
db.onversionchange = () => {
|
|
337
|
+
db.close();
|
|
338
|
+
if (this.opening === opening)
|
|
339
|
+
this.opening = undefined;
|
|
340
|
+
};
|
|
341
|
+
resolve(db);
|
|
342
|
+
};
|
|
343
|
+
// A blocked upgrade is not a failure: the request finishes once older connections close.
|
|
344
|
+
req.onerror = () => reject(req.error);
|
|
345
|
+
}))
|
|
346
|
+
.catch((err) => {
|
|
347
|
+
if (this.opening === opening)
|
|
348
|
+
this.opening = undefined;
|
|
349
|
+
throw err;
|
|
350
|
+
});
|
|
351
|
+
this.opening = opening;
|
|
352
|
+
return opening;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Runs `body` in one readwrite transaction over `stores` and resolves with its result once the
|
|
356
|
+
* transaction commits; subscribers then hear about what `body` passed to `told`. `body` may
|
|
357
|
+
* await only requests on `tx`: awaiting anything else would let the transaction commit early.
|
|
358
|
+
* If `body` throws, the transaction is aborted and nothing it wrote is kept.
|
|
359
|
+
*/
|
|
360
|
+
async transact(stores, body) {
|
|
361
|
+
const db = await this.db();
|
|
362
|
+
const pending = [];
|
|
363
|
+
const result = await new Promise((resolve, reject) => {
|
|
364
|
+
const tx = db.transaction(stores, "readwrite");
|
|
365
|
+
let failure;
|
|
366
|
+
let value;
|
|
367
|
+
tx.oncomplete = () => resolve(value);
|
|
368
|
+
tx.onabort = () => reject(failure ?? tx.error ?? new Error("Transaction aborted"));
|
|
369
|
+
body(tx, (p) => pending.push(p)).then((v) => {
|
|
370
|
+
value = v;
|
|
371
|
+
}, (err) => {
|
|
372
|
+
failure ??= err;
|
|
373
|
+
try {
|
|
374
|
+
tx.abort();
|
|
375
|
+
}
|
|
376
|
+
catch {
|
|
377
|
+
// Already finished; `onabort` or `oncomplete` has fired or will.
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
});
|
|
381
|
+
for (const p of pending)
|
|
382
|
+
this.emit(p);
|
|
383
|
+
return result;
|
|
384
|
+
}
|
|
385
|
+
/** Adds `a` at rev 1, failing if the id is taken. */
|
|
386
|
+
async insert(store, a, told) {
|
|
387
|
+
const stored = structuredClone({ ...a, ext: { ...a.ext, rev: 1 } });
|
|
388
|
+
try {
|
|
389
|
+
await request(store.add(stored));
|
|
390
|
+
}
|
|
391
|
+
catch (err) {
|
|
392
|
+
throw err?.name === "ConstraintError"
|
|
393
|
+
? new Error(`Annotation ${a.id} already exists`)
|
|
394
|
+
: err;
|
|
395
|
+
}
|
|
396
|
+
told(broadcast(stored, { type: "created", annotation: stored }));
|
|
397
|
+
return stored;
|
|
398
|
+
}
|
|
399
|
+
/** Writes `a` over `existing` at the next rev. */
|
|
400
|
+
async put(store, a, existing, told) {
|
|
401
|
+
const stored = structuredClone({
|
|
402
|
+
...a,
|
|
403
|
+
ext: { ...a.ext, rev: existing.ext.rev + 1 },
|
|
404
|
+
});
|
|
405
|
+
await request(store.put(stored));
|
|
406
|
+
told(broadcast(stored, { type: "updated", annotation: stored }));
|
|
407
|
+
return stored;
|
|
408
|
+
}
|
|
409
|
+
/** Removes `existing` and its saved versions. */
|
|
410
|
+
async drop(store, versions, existing, told) {
|
|
411
|
+
await request(store.delete(existing.id));
|
|
412
|
+
await clearVersions(versions, existing.id);
|
|
413
|
+
told(broadcast(existing, { type: "removed", id: existing.id }));
|
|
414
|
+
}
|
|
415
|
+
emit(message) {
|
|
416
|
+
if (this.channel) {
|
|
417
|
+
this.channel.postMessage(message);
|
|
418
|
+
}
|
|
419
|
+
else if (typeof BroadcastChannel !== "undefined") {
|
|
420
|
+
// Nobody here listens, but other adapters on this database may: tell them and let go.
|
|
421
|
+
const once = new BroadcastChannel(this.channelName());
|
|
422
|
+
once.postMessage(message);
|
|
423
|
+
once.close();
|
|
424
|
+
}
|
|
425
|
+
this.deliver(message);
|
|
426
|
+
}
|
|
427
|
+
deliver({ source, scope, event }) {
|
|
428
|
+
for (const l of this.listeners) {
|
|
429
|
+
if (l.documentId !== source || l.scope !== scope)
|
|
430
|
+
continue;
|
|
431
|
+
// A throwing listener must not fail a write that has already committed.
|
|
432
|
+
try {
|
|
433
|
+
l.onChange(structuredClone(event));
|
|
434
|
+
}
|
|
435
|
+
catch (err) {
|
|
436
|
+
queueMicrotask(() => {
|
|
437
|
+
throw err;
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
openChannel() {
|
|
443
|
+
if (this.channel || typeof BroadcastChannel === "undefined")
|
|
444
|
+
return;
|
|
445
|
+
this.channel = new BroadcastChannel(this.channelName());
|
|
446
|
+
this.channel.onmessage = (e) => this.deliver(e.data);
|
|
447
|
+
// In Node, an open channel would otherwise keep the process alive.
|
|
448
|
+
this.channel.unref?.();
|
|
449
|
+
}
|
|
450
|
+
channelName() {
|
|
451
|
+
return `acornly-idb:${this.name}`;
|
|
452
|
+
}
|
|
453
|
+
closeChannel() {
|
|
454
|
+
this.channel?.close();
|
|
455
|
+
this.channel = undefined;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
/** What `search` looks in: body text and summaries, and quoted text, lower-cased. */
|
|
459
|
+
function searchText(a) {
|
|
460
|
+
const parts = [];
|
|
461
|
+
for (const b of a.body ?? []) {
|
|
462
|
+
const text = b.type === "ContextualBody" ? b.summary : b.value;
|
|
463
|
+
if (typeof text === "string")
|
|
464
|
+
parts.push(text);
|
|
465
|
+
}
|
|
466
|
+
for (const s of a.target.selector ?? []) {
|
|
467
|
+
if (s.type === "TextQuoteSelector" && typeof s["exact"] === "string")
|
|
468
|
+
parts.push(s["exact"]);
|
|
469
|
+
}
|
|
470
|
+
return parts.join("\n").toLowerCase();
|
|
471
|
+
}
|
|
472
|
+
function broadcast(a, event) {
|
|
473
|
+
return { source: documentKeyOf(a), scope: a.ext.scope, event };
|
|
474
|
+
}
|
|
475
|
+
/** `next` with the document key `existing` was stored with: a note's key never changes. */
|
|
476
|
+
function keepDocumentKey(next, existing) {
|
|
477
|
+
const ext = { ...next.ext };
|
|
478
|
+
if (existing.ext.documentKey === undefined)
|
|
479
|
+
delete ext.documentKey;
|
|
480
|
+
else
|
|
481
|
+
ext.documentKey = existing.ext.documentKey;
|
|
482
|
+
return { ...next, ext };
|
|
483
|
+
}
|
|
484
|
+
/** Reads `id` in the transaction and returns it only if it exists at `expectedRev`. */
|
|
485
|
+
async function current(store, id, expectedRev) {
|
|
486
|
+
const found = await request(store.get(id));
|
|
487
|
+
if (!found)
|
|
488
|
+
throw new NotFoundError(id);
|
|
489
|
+
if (found.ext.rev !== expectedRev)
|
|
490
|
+
throw new ConflictError(id, expectedRev, found.ext.rev);
|
|
491
|
+
return found;
|
|
492
|
+
}
|
|
493
|
+
/** Whether any stored annotation targets `a`. Children share `a`'s scope and thread. */
|
|
494
|
+
async function hasChildren(store, a) {
|
|
495
|
+
const nodes = await request(store.index(BY_SCOPE_THREAD).getAll([a.ext.scope, threadRootOf(a)]));
|
|
496
|
+
return nodes.some((n) => safeParentId(n) === a.id);
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* Plain updates keep the tree: thread fields never change, `deleted` changes only through
|
|
500
|
+
* `deleteNode`, and a child keeps its target, scope and parent rev and may only get an
|
|
501
|
+
* audience within its parent's. Mirrors the memory adapter.
|
|
502
|
+
*/
|
|
503
|
+
async function checkTreeKept(store, next, existing) {
|
|
504
|
+
if ((next.ext.deleted ?? false) !== (existing.ext.deleted ?? false)) {
|
|
505
|
+
throw new ThreadError(`Annotation ${next.id} is deleted or restored only by deleteNode`);
|
|
506
|
+
}
|
|
507
|
+
if (existing.ext.deleted)
|
|
508
|
+
throw new ThreadError(`Annotation ${next.id} is deleted`);
|
|
509
|
+
if ((next.ext.scope !== existing.ext.scope || next.creator?.id !== existing.creator?.id) &&
|
|
510
|
+
(await hasChildren(store, existing))) {
|
|
511
|
+
throw new ThreadError(`Annotation ${next.id} has replies; its scope and author stay`);
|
|
512
|
+
}
|
|
513
|
+
if ((next.ext.threadRoot ?? null) !== (existing.ext.threadRoot ?? null) ||
|
|
514
|
+
next.ext.depth !== existing.ext.depth) {
|
|
515
|
+
throw new ThreadError(`Annotation ${next.id} cannot move in its thread`);
|
|
516
|
+
}
|
|
517
|
+
const isChild = isAnnotationTarget(next.target.source);
|
|
518
|
+
if (!isAnnotationTarget(existing.target.source) && !isChild)
|
|
519
|
+
return;
|
|
520
|
+
if (JSON.stringify(next.target) !== JSON.stringify(existing.target) ||
|
|
521
|
+
next.ext.scope !== existing.ext.scope ||
|
|
522
|
+
next.ext.parentRev !== existing.ext.parentRev) {
|
|
523
|
+
throw new ThreadError(`Annotation ${next.id} cannot move in its thread`);
|
|
524
|
+
}
|
|
525
|
+
// An unchanged or narrower audience is fine even if the parent was narrowed meanwhile.
|
|
526
|
+
if (isWithinAudience(next.ext.audience, existing.ext.audience))
|
|
527
|
+
return;
|
|
528
|
+
const parentId = safeParentId(existing);
|
|
529
|
+
const parent = parentId === null ? undefined : await request(store.get(parentId));
|
|
530
|
+
if (parent && !isWithinAudience(next.ext.audience, parent.ext.audience, parent.creator?.id)) {
|
|
531
|
+
throw new AudienceError(`Annotation ${next.id} cannot be wider than its parent`);
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
/** Deletes every saved version of one annotation. */
|
|
535
|
+
async function clearVersions(versions, id) {
|
|
536
|
+
const keys = await request(versions.index(VERSIONS_BY_ID).getAllKeys(id));
|
|
537
|
+
for (const key of keys)
|
|
538
|
+
await request(versions.delete(key));
|
|
539
|
+
}
|
|
540
|
+
/** A stored record's parent id, treating an unreadable target as a page. */
|
|
541
|
+
function safeParentId(a) {
|
|
542
|
+
try {
|
|
543
|
+
return parentIdOf(a);
|
|
544
|
+
}
|
|
545
|
+
catch {
|
|
546
|
+
return null;
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
function isAnnotationTarget(source) {
|
|
550
|
+
return afterAnnotationPrefix(source) !== undefined;
|
|
551
|
+
}
|
|
552
|
+
function request(req) {
|
|
553
|
+
return new Promise((resolve, reject) => {
|
|
554
|
+
req.onsuccess = () => resolve(req.result);
|
|
555
|
+
req.onerror = (e) => {
|
|
556
|
+
// Handled here: an unprevented error would abort the transaction before `body` decides.
|
|
557
|
+
e.preventDefault();
|
|
558
|
+
reject(req.error);
|
|
559
|
+
};
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
//# sourceMappingURL=index.js.map
|
|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AAED,qDAAqD;AACrD,KAAK,UAAU,aAAa,CAAC,QAAwB,EAAE,EAAU;IAC/D,MAAM,IAAI,GAAG,MAAM,OAAO,CAAgB,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC;IACzF,KAAK,MAAM,GAAG,IAAI,IAAI;QAAE,MAAM,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AAC9D,CAAC;AAED,4EAA4E;AAC5E,SAAS,YAAY,CAAC,CAAa;IACjC,IAAI,CAAC;QACH,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC;IACvB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAAS,kBAAkB,CAAC,MAAc;IACxC,OAAO,qBAAqB,CAAC,MAAM,CAAC,KAAK,SAAS,CAAC;AACrD,CAAC;AAED,SAAS,OAAO,CAAc,GAAe;IAC3C,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,GAAG,CAAC,SAAS,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,MAAW,CAAC,CAAC;QAC/C,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC,EAAE,EAAE;YAClB,wFAAwF;YACxF,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acornly/adapter-indexeddb",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "IndexedDB StorageAdapter: the local store for the SDK and the extension",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/postagilab/acornly.git",
|
|
9
|
+
"directory": "packages/adapter-indexeddb"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/index.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@acornly/core": "0.3.0"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"fake-indexeddb": "^6.2.2"
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
}
|
|
6
31
|
}
|
package/README.md
DELETED