@xyo-network/archivist-model 3.9.17 → 3.9.19

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.
Files changed (73) hide show
  1. package/dist/neutral/ArchivistFunctions.d.ts +18 -0
  2. package/dist/neutral/ArchivistFunctions.d.ts.map +1 -0
  3. package/dist/neutral/Config.d.ts +27 -0
  4. package/dist/neutral/Config.d.ts.map +1 -0
  5. package/dist/neutral/EventData.d.ts +5 -0
  6. package/dist/neutral/EventData.d.ts.map +1 -0
  7. package/dist/neutral/EventModels/Cleared.d.ts +7 -0
  8. package/dist/neutral/EventModels/Cleared.d.ts.map +1 -0
  9. package/dist/neutral/EventModels/Deleted.d.ts +10 -0
  10. package/dist/neutral/EventModels/Deleted.d.ts.map +1 -0
  11. package/dist/neutral/EventModels/Inserted.d.ts +10 -0
  12. package/dist/neutral/EventModels/Inserted.d.ts.map +1 -0
  13. package/dist/neutral/EventModels/index.d.ts +4 -0
  14. package/dist/neutral/EventModels/index.d.ts.map +1 -0
  15. package/dist/neutral/IndexDescription.d.ts +34 -0
  16. package/dist/neutral/IndexDescription.d.ts.map +1 -0
  17. package/dist/neutral/Instance.d.ts +10 -0
  18. package/dist/neutral/Instance.d.ts.map +1 -0
  19. package/dist/neutral/Labels.d.ts +5 -0
  20. package/dist/neutral/Labels.d.ts.map +1 -0
  21. package/dist/neutral/Module.d.ts +7 -0
  22. package/dist/neutral/Module.d.ts.map +1 -0
  23. package/dist/neutral/ModuleInstance.d.ts +6 -0
  24. package/dist/neutral/ModuleInstance.d.ts.map +1 -0
  25. package/dist/neutral/NextOptions.d.ts +10 -0
  26. package/dist/neutral/NextOptions.d.ts.map +1 -0
  27. package/dist/neutral/Params.d.ts +14 -0
  28. package/dist/neutral/Params.d.ts.map +1 -0
  29. package/dist/neutral/PayloadArchivist.d.ts +18 -0
  30. package/dist/neutral/PayloadArchivist.d.ts.map +1 -0
  31. package/dist/neutral/Queries/All.d.ts +7 -0
  32. package/dist/neutral/Queries/All.d.ts.map +1 -0
  33. package/dist/neutral/Queries/Clear.d.ts +7 -0
  34. package/dist/neutral/Queries/Clear.d.ts.map +1 -0
  35. package/dist/neutral/Queries/Commit.d.ts +7 -0
  36. package/dist/neutral/Queries/Commit.d.ts.map +1 -0
  37. package/dist/neutral/Queries/Delete.d.ts +9 -0
  38. package/dist/neutral/Queries/Delete.d.ts.map +1 -0
  39. package/dist/neutral/Queries/Get.d.ts +9 -0
  40. package/dist/neutral/Queries/Get.d.ts.map +1 -0
  41. package/dist/neutral/Queries/Insert.d.ts +7 -0
  42. package/dist/neutral/Queries/Insert.d.ts.map +1 -0
  43. package/dist/neutral/Queries/Next.d.ts +6 -0
  44. package/dist/neutral/Queries/Next.d.ts.map +1 -0
  45. package/dist/neutral/Queries/index.d.ts +18 -0
  46. package/dist/neutral/Queries/index.d.ts.map +1 -0
  47. package/dist/neutral/RawQueryFunctions.d.ts +16 -0
  48. package/dist/neutral/RawQueryFunctions.d.ts.map +1 -0
  49. package/dist/neutral/attachable/AttachableInstance.d.ts +14 -0
  50. package/dist/neutral/attachable/AttachableInstance.d.ts.map +1 -0
  51. package/dist/neutral/attachable/asAttachableInstance.d.ts +35 -0
  52. package/dist/neutral/attachable/asAttachableInstance.d.ts.map +1 -0
  53. package/dist/neutral/attachable/index.d.ts +4 -0
  54. package/dist/neutral/attachable/index.d.ts.map +1 -0
  55. package/dist/neutral/attachable/isAttachableInstance.d.ts +6 -0
  56. package/dist/neutral/attachable/isAttachableInstance.d.ts.map +1 -0
  57. package/dist/neutral/index.d.ts +16 -353
  58. package/dist/neutral/index.d.ts.map +1 -0
  59. package/dist/neutral/index.mjs.map +1 -1
  60. package/dist/neutral/lib/HydratedBoundWitness.d.ts +4 -0
  61. package/dist/neutral/lib/HydratedBoundWitness.d.ts.map +1 -0
  62. package/dist/neutral/lib/IdentityFunction.d.ts +2 -0
  63. package/dist/neutral/lib/IdentityFunction.d.ts.map +1 -0
  64. package/dist/neutral/lib/getBoundWitness.d.ts +9 -0
  65. package/dist/neutral/lib/getBoundWitness.d.ts.map +1 -0
  66. package/dist/neutral/lib/hydrateBoundWitness.d.ts +10 -0
  67. package/dist/neutral/lib/hydrateBoundWitness.d.ts.map +1 -0
  68. package/dist/neutral/lib/index.d.ts +5 -0
  69. package/dist/neutral/lib/index.d.ts.map +1 -0
  70. package/dist/neutral/typeChecks.d.ts +115 -0
  71. package/dist/neutral/typeChecks.d.ts.map +1 -0
  72. package/package.json +9 -9
  73. package/src/lib/hydrateBoundWitness.ts +4 -2
