@xyo-network/diviner-payload-indexeddb 3.7.2 → 3.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,37 @@
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
1
+ import { IndexDescription } from '@xyo-network/archivist-model';
2
+ import { DivinerConfig, DivinerParams, DivinerModuleEventData, DivinerInstance } from '@xyo-network/diviner-model';
3
+ import { PayloadDiviner } from '@xyo-network/diviner-payload-abstract';
4
+ import { PayloadDivinerQueryPayload } from '@xyo-network/diviner-payload-model';
5
+ import { Payload, Schema } from '@xyo-network/payload-model';
6
+ import { AnyConfigSchema } from '@xyo-network/module-model';
7
+
8
+ declare const IndexedDbPayloadDivinerConfigSchema: "network.xyo.diviner.payload.indexeddb.config";
9
+ type IndexedDbPayloadDivinerConfigSchema = typeof IndexedDbPayloadDivinerConfigSchema;
10
+ type IndexedDbPayloadDivinerConfig = DivinerConfig<{
11
+ dbName?: string;
12
+ dbVersion?: number;
13
+ schema: IndexedDbPayloadDivinerConfigSchema;
14
+ storage?: {
15
+ indexes?: IndexDescription[];
16
+ };
17
+ storeName?: string;
18
+ }>;
19
+
20
+ type IndexedDbPayloadDivinerParams = DivinerParams<AnyConfigSchema<IndexedDbPayloadDivinerConfig>>;
21
+
22
+ declare class IndexedDbPayloadDiviner<TParams extends IndexedDbPayloadDivinerParams = IndexedDbPayloadDivinerParams, TIn extends PayloadDivinerQueryPayload = PayloadDivinerQueryPayload, TOut extends Payload = Payload, TEventData extends DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut> = DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut>> extends PayloadDiviner<TParams, TIn, TOut, TEventData> {
23
+ static readonly configSchemas: Schema[];
24
+ static readonly defaultConfigSchema: Schema;
25
+ get dbName(): string;
26
+ get dbVersion(): number;
27
+ get storeName(): string;
28
+ protected divineHandler(payloads?: TIn[]): Promise<TOut[]>;
29
+ protected startHandler(): Promise<boolean>;
30
+ private tryGetInitializedDb;
31
+ private tryUseDb;
32
+ }
33
+
34
+ declare const IndexedDbPayloadDivinerSchema: "network.xyo.diviner.payload.indexeddb";
35
+ type IndexedDbPayloadDivinerSchema = typeof IndexedDbPayloadDivinerSchema;
36
+
37
+ export { IndexedDbPayloadDiviner, type IndexedDbPayloadDivinerConfig, IndexedDbPayloadDivinerConfigSchema, type IndexedDbPayloadDivinerParams, IndexedDbPayloadDivinerSchema };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/diviner-payload-indexeddb",
3
- "version": "3.7.2",
3
+ "version": "3.8.1",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -33,25 +33,25 @@
33
33
  "@xylabs/assert": "^4.5.1",
34
34
  "@xylabs/exists": "^4.5.1",
35
35
  "@xylabs/object": "^4.5.1",
36
- "@xyo-network/archivist-indexeddb": "^3.7.2",
37
- "@xyo-network/archivist-model": "^3.7.2",
38
- "@xyo-network/diviner-model": "^3.7.2",
39
- "@xyo-network/diviner-payload-abstract": "^3.7.2",
40
- "@xyo-network/diviner-payload-model": "^3.7.2",
41
- "@xyo-network/module-model": "^3.7.2",
42
- "@xyo-network/payload-model": "^3.7.2",
43
- "idb": "^8.0.1"
36
+ "@xyo-network/archivist-indexeddb": "^3.8.1",
37
+ "@xyo-network/archivist-model": "^3.8.1",
38
+ "@xyo-network/diviner-model": "^3.8.1",
39
+ "@xyo-network/diviner-payload-abstract": "^3.8.1",
40
+ "@xyo-network/diviner-payload-model": "^3.8.1",
41
+ "@xyo-network/module-model": "^3.8.1",
42
+ "@xyo-network/payload-model": "^3.8.1",
43
+ "idb": "^8.0.2"
44
44
  },
45
45
  "devDependencies": {
46
- "@xylabs/ts-scripts-yarn3": "^4.2.6",
47
- "@xylabs/tsconfig": "^4.2.6",
46
+ "@xylabs/ts-scripts-yarn3": "^5.0.22",
47
+ "@xylabs/tsconfig": "^5.0.22",
48
48
  "@xylabs/vitest-extended": "^4.5.1",
49
- "@xyo-network/archivist-indexeddb": "^3.7.2",
50
- "@xyo-network/node-memory": "^3.7.2",
51
- "@xyo-network/payload-builder": "^3.7.2",
49
+ "@xyo-network/archivist-indexeddb": "^3.8.1",
50
+ "@xyo-network/node-memory": "^3.8.1",
51
+ "@xyo-network/payload-builder": "^3.8.1",
52
52
  "fake-indexeddb": "^6.0.0",
53
53
  "typescript": "^5.7.3",
54
- "vitest": "^3.0.4"
54
+ "vitest": "^3.0.5"
55
55
  },
