@xyo-network/diviner-boundwitness-indexeddb 3.3.0 → 3.3.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.
@@ -3,12 +3,28 @@ import type { DivinerConfig } from '@xyo-network/diviner-model';
3
3
  export declare const IndexedDbBoundWitnessDivinerConfigSchema: "network.xyo.diviner.boundwitness.indexeddb.config";
4
4
  export type IndexedDbBoundWitnessDivinerConfigSchema = typeof IndexedDbBoundWitnessDivinerConfigSchema;
5
5
  export type IndexedDbBoundWitnessDivinerConfig = DivinerConfig<{
6
+ /**
7
+ * The database name
8
+ */
6
9
  dbName?: string;
10
+ /**
11
+ * The version of the DB, defaults to 1
12
+ */
7
13
  dbVersion?: number;
8
14
  schema: IndexedDbBoundWitnessDivinerConfigSchema;
15
+ /**
16
+ * The storage configuration
17
+ * // TODO: Hoist to main diviner config
18
+ */
9
19
  storage?: {
20
+ /**
21
+ * The indexes to create on the object store
22
+ */
10
23
  indexes?: IndexDescription[];
11
24
  };
25
+ /**
26
+ * The name of the object store
27
+ */
12
28
  storeName?: string;
13
29
  }>;
14
30
  //# sourceMappingURL=Config.d.ts.map
@@ -1 +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;IAI7D,MAAM,CAAC,EAAE,MAAM,CAAA;IAIf,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,wCAAwC,CAAA;IAKhD,OAAO,CAAC,EAAE;QAIR,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAA;KAC7B,CAAA;IAID,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAC,CAAA"}
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"}
@@ -6,12 +6,35 @@ import type { IndexedDbBoundWitnessDivinerParams } from './Params.ts';
6
6
  export declare class IndexedDbBoundWitnessDiviner<TParams extends IndexedDbBoundWitnessDivinerParams = IndexedDbBoundWitnessDivinerParams, TIn extends BoundWitnessDivinerQueryPayload = BoundWitnessDivinerQueryPayload, TOut extends BoundWitness = BoundWitness> extends BoundWitnessDiviner<TParams, TIn, TOut> {
7
7
  static readonly configSchemas: Schema[];
8
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
+ */
9
16
  get dbName(): string;
17
+ /**
18
+ * The database version. If not supplied via config, it defaults to 1.
19
+ */
10
20
  get dbVersion(): number;
21
+ /**
22
+ * The name of the object store. If not supplied via config, it defaults
23
+ * to `payloads`.
24
+ */
11
25
  get storeName(): string;
12
26
  protected divineHandler(payloads?: TIn[]): Promise<TOut[]>;
13
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
+ */
14
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
+ */
15
38
  private tryUseDb;
16
39
  }
17
40
  //# sourceMappingURL=Diviner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../src/Diviner.ts"],"names":[],"mappings":"AAGA,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;AAG9F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAKxD,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;IAS/F,IAAI,MAAM,WAET;IAKD,IAAI,SAAS,WAEZ;IAMD,IAAI,SAAS,WAEZ;cAEwB,aAAa,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;cAgEhD,YAAY;YAYvB,mBAAmB;YA6BnB,QAAQ;CAcvB"}
1
+ {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../src/Diviner.ts"],"names":[],"mappings":"AAGA,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;AAG9F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAKxD,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;cAgEhD,YAAY;IAQrC;;;OAGG;YACW,mBAAmB;IAwBjC;;;;OAIG;YACW,QAAQ;CAcvB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/diviner-boundwitness-indexeddb",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
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.2.2",
33
- "@xylabs/exists": "^4.2.2",
34
- "@xyo-network/archivist-indexeddb": "^3.3.0",
35
- "@xyo-network/archivist-model": "^3.3.0",
36
- "@xyo-network/boundwitness-model": "^3.3.0",
37
- "@xyo-network/diviner-boundwitness-abstract": "^3.3.0",
38
- "@xyo-network/diviner-boundwitness-model": "^3.3.0",
39
- "@xyo-network/diviner-model": "^3.3.0",
40
- "@xyo-network/module-model": "^3.3.0",
41
- "@xyo-network/payload-builder": "^3.3.0",
42
- "@xyo-network/payload-model": "^3.3.0",
32
+ "@xylabs/array": "^4.3.2",
33
+ "@xylabs/exists": "^4.3.2",
34
+ "@xyo-network/archivist-indexeddb": "^3.3.1",
35
+ "@xyo-network/archivist-model": "^3.3.1",
36
+ "@xyo-network/boundwitness-model": "^3.3.1",
37
+ "@xyo-network/diviner-boundwitness-abstract": "^3.3.1",
38
+ "@xyo-network/diviner-boundwitness-model": "^3.3.1",
39
+ "@xyo-network/diviner-model": "^3.3.1",
40
+ "@xyo-network/module-model": "^3.3.1",
41
+ "@xyo-network/payload-builder": "^3.3.1",
42
+ "@xyo-network/payload-model": "^3.3.1",
43
43
  "idb": "^8.0.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@xylabs/ts-scripts-yarn3": "^4.2.1",
47
- "@xylabs/tsconfig": "^4.2.1",
48
- "@xyo-network/archivist-indexeddb": "^3.3.0",
49
- "@xyo-network/boundwitness-builder": "^3.3.0",
50
- "@xyo-network/node-memory": "^3.3.0",
51
- "@xyo-network/payload-builder": "^3.3.0",
46
+ "@xylabs/ts-scripts-yarn3": "^4.2.3",
47
+ "@xylabs/tsconfig": "^4.2.3",
48
+ "@xyo-network/archivist-indexeddb": "^3.3.1",
49
+ "@xyo-network/boundwitness-builder": "^3.3.1",
50
+ "@xyo-network/node-memory": "^3.3.1",
51
+ "@xyo-network/payload-builder": "^3.3.1",
52
52
  "fake-indexeddb": "^6.0.0",
53
53
  "typescript": "^5.6.3"
54
54
  },