@xyo-network/diviner-stateful 3.5.2 → 3.6.0-rc.10

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,7 +3,7 @@ import { AbstractDiviner } from '@xyo-network/diviner-abstract';
3
3
  import type { DivinerInstance, DivinerModuleEventData } from '@xyo-network/diviner-model';
4
4
  import { DivinerWrapper } from '@xyo-network/diviner-wrapper';
5
5
  import type { ModuleState, StateDictionary } from '@xyo-network/module-model';
6
- import type { Payload, Schema, WithMeta } from '@xyo-network/payload-model';
6
+ import { type Payload, type Schema } from '@xyo-network/payload-model';
7
7
  import type { StatefulDivinerParams } from './Params.ts';
8
8
  /**
9
9
  * A Diviner that maintains state
@@ -14,7 +14,7 @@ export declare abstract class StatefulDiviner<TParams extends StatefulDivinerPar
14
14
  /**
15
15
  * The last state
16
16
  */
17
- protected _lastState?: WithMeta<ModuleState<TState>>;
17
+ protected _lastState?: ModuleState<TState>;
18
18
  /**
19
19
  * Commit the internal state of the Diviner process. This is similar
20
20
  * to a transaction completion in a database and should only be called
@@ -22,7 +22,7 @@ export declare abstract class StatefulDiviner<TParams extends StatefulDivinerPar
22
22
  * external stores.
23
23
  * @param nextState The state to commit
24
24
  */