56
56
  "publishConfig": {
57
57
  "access": "public"
@@ -1,30 +0,0 @@
1
- import type { IndexDescription } from '@xyo-network/archivist-model';
2
- import type { DivinerConfig } from '@xyo-network/diviner-model';
3
- export declare const IndexedDbPayloadDivinerConfigSchema: "network.xyo.diviner.payload.indexeddb.config";
4
- export type IndexedDbPayloadDivinerConfigSchema = typeof IndexedDbPayloadDivinerConfigSchema;
5
- export type IndexedDbPayloadDivinerConfig = 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: IndexedDbPayloadDivinerConfigSchema;
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
@@ -1 +0,0 @@
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,mCAAmC,gDAAqD,CAAA;AACrG,MAAM,MAAM,mCAAmC,GAAG,OAAO,mCAAmC,CAAA;AAE5F,MAAM,MAAM,6BAA6B,GAAG,aAAa,CAAC;IACxD;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,mCAAmC,CAAA;IAC3C;;;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"}
@@ -1,40 +0,0 @@
1
- import type { DivinerInstance, DivinerModuleEventData } from '@xyo-network/diviner-model';
2
- import { PayloadDiviner } from '@xyo-network/diviner-payload-abstract';
3
- import type { PayloadDivinerQueryPayload } from '@xyo-network/diviner-payload-model';
4
- import type { Payload, Schema } from '@xyo-network/payload-model';
5
- import type { IndexedDbPayloadDivinerParams } from './Params.ts';
6
- export declare class IndexedDbPayloadDiviner<TParams extends IndexedDbPayloadDivinerParams = IndexedDbPayloadDivinerParams, TIn extends PayloadDivinerQueryPayload = PayloadDivinerQueryPayload, TOut extends Payload = Payload, TEventData extends DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut> = DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut>> extends PayloadDiviner<TParams, TIn, TOut, TEventData> {
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../src/Diviner.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAA;AACzF,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAA;AACtE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAA;AAEpF,OAAO,KAAK,EACV,OAAO,EAAE,MAAM,EAChB,MAAM,4BAA4B,CAAA;AAKnC,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAA;AAoBhE,qBAAa,uBAAuB,CAClC,OAAO,SAAS,6BAA6B,GAAG,6BAA6B,EAC7E,GAAG,SAAS,0BAA0B,GAAG,0BAA0B,EACnE,IAAI,SAAS,OAAO,GAAG,OAAO,EAC9B,UAAU,SAAS,sBAAsB,CAAC,eAAe,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,sBAAsB,CAChH,eAAe,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,EACnC,GAAG,EACH,IAAI,CACL,CACD,SAAQ,cAAc,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,CAAC;IACtD,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAAgE;IAChH,gBAAyB,mBAAmB,EAAE,MAAM,CAAsC;IAE1F;;;;;;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;cAkEhD,YAAY;IAKrC;;;OAGG;YACW,mBAAmB;IAwBjC;;;;OAIG;YACW,QAAQ;CAcvB"}
@@ -1,5 +0,0 @@
1
- import type { DivinerParams } from '@xyo-network/diviner-model';
2
- import type { AnyConfigSchema } from '@xyo-network/module-model';
3
- import type { IndexedDbPayloadDivinerConfig } from './Config.ts';
4
- export type IndexedDbPayloadDivinerParams = DivinerParams<AnyConfigSchema<IndexedDbPayloadDivinerConfig>>;
5
- //# sourceMappingURL=Params.d.ts.map
@@ -1 +0,0 @@
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,6BAA6B,EAAE,MAAM,aAAa,CAAA;AAEhE,MAAM,MAAM,6BAA6B,GAAG,aAAa,CAAC,eAAe,CAAC,6BAA6B,CAAC,CAAC,CAAA"}
@@ -1,3 +0,0 @@
1
- export declare const IndexedDbPayloadDivinerSchema: "network.xyo.diviner.payload.indexeddb";
2
- export type IndexedDbPayloadDivinerSchema = typeof IndexedDbPayloadDivinerSchema;
3
- //# sourceMappingURL=Schema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../src/Schema.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,6BAA6B,yCAA+C,CAAA;AACzF,MAAM,MAAM,6BAA6B,GAAG,OAAO,6BAA6B,CAAA"}
@@ -1 +0,0 @@
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"}