@grafeo-db/web 0.0.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 ADDED
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to the Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2024 Grafeo Contributors
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,259 @@
1
+ # @grafeo-db/web
2
+
3
+ [Grafeo](https://github.com/GrafeoDB/grafeo) graph database in the browser.
4
+
5
+ Zero backend. Your data stays on the client.
6
+
7
+ ## Features
8
+
9
+ - **Zero backend** — Grafeo runs entirely in the browser via WebAssembly
10
+ - **Persistent storage** — IndexedDB keeps your data across sessions
11
+ - **Non-blocking** — Web Worker execution keeps the UI responsive
12
+ - **Full query support** — GQL, Cypher, SPARQL, GraphQL, Gremlin
13
+ - **Framework integrations** — React, Vue, Svelte
14
+ - **TypeScript-first** — Complete type definitions
15
+
16
+ ## Installation
17
+
18
+ ```bash
19
+ npm install @grafeo-db/web
20
+ ```
21
+
22
+ ## Quick Start
23
+
24
+ ```typescript
25
+ import { GrafeoDB } from '@grafeo-db/web';
26
+
27
+ // In-memory database
28
+ const db = await GrafeoDB.create();
29
+
30
+ // Or persist to IndexedDB
31
+ const db = await GrafeoDB.create({
32
+ persist: 'my-database'
33
+ });
34
+
35
+ // Create data
36
+ await db.execute(`INSERT (:Person {name: 'Alice', age: 30})`);
37
+ await db.execute(`INSERT (:Person {name: 'Bob', age: 25})`);
38
+ await db.execute(`
39
+ MATCH (a:Person {name: 'Alice'}), (b:Person {name: 'Bob'})
40
+ INSERT (a)-[:KNOWS {since: 2020}]->(b)
41
+ `);
42
+
43
+ // Query
44
+ const result = await db.execute(`
45
+ MATCH (p:Person)-[:KNOWS]->(friend)
46
+ RETURN p.name, friend.name
47
+ `);
48
+
49
+ for (const row of result) {
50
+ console.log(`${row['p.name']} knows ${row['friend.name']}`);
51
+ }
52
+ ```
53
+
54
+ ## Persistence
55
+
56
+ Data persists to IndexedDB automatically:
57
+
58
+ ```typescript
59
+ // First visit - creates database
60
+ const db = await GrafeoDB.create({ persist: 'my-app' });
61
+ await db.execute(`INSERT (:User {name: 'Alice'})`);
62
+
63
+ // Later visit - data is still there
64
+ const db = await GrafeoDB.create({ persist: 'my-app' });
65
+ const result = await db.execute(`MATCH (u:User) RETURN u.name`);
66
+ // → [{ 'u.name': 'Alice' }]
67
+ ```
68
+
69
+ ### Storage Management
70
+
71
+ ```typescript
72
+ // Check storage usage
73
+ const stats = await db.storageStats();
74
+ console.log(`Using ${stats.bytesUsed} of ${stats.quota} bytes`);
75
+
76
+ // Export database
77
+ const snapshot = await db.export();
78
+ localStorage.setItem('backup', JSON.stringify(snapshot));
79
+
80
+ // Import database
81
+ const backup = JSON.parse(localStorage.getItem('backup'));
82
+ await db.import(backup);
83
+
84
+ // Clear all data
85
+ await db.clear();
86
+ ```
87
+
88
+ ## Web Worker Mode
89
+
90
+ For large databases or complex queries, run in a Web Worker:
91
+
92
+ ```typescript
93
+ import { GrafeoDB } from '@grafeo-db/web';
94
+
95
+ const db = await GrafeoDB.create({
96
+ worker: true,
97
+ persist: 'large-database'
98
+ });
99
+
100
+ // Queries run in background thread
101
+ // UI stays responsive
102
+ const result = await db.execute(`
103
+ MATCH (a)-[*1..5]->(b)
104
+ RETURN count(*)
105
+ `);
106
+ ```
107
+
108
+ ## Framework Integrations
109
+
110
+ ### React
111
+
112
+ ```typescript
113
+ import { useGrafeo, useQuery } from '@grafeo-db/web/react';
114
+
115
+ function App() {
116
+ const { db, loading, error } = useGrafeo({ persist: 'my-app' });
117
+
118
+ if (loading) return <div>Loading...</div>;
119
+ if (error) return <div>Error: {error.message}</div>;
120
+
121
+ return <PersonList db={db} />;
122
+ }
123
+
124
+ function PersonList({ db }) {
125
+ const { data, loading } = useQuery(db, `MATCH (p:Person) RETURN p`);
126
+
127
+ if (loading) return <div>Loading...</div>;
128
+
129
+ return (
130
+ <ul>
131
+ {data.map(row => <li key={row.p.id}>{row.p.name}</li>)}
132
+ </ul>
133
+ );
134
+ }
135
+ ```
136
+
137
+ ### Vue
138
+
139
+ ```typescript
140
+ import { useGrafeo, useQuery } from '@grafeo-db/web/vue';
141
+
142
+ const { db, loading, error } = useGrafeo({ persist: 'my-app' });
143
+
144
+ const { data } = useQuery(db, `MATCH (p:Person) RETURN p`);
145
+ ```
146
+
147
+ ### Svelte
148
+
149
+ ```typescript
150
+ import { createGrafeo } from '@grafeo-db/web/svelte';
151
+
152
+ const { db, loading, error } = createGrafeo({ persist: 'my-app' });
153
+ ```
154
+
155
+ ## Offline-First
156
+
157
+ Grafeo works completely offline:
158
+
159
+ ```typescript
160
+ const db = await GrafeoDB.create({ persist: 'offline-app' });
161
+
162
+ // Works with or without network
163
+ await db.execute(`INSERT (:Note {text: 'Remember milk'})`);
164
+
165
+ // Optional: sync with your backend when online
166
+ if (navigator.onLine) {
167
+ const changes = await db.changesSince(lastSync);
168
+ await fetch('/api/sync', {
169
+ method: 'POST',
170
+ body: JSON.stringify(changes)
171
+ });
172
+ }
173
+ ```
174
+
175
+ ## Query Languages
176
+
177
+ ```typescript
178
+ // GQL (default)
179
+ await db.execute(`INSERT (:Person {name: 'Alice'})`);
180
+
181
+ // Cypher
182
+ await db.execute(`CREATE (p:Person {name: 'Bob'})`, { language: 'cypher' });
183
+
184
+ // SPARQL
185
+ await db.execute(`
186
+ PREFIX foaf: <http://xmlns.com/foaf/0.1/>
187
+ SELECT ?name WHERE { ?p foaf:name ?name }
188
+ `, { language: 'sparql' });
189
+
190
+ // GraphQL
191
+ await db.execute(`
192
+ query { persons { name } }
193
+ `, { language: 'graphql' });
194
+
195
+ // Gremlin
196
+ await db.execute(`g.V().hasLabel('Person').values('name')`, { language: 'gremlin' });
197
+ ```
198
+
199
+ ## Bundle Size
200
+
201
+ | Import | Size (gzip) |
202
+ |--------|-------------|
203
+ | `@grafeo-db/web` | ~800 KB |
204
+ | `@grafeo-db/web/lite` | ~400 KB (GQL only) |
205
+
206
+ ### Lite Build
207
+
208
+ ```typescript
209
+ // Smaller bundle, GQL only
210
+ import { GrafeoDB } from '@grafeo-db/web/lite';
211
+ ```
212
+
213
+ ## Browser Support
214
+
215
+ | Browser | Version |
216
+ |---------|---------|
217
+ | Chrome | 89+ |
218
+ | Firefox | 89+ |
219
+ | Safari | 15+ |
220
+ | Edge | 89+ |
221
+
222
+ Requires WebAssembly, IndexedDB, and Web Workers.
223
+
224
+ ## Limitations
225
+
226
+ | Constraint | Limit |
227
+ |------------|-------|
228
+ | Database size | ~500 MB (IndexedDB quota) |
229
+ | Memory | ~256 MB (WASM heap) |
230
+ | Concurrency | Single writer, multiple readers |
231
+
232
+ For larger datasets, use [Grafeo](https://github.com/GrafeoDB/grafeo) server-side.
233
+
234
+ ## When to Use
235
+
236
+ **Good fit:**
237
+ - Offline-first applications
238
+ - Privacy-sensitive data (never leaves browser)
239
+ - Local-first software
240
+ - Prototypes and demos
241
+ - PWAs
242
+
243
+ **Not a fit:**
244
+ - Large datasets (> 500 MB)
245
+ - Multi-device sync (no built-in sync)
246
+ - Server-side rendering
247
+
248
+ ## Related
249
+
250
+ | Package | Use Case |
251
+ |---------|----------|
252
+ | [`@grafeo-db/js`](https://www.npmjs.com/package/@grafeo/js) | Node.js, Deno, Edge runtimes |
253
+ | [`@grafeo-db/wasm`](https://www.npmjs.com/package/@grafeo/wasm) | Raw WASM binary |
254
+ | [`grafeo`](https://crates.io/crates/grafeo) | Rust crate |
255
+ | [`grafeo`](https://pypi.org/project/grafeo/) | Python bindings |
256
+
257
+ ## License
258
+
259
+ Apache-2.0
package/dist/index.cjs ADDED
@@ -0,0 +1,63 @@
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/index.ts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ GrafeoDB: () => GrafeoDB
24
+ });
25
+ module.exports = __toCommonJS(src_exports);
26
+ var PLACEHOLDER_MESSAGE = "@grafeo-db/web is not yet released. Follow https://github.com/GrafeoDB/grafeo-web for updates.";
27
+ function placeholder() {
28
+ throw new Error(PLACEHOLDER_MESSAGE);
29
+ }
30
+ var GrafeoDB = class {
31
+ constructor() {
32
+ placeholder();
33
+ }
34
+ static create(_options) {
35
+ placeholder();
36
+ }
37
+ execute(_query, _options) {
38
+ placeholder();
39
+ }
40
+ storageStats() {
41
+ placeholder();
42
+ }
43
+ export() {
44
+ placeholder();
45
+ }
46
+ import(_snapshot) {
47
+ placeholder();
48
+ }
49
+ clear() {
50
+ placeholder();
51
+ }
52
+ changesSince(_timestamp) {
53
+ placeholder();
54
+ }
55
+ close() {
56
+ placeholder();
57
+ }
58
+ };
59
+ // Annotate the CommonJS export names for ESM import in node:
60
+ 0 && (module.exports = {
61
+ GrafeoDB
62
+ });
63
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["const PLACEHOLDER_MESSAGE =\n '@grafeo-db/web is not yet released. Follow https://github.com/GrafeoDB/grafeo-web for updates.';\n\nfunction placeholder(): never {\n throw new Error(PLACEHOLDER_MESSAGE);\n}\n\nexport type QueryLanguage = 'gql' | 'cypher' | 'sparql' | 'graphql' | 'gremlin';\n\nexport interface CreateOptions {\n persist?: string;\n worker?: boolean;\n}\n\nexport interface ExecuteOptions {\n language?: QueryLanguage;\n}\n\nexport interface StorageStats {\n bytesUsed: number;\n quota: number;\n}\n\nexport interface DatabaseSnapshot {\n version: number;\n data: unknown;\n}\n\nexport interface Change {\n type: 'insert' | 'update' | 'delete';\n timestamp: number;\n data: unknown;\n}\n\nexport class GrafeoDB {\n private constructor() {\n placeholder();\n }\n\n static create(_options?: CreateOptions): Promise<GrafeoDB> {\n placeholder();\n }\n\n execute(_query: string, _options?: ExecuteOptions): Promise<Record<string, unknown>[]> {\n placeholder();\n }\n\n storageStats(): Promise<StorageStats> {\n placeholder();\n }\n\n export(): Promise<DatabaseSnapshot> {\n placeholder();\n }\n\n import(_snapshot: DatabaseSnapshot): Promise<void> {\n placeholder();\n }\n\n clear(): Promise<void> {\n placeholder();\n }\n\n changesSince(_timestamp: number): Promise<Change[]> {\n placeholder();\n }\n\n close(): Promise<void> {\n placeholder();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAM,sBACJ;AAEF,SAAS,cAAqB;AAC5B,QAAM,IAAI,MAAM,mBAAmB;AACrC;AA6BO,IAAM,WAAN,MAAe;AAAA,EACZ,cAAc;AACpB,gBAAY;AAAA,EACd;AAAA,EAEA,OAAO,OAAO,UAA6C;AACzD,gBAAY;AAAA,EACd;AAAA,EAEA,QAAQ,QAAgB,UAA+D;AACrF,gBAAY;AAAA,EACd;AAAA,EAEA,eAAsC;AACpC,gBAAY;AAAA,EACd;AAAA,EAEA,SAAoC;AAClC,gBAAY;AAAA,EACd;AAAA,EAEA,OAAO,WAA4C;AACjD,gBAAY;AAAA,EACd;AAAA,EAEA,QAAuB;AACrB,gBAAY;AAAA,EACd;AAAA,EAEA,aAAa,YAAuC;AAClD,gBAAY;AAAA,EACd;AAAA,EAEA,QAAuB;AACrB,gBAAY;AAAA,EACd;AACF;","names":[]}
@@ -0,0 +1,34 @@
1
+ type QueryLanguage = 'gql' | 'cypher' | 'sparql' | 'graphql' | 'gremlin';
2
+ interface CreateOptions {
3
+ persist?: string;
4
+ worker?: boolean;
5
+ }
6
+ interface ExecuteOptions {
7
+ language?: QueryLanguage;
8
+ }
9
+ interface StorageStats {
10
+ bytesUsed: number;
11
+ quota: number;
12
+ }
13
+ interface DatabaseSnapshot {
14
+ version: number;
15
+ data: unknown;
16
+ }
17
+ interface Change {
18
+ type: 'insert' | 'update' | 'delete';
19
+ timestamp: number;
20
+ data: unknown;
21
+ }
22
+ declare class GrafeoDB {
23
+ private constructor();
24
+ static create(_options?: CreateOptions): Promise<GrafeoDB>;
25
+ execute(_query: string, _options?: ExecuteOptions): Promise<Record<string, unknown>[]>;
26
+ storageStats(): Promise<StorageStats>;
27
+ export(): Promise<DatabaseSnapshot>;
28
+ import(_snapshot: DatabaseSnapshot): Promise<void>;
29
+ clear(): Promise<void>;
30
+ changesSince(_timestamp: number): Promise<Change[]>;
31
+ close(): Promise<void>;
32
+ }
33
+
34
+ export { type Change, type CreateOptions, type DatabaseSnapshot, type ExecuteOptions, GrafeoDB, type QueryLanguage, type StorageStats };
@@ -0,0 +1,34 @@
1
+ type QueryLanguage = 'gql' | 'cypher' | 'sparql' | 'graphql' | 'gremlin';
2
+ interface CreateOptions {
3
+ persist?: string;
4
+ worker?: boolean;
5
+ }
6
+ interface ExecuteOptions {
7
+ language?: QueryLanguage;
8
+ }
9
+ interface StorageStats {
10
+ bytesUsed: number;
11
+ quota: number;
12
+ }
13
+ interface DatabaseSnapshot {
14
+ version: number;
15
+ data: unknown;
16
+ }
17
+ interface Change {
18
+ type: 'insert' | 'update' | 'delete';
19
+ timestamp: number;
20
+ data: unknown;
21
+ }
22
+ declare class GrafeoDB {
23
+ private constructor();
24
+ static create(_options?: CreateOptions): Promise<GrafeoDB>;
25
+ execute(_query: string, _options?: ExecuteOptions): Promise<Record<string, unknown>[]>;
26
+ storageStats(): Promise<StorageStats>;
27
+ export(): Promise<DatabaseSnapshot>;
28
+ import(_snapshot: DatabaseSnapshot): Promise<void>;
29
+ clear(): Promise<void>;
30
+ changesSince(_timestamp: number): Promise<Change[]>;
31
+ close(): Promise<void>;
32
+ }
33
+
34
+ export { type Change, type CreateOptions, type DatabaseSnapshot, type ExecuteOptions, GrafeoDB, type QueryLanguage, type StorageStats };
package/dist/index.js ADDED
@@ -0,0 +1,38 @@
1
+ // src/index.ts
2
+ var PLACEHOLDER_MESSAGE = "@grafeo-db/web is not yet released. Follow https://github.com/GrafeoDB/grafeo-web for updates.";
3
+ function placeholder() {
4
+ throw new Error(PLACEHOLDER_MESSAGE);
5
+ }
6
+ var GrafeoDB = class {
7
+ constructor() {
8
+ placeholder();
9
+ }
10
+ static create(_options) {
11
+ placeholder();
12
+ }
13
+ execute(_query, _options) {
14
+ placeholder();
15
+ }
16
+ storageStats() {
17
+ placeholder();
18
+ }
19
+ export() {
20
+ placeholder();
21
+ }
22
+ import(_snapshot) {
23
+ placeholder();
24
+ }
25
+ clear() {
26
+ placeholder();
27
+ }
28
+ changesSince(_timestamp) {
29
+ placeholder();
30
+ }
31
+ close() {
32
+ placeholder();
33
+ }
34
+ };
35
+ export {
36
+ GrafeoDB
37
+ };
38
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["const PLACEHOLDER_MESSAGE =\n '@grafeo-db/web is not yet released. Follow https://github.com/GrafeoDB/grafeo-web for updates.';\n\nfunction placeholder(): never {\n throw new Error(PLACEHOLDER_MESSAGE);\n}\n\nexport type QueryLanguage = 'gql' | 'cypher' | 'sparql' | 'graphql' | 'gremlin';\n\nexport interface CreateOptions {\n persist?: string;\n worker?: boolean;\n}\n\nexport interface ExecuteOptions {\n language?: QueryLanguage;\n}\n\nexport interface StorageStats {\n bytesUsed: number;\n quota: number;\n}\n\nexport interface DatabaseSnapshot {\n version: number;\n data: unknown;\n}\n\nexport interface Change {\n type: 'insert' | 'update' | 'delete';\n timestamp: number;\n data: unknown;\n}\n\nexport class GrafeoDB {\n private constructor() {\n placeholder();\n }\n\n static create(_options?: CreateOptions): Promise<GrafeoDB> {\n placeholder();\n }\n\n execute(_query: string, _options?: ExecuteOptions): Promise<Record<string, unknown>[]> {\n placeholder();\n }\n\n storageStats(): Promise<StorageStats> {\n placeholder();\n }\n\n export(): Promise<DatabaseSnapshot> {\n placeholder();\n }\n\n import(_snapshot: DatabaseSnapshot): Promise<void> {\n placeholder();\n }\n\n clear(): Promise<void> {\n placeholder();\n }\n\n changesSince(_timestamp: number): Promise<Change[]> {\n placeholder();\n }\n\n close(): Promise<void> {\n placeholder();\n }\n}\n"],"mappings":";AAAA,IAAM,sBACJ;AAEF,SAAS,cAAqB;AAC5B,QAAM,IAAI,MAAM,mBAAmB;AACrC;AA6BO,IAAM,WAAN,MAAe;AAAA,EACZ,cAAc;AACpB,gBAAY;AAAA,EACd;AAAA,EAEA,OAAO,OAAO,UAA6C;AACzD,gBAAY;AAAA,EACd;AAAA,EAEA,QAAQ,QAAgB,UAA+D;AACrF,gBAAY;AAAA,EACd;AAAA,EAEA,eAAsC;AACpC,gBAAY;AAAA,EACd;AAAA,EAEA,SAAoC;AAClC,gBAAY;AAAA,EACd;AAAA,EAEA,OAAO,WAA4C;AACjD,gBAAY;AAAA,EACd;AAAA,EAEA,QAAuB;AACrB,gBAAY;AAAA,EACd;AAAA,EAEA,aAAa,YAAuC;AAClD,gBAAY;AAAA,EACd;AAAA,EAEA,QAAuB;AACrB,gBAAY;AAAA,EACd;AACF;","names":[]}
package/dist/lite.cjs ADDED
@@ -0,0 +1,63 @@
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/lite.ts
21
+ var lite_exports = {};
22
+ __export(lite_exports, {
23
+ GrafeoDB: () => GrafeoDB
24
+ });
25
+ module.exports = __toCommonJS(lite_exports);
26
+ var PLACEHOLDER_MESSAGE = "@grafeo-db/web/lite is not yet released. Follow https://github.com/GrafeoDB/grafeo-web for updates.";
27
+ function placeholder() {
28
+ throw new Error(PLACEHOLDER_MESSAGE);
29
+ }
30
+ var GrafeoDB = class {
31
+ constructor() {
32
+ placeholder();
33
+ }
34
+ static create(_options) {
35
+ placeholder();
36
+ }
37
+ execute(_query) {
38
+ placeholder();
39
+ }
40
+ storageStats() {
41
+ placeholder();
42
+ }
43
+ export() {
44
+ placeholder();
45
+ }
46
+ import(_snapshot) {
47
+ placeholder();
48
+ }
49
+ clear() {
50
+ placeholder();
51
+ }
52
+ changesSince(_timestamp) {
53
+ placeholder();
54
+ }
55
+ close() {
56
+ placeholder();
57
+ }
58
+ };
59
+ // Annotate the CommonJS export names for ESM import in node:
60
+ 0 && (module.exports = {
61
+ GrafeoDB
62
+ });
63
+ //# sourceMappingURL=lite.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lite.ts"],"sourcesContent":["const PLACEHOLDER_MESSAGE =\n '@grafeo-db/web/lite is not yet released. Follow https://github.com/GrafeoDB/grafeo-web for updates.';\n\nfunction placeholder(): never {\n throw new Error(PLACEHOLDER_MESSAGE);\n}\n\nexport interface CreateOptions {\n persist?: string;\n worker?: boolean;\n}\n\nexport interface StorageStats {\n bytesUsed: number;\n quota: number;\n}\n\nexport interface DatabaseSnapshot {\n version: number;\n data: unknown;\n}\n\nexport interface Change {\n type: 'insert' | 'update' | 'delete';\n timestamp: number;\n data: unknown;\n}\n\nexport class GrafeoDB {\n private constructor() {\n placeholder();\n }\n\n static create(_options?: CreateOptions): Promise<GrafeoDB> {\n placeholder();\n }\n\n execute(_query: string): Promise<Record<string, unknown>[]> {\n placeholder();\n }\n\n storageStats(): Promise<StorageStats> {\n placeholder();\n }\n\n export(): Promise<DatabaseSnapshot> {\n placeholder();\n }\n\n import(_snapshot: DatabaseSnapshot): Promise<void> {\n placeholder();\n }\n\n clear(): Promise<void> {\n placeholder();\n }\n\n changesSince(_timestamp: number): Promise<Change[]> {\n placeholder();\n }\n\n close(): Promise<void> {\n placeholder();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAM,sBACJ;AAEF,SAAS,cAAqB;AAC5B,QAAM,IAAI,MAAM,mBAAmB;AACrC;AAuBO,IAAM,WAAN,MAAe;AAAA,EACZ,cAAc;AACpB,gBAAY;AAAA,EACd;AAAA,EAEA,OAAO,OAAO,UAA6C;AACzD,gBAAY;AAAA,EACd;AAAA,EAEA,QAAQ,QAAoD;AAC1D,gBAAY;AAAA,EACd;AAAA,EAEA,eAAsC;AACpC,gBAAY;AAAA,EACd;AAAA,EAEA,SAAoC;AAClC,gBAAY;AAAA,EACd;AAAA,EAEA,OAAO,WAA4C;AACjD,gBAAY;AAAA,EACd;AAAA,EAEA,QAAuB;AACrB,gBAAY;AAAA,EACd;AAAA,EAEA,aAAa,YAAuC;AAClD,gBAAY;AAAA,EACd;AAAA,EAEA,QAAuB;AACrB,gBAAY;AAAA,EACd;AACF;","names":[]}
@@ -0,0 +1,30 @@
1
+ interface CreateOptions {
2
+ persist?: string;
3
+ worker?: boolean;
4
+ }
5
+ interface StorageStats {
6
+ bytesUsed: number;
7
+ quota: number;
8
+ }
9
+ interface DatabaseSnapshot {
10
+ version: number;
11
+ data: unknown;
12
+ }
13
+ interface Change {
14
+ type: 'insert' | 'update' | 'delete';
15
+ timestamp: number;
16
+ data: unknown;
17
+ }
18
+ declare class GrafeoDB {
19
+ private constructor();
20
+ static create(_options?: CreateOptions): Promise<GrafeoDB>;
21
+ execute(_query: string): Promise<Record<string, unknown>[]>;
22
+ storageStats(): Promise<StorageStats>;
23
+ export(): Promise<DatabaseSnapshot>;
24
+ import(_snapshot: DatabaseSnapshot): Promise<void>;
25
+ clear(): Promise<void>;
26
+ changesSince(_timestamp: number): Promise<Change[]>;
27
+ close(): Promise<void>;
28
+ }
29
+
30
+ export { type Change, type CreateOptions, type DatabaseSnapshot, GrafeoDB, type StorageStats };
package/dist/lite.d.ts ADDED
@@ -0,0 +1,30 @@
1
+ interface CreateOptions {
2
+ persist?: string;
3
+ worker?: boolean;
4
+ }
5
+ interface StorageStats {
6
+ bytesUsed: number;
7
+ quota: number;
8
+ }
9
+ interface DatabaseSnapshot {
10
+ version: number;
11
+ data: unknown;
12
+ }
13
+ interface Change {
14
+ type: 'insert' | 'update' | 'delete';
15
+ timestamp: number;
16
+ data: unknown;
17
+ }
18
+ declare class GrafeoDB {
19
+ private constructor();
20
+ static create(_options?: CreateOptions): Promise<GrafeoDB>;
21
+ execute(_query: string): Promise<Record<string, unknown>[]>;
22
+ storageStats(): Promise<StorageStats>;
23
+ export(): Promise<DatabaseSnapshot>;
24
+ import(_snapshot: DatabaseSnapshot): Promise<void>;
25
+ clear(): Promise<void>;
26
+ changesSince(_timestamp: number): Promise<Change[]>;
27
+ close(): Promise<void>;
28
+ }
29
+
30
+ export { type Change, type CreateOptions, type DatabaseSnapshot, GrafeoDB, type StorageStats };
package/dist/lite.js ADDED
@@ -0,0 +1,38 @@
1
+ // src/lite.ts
2
+ var PLACEHOLDER_MESSAGE = "@grafeo-db/web/lite is not yet released. Follow https://github.com/GrafeoDB/grafeo-web for updates.";
3
+ function placeholder() {
4
+ throw new Error(PLACEHOLDER_MESSAGE);
5
+ }
6
+ var GrafeoDB = class {
7
+ constructor() {
8
+ placeholder();
9
+ }
10
+ static create(_options) {
11
+ placeholder();
12
+ }
13
+ execute(_query) {
14
+ placeholder();
15
+ }
16
+ storageStats() {
17
+ placeholder();
18
+ }
19
+ export() {
20
+ placeholder();
21
+ }
22
+ import(_snapshot) {
23
+ placeholder();
24
+ }
25
+ clear() {
26
+ placeholder();
27
+ }
28
+ changesSince(_timestamp) {
29
+ placeholder();
30
+ }
31
+ close() {
32
+ placeholder();
33
+ }
34
+ };
35
+ export {
36
+ GrafeoDB
37
+ };
38
+ //# sourceMappingURL=lite.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lite.ts"],"sourcesContent":["const PLACEHOLDER_MESSAGE =\n '@grafeo-db/web/lite is not yet released. Follow https://github.com/GrafeoDB/grafeo-web for updates.';\n\nfunction placeholder(): never {\n throw new Error(PLACEHOLDER_MESSAGE);\n}\n\nexport interface CreateOptions {\n persist?: string;\n worker?: boolean;\n}\n\nexport interface StorageStats {\n bytesUsed: number;\n quota: number;\n}\n\nexport interface DatabaseSnapshot {\n version: number;\n data: unknown;\n}\n\nexport interface Change {\n type: 'insert' | 'update' | 'delete';\n timestamp: number;\n data: unknown;\n}\n\nexport class GrafeoDB {\n private constructor() {\n placeholder();\n }\n\n static create(_options?: CreateOptions): Promise<GrafeoDB> {\n placeholder();\n }\n\n execute(_query: string): Promise<Record<string, unknown>[]> {\n placeholder();\n }\n\n storageStats(): Promise<StorageStats> {\n placeholder();\n }\n\n export(): Promise<DatabaseSnapshot> {\n placeholder();\n }\n\n import(_snapshot: DatabaseSnapshot): Promise<void> {\n placeholder();\n }\n\n clear(): Promise<void> {\n placeholder();\n }\n\n changesSince(_timestamp: number): Promise<Change[]> {\n placeholder();\n }\n\n close(): Promise<void> {\n placeholder();\n }\n}\n"],"mappings":";AAAA,IAAM,sBACJ;AAEF,SAAS,cAAqB;AAC5B,QAAM,IAAI,MAAM,mBAAmB;AACrC;AAuBO,IAAM,WAAN,MAAe;AAAA,EACZ,cAAc;AACpB,gBAAY;AAAA,EACd;AAAA,EAEA,OAAO,OAAO,UAA6C;AACzD,gBAAY;AAAA,EACd;AAAA,EAEA,QAAQ,QAAoD;AAC1D,gBAAY;AAAA,EACd;AAAA,EAEA,eAAsC;AACpC,gBAAY;AAAA,EACd;AAAA,EAEA,SAAoC;AAClC,gBAAY;AAAA,EACd;AAAA,EAEA,OAAO,WAA4C;AACjD,gBAAY;AAAA,EACd;AAAA,EAEA,QAAuB;AACrB,gBAAY;AAAA,EACd;AAAA,EAEA,aAAa,YAAuC;AAClD,gBAAY;AAAA,EACd;AAAA,EAEA,QAAuB;AACrB,gBAAY;AAAA,EACd;AACF;","names":[]}
package/dist/react.cjs ADDED
@@ -0,0 +1,42 @@
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/react.ts
21
+ var react_exports = {};
22
+ __export(react_exports, {
23
+ useGrafeo: () => useGrafeo,
24
+ useQuery: () => useQuery
25
+ });
26
+ module.exports = __toCommonJS(react_exports);
27
+ var PLACEHOLDER_MESSAGE = "@grafeo-db/web/react is not yet released. Follow https://github.com/GrafeoDB/grafeo-web for updates.";
28
+ function placeholder() {
29
+ throw new Error(PLACEHOLDER_MESSAGE);
30
+ }
31
+ function useGrafeo(_options) {
32
+ placeholder();
33
+ }
34
+ function useQuery(_db, _query) {
35
+ placeholder();
36
+ }
37
+ // Annotate the CommonJS export names for ESM import in node:
38
+ 0 && (module.exports = {
39
+ useGrafeo,
40
+ useQuery
41
+ });
42
+ //# sourceMappingURL=react.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/react.ts"],"sourcesContent":["const PLACEHOLDER_MESSAGE =\n '@grafeo-db/web/react is not yet released. Follow https://github.com/GrafeoDB/grafeo-web for updates.';\n\nfunction placeholder(): never {\n throw new Error(PLACEHOLDER_MESSAGE);\n}\n\nexport interface CreateOptions {\n persist?: string;\n worker?: boolean;\n}\n\nexport interface GrafeoDB {\n execute(query: string): Promise<Record<string, unknown>[]>;\n close(): Promise<void>;\n}\n\nexport interface UseGrafeoResult {\n db: GrafeoDB | null;\n loading: boolean;\n error: Error | null;\n}\n\nexport interface UseQueryResult<T = Record<string, unknown>[]> {\n data: T | null;\n loading: boolean;\n error: Error | null;\n refetch: () => void;\n}\n\nexport function useGrafeo(_options?: CreateOptions): UseGrafeoResult {\n placeholder();\n}\n\nexport function useQuery<T = Record<string, unknown>[]>(\n _db: GrafeoDB | null,\n _query: string\n): UseQueryResult<T> {\n placeholder();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAM,sBACJ;AAEF,SAAS,cAAqB;AAC5B,QAAM,IAAI,MAAM,mBAAmB;AACrC;AAyBO,SAAS,UAAU,UAA2C;AACnE,cAAY;AACd;AAEO,SAAS,SACd,KACA,QACmB;AACnB,cAAY;AACd;","names":[]}
@@ -0,0 +1,23 @@
1
+ interface CreateOptions {
2
+ persist?: string;
3
+ worker?: boolean;
4
+ }
5
+ interface GrafeoDB {
6
+ execute(query: string): Promise<Record<string, unknown>[]>;
7
+ close(): Promise<void>;
8
+ }
9
+ interface UseGrafeoResult {
10
+ db: GrafeoDB | null;
11
+ loading: boolean;
12
+ error: Error | null;
13
+ }
14
+ interface UseQueryResult<T = Record<string, unknown>[]> {
15
+ data: T | null;
16
+ loading: boolean;
17
+ error: Error | null;
18
+ refetch: () => void;
19
+ }
20
+ declare function useGrafeo(_options?: CreateOptions): UseGrafeoResult;
21
+ declare function useQuery<T = Record<string, unknown>[]>(_db: GrafeoDB | null, _query: string): UseQueryResult<T>;
22
+
23
+ export { type CreateOptions, type GrafeoDB, type UseGrafeoResult, type UseQueryResult, useGrafeo, useQuery };
@@ -0,0 +1,23 @@
1
+ interface CreateOptions {
2
+ persist?: string;
3
+ worker?: boolean;
4
+ }
5
+ interface GrafeoDB {
6
+ execute(query: string): Promise<Record<string, unknown>[]>;
7
+ close(): Promise<void>;
8
+ }
9
+ interface UseGrafeoResult {
10
+ db: GrafeoDB | null;
11
+ loading: boolean;
12
+ error: Error | null;
13
+ }
14
+ interface UseQueryResult<T = Record<string, unknown>[]> {
15
+ data: T | null;
16
+ loading: boolean;
17
+ error: Error | null;
18
+ refetch: () => void;
19
+ }
20
+ declare function useGrafeo(_options?: CreateOptions): UseGrafeoResult;
21
+ declare function useQuery<T = Record<string, unknown>[]>(_db: GrafeoDB | null, _query: string): UseQueryResult<T>;
22
+
23
+ export { type CreateOptions, type GrafeoDB, type UseGrafeoResult, type UseQueryResult, useGrafeo, useQuery };
package/dist/react.js ADDED
@@ -0,0 +1,16 @@
1
+ // src/react.ts
2
+ var PLACEHOLDER_MESSAGE = "@grafeo-db/web/react is not yet released. Follow https://github.com/GrafeoDB/grafeo-web for updates.";
3
+ function placeholder() {
4
+ throw new Error(PLACEHOLDER_MESSAGE);
5
+ }
6
+ function useGrafeo(_options) {
7
+ placeholder();
8
+ }
9
+ function useQuery(_db, _query) {
10
+ placeholder();
11
+ }
12
+ export {
13
+ useGrafeo,
14
+ useQuery
15
+ };
16
+ //# sourceMappingURL=react.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/react.ts"],"sourcesContent":["const PLACEHOLDER_MESSAGE =\n '@grafeo-db/web/react is not yet released. Follow https://github.com/GrafeoDB/grafeo-web for updates.';\n\nfunction placeholder(): never {\n throw new Error(PLACEHOLDER_MESSAGE);\n}\n\nexport interface CreateOptions {\n persist?: string;\n worker?: boolean;\n}\n\nexport interface GrafeoDB {\n execute(query: string): Promise<Record<string, unknown>[]>;\n close(): Promise<void>;\n}\n\nexport interface UseGrafeoResult {\n db: GrafeoDB | null;\n loading: boolean;\n error: Error | null;\n}\n\nexport interface UseQueryResult<T = Record<string, unknown>[]> {\n data: T | null;\n loading: boolean;\n error: Error | null;\n refetch: () => void;\n}\n\nexport function useGrafeo(_options?: CreateOptions): UseGrafeoResult {\n placeholder();\n}\n\nexport function useQuery<T = Record<string, unknown>[]>(\n _db: GrafeoDB | null,\n _query: string\n): UseQueryResult<T> {\n placeholder();\n}\n"],"mappings":";AAAA,IAAM,sBACJ;AAEF,SAAS,cAAqB;AAC5B,QAAM,IAAI,MAAM,mBAAmB;AACrC;AAyBO,SAAS,UAAU,UAA2C;AACnE,cAAY;AACd;AAEO,SAAS,SACd,KACA,QACmB;AACnB,cAAY;AACd;","names":[]}
@@ -0,0 +1,37 @@
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/svelte.ts
21
+ var svelte_exports = {};
22
+ __export(svelte_exports, {
23
+ createGrafeo: () => createGrafeo
24
+ });
25
+ module.exports = __toCommonJS(svelte_exports);
26
+ var PLACEHOLDER_MESSAGE = "@grafeo-db/web/svelte is not yet released. Follow https://github.com/GrafeoDB/grafeo-web for updates.";
27
+ function placeholder() {
28
+ throw new Error(PLACEHOLDER_MESSAGE);
29
+ }
30
+ function createGrafeo(_options) {
31
+ placeholder();
32
+ }
33
+ // Annotate the CommonJS export names for ESM import in node:
34
+ 0 && (module.exports = {
35
+ createGrafeo
36
+ });
37
+ //# sourceMappingURL=svelte.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/svelte.ts"],"sourcesContent":["const PLACEHOLDER_MESSAGE =\n '@grafeo-db/web/svelte is not yet released. Follow https://github.com/GrafeoDB/grafeo-web for updates.';\n\nfunction placeholder(): never {\n throw new Error(PLACEHOLDER_MESSAGE);\n}\n\nexport interface CreateOptions {\n persist?: string;\n worker?: boolean;\n}\n\nexport interface GrafeoDB {\n execute(query: string): Promise<Record<string, unknown>[]>;\n close(): Promise<void>;\n}\n\nexport interface Readable<T> {\n subscribe(fn: (value: T) => void): () => void;\n}\n\nexport interface CreateGrafeoResult {\n db: Readable<GrafeoDB | null>;\n loading: Readable<boolean>;\n error: Readable<Error | null>;\n}\n\nexport function createGrafeo(_options?: CreateOptions): CreateGrafeoResult {\n placeholder();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAM,sBACJ;AAEF,SAAS,cAAqB;AAC5B,QAAM,IAAI,MAAM,mBAAmB;AACrC;AAsBO,SAAS,aAAa,UAA8C;AACzE,cAAY;AACd;","names":[]}
@@ -0,0 +1,19 @@
1
+ interface CreateOptions {
2
+ persist?: string;
3
+ worker?: boolean;
4
+ }
5
+ interface GrafeoDB {
6
+ execute(query: string): Promise<Record<string, unknown>[]>;
7
+ close(): Promise<void>;
8
+ }
9
+ interface Readable<T> {
10
+ subscribe(fn: (value: T) => void): () => void;
11
+ }
12
+ interface CreateGrafeoResult {
13
+ db: Readable<GrafeoDB | null>;
14
+ loading: Readable<boolean>;
15
+ error: Readable<Error | null>;
16
+ }
17
+ declare function createGrafeo(_options?: CreateOptions): CreateGrafeoResult;
18
+
19
+ export { type CreateGrafeoResult, type CreateOptions, type GrafeoDB, type Readable, createGrafeo };
@@ -0,0 +1,19 @@
1
+ interface CreateOptions {
2
+ persist?: string;
3
+ worker?: boolean;
4
+ }
5
+ interface GrafeoDB {
6
+ execute(query: string): Promise<Record<string, unknown>[]>;
7
+ close(): Promise<void>;
8
+ }
9
+ interface Readable<T> {
10
+ subscribe(fn: (value: T) => void): () => void;
11
+ }
12
+ interface CreateGrafeoResult {
13
+ db: Readable<GrafeoDB | null>;
14
+ loading: Readable<boolean>;
15
+ error: Readable<Error | null>;
16
+ }
17
+ declare function createGrafeo(_options?: CreateOptions): CreateGrafeoResult;
18
+
19
+ export { type CreateGrafeoResult, type CreateOptions, type GrafeoDB, type Readable, createGrafeo };
package/dist/svelte.js ADDED
@@ -0,0 +1,12 @@
1
+ // src/svelte.ts
2
+ var PLACEHOLDER_MESSAGE = "@grafeo-db/web/svelte is not yet released. Follow https://github.com/GrafeoDB/grafeo-web for updates.";
3
+ function placeholder() {
4
+ throw new Error(PLACEHOLDER_MESSAGE);
5
+ }
6
+ function createGrafeo(_options) {
7
+ placeholder();
8
+ }
9
+ export {
10
+ createGrafeo
11
+ };
12
+ //# sourceMappingURL=svelte.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/svelte.ts"],"sourcesContent":["const PLACEHOLDER_MESSAGE =\n '@grafeo-db/web/svelte is not yet released. Follow https://github.com/GrafeoDB/grafeo-web for updates.';\n\nfunction placeholder(): never {\n throw new Error(PLACEHOLDER_MESSAGE);\n}\n\nexport interface CreateOptions {\n persist?: string;\n worker?: boolean;\n}\n\nexport interface GrafeoDB {\n execute(query: string): Promise<Record<string, unknown>[]>;\n close(): Promise<void>;\n}\n\nexport interface Readable<T> {\n subscribe(fn: (value: T) => void): () => void;\n}\n\nexport interface CreateGrafeoResult {\n db: Readable<GrafeoDB | null>;\n loading: Readable<boolean>;\n error: Readable<Error | null>;\n}\n\nexport function createGrafeo(_options?: CreateOptions): CreateGrafeoResult {\n placeholder();\n}\n"],"mappings":";AAAA,IAAM,sBACJ;AAEF,SAAS,cAAqB;AAC5B,QAAM,IAAI,MAAM,mBAAmB;AACrC;AAsBO,SAAS,aAAa,UAA8C;AACzE,cAAY;AACd;","names":[]}
package/dist/vue.cjs ADDED
@@ -0,0 +1,42 @@
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/vue.ts
21
+ var vue_exports = {};
22
+ __export(vue_exports, {
23
+ useGrafeo: () => useGrafeo,
24
+ useQuery: () => useQuery
25
+ });
26
+ module.exports = __toCommonJS(vue_exports);
27
+ var PLACEHOLDER_MESSAGE = "@grafeo-db/web/vue is not yet released. Follow https://github.com/GrafeoDB/grafeo-web for updates.";
28
+ function placeholder() {
29
+ throw new Error(PLACEHOLDER_MESSAGE);
30
+ }
31
+ function useGrafeo(_options) {
32
+ placeholder();
33
+ }
34
+ function useQuery(_db, _query) {
35
+ placeholder();
36
+ }
37
+ // Annotate the CommonJS export names for ESM import in node:
38
+ 0 && (module.exports = {
39
+ useGrafeo,
40
+ useQuery
41
+ });
42
+ //# sourceMappingURL=vue.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/vue.ts"],"sourcesContent":["const PLACEHOLDER_MESSAGE =\n '@grafeo-db/web/vue is not yet released. Follow https://github.com/GrafeoDB/grafeo-web for updates.';\n\nfunction placeholder(): never {\n throw new Error(PLACEHOLDER_MESSAGE);\n}\n\nexport interface CreateOptions {\n persist?: string;\n worker?: boolean;\n}\n\nexport interface GrafeoDB {\n execute(query: string): Promise<Record<string, unknown>[]>;\n close(): Promise<void>;\n}\n\nexport interface Ref<T> {\n value: T;\n}\n\nexport interface UseGrafeoResult {\n db: Ref<GrafeoDB | null>;\n loading: Ref<boolean>;\n error: Ref<Error | null>;\n}\n\nexport interface UseQueryResult<T = Record<string, unknown>[]> {\n data: Ref<T | null>;\n loading: Ref<boolean>;\n error: Ref<Error | null>;\n refetch: () => void;\n}\n\nexport function useGrafeo(_options?: CreateOptions): UseGrafeoResult {\n placeholder();\n}\n\nexport function useQuery<T = Record<string, unknown>[]>(\n _db: Ref<GrafeoDB | null>,\n _query: string\n): UseQueryResult<T> {\n placeholder();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAM,sBACJ;AAEF,SAAS,cAAqB;AAC5B,QAAM,IAAI,MAAM,mBAAmB;AACrC;AA6BO,SAAS,UAAU,UAA2C;AACnE,cAAY;AACd;AAEO,SAAS,SACd,KACA,QACmB;AACnB,cAAY;AACd;","names":[]}
package/dist/vue.d.cts ADDED
@@ -0,0 +1,26 @@
1
+ interface CreateOptions {
2
+ persist?: string;
3
+ worker?: boolean;
4
+ }
5
+ interface GrafeoDB {
6
+ execute(query: string): Promise<Record<string, unknown>[]>;
7
+ close(): Promise<void>;
8
+ }
9
+ interface Ref<T> {
10
+ value: T;
11
+ }
12
+ interface UseGrafeoResult {
13
+ db: Ref<GrafeoDB | null>;
14
+ loading: Ref<boolean>;
15
+ error: Ref<Error | null>;
16
+ }
17
+ interface UseQueryResult<T = Record<string, unknown>[]> {
18
+ data: Ref<T | null>;
19
+ loading: Ref<boolean>;
20
+ error: Ref<Error | null>;
21
+ refetch: () => void;
22
+ }
23
+ declare function useGrafeo(_options?: CreateOptions): UseGrafeoResult;
24
+ declare function useQuery<T = Record<string, unknown>[]>(_db: Ref<GrafeoDB | null>, _query: string): UseQueryResult<T>;
25
+
26
+ export { type CreateOptions, type GrafeoDB, type Ref, type UseGrafeoResult, type UseQueryResult, useGrafeo, useQuery };
package/dist/vue.d.ts ADDED
@@ -0,0 +1,26 @@
1
+ interface CreateOptions {
2
+ persist?: string;
3
+ worker?: boolean;
4
+ }
5
+ interface GrafeoDB {
6
+ execute(query: string): Promise<Record<string, unknown>[]>;
7
+ close(): Promise<void>;
8
+ }
9
+ interface Ref<T> {
10
+ value: T;
11
+ }
12
+ interface UseGrafeoResult {
13
+ db: Ref<GrafeoDB | null>;
14
+ loading: Ref<boolean>;
15
+ error: Ref<Error | null>;
16
+ }
17
+ interface UseQueryResult<T = Record<string, unknown>[]> {
18
+ data: Ref<T | null>;
19
+ loading: Ref<boolean>;
20
+ error: Ref<Error | null>;
21
+ refetch: () => void;
22
+ }
23
+ declare function useGrafeo(_options?: CreateOptions): UseGrafeoResult;
24
+ declare function useQuery<T = Record<string, unknown>[]>(_db: Ref<GrafeoDB | null>, _query: string): UseQueryResult<T>;
25
+
26
+ export { type CreateOptions, type GrafeoDB, type Ref, type UseGrafeoResult, type UseQueryResult, useGrafeo, useQuery };
package/dist/vue.js ADDED
@@ -0,0 +1,16 @@
1
+ // src/vue.ts
2
+ var PLACEHOLDER_MESSAGE = "@grafeo-db/web/vue is not yet released. Follow https://github.com/GrafeoDB/grafeo-web for updates.";
3
+ function placeholder() {
4
+ throw new Error(PLACEHOLDER_MESSAGE);
5
+ }
6
+ function useGrafeo(_options) {
7
+ placeholder();
8
+ }
9
+ function useQuery(_db, _query) {
10
+ placeholder();
11
+ }
12
+ export {
13
+ useGrafeo,
14
+ useQuery
15
+ };
16
+ //# sourceMappingURL=vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/vue.ts"],"sourcesContent":["const PLACEHOLDER_MESSAGE =\n '@grafeo-db/web/vue is not yet released. Follow https://github.com/GrafeoDB/grafeo-web for updates.';\n\nfunction placeholder(): never {\n throw new Error(PLACEHOLDER_MESSAGE);\n}\n\nexport interface CreateOptions {\n persist?: string;\n worker?: boolean;\n}\n\nexport interface GrafeoDB {\n execute(query: string): Promise<Record<string, unknown>[]>;\n close(): Promise<void>;\n}\n\nexport interface Ref<T> {\n value: T;\n}\n\nexport interface UseGrafeoResult {\n db: Ref<GrafeoDB | null>;\n loading: Ref<boolean>;\n error: Ref<Error | null>;\n}\n\nexport interface UseQueryResult<T = Record<string, unknown>[]> {\n data: Ref<T | null>;\n loading: Ref<boolean>;\n error: Ref<Error | null>;\n refetch: () => void;\n}\n\nexport function useGrafeo(_options?: CreateOptions): UseGrafeoResult {\n placeholder();\n}\n\nexport function useQuery<T = Record<string, unknown>[]>(\n _db: Ref<GrafeoDB | null>,\n _query: string\n): UseQueryResult<T> {\n placeholder();\n}\n"],"mappings":";AAAA,IAAM,sBACJ;AAEF,SAAS,cAAqB;AAC5B,QAAM,IAAI,MAAM,mBAAmB;AACrC;AA6BO,SAAS,UAAU,UAA2C;AACnE,cAAY;AACd;AAEO,SAAS,SACd,KACA,QACmB;AACnB,cAAY;AACd;","names":[]}
package/package.json ADDED
@@ -0,0 +1,99 @@
1
+ {
2
+ "name": "@grafeo-db/web",
3
+ "version": "0.0.1",
4
+ "description": "Grafeo graph database in the browser - WebAssembly powered, zero backend",
5
+ "keywords": [
6
+ "grafeo",
7
+ "graph",
8
+ "database",
9
+ "wasm",
10
+ "webassembly",
11
+ "indexeddb",
12
+ "offline",
13
+ "gql",
14
+ "cypher",
15
+ "sparql",
16
+ "graphql",
17
+ "gremlin"
18
+ ],
19
+ "homepage": "https://github.com/GrafeoDB/grafeo-web",
20
+ "bugs": {
21
+ "url": "https://github.com/GrafeoDB/grafeo-web/issues"
22
+ },
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/GrafeoDB/grafeo-web.git"
26
+ },
27
+ "license": "Apache-2.0",
28
+ "author": "Grafeo Contributors",
29
+ "type": "module",
30
+ "exports": {
31
+ ".": {
32
+ "import": {
33
+ "types": "./dist/index.d.ts",
34
+ "default": "./dist/index.js"
35
+ },
36
+ "require": {
37
+ "types": "./dist/index.d.cts",
38
+ "default": "./dist/index.cjs"
39
+ }
40
+ },
41
+ "./lite": {
42
+ "import": {
43
+ "types": "./dist/lite.d.ts",
44
+ "default": "./dist/lite.js"
45
+ },
46
+ "require": {
47
+ "types": "./dist/lite.d.cts",
48
+ "default": "./dist/lite.cjs"
49
+ }
50
+ },
51
+ "./react": {
52
+ "import": {
53
+ "types": "./dist/react.d.ts",
54
+ "default": "./dist/react.js"
55
+ },
56
+ "require": {
57
+ "types": "./dist/react.d.cts",
58
+ "default": "./dist/react.cjs"
59
+ }
60
+ },
61
+ "./vue": {
62
+ "import": {
63
+ "types": "./dist/vue.d.ts",
64
+ "default": "./dist/vue.js"
65
+ },
66
+ "require": {
67
+ "types": "./dist/vue.d.cts",
68
+ "default": "./dist/vue.cjs"
69
+ }
70
+ },
71
+ "./svelte": {
72
+ "import": {
73
+ "types": "./dist/svelte.d.ts",
74
+ "default": "./dist/svelte.js"
75
+ },
76
+ "require": {
77
+ "types": "./dist/svelte.d.cts",
78
+ "default": "./dist/svelte.cjs"
79
+ }
80
+ }
81
+ },
82
+ "main": "./dist/index.cjs",
83
+ "module": "./dist/index.js",
84
+ "types": "./dist/index.d.ts",
85
+ "files": [
86
+ "dist"
87
+ ],
88
+ "scripts": {
89
+ "build": "tsup",
90
+ "prepublishOnly": "npm run build"
91
+ },
92
+ "devDependencies": {
93
+ "tsup": "^8.0.0",
94
+ "typescript": "^5.3.0"
95
+ },
96
+ "engines": {
97
+ "node": ">=18"
98
+ }
99
+ }