@xyo-network/archivist-indexeddb 2.73.3 → 2.74.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.
@@ -0,0 +1,52 @@
1
+ import { AbstractArchivist } from '@xyo-network/archivist-abstract';
2
+ import { ArchivistConfig, ArchivistModuleEventData, ArchivistParams } from '@xyo-network/archivist-model';
3
+ import { AnyConfigSchema } from '@xyo-network/module';
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<{
8
+ /**
9
+ * The database name
10
+ */
11
+ dbName?: string;
12
+ schema: IndexedDbArchivistConfigSchema;
13
+ /**
14
+ * The name of the object store
15
+ */
16
+ storeName?: string;
17
+ }>;
18
+ export type IndexedDbArchivistParams = ArchivistParams<AnyConfigSchema<IndexedDbArchivistConfig>>;
19
+ export declare class IndexedDbArchivist<TParams extends IndexedDbArchivistParams = IndexedDbArchivistParams, TEventData extends ArchivistModuleEventData = ArchivistModuleEventData> extends AbstractArchivist<TParams, TEventData> {
20
+ static configSchemas: "network.xyo.archivist.indexeddb.config"[];
21
+ static defaultDbName: string;
22
+ static defaultStoreName: string;
23
+ private _db;
24
+ /**
25
+ * The database name. If not supplied via config, it defaults
26
+ * to the module name (not guaranteed to be unique) and if module
27
+ * name is not supplied, it defaults to `archivist`. This behavior
28
+ * biases towards a single, isolated DB per archivist which seems to
29
+ * make the most sense for 99% of use cases.
30
+ */
31
+ get dbName(): string;
32
+ get queries(): string[];
33
+ /**
34
+ * The name of the object store. If not supplied via config, it defaults
35
+ * to `payloads`. The limitation of the current IndexedDB wrapper we're
36
+ * using is that it only supports a single object store per DB. See here:
37
+ * https://github.com/jakearchibald/idb-keyval/blob/main/custom-stores.md#defining-a-custom-database--store-name
38
+ * If this becomes a problem or we need migrations/transactions, we can
39
+ * move to this more-flexible library, which they recommend (and who
40
+ * recommends them for our simple use case of key-value storage):
41
+ * https://www.npmjs.com/package/idb
42
+ */
43
+ get storeName(): string;
44
+ private get db();
45
+ protected allHandler(): Promise<Payload[]>;
46
+ protected clearHandler(): Promise<void>;
47
+ protected deleteHandler(hashes: string[]): Promise<string[]>;
48
+ protected getHandler(hashes: string[]): Promise<Payload[]>;
49
+ protected insertHandler(payloads: Payload[]): Promise<Payload[]>;
50
+ protected startHandler(): Promise<boolean>;
51
+ }
52
+ //# sourceMappingURL=IndexedDbArchivist.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IndexedDbArchivist.d.ts","sourceRoot":"","sources":["../src/IndexedDbArchivist.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EAGL,eAAe,EAGf,wBAAwB,EACxB,eAAe,EAChB,MAAM,8BAA8B,CAAA;AAErC,OAAO,EAAE,eAAe,EAAmB,MAAM,qBAAqB,CAAA;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAGpD,MAAM,MAAM,8BAA8B,GAAG,wCAAwC,CAAA;AACrF,eAAO,MAAM,8BAA8B,EAAE,8BAAyE,CAAA;AAEtH,MAAM,MAAM,wBAAwB,GAAG,eAAe,CAAC;IACrD;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,8BAA8B,CAAA;IACtC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAC,CAAA;AAEF,MAAM,MAAM,wBAAwB,GAAG,eAAe,CAAC,eAAe,CAAC,wBAAwB,CAAC,CAAC,CAAA;AAEjG,qBACa,kBAAkB,CAC7B,OAAO,SAAS,wBAAwB,GAAG,wBAAwB,EACnE,UAAU,SAAS,wBAAwB,GAAG,wBAAwB,CACtE,SAAQ,iBAAiB,CAAC,OAAO,EAAE,UAAU,CAAC;IAC9C,OAAgB,aAAa,6CAAmC;IAChE,MAAM,CAAC,aAAa,SAAc;IAClC,MAAM,CAAC,gBAAgB,SAAa;IAEpC,OAAO,CAAC,GAAG,CAAsB;IAEjC;;;;;;OAMG;IACH,IAAI,MAAM,WAET;IAED,IAAa,OAAO,aAEnB;IACD;;;;;;;;;OASG;IACH,IAAI,SAAS,WAEZ;IAED,OAAO,KAAK,EAAE,GAEb;cAEwB,UAAU,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;cAKhC,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;cAI7B,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;cAWlD,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;cAIhD,aAAa,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;cAYtD,YAAY;CAOtC"}
@@ -0,0 +1,52 @@
1
+ import { AbstractArchivist } from '@xyo-network/archivist-abstract';
2
+ import { ArchivistConfig, ArchivistModuleEventData, ArchivistParams } from '@xyo-network/archivist-model';
3
+ import { AnyConfigSchema } from '@xyo-network/module';
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<{
8
+ /**
9
+ * The database name
10
+ */
11
+ dbName?: string;
12
+ schema: IndexedDbArchivistConfigSchema;
13
+ /**
14
+ * The name of the object store
15
+ */
16
+ storeName?: string;
17
+ }>;
18
+ export type IndexedDbArchivistParams = ArchivistParams<AnyConfigSchema<IndexedDbArchivistConfig>>;
19
+ export declare class IndexedDbArchivist<TParams extends IndexedDbArchivistParams = IndexedDbArchivistParams, TEventData extends ArchivistModuleEventData = ArchivistModuleEventData> extends AbstractArchivist<TParams, TEventData> {
20
+ static configSchemas: "network.xyo.archivist.indexeddb.config"[];
21
+ static defaultDbName: string;
22
+ static defaultStoreName: string;
23
+ private _db;
24
+ /**
25
+ * The database name. If not supplied via config, it defaults
26
+ * to the module name (not guaranteed to be unique) and if module
27
+ * name is not supplied, it defaults to `archivist`. This behavior
28
+ * biases towards a single, isolated DB per archivist which seems to
29
+ * make the most sense for 99% of use cases.
30
+ */
31
+ get dbName(): string;
32
+ get queries(): string[];
33
+ /**
34
+ * The name of the object store. If not supplied via config, it defaults
35
+ * to `payloads`. The limitation of the current IndexedDB wrapper we're
36
+ * using is that it only supports a single object store per DB. See here:
37
+ * https://github.com/jakearchibald/idb-keyval/blob/main/custom-stores.md#defining-a-custom-database--store-name
38
+ * If this becomes a problem or we need migrations/transactions, we can
39
+ * move to this more-flexible library, which they recommend (and who
40
+ * recommends them for our simple use case of key-value storage):
41
+ * https://www.npmjs.com/package/idb
42
+ */
43
+ get storeName(): string;
44
+ private get db();
45
+ protected allHandler(): Promise<Payload[]>;
46
+ protected clearHandler(): Promise<void>;
47
+ protected deleteHandler(hashes: string[]): Promise<string[]>;
48
+ protected getHandler(hashes: string[]): Promise<Payload[]>;
49
+ protected insertHandler(payloads: Payload[]): Promise<Payload[]>;
50
+ protected startHandler(): Promise<boolean>;
51
+ }
52
+ //# sourceMappingURL=IndexedDbArchivist.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IndexedDbArchivist.d.ts","sourceRoot":"","sources":["../src/IndexedDbArchivist.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EAGL,eAAe,EAGf,wBAAwB,EACxB,eAAe,EAChB,MAAM,8BAA8B,CAAA;AAErC,OAAO,EAAE,eAAe,EAAmB,MAAM,qBAAqB,CAAA;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAGpD,MAAM,MAAM,8BAA8B,GAAG,wCAAwC,CAAA;AACrF,eAAO,MAAM,8BAA8B,EAAE,8BAAyE,CAAA;AAEtH,MAAM,MAAM,wBAAwB,GAAG,eAAe,CAAC;IACrD;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,8BAA8B,CAAA;IACtC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAC,CAAA;AAEF,MAAM,MAAM,wBAAwB,GAAG,eAAe,CAAC,eAAe,CAAC,wBAAwB,CAAC,CAAC,CAAA;AAEjG,qBACa,kBAAkB,CAC7B,OAAO,SAAS,wBAAwB,GAAG,wBAAwB,EACnE,UAAU,SAAS,wBAAwB,GAAG,wBAAwB,CACtE,SAAQ,iBAAiB,CAAC,OAAO,EAAE,UAAU,CAAC;IAC9C,OAAgB,aAAa,6CAAmC;IAChE,MAAM,CAAC,aAAa,SAAc;IAClC,MAAM,CAAC,gBAAgB,SAAa;IAEpC,OAAO,CAAC,GAAG,CAAsB;IAEjC;;;;;;OAMG;IACH,IAAI,MAAM,WAET;IAED,IAAa,OAAO,aAEnB;IACD;;;;;;;;;OASG;IACH,IAAI,SAAS,WAEZ;IAED,OAAO,KAAK,EAAE,GAEb;cAEwB,UAAU,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;cAKhC,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;cAI7B,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;cAWlD,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;cAIhD,aAAa,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;cAYtD,YAAY;CAOtC"}
package/dist/index.d.mts CHANGED
@@ -1,54 +1,2 @@
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 };
1
+ export * from './IndexedDbArchivist';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA"}
package/dist/index.d.ts CHANGED
@@ -1,54 +1,2 @@
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 };
1
+ export * from './IndexedDbArchivist';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA"}
package/package.json CHANGED
@@ -10,30 +10,24 @@
10
10
  "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
