@fireproof/core 0.19.8-dev-global → 0.19.11-dev-dryrun
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +34 -0
- package/chunk-7EWIAXTM.js +7 -0
- package/chunk-7EWIAXTM.js.map +1 -0
- package/chunk-MAK4D54P.js +280 -0
- package/chunk-MAK4D54P.js.map +1 -0
- package/chunk-PB4BKL4O.js +7 -0
- package/chunk-PB4BKL4O.js.map +1 -0
- package/chunk-XINRLWR3.js +75 -0
- package/chunk-XINRLWR3.js.map +1 -0
- package/deno.json +20 -0
- package/{store-indexdb-WLRSICCB.js → gateway-7OM6OSYK.js} +49 -82
- package/gateway-7OM6OSYK.js.map +1 -0
- package/gateway-VWWKLHUI.js +144 -0
- package/gateway-VWWKLHUI.js.map +1 -0
- package/index.cjs +2351 -1825
- package/index.cjs.map +1 -1
- package/index.d.cts +659 -535
- package/index.d.ts +659 -535
- package/index.global.js +26315 -20709
- package/index.global.js.map +1 -1
- package/index.js +1700 -1058
- package/index.js.map +1 -1
- package/key-bag-file-DFMW6ZM6.js +54 -0
- package/key-bag-file-DFMW6ZM6.js.map +1 -0
- package/key-bag-indexdb-R2RWGSQ4.js +50 -0
- package/key-bag-indexdb-R2RWGSQ4.js.map +1 -0
- package/mem-filesystem-BZQZLUR6.js +41 -0
- package/mem-filesystem-BZQZLUR6.js.map +1 -0
- package/metafile-cjs.json +1 -1
- package/metafile-esm.json +1 -1
- package/metafile-iife.json +1 -1
- package/node-filesystem-7YZR3POJ.js +45 -0
- package/node-filesystem-7YZR3POJ.js.map +1 -0
- package/package.json +12 -8
- package/tests/blockstore/fragment-gateway.test.ts +107 -0
- package/tests/blockstore/keyed-crypto.test.ts +332 -0
- package/tests/blockstore/loader.test.ts +24 -19
- package/tests/blockstore/store.test.ts +51 -40
- package/tests/blockstore/transaction.test.ts +19 -15
- package/tests/fireproof/all-gateway.test.ts +395 -0
- package/tests/fireproof/cars/bafkreidxwt2nhvbl4fnqfw3ctlt6zbrir4kqwmjo5im6rf4q5si27kgo2i.car +0 -0
- package/tests/fireproof/cars/bafkreidxwt2nhvbl4fnqfw3ctlt6zbrir4kqwmjo5im6rf4q5si27kgo2i.js +316 -0
- package/tests/fireproof/config.test.ts +94 -78
- package/tests/fireproof/convert_uint8.py +27 -0
- package/tests/fireproof/crdt.test.ts +34 -28
- package/tests/fireproof/database.test.ts +22 -14
- package/tests/fireproof/fireproof.test.fixture.ts +133 -0
- package/tests/fireproof/fireproof.test.ts +331 -219
- package/tests/fireproof/hello.test.ts +34 -18
- package/tests/fireproof/indexer.test.ts +34 -27
- package/tests/fireproof/utils.test.ts +65 -0
- package/tests/helpers.ts +28 -57
- package/utils-AISQB3PB.js +14 -0
- package/utils-AISQB3PB.js.map +1 -0
- package/chunk-BNL4PVBF.js +0 -314
- package/chunk-BNL4PVBF.js.map +0 -1
- package/chunk-JW2QT6BF.js +0 -184
- package/chunk-JW2QT6BF.js.map +0 -1
- package/node-sys-container-MIEX6ELJ.js +0 -29
- package/node-sys-container-MIEX6ELJ.js.map +0 -1
- package/store-file-VJ6BI4II.js +0 -191
- package/store-file-VJ6BI4II.js.map +0 -1
- package/store-indexdb-WLRSICCB.js.map +0 -1
package/README.md
CHANGED
@@ -121,6 +121,40 @@ if you are in the browser you can use the following code to set the debug level:
|
|
121
121
|
this[Symbol.for("FP_ENV")].set("FP_DEBUG", "*");
|
122
122
|
```
|
123
123
|
|
124
|
+
```js
|
125
|
+
// vitest pass env
|
126
|
+
globalThis[Symbol.for("FP_PRESET_ENV")] = {
|
127
|
+
FP_DEBUG: "*",
|
128
|
+
};
|
129
|
+
```
|
130
|
+
|
131
|
+
### Log Formatting
|
132
|
+
|
133
|
+
It's possible to change the logformat by setting FP_FORMAT to:
|
134
|
+
|
135
|
+
- jsonice makes the log output in multiline json
|
136
|
+
- yaml makes the log output in yaml
|
137
|
+
- json makes the log output in singleline json (default)
|
138
|
+
|
139
|
+
### KeyBag
|
140
|
+
|
141
|
+
If you add `extractKey` with the value `_deprecated_internal_api` to the `FP_STORAGE_URL` url
|
142
|
+
you can bypass the security check to extract the key material. This is the default configuration,
|
143
|
+
but there is a warning emitted if you use this feature, and roadmap plans for more secure key management.
|
144
|
+
|
145
|
+
### Deno
|
146
|
+
|
147
|
+
Fireproof is compatible with Deno. To runit in Deno you need to add the following flags:
|
148
|
+
|
149
|
+
Currently the tests are not run with deno -- TODO
|
150
|
+
|
151
|
+
It might be that using our provided deno.json is somekind of odd
|
152
|
+
--- TODO is to add fireproof to jsr and deno.land
|
153
|
+
|
154
|
+
```shell
|
155
|
+
deno run --config node_modules/@fireproof/core/deno.json --allow-read --allow-write --allow-env --unstable-sloppy-imports ./node-test.ts
|
156
|
+
```
|
157
|
+
|
124
158
|
## Thanks 🙏
|
125
159
|
|
126
160
|
Fireproof is a synthesis of work done by people in the web community over the years. I couldn't even begin to name all the folks who made pivotal contributions. Without npm, React, and VS Code all this would have taken so much longer. Thanks to everyone who supported me getting into database development via Apache CouchDB, one of the original document databases. The distinguishing work on immutable data-structures comes from the years of consideration [IPFS](https://ipfs.tech), [IPLD](https://ipld.io), and the [Filecoin APIs](https://docs.filecoin.io) have enjoyed.
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/runtime/gateways/file/version.ts"],"sourcesContent":["export const FILESTORE_VERSION = \"v0.19-file\";\n"],"mappings":";AAAO,IAAM,oBAAoB;","names":[]}
|
@@ -0,0 +1,280 @@
|
|
1
|
+
var __defProp = Object.defineProperty;
|
2
|
+
var __export = (target, all) => {
|
3
|
+
for (var name in all)
|
4
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
5
|
+
};
|
6
|
+
|
7
|
+
// src/utils.ts
|
8
|
+
import {
|
9
|
+
LoggerImpl,
|
10
|
+
IsLogger,
|
11
|
+
Result,
|
12
|
+
ResolveOnce,
|
13
|
+
isURL,
|
14
|
+
URI,
|
15
|
+
runtimeFn,
|
16
|
+
envFactory,
|
17
|
+
toCryptoRuntime,
|
18
|
+
JSONFormatter,
|
19
|
+
YAMLFormatter
|
20
|
+
} from "@adviser/cement";
|
21
|
+
import { base58btc } from "multiformats/bases/base58";
|
22
|
+
var globalLogger = new LoggerImpl();
|
23
|
+
var registerFP_DEBUG = new ResolveOnce();
|
24
|
+
var superThis = class _superThis {
|
25
|
+
constructor(opts) {
|
26
|
+
this.logger = opts.logger;
|
27
|
+
this.env = opts.env;
|
28
|
+
this.crypto = opts.crypto;
|
29
|
+
this.pathOps = opts.pathOps;
|
30
|
+
this.txt = opts.txt;
|
31
|
+
this.ctx = { ...opts.ctx };
|
32
|
+
}
|
33
|
+
nextId(bytes = 6) {
|
34
|
+
const bin = this.crypto.randomBytes(bytes);
|
35
|
+
return {
|
36
|
+
str: base58btc.encode(bin),
|
37
|
+
bin
|
38
|
+
};
|
39
|
+
}
|
40
|
+
start() {
|
41
|
+
return Promise.resolve();
|
42
|
+
}
|
43
|
+
clone(override) {
|
44
|
+
return new _superThis({
|
45
|
+
logger: override.logger || this.logger,
|
46
|
+
env: envFactory(override.env) || this.env,
|
47
|
+
crypto: override.crypto || this.crypto,
|
48
|
+
pathOps: override.pathOps || this.pathOps,
|
49
|
+
txt: override.txt || this.txt,
|
50
|
+
ctx: { ...this.ctx, ...override.ctx }
|
51
|
+
});
|
52
|
+
}
|
53
|
+
};
|
54
|
+
function presetEnv() {
|
55
|
+
const penv = new Map([
|
56
|
+
// ["FP_DEBUG", "xxx"],
|
57
|
+
// ["FP_ENV", "development"],
|
58
|
+
...Array.from(
|
59
|
+
Object.entries(
|
60
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
61
|
+
globalThis[Symbol.for("FP_PRESET_ENV")] || {}
|
62
|
+
)
|
63
|
+
)
|
64
|
+
// .map(([k, v]) => [k, v as string])
|
65
|
+
]);
|
66
|
+
return penv;
|
67
|
+
}
|
68
|
+
var pathOpsImpl = class {
|
69
|
+
join(...paths) {
|
70
|
+
return paths.map((i) => i.replace(/\/+$/, "")).join("/");
|
71
|
+
}
|
72
|
+
dirname(path) {
|
73
|
+
return path.split("/").slice(0, -1).join("/");
|
74
|
+
}
|
75
|
+
// homedir() {
|
76
|
+
// throw new Error("SysContainer:homedir is not available in seeded state");
|
77
|
+
// }
|
78
|
+
};
|
79
|
+
var pathOps = new pathOpsImpl();
|
80
|
+
var txtOps = {
|
81
|
+
encode: (input) => new TextEncoder().encode(input),
|
82
|
+
decode: (input) => new TextDecoder().decode(input)
|
83
|
+
};
|
84
|
+
function ensureSuperThis(osthis) {
|
85
|
+
const env = envFactory({
|
86
|
+
symbol: osthis?.env?.symbol || "FP_ENV",
|
87
|
+
presetEnv: osthis?.env?.presetEnv || presetEnv()
|
88
|
+
});
|
89
|
+
return new superThis({
|
90
|
+
logger: osthis?.logger || globalLogger,
|
91
|
+
env,
|
92
|
+
crypto: osthis?.crypto || toCryptoRuntime(),
|
93
|
+
ctx: osthis?.ctx || {},
|
94
|
+
pathOps,
|
95
|
+
txt: osthis?.txt || txtOps
|
96
|
+
});
|
97
|
+
}
|
98
|
+
function ensureSuperLog(sthis, componentName, ctx) {
|
99
|
+
return sthis.clone({
|
100
|
+
logger: ensureLogger(sthis, componentName, ctx)
|
101
|
+
});
|
102
|
+
}
|
103
|
+
function ensureLogger(sthis, componentName, ctx) {
|
104
|
+
let logger = globalLogger;
|
105
|
+
if (IsLogger(sthis)) {
|
106
|
+
logger = sthis;
|
107
|
+
} else if (sthis && IsLogger(sthis.logger)) {
|
108
|
+
logger = sthis.logger;
|
109
|
+
}
|
110
|
+
const cLogger = logger.With().Module(componentName);
|
111
|
+
const debug = [];
|
112
|
+
let exposeStack = false;
|
113
|
+
if (ctx) {
|
114
|
+
if ("debug" in ctx) {
|
115
|
+
if (typeof ctx.debug === "string" && ctx.debug.length > 0) {
|
116
|
+
debug.push(ctx.debug);
|
117
|
+
} else {
|
118
|
+
debug.push(componentName);
|
119
|
+
}
|
120
|
+
delete ctx.debug;
|
121
|
+
}
|
122
|
+
if ("exposeStack" in ctx) {
|
123
|
+
exposeStack = true;
|
124
|
+
delete ctx.exposeStack;
|
125
|
+
}
|
126
|
+
if ("this" in ctx) {
|
127
|
+
cLogger.Str("this", sthis.nextId(4).str);
|
128
|
+
delete ctx.this;
|
129
|
+
}
|
130
|
+
for (const [key, value] of Object.entries(ctx)) {
|
131
|
+
switch (typeof value) {
|
132
|
+
case "string":
|
133
|
+
cLogger.Str(key, value);
|
134
|
+
break;
|
135
|
+
case "number":
|
136
|
+
cLogger.Uint64(key, value);
|
137
|
+
break;
|
138
|
+
default:
|
139
|
+
if (value instanceof Date) {
|
140
|
+
cLogger.Str(key, value.toISOString());
|
141
|
+
} else if (isURL(value)) {
|
142
|
+
cLogger.Str(key, value.toString());
|
143
|
+
} else if (typeof value === "function") {
|
144
|
+
cLogger.Ref(key, value);
|
145
|
+
} else {
|
146
|
+
cLogger.Any(key, value);
|
147
|
+
}
|
148
|
+
break;
|
149
|
+
}
|
150
|
+
}
|
151
|
+
}
|
152
|
+
registerFP_DEBUG.once(async () => {
|
153
|
+
sthis.env.onSet(
|
154
|
+
(key, value) => {
|
155
|
+
switch (key) {
|
156
|
+
case "FP_FORMAT": {
|
157
|
+
switch (value) {
|
158
|
+
case "jsonice":
|
159
|
+
logger.SetFormatter(new JSONFormatter(logger.TxtEnDe(), 2));
|
160
|
+
break;
|
161
|
+
case "yaml":
|
162
|
+
logger.SetFormatter(new YAMLFormatter(logger.TxtEnDe(), 2));
|
163
|
+
break;
|
164
|
+
case "json":
|
165
|
+
default:
|
166
|
+
logger.SetFormatter(new JSONFormatter(logger.TxtEnDe()));
|
167
|
+
break;
|
168
|
+
}
|
169
|
+
break;
|
170
|
+
}
|
171
|
+
case "FP_DEBUG":
|
172
|
+
logger.SetDebug(value || []);
|
173
|
+
break;
|
174
|
+
case "FP_STACK":
|
175
|
+
logger.SetExposeStack(!!value);
|
176
|
+
break;
|
177
|
+
}
|
178
|
+
},
|
179
|
+
"FP_FORMAT",
|
180
|
+
"FP_DEBUG",
|
181
|
+
"FP_STACK"
|
182
|
+
);
|
183
|
+
}).finally(() => {
|
184
|
+
});
|
185
|
+
if (debug.length > 0) {
|
186
|
+
logger.SetDebug(debug);
|
187
|
+
}
|
188
|
+
if (exposeStack) {
|
189
|
+
logger.SetExposeStack(true);
|
190
|
+
}
|
191
|
+
const out = cLogger.Logger();
|
192
|
+
return out;
|
193
|
+
}
|
194
|
+
function getStore(url, sthis, joiner) {
|
195
|
+
const store = url.getParam("store");
|
196
|
+
switch (store) {
|
197
|
+
case "data":
|
198
|
+
case "wal":
|
199
|
+
case "meta":
|
200
|
+
break;
|
201
|
+
default:
|
202
|
+
throw sthis.logger.Error().Url(url).Msg(`store not found`).AsError();
|
203
|
+
}
|
204
|
+
let name = store;
|
205
|
+
if (url.hasParam("index")) {
|
206
|
+
name = joiner(url.getParam("index") || "idx", name);
|
207
|
+
}
|
208
|
+
return { store, name };
|
209
|
+
}
|
210
|
+
function getKey(url, logger) {
|
211
|
+
const result = url.getParam("key");
|
212
|
+
if (!result) throw logger.Error().Str("url", url.toString()).Msg(`key not found`).AsError();
|
213
|
+
return result;
|
214
|
+
}
|
215
|
+
function getName(sthis, url) {
|
216
|
+
let result = url.getParam("name");
|
217
|
+
if (!result) {
|
218
|
+
result = sthis.pathOps.dirname(url.pathname);
|
219
|
+
if (result.length === 0) {
|
220
|
+
throw sthis.logger.Error().Str("url", url.toString()).Msg(`name not found`).AsError();
|
221
|
+
}
|
222
|
+
}
|
223
|
+
return result;
|
224
|
+
}
|
225
|
+
async function exceptionWrapper(fn) {
|
226
|
+
return fn().catch((e) => Result.Err(e));
|
227
|
+
}
|
228
|
+
var NotFoundError = class extends Error {
|
229
|
+
constructor() {
|
230
|
+
super(...arguments);
|
231
|
+
this.code = "ENOENT";
|
232
|
+
}
|
233
|
+
};
|
234
|
+
function isNotFoundError(e) {
|
235
|
+
if (Result.Is(e)) {
|
236
|
+
if (e.isOk()) return false;
|
237
|
+
e = e.Err();
|
238
|
+
}
|
239
|
+
if (e.code === "ENOENT") return true;
|
240
|
+
return false;
|
241
|
+
}
|
242
|
+
function dataDir(sthis, name, base) {
|
243
|
+
if (!base) {
|
244
|
+
if (!runtimeFn().isBrowser) {
|
245
|
+
const home = sthis.env.get("HOME") || "./";
|
246
|
+
base = sthis.env.get("FP_STORAGE_URL") || `file://${sthis.pathOps.join(home, ".fireproof")}`;
|
247
|
+
} else {
|
248
|
+
base = sthis.env.get("FP_STORAGE_URL") || `indexdb://fp`;
|
249
|
+
}
|
250
|
+
}
|
251
|
+
return URI.from(base.toString()).build().setParam("name", name || "").URI();
|
252
|
+
}
|
253
|
+
function UInt8ArrayEqual(a, b) {
|
254
|
+
if (a.length !== b.length) {
|
255
|
+
return false;
|
256
|
+
}
|
257
|
+
for (let i = 0; i < a.length; i++) {
|
258
|
+
if (a[i] !== b[i]) {
|
259
|
+
return false;
|
260
|
+
}
|
261
|
+
}
|
262
|
+
return true;
|
263
|
+
}
|
264
|
+
|
265
|
+
export {
|
266
|
+
__export,
|
267
|
+
Result,
|
268
|
+
ensureSuperThis,
|
269
|
+
ensureSuperLog,
|
270
|
+
ensureLogger,
|
271
|
+
getStore,
|
272
|
+
getKey,
|
273
|
+
getName,
|
274
|
+
exceptionWrapper,
|
275
|
+
NotFoundError,
|
276
|
+
isNotFoundError,
|
277
|
+
dataDir,
|
278
|
+
UInt8ArrayEqual
|
279
|
+
};
|
280
|
+
//# sourceMappingURL=chunk-MAK4D54P.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/utils.ts"],"sourcesContent":["import {\n Logger,\n LoggerImpl,\n IsLogger,\n Result,\n ResolveOnce,\n isURL,\n URI,\n CoerceURI,\n runtimeFn,\n envFactory,\n Env,\n toCryptoRuntime,\n CryptoRuntime,\n JSONFormatter,\n YAMLFormatter,\n} from \"@adviser/cement\";\nimport { PathOps, StoreType, SuperThis, SuperThisOpts, TextEndeCoder } from \"./types\";\nimport { base58btc } from \"multiformats/bases/base58\";\n\nexport type { Logger };\nexport { Result };\n\nconst globalLogger: Logger = new LoggerImpl();\n\nconst registerFP_DEBUG = new ResolveOnce();\n\ninterface superThisOpts {\n readonly logger: Logger;\n readonly env: Env;\n readonly pathOps: PathOps;\n readonly crypto: CryptoRuntime;\n readonly ctx: Record<string, unknown>;\n readonly txt: TextEndeCoder;\n}\n\nclass superThis implements SuperThis {\n readonly logger: Logger;\n readonly env: Env;\n readonly pathOps: PathOps;\n readonly ctx: Record<string, unknown>;\n readonly txt: TextEndeCoder;\n readonly crypto: CryptoRuntime;\n\n constructor(opts: superThisOpts) {\n this.logger = opts.logger;\n this.env = opts.env;\n this.crypto = opts.crypto;\n this.pathOps = opts.pathOps;\n this.txt = opts.txt;\n this.ctx = { ...opts.ctx };\n // console.log(\"superThis\", this);\n }\n\n nextId(bytes = 6): { str: string; bin: Uint8Array } {\n const bin = this.crypto.randomBytes(bytes);\n return {\n str: base58btc.encode(bin),\n bin,\n };\n }\n\n start(): Promise<void> {\n return Promise.resolve();\n }\n\n clone(override: Partial<SuperThisOpts>): SuperThis {\n return new superThis({\n logger: override.logger || this.logger,\n env: envFactory(override.env) || this.env,\n crypto: override.crypto || this.crypto,\n pathOps: override.pathOps || this.pathOps,\n txt: override.txt || this.txt,\n ctx: { ...this.ctx, ...override.ctx },\n });\n }\n}\n\n// const pathOps =\nfunction presetEnv() {\n const penv = new Map([\n // [\"FP_DEBUG\", \"xxx\"],\n // [\"FP_ENV\", \"development\"],\n ...Array.from(\n Object.entries(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ((globalThis as any)[Symbol.for(\"FP_PRESET_ENV\")] || {}) as Record<string, string>,\n ),\n ), // .map(([k, v]) => [k, v as string])\n ]);\n // console.log(\">>>>>>\", penv)\n return penv;\n}\n// const envImpl = envFactory({\n// symbol: \"FP_ENV\",\n// presetEnv: presetEnv(),\n// });\nclass pathOpsImpl implements PathOps {\n join(...paths: string[]): string {\n return paths.map((i) => i.replace(/\\/+$/, \"\")).join(\"/\");\n }\n dirname(path: string) {\n return path.split(\"/\").slice(0, -1).join(\"/\");\n }\n // homedir() {\n // throw new Error(\"SysContainer:homedir is not available in seeded state\");\n // }\n}\nconst pathOps = new pathOpsImpl();\nconst txtOps = {\n encode: (input: string) => new TextEncoder().encode(input),\n decode: (input: Uint8Array) => new TextDecoder().decode(input),\n};\n\nexport function ensureSuperThis(osthis?: Partial<SuperThisOpts>): SuperThis {\n const env = envFactory({\n symbol: osthis?.env?.symbol || \"FP_ENV\",\n presetEnv: osthis?.env?.presetEnv || presetEnv(),\n });\n return new superThis({\n logger: osthis?.logger || globalLogger,\n env,\n crypto: osthis?.crypto || toCryptoRuntime(),\n ctx: osthis?.ctx || {},\n pathOps,\n txt: osthis?.txt || txtOps,\n });\n}\n\n// // eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function ensureSuperLog(sthis: SuperThis, componentName: string, ctx?: Record<string, unknown>): SuperThis {\n return sthis.clone({\n logger: ensureLogger(sthis, componentName, ctx),\n });\n}\n\nexport function ensureLogger(\n sthis: SuperThis /* Partial<LoggerOpts> | Logger */,\n componentName: string,\n ctx?: Record<string, unknown>,\n): Logger {\n // if (!opts?.logger) {\n // throw new Error(\"logger is required\");\n // }\n let logger = globalLogger;\n if (IsLogger(sthis)) {\n logger = sthis;\n } else if (sthis && IsLogger(sthis.logger)) {\n logger = sthis.logger;\n }\n const cLogger = logger.With().Module(componentName); //.Str(\"this\", uuidv7());\n const debug: string[] = [];\n let exposeStack = false;\n if (ctx) {\n if (\"debug\" in ctx) {\n if (typeof ctx.debug === \"string\" && ctx.debug.length > 0) {\n debug.push(ctx.debug);\n } else {\n debug.push(componentName);\n }\n delete ctx.debug;\n }\n if (\"exposeStack\" in ctx) {\n exposeStack = true;\n delete ctx.exposeStack;\n }\n if (\"this\" in ctx) {\n cLogger.Str(\"this\", sthis.nextId(4).str);\n delete ctx.this;\n }\n for (const [key, value] of Object.entries(ctx)) {\n switch (typeof value) {\n case \"string\":\n cLogger.Str(key, value);\n break;\n case \"number\":\n cLogger.Uint64(key, value);\n break;\n default:\n if (value instanceof Date) {\n cLogger.Str(key, value.toISOString());\n } else if (isURL(value)) {\n cLogger.Str(key, value.toString());\n } else if (typeof value === \"function\") {\n cLogger.Ref(key, value);\n } else {\n cLogger.Any(key, value);\n }\n break;\n }\n }\n }\n registerFP_DEBUG\n .once(async () => {\n // console.log(\"registerFP_DEBUG\", SysContainer.env)\n sthis.env.onSet(\n (key, value) => {\n // console.log(\"FP_DEBUG\", key, value, debug)\n switch (key) {\n case \"FP_FORMAT\": {\n switch (value) {\n case \"jsonice\":\n logger.SetFormatter(new JSONFormatter(logger.TxtEnDe(), 2));\n break;\n case \"yaml\":\n logger.SetFormatter(new YAMLFormatter(logger.TxtEnDe(), 2));\n break;\n case \"json\":\n default:\n logger.SetFormatter(new JSONFormatter(logger.TxtEnDe()));\n break;\n }\n break;\n }\n case \"FP_DEBUG\":\n logger.SetDebug(value || []);\n break;\n case \"FP_STACK\":\n logger.SetExposeStack(!!value);\n break;\n }\n },\n \"FP_FORMAT\",\n \"FP_DEBUG\",\n \"FP_STACK\",\n );\n })\n .finally(() => {\n /* do nothing */\n });\n\n if (debug.length > 0) {\n logger.SetDebug(debug);\n }\n if (exposeStack) {\n logger.SetExposeStack(true);\n }\n const out = cLogger.Logger();\n // out.Debug().Msg(\"logger ready\");\n return out;\n}\n\nexport type Joiner = (...toJoin: string[]) => string;\n\nexport interface Store {\n readonly store: StoreType;\n readonly name: string;\n}\n\nexport function getStore(url: URI, sthis: SuperThis, joiner: Joiner): Store {\n const store = url.getParam(\"store\");\n switch (store) {\n case \"data\":\n case \"wal\":\n case \"meta\":\n break;\n default:\n throw sthis.logger.Error().Url(url).Msg(`store not found`).AsError();\n }\n let name: string = store;\n if (url.hasParam(\"index\")) {\n name = joiner(url.getParam(\"index\") || \"idx\", name);\n }\n return { store, name };\n}\n\nexport function getKey(url: URI, logger: Logger): string {\n const result = url.getParam(\"key\");\n if (!result) throw logger.Error().Str(\"url\", url.toString()).Msg(`key not found`).AsError();\n return result;\n}\n\nexport function getName(sthis: SuperThis, url: URI): string {\n let result = url.getParam(\"name\");\n if (!result) {\n result = sthis.pathOps.dirname(url.pathname);\n if (result.length === 0) {\n throw sthis.logger.Error().Str(\"url\", url.toString()).Msg(`name not found`).AsError();\n }\n }\n return result;\n}\n\n// export function exception2Result<T = void>(fn: () => Promise<T>): Promise<Result<T>> {\n// return fn()\n// .then((value) => Result.Ok(value))\n// .catch((e) => Result.Err(e));\n// }\n\nexport async function exceptionWrapper<T, E extends Error>(fn: () => Promise<Result<T, E>>): Promise<Result<T, E>> {\n return fn().catch((e) => Result.Err(e));\n}\n\n// // the big side effect party --- hate it\n// export function sanitizeURL(url: URL) {\n// url.searchParams.sort();\n// // const searchParams = Object.entries(url.searchParams).sort(([a], [b]) => a.localeCompare(b));\n// // console.log(\"searchParams\", searchParams);\n// // for (const [key] of searchParams) {\n// // url.searchParams.delete(key);\n// // }\n// // for (const [key, value] of searchParams) {\n// // url.searchParams.set(key, value);\n// // }\n// }\n\nexport class NotFoundError extends Error {\n readonly code = \"ENOENT\";\n}\n\nexport function isNotFoundError(e: Error | Result<unknown> | unknown): e is NotFoundError {\n if (Result.Is(e)) {\n if (e.isOk()) return false;\n e = e.Err();\n }\n if ((e as NotFoundError).code === \"ENOENT\") return true;\n return false;\n}\n\nexport function dataDir(sthis: SuperThis, name?: string, base?: CoerceURI): URI {\n if (!base) {\n if (!runtimeFn().isBrowser) {\n const home = sthis.env.get(\"HOME\") || \"./\";\n base = sthis.env.get(\"FP_STORAGE_URL\") || `file://${sthis.pathOps.join(home, \".fireproof\")}`;\n } else {\n base = sthis.env.get(\"FP_STORAGE_URL\") || `indexdb://fp`;\n }\n }\n return URI.from(base.toString())\n .build()\n .setParam(\"name\", name || \"\")\n .URI();\n}\n\nexport function UInt8ArrayEqual(a: Uint8Array, b: Uint8Array): boolean {\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}\n"],"mappings":";;;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":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/runtime/gateways/indexdb/version.ts"],"sourcesContent":["export const INDEXDB_VERSION = \"v0.19-indexdb\";\n"],"mappings":";AAAO,IAAM,kBAAkB;","names":[]}
|
@@ -0,0 +1,75 @@
|
|
1
|
+
import {
|
2
|
+
getStore
|
3
|
+
} from "./chunk-MAK4D54P.js";
|
4
|
+
|
5
|
+
// src/runtime/gateways/file/utils.ts
|
6
|
+
async function getFileSystem(url) {
|
7
|
+
const name = url.getParam("fs");
|
8
|
+
let fs;
|
9
|
+
switch (name) {
|
10
|
+
case "mem":
|
11
|
+
{
|
12
|
+
const { MemFileSystem } = await import("./mem-filesystem-BZQZLUR6.js");
|
13
|
+
fs = new MemFileSystem();
|
14
|
+
}
|
15
|
+
break;
|
16
|
+
// case 'deno': {
|
17
|
+
// const { DenoFileSystem } = await import("./deno-filesystem.js");
|
18
|
+
// fs = new DenoFileSystem();
|
19
|
+
// break;
|
20
|
+
// }
|
21
|
+
case "node": {
|
22
|
+
const { NodeFileSystem } = await import("./node-filesystem-7YZR3POJ.js");
|
23
|
+
fs = new NodeFileSystem();
|
24
|
+
break;
|
25
|
+
}
|
26
|
+
case "sys":
|
27
|
+
default: {
|
28
|
+
return getFileSystem(url.build().setParam("fs", "node").URI());
|
29
|
+
}
|
30
|
+
}
|
31
|
+
return fs.start();
|
32
|
+
}
|
33
|
+
function getPath(url, sthis) {
|
34
|
+
const basePath = url.pathname;
|
35
|
+
const name = url.getParam("name");
|
36
|
+
if (name) {
|
37
|
+
const version = url.getParam("version");
|
38
|
+
if (!version) throw sthis.logger.Error().Url(url).Msg(`version not found`).AsError();
|
39
|
+
return sthis.pathOps.join(basePath, version, name);
|
40
|
+
}
|
41
|
+
return sthis.pathOps.join(basePath);
|
42
|
+
}
|
43
|
+
function getFileName(url, sthis) {
|
44
|
+
const key = url.getParam("key");
|
45
|
+
if (!key) throw sthis.logger.Error().Url(url).Msg(`key not found`).AsError();
|
46
|
+
const res = getStore(url, sthis, (...a) => a.join("-"));
|
47
|
+
switch (res.store) {
|
48
|
+
case "data":
|
49
|
+
return sthis.pathOps.join(res.name, key + ".car");
|
50
|
+
case "wal":
|
51
|
+
case "meta":
|
52
|
+
return sthis.pathOps.join(res.name, key + ".json");
|
53
|
+
default:
|
54
|
+
throw sthis.logger.Error().Url(url).Msg(`unsupported store type`).AsError();
|
55
|
+
}
|
56
|
+
}
|
57
|
+
function toArrayBuffer(buffer) {
|
58
|
+
if (typeof buffer === "string") {
|
59
|
+
buffer = Buffer.from(buffer);
|
60
|
+
}
|
61
|
+
const ab = new ArrayBuffer(buffer.length);
|
62
|
+
const view = new Uint8Array(ab);
|
63
|
+
for (let i = 0; i < buffer.length; ++i) {
|
64
|
+
view[i] = buffer[i];
|
65
|
+
}
|
66
|
+
return view;
|
67
|
+
}
|
68
|
+
|
69
|
+
export {
|
70
|
+
getFileSystem,
|
71
|
+
getPath,
|
72
|
+
getFileName,
|
73
|
+
toArrayBuffer
|
74
|
+
};
|
75
|
+
//# sourceMappingURL=chunk-XINRLWR3.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/runtime/gateways/file/utils.ts"],"sourcesContent":["import { URI } from \"@adviser/cement\";\nimport { getStore } from \"../../../utils.js\";\nimport { SuperThis, SysFileSystem } from \"../../../types.js\";\n\nexport async function getFileSystem(url: URI): Promise<SysFileSystem> {\n const name = url.getParam(\"fs\");\n let fs: SysFileSystem;\n switch (name) {\n case \"mem\":\n {\n const { MemFileSystem } = await import(\"./mem-filesystem.js\");\n fs = new MemFileSystem();\n }\n break;\n // case 'deno': {\n // const { DenoFileSystem } = await import(\"./deno-filesystem.js\");\n // fs = new DenoFileSystem();\n // break;\n // }\n case \"node\": {\n const { NodeFileSystem } = await import(\"./node-filesystem.js\");\n fs = new NodeFileSystem();\n break;\n }\n case \"sys\":\n default: {\n // if (runtimeFn().isDeno) {\n // return getFileSystem(url.build().setParam(\"fs\", \"deno\").URI());\n // } else {\n return getFileSystem(url.build().setParam(\"fs\", \"node\").URI());\n // }\n }\n }\n return fs.start();\n}\n\nexport function getPath(url: URI, sthis: SuperThis): string {\n const basePath = url.pathname;\n // .toString()\n // .replace(new RegExp(`^${url.protocol}//`), \"\")\n // .replace(/\\?.*$/, \"\");\n const name = url.getParam(\"name\");\n if (name) {\n const version = url.getParam(\"version\");\n if (!version) throw sthis.logger.Error().Url(url).Msg(`version not found`).AsError();\n return sthis.pathOps.join(basePath, version, name);\n }\n return sthis.pathOps.join(basePath);\n}\n\nexport function getFileName(url: URI, sthis: SuperThis): string {\n const key = url.getParam(\"key\");\n if (!key) throw sthis.logger.Error().Url(url).Msg(`key not found`).AsError();\n const res = getStore(url, sthis, (...a: string[]) => a.join(\"-\"));\n switch (res.store) {\n case \"data\":\n return sthis.pathOps.join(res.name, key + \".car\");\n case \"wal\":\n case \"meta\":\n return sthis.pathOps.join(res.name, key + \".json\");\n default:\n throw sthis.logger.Error().Url(url).Msg(`unsupported store type`).AsError();\n }\n}\n\nexport function toArrayBuffer(buffer: Buffer | string): Uint8Array {\n if (typeof buffer === \"string\") {\n buffer = Buffer.from(buffer);\n }\n const ab = new ArrayBuffer(buffer.length);\n const view = new Uint8Array(ab);\n for (let i = 0; i < buffer.length; ++i) {\n view[i] = buffer[i];\n }\n return view;\n}\n"],"mappings":";;;;;AAIA,eAAsB,cAAc,KAAkC;AACpE,QAAM,OAAO,IAAI,SAAS,IAAI;AAC9B,MAAI;AACJ,UAAQ,MAAM;AAAA,IACZ,KAAK;AACH;AACE,cAAM,EAAE,cAAc,IAAI,MAAM,OAAO,8BAAqB;AAC5D,aAAK,IAAI,cAAc;AAAA,MACzB;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMF,KAAK,QAAQ;AACX,YAAM,EAAE,eAAe,IAAI,MAAM,OAAO,+BAAsB;AAC9D,WAAK,IAAI,eAAe;AACxB;AAAA,IACF;AAAA,IACA,KAAK;AAAA,IACL,S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AO,QAAQ,EAAE,GAAG;AACtC,SAAK,CAAC,IAAI,OAAO,CAAC;AAAA,EACpB;AACA,SAAO;AACT;","names":[]}
|
package/deno.json
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
{
|
2
|
+
"imports": {
|
3
|
+
"@fireproof/core": "./index.js",
|
4
|
+
"@adviser/cement": "npm:@adviser/cement@^0.2.31",
|
5
|
+
"multiformats": "npm:multiformats@^13.3.0",
|
6
|
+
"@ipld/unixfs": "npm:@ipld/unixfs@^3.0.0",
|
7
|
+
"@ipld/car": "npm:@ipld/car@^5.3.2",
|
8
|
+
"@ipld/dag-json": "npm:@ipld/dag-json@^10.2.2",
|
9
|
+
"@ipld/dag-cbor": "npm:@ipld/dag-cbor@^9.2.1",
|
10
|
+
"@web3-storage/pail": "npm:@web3-storage/pail@^0.6.0",
|
11
|
+
"cborg": "npm:cborg@^4.2.4",
|
12
|
+
"charwise": "npm:charwise@^3.0.1",
|
13
|
+
"prolly-trees": "npm:prolly-trees@^1.0.4",
|
14
|
+
"idb": "npm:idb@^8.0.0",
|
15
|
+
"ipfs-unixfs-exporter": "npm:ipfs-unixfs-exporter@^13.6.1",
|
16
|
+
"memfs": "npm:memfs@^4.12.0",
|
17
|
+
"p-limit": "npm:p-limit@^6.1.0",
|
18
|
+
"react": "npm:react@^18.3.1"
|
19
|
+
}
|
20
|
+
}
|