@xyo-network/diviner-payload-generic 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,2 +1,38 @@
1
- export * from './Diviner.ts';
2
- //# sourceMappingURL=index.d.ts.map
1
+ import { Hex } from '@xylabs/hex';
2
+ import { ArchivistInstance, ArchivistModuleEventData } from '@xyo-network/archivist-model';
3
+ import { DivinerModuleEventData, DivinerInstance } from '@xyo-network/diviner-model';
4
+ import { PayloadDiviner } from '@xyo-network/diviner-payload-abstract';
5
+ import { PayloadDivinerConfig, PayloadDivinerParams, PayloadDivinerQueryPayload, Order } from '@xyo-network/diviner-payload-model';
6
+ import { EventListener } from '@xyo-network/module-events';
7
+ import { WithStorageMeta, Payload, Schema } from '@xyo-network/payload-model';
8
+
9
+ declare const GenericPayloadDivinerConfigSchema: "network.xyo.diviner.payload.generic.config";
10
+ type GenericPayloadDivinerConfigSchema = typeof GenericPayloadDivinerConfigSchema;
11
+ type GenericPayloadDivinerConfig = PayloadDivinerConfig<{
12
+ indexes?: string[];
13
+ }, GenericPayloadDivinerConfigSchema>;
14
+ declare class GenericPayloadDiviner<TParams extends PayloadDivinerParams<GenericPayloadDivinerConfig> = PayloadDivinerParams<GenericPayloadDivinerConfig>, TIn extends PayloadDivinerQueryPayload = PayloadDivinerQueryPayload, TOut extends WithStorageMeta<Payload> = WithStorageMeta<Payload>, TEventData extends DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut> = DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut>> extends PayloadDiviner<TParams, TIn, TOut, TEventData> {
15
+ static readonly configSchemas: Schema[];
16
+ static readonly defaultConfigSchema: Schema;
17
+ protected indexMaps: Record<string, WithStorageMeta<TOut>[]>;
18
+ protected payloadsWithMeta: WithStorageMeta<TOut>[];
19
+ private _archivistInstance?;
20
+ private _cursor?;
21
+ private _updatePayloadPairsMutex;
22
+ protected get indexBatchSize(): number;
23
+ protected get indexes(): string[];
24
+ protected get maxIndexSize(): number;
25
+ protected all(order?: Order, cursor?: Hex): WithStorageMeta<TOut>[];
26
+ protected archivistInstance(): Promise<ArchivistInstance | undefined>;
27
+ protected archivistInstance(required: true): Promise<ArchivistInstance>;
28
+ protected clearIndex(): Promise<void>;
29
+ protected divineHandler(payloads?: TIn[]): Promise<TOut[]>;
30
+ protected onArchivistCleared: EventListener<ArchivistModuleEventData['cleared']>;
31
+ protected onArchivistDeleted: EventListener<ArchivistModuleEventData['deleted']>;
32
+ protected onArchivistInserted: EventListener<ArchivistModuleEventData['inserted']>;
33
+ protected stopHandler(_timeout?: number | undefined): Promise<boolean>;
34
+ protected updateIndex(): Promise<void>;
35
+ private indexPayloads;
36
+ }
37
+
38
+ export { GenericPayloadDiviner, type GenericPayloadDivinerConfig, GenericPayloadDivinerConfigSchema };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/diviner-payload-generic",
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,27 +33,27 @@
33
33
  "@xylabs/assert": "^4.5.1",
34
34
  "@xylabs/forget": "^4.5.1",
35
35
  "@xylabs/hex": "^4.5.1",
36
- "@xyo-network/archivist-model": "^3.7.2",
37
- "@xyo-network/diviner-model": "^3.7.2",
38
- "@xyo-network/diviner-payload-abstract": "^3.7.2",
39
- "@xyo-network/diviner-payload-model": "^3.7.2",
40
- "@xyo-network/module-events": "^3.7.2",
41
- "@xyo-network/payload-builder": "^3.7.2",
42
- "@xyo-network/payload-model": "^3.7.2",
36
+ "@xyo-network/archivist-model": "^3.8.1",
37
+ "@xyo-network/diviner-model": "^3.8.1",
38
+ "@xyo-network/diviner-payload-abstract": "^3.8.1",
39
+ "@xyo-network/diviner-payload-model": "^3.8.1",
40
+ "@xyo-network/module-events": "^3.8.1",
41
+ "@xyo-network/payload-builder": "^3.8.1",
42
+ "@xyo-network/payload-model": "^3.8.1",
43
43
  "async-mutex": "^0.5.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@xylabs/delay": "^4.5.1",