11
11
  },
12
12
  "dependencies": {
13
- "@xylabs/assert": "^2.10.11",
14
- "@xyo-network/archivist-abstract": "~2.73.3",
15
- "@xyo-network/archivist-model": "~2.73.3",
16
- "@xyo-network/core": "~2.73.3",
17
- "@xyo-network/module": "~2.73.3",
18
- "@xyo-network/payload-model": "~2.73.3",
19
- "@xyo-network/payload-wrapper": "~2.73.3",
20
- "@xyo-network/promise": "~2.73.3",
13
+ "@xylabs/assert": "^2.11.5",
14
+ "@xyo-network/archivist-abstract": "~2.74.0",
15
+ "@xyo-network/archivist-model": "~2.74.0",
16
+ "@xyo-network/core": "~2.74.0",
17
+ "@xyo-network/module": "~2.74.0",
18
+ "@xyo-network/payload-model": "~2.74.0",
21
19
  "idb-keyval": "^6.2.1"
22
20
  },
23
21
  "devDependencies": {
24
- "@xylabs/delay": "^2.10.11",
25
- "@xylabs/ts-scripts-yarn3": "^2.19.5",
26
- "@xylabs/tsconfig": "^2.19.5",
27
- "@xyo-network/id-payload-plugin": "~2.73.3",
22
+ "@xylabs/delay": "^2.11.5",
23
+ "@xylabs/ts-scripts-yarn3": "^3.0.27",
24
+ "@xylabs/tsconfig": "^3.0.27",
25
+ "@xyo-network/id-payload-plugin": "^2.74.0",
26
+ "@xyo-network/payload-wrapper": "^2.74.0",
27
+ "@xyo-network/promise": "^2.74.0",
28
28
  "fake-indexeddb": "^4.0.2",
29
- "publint": "^0.2.2",
30
- "tsup": "^7.2.0",
31
29
  "typescript": "^5.2.2"
32
30
  },
33
- "scripts": {
34
- "package-compile": "tsup && publint",
35
- "package-recompile": "tsup && publint"
36
- },
37
31
  "description": "Primary SDK for using XYO Protocol 2.0",
38
32
  "docs": "dist/docs.json",
39
33
  "types": "dist/index.d.ts",
@@ -74,5 +68,5 @@
74
68
  "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
75
69
  },
76
70
  "sideEffects": false,
77
- "version": "2.73.3"
71
+ "version": "2.74.0"
78
72
  }