@xyo-network/archivist-indexeddb 2.72.8 → 2.73.0

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.
@@ -1,10 +1,11 @@
1
- import { AbstractArchivist } from '@xyo-network/abstract-archivist';
2
- import { ArchivistConfig, ArchivistModuleEventData, ArchivistParams } from '@xyo-network/archivist-model';
1
+ import { AbstractArchivist } from '@xyo-network/archivist-abstract';
2
+ import { ArchivistConfig, ArchivistParams, ArchivistModuleEventData } from '@xyo-network/archivist-model';
3
3
  import { AnyConfigSchema } from '@xyo-network/module';
4
4
  import { Payload } from '@xyo-network/payload-model';
5
- export type IndexedDbArchivistConfigSchema = 'network.xyo.archivist.indexeddb.config';
6
- export declare const IndexedDbArchivistConfigSchema: IndexedDbArchivistConfigSchema;
7
- export type IndexedDbArchivistConfig = ArchivistConfig<{
5
+
6
+ type IndexedDbArchivistConfigSchema = 'network.xyo.archivist.indexeddb.config';
7
+ declare const IndexedDbArchivistConfigSchema: IndexedDbArchivistConfigSchema;
8
+ type IndexedDbArchivistConfig = ArchivistConfig<{
8
9
  /**
9
10
  * The database name
10
11
  */
@@ -15,8 +16,8 @@ export type IndexedDbArchivistConfig = ArchivistConfig<{
15
16
  */
16
17
  storeName?: string;
17
18
  }>;
18
- export type IndexedDbArchivistParams = ArchivistParams<AnyConfigSchema<IndexedDbArchivistConfig>>;
19
- export declare class IndexedDbArchivist<TParams extends IndexedDbArchivistParams = IndexedDbArchivistParams, TEventData extends ArchivistModuleEventData = ArchivistModuleEventData> extends AbstractArchivist<TParams, TEventData> {
19
+ type IndexedDbArchivistParams = ArchivistParams<AnyConfigSchema<IndexedDbArchivistConfig>>;
20
+ declare class IndexedDbArchivist<TParams extends IndexedDbArchivistParams = IndexedDbArchivistParams, TEventData extends ArchivistModuleEventData = ArchivistModuleEventData> extends AbstractArchivist<TParams, TEventData> {
20
21
  static configSchemas: "network.xyo.archivist.indexeddb.config"[];
21
22
  static defaultDbName: string;
22
23
  static defaultStoreName: string;
@@ -49,4 +50,5 @@ export declare class IndexedDbArchivist<TParams extends IndexedDbArchivistParams
49
50
  protected insertHandler(payloads: Payload[]): Promise<Payload[]>;
50
51
  protected startHandler(): Promise<boolean>;
51
52
  }
52
- //# sourceMappingURL=IndexedDbArchivist.d.ts.map
53
+
54
+ export { IndexedDbArchivist, IndexedDbArchivistConfig, IndexedDbArchivistConfigSchema, IndexedDbArchivistParams };
@@ -0,0 +1,54 @@
1
+ import { AbstractArchivist } from '@xyo-network/archivist-abstract';
2
+ import { ArchivistConfig, ArchivistParams, ArchivistModuleEventData } from '@xyo-network/archivist-model';
3
+ import { AnyConfigSchema } from '@xyo-network/module';
4
+ import { Payload } from '@xyo-network/payload-model';
5
+
6
+ type IndexedDbArchivistConfigSchema = 'network.xyo.archivist.indexeddb.config';
7
+ declare const IndexedDbArchivistConfigSchema: IndexedDbArchivistConfigSchema;
8
+ type IndexedDbArchivistConfig = ArchivistConfig<{
9
+ /**
10
+ * The database name
11
+ */
12
+ dbName?: string;
13
+ schema: IndexedDbArchivistConfigSchema;
14
+ /**
15
+ * The name of the object store
16
+ */
17
+ storeName?: string;
18
+ }>;
19
+ type IndexedDbArchivistParams = ArchivistParams<AnyConfigSchema<IndexedDbArchivistConfig>>;
20
+ declare class IndexedDbArchivist<TParams extends IndexedDbArchivistParams = IndexedDbArchivistParams, TEventData extends ArchivistModuleEventData = ArchivistModuleEventData> extends AbstractArchivist<TParams, TEventData> {
21
+ static configSchemas: "network.xyo.archivist.indexeddb.config"[];
22
+ static defaultDbName: string;
23
+ static defaultStoreName: string;
24
+ private _db;
25
+ /**
26
+ * The database name. If not supplied via config, it defaults
27
+ * to the module name (not guaranteed to be unique) and if module
28
+ * name is not supplied, it defaults to `archivist`. This behavior
29
+ * biases towards a single, isolated DB per archivist which seems to
30
+ * make the most sense for 99% of use cases.
31
+ */
32
+ get dbName(): string;
33
+ get queries(): string[];
34
+ /**
35
+ * The name of the object store. If not supplied via config, it defaults
36
+ * to `payloads`. The limitation of the current IndexedDB wrapper we're
37
+ * using is that it only supports a single object store per DB. See here:
38
+ * https://github.com/jakearchibald/idb-keyval/blob/main/custom-stores.md#defining-a-custom-database--store-name
39
+ * If this becomes a problem or we need migrations/transactions, we can
40
+ * move to this more-flexible library, which they recommend (and who
41
+ * recommends them for our simple use case of key-value storage):
42
+ * https://www.npmjs.com/package/idb
43
+ */
44
+ get storeName(): string;
45
+ private get db();
46
+ protected allHandler(): Promise<Payload[]>;
47
+ protected clearHandler(): Promise<void>;
48
+ protected deleteHandler(hashes: string[]): Promise<string[]>;
49
+ protected getHandler(hashes: string[]): Promise<Payload[]>;
50
+ protected insertHandler(payloads: Payload[]): Promise<Payload[]>;
51
+ protected startHandler(): Promise<boolean>;
52
+ }
53
+
54
+ export { IndexedDbArchivist, IndexedDbArchivistConfig, IndexedDbArchivistConfigSchema, IndexedDbArchivistParams };
package/dist/index.js ADDED
@@ -0,0 +1,137 @@
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 __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/index.ts
22
+ var src_exports = {};
23
+ __export(src_exports, {
24
+ IndexedDbArchivist: () => IndexedDbArchivist,
25
+ IndexedDbArchivistConfigSchema: () => IndexedDbArchivistConfigSchema
26
+ });
27
+ module.exports = __toCommonJS(src_exports);
28
+
29
+ // src/IndexedDbArchivist.ts
30
+ var import_assert = require("@xylabs/assert");
31
+ var import_archivist_abstract = require("@xyo-network/archivist-abstract");
32
+ var import_archivist_model = require("@xyo-network/archivist-model");
33
+ var import_core = require("@xyo-network/core");
34
+ var import_module = require("@xyo-network/module");
35
+ var import_idb_keyval = require("idb-keyval");
36
+ function _ts_decorate(decorators, target, key, desc) {
37
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
38
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
39
+ r = Reflect.decorate(decorators, target, key, desc);
40
+ else
41
+ for (var i = decorators.length - 1; i >= 0; i--)
42
+ if (d = decorators[i])
43
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
44
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
45
+ }
46
+ __name(_ts_decorate, "_ts_decorate");
47
+ var IndexedDbArchivistConfigSchema = "network.xyo.archivist.indexeddb.config";
48
+ var IndexedDbArchivist = class IndexedDbArchivist2 extends import_archivist_abstract.AbstractArchivist {
49
+ static {
50
+ __name(this, "IndexedDbArchivist");
51
+ }
52
+ static configSchemas = [
53
+ IndexedDbArchivistConfigSchema
54
+ ];
55
+ static defaultDbName = "archivist";
56
+ static defaultStoreName = "payloads";
57
+ _db;
58
+ /**
59
+ * The database name. If not supplied via config, it defaults
60
+ * to the module name (not guaranteed to be unique) and if module
61
+ * name is not supplied, it defaults to `archivist`. This behavior
62
+ * biases towards a single, isolated DB per archivist which seems to
63
+ * make the most sense for 99% of use cases.
64
+ */
65
+ get dbName() {
66
+ return this.config?.dbName ?? this.config?.name ?? IndexedDbArchivist2.defaultDbName;
67
+ }
68
+ get queries() {
69
+ return [
70
+ import_archivist_model.ArchivistAllQuerySchema,
71
+ import_archivist_model.ArchivistClearQuerySchema,
72
+ import_archivist_model.ArchivistDeleteQuerySchema,
73
+ import_archivist_model.ArchivistInsertQuerySchema,
74
+ ...super.queries
75
+ ];
76
+ }
77
+ /**
78
+ * The name of the object store. If not supplied via config, it defaults
79
+ * to `payloads`. The limitation of the current IndexedDB wrapper we're
80
+ * using is that it only supports a single object store per DB. See here:
81
+ * https://github.com/jakearchibald/idb-keyval/blob/main/custom-stores.md#defining-a-custom-database--store-name
82
+ * If this becomes a problem or we need migrations/transactions, we can
83
+ * move to this more-flexible library, which they recommend (and who
84
+ * recommends them for our simple use case of key-value storage):
85
+ * https://www.npmjs.com/package/idb
86
+ */
87
+ get storeName() {
88
+ return this.config?.storeName ?? IndexedDbArchivist2.defaultStoreName;
89
+ }
90
+ get db() {
91
+ return (0, import_assert.assertEx)(this._db, "DB not initialized");
92
+ }
93
+ async allHandler() {
94
+ const result = await (0, import_idb_keyval.entries)(this.db);
95
+ return result.map(([_hash, payload]) => payload);
96
+ }
97
+ async clearHandler() {
98
+ await (0, import_idb_keyval.clear)(this.db);
99
+ }
100
+ async deleteHandler(hashes) {
101
+ const payloadPairs = await Promise.all((await this.get(hashes)).map(async (payload) => [
102
+ await import_core.PayloadHasher.hashAsync(payload),
103
+ payload
104
+ ]));
105
+ const foundHashesToDelete = payloadPairs.map(([hash, _]) => hash);
106
+ await (0, import_idb_keyval.delMany)(foundHashesToDelete, this.db);
107
+ return foundHashesToDelete;
108
+ }
109
+ async getHandler(hashes) {
110
+ return (await (0, import_idb_keyval.getMany)(hashes, this.db)).filter((result) => result !== void 0);
111
+ }
112
+ async insertHandler(payloads) {
113
+ const entries2 = await Promise.all(payloads.map(async (payload) => {
114
+ const hash = await import_core.PayloadHasher.hashAsync(payload);
115
+ return [
116
+ hash,
117
+ payload
118
+ ];
119
+ }));
120
+ await (0, import_idb_keyval.setMany)(entries2, this.db);
121
+ return payloads;
122
+ }
123
+ async startHandler() {
124
+ await super.startHandler();
125
+ this._db = (0, import_idb_keyval.createStore)(this.dbName, this.storeName);
126
+ return true;
127
+ }
128
+ };
129
+ IndexedDbArchivist = _ts_decorate([
130
+ (0, import_module.creatableModule)()
131
+ ], IndexedDbArchivist);
132
+ // Annotate the CommonJS export names for ESM import in node:
133
+ 0 && (module.exports = {
134
+ IndexedDbArchivist,
135
+ IndexedDbArchivistConfigSchema
136
+ });
137
+ //# sourceMappingURL=index.js.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/core'\nimport { AnyConfigSchema, creatableModule } from '@xyo-network/module'\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,oBAAiD;AAEjD,wBAAiF;;;;;;;;;;;;AAG1E,IAAMA,iCAAiE;AAiB9E,IAAaC,qBAAN,MAAAA,4BAGGC,4CAAAA;SAAAA;;;EACR,OAAgBC,gBAAgB;IAACH;;EACjC,OAAOI,gBAAgB;EACvB,OAAOC,mBAAmB;EAElBC;;;;;;;;EASR,IAAIC,SAAS;AACX,WAAO,KAAKC,QAAQD,UAAU,KAAKC,QAAQC,QAAQR,oBAAmBG;EACxE;EAEA,IAAaM,UAAU;AACrB,WAAO;MAACC;MAAyBC;MAA2BC;MAA4BC;SAA+B,MAAMJ;;EAC/H;;;;;;;;;;;EAWA,IAAIK,YAAY;AACd,WAAO,KAAKP,QAAQO,aAAad,oBAAmBI;EACtD;EAEA,IAAYW,KAAe;AACzB,eAAOC,wBAAS,KAAKX,KAAK,oBAAA;EAC5B;EAEA,MAAyBY,aAAiC;AACxD,UAAMC,SAAS,UAAMC,2BAAyB,KAAKJ,EAAE;AACrD,WAAOG,OAAOE,IAAa,CAAC,CAACC,OAAOC,OAAAA,MAAaA,OAAAA;EACnD;EAEA,MAAyBC,eAA8B;AACrD,cAAMC,yBAAM,KAAKT,EAAE;EACrB;EAEA,MAAyBU,cAAcC,QAAqC;AAC1E,UAAMC,eAAoC,MAAMC,QAAQC,KACrD,MAAM,KAAKC,IAAIJ,MAAAA,GAASN,IAAgC,OAAOE,YAAY;MAAC,MAAMS,0BAAcC,UAAUV,OAAAA;MAAUA;KAAQ,CAAA;AAG/H,UAAMW,sBAAsBN,aAAaP,IAAI,CAAC,CAACc,MAAMC,CAAAA,MAAOD,IAAAA;AAC5D,cAAME,2BAAQH,qBAAqB,KAAKlB,EAAE;AAE1C,WAAOkB;EACT;EAEA,MAAyBI,WAAWX,QAAsC;AACxE,YAAQ,UAAMY,2BAAiBZ,QAAQ,KAAKX,EAAE,GAAGwB,OAAO,CAACrB,WAAWA,WAAWsB,MAAAA;EACjF;EAEA,MAAyBC,cAAcC,UAAyC;AAC9E,UAAMvB,WAAU,MAAMS,QAAQC,IAC5Ba,SAAStB,IAAgC,OAAOE,YAAAA;AAC9C,YAAMY,OAAO,MAAMH,0BAAcC,UAAUV,OAAAA;AAC3C,aAAO;QAACY;QAAMZ;;IAChB,CAAA,CAAA;AAEF,cAAMqB,2BAAQxB,UAAS,KAAKJ,EAAE;AAE9B,WAAO2B;EACT;EAEA,MAAyBE,eAAe;AACtC,UAAM,MAAMA,aAAAA;AAGZ,SAAKvC,UAAMwC,+BAAY,KAAKvC,QAAQ,KAAKQ,SAAS;AAClD,WAAO;EACT;AACF;AArFad,qBAAAA,aAAAA;MADZ8C,+BAAAA;GACY9C,kBAAAA;","names":["IndexedDbArchivistConfigSchema","IndexedDbArchivist","AbstractArchivist","configSchemas","defaultDbName","defaultStoreName","_db","dbName","config","name","queries","ArchivistAllQuerySchema","ArchivistClearQuerySchema","ArchivistDeleteQuerySchema","ArchivistInsertQuerySchema","storeName","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","creatableModule"]}
package/dist/index.mjs ADDED
@@ -0,0 +1,111 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+
4
+ // src/IndexedDbArchivist.ts
5
+ import { assertEx } from "@xylabs/assert";
6
+ import { AbstractArchivist } from "@xyo-network/archivist-abstract";
7
+ import { ArchivistAllQuerySchema, ArchivistClearQuerySchema, ArchivistDeleteQuerySchema, ArchivistInsertQuerySchema } from "@xyo-network/archivist-model";
8
+ import { PayloadHasher } from "@xyo-network/core";
9
+ import { creatableModule } from "@xyo-network/module";
10
+ import { clear, createStore, delMany, entries, getMany, setMany } from "idb-keyval";
11
+ function _ts_decorate(decorators, target, key, desc) {
12
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
13
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
14
+ r = Reflect.decorate(decorators, target, key, desc);
15
+ else
16
+ for (var i = decorators.length - 1; i >= 0; i--)
17
+ if (d = decorators[i])
18
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
19
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
20
+ }
21
+ __name(_ts_decorate, "_ts_decorate");
22
+ var IndexedDbArchivistConfigSchema = "network.xyo.archivist.indexeddb.config";
23
+ var IndexedDbArchivist = class IndexedDbArchivist2 extends AbstractArchivist {
24
+ static {
25
+ __name(this, "IndexedDbArchivist");
26
+ }
27
+ static configSchemas = [
28
+ IndexedDbArchivistConfigSchema
29
+ ];
30
+ static defaultDbName = "archivist";
31
+ static defaultStoreName = "payloads";
32
+ _db;
33
+ /**
34
+ * The database name. If not supplied via config, it defaults
35
+ * to the module name (not guaranteed to be unique) and if module
36
+ * name is not supplied, it defaults to `archivist`. This behavior
37
+ * biases towards a single, isolated DB per archivist which seems to
38
+ * make the most sense for 99% of use cases.
39
+ */
40
+ get dbName() {
41
+ return this.config?.dbName ?? this.config?.name ?? IndexedDbArchivist2.defaultDbName;
42
+ }
43
+ get queries() {
44
+ return [
45
+ ArchivistAllQuerySchema,
46
+ ArchivistClearQuerySchema,
47
+ ArchivistDeleteQuerySchema,
48
+ ArchivistInsertQuerySchema,
49
+ ...super.queries
50
+ ];
51
+ }
52
+ /**
53
+ * The name of the object store. If not supplied via config, it defaults
54
+ * to `payloads`. The limitation of the current IndexedDB wrapper we're
55
+ * using is that it only supports a single object store per DB. See here:
56
+ * https://github.com/jakearchibald/idb-keyval/blob/main/custom-stores.md#defining-a-custom-database--store-name
57
+ * If this becomes a problem or we need migrations/transactions, we can
58
+ * move to this more-flexible library, which they recommend (and who
59
+ * recommends them for our simple use case of key-value storage):
60
+ * https://www.npmjs.com/package/idb
61
+ */
62
+ get storeName() {
63
+ return this.config?.storeName ?? IndexedDbArchivist2.defaultStoreName;
64
+ }
65
+ get db() {
66
+ return assertEx(this._db, "DB not initialized");
67
+ }
68
+ async allHandler() {
69
+ const result = await entries(this.db);
70
+ return result.map(([_hash, payload]) => payload);
71
+ }
72
+ async clearHandler() {
73
+ await clear(this.db);
74
+ }
75
+ async deleteHandler(hashes) {
76
+ const payloadPairs = await Promise.all((await this.get(hashes)).map(async (payload) => [
77
+ await PayloadHasher.hashAsync(payload),
78
+ payload
79
+ ]));
80
+ const foundHashesToDelete = payloadPairs.map(([hash, _]) => hash);
81
+ await delMany(foundHashesToDelete, this.db);
82
+ return foundHashesToDelete;
83
+ }
84
+ async getHandler(hashes) {
85
+ return (await getMany(hashes, this.db)).filter((result) => result !== void 0);
86
+ }
87
+ async insertHandler(payloads) {
88
+ const entries2 = await Promise.all(payloads.map(async (payload) => {
89
+ const hash = await PayloadHasher.hashAsync(payload);
90
+ return [
91
+ hash,
92
+ payload
93
+ ];
94
+ }));
95
+ await setMany(entries2, this.db);
96
+ return payloads;
97
+ }
98
+ async startHandler() {
99
+ await super.startHandler();
100
+ this._db = createStore(this.dbName, this.storeName);
101
+ return true;
102
+ }
103
+ };
104
+ IndexedDbArchivist = _ts_decorate([
105
+ creatableModule()
106
+ ], IndexedDbArchivist);
107
+ export {
108
+ IndexedDbArchivist,
109
+ IndexedDbArchivistConfigSchema
110
+ };
111
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
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/core'\nimport { AnyConfigSchema, creatableModule } from '@xyo-network/module'\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,iCAA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,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,SAAKvC,MAAMwC,YAAY,KAAKvC,QAAQ,KAAKQ,SAAS;AAClD,WAAO;EACT;AACF;AArFad,qBAAAA,aAAAA;EADZ8C,gBAAAA;GACY9C,kBAAAA;","names":["assertEx","AbstractArchivist","ArchivistAllQuerySchema","ArchivistClearQuerySchema","ArchivistDeleteQuerySchema","ArchivistInsertQuerySchema","PayloadHasher","creatableModule","clear","createStore","delMany","entries","getMany","setMany","IndexedDbArchivistConfigSchema","IndexedDbArchivist","AbstractArchivist","configSchemas","defaultDbName","defaultStoreName","_db","dbName","config","name","queries","ArchivistAllQuerySchema","ArchivistClearQuerySchema","ArchivistDeleteQuerySchema","ArchivistInsertQuerySchema","storeName","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","creatableModule"]}
package/package.json CHANGED
@@ -10,46 +10,60 @@
10
10
  "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
11
11
  },
12
12
  "dependencies": {
13
- "@xylabs/assert": "^2.9.3",
14
- "@xyo-network/abstract-archivist": "~2.72.8",
15
- "@xyo-network/archivist-model": "~2.72.8",
16
- "@xyo-network/core": "~2.72.8",
17
- "@xyo-network/module": "~2.72.8",
18
- "@xyo-network/payload-model": "~2.72.8",
19
- "@xyo-network/payload-wrapper": "~2.72.8",
20
- "@xyo-network/promise": "~2.72.8",
13
+ "@xylabs/assert": "^2.10.7",
14
+ "@xyo-network/archivist-abstract": "~2.73.0",
15
+ "@xyo-network/archivist-model": "~2.73.0",
16
+ "@xyo-network/core": "~2.73.0",
17
+ "@xyo-network/module": "~2.73.0",
18
+ "@xyo-network/payload-model": "~2.73.0",
19
+ "@xyo-network/payload-wrapper": "~2.73.0",
20
+ "@xyo-network/promise": "~2.73.0",
21
21
  "idb-keyval": "^6.2.1"
22
22
  },
23
23
  "devDependencies": {
24
- "@xylabs/delay": "^2.9.3",
25
- "@xylabs/ts-scripts-yarn3": "^2.19.3",
26
- "@xylabs/tsconfig": "^2.19.3",
27
- "@xyo-network/id-payload-plugin": "~2.72.8",
24
+ "@xylabs/delay": "^2.10.7",
25
+ "@xylabs/ts-scripts-yarn3": "^2.19.5",
26
+ "@xylabs/tsconfig": "^2.19.5",
27
+ "@xyo-network/id-payload-plugin": "~2.73.0",
28
28
  "fake-indexeddb": "^4.0.2",
29
+ "publint": "^0.2.2",
30
+ "tsup": "^7.2.0",
29
31
  "typescript": "^5.2.2"
30
32
  },
33
+ "scripts": {
34
+ "package-compile": "tsup && publint",
35
+ "package-recompile": "tsup && publint"
36
+ },
31
37
  "description": "Primary SDK for using XYO Protocol 2.0",
32
- "browser": "dist/esm/index.js",
33
38
  "docs": "dist/docs.json",
39
+ "types": "dist/index.d.ts",
34
40
  "exports": {
35
41
  ".": {
36
- "node": {
37
- "import": "./dist/esm/index.js",
38
- "require": "./dist/cjs/index.js"
39
- },
40
- "browser": {
41
- "import": "./dist/esm/index.js",
42
- "require": "./dist/cjs/index.js"
42
+ "require": {
43
+ "types": "./dist/index.d.ts",
44
+ "default": "./dist/index.js"
43
45
  },
44
- "default": "./dist/esm/index.js"
46
+ "import": {
47
+ "types": "./dist/index.d.mts",
48
+ "default": "./dist/index.mjs"
49
+ }
45
50
  },
46
51
  "./dist/docs.json": {
47
52
  "default": "./dist/docs.json"
48
53
  },
54
+ "./cjs": {
55
+ "default": "./dist/index.js"
56
+ },
57
+ "./docs": {
58
+ "default": "./dist/docs.json"
59
+ },
60
+ "./esm": {
61
+ "default": "./dist/index.mjs"
62
+ },
49
63
  "./package.json": "./package.json"
50
64
  },
51
- "main": "dist/cjs/index.js",
52
- "module": "dist/esm/index.js",
65
+ "main": "dist/index.js",
66
+ "module": "dist/index.mjs",
53
67
  "homepage": "https://xyo.network",
54
68
  "license": "LGPL-3.0",
55
69
  "publishConfig": {
@@ -60,6 +74,5 @@
60
74
  "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
61
75
  },
62
76
  "sideEffects": false,
63
- "types": "dist/types/index.d.ts",
64
- "version": "2.72.8"
77
+ "version": "2.73.0"
65
78
  }
@@ -1,5 +1,5 @@
1
1
  import { assertEx } from '@xylabs/assert'
2
- import { AbstractArchivist } from '@xyo-network/abstract-archivist'
2
+ import { AbstractArchivist } from '@xyo-network/archivist-abstract'
3
3
  import {
4
4
  ArchivistAllQuerySchema,
5
5
  ArchivistClearQuerySchema,
package/tsup.config.ts ADDED
@@ -0,0 +1,16 @@
1
+ import { defineConfig } from 'tsup'
2
+
3
+ // eslint-disable-next-line import/no-default-export
4
+ export default defineConfig({
5
+ bundle: true,
6
+ cjsInterop: true,
7
+ clean: true,
8
+ dts: {
9
+ entry: ['src/index.ts'],
10
+ },
11
+ entry: ['src/index.ts'],
12
+ format: ['cjs', 'esm'],
13
+ sourcemap: true,
14
+ splitting: false,
15
+ tsconfig: 'tsconfig.json',
16
+ })
@@ -1,98 +0,0 @@
1
- "use strict";
2
- var IndexedDbArchivist_1;
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.IndexedDbArchivist = exports.IndexedDbArchivistConfigSchema = void 0;
5
- const tslib_1 = require("tslib");
6
- const assert_1 = require("@xylabs/assert");
7
- const abstract_archivist_1 = require("@xyo-network/abstract-archivist");
8
- const archivist_model_1 = require("@xyo-network/archivist-model");
9
- const core_1 = require("@xyo-network/core");
10
- const module_1 = require("@xyo-network/module");
11
- const idb_keyval_1 = require("idb-keyval");
12
- exports.IndexedDbArchivistConfigSchema = 'network.xyo.archivist.indexeddb.config';
13
- let IndexedDbArchivist = exports.IndexedDbArchivist = IndexedDbArchivist_1 = class IndexedDbArchivist extends abstract_archivist_1.AbstractArchivist {
14
- /**
15
- * The database name. If not supplied via config, it defaults
16
- * to the module name (not guaranteed to be unique) and if module
17
- * name is not supplied, it defaults to `archivist`. This behavior
18
- * biases towards a single, isolated DB per archivist which seems to
19
- * make the most sense for 99% of use cases.
20
- */
21
- get dbName() {
22
- var _a, _b, _c, _d;
23
- return (_d = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.dbName) !== null && _b !== void 0 ? _b : (_c = this.config) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : IndexedDbArchivist_1.defaultDbName;
24
- }
25
- get queries() {
26
- return [archivist_model_1.ArchivistAllQuerySchema, archivist_model_1.ArchivistClearQuerySchema, archivist_model_1.ArchivistDeleteQuerySchema, archivist_model_1.ArchivistInsertQuerySchema, ...super.queries];
27
- }
28
- /**
29
- * The name of the object store. If not supplied via config, it defaults
30
- * to `payloads`. The limitation of the current IndexedDB wrapper we're
31
- * using is that it only supports a single object store per DB. See here:
32
- * https://github.com/jakearchibald/idb-keyval/blob/main/custom-stores.md#defining-a-custom-database--store-name
33
- * If this becomes a problem or we need migrations/transactions, we can
34
- * move to this more-flexible library, which they recommend (and who
35
- * recommends them for our simple use case of key-value storage):
36
- * https://www.npmjs.com/package/idb
37
- */
38
- get storeName() {
39
- var _a, _b;
40
- return (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.storeName) !== null && _b !== void 0 ? _b : IndexedDbArchivist_1.defaultStoreName;
41
- }
42
- get db() {
43
- return (0, assert_1.assertEx)(this._db, 'DB not initialized');
44
- }
45
- allHandler() {
46
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
47
- const result = yield (0, idb_keyval_1.entries)(this.db);
48
- return result.map(([_hash, payload]) => payload);
49
- });
50
- }
51
- clearHandler() {
52
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
53
- yield (0, idb_keyval_1.clear)(this.db);
54
- });
55
- }
56
- deleteHandler(hashes) {
57
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
58
- const payloadPairs = yield Promise.all((yield this.get(hashes)).map((payload) => tslib_1.__awaiter(this, void 0, void 0, function* () { return [yield core_1.PayloadHasher.hashAsync(payload), payload]; })));
59
- const foundHashesToDelete = payloadPairs.map(([hash, _]) => hash);
60
- yield (0, idb_keyval_1.delMany)(foundHashesToDelete, this.db);
61
- return foundHashesToDelete;
62
- });
63
- }
64
- getHandler(hashes) {
65
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
66
- return (yield (0, idb_keyval_1.getMany)(hashes, this.db)).filter((result) => result !== undefined);
67
- });
68
- }
69
- insertHandler(payloads) {
70
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
71
- const entries = yield Promise.all(payloads.map((payload) => tslib_1.__awaiter(this, void 0, void 0, function* () {
72
- const hash = yield core_1.PayloadHasher.hashAsync(payload);
73
- return [hash, payload];
74
- })));
75
- yield (0, idb_keyval_1.setMany)(entries, this.db);
76
- return payloads;
77
- });
78
- }
79
- startHandler() {
80
- const _super = Object.create(null, {
81
- startHandler: { get: () => super.startHandler }
82
- });
83
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
84
- yield _super.startHandler.call(this);
85
- // NOTE: We could defer this creation to first access but we
86
- // want to fail fast here in case something is wrong
87
- this._db = (0, idb_keyval_1.createStore)(this.dbName, this.storeName);
88
- return true;
89
- });
90
- }
91
- };
92
- IndexedDbArchivist.configSchemas = [exports.IndexedDbArchivistConfigSchema];
93
- IndexedDbArchivist.defaultDbName = 'archivist';
94
- IndexedDbArchivist.defaultStoreName = 'payloads';
95
- exports.IndexedDbArchivist = IndexedDbArchivist = IndexedDbArchivist_1 = tslib_1.__decorate([
96
- (0, module_1.creatableModule)()
97
- ], IndexedDbArchivist);
98
- //# sourceMappingURL=IndexedDbArchivist.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IndexedDbArchivist.js","sourceRoot":"","sources":["../../src/IndexedDbArchiv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IAAI,CAAA;QACb,CAAC;KAAA;;AAhFe,gCAAa,GAAG,CAAC,sCAA8B,CAAC,AAAnC,CAAmC;AACzD,gCAAa,GAAG,WAAW,AAAd,CAAc;AAC3B,mCAAgB,GAAG,UAAU,AAAb,CAAa;6BANzB,kBAAkB;IAD9B,IAAA,wBAAe,GAAE;GACL,kBAAkB,CAqF9B"}
package/dist/cjs/index.js DELETED
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./IndexedDbArchivist"), exports);
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,+DAAoC"}