47
- "@xylabs/ts-scripts-yarn3": "^4.2.6",
48
- "@xylabs/tsconfig": "^4.2.6",
47
+ "@xylabs/ts-scripts-yarn3": "^5.0.22",
48
+ "@xylabs/tsconfig": "^5.0.22",
49
49
  "@xylabs/vitest-extended": "^4.5.1",
50
- "@xyo-network/archivist-indexeddb": "^3.7.2",
51
- "@xyo-network/archivist-memory": "^3.7.2",
52
- "@xyo-network/node-memory": "^3.7.2",
53
- "@xyo-network/payload-builder": "^3.7.2",
50
+ "@xyo-network/archivist-indexeddb": "^3.8.1",
51
+ "@xyo-network/archivist-memory": "^3.8.1",
52
+ "@xyo-network/node-memory": "^3.8.1",
53
+ "@xyo-network/payload-builder": "^3.8.1",
54
54
  "fake-indexeddb": "^6.0.0",
55
55
  "typescript": "^5.7.3",
56
- "vitest": "^3.0.4"
56
+ "vitest": "^3.0.5"
57
57
  },
58
58
  "publishConfig": {
59
59
  "access": "public"
@@ -1,36 +0,0 @@
1
- import { type Hex } from '@xylabs/hex';
2
- import type { ArchivistInstance, ArchivistModuleEventData } from '@xyo-network/archivist-model';
3
- import type { DivinerInstance, DivinerModuleEventData } from '@xyo-network/diviner-model';
4
- import { PayloadDiviner } from '@xyo-network/diviner-payload-abstract';
5
- import { type Order, type PayloadDivinerConfig, type PayloadDivinerParams, type PayloadDivinerQueryPayload } from '@xyo-network/diviner-payload-model';
6
- import type { EventListener } from '@xyo-network/module-events';
7
- import { type Payload, type Schema, type WithStorageMeta } from '@xyo-network/payload-model';
8
- export declare const GenericPayloadDivinerConfigSchema: "network.xyo.diviner.payload.generic.config";
9
- export type GenericPayloadDivinerConfigSchema = typeof GenericPayloadDivinerConfigSchema;
10
- export type GenericPayloadDivinerConfig = PayloadDivinerConfig<{
11
- indexes?: string[];
12
- }, GenericPayloadDivinerConfigSchema>;
13
- export declare class GenericPayloadDiviner<TParams extends PayloadDivinerParams<GenericPayloadDivinerConfig> = PayloadDivinerParams<GenericPayloadDivinerConfig>, TIn extends PayloadDivinerQueryPayload = PayloadDivinerQueryPayload, TOut extends WithStorageMeta<Payload> = WithStorageMeta<Payload>, TEventData extends DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut> = DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut>> extends PayloadDiviner<TParams, TIn, TOut, TEventData> {
14
- static readonly configSchemas: Schema[];
15
- static readonly defaultConfigSchema: Schema;
16
- protected indexMaps: Record<string, WithStorageMeta<TOut>[]>;
17
- protected payloadsWithMeta: WithStorageMeta<TOut>[];
18
- private _archivistInstance?;
19
- private _cursor?;
20
- private _updatePayloadPairsMutex;
21
- protected get indexBatchSize(): number;
22
- protected get indexes(): string[];
23
- protected get maxIndexSize(): number;
24
- protected all(order?: Order, cursor?: Hex): WithStorageMeta<TOut>[];
25
- protected archivistInstance(): Promise<ArchivistInstance | undefined>;
26
- protected archivistInstance(required: true): Promise<ArchivistInstance>;
27
- protected clearIndex(): Promise<void>;
28
- protected divineHandler(payloads?: TIn[]): Promise<TOut[]>;
29
- protected onArchivistCleared: EventListener<ArchivistModuleEventData['cleared']>;
30
- protected onArchivistDeleted: EventListener<ArchivistModuleEventData['deleted']>;
31
- protected onArchivistInserted: EventListener<ArchivistModuleEventData['inserted']>;
32
- protected stopHandler(_timeout?: number | undefined): Promise<boolean>;
33
- protected updateIndex(): Promise<void>;
34
- private indexPayloads;
35
- }
36
- //# sourceMappingURL=Diviner.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../src/Diviner.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,KAAK,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,C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