@xyo-network/diviner-payload-indexeddb 4.1.1 → 4.1.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.
@@ -1,76 +1,5 @@
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
- /**
12
- * The database name
13
- */
14
- dbName?: string;
15
- /**
16
- * The version of the DB, defaults to 1
17
- */
18
- dbVersion?: number;
19
- schema: IndexedDbPayloadDivinerConfigSchema;
20
- /**
21
- * The storage configuration
22
- * // TODO: Hoist to main diviner config
23
- */
24
- storage?: {
25
- /**
26
- * The indexes to create on the object store
27
- */
28
- indexes?: IndexDescription[];
29
- };
30
- /**
31
- * The name of the object store
32
- */
33
- storeName?: string;
34
- }>;
35
-
36
- type IndexedDbPayloadDivinerParams = DivinerParams<AnyConfigSchema<IndexedDbPayloadDivinerConfig>>;
37
-
38
- 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> {
39
- static readonly configSchemas: Schema[];
40
- static readonly defaultConfigSchema: Schema;
41
- /**
42
- * The database name. If not supplied via config, it defaults
43
- * to the archivist's name and if archivist's name is not supplied,
44
- * it defaults to `archivist`. This behavior
45
- * biases towards a single, isolated DB per archivist which seems to
46
- * make the most sense for 99% of use cases.
47
- */
48
- get dbName(): string;
49
- /**
50
- * The database version. If not supplied via config, it defaults to the archivist default version.
51
- */
52
- get dbVersion(): number;
53
- /**
54
- * The name of the object store. If not supplied via config, it defaults
55
- * to `payloads`.
56
- */
57
- get storeName(): string;
58
- protected divineHandler(payloads?: TIn[]): Promise<TOut[]>;
59
- /**
60
- * Checks that the desired DB/objectStore exists and is initialized to the correct version
61
- * @returns The initialized DB or undefined if it does not exist in the desired state
62
- */
63
- private tryGetInitializedDb;
64
- /**
65
- * Executes a callback with the initialized DB and then closes the db
66
- * @param callback The method to execute with the initialized DB
67
- * @returns
68
- */
69
- private tryUseDb;
70
- }
71
-
72
- declare const IndexedDbPayloadDivinerSchema: "network.xyo.diviner.payload.indexeddb";
73
- type IndexedDbPayloadDivinerSchema = typeof IndexedDbPayloadDivinerSchema;
74
-
75
- export { IndexedDbPayloadDiviner, IndexedDbPayloadDivinerConfigSchema, IndexedDbPayloadDivinerSchema };
76
- export type { IndexedDbPayloadDivinerConfig, IndexedDbPayloadDivinerParams };
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/diviner-payload-indexeddb",
3
- "version": "4.1.1",
3
+ "version": "4.1.3",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -29,26 +29,26 @@
29
29
  "module": "dist/browser/index.mjs",
30
30
  "types": "dist/browser/index.d.ts",
31
31
  "dependencies": {
32
- "@xylabs/array": "^4.13.15",
33
- "@xylabs/assert": "^4.13.15",
34
- "@xylabs/exists": "^4.13.15",
35
- "@xylabs/object": "^4.13.15",
36
- "@xyo-network/archivist-indexeddb": "^4.1.1",
37
- "@xyo-network/archivist-model": "^4.1.1",
38
- "@xyo-network/diviner-model": "^4.1.1",
39
- "@xyo-network/diviner-payload-abstract": "^4.1.1",
40
- "@xyo-network/diviner-payload-model": "^4.1.1",
41
- "@xyo-network/module-model": "^4.1.1",
42
- "@xyo-network/payload-model": "^4.1.1",
32
+ "@xylabs/array": "^4.13.16",
33
+ "@xylabs/assert": "^4.13.16",
34
+ "@xylabs/exists": "^4.13.16",
35
+ "@xylabs/object": "^4.13.16",
36
+ "@xyo-network/archivist-indexeddb": "^4.1.3",
37
+ "@xyo-network/archivist-model": "^4.1.3",
38
+ "@xyo-network/diviner-model": "^4.1.3",
39
+ "@xyo-network/diviner-payload-abstract": "^4.1.3",
40
+ "@xyo-network/diviner-payload-model": "^4.1.3",
41
+ "@xyo-network/module-model": "^4.1.3",
42
+ "@xyo-network/payload-model": "^4.1.3",
43
43
  "idb": "^8.0.3"
44
44
  },
45
45
  "devDependencies": {
46
- "@xylabs/ts-scripts-yarn3": "^7.0.0-rc.23",
47
- "@xylabs/tsconfig": "^7.0.0-rc.23",
48
- "@xylabs/vitest-extended": "^4.13.15",
49
- "@xyo-network/archivist-indexeddb": "^4.1.1",
50
- "@xyo-network/node-memory": "^4.1.1",
51
- "@xyo-network/payload-builder": "^4.1.1",
46
+ "@xylabs/ts-scripts-yarn3": "^7.0.0-rc.27",
47
+ "@xylabs/tsconfig": "^7.0.0-rc.27",
48
+ "@xylabs/vitest-extended": "^4.13.16",
49
+ "@xyo-network/archivist-indexeddb": "^4.1.3",
50
+ "@xyo-network/node-memory": "^4.1.3",
51
+ "@xyo-network/payload-builder": "^4.1.3",
52
52
  "fake-indexeddb": "^6.0.1",
53
53
  "typescript": "^5.8.3",
54
54
  "vitest": "^3.2.4"