@@ -1,353 +1,16 @@
1
- import * as _xylabs_promise from '@xylabs/promise';
2
- import { PromisableArray, Promisable } from '@xylabs/promise';
3
- import { Hex, Hash } from '@xylabs/hex';
4
- import * as _xylabs_object from '@xylabs/object';
5
- import { EmptyObject, WithAdditional, TypeCheck, IsObjectFactory } from '@xylabs/object';
6
- import * as _xyo_network_module_model from '@xyo-network/module-model';
7
- import { Module, ModuleEventArgs, ModuleEventData, ModuleQueryFunctions, ModuleConfig, ModuleIdentifier, ModuleParams, AnyConfigSchema, ModuleQueryResult, ModuleInstance, AttachableModuleInstance, Labels, ModuleQueries } from '@xyo-network/module-model';
8
- import * as _xyo_network_payload_model from '@xyo-network/payload-model';
9
- import { Payload, WithStorageMeta, Query } from '@xyo-network/payload-model';
10
- import { EventData } from '@xyo-network/module-events';
11
- import * as _xyo_network_account_model from '@xyo-network/account-model';
12
- import { AccountInstance } from '@xyo-network/account-model';
13
- import { ObjectTypeShape } from '@xylabs/typeof';
14
- import { BoundWitness } from '@xyo-network/boundwitness-model';
15
-
16
- interface NextOptions<TId = Hex> {
17
- cursor?: TId;
18
- limit?: number;
19
- open?: boolean;
20
- order?: 'asc' | 'desc';
21
- }
22
- interface ArchivistNextOptions extends NextOptions<Hash> {
23
- }
24
-
25
- interface AllArchivistFunctions<TReadResponse> {
26
- all(): PromisableArray<TReadResponse>;
27
- }
28
- interface ReadArchivistFunctions<TReadResponse, TId = string> {
29
- get(ids: TId[]): PromisableArray<TReadResponse>;
30
- next(options?: NextOptions<TId>): PromisableArray<TReadResponse>;
31
- }
32
- interface WriteArchivistFunctions<TReadResponse, TWriteResponse = TReadResponse, TWrite = TReadResponse, TId = string> {
33
- clear(): Promisable<void>;
34
- delete(ids: TId[]): PromisableArray<TId>;
35
- insert(item: TWrite[]): PromisableArray<TWriteResponse>;
36
- }
37
- interface StashArchivistFunctions<TWriteResponse> {
38
- commit(): PromisableArray<TWriteResponse>;
39
- }
40
-
41
- type ClearedEventArgs<T extends Module = Module> = ModuleEventArgs<T>;
42
- interface ClearedEventData<T extends Module = Module> extends EventData {
43
- cleared: ClearedEventArgs<T>;
44
- }
45
-
46
- type DeletedEventArgs<T extends Module = Module> = ModuleEventArgs<T, {
47
- hashes: Hash[];
48
- }>;
49
- interface DeletedEventData<T extends Module = Module> extends EventData {
50
- deleted: DeletedEventArgs<T>;
51
- }
52
-
53
- type InsertedEventArgs<T extends Module = Module> = ModuleEventArgs<T, {
54
- payloads: Payload[];
55
- }>;
56
- interface InsertedEventData<T extends Module = Module> extends EventData {
57
- inserted: InsertedEventArgs<T>;
58
- }
59
-
60
- interface ArchivistModuleEventData extends InsertedEventData, DeletedEventData, ClearedEventData, ModuleEventData {
61
- }
62
-
63
- interface AllArchivist<TReadResponse extends Payload = Payload> extends AllArchivistFunctions<WithStorageMeta<TReadResponse>> {
64
- }
65
- interface ReadArchivist<TReadResponse extends Payload = Payload, TId = Hash> extends ReadArchivistFunctions<WithStorageMeta<TReadResponse>, TId> {
66
- }
67
- interface WriteArchivist<TReadResponse extends Payload = Payload, TWriteResponse extends Payload = TReadResponse, TWrite extends Payload = TReadResponse, TId = Hash> extends WriteArchivistFunctions<WithStorageMeta<TReadResponse>, TWriteResponse, TWrite, TId> {
68
- }
69
- interface ReadWriteArchivist<TReadResponse extends Payload = Payload, TWriteResponse extends Payload = TReadResponse, TWrite extends Payload = TReadResponse, TId = Hash> extends WriteArchivist<TReadResponse, TWriteResponse, TWrite, TId>, ReadArchivist<TReadResponse, TId> {
70
- }
71
- interface StashArchivist<TWriteResponse extends Payload = Payload> extends StashArchivistFunctions<WithStorageMeta<TWriteResponse>> {
72
- }
73
- interface FullArchivist<TReadResponse extends Payload = Payload, TWriteResponse extends Payload = TReadResponse, TWrite extends Payload = TReadResponse, TId = Hash> extends ReadWriteArchivist<TReadResponse, TWriteResponse, TWrite, TId>, StashArchivist<TWriteResponse> {
74
- }
75
- interface Archivist<TReadResponse extends Payload = Payload, TWriteResponse extends Payload = Payload, TWrite extends Payload = TReadResponse & Payload, TId = Hash> extends ReadArchivist<WithStorageMeta<TReadResponse>, TId>, AllArchivist<WithStorageMeta<TReadResponse>>, WriteArchivist<WithStorageMeta<TReadResponse>, WithStorageMeta<TWriteResponse>, TWrite, TId>, StashArchivistFunctions<TWriteResponse> {
76
- }
77
-
78
- interface ArchivistModule<TReadResponse extends Payload = Payload, TWriteResponse extends Payload = Payload, TWrite extends Payload = TReadResponse & Payload, TId = Hash> extends Archivist<TReadResponse, TWriteResponse, TWrite, TId>, ModuleQueryFunctions {
79
- }
80
-
81
- type IndexDirection = -1 | 1;
82
- type IndexDescription = {
83
- key: Record<string, IndexDirection>;
84
- multiEntry?: boolean;
85
- name?: string;
86
- unique?: boolean;
87
- };
88
- declare const IndexSeparator = "-";
89
- declare const buildStandardIndexName: (index: IndexDescription) => string;
90
-
91
- interface ArchivistParents {
92
- commit?: ModuleIdentifier[];
93
- read?: ModuleIdentifier[];
94
- write?: ModuleIdentifier[];
95
- }
96
- interface ArchivistStorage {
97
- indexes?: IndexDescription[];
98
- }
99
- declare const ArchivistConfigSchema: "network.xyo.archivist.config";
100
- type ArchivistConfigSchema = typeof ArchivistConfigSchema;
101
- type ArchivistConfig<TConfig extends Payload | EmptyObject | void = void, TSchema extends string | void = void> = ModuleConfig<WithAdditional<{
102
- parents?: ArchivistParents;
103
- requireAllParents?: boolean;
104
- schema: TConfig extends Payload ? TConfig['schema'] : ArchivistConfigSchema;
105
- storage?: ArchivistStorage;
106
- storeParentReads?: boolean;
107
- }, TConfig>, TSchema>;
108
-
109
- interface ArchivistModuleInstance<TParams extends ModuleParams<AnyConfigSchema<ArchivistConfig>> = ModuleParams<AnyConfigSchema<ArchivistConfig>>, TEventData extends ArchivistModuleEventData = ArchivistModuleEventData> extends Module<TParams, TEventData> {
110
- }
111
-
112
- interface ArchivistParentInstances {
113
- commit?: ArchivistInstance[];
114
- read?: ArchivistInstance[];
115
- write?: ArchivistInstance[];
116
- }
117
- interface ArchivistParamFields {
118
- parents?: ArchivistParentInstances;
119
- }
120
- type ArchivistParams<TConfig extends AnyConfigSchema<ArchivistConfig> = AnyConfigSchema<ArchivistConfig>, TAdditionalParams extends EmptyObject = EmptyObject> = ModuleParams<TConfig, WithAdditional<ArchivistParamFields & TAdditionalParams>>;
121
-
122
- interface ArchivistRawQueryFunctions {
123
- allQuery(account?: AccountInstance): Promisable<ModuleQueryResult>;
124
- clearQuery(account?: AccountInstance): Promisable<ModuleQueryResult>;
125
- commitQuery(account?: AccountInstance): Promisable<ModuleQueryResult>;
126
- deleteQuery(hashes: Hash[], account?: AccountInstance): Promisable<ModuleQueryResult>;
127
- getQuery(hashes: Hash[], account?: AccountInstance): Promisable<ModuleQueryResult>;
128
- insertQuery(payloads: Payload[], account?: AccountInstance): Promisable<ModuleQueryResult>;
129
- nextQuery(options?: ArchivistNextOptions, account?: AccountInstance): Promisable<ModuleQueryResult>;
130
- }
131
-
132
- interface ArchivistInstance<TParams extends ArchivistParams = ArchivistParams, TEventData extends ArchivistModuleEventData = ArchivistModuleEventData, TPayload extends Payload = Payload> extends ArchivistModuleInstance<TParams, TEventData>, ArchivistModule<TPayload, TPayload>, ModuleInstance<TParams, TEventData>, ArchivistRawQueryFunctions {
133
- }
134
-
135
- interface AttachableArchivistInstance<TParams extends ArchivistParams = ArchivistParams, TEventData extends ArchivistModuleEventData = ArchivistModuleEventData, TPayload extends Payload = Payload> extends ArchivistModuleInstance<TParams, TEventData>, AttachableModuleInstance<TParams, TEventData>, ArchivistInstance<TParams, TEventData, TPayload> {
136
- }
137
- type AttachableArchivistInstanceTypeCheck<T extends AttachableArchivistInstance = AttachableArchivistInstance> = TypeCheck<T>;
138
- declare class IsAttachableArchivistInstanceFactory<T extends AttachableArchivistInstance = AttachableArchivistInstance> extends IsObjectFactory<T> {
139
- }
140
-
141
- declare const asAttachableArchivistInstance: {
142
- <TType extends AttachableArchivistInstance<_xylabs_object.BaseParamsFields & {
143
- account?: _xyo_network_account_model.AccountInstance | "random";
144
- addToResolvers?: boolean;
145
- additionalSigners?: _xyo_network_account_model.AccountInstance[];
146
- allowNameResolution?: boolean;
147
- config: _xyo_network_module_model.AnyConfigSchema<ArchivistConfig>;
148
- ephemeralQueryAccountEnabled?: boolean;
149
- moduleIdentifierTransformers?: _xyo_network_module_model.ModuleIdentifierTransformer[];
150
- privateChildren?: _xyo_network_module_model.ModuleInstance[];
151
- publicChildren?: _xyo_network_module_model.ModuleInstance[];
152
- } & ArchivistParamFields & object, ArchivistModuleEventData, _xyo_network_payload_model.Payload>>(value: _xylabs_promise.AnyNonPromise, config?: _xylabs_object.TypeCheckConfig): TType | undefined;
153
- <TType extends AttachableArchivistInstance<_xylabs_object.BaseParamsFields & {
154
- account?: _xyo_network_account_model.AccountInstance | "random";
155
- addToResolvers?: boolean;
156
- additionalSigners?: _xyo_network_account_model.AccountInstance[];
157
- allowNameResolution?: boolean;
158
- config: _xyo_network_module_model.AnyConfigSchema<ArchivistConfig>;
159
- ephemeralQueryAccountEnabled?: boolean;
160
- moduleIdentifierTransformers?: _xyo_network_module_model.ModuleIdentifierTransformer[];
161
- privateChildren?: _xyo_network_module_model.ModuleInstance[];
162
- publicChildren?: _xyo_network_module_model.ModuleInstance[];
163
- } & ArchivistParamFields & object, ArchivistModuleEventData, _xyo_network_payload_model.Payload>>(value: _xylabs_promise.AnyNonPromise, assert: _xylabs_object.StringOrAlertFunction<AttachableArchivistInstance<_xylabs_object.BaseParamsFields & {
164
- account?: _xyo_network_account_model.AccountInstance | "random";
165
- addToResolvers?: boolean;
166
- additionalSigners?: _xyo_network_account_model.AccountInstance[];
167
- allowNameResolution?: boolean;
168
- config: _xyo_network_module_model.AnyConfigSchema<ArchivistConfig>;
169
- ephemeralQueryAccountEnabled?: boolean;
170
- moduleIdentifierTransformers?: _xyo_network_module_model.ModuleIdentifierTransformer[];
171
- privateChildren?: _xyo_network_module_model.ModuleInstance[];
172
- publicChildren?: _xyo_network_module_model.ModuleInstance[];
173
- } & ArchivistParamFields & object, ArchivistModuleEventData, _xyo_network_payload_model.Payload>>, config?: _xylabs_object.TypeCheckConfig): TType;
174
- };
175
-
176
- declare const requiredAttachableArchivistInstanceFunctions: ObjectTypeShape;
177
- declare const isAttachableArchivistInstance: TypeCheck<AttachableArchivistInstance>;
178
-
179
- interface ArchivistLabels extends Labels {
180
- 'network.xyo.archivist.persistence.scope': 'memory' | 'thread' | 'process' | 'device' | 'network';
181
- }
182
-
183
- type IdentityFunction<T> = (value: unknown) => value is T;
184
-
185
- declare const tryGetTypedBoundWitness: <T extends BoundWitness>(archivist: ReadArchivist, hash: Hash, identity: IdentityFunction<WithStorageMeta<T>>) => Promise<WithStorageMeta<T> | undefined>;
186
- declare const getTypedBoundWitness: <T extends BoundWitness>(archivist: ReadArchivist, hash: Hash, identity: IdentityFunction<WithStorageMeta<T>>) => Promise<WithStorageMeta<T>>;
187
- declare const getBoundWitness: (archivist: ReadArchivist, hash: Hash) => Promise<WithStorageMeta<BoundWitness>>;
188
-
189
- type HydratedBoundWitness<T extends BoundWitness = BoundWitness, P extends Payload = Payload> = [WithStorageMeta<T>, WithStorageMeta<P>[]];
190
-
191
- declare const tryHydrateTypedBoundWitness: <T extends BoundWitness>(archivist: ReadArchivist, hashOrBw: Hash | WithStorageMeta<T>, identity: IdentityFunction<WithStorageMeta<T>>) => Promise<HydratedBoundWitness<T> | undefined>;
192
- declare const hydrateTypedBoundWitness: <T extends BoundWitness>(archivist: ReadArchivist, hashOrBw: Hash | WithStorageMeta<T>, identity: IdentityFunction<WithStorageMeta<T>>) => Promise<HydratedBoundWitness<T>>;
193
- declare const hydrateBoundWitness: (archivist: ReadArchivist, hashOrBw: Hash | WithStorageMeta<BoundWitness>) => Promise<HydratedBoundWitness<BoundWitness>>;
194
-
195
- declare const ArchivistAllQuerySchema: "network.xyo.query.archivist.all";
196
- type ArchivistAllQuerySchema = typeof ArchivistAllQuerySchema;
197
- type ArchivistAllQuery = Query<{
198
- schema: ArchivistAllQuerySchema;
199
- }>;
200
-
201
- declare const ArchivistClearQuerySchema: "network.xyo.query.archivist.clear";
202
- type ArchivistClearQuerySchema = typeof ArchivistClearQuerySchema;
203
- type ArchivistClearQuery = Query<{
204
- schema: ArchivistClearQuerySchema;
205
- }>;
206
-
207
- declare const ArchivistCommitQuerySchema: "network.xyo.query.archivist.commit";
208
- type ArchivistCommitQuerySchema = typeof ArchivistCommitQuerySchema;
209
- type ArchivistCommitQuery = Query<{
210
- schema: ArchivistCommitQuerySchema;
211
- }>;
212
-
213
- declare const ArchivistDeleteQuerySchema: "network.xyo.query.archivist.delete";
214
- type ArchivistDeleteQuerySchema = typeof ArchivistDeleteQuerySchema;
215
- type ArchivistDeleteQuery = Query<{
216
- hashes: Hash[];
217
- schema: ArchivistDeleteQuerySchema;
218
- }>;
219
-
220
- declare const ArchivistGetQuerySchema: "network.xyo.query.archivist.get";
221
- type ArchivistGetQuerySchema = typeof ArchivistGetQuerySchema;
222
- type ArchivistGetQuery = Query<{
223
- hashes: Hash[];
224
- schema: ArchivistGetQuerySchema;
225
- }>;
226
-
227
- declare const ArchivistInsertQuerySchema: "network.xyo.query.archivist.insert";
228
- type ArchivistInsertQuerySchema = typeof ArchivistInsertQuerySchema;
229
- type ArchivistInsertQuery = Query<{
230
- schema: ArchivistInsertQuerySchema;
231
- }>;
232
-
233
- declare const ArchivistNextQuerySchema: "network.xyo.query.archivist.next";
234
- type ArchivistNextQuerySchema = typeof ArchivistNextQuerySchema;
235
- type ArchivistNextQuery = Query<ArchivistNextOptions, ArchivistNextQuerySchema>;
236
-
237
- type ArchivistQueries = ArchivistAllQuery | ArchivistClearQuery | ArchivistCommitQuery | ArchivistDeleteQuery | ArchivistGetQuery | ArchivistInsertQuery | ArchivistNextQuery;
238
- type ArchivistModuleQueries = ModuleQueries | ArchivistQueries;
239
-
240
- declare const isArchivistInstance: _xylabs_object.TypeCheck<ArchivistInstance<_xylabs_object.BaseParamsFields & {
241
- account?: _xyo_network_account_model.AccountInstance | "random";
242
- addToResolvers?: boolean;
243
- additionalSigners?: _xyo_network_account_model.AccountInstance[];
244
- allowNameResolution?: boolean;
245
- config: _xyo_network_module_model.AnyConfigSchema<ArchivistConfig>;
246
- ephemeralQueryAccountEnabled?: boolean;
247
- moduleIdentifierTransformers?: _xyo_network_module_model.ModuleIdentifierTransformer[];
248
- privateChildren?: _xyo_network_module_model.ModuleInstance[];
249
- publicChildren?: _xyo_network_module_model.ModuleInstance[];
250
- } & ArchivistParamFields & object, ArchivistModuleEventData, _xyo_network_payload_model.Payload>>;
251
- declare const isArchivistModule: _xyo_network_module_model.ModuleTypeCheck<ArchivistModuleInstance<_xylabs_object.BaseParamsFields & {
252
- account?: _xyo_network_account_model.AccountInstance | "random";
253
- addToResolvers?: boolean;
254
- additionalSigners?: _xyo_network_account_model.AccountInstance[];
255
- allowNameResolution?: boolean;
256
- config: _xyo_network_module_model.AnyConfigSchema<ArchivistConfig>;
257
- ephemeralQueryAccountEnabled?: boolean;
258
- moduleIdentifierTransformers?: _xyo_network_module_model.ModuleIdentifierTransformer[];
259
- privateChildren?: _xyo_network_module_model.ModuleInstance[];
260
- publicChildren?: _xyo_network_module_model.ModuleInstance[];
261
- }, ArchivistModuleEventData>>;
262
- declare const asArchivistModule: {
263
- <TType extends ArchivistModuleInstance<_xylabs_object.BaseParamsFields & {
264
- account?: _xyo_network_account_model.AccountInstance | "random";
265
- addToResolvers?: boolean;
266
- additionalSigners?: _xyo_network_account_model.AccountInstance[];
267
- allowNameResolution?: boolean;
268
- config: _xyo_network_module_model.AnyConfigSchema<ArchivistConfig>;
269
- ephemeralQueryAccountEnabled?: boolean;
270
- moduleIdentifierTransformers?: _xyo_network_module_model.ModuleIdentifierTransformer[];
271
- privateChildren?: _xyo_network_module_model.ModuleInstance[];
272
- publicChildren?: _xyo_network_module_model.ModuleInstance[];
273
- }, ArchivistModuleEventData>>(value: _xylabs_promise.AnyNonPromise, config?: _xylabs_object.TypeCheckConfig): TType | undefined;
274
- <TType extends ArchivistModuleInstance<_xylabs_object.BaseParamsFields & {
275
- account?: _xyo_network_account_model.AccountInstance | "random";
276
- addToResolvers?: boolean;
277
- additionalSigners?: _xyo_network_account_model.AccountInstance[];
278
- allowNameResolution?: boolean;
279
- config: _xyo_network_module_model.AnyConfigSchema<ArchivistConfig>;
280
- ephemeralQueryAccountEnabled?: boolean;
281
- moduleIdentifierTransformers?: _xyo_network_module_model.ModuleIdentifierTransformer[];
282
- privateChildren?: _xyo_network_module_model.ModuleInstance[];
283
- publicChildren?: _xyo_network_module_model.ModuleInstance[];
284
- }, ArchivistModuleEventData>>(value: _xylabs_promise.AnyNonPromise, assert: _xylabs_object.StringOrAlertFunction<ArchivistModuleInstance<_xylabs_object.BaseParamsFields & {
285
- account?: _xyo_network_account_model.AccountInstance | "random";
286
- addToResolvers?: boolean;
287
- additionalSigners?: _xyo_network_account_model.AccountInstance[];
288
- allowNameResolution?: boolean;
289
- config: _xyo_network_module_model.AnyConfigSchema<ArchivistConfig>;
290
- ephemeralQueryAccountEnabled?: boolean;
291
- moduleIdentifierTransformers?: _xyo_network_module_model.ModuleIdentifierTransformer[];
292
- privateChildren?: _xyo_network_module_model.ModuleInstance[];
293
- publicChildren?: _xyo_network_module_model.ModuleInstance[];
294
- }, ArchivistModuleEventData>>, config?: _xylabs_object.TypeCheckConfig): TType;
295
- };
296
- declare const asArchivistInstance: {
297
- <TType extends ArchivistInstance<_xylabs_object.BaseParamsFields & {
298
- account?: _xyo_network_account_model.AccountInstance | "random";
299
- addToResolvers?: boolean;
300
- additionalSigners?: _xyo_network_account_model.AccountInstance[];
301
- allowNameResolution?: boolean;
302
- config: _xyo_network_module_model.AnyConfigSchema<ArchivistConfig>;
303
- ephemeralQueryAccountEnabled?: boolean;
304
- moduleIdentifierTransformers?: _xyo_network_module_model.ModuleIdentifierTransformer[];
305
- privateChildren?: _xyo_network_module_model.ModuleInstance[];
306
- publicChildren?: _xyo_network_module_model.ModuleInstance[];
307
- } & ArchivistParamFields & object, ArchivistModuleEventData, _xyo_network_payload_model.Payload>>(value: _xylabs_promise.AnyNonPromise, config?: _xylabs_object.TypeCheckConfig): TType | undefined;
308
- <TType extends ArchivistInstance<_xylabs_object.BaseParamsFields & {
309
- account?: _xyo_network_account_model.AccountInstance | "random";
310
- addToResolvers?: boolean;
311
- additionalSigners?: _xyo_network_account_model.AccountInstance[];
312
- allowNameResolution?: boolean;
313
- config: _xyo_network_module_model.AnyConfigSchema<ArchivistConfig>;
314
- ephemeralQueryAccountEnabled?: boolean;
315
- moduleIdentifierTransformers?: _xyo_network_module_model.ModuleIdentifierTransformer[];
316
- privateChildren?: _xyo_network_module_model.ModuleInstance[];
317
- publicChildren?: _xyo_network_module_model.ModuleInstance[];
318
- } & ArchivistParamFields & object, ArchivistModuleEventData, _xyo_network_payload_model.Payload>>(value: _xylabs_promise.AnyNonPromise, assert: _xylabs_object.StringOrAlertFunction<ArchivistInstance<_xylabs_object.BaseParamsFields & {
319
- account?: _xyo_network_account_model.AccountInstance | "random";
320
- addToResolvers?: boolean;
321
- additionalSigners?: _xyo_network_account_model.AccountInstance[];
322
- allowNameResolution?: boolean;
323
- config: _xyo_network_module_model.AnyConfigSchema<ArchivistConfig>;
324
- ephemeralQueryAccountEnabled?: boolean;
325
- moduleIdentifierTransformers?: _xyo_network_module_model.ModuleIdentifierTransformer[];
326
- privateChildren?: _xyo_network_module_model.ModuleInstance[];
327
- publicChildren?: _xyo_network_module_model.ModuleInstance[];
328
- } & ArchivistParamFields & object, ArchivistModuleEventData, _xyo_network_payload_model.Payload>>, config?: _xylabs_object.TypeCheckConfig): TType;
329
- };
330
- declare const withArchivistModule: <R>(mod: any, closure: (mod: ArchivistModuleInstance<_xylabs_object.BaseParamsFields & {
331
- account?: _xyo_network_account_model.AccountInstance | "random";
332
- addToResolvers?: boolean;
333
- additionalSigners?: _xyo_network_account_model.AccountInstance[];
334
- allowNameResolution?: boolean;
335
- config: _xyo_network_module_model.AnyConfigSchema<ArchivistConfig>;
336
- ephemeralQueryAccountEnabled?: boolean;
337
- moduleIdentifierTransformers?: _xyo_network_module_model.ModuleIdentifierTransformer[];
338
- privateChildren?: _xyo_network_module_model.ModuleInstance[];
339
- publicChildren?: _xyo_network_module_model.ModuleInstance[];
340
- }, ArchivistModuleEventData>) => R) => R | undefined;
341
- declare const withArchivistInstance: <R>(mod: any, closure: (mod: ArchivistInstance<_xylabs_object.BaseParamsFields & {
342
- account?: _xyo_network_account_model.AccountInstance | "random";
343
- addToResolvers?: boolean;
344
- additionalSigners?: _xyo_network_account_model.AccountInstance[];
345
- allowNameResolution?: boolean;
346
- config: _xyo_network_module_model.AnyConfigSchema<ArchivistConfig>;
347
- ephemeralQueryAccountEnabled?: boolean;
348
- moduleIdentifierTransformers?: _xyo_network_module_model.ModuleIdentifierTransformer[];
349
- privateChildren?: _xyo_network_module_model.ModuleInstance[];
350
- publicChildren?: _xyo_network_module_model.ModuleInstance[];
351
- } & ArchivistParamFields & object, ArchivistModuleEventData, _xyo_network_payload_model.Payload>) => R) => R | undefined;
352
-
353
- export { type AllArchivist, type AllArchivistFunctions, type Archivist, type ArchivistAllQuery, ArchivistAllQuerySchema, type ArchivistClearQuery, ArchivistClearQuerySchema, type ArchivistCommitQuery, ArchivistCommitQuerySchema, type ArchivistConfig, ArchivistConfigSchema, type ArchivistDeleteQuery, ArchivistDeleteQuerySchema, type ArchivistGetQuery, ArchivistGetQuerySchema, type ArchivistInsertQuery, ArchivistInsertQuerySchema, type ArchivistInstance, type ArchivistLabels, type ArchivistModuleEventData, type ArchivistModuleInstance, type ArchivistModuleQueries, type ArchivistNextOptions, type ArchivistNextQuery, ArchivistNextQuerySchema, type ArchivistParamFields, type ArchivistParams, type ArchivistParentInstances, type ArchivistParents, type ArchivistQueries, type ArchivistRawQueryFunctions, type ArchivistStorage, type AttachableArchivistInstance, type AttachableArchivistInstanceTypeCheck, type FullArchivist, type HydratedBoundWitness, type IdentityFunction, type IndexDescription, type IndexDirection, IndexSeparator, IsAttachableArchivistInstanceFactory, type NextOptions, type ReadArchivist, type ReadArchivistFunctions, type ReadWriteArchivist, type StashArchivist, type StashArchivistFunctions, type WriteArchivist, type WriteArchivistFunctions, asArchivistInstance, asArchivistModule, asAttachableArchivistInstance, buildStandardIndexName, getBoundWitness, getTypedBoundWitness, hydrateBoundWitness, hydrateTypedBoundWitness, isArchivistInstance, isArchivistModule, isAttachableArchivistInstance, requiredAttachableArchivistInstanceFunctions, tryGetTypedBoundWitness, tryHydrateTypedBoundWitness, withArchivistInstance, withArchivistModule };
1
+ export * from './ArchivistFunctions.ts';
2
+ export * from './attachable/index.ts';
3
+ export * from './Config.ts';
4
+ export * from './EventData.ts';
5
+ export * from './IndexDescription.ts';
6
+ export * from './Instance.ts';
7
+ export * from './Labels.ts';
8
+ export * from './lib/index.ts';
9
+ export * from './ModuleInstance.ts';
10
+ export * from './NextOptions.ts';
11
+ export * from './Params.ts';
12
+ export * from './PayloadArchivist.ts';
13
+ export * from './Queries/index.ts';
14
+ export * from './RawQueryFunctions.ts';
15
+ export * from './typeChecks.ts';
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,cAAc,uBAAuB,CAAA;AACrC,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,uBAAuB,CAAA;AACrC,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,aAAa,CAAA;AAC3B,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/attachable/asAttachableInstance.ts","../../src/attachable/isAttachableInstance.ts","../../src/typeChecks.ts","../../src/Queries/All.ts","../../src/Queries/Clear.ts","../../src/Queries/Commit.ts","../../src/Queries/Delete.ts","../../src/Queries/Get.ts","../../src/Queries/Insert.ts","../../src/Queries/Next.ts","../../src/attachable/AttachableInstance.ts","../../src/Config.ts","../../src/IndexDescription.ts","../../src/lib/getBoundWitness.ts","../../src/lib/hydrateBoundWitness.ts"],"sourcesContent":["import { AsObjectFactory } from '@xylabs/object'\n\nimport { isAttachableArchivistInstance } from './isAttachableInstance.ts'\n\nexport const asAttachableArchivistInstance = AsObjectFactory.create(isAttachableArchivistInstance)\n","import type { TypeCheck } from '@xylabs/object'\nimport { IsObjectFactory } from '@xylabs/object'\nimport type { ObjectTypeShape } from '@xylabs/typeof'\nimport { isAttachableModuleInstance } from '@xyo-network/module-model'\n\nimport { isArchivistInstance } from '../typeChecks.ts'\nimport type { AttachableArchivistInstance } from './AttachableInstance.ts'\n\nexport const requiredAttachableArchivistInstanceFunctions: ObjectTypeShape = {}\n\n// we do not use IsInstanceFactory here to prevent a cycle\nconst factory = new IsObjectFactory<AttachableArchivistInstance>()\n\nexport const isAttachableArchivistInstance: TypeCheck<AttachableArchivistInstance> = factory.create(requiredAttachableArchivistInstanceFunctions, [\n isArchivistInstance,\n isAttachableModuleInstance,\n])\n","import { AsObjectFactory } from '@xylabs/object'\nimport {\n IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory,\n} from '@xyo-network/module-model'\n\nimport type { ArchivistInstance } from './Instance.ts'\nimport type { ArchivistModuleInstance } from './ModuleInstance.ts'\nimport { ArchivistGetQuerySchema } from './Queries/index.ts'\n\nexport const isArchivistInstance = new IsInstanceFactory<ArchivistInstance>().create({ get: 'function' }, [isModuleInstance])\nexport const isArchivistModule = new IsModuleFactory<ArchivistModuleInstance>().create([ArchivistGetQuerySchema])\n\nexport const asArchivistModule = AsObjectFactory.create(isArchivistModule)\nexport const asArchivistInstance = AsObjectFactory.create(isArchivistInstance)\nexport const withArchivistModule = WithFactory.create(isArchivistModule)\nexport const withArchivistInstance = WithFactory.create(isArchivistInstance)\n","import type { Query } from '@xyo-network/payload-model'\n\nexport const ArchivistAllQuerySchema = 'network.xyo.query.archivist.all' as const\nexport type ArchivistAllQuerySchema = typeof ArchivistAllQuerySchema\n\nexport type ArchivistAllQuery = Query<{\n schema: ArchivistAllQuerySchema\n}>\n","import type { Query } from '@xyo-network/payload-model'\n\nexport const ArchivistClearQuerySchema = 'network.xyo.query.archivist.clear' as const\nexport type ArchivistClearQuerySchema = typeof ArchivistClearQuerySchema\n\nexport type ArchivistClearQuery = Query<{\n schema: ArchivistClearQuerySchema\n}>\n","import type { Query } from '@xyo-network/payload-model'\n\nexport const ArchivistCommitQuerySchema = 'network.xyo.query.archivist.commit' as const\nexport type ArchivistCommitQuerySchema = typeof ArchivistCommitQuerySchema\n\nexport type ArchivistCommitQuery = Query<{\n schema: ArchivistCommitQuerySchema\n}>\n","import type { Hash } from '@xylabs/hex'\nimport type { Query } from '@xyo-network/payload-model'\n\nexport const ArchivistDeleteQuerySchema = 'network.xyo.query.archivist.delete' as const\nexport type ArchivistDeleteQuerySchema = typeof ArchivistDeleteQuerySchema\n\nexport type ArchivistDeleteQuery = Query<{\n hashes: Hash[]\n schema: ArchivistDeleteQuerySchema\n}>\n","import type { Hash } from '@xylabs/hex'\nimport type { Query } from '@xyo-network/payload-model'\n\nexport const ArchivistGetQuerySchema = 'network.xyo.query.archivist.get' as const\nexport type ArchivistGetQuerySchema = typeof ArchivistGetQuerySchema\n\nexport type ArchivistGetQuery = Query<{\n hashes: Hash[]\n schema: ArchivistGetQuerySchema\n}>\n","import type { Query } from '@xyo-network/payload-model'\n\nexport const ArchivistInsertQuerySchema = 'network.xyo.query.archivist.insert' as const\nexport type ArchivistInsertQuerySchema = typeof ArchivistInsertQuerySchema\n\nexport type ArchivistInsertQuery = Query<{\n schema: ArchivistInsertQuerySchema\n}>\n","import type { Query } from '@xyo-network/payload-model'\n\nimport type { ArchivistNextOptions } from '../NextOptions.ts'\n\nexport const ArchivistNextQuerySchema = 'network.xyo.query.archivist.next' as const\nexport type ArchivistNextQuerySchema = typeof ArchivistNextQuerySchema\n\nexport type ArchivistNextQuery = Query<ArchivistNextOptions, ArchivistNextQuerySchema>\n","import type { TypeCheck } from '@xylabs/object'\nimport { IsObjectFactory } from '@xylabs/object'\nimport type { AttachableModuleInstance } from '@xyo-network/module-model'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport type { ArchivistModuleEventData } from '../EventData.ts'\nimport type { ArchivistInstance } from '../Instance.ts'\nimport type { ArchivistModuleInstance } from '../ModuleInstance.ts'\nimport type { ArchivistParams } from '../Params.ts'\n\nexport interface AttachableArchivistInstance<\n TParams extends ArchivistParams = ArchivistParams,\n TEventData extends ArchivistModuleEventData = ArchivistModuleEventData,\n TPayload extends Payload = Payload,\n> extends ArchivistModuleInstance<TParams, TEventData>,\n AttachableModuleInstance<TParams, TEventData>,\n ArchivistInstance<TParams, TEventData, TPayload> {}\n\nexport type AttachableArchivistInstanceTypeCheck<T extends AttachableArchivistInstance = AttachableArchivistInstance> = TypeCheck<T>\n\nexport class IsAttachableArchivistInstanceFactory<T extends AttachableArchivistInstance = AttachableArchivistInstance> extends IsObjectFactory<T> {}\n","import type { EmptyObject, WithAdditional } from '@xylabs/object'\nimport type { ModuleConfig, ModuleIdentifier } from '@xyo-network/module-model'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport type { IndexDescription } from './IndexDescription.ts'\n\nexport interface ArchivistParents {\n commit?: ModuleIdentifier[]\n read?: ModuleIdentifier[]\n write?: ModuleIdentifier[]\n}\n\nexport interface ArchivistStorage {\n /** The indexes to create on the object store */\n indexes?: IndexDescription[]\n}\n\nexport const ArchivistConfigSchema = 'network.xyo.archivist.config' as const\nexport type ArchivistConfigSchema = typeof ArchivistConfigSchema\n\nexport type ArchivistConfig<TConfig extends Payload | EmptyObject | void = void, TSchema extends string | void = void> = ModuleConfig<\n WithAdditional<\n {\n /** @field address of one or more parent archivists to read from */\n parents?: ArchivistParents\n /** @field fail if some parents can not be resolved (true if unspecified) */\n requireAllParents?: boolean\n schema: TConfig extends Payload ? TConfig['schema'] : ArchivistConfigSchema\n /** @field storage configuration */\n storage?: ArchivistStorage\n /** @field should child store all reads from parents? */\n storeParentReads?: boolean\n },\n TConfig\n >,\n TSchema\n>\n","/**\n * The index direction (1 for ascending, -1 for descending)\n */\nexport type IndexDirection = -1 | 1\n\n/**\n * Description of index(es) to be created on a store\n */\nexport type IndexDescription = {\n /**\n * The key(s) to index\n */\n key: Record<string, IndexDirection>\n /**\n * Is the indexed value an array\n */\n multiEntry?: boolean\n /**\n * The name of the index\n */\n name?: string\n /**\n * If true, the index must enforce uniqueness on the key\n */\n unique?: boolean\n}\n\nexport const IndexSeparator = '-'\n\n/**\n * Given an index description, this will build the index\n * name in standard form\n * @param index The index description\n * @returns The index name in standard form\n */\nexport const buildStandardIndexName = (index: IndexDescription) => {\n const { key, unique } = index\n const prefix = unique ? 'UX' : 'IX'\n const indexKeys = Object.keys(key)\n return `${prefix}_${indexKeys.join(IndexSeparator)}`\n}\n","import { assertEx } from '@xylabs/assert'\nimport type { Hash } from '@xylabs/hex'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isBoundWitnessWithStorageMeta } from '@xyo-network/boundwitness-model'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\n\nimport type { ReadArchivist } from '../PayloadArchivist.ts'\nimport type { IdentityFunction } from './IdentityFunction.ts'\n\nexport const tryGetTypedBoundWitness = async <T extends BoundWitness>(archivist: ReadArchivist, hash: Hash,\n identity: IdentityFunction<WithStorageMeta<T>>): Promise<WithStorageMeta<T> | undefined> => {\n const payload = (await archivist.get([hash])).at(0)\n return identity(payload) ? payload : undefined\n}\n\nexport const getTypedBoundWitness = async <T extends BoundWitness>(archivist: ReadArchivist, hash: Hash,\n identity: IdentityFunction<WithStorageMeta<T>>): Promise<WithStorageMeta<T>> => {\n const payload = assertEx((await archivist.get([hash])).at(0), () => `failed to locate bound witness: ${hash}`)\n return assertEx(identity(payload) ? payload : undefined, () => `located payload failed identity check: ${hash}`)\n}\n\nexport const getBoundWitness = (archivist: ReadArchivist, hash: Hash): Promise<WithStorageMeta<BoundWitness>> => {\n return getTypedBoundWitness<BoundWitness>(archivist, hash, isBoundWitnessWithStorageMeta)\n}\n","import { exists } from '@xylabs/exists'\nimport { type Hash, isHash } from '@xylabs/hex'\nimport { type BoundWitness, isBoundWitnessWithStorageMeta } from '@xyo-network/boundwitness-model'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\n\nimport type { ReadArchivist } from '../PayloadArchivist.ts'\nimport { getTypedBoundWitness, tryGetTypedBoundWitness } from './getBoundWitness.ts'\nimport type { HydratedBoundWitness } from './HydratedBoundWitness.ts'\nimport type { IdentityFunction } from './IdentityFunction.ts'\n\nexport const tryHydrateTypedBoundWitness = async <T extends BoundWitness>(archivist: ReadArchivist, hashOrBw: Hash | WithStorageMeta<T>,\n identity: IdentityFunction<WithStorageMeta<T>>): Promise<HydratedBoundWitness<T> | undefined> => {\n const bw = isHash(hashOrBw) ? await tryGetTypedBoundWitness(archivist, hashOrBw, identity) : hashOrBw\n return bw ? [bw, (await archivist.get(bw?.payload_hashes)).filter(exists)] : undefined\n}\n\nexport const hydrateTypedBoundWitness = async <T extends BoundWitness>(archivist: ReadArchivist, hashOrBw: Hash | WithStorageMeta<T>,\n identity: IdentityFunction<WithStorageMeta<T>>): Promise<HydratedBoundWitness<T>> => {\n const bw = isHash(hashOrBw) ? await getTypedBoundWitness(archivist, hashOrBw, identity) : hashOrBw\n return [bw, (await archivist.get(bw?.payload_hashes)).filter(exists)]\n}\n\nexport const hydrateBoundWitness = (\n archivist: ReadArchivist,\n hashOrBw: Hash | WithStorageMeta<BoundWitness>,\n): Promise<HydratedBoundWitness<BoundWitness>> => {\n return hydrateTypedBoundWitness<BoundWitness>(archivist, hashOrBw, isBoundWitnessWithStorageMeta)\n}\n"],"mappings":";AAAA,SAAS,mBAAAA,wBAAuB;;;ACChC,SAAS,uBAAuB;AAEhC,SAAS,kCAAkC;;;ACH3C,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EAAmB;AAAA,EAAiB;AAAA,EAAkB;AAAA,OACjD;;;ACDA,IAAM,0BAA0B;;;ACAhC,IAAM,4BAA4B;;;ACAlC,IAAM,6BAA6B;;;ACCnC,IAAM,6BAA6B;;;ACAnC,IAAM,0BAA0B;;;ACDhC,IAAM,6BAA6B;;;ACEnC,IAAM,2BAA2B;;;APKjC,IAAM,sBAAsB,IAAI,kBAAqC,EAAE,OAAO,EAAE,KAAK,WAAW,GAAG,CAAC,gBAAgB,CAAC;AACrH,IAAM,oBAAoB,IAAI,gBAAyC,EAAE,OAAO,CAAC,uBAAuB,CAAC;AAEzG,IAAM,oBAAoB,gBAAgB,OAAO,iBAAiB;AAClE,IAAM,sBAAsB,gBAAgB,OAAO,mBAAmB;AACtE,IAAM,sBAAsB,YAAY,OAAO,iBAAiB;AAChE,IAAM,wBAAwB,YAAY,OAAO,mBAAmB;;;ADPpE,IAAM,+CAAgE,CAAC;AAG9E,IAAM,UAAU,IAAI,gBAA6C;AAE1D,IAAM,gCAAwE,QAAQ,OAAO,8CAA8C;AAAA,EAChJ;AAAA,EACA;AACF,CAAC;;;ADZM,IAAM,gCAAgCC,iBAAgB,OAAO,6BAA6B;;;AUHjG,SAAS,mBAAAC,wBAAuB;AAmBzB,IAAM,uCAAN,cAAwHA,iBAAmB;AAAC;;;ACH5I,IAAM,wBAAwB;;;ACU9B,IAAM,iBAAiB;AAQvB,IAAM,yBAAyB,CAAC,UAA4B;AACjE,QAAM,EAAE,KAAK,OAAO,IAAI;AACxB,QAAM,SAAS,SAAS,OAAO;AAC/B,QAAM,YAAY,OAAO,KAAK,GAAG;AACjC,SAAO,GAAG,MAAM,IAAI,UAAU,KAAK,cAAc,CAAC;AACpD;;;ACxCA,SAAS,gBAAgB;AAGzB,SAAS,qCAAqC;AAMvC,IAAM,0BAA0B,OAA+B,WAA0B,MAC9F,aAA4F;AAC5F,QAAM,WAAW,MAAM,UAAU,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC;AAClD,SAAO,SAAS,OAAO,IAAI,UAAU;AACvC;AAEO,IAAM,uBAAuB,OAA+B,WAA0B,MAC3F,aAAgF;AAChF,QAAM,UAAU,UAAU,MAAM,UAAU,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,GAAG,MAAM,mCAAmC,IAAI,EAAE;AAC7G,SAAO,SAAS,SAAS,OAAO,IAAI,UAAU,QAAW,MAAM,0CAA0C,IAAI,EAAE;AACjH;AAEO,IAAM,kBAAkB,CAAC,WAA0B,SAAuD;AAC/G,SAAO,qBAAmC,WAAW,MAAM,6BAA6B;AAC1F;;;ACvBA,SAAS,cAAc;AACvB,SAAoB,cAAc;AAClC,SAA4B,iCAAAC,sCAAqC;AAQ1D,IAAM,8BAA8B,OAA+B,WAA0B,UAClG,aAAiG;AACjG,QAAM,KAAK,OAAO,QAAQ,IAAI,MAAM,wBAAwB,WAAW,UAAU,QAAQ,IAAI;AAC7F,SAAO,KAAK,CAAC,KAAK,MAAM,UAAU,IAAI,IAAI,cAAc,GAAG,OAAO,MAAM,CAAC,IAAI;AAC/E;AAEO,IAAM,2BAA2B,OAA+B,WAA0B,UAC/F,aAAqF;AACrF,QAAM,KAAK,OAAO,QAAQ,IAAI,MAAM,qBAAqB,WAAW,UAAU,QAAQ,IAAI;AAC1F,SAAO,CAAC,KAAK,MAAM,UAAU,IAAI,IAAI,cAAc,GAAG,OAAO,MAAM,CAAC;AACtE;AAEO,IAAM,sBAAsB,CACjC,WACA,aACgD;AAChD,SAAO,yBAAuC,WAAW,UAAUC,8BAA6B;AAClG;","names":["AsObjectFactory","AsObjectFactory","IsObjectFactory","isBoundWitnessWithStorageMeta","isBoundWitnessWithStorageMeta"]}
1
+ {"version":3,"sources":["../../src/attachable/asAttachableInstance.ts","../../src/attachable/isAttachableInstance.ts","../../src/typeChecks.ts","../../src/Queries/All.ts","../../src/Queries/Clear.ts","../../src/Queries/Commit.ts","../../src/Queries/Delete.ts","../../src/Queries/Get.ts","../../src/Queries/Insert.ts","../../src/Queries/Next.ts","../../src/attachable/AttachableInstance.ts","../../src/Config.ts","../../src/IndexDescription.ts","../../src/lib/getBoundWitness.ts","../../src/lib/hydrateBoundWitness.ts"],"sourcesContent":["import { AsObjectFactory } from '@xylabs/object'\n\nimport { isAttachableArchivistInstance } from './isAttachableInstance.ts'\n\nexport const asAttachableArchivistInstance = AsObjectFactory.create(isAttachableArchivistInstance)\n","import type { TypeCheck } from '@xylabs/object'\nimport { IsObjectFactory } from '@xylabs/object'\nimport type { ObjectTypeShape } from '@xylabs/typeof'\nimport { isAttachableModuleInstance } from '@xyo-network/module-model'\n\nimport { isArchivistInstance } from '../typeChecks.ts'\nimport type { AttachableArchivistInstance } from './AttachableInstance.ts'\n\nexport const requiredAttachableArchivistInstanceFunctions: ObjectTypeShape = {}\n\n// we do not use IsInstanceFactory here to prevent a cycle\nconst factory = new IsObjectFactory<AttachableArchivistInstance>()\n\nexport const isAttachableArchivistInstance: TypeCheck<AttachableArchivistInstance> = factory.create(requiredAttachableArchivistInstanceFunctions, [\n isArchivistInstance,\n isAttachableModuleInstance,\n])\n","import { AsObjectFactory } from '@xylabs/object'\nimport {\n IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory,\n} from '@xyo-network/module-model'\n\nimport type { ArchivistInstance } from './Instance.ts'\nimport type { ArchivistModuleInstance } from './ModuleInstance.ts'\nimport { ArchivistGetQuerySchema } from './Queries/index.ts'\n\nexport const isArchivistInstance = new IsInstanceFactory<ArchivistInstance>().create({ get: 'function' }, [isModuleInstance])\nexport const isArchivistModule = new IsModuleFactory<ArchivistModuleInstance>().create([ArchivistGetQuerySchema])\n\nexport const asArchivistModule = AsObjectFactory.create(isArchivistModule)\nexport const asArchivistInstance = AsObjectFactory.create(isArchivistInstance)\nexport const withArchivistModule = WithFactory.create(isArchivistModule)\nexport const withArchivistInstance = WithFactory.create(isArchivistInstance)\n","import type { Query } from '@xyo-network/payload-model'\n\nexport const ArchivistAllQuerySchema = 'network.xyo.query.archivist.all' as const\nexport type ArchivistAllQuerySchema = typeof ArchivistAllQuerySchema\n\nexport type ArchivistAllQuery = Query<{\n schema: ArchivistAllQuerySchema\n}>\n","import type { Query } from '@xyo-network/payload-model'\n\nexport const ArchivistClearQuerySchema = 'network.xyo.query.archivist.clear' as const\nexport type ArchivistClearQuerySchema = typeof ArchivistClearQuerySchema\n\nexport type ArchivistClearQuery = Query<{\n schema: ArchivistClearQuerySchema\n}>\n","import type { Query } from '@xyo-network/payload-model'\n\nexport const ArchivistCommitQuerySchema = 'network.xyo.query.archivist.commit' as const\nexport type ArchivistCommitQuerySchema = typeof ArchivistCommitQuerySchema\n\nexport type ArchivistCommitQuery = Query<{\n schema: ArchivistCommitQuerySchema\n}>\n","import type { Hash } from '@xylabs/hex'\nimport type { Query } from '@xyo-network/payload-model'\n\nexport const ArchivistDeleteQuerySchema = 'network.xyo.query.archivist.delete' as const\nexport type ArchivistDeleteQuerySchema = typeof ArchivistDeleteQuerySchema\n\nexport type ArchivistDeleteQuery = Query<{\n hashes: Hash[]\n schema: ArchivistDeleteQuerySchema\n}>\n","import type { Hash } from '@xylabs/hex'\nimport type { Query } from '@xyo-network/payload-model'\n\nexport const ArchivistGetQuerySchema = 'network.xyo.query.archivist.get' as const\nexport type ArchivistGetQuerySchema = typeof ArchivistGetQuerySchema\n\nexport type ArchivistGetQuery = Query<{\n hashes: Hash[]\n schema: ArchivistGetQuerySchema\n}>\n","import type { Query } from '@xyo-network/payload-model'\n\nexport const ArchivistInsertQuerySchema = 'network.xyo.query.archivist.insert' as const\nexport type ArchivistInsertQuerySchema = typeof ArchivistInsertQuerySchema\n\nexport type ArchivistInsertQuery = Query<{\n schema: ArchivistInsertQuerySchema\n}>\n","import type { Query } from '@xyo-network/payload-model'\n\nimport type { ArchivistNextOptions } from '../NextOptions.ts'\n\nexport const ArchivistNextQuerySchema = 'network.xyo.query.archivist.next' as const\nexport type ArchivistNextQuerySchema = typeof ArchivistNextQuerySchema\n\nexport type ArchivistNextQuery = Query<ArchivistNextOptions, ArchivistNextQuerySchema>\n","import type { TypeCheck } from '@xylabs/object'\nimport { IsObjectFactory } from '@xylabs/object'\nimport type { AttachableModuleInstance } from '@xyo-network/module-model'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport type { ArchivistModuleEventData } from '../EventData.ts'\nimport type { ArchivistInstance } from '../Instance.ts'\nimport type { ArchivistModuleInstance } from '../ModuleInstance.ts'\nimport type { ArchivistParams } from '../Params.ts'\n\nexport interface AttachableArchivistInstance<\n TParams extends ArchivistParams = ArchivistParams,\n TEventData extends ArchivistModuleEventData = ArchivistModuleEventData,\n TPayload extends Payload = Payload,\n> extends ArchivistModuleInstance<TParams, TEventData>,\n AttachableModuleInstance<TParams, TEventData>,\n ArchivistInstance<TParams, TEventData, TPayload> {}\n\nexport type AttachableArchivistInstanceTypeCheck<T extends AttachableArchivistInstance = AttachableArchivistInstance> = TypeCheck<T>\n\nexport class IsAttachableArchivistInstanceFactory<T extends AttachableArchivistInstance = AttachableArchivistInstance> extends IsObjectFactory<T> {}\n","import type { EmptyObject, WithAdditional } from '@xylabs/object'\nimport type { ModuleConfig, ModuleIdentifier } from '@xyo-network/module-model'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport type { IndexDescription } from './IndexDescription.ts'\n\nexport interface ArchivistParents {\n commit?: ModuleIdentifier[]\n read?: ModuleIdentifier[]\n write?: ModuleIdentifier[]\n}\n\nexport interface ArchivistStorage {\n /** The indexes to create on the object store */\n indexes?: IndexDescription[]\n}\n\nexport const ArchivistConfigSchema = 'network.xyo.archivist.config' as const\nexport type ArchivistConfigSchema = typeof ArchivistConfigSchema\n\nexport type ArchivistConfig<TConfig extends Payload | EmptyObject | void = void, TSchema extends string | void = void> = ModuleConfig<\n WithAdditional<\n {\n /** @field address of one or more parent archivists to read from */\n parents?: ArchivistParents\n /** @field fail if some parents can not be resolved (true if unspecified) */\n requireAllParents?: boolean\n schema: TConfig extends Payload ? TConfig['schema'] : ArchivistConfigSchema\n /** @field storage configuration */\n storage?: ArchivistStorage\n /** @field should child store all reads from parents? */\n storeParentReads?: boolean\n },\n TConfig\n >,\n TSchema\n>\n","/**\n * The index direction (1 for ascending, -1 for descending)\n */\nexport type IndexDirection = -1 | 1\n\n/**\n * Description of index(es) to be created on a store\n */\nexport type IndexDescription = {\n /**\n * The key(s) to index\n */\n key: Record<string, IndexDirection>\n /**\n * Is the indexed value an array\n */\n multiEntry?: boolean\n /**\n * The name of the index\n */\n name?: string\n /**\n * If true, the index must enforce uniqueness on the key\n */\n unique?: boolean\n}\n\nexport const IndexSeparator = '-'\n\n/**\n * Given an index description, this will build the index\n * name in standard form\n * @param index The index description\n * @returns The index name in standard form\n */\nexport const buildStandardIndexName = (index: IndexDescription) => {\n const { key, unique } = index\n const prefix = unique ? 'UX' : 'IX'\n const indexKeys = Object.keys(key)\n return `${prefix}_${indexKeys.join(IndexSeparator)}`\n}\n","import { assertEx } from '@xylabs/assert'\nimport type { Hash } from '@xylabs/hex'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isBoundWitnessWithStorageMeta } from '@xyo-network/boundwitness-model'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\n\nimport type { ReadArchivist } from '../PayloadArchivist.ts'\nimport type { IdentityFunction } from './IdentityFunction.ts'\n\nexport const tryGetTypedBoundWitness = async <T extends BoundWitness>(archivist: ReadArchivist, hash: Hash,\n identity: IdentityFunction<WithStorageMeta<T>>): Promise<WithStorageMeta<T> | undefined> => {\n const payload = (await archivist.get([hash])).at(0)\n return identity(payload) ? payload : undefined\n}\n\nexport const getTypedBoundWitness = async <T extends BoundWitness>(archivist: ReadArchivist, hash: Hash,\n identity: IdentityFunction<WithStorageMeta<T>>): Promise<WithStorageMeta<T>> => {\n const payload = assertEx((await archivist.get([hash])).at(0), () => `failed to locate bound witness: ${hash}`)\n return assertEx(identity(payload) ? payload : undefined, () => `located payload failed identity check: ${hash}`)\n}\n\nexport const getBoundWitness = (archivist: ReadArchivist, hash: Hash): Promise<WithStorageMeta<BoundWitness>> => {\n return getTypedBoundWitness<BoundWitness>(archivist, hash, isBoundWitnessWithStorageMeta)\n}\n","import { exists } from '@xylabs/exists'\nimport type { Hash } from '@xylabs/hex'\nimport { isHash } from '@xylabs/hex'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isBoundWitnessWithStorageMeta } from '@xyo-network/boundwitness-model'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\n\nimport type { ReadArchivist } from '../PayloadArchivist.ts'\nimport { getTypedBoundWitness, tryGetTypedBoundWitness } from './getBoundWitness.ts'\nimport type { HydratedBoundWitness } from './HydratedBoundWitness.ts'\nimport type { IdentityFunction } from './IdentityFunction.ts'\n\nexport const tryHydrateTypedBoundWitness = async <T extends BoundWitness>(archivist: ReadArchivist, hashOrBw: Hash | WithStorageMeta<T>,\n identity: IdentityFunction<WithStorageMeta<T>>): Promise<HydratedBoundWitness<T> | undefined> => {\n const bw = isHash(hashOrBw) ? await tryGetTypedBoundWitness(archivist, hashOrBw, identity) : hashOrBw\n return bw ? [bw, (await archivist.get(bw?.payload_hashes)).filter(exists)] : undefined\n}\n\nexport const hydrateTypedBoundWitness = async <T extends BoundWitness>(archivist: ReadArchivist, hashOrBw: Hash | WithStorageMeta<T>,\n identity: IdentityFunction<WithStorageMeta<T>>): Promise<HydratedBoundWitness<T>> => {\n const bw = isHash(hashOrBw) ? await getTypedBoundWitness(archivist, hashOrBw, identity) : hashOrBw\n return [bw, (await archivist.get(bw?.payload_hashes)).filter(exists)]\n}\n\nexport const hydrateBoundWitness = (\n archivist: ReadArchivist,\n hashOrBw: Hash | WithStorageMeta<BoundWitness>,\n): Promise<HydratedBoundWitness<BoundWitness>> => {\n return hydrateTypedBoundWitness<BoundWitness>(archivist, hashOrBw, isBoundWitnessWithStorageMeta)\n}\n"],"mappings":";AAAA,SAAS,mBAAAA,wBAAuB;;;ACChC,SAAS,uBAAuB;AAEhC,SAAS,kCAAkC;;;ACH3C,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EAAmB;AAAA,EAAiB;AAAA,EAAkB;AAAA,OACjD;;;ACDA,IAAM,0BAA0B;;;ACAhC,IAAM,4BAA4B;;;ACAlC,IAAM,6BAA6B;;;ACCnC,IAAM,6BAA6B;;;ACAnC,IAAM,0BAA0B;;;ACDhC,IAAM,6BAA6B;;;ACEnC,IAAM,2BAA2B;;;APKjC,IAAM,sBAAsB,IAAI,kBAAqC,EAAE,OAAO,EAAE,KAAK,WAAW,GAAG,CAAC,gBAAgB,CAAC;AACrH,IAAM,oBAAoB,IAAI,gBAAyC,EAAE,OAAO,CAAC,uBAAuB,CAAC;AAEzG,IAAM,oBAAoB,gBAAgB,OAAO,iBAAiB;AAClE,IAAM,sBAAsB,gBAAgB,OAAO,mBAAmB;AACtE,IAAM,sBAAsB,YAAY,OAAO,iBAAiB;AAChE,IAAM,wBAAwB,YAAY,OAAO,mBAAmB;;;ADPpE,IAAM,+CAAgE,CAAC;AAG9E,IAAM,UAAU,IAAI,gBAA6C;AAE1D,IAAM,gCAAwE,QAAQ,OAAO,8CAA8C;AAAA,EAChJ;AAAA,EACA;AACF,CAAC;;;ADZM,IAAM,gCAAgCC,iBAAgB,OAAO,6BAA6B;;;AUHjG,SAAS,mBAAAC,wBAAuB;AAmBzB,IAAM,uCAAN,cAAwHA,iBAAmB;AAAC;;;ACH5I,IAAM,wBAAwB;;;ACU9B,IAAM,iBAAiB;AAQvB,IAAM,yBAAyB,CAAC,UAA4B;AACjE,QAAM,EAAE,KAAK,OAAO,IAAI;AACxB,QAAM,SAAS,SAAS,OAAO;AAC/B,QAAM,YAAY,OAAO,KAAK,GAAG;AACjC,SAAO,GAAG,MAAM,IAAI,UAAU,KAAK,cAAc,CAAC;AACpD;;;ACxCA,SAAS,gBAAgB;AAGzB,SAAS,qCAAqC;AAMvC,IAAM,0BAA0B,OAA+B,WAA0B,MAC9F,aAA4F;AAC5F,QAAM,WAAW,MAAM,UAAU,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC;AAClD,SAAO,SAAS,OAAO,IAAI,UAAU;AACvC;AAEO,IAAM,uBAAuB,OAA+B,WAA0B,MAC3F,aAAgF;AAChF,QAAM,UAAU,UAAU,MAAM,UAAU,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,GAAG,MAAM,mCAAmC,IAAI,EAAE;AAC7G,SAAO,SAAS,SAAS,OAAO,IAAI,UAAU,QAAW,MAAM,0CAA0C,IAAI,EAAE;AACjH;AAEO,IAAM,kBAAkB,CAAC,WAA0B,SAAuD;AAC/G,SAAO,qBAAmC,WAAW,MAAM,6BAA6B;AAC1F;;;ACvBA,SAAS,cAAc;AAEvB,SAAS,cAAc;AAEvB,SAAS,iCAAAC,sCAAqC;AAQvC,IAAM,8BAA8B,OAA+B,WAA0B,UAClG,aAAiG;AACjG,QAAM,KAAK,OAAO,QAAQ,IAAI,MAAM,wBAAwB,WAAW,UAAU,QAAQ,IAAI;AAC7F,SAAO,KAAK,CAAC,KAAK,MAAM,UAAU,IAAI,IAAI,cAAc,GAAG,OAAO,MAAM,CAAC,IAAI;AAC/E;AAEO,IAAM,2BAA2B,OAA+B,WAA0B,UAC/F,aAAqF;AACrF,QAAM,KAAK,OAAO,QAAQ,IAAI,MAAM,qBAAqB,WAAW,UAAU,QAAQ,IAAI;AAC1F,SAAO,CAAC,KAAK,MAAM,UAAU,IAAI,IAAI,cAAc,GAAG,OAAO,MAAM,CAAC;AACtE;AAEO,IAAM,sBAAsB,CACjC,WACA,aACgD;AAChD,SAAO,yBAAuC,WAAW,UAAUC,8BAA6B;AAClG;","names":["AsObjectFactory","AsObjectFactory","IsObjectFactory","isBoundWitnessWithStorageMeta","isBoundWitnessWithStorageMeta"]}
@@ -0,0 +1,4 @@
1
+ import type { BoundWitness } from '@xyo-network/boundwitness-model';
2
+ import type { Payload, WithStorageMeta } from '@xyo-network/payload-model';
3
+ export type HydratedBoundWitness<T extends BoundWitness = BoundWitness, P extends Payload = Payload> = [WithStorageMeta<T>, WithStorageMeta<P>[]];
4
+ //# sourceMappingURL=HydratedBoundWitness.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HydratedBoundWitness.d.ts","sourceRoot":"","sources":["../../../src/lib/HydratedBoundWitness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAE1E,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,EAAE,CAAC,SAAS,OAAO,GAAG,OAAO,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export type IdentityFunction<T> = (value: unknown) => value is T;
2
+ //# sourceMappingURL=IdentityFunction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IdentityFunction.d.ts","sourceRoot":"","sources":["../../../src/lib/IdentityFunction.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,IAAI,CAAC,CAAA"}
@@ -0,0 +1,9 @@
1
+ import type { Hash } from '@xylabs/hex';
2
+ import type { BoundWitness } from '@xyo-network/boundwitness-model';
3
+ import type { WithStorageMeta } from '@xyo-network/payload-model';
4
+ import type { ReadArchivist } from '../PayloadArchivist.ts';
5
+ import type { IdentityFunction } from './IdentityFunction.ts';
6
+ export declare const tryGetTypedBoundWitness: <T extends BoundWitness>(archivist: ReadArchivist, hash: Hash, identity: IdentityFunction<WithStorageMeta<T>>) => Promise<WithStorageMeta<T> | undefined>;
7
+ export declare const getTypedBoundWitness: <T extends BoundWitness>(archivist: ReadArchivist, hash: Hash, identity: IdentityFunction<WithStorageMeta<T>>) => Promise<WithStorageMeta<T>>;
8
+ export declare const getBoundWitness: (archivist: ReadArchivist, hash: Hash) => Promise<WithStorageMeta<BoundWitness>>;
9
+ //# sourceMappingURL=getBoundWitness.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getBoundWitness.d.ts","sourceRoot":"","sources":["../../../src/lib/getBoundWitness.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAEnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAEjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAE7D,eAAO,MAAM,uBAAuB,GAAU,CAAC,SAAS,YAAY,EAAE,WAAW,aAAa,EAAE,MAAM,IAAI,EACxG,UAAU,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,KAAG,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,GAAG,SAAS,CAGxF,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAU,CAAC,SAAS,YAAY,EAAE,WAAW,aAAa,EAAE,MAAM,IAAI,EACrG,UAAU,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,KAAG,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAG5E,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,WAAW,aAAa,EAAE,MAAM,IAAI,KAAG,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAE3G,CAAA"}
@@ -0,0 +1,10 @@
1
+ import type { Hash } from '@xylabs/hex';
2
+ import type { BoundWitness } from '@xyo-network/boundwitness-model';
3
+ import type { WithStorageMeta } from '@xyo-network/payload-model';
4
+ import type { ReadArchivist } from '../PayloadArchivist.ts';
5
+ import type { HydratedBoundWitness } from './HydratedBoundWitness.ts';
6
+ import type { IdentityFunction } from './IdentityFunction.ts';
7
+ export declare const tryHydrateTypedBoundWitness: <T extends BoundWitness>(archivist: ReadArchivist, hashOrBw: Hash | WithStorageMeta<T>, identity: IdentityFunction<WithStorageMeta<T>>) => Promise<HydratedBoundWitness<T> | undefined>;
8
+ export declare const hydrateTypedBoundWitness: <T extends BoundWitness>(archivist: ReadArchivist, hashOrBw: Hash | WithStorageMeta<T>, identity: IdentityFunction<WithStorageMeta<T>>) => Promise<HydratedBoundWitness<T>>;
9
+ export declare const hydrateBoundWitness: (archivist: ReadArchivist, hashOrBw: Hash | WithStorageMeta<BoundWitness>) => Promise<HydratedBoundWitness<BoundWitness>>;
10
+ //# sourceMappingURL=hydrateBoundWitness.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hydrateBoundWitness.d.ts","sourceRoot":"","sources":["../../../src/lib/hydrateBoundWitness.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAEvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAEnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAEjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAE3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAE7D,eAAO,MAAM,2BAA2B,GAAU,CAAC,SAAS,YAAY,EAAE,WAAW,aAAa,EAAE,UAAU,IAAI,GAAG,eAAe,CAAC,CAAC,CAAC,EACrI,UAAU,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,KAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,GAAG,SAAS,CAG7F,CAAA;AAED,eAAO,MAAM,wBAAwB,GAAU,CAAC,SAAS,YAAY,EAAE,WAAW,aAAa,EAAE,UAAU,IAAI,GAAG,eAAe,CAAC,CAAC,CAAC,EAClI,UAAU,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,KAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAGjF,CAAA;AAED,eAAO,MAAM,mBAAmB,GAC9B,WAAW,aAAa,EACxB,UAAU,IAAI,GAAG,eAAe,CAAC,YAAY,CAAC,KAC7C,OAAO,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAE5C,CAAA"}
@@ -0,0 +1,5 @@
1
+ export * from './getBoundWitness.ts';
2
+ export * from './hydrateBoundWitness.ts';
3
+ export * from './HydratedBoundWitness.ts';
4
+ export * from './IdentityFunction.ts';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA"}