25
- protected commitState(nextState: WithMeta<ModuleState<TState>>): Promise<void>;
25
+ protected commitState(nextState: ModuleState<TState>): Promise<void>;
26
26
  /**
27
27
  * Retrieves the archivist for the specified store
28
28
  * @param store The store to retrieve the archivist for
@@ -33,17 +33,59 @@ export declare abstract class StatefulDiviner<TParams extends StatefulDivinerPar
33
33
  addToResolvers?: boolean;
34
34
  additionalSigners?: import("@xyo-network/account-model").AccountInstance[];
35
35
  allowNameResolution?: boolean;
36
- config: import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import("@xyo-network/module-model").ArchivingModuleConfig & import("@xyo-network/module-model").ModuleConfigFields & import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import("@xyo-network/module-model").ArchivingModuleConfig & import("@xyo-network/module-model").ModuleConfigFields & {
37
- parents?: import("@xyo-network/archivist-model").ArchivistParents;
38
- requireAllParents?: boolean;
39
- schema: "network.xyo.archivist.config";
40
- storage?: import("@xyo-network/archivist-model").ArchivistStorage;
41
- storeParentReads?: boolean;
42
- }, "schema"> & {
43
- schema: "network.xyo.archivist.config";
44
- }, "schema"> & {
45
- schema: string;
46
- };
36
+ config: import("@xylabs/object").DeepRestrictToStringKeys<{
37
+ schema: Schema;
38
+ readonly archiving?: {
39
+ readonly archivists?: string[] | undefined;
40
+ readonly queries?: string[] | undefined;
41
+ } | undefined;
42
+ readonly allowedQueries?: string[] | undefined;
43
+ readonly archivist?: import("@xyo-network/module-model").ModuleIdentifier | undefined;
44
+ readonly consoleLogger?: import("@xylabs/logger").LogLevel | undefined;
45
+ readonly labels?: {
46
+ [x: string]: string | undefined;
47
+ } | undefined;
48
+ readonly name?: import("@xyo-network/module-model").ModuleName | undefined;
49
+ readonly paging?: {
50
+ [x: string]: {
51
+ size?: number | undefined;
52
+ };
53
+ } | undefined;
54
+ readonly retry?: {
55
+ backoff?: number | undefined;
56
+ interval?: number | undefined;
57
+ retries?: number | undefined;
58
+ } | undefined;
59
+ readonly security?: {
60
+ readonly allowAnonymous?: boolean | undefined;
61
+ readonly allowed?: {
62
+ [x: string]: (Lowercase<string> | Lowercase<string>[])[];
63
+ } | undefined;
64
+ readonly disallowed?: {
65
+ [x: string]: Lowercase<string>[];
66
+ } | undefined;
67
+ } | undefined;
68
+ readonly sign?: boolean | undefined;
69
+ readonly storeQueries?: boolean | undefined;
70
+ readonly timestamp?: boolean | undefined;
71
+ parents?: {
72
+ commit?: Lowercase<string>[] | undefined;
73
+ read?: Lowercase<string>[] | undefined;
74
+ write?: Lowercase<string>[] | undefined;
75
+ } | undefined;
76
+ requireAllParents?: boolean | undefined;
77
+ storage?: {
78
+ indexes?: {
79
+ key: {
80
+ [x: string]: import("@xyo-network/archivist-model").IndexDirection;
81
+ };
82
+ multiEntry?: boolean | undefined;
83
+ name?: string | undefined;
84
+ unique?: boolean | undefined;
85
+ }[] | undefined;
86
+ } | undefined;
87
+ storeParentReads?: boolean | undefined;
88
+ }>;
47
89
  ephemeralQueryAccountEnabled?: boolean;
48
90
  moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[];
49
91
  }, import("@xyo-network/archivist-model").ArchivistModuleEventData>>>;
@@ -57,20 +99,49 @@ export declare abstract class StatefulDiviner<TParams extends StatefulDivinerPar
57
99
  addToResolvers?: boolean;
58
100
  additionalSigners?: import("@xyo-network/account-model").AccountInstance[];
59
101
  allowNameResolution?: boolean;
60
- config: import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import("@xyo-network/module-model").ArchivingModuleConfig & import("@xyo-network/module-model").ModuleConfigFields & import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import("@xyo-network/module-model").ArchivingModuleConfig & import("@xyo-network/module-model").ModuleConfigFields & {
61
- schema: "network.xyo.diviner.config";
62
- }, "schema"> & {
63
- schema: "network.xyo.diviner.config";
64
- }, "schema"> & {
65
- schema: string;
66
- };
102
+ config: import("@xylabs/object").DeepRestrictToStringKeys<{
103
+ schema: Schema;
104
+ readonly archiving?: {
105
+ readonly archivists?: string[] | undefined;
106
+ readonly queries?: string[] | undefined;
107
+ } | undefined;
108
+ readonly allowedQueries?: string[] | undefined;
109
+ readonly archivist?: import("@xyo-network/module-model").ModuleIdentifier | undefined;
110
+ readonly consoleLogger?: import("@xylabs/logger").LogLevel | undefined;
111
+ readonly labels?: {
112
+ [x: string]: string | undefined;
113
+ } | undefined;
114
+ readonly name?: import("@xyo-network/module-model").ModuleName | undefined;
115
+ readonly paging?: {
116
+ [x: string]: {
117
+ size?: number | undefined;
118
+ };
119
+ } | undefined;
120
+ readonly retry?: {
121
+ backoff?: number | undefined;
122
+ interval?: number | undefined;
123
+ retries?: number | undefined;
124
+ } | undefined;
125
+ readonly security?: {
126
+ readonly allowAnonymous?: boolean | undefined;
127
+ readonly allowed?: {
128
+ [x: string]: (Lowercase<string> | Lowercase<string>[])[];
129
+ } | undefined;
130
+ readonly disallowed?: {
131
+ [x: string]: Lowercase<string>[];
132
+ } | undefined;
133
+ } | undefined;
134
+ readonly sign?: boolean | undefined;
135
+ readonly storeQueries?: boolean | undefined;
136
+ readonly timestamp?: boolean | undefined;
137
+ }>;
67
138
  ephemeralQueryAccountEnabled?: boolean;
68
139
  moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[];
69
- }, DivinerModuleEventData>, {
70
- schema: string;
71
- } & import("@xyo-network/payload-model").PayloadFields, {
72
- schema: string;
73
- } & import("@xyo-network/payload-model").PayloadFields>>;
140
+ }, DivinerModuleEventData>, import("@xylabs/object").DeepRestrictToStringKeys<{
141
+ schema: Schema;
142
+ }>, import("@xylabs/object").DeepRestrictToStringKeys<{
143
+ schema: Schema;
144
+ }>>>;
74
145
  /**
75
146
  * Retrieves the Payload Diviner for the specified store
76
147
  * @param store The store to retrieve the Payload Diviner for
@@ -81,24 +152,53 @@ export declare abstract class StatefulDiviner<TParams extends StatefulDivinerPar
81
152
  addToResolvers?: boolean;
82
153
  additionalSigners?: import("@xyo-network/account-model").AccountInstance[];
83
154
  allowNameResolution?: boolean;
84
- config: import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import("@xyo-network/module-model").ArchivingModuleConfig & import("@xyo-network/module-model").ModuleConfigFields & import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import("@xyo-network/module-model").ArchivingModuleConfig & import("@xyo-network/module-model").ModuleConfigFields & {
85
- schema: "network.xyo.diviner.config";
86
- }, "schema"> & {
87
- schema: "network.xyo.diviner.config";
88
- }, "schema"> & {
89
- schema: string;
90
- };
155
+ config: import("@xylabs/object").DeepRestrictToStringKeys<{
156
+ schema: Schema;
157
+ readonly archiving?: {
158
+ readonly archivists?: string[] | undefined;
159
+ readonly queries?: string[] | undefined;
160
+ } | undefined;
161
+ readonly allowedQueries?: string[] | undefined;
162
+ readonly archivist?: import("@xyo-network/module-model").ModuleIdentifier | undefined;
163
+ readonly consoleLogger?: import("@xylabs/logger").LogLevel | undefined;
164
+ readonly labels?: {
165
+ [x: string]: string | undefined;
166
+ } | undefined;
167
+ readonly name?: import("@xyo-network/module-model").ModuleName | undefined;
168
+ readonly paging?: {
169
+ [x: string]: {
170
+ size?: number | undefined;
171
+ };
172
+ } | undefined;
173
+ readonly retry?: {
174
+ backoff?: number | undefined;
175
+ interval?: number | undefined;
176
+ retries?: number | undefined;
177
+ } | undefined;
178
+ readonly security?: {
179
+ readonly allowAnonymous?: boolean | undefined;
180
+ readonly allowed?: {
181
+ [x: string]: (Lowercase<string> | Lowercase<string>[])[];
182
+ } | undefined;
183
+ readonly disallowed?: {
184
+ [x: string]: Lowercase<string>[];
185
+ } | undefined;
186
+ } | undefined;
187
+ readonly sign?: boolean | undefined;
188
+ readonly storeQueries?: boolean | undefined;
189
+ readonly timestamp?: boolean | undefined;
190
+ }>;
91
191
  ephemeralQueryAccountEnabled?: boolean;
92
192
  moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[];
93
- }, DivinerModuleEventData>, {
94
- schema: string;
95
- } & import("@xyo-network/payload-model").PayloadFields, {
96
- schema: string;
97
- } & import("@xyo-network/payload-model").PayloadFields>>;
193
+ }, DivinerModuleEventData>, import("@xylabs/object").DeepRestrictToStringKeys<{
194
+ schema: Schema;
195
+ }>, import("@xylabs/object").DeepRestrictToStringKeys<{
196
+ schema: Schema;
197
+ }>>>;
98
198
  /**
99
199
  * Retrieves the last state of the Diviner process. Used to recover state after
100
200
  * preemptions, reboots, etc.
101
201
  */
102
- protected retrieveState(): Promise<WithMeta<ModuleState<TState>> | undefined>;
202
+ protected retrieveState(): Promise<ModuleState<TState> | undefined>;
103
203
  }
104
204
  //# source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