@xyo-network/archivist-indexeddb 2.84.2 → 2.84.3
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/dist/node/{index.mjs → index.cjs} +50 -24
- package/dist/node/index.cjs.map +1 -0
- package/dist/node/index.js +23 -49
- package/dist/node/index.js.map +1 -1
- package/package.json +17 -17
- package/dist/node/index.mjs.map +0 -1
|
@@ -1,18 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
2
6
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
7
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
4
21
|
var __publicField = (obj, key, value) => {
|
|
5
22
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
6
23
|
return value;
|
|
7
24
|
};
|
|
8
25
|
|
|
26
|
+
// src/index.ts
|
|
27
|
+
var src_exports = {};
|
|
28
|
+
__export(src_exports, {
|
|
29
|
+
IndexedDbArchivist: () => IndexedDbArchivist,
|
|
30
|
+
IndexedDbArchivistConfigSchema: () => IndexedDbArchivistConfigSchema
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(src_exports);
|
|
33
|
+
|
|
9
34
|
// src/IndexedDbArchivist.ts
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
35
|
+
var import_assert = require("@xylabs/assert");
|
|
36
|
+
var import_archivist_abstract = require("@xyo-network/archivist-abstract");
|
|
37
|
+
var import_archivist_model = require("@xyo-network/archivist-model");
|
|
38
|
+
var import_hash = require("@xyo-network/hash");
|
|
39
|
+
var import_module_model = require("@xyo-network/module-model");
|
|
40
|
+
var import_idb_keyval = require("idb-keyval");
|
|
16
41
|
function _ts_decorate(decorators, target, key, desc) {
|
|
17
42
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18
43
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -25,7 +50,7 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
25
50
|
}
|
|
26
51
|
__name(_ts_decorate, "_ts_decorate");
|
|
27
52
|
var IndexedDbArchivistConfigSchema = "network.xyo.archivist.indexeddb.config";
|
|
28
|
-
var _IndexedDbArchivist = class _IndexedDbArchivist extends AbstractArchivist {
|
|
53
|
+
var _IndexedDbArchivist = class _IndexedDbArchivist extends import_archivist_abstract.AbstractArchivist {
|
|
29
54
|
_db;
|
|
30
55
|
/**
|
|
31
56
|
* The database name. If not supplied via config, it defaults
|
|
@@ -40,10 +65,10 @@ var _IndexedDbArchivist = class _IndexedDbArchivist extends AbstractArchivist {
|
|
|
40
65
|
}
|
|
41
66
|
get queries() {
|
|
42
67
|
return [
|
|
43
|
-
ArchivistAllQuerySchema,
|
|
44
|
-
ArchivistClearQuerySchema,
|
|
45
|
-
ArchivistDeleteQuerySchema,
|
|
46
|
-
ArchivistInsertQuerySchema,
|
|
68
|
+
import_archivist_model.ArchivistAllQuerySchema,
|
|
69
|
+
import_archivist_model.ArchivistClearQuerySchema,
|
|
70
|
+
import_archivist_model.ArchivistDeleteQuerySchema,
|
|
71
|
+
import_archivist_model.ArchivistInsertQuerySchema,
|
|
47
72
|
...super.queries
|
|
48
73
|
];
|
|
49
74
|
}
|
|
@@ -62,41 +87,41 @@ var _IndexedDbArchivist = class _IndexedDbArchivist extends AbstractArchivist {
|
|
|
62
87
|
return ((_a = this.config) == null ? void 0 : _a.storeName) ?? _IndexedDbArchivist.defaultStoreName;
|
|
63
88
|
}
|
|
64
89
|
get db() {
|
|
65
|
-
return assertEx(this._db, "DB not initialized");
|
|
90
|
+
return (0, import_assert.assertEx)(this._db, "DB not initialized");
|
|
66
91
|
}
|
|
67
92
|
async allHandler() {
|
|
68
|
-
const result = await entries(this.db);
|
|
93
|
+
const result = await (0, import_idb_keyval.entries)(this.db);
|
|
69
94
|
return result.map(([_hash, payload]) => payload);
|
|
70
95
|
}
|
|
71
96
|
async clearHandler() {
|
|
72
|
-
await clear(this.db);
|
|
97
|
+
await (0, import_idb_keyval.clear)(this.db);
|
|
73
98
|
}
|
|
74
99
|
async deleteHandler(hashes) {
|
|
75
100
|
const payloadPairs = await Promise.all((await this.get(hashes)).map(async (payload) => [
|
|
76
|
-
await PayloadHasher.hashAsync(payload),
|
|
101
|
+
await import_hash.PayloadHasher.hashAsync(payload),
|
|
77
102
|
payload
|
|
78
103
|
]));
|
|
79
104
|
const foundHashesToDelete = payloadPairs.map(([hash, _]) => hash);
|
|
80
|
-
await delMany(foundHashesToDelete, this.db);
|
|
105
|
+
await (0, import_idb_keyval.delMany)(foundHashesToDelete, this.db);
|
|
81
106
|
return foundHashesToDelete;
|
|
82
107
|
}
|
|
83
108
|
async getHandler(hashes) {
|
|
84
|
-
return (await getMany(hashes, this.db)).filter((result) => result !== void 0);
|
|
109
|
+
return (await (0, import_idb_keyval.getMany)(hashes, this.db)).filter((result) => result !== void 0);
|
|
85
110
|
}
|
|
86
111
|
async insertHandler(payloads) {
|
|
87
112
|
const entries2 = await Promise.all(payloads.map(async (payload) => {
|
|
88
|
-
const hash = await PayloadHasher.hashAsync(payload);
|
|
113
|
+
const hash = await import_hash.PayloadHasher.hashAsync(payload);
|
|
89
114
|
return [
|
|
90
115
|
hash,
|
|
91
116
|
payload
|
|
92
117
|
];
|
|
93
118
|
}));
|
|
94
|
-
await setMany(entries2, this.db);
|
|
119
|
+
await (0, import_idb_keyval.setMany)(entries2, this.db);
|
|
95
120
|
return payloads;
|
|
96
121
|
}
|
|
97
122
|
async startHandler() {
|
|
98
123
|
await super.startHandler();
|
|
99
|
-
this._db = createStore(this.dbName, this.storeName);
|
|
124
|
+
this._db = (0, import_idb_keyval.createStore)(this.dbName, this.storeName);
|
|
100
125
|
return true;
|
|
101
126
|
}
|
|
102
127
|
};
|
|
@@ -108,10 +133,11 @@ __publicField(_IndexedDbArchivist, "defaultDbName", "archivist");
|
|
|
108
133
|
__publicField(_IndexedDbArchivist, "defaultStoreName", "payloads");
|
|
109
134
|
var IndexedDbArchivist = _IndexedDbArchivist;
|
|
110
135
|
IndexedDbArchivist = _ts_decorate([
|
|
111
|
-
creatableModule()
|
|
136
|
+
(0, import_module_model.creatableModule)()
|
|
112
137
|
], IndexedDbArchivist);
|
|
113
|
-
export
|
|
138
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
139
|
+
0 && (module.exports = {
|
|
114
140
|
IndexedDbArchivist,
|
|
115
141
|
IndexedDbArchivistConfigSchema
|
|
116
|
-
};
|
|
117
|
-
//# sourceMappingURL=index.
|
|
142
|
+
});
|
|
143
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/IndexedDbArchivist.ts"],"sourcesContent":["export * from './IndexedDbArchivist'\n","import { assertEx } from '@xylabs/assert'\nimport { AbstractArchivist } from '@xyo-network/archivist-abstract'\nimport {\n ArchivistAllQuerySchema,\n ArchivistClearQuerySchema,\n ArchivistConfig,\n ArchivistDeleteQuerySchema,\n ArchivistInsertQuerySchema,\n ArchivistModuleEventData,\n ArchivistParams,\n} from '@xyo-network/archivist-model'\nimport { PayloadHasher } from '@xyo-network/hash'\nimport { AnyConfigSchema, creatableModule } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\nimport { clear, createStore, delMany, entries, getMany, setMany, UseStore } from 'idb-keyval'\n\nexport type IndexedDbArchivistConfigSchema = 'network.xyo.archivist.indexeddb.config'\nexport const IndexedDbArchivistConfigSchema: IndexedDbArchivistConfigSchema = 'network.xyo.archivist.indexeddb.config'\n\nexport type IndexedDbArchivistConfig = ArchivistConfig<{\n /**\n * The database name\n */\n dbName?: string\n schema: IndexedDbArchivistConfigSchema\n /**\n * The name of the object store\n */\n storeName?: string\n}>\n\nexport type IndexedDbArchivistParams = ArchivistParams<AnyConfigSchema<IndexedDbArchivistConfig>>\n\n@creatableModule()\nexport class IndexedDbArchivist<\n TParams extends IndexedDbArchivistParams = IndexedDbArchivistParams,\n TEventData extends ArchivistModuleEventData = ArchivistModuleEventData,\n> extends AbstractArchivist<TParams, TEventData> {\n static override configSchemas = [IndexedDbArchivistConfigSchema]\n static defaultDbName = 'archivist'\n static defaultStoreName = 'payloads'\n\n private _db: UseStore | undefined\n\n /**\n * The database name. If not supplied via config, it defaults\n * to the module name (not guaranteed to be unique) and if module\n * name is not supplied, it defaults to `archivist`. This behavior\n * biases towards a single, isolated DB per archivist which seems to\n * make the most sense for 99% of use cases.\n */\n get dbName() {\n return this.config?.dbName ?? this.config?.name ?? IndexedDbArchivist.defaultDbName\n }\n\n override get queries() {\n return [ArchivistAllQuerySchema, ArchivistClearQuerySchema, ArchivistDeleteQuerySchema, ArchivistInsertQuerySchema, ...super.queries]\n }\n /**\n * The name of the object store. If not supplied via config, it defaults\n * to `payloads`. The limitation of the current IndexedDB wrapper we're\n * using is that it only supports a single object store per DB. See here:\n * https://github.com/jakearchibald/idb-keyval/blob/main/custom-stores.md#defining-a-custom-database--store-name\n * If this becomes a problem or we need migrations/transactions, we can\n * move to this more-flexible library, which they recommend (and who\n * recommends them for our simple use case of key-value storage):\n * https://www.npmjs.com/package/idb\n */\n get storeName() {\n return this.config?.storeName ?? IndexedDbArchivist.defaultStoreName\n }\n\n private get db(): UseStore {\n return assertEx(this._db, 'DB not initialized')\n }\n\n protected override async allHandler(): Promise<Payload[]> {\n const result = await entries<string, Payload>(this.db)\n return result.map<Payload>(([_hash, payload]) => payload)\n }\n\n protected override async clearHandler(): Promise<void> {\n await clear(this.db)\n }\n\n protected override async deleteHandler(hashes: string[]): Promise<string[]> {\n const payloadPairs: [string, Payload][] = await Promise.all(\n (await this.get(hashes)).map<Promise<[string, Payload]>>(async (payload) => [await PayloadHasher.hashAsync(payload), payload]),\n )\n\n const foundHashesToDelete = payloadPairs.map(([hash, _]) => hash)\n await delMany(foundHashesToDelete, this.db)\n\n return foundHashesToDelete\n }\n\n protected override async getHandler(hashes: string[]): Promise<Payload[]> {\n return (await getMany<Payload>(hashes, this.db)).filter((result) => result !== undefined)\n }\n\n protected override async insertHandler(payloads: Payload[]): Promise<Payload[]> {\n const entries = await Promise.all(\n payloads.map<Promise<[string, Payload]>>(async (payload) => {\n const hash = await PayloadHasher.hashAsync(payload)\n return [hash, payload]\n }),\n )\n await setMany(entries, this.db)\n\n return payloads\n }\n\n protected override async startHandler() {\n await super.startHandler()\n // NOTE: We could defer this creation to first access but we\n // want to fail fast here in case something is wrong\n this._db = createStore(this.dbName, this.storeName)\n return true\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;ACAA,oBAAyB;AACzB,gCAAkC;AAClC,6BAQO;AACP,kBAA8B;AAC9B,0BAAiD;AAEjD,wBAAiF;;;;;;;;;;;;AAG1E,IAAMA,iCAAiE;AAiBvE,IAAMC,sBAAN,MAAMA,4BAGHC,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A;AAEF,cAAMqB,2BAAQxB,UAAS,KAAKJ,EAAE;AAE9B,WAAO2B;EACT;EAEA,MAAyBE,eAAe;AACtC,UAAM,MAAMA,aAAAA;AAGZ,SAAKzC,UAAM0C,+BAAY,KAAKzC,QAAQ,KAAKS,SAAS;AAClD,WAAO;EACT;AACF;AAlFUX;AACR,cAJWD,qBAIK6C,iBAAgB;EAAC9C;;AACjC,cALWC,qBAKJM,iBAAgB;AACvB,cANWN,qBAMJa,oBAAmB;AANrB,IAAMb,qBAAN;AAAMA,qBAAAA,aAAAA;MADZ8C,qCAAAA;GACY9C,kBAAAA;","names":["IndexedDbArchivistConfigSchema","IndexedDbArchivist","AbstractArchivist","_db","dbName","config","name","defaultDbName","queries","ArchivistAllQuerySchema","ArchivistClearQuerySchema","ArchivistDeleteQuerySchema","ArchivistInsertQuerySchema","storeName","defaultStoreName","db","assertEx","allHandler","result","entries","map","_hash","payload","clearHandler","clear","deleteHandler","hashes","payloadPairs","Promise","all","get","PayloadHasher","hashAsync","foundHashesToDelete","hash","_","delMany","getHandler","getMany","filter","undefined","insertHandler","payloads","setMany","startHandler","createStore","configSchemas","creatableModule"]}
|
package/dist/node/index.js
CHANGED
|
@@ -1,43 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
3
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
4
|
var __publicField = (obj, key, value) => {
|
|
22
5
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
23
6
|
return value;
|
|
24
7
|
};
|
|
25
8
|
|
|
26
|
-
// src/index.ts
|
|
27
|
-
var src_exports = {};
|
|
28
|
-
__export(src_exports, {
|
|
29
|
-
IndexedDbArchivist: () => IndexedDbArchivist,
|
|
30
|
-
IndexedDbArchivistConfigSchema: () => IndexedDbArchivistConfigSchema
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(src_exports);
|
|
33
|
-
|
|
34
9
|
// src/IndexedDbArchivist.ts
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
10
|
+
import { assertEx } from "@xylabs/assert";
|
|
11
|
+
import { AbstractArchivist } from "@xyo-network/archivist-abstract";
|
|
12
|
+
import { ArchivistAllQuerySchema, ArchivistClearQuerySchema, ArchivistDeleteQuerySchema, ArchivistInsertQuerySchema } from "@xyo-network/archivist-model";
|
|
13
|
+
import { PayloadHasher } from "@xyo-network/hash";
|
|
14
|
+
import { creatableModule } from "@xyo-network/module-model";
|
|
15
|
+
import { clear, createStore, delMany, entries, getMany, setMany } from "idb-keyval";
|
|
41
16
|
function _ts_decorate(decorators, target, key, desc) {
|
|
42
17
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
43
18
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -50,7 +25,7 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
50
25
|
}
|
|
51
26
|
__name(_ts_decorate, "_ts_decorate");
|
|
52
27
|
var IndexedDbArchivistConfigSchema = "network.xyo.archivist.indexeddb.config";
|
|
53
|
-
var _IndexedDbArchivist = class _IndexedDbArchivist extends
|
|
28
|
+
var _IndexedDbArchivist = class _IndexedDbArchivist extends AbstractArchivist {
|
|
54
29
|
_db;
|
|
55
30
|
/**
|
|
56
31
|
* The database name. If not supplied via config, it defaults
|
|
@@ -65,10 +40,10 @@ var _IndexedDbArchivist = class _IndexedDbArchivist extends import_archivist_abs
|
|
|
65
40
|
}
|
|
66
41
|
get queries() {
|
|
67
42
|
return [
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
43
|
+
ArchivistAllQuerySchema,
|
|
44
|
+
ArchivistClearQuerySchema,
|
|
45
|
+
ArchivistDeleteQuerySchema,
|
|
46
|
+
ArchivistInsertQuerySchema,
|
|
72
47
|
...super.queries
|
|
73
48
|
];
|
|
74
49
|
}
|
|
@@ -87,41 +62,41 @@ var _IndexedDbArchivist = class _IndexedDbArchivist extends import_archivist_abs
|
|
|
87
62
|
return ((_a = this.config) == null ? void 0 : _a.storeName) ?? _IndexedDbArchivist.defaultStoreName;
|
|
88
63
|
}
|
|
89
64
|
get db() {
|
|
90
|
-
return
|
|
65
|
+
return assertEx(this._db, "DB not initialized");
|
|
91
66
|
}
|
|
92
67
|
async allHandler() {
|
|
93
|
-
const result = await
|
|
68
|
+
const result = await entries(this.db);
|
|
94
69
|
return result.map(([_hash, payload]) => payload);
|
|
95
70
|
}
|
|
96
71
|
async clearHandler() {
|
|
97
|
-
await
|
|
72
|
+
await clear(this.db);
|
|
98
73
|
}
|
|
99
74
|
async deleteHandler(hashes) {
|
|
100
75
|
const payloadPairs = await Promise.all((await this.get(hashes)).map(async (payload) => [
|
|
101
|
-
await
|
|
76
|
+
await PayloadHasher.hashAsync(payload),
|
|
102
77
|
payload
|
|
103
78
|
]));
|
|
104
79
|
const foundHashesToDelete = payloadPairs.map(([hash, _]) => hash);
|
|
105
|
-
await
|
|
80
|
+
await delMany(foundHashesToDelete, this.db);
|
|
106
81
|
return foundHashesToDelete;
|
|
107
82
|
}
|
|
108
83
|
async getHandler(hashes) {
|
|
109
|
-
return (await
|
|
84
|
+
return (await getMany(hashes, this.db)).filter((result) => result !== void 0);
|
|
110
85
|
}
|
|
111
86
|
async insertHandler(payloads) {
|
|
112
87
|
const entries2 = await Promise.all(payloads.map(async (payload) => {
|
|
113
|
-
const hash = await
|
|
88
|
+
const hash = await PayloadHasher.hashAsync(payload);
|
|
114
89
|
return [
|
|
115
90
|
hash,
|
|
116
91
|
payload
|
|
117
92
|
];
|
|
118
93
|
}));
|
|
119
|
-
await
|
|
94
|
+
await setMany(entries2, this.db);
|
|
120
95
|
return payloads;
|
|
121
96
|
}
|
|
122
97
|
async startHandler() {
|
|
123
98
|
await super.startHandler();
|
|
124
|
-
this._db =
|
|
99
|
+
this._db = createStore(this.dbName, this.storeName);
|
|
125
100
|
return true;
|
|
126
101
|
}
|
|
127
102
|
};
|
|
@@ -133,11 +108,10 @@ __publicField(_IndexedDbArchivist, "defaultDbName", "archivist");
|
|
|
133
108
|
__publicField(_IndexedDbArchivist, "defaultStoreName", "payloads");
|
|
134
109
|
var IndexedDbArchivist = _IndexedDbArchivist;
|
|
135
110
|
IndexedDbArchivist = _ts_decorate([
|
|
136
|
-
|
|
111
|
+
creatableModule()
|
|
137
112
|
], IndexedDbArchivist);
|
|
138
|
-
|
|
139
|
-
0 && (module.exports = {
|
|
113
|
+
export {
|
|
140
114
|
IndexedDbArchivist,
|
|
141
115
|
IndexedDbArchivistConfigSchema
|
|
142
|
-
}
|
|
116
|
+
};
|
|
143
117
|
//# sourceMappingURL=index.js.map
|
package/dist/node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/
|
|
1
|
+
{"version":3,"sources":["../../src/IndexedDbArchivist.ts"],"sourcesContent":["import { assertEx } from '@xylabs/assert'\nimport { AbstractArchivist } from '@xyo-network/archivist-abstract'\nimport {\n ArchivistAllQuerySchema,\n ArchivistClearQuerySchema,\n ArchivistConfig,\n ArchivistDeleteQuerySchema,\n ArchivistInsertQuerySchema,\n ArchivistModuleEventData,\n ArchivistParams,\n} from '@xyo-network/archivist-model'\nimport { PayloadHasher } from '@xyo-network/hash'\nimport { AnyConfigSchema, creatableModule } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\nimport { clear, createStore, delMany, entries, getMany, setMany, UseStore } from 'idb-keyval'\n\nexport type IndexedDbArchivistConfigSchema = 'network.xyo.archivist.indexeddb.config'\nexport const IndexedDbArchivistConfigSchema: IndexedDbArchivistConfigSchema = 'network.xyo.archivist.indexeddb.config'\n\nexport type IndexedDbArchivistConfig = ArchivistConfig<{\n /**\n * The database name\n */\n dbName?: string\n schema: IndexedDbArchivistConfigSchema\n /**\n * The name of the object store\n */\n storeName?: string\n}>\n\nexport type IndexedDbArchivistParams = ArchivistParams<AnyConfigSchema<IndexedDbArchivistConfig>>\n\n@creatableModule()\nexport class IndexedDbArchivist<\n TParams extends IndexedDbArchivistParams = IndexedDbArchivistParams,\n TEventData extends ArchivistModuleEventData = ArchivistModuleEventData,\n> extends AbstractArchivist<TParams, TEventData> {\n static override configSchemas = [IndexedDbArchivistConfigSchema]\n static defaultDbName = 'archivist'\n static defaultStoreName = 'payloads'\n\n private _db: UseStore | undefined\n\n /**\n * The database name. If not supplied via config, it defaults\n * to the module name (not guaranteed to be unique) and if module\n * name is not supplied, it defaults to `archivist`. This behavior\n * biases towards a single, isolated DB per archivist which seems to\n * make the most sense for 99% of use cases.\n */\n get dbName() {\n return this.config?.dbName ?? this.config?.name ?? IndexedDbArchivist.defaultDbName\n }\n\n override get queries() {\n return [ArchivistAllQuerySchema, ArchivistClearQuerySchema, ArchivistDeleteQuerySchema, ArchivistInsertQuerySchema, ...super.queries]\n }\n /**\n * The name of the object store. If not supplied via config, it defaults\n * to `payloads`. The limitation of the current IndexedDB wrapper we're\n * using is that it only supports a single object store per DB. See here:\n * https://github.com/jakearchibald/idb-keyval/blob/main/custom-stores.md#defining-a-custom-database--store-name\n * If this becomes a problem or we need migrations/transactions, we can\n * move to this more-flexible library, which they recommend (and who\n * recommends them for our simple use case of key-value storage):\n * https://www.npmjs.com/package/idb\n */\n get storeName() {\n return this.config?.storeName ?? IndexedDbArchivist.defaultStoreName\n }\n\n private get db(): UseStore {\n return assertEx(this._db, 'DB not initialized')\n }\n\n protected override async allHandler(): Promise<Payload[]> {\n const result = await entries<string, Payload>(this.db)\n return result.map<Payload>(([_hash, payload]) => payload)\n }\n\n protected override async clearHandler(): Promise<void> {\n await clear(this.db)\n }\n\n protected override async deleteHandler(hashes: string[]): Promise<string[]> {\n const payloadPairs: [string, Payload][] = await Promise.all(\n (await this.get(hashes)).map<Promise<[string, Payload]>>(async (payload) => [await PayloadHasher.hashAsync(payload), payload]),\n )\n\n const foundHashesToDelete = payloadPairs.map(([hash, _]) => hash)\n await delMany(foundHashesToDelete, this.db)\n\n return foundHashesToDelete\n }\n\n protected override async getHandler(hashes: string[]): Promise<Payload[]> {\n return (await getMany<Payload>(hashes, this.db)).filter((result) => result !== undefined)\n }\n\n protected override async insertHandler(payloads: Payload[]): Promise<Payload[]> {\n const entries = await Promise.all(\n payloads.map<Promise<[string, Payload]>>(async (payload) => {\n const hash = await PayloadHasher.hashAsync(payload)\n return [hash, payload]\n }),\n )\n await setMany(entries, this.db)\n\n return payloads\n }\n\n protected override async startHandler() {\n await super.startHandler()\n // NOTE: We could defer this creation to first access but we\n // want to fail fast here in case something is wrong\n this._db = createStore(this.dbName, this.storeName)\n return true\n }\n}\n"],"mappings":";;;;;;;;;AAAA,SAASA,gBAAgB;AACzB,SAASC,yBAAyB;AAClC,SACEC,yBACAC,2BAEAC,4BACAC,kCAGK;AACP,SAASC,qBAAqB;AAC9B,S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C,IAC5Ba,SAAStB,IAAgC,OAAOE,YAAAA;AAC9C,YAAMY,OAAO,MAAMH,cAAcC,UAAUV,OAAAA;AAC3C,aAAO;QAACY;QAAMZ;;IAChB,CAAA,CAAA;AAEF,UAAMqB,QAAQxB,UAAS,KAAKJ,EAAE;AAE9B,WAAO2B;EACT;EAEA,MAAyBE,eAAe;AACtC,UAAM,MAAMA,aAAAA;AAGZ,SAAKzC,MAAM0C,YAAY,KAAKzC,QAAQ,KAAKS,SAAS;AAClD,WAAO;EACT;AACF;AAlFUX;AACR,cAJWD,qBAIK6C,iBAAgB;EAAC9C;;AACjC,cALWC,qBAKJM,iBAAgB;AACvB,cANWN,qBAMJa,oBAAmB;AANrB,IAAMb,qBAAN;AAAMA,qBAAAA,aAAAA;EADZ8C,gBAAAA;GACY9C,kBAAAA;","names":["assertEx","AbstractArchivist","ArchivistAllQuerySchema","ArchivistClearQuerySchema","ArchivistDeleteQuerySchema","ArchivistInsertQuerySchema","PayloadHasher","creatableModule","clear","createStore","delMany","entries","getMany","setMany","IndexedDbArchivistConfigSchema","IndexedDbArchivist","AbstractArchivist","_db","dbName","config","name","defaultDbName","queries","ArchivistAllQuerySchema","ArchivistClearQuerySchema","ArchivistDeleteQuerySchema","ArchivistInsertQuerySchema","storeName","defaultStoreName","db","assertEx","allHandler","result","entries","map","_hash","payload","clearHandler","clear","deleteHandler","hashes","payloadPairs","Promise","all","get","PayloadHasher","hashAsync","foundHashesToDelete","hash","_","delMany","getHandler","getMany","filter","undefined","insertHandler","payloads","setMany","startHandler","createStore","configSchemas","creatableModule"]}
|
package/package.json
CHANGED
|
@@ -11,26 +11,25 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@xylabs/assert": "^2.13.20",
|
|
14
|
-
"@xyo-network/archivist-abstract": "~2.84.
|
|
15
|
-
"@xyo-network/archivist-model": "~2.84.
|
|
16
|
-
"@xyo-network/hash": "~2.84.
|
|
17
|
-
"@xyo-network/module-model": "~2.84.
|
|
18
|
-
"@xyo-network/payload-model": "~2.84.
|
|
14
|
+
"@xyo-network/archivist-abstract": "~2.84.3",
|
|
15
|
+
"@xyo-network/archivist-model": "~2.84.3",
|
|
16
|
+
"@xyo-network/hash": "~2.84.3",
|
|
17
|
+
"@xyo-network/module-model": "~2.84.3",
|
|
18
|
+
"@xyo-network/payload-model": "~2.84.3",
|
|
19
19
|
"idb-keyval": "^6.2.1"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@xylabs/delay": "^2.13.20",
|
|
23
23
|
"@xylabs/promise": "^2.13.20",
|
|
24
|
-
"@xylabs/ts-scripts-yarn3": "^3.2.
|
|
25
|
-
"@xylabs/tsconfig": "^3.2.
|
|
26
|
-
"@xyo-network/account": "~2.84.
|
|
27
|
-
"@xyo-network/id-payload-plugin": "^2.
|
|
28
|
-
"@xyo-network/payload-wrapper": "~2.84.
|
|
24
|
+
"@xylabs/ts-scripts-yarn3": "^3.2.19",
|
|
25
|
+
"@xylabs/tsconfig": "^3.2.19",
|
|
26
|
+
"@xyo-network/account": "~2.84.3",
|
|
27
|
+
"@xyo-network/id-payload-plugin": "^2.84.0",
|
|
28
|
+
"@xyo-network/payload-wrapper": "~2.84.3",
|
|
29
29
|
"fake-indexeddb": "^5.0.1",
|
|
30
30
|
"typescript": "^5.3.3"
|
|
31
31
|
},
|
|
32
32
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
33
|
-
"docs": "dist/docs.json",
|
|
34
33
|
"types": "dist/node/index.d.ts",
|
|
35
34
|
"exports": {
|
|
36
35
|
".": {
|
|
@@ -46,19 +45,19 @@
|
|
|
46
45
|
},
|
|
47
46
|
"node": {
|
|
48
47
|
"require": {
|
|
49
|
-
"types": "./dist/node/index.d.
|
|
50
|
-
"default": "./dist/node/index.
|
|
48
|
+
"types": "./dist/node/index.d.cts",
|
|
49
|
+
"default": "./dist/node/index.cjs"
|
|
51
50
|
},
|
|
52
51
|
"import": {
|
|
53
52
|
"types": "./dist/node/index.d.mts",
|
|
54
|
-
"default": "./dist/node/index.
|
|
53
|
+
"default": "./dist/node/index.js"
|
|
55
54
|
}
|
|
56
55
|
}
|
|
57
56
|
},
|
|
58
57
|
"./package.json": "./package.json"
|
|
59
58
|
},
|
|
60
|
-
"main": "dist/node/index.
|
|
61
|
-
"module": "dist/node/index.
|
|
59
|
+
"main": "dist/node/index.cjs",
|
|
60
|
+
"module": "dist/node/index.js",
|
|
62
61
|
"homepage": "https://xyo.network",
|
|
63
62
|
"license": "LGPL-3.0-only",
|
|
64
63
|
"publishConfig": {
|
|
@@ -69,5 +68,6 @@
|
|
|
69
68
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
|
|
70
69
|
},
|
|
71
70
|
"sideEffects": false,
|
|
72
|
-
"version": "2.84.
|
|
71
|
+
"version": "2.84.3",
|
|
72
|
+
"type": "module"
|
|
73
73
|
}
|
package/dist/node/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/IndexedDbArchivist.ts"],"sourcesContent":["import { assertEx } from '@xylabs/assert'\nimport { AbstractArchivist } from '@xyo-network/archivist-abstract'\nimport {\n ArchivistAllQuerySchema,\n ArchivistClearQuerySchema,\n ArchivistConfig,\n ArchivistDeleteQuerySchema,\n ArchivistInsertQuerySchema,\n ArchivistModuleEventData,\n ArchivistParams,\n} from '@xyo-network/archivist-model'\nimport { PayloadHasher } from '@xyo-network/hash'\nimport { AnyConfigSchema, creatableModule } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\nimport { clear, createStore, delMany, entries, getMany, setMany, UseStore } from 'idb-keyval'\n\nexport type IndexedDbArchivistConfigSchema = 'network.xyo.archivist.indexeddb.config'\nexport const IndexedDbArchivistConfigSchema: IndexedDbArchivistConfigSchema = 'network.xyo.archivist.indexeddb.config'\n\nexport type IndexedDbArchivistConfig = ArchivistConfig<{\n /**\n * The database name\n */\n dbName?: string\n schema: IndexedDbArchivistConfigSchema\n /**\n * The name of the object store\n */\n storeName?: string\n}>\n\nexport type IndexedDbArchivistParams = ArchivistParams<AnyConfigSchema<IndexedDbArchivistConfig>>\n\n@creatableModule()\nexport class IndexedDbArchivist<\n TParams extends IndexedDbArchivistParams = IndexedDbArchivistParams,\n TEventData extends ArchivistModuleEventData = ArchivistModuleEventData,\n> extends AbstractArchivist<TParams, TEventData> {\n static override configSchemas = [IndexedDbArchivistConfigSchema]\n static defaultDbName = 'archivist'\n static defaultStoreName = 'payloads'\n\n private _db: UseStore | undefined\n\n /**\n * The database name. If not supplied via config, it defaults\n * to the module name (not guaranteed to be unique) and if module\n * name is not supplied, it defaults to `archivist`. This behavior\n * biases towards a single, isolated DB per archivist which seems to\n * make the most sense for 99% of use cases.\n */\n get dbName() {\n return this.config?.dbName ?? this.config?.name ?? IndexedDbArchivist.defaultDbName\n }\n\n override get queries() {\n return [ArchivistAllQuerySchema, ArchivistClearQuerySchema, ArchivistDeleteQuerySchema, ArchivistInsertQuerySchema, ...super.queries]\n }\n /**\n * The name of the object store. If not supplied via config, it defaults\n * to `payloads`. The limitation of the current IndexedDB wrapper we're\n * using is that it only supports a single object store per DB. See here:\n * https://github.com/jakearchibald/idb-keyval/blob/main/custom-stores.md#defining-a-custom-database--store-name\n * If this becomes a problem or we need migrations/transactions, we can\n * move to this more-flexible library, which they recommend (and who\n * recommends them for our simple use case of key-value storage):\n * https://www.npmjs.com/package/idb\n */\n get storeName() {\n return this.config?.storeName ?? IndexedDbArchivist.defaultStoreName\n }\n\n private get db(): UseStore {\n return assertEx(this._db, 'DB not initialized')\n }\n\n protected override async allHandler(): Promise<Payload[]> {\n const result = await entries<string, Payload>(this.db)\n return result.map<Payload>(([_hash, payload]) => payload)\n }\n\n protected override async clearHandler(): Promise<void> {\n await clear(this.db)\n }\n\n protected override async deleteHandler(hashes: string[]): Promise<string[]> {\n const payloadPairs: [string, Payload][] = await Promise.all(\n (await this.get(hashes)).map<Promise<[string, Payload]>>(async (payload) => [await PayloadHasher.hashAsync(payload), payload]),\n )\n\n const foundHashesToDelete = payloadPairs.map(([hash, _]) => hash)\n await delMany(foundHashesToDelete, this.db)\n\n return foundHashesToDelete\n }\n\n protected override async getHandler(hashes: string[]): Promise<Payload[]> {\n return (await getMany<Payload>(hashes, this.db)).filter((result) => result !== undefined)\n }\n\n protected override async insertHandler(payloads: Payload[]): Promise<Payload[]> {\n const entries = await Promise.all(\n payloads.map<Promise<[string, Payload]>>(async (payload) => {\n const hash = await PayloadHasher.hashAsync(payload)\n return [hash, payload]\n }),\n )\n await setMany(entries, this.db)\n\n return payloads\n }\n\n protected override async startHandler() {\n await super.startHandler()\n // NOTE: We could defer this creation to first access but we\n // want to fail fast here in case something is wrong\n this._db = createStore(this.dbName, this.storeName)\n return true\n }\n}\n"],"mappings":";;;;;;;;;AAAA,SAASA,gBAAgB;AACzB,SAASC,yBAAyB;AAClC,SACEC,yBACAC,2BAEAC,4BACAC,kCAGK;AACP,SAASC,qBAAqB;AAC9B,SAA0BC,uBAAuB;AAEjD,SAASC,OAAOC,aAAaC,SAASC,SAASC,SAASC,eAAyB;;;;;;;;;;;;AAG1E,IAAMC,iCAAiE;AAiBvE,IAAMC,sBAAN,MAAMA,4BAGHC,kBAAAA;EAKAC;;;;;;;;EASR,IAAIC,SAAS;;AACX,aAAO,UAAKC,WAAL,mBAAaD,aAAU,UAAKC,WAAL,mBAAaC,SAAQL,oBAAmBM;EACxE;EAEA,IAAaC,UAAU;AACrB,WAAO;MAACC;MAAyBC;MAA2BC;MAA4BC;SAA+B,MAAMJ;;EAC/H;;;;;;;;;;;EAWA,IAAIK,YAAY;;AACd,aAAO,UAAKR,WAAL,mBAAaQ,cAAaZ,oBAAmBa;EACtD;EAEA,IAAYC,KAAe;AACzB,WAAOC,SAAS,KAAKb,KAAK,oBAAA;EAC5B;EAEA,MAAyBc,aAAiC;AACxD,UAAMC,SAAS,MAAMC,QAAyB,KAAKJ,EAAE;AACrD,WAAOG,OAAOE,IAAa,CA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","creatableModule","clear","createStore","delMany","entries","getMany","setMany","IndexedDbArchivistConfigSchema","IndexedDbArchivist","AbstractArchivist","_db","dbName","config","name","defaultDbName","queries","ArchivistAllQuerySchema","ArchivistClearQuerySchema","ArchivistDeleteQuerySchema","ArchivistInsertQuerySchema","storeName","defaultStoreName","db","assertEx","allHandler","result","entries","map","_hash","payload","clearHandler","clear","deleteHandler","hashes","payloadPairs","Promise","all","get","PayloadHasher","hashAsync","foundHashesToDelete","hash","_","delMany","getHandler","getMany","filter","undefined","insertHandler","payloads","setMany","startHandler","createStore","configSchemas","creatableModule"]}
|