@xyo-network/diviner-boundwitness-indexeddb 3.9.18 → 3.9.20

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.
@@ -0,0 +1,30 @@
1
+ import type { IndexDescription } from '@xyo-network/archivist-model';
2
+ import type { DivinerConfig } from '@xyo-network/diviner-model';
3
+ export declare const IndexedDbBoundWitnessDivinerConfigSchema: "network.xyo.diviner.boundwitness.indexeddb.config";
4
+ export type IndexedDbBoundWitnessDivinerConfigSchema = typeof IndexedDbBoundWitnessDivinerConfigSchema;
5
+ export type IndexedDbBoundWitnessDivinerConfig = DivinerConfig<{
6
+ /**
7
+ * The database name
8
+ */
9
+ dbName?: string;
10
+ /**
11
+ * The version of the DB, defaults to 1
12
+ */
13
+ dbVersion?: number;
14
+ schema: IndexedDbBoundWitnessDivinerConfigSchema;
15
+ /**
16
+ * The storage configuration
17
+ * // TODO: Hoist to main diviner config
18
+ */
19
+ storage?: {
20
+ /**
21
+ * The indexes to create on the object store
22
+ */
23
+ indexes?: IndexDescription[];
24
+ };
25
+ /**
26
+ * The name of the object store
27
+ */
28
+ storeName?: string;
29
+ }>;
30
+ //# sourceMappingURL=Config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAI/D,eAAO,MAAM,wCAAwC,qDAA0D,CAAA;AAC/G,MAAM,MAAM,wCAAwC,GAAG,OAAO,wCAAwC,CAAA;AAEtG,MAAM,MAAM,kCAAkC,GAAG,aAAa,CAAC;IAC7D;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,wCAAwC,CAAA;IAChD;;;OAGG;IACH,OAAO,CAAC,EAAE;QACR;;WAEG;QACH,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAA;KAC7B,CAAA;IACD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAC,CAAA"}
@@ -0,0 +1,40 @@
1
+ import type { BoundWitness } from '@xyo-network/boundwitness-model';
2
+ import { BoundWitnessDiviner } from '@xyo-network/diviner-boundwitness-abstract';
3
+ import type { BoundWitnessDivinerQueryPayload } from '@xyo-network/diviner-boundwitness-model';
4
+ import type { Schema } from '@xyo-network/payload-model';
5
+ import type { IndexedDbBoundWitnessDivinerParams } from './Params.ts';
6
+ export declare class IndexedDbBoundWitnessDiviner<TParams extends IndexedDbBoundWitnessDivinerParams = IndexedDbBoundWitnessDivinerParams, TIn extends BoundWitnessDivinerQueryPayload = BoundWitnessDivinerQueryPayload, TOut extends BoundWitness = BoundWitness> extends BoundWitnessDiviner<TParams, TIn, TOut> {
7
+ static readonly configSchemas: Schema[];
8
+ static readonly defaultConfigSchema: Schema;
9
+ /**
10
+ * The database name. If not supplied via config, it defaults
11
+ * to the archivist's name and if archivist's name is not supplied,
12
+ * it defaults to `archivist`. This behavior
13
+ * biases towards a single, isolated DB per archivist which seems to
14
+ * make the most sense for 99% of use cases.
15
+ */
16
+ get dbName(): string;
17
+ /**
18
+ * The database version. If not supplied via config, it defaults to the archivist default version.
19
+ */
20
+ get dbVersion(): number;
21
+ /**
22
+ * The name of the object store. If not supplied via config, it defaults
23
+ * to `payloads`.
24
+ */
25
+ get storeName(): string;
26
+ protected divineHandler(payloads?: TIn[]): Promise<TOut[]>;
27
+ protected startHandler(): Promise<boolean>;
28
+ /**
29
+ * Checks that the desired DB/objectStore exists and is initialized to the correct version
30
+ * @returns The initialized DB or undefined if it does not exist in the desired state
31
+ */
32
+ private tryGetInitializedDb;
33
+ /**
34
+ * Executes a callback with the initialized DB and then closes the db
35
+ * @param callback The method to execute with the initialized DB
36
+ * @returns
37
+ */
38
+ private tryUseDb;
39
+ }
40
+ //# sourceMappingURL=Diviner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../src/Diviner.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAEnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAA;AAChF,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,yCAAyC,CAAA;AAE9F,OAAO,KAAK,EACV,MAAM,EACP,MAAM,4BAA4B,CAAA;AAKnC,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,aAAa,CAAA;AAmBrE,qBAAa,4BAA4B,CACvC,OAAO,SAAS,kCAAkC,GAAG,kCAAkC,EACvF,GAAG,SAAS,+BAA+B,GAAG,+BAA+B,EAC7E,IAAI,SAAS,YAAY,GAAG,YAAY,CACxC,SAAQ,mBAAmB,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC;IAC/C,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAAqE;IACrH,gBAAyB,mBAAmB,EAAE,MAAM,CAA2C;IAE/F;;;;;;OAMG;IACH,IAAI,MAAM,WAET;IAED;;OAEG;IACH,IAAI,SAAS,WAEZ;IAED;;;OAGG;IACH,IAAI,SAAS,WAEZ;cAEwB,aAAa,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;cAmEhD,YAAY;IAQrC;;;OAGG;YACW,mBAAmB;IAwBjC;;;;OAIG;YACW,QAAQ;CAcvB"}
@@ -0,0 +1,5 @@
1
+ import type { DivinerParams } from '@xyo-network/diviner-model';
2
+ import type { AnyConfigSchema } from '@xyo-network/module-model';
3
+ import type { IndexedDbBoundWitnessDivinerConfig } from './Config.ts';
4
+ export type IndexedDbBoundWitnessDivinerParams = DivinerParams<AnyConfigSchema<IndexedDbBoundWitnessDivinerConfig>>;
5
+ //# sourceMappingURL=Params.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Params.d.ts","sourceRoot":"","sources":["../../src/Params.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAEhE,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,aAAa,CAAA;AAErE,MAAM,MAAM,kCAAkC,GAAG,aAAa,CAAC,eAAe,CAAC,kCAAkC,CAAC,CAAC,CAAA"}
@@ -0,0 +1,3 @@
1
+ export declare const IndexedDbBoundWitnessDivinerSchema: "network.xyo.diviner.boundwitness.indexeddb";
2
+ export type IndexedDbBoundWitnessDivinerSchema = typeof IndexedDbBoundWitnessDivinerSchema;
3
+ //# sourceMappingURL=Schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../src/Schema.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kCAAkC,8CAAoD,CAAA;AACnG,MAAM,MAAM,kCAAkC,GAAG,OAAO,kCAAkC,CAAA"}
@@ -1,38 +1,5 @@
1
- import { IndexDescription } from '@xyo-network/archivist-model';
2
- import { DivinerConfig, DivinerParams } from '@xyo-network/diviner-model';
3
- import { BoundWitness } from '@xyo-network/boundwitness-model';
4
- import { BoundWitnessDiviner } from '@xyo-network/diviner-boundwitness-abstract';
5
- import { BoundWitnessDivinerQueryPayload } from '@xyo-network/diviner-boundwitness-model';
6
- import { Schema } from '@xyo-network/payload-model';
7
- import { AnyConfigSchema } from '@xyo-network/module-model';
8
-
9
- declare const IndexedDbBoundWitnessDivinerConfigSchema: "network.xyo.diviner.boundwitness.indexeddb.config";
10
- type IndexedDbBoundWitnessDivinerConfigSchema = typeof IndexedDbBoundWitnessDivinerConfigSchema;
11
- type IndexedDbBoundWitnessDivinerConfig = DivinerConfig<{
12
- dbName?: string;
13
- dbVersion?: number;
14
- schema: IndexedDbBoundWitnessDivinerConfigSchema;
15
- storage?: {
16
- indexes?: IndexDescription[];
17
- };
18
- storeName?: string;
19
- }>;
20
-
21
- type IndexedDbBoundWitnessDivinerParams = DivinerParams<AnyConfigSchema<IndexedDbBoundWitnessDivinerConfig>>;
22
-
23
- declare class IndexedDbBoundWitnessDiviner<TParams extends IndexedDbBoundWitnessDivinerParams = IndexedDbBoundWitnessDivinerParams, TIn extends BoundWitnessDivinerQueryPayload = BoundWitnessDivinerQueryPayload, TOut extends BoundWitness = BoundWitness> extends BoundWitnessDiviner<TParams, TIn, TOut> {
24
- static readonly configSchemas: Schema[];
25
- static readonly defaultConfigSchema: Schema;
26
- get dbName(): string;
27
- get dbVersion(): number;
28
- get storeName(): string;
29
- protected divineHandler(payloads?: TIn[]): Promise<TOut[]>;
30
- protected startHandler(): Promise<boolean>;
31
- private tryGetInitializedDb;
32
- private tryUseDb;
33
- }
34
-
35
- declare const IndexedDbBoundWitnessDivinerSchema: "network.xyo.diviner.boundwitness.indexeddb";
36
- type IndexedDbBoundWitnessDivinerSchema = typeof IndexedDbBoundWitnessDivinerSchema;
37
-
38
- export { IndexedDbBoundWitnessDiviner, type IndexedDbBoundWitnessDivinerConfig, IndexedDbBoundWitnessDivinerConfigSchema, type IndexedDbBoundWitnessDivinerParams, IndexedDbBoundWitnessDivinerSchema };
1
+ export * from './Config.ts';
2
+ export * from './Diviner.ts';
3
+ export * from './Params.ts';
4
+ export * from './Schema.ts';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/diviner-boundwitness-indexeddb",
3
- "version": "3.9.18",
3
+ "version": "3.9.20",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -32,27 +32,27 @@
32
32
  "@xylabs/array": "^4.5.1",
33
33
  "@xylabs/assert": "^4.5.1",
34
34
  "@xylabs/exists": "^4.5.1",
35
- "@xyo-network/archivist-indexeddb": "^3.9.18",
36
- "@xyo-network/archivist-model": "^3.9.18",
37
- "@xyo-network/boundwitness-model": "^3.9.18",
38
- "@xyo-network/diviner-boundwitness-abstract": "^3.9.18",
39
- "@xyo-network/diviner-boundwitness-model": "^3.9.18",
40
- "@xyo-network/diviner-model": "^3.9.18",
41
- "@xyo-network/module-model": "^3.9.18",
42
- "@xyo-network/payload-model": "^3.9.18",
35
+ "@xyo-network/archivist-indexeddb": "^3.9.20",
36
+ "@xyo-network/archivist-model": "^3.9.20",
37
+ "@xyo-network/boundwitness-model": "^3.9.20",
38
+ "@xyo-network/diviner-boundwitness-abstract": "^3.9.20",
39
+ "@xyo-network/diviner-boundwitness-model": "^3.9.20",
40
+ "@xyo-network/diviner-model": "^3.9.20",
41
+ "@xyo-network/module-model": "^3.9.20",
42
+ "@xyo-network/payload-model": "^3.9.20",
43
43
  "idb": "^8.0.2"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@xylabs/delay": "^4.5.1",
47
- "@xylabs/ts-scripts-yarn3": "^5.0.25",
48
- "@xylabs/tsconfig": "^5.0.25",
47
+ "@xylabs/ts-scripts-yarn3": "^5.0.39",
48
+ "@xylabs/tsconfig": "^5.0.39",
49
49
  "@xylabs/vitest-extended": "^4.5.1",
50
- "@xyo-network/archivist-indexeddb": "^3.9.18",
51
- "@xyo-network/boundwitness-builder": "^3.9.18",
52
- "@xyo-network/node-memory": "^3.9.18",
53
- "@xyo-network/payload-builder": "^3.9.18",
50
+ "@xyo-network/archivist-indexeddb": "^3.9.20",
51
+ "@xyo-network/boundwitness-builder": "^3.9.20",
52
+ "@xyo-network/node-memory": "^3.9.20",
53
+ "@xyo-network/payload-builder": "^3.9.20",
54
54
  "fake-indexeddb": "^6.0.0",
55
- "typescript": "^5.7.3",
55
+ "typescript": "^5.8.2",
56
56
  "vitest": "^3.0.7"
57
57
  },
58
58
  "publishConfig": {