@xyo-network/module-mongodb 5.3.25 → 5.3.27

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 (2) hide show
  1. package/README.md +1301 -10
  2. package/package.json +17 -31
package/README.md CHANGED
@@ -1,23 +1,1314 @@
1
+ [![logo][]](https://xyo.network)
2
+
1
3
  # @xyo-network/module-mongodb
2
4
 
3
- [![logo][]](https://xyo.network)
5
+ [![npm][npm-badge]][npm-link]
6
+ [![license][license-badge]][license-link]
7
+
8
+ > Primary SDK for using XYO Protocol 2.0
9
+
10
+ ## Install
11
+
12
+ Using npm:
13
+
14
+ ```sh
15
+ npm install {{name}}
16
+ ```
17
+
18
+ Using yarn:
4
19
 
5
- Version: 5.0.2
20
+ ```sh
21
+ yarn add {{name}}
22
+ ```
6
23
 
7
- Primary SDK for using XYO Protocol 2.0
24
+ Using pnpm:
8
25
 
9
- ## Documentation
26
+ ```sh
27
+ pnpm add {{name}}
28
+ ```
10
29
 
11
- [TypeDoc Generated Documentation](https://gitbook.xyo.network/xyo-data-lab/xyo-reference/package-documentation/xyo-network__module-mongodb)
30
+ Using bun:
31
+
32
+ ```sh
33
+ bun add {{name}}
34
+ ```
12
35
 
13
- Part of [sdk-xyo-client-js](https://www.npmjs.com/package/@xyo-network/sdk-xyo-client-js)
14
36
 
15
37
  ## License
16
38
 
17
- > See the [LICENSE](LICENSE) file for license details
39
+ See the [LICENSE](LICENSE) file for license rights and limitations (LGPL-3.0-only).
40
+
41
+ ## Reference
42
+
43
+ ### packages
44
+
45
+ ### modules
46
+
47
+ ### packages
48
+
49
+ ### module
50
+
51
+ ### packages
52
+
53
+ ### mongodb
54
+
55
+ ### .temp-typedoc
56
+
57
+ ### functions
58
+
59
+ ### <a id="boundWitnessFromDbRepresentation"></a>boundWitnessFromDbRepresentation
60
+
61
+ [**@xyo-network/module-mongodb**](#../README)
62
+
63
+ ***
64
+
65
+ ```ts
66
+ function boundWitnessFromDbRepresentation<T>(value): WithStorageMeta<T>;
67
+ ```
68
+
69
+ ## Type Parameters
70
+
71
+ ### T
72
+
73
+ `T` *extends* `object` = \{
74
+ `schema`: `"network.xyo.boundwitness"` & `object`;
75
+ `addresses`: `Lowercase`\<`string`\> & `object` & `object`[];
76
+ `payload_hashes`: `BrandedHash`[];
77
+ `payload_schemas`: `BrandedSchema`\<`string`\>[];
78
+ `previous_hashes`: (`BrandedHash` \| `null`)[];
79
+ `$destination?`: `Lowercase`\<`string`\> & `object` & `object`;
80
+ `$sourceQuery?`: `BrandedHash`;
81
+ `$signatures`: (`BrandedHex` \| `null`)[];
82
+ \}
83
+
84
+ ## Parameters
85
+
86
+ ### value
87
+
88
+ [`BoundWitnessWithMongoMeta`](#../type-aliases/BoundWitnessWithMongoMeta)\<`T`\>
89
+
90
+ ## Returns
91
+
92
+ `WithStorageMeta`\<`T`\>
93
+
94
+ ### <a id="fromDbRepresentation"></a>fromDbRepresentation
95
+
96
+ [**@xyo-network/module-mongodb**](#../README)
97
+
98
+ ***
99
+
100
+ ```ts
101
+ function fromDbRepresentation<T>(value): WithStorageMeta<T>;
102
+ ```
103
+
104
+ ## Type Parameters
105
+
106
+ ### T
107
+
108
+ `T` *extends* `Payload` = `Payload`
109
+
110
+ ## Parameters
111
+
112
+ ### value
113
+
114
+ [`PayloadWithMongoMeta`](#../type-aliases/PayloadWithMongoMeta)\<`T`\>
115
+
116
+ ## Returns
117
+
118
+ `WithStorageMeta`\<`T`\>
119
+
120
+ ### <a id="payloadFromDbRepresentation"></a>payloadFromDbRepresentation
121
+
122
+ [**@xyo-network/module-mongodb**](#../README)
123
+
124
+ ***
125
+
126
+ ```ts
127
+ function payloadFromDbRepresentation<T>(value): WithStorageMeta<T>;
128
+ ```
129
+
130
+ ## Type Parameters
131
+
132
+ ### T
133
+
134
+ `T` *extends* `Payload` = \{
135
+ \[`key`: `string`\]: `unknown`;
136
+ `schema`: `BrandedSchema`\<`string`\>;
137
+ \}
138
+
139
+ ## Parameters
140
+
141
+ ### value
142
+
143
+ [`PayloadWithMongoMeta`](#../type-aliases/PayloadWithMongoMeta)\<`T`\>
144
+
145
+ ## Returns
146
+
147
+ `WithStorageMeta`\<`T`\>
148
+
149
+ ### interfaces
150
+
151
+ ### <a id="MongoDBModule"></a>MongoDBModule
152
+
153
+ [**@xyo-network/module-mongodb**](#../README)
154
+
155
+ ***
156
+
157
+ ## Accessors
158
+
159
+ ### boundWitnessSdkConfig
160
+
161
+ ### Get Signature
162
+
163
+ ```ts
164
+ get boundWitnessSdkConfig(): BaseMongoSdkConfig;
165
+ ```
166
+
167
+ #### Returns
168
+
169
+ `BaseMongoSdkConfig`
170
+
171
+ ***
172
+
173
+ ### boundWitnesses
174
+
175
+ ### Get Signature
176
+
177
+ ```ts
178
+ get boundWitnesses(): BaseMongoSdk<BoundWitnessWithMongoMeta>;
179
+ ```
180
+
181
+ #### Returns
182
+
183
+ `BaseMongoSdk`\<[`BoundWitnessWithMongoMeta`](#../type-aliases/BoundWitnessWithMongoMeta)\>
184
+
185
+ ***
186
+
187
+ ### payloadSdkConfig
188
+
189
+ ### Get Signature
190
+
191
+ ```ts
192
+ get payloadSdkConfig(): BaseMongoSdkConfig;
193
+ ```
194
+
195
+ #### Returns
196
+
197
+ `BaseMongoSdkConfig`
198
+
199
+ ***
200
+
201
+ ### payloads
202
+
203
+ ### Get Signature
204
+
205
+ ```ts
206
+ get payloads(): BaseMongoSdk<PayloadWithMongoMeta>;
207
+ ```
208
+
209
+ #### Returns
210
+
211
+ `BaseMongoSdk`\<[`PayloadWithMongoMeta`](#../type-aliases/PayloadWithMongoMeta)\>
212
+
213
+ ### <a id="MongoDBModuleParams"></a>MongoDBModuleParams
214
+
215
+ [**@xyo-network/module-mongodb**](#../README)
216
+
217
+ ***
218
+
219
+ ## Extends
220
+
221
+ - `QueryableModuleParams`\<`AnyConfigSchema`\<[`MongoDBModuleConfig`](#../type-aliases/MongoDBModuleConfig)\>\>
222
+
223
+ ## Properties
224
+
225
+ ### account?
226
+
227
+ ```ts
228
+ optional account?: AccountInstance | "random";
229
+ ```
230
+
231
+ ### Inherited from
232
+
233
+ [`MongoDBModuleParamsV2`](#MongoDBModuleParamsV2).[`account`](MongoDBModuleParamsV2.md#account)
234
+
235
+ ***
236
+
237
+ ### addToResolvers?
238
+
239
+ ```ts
240
+ optional addToResolvers?: boolean;
241
+ ```
242
+
243
+ ### Inherited from
244
+
245
+ [`MongoDBModuleParamsV2`](#MongoDBModuleParamsV2).[`addToResolvers`](MongoDBModuleParamsV2.md#addtoresolvers)
246
+
247
+ ***
248
+
249
+ ### additionalSigners?
250
+
251
+ ```ts
252
+ optional additionalSigners?: AccountInstance[];
253
+ ```
254
+
255
+ ### Inherited from
256
+
257
+ [`MongoDBModuleParamsV2`](#MongoDBModuleParamsV2).[`additionalSigners`](MongoDBModuleParamsV2.md#additionalsigners)
258
+
259
+ ***
260
+
261
+ ### allowNameResolution?
262
+
263
+ ```ts
264
+ optional allowNameResolution?: boolean;
265
+ ```
266
+
267
+ ### Inherited from
268
+
269
+ [`MongoDBModuleParamsV2`](#MongoDBModuleParamsV2).[`allowNameResolution`](MongoDBModuleParamsV2.md#allownameresolution)
270
+
271
+ ***
272
+
273
+ ### config
274
+
275
+ ```ts
276
+ config: Partial<TConfig>;
277
+ ```
278
+
279
+ ### Inherited from
280
+
281
+ ```ts
282
+ QueryableModuleParams.config
283
+ ```
284
+
285
+ ***
286
+
287
+ ### ephemeralQueryAccountEnabled?
288
+
289
+ ```ts
290
+ optional ephemeralQueryAccountEnabled?: boolean;
291
+ ```
292
+
293
+ ### Inherited from
294
+
295
+ [`MongoDBModuleParamsV2`](#MongoDBModuleParamsV2).[`ephemeralQueryAccountEnabled`](MongoDBModuleParamsV2.md#ephemeralqueryaccountenabled)
296
+
297
+ ***
298
+
299
+ ### moduleIdentifierTransformers?
300
+
301
+ ```ts
302
+ optional moduleIdentifierTransformers?: ModuleIdentifierTransformer[];
303
+ ```
304
+
305
+ ### Inherited from
306
+
307
+ [`MongoDBModuleParamsV2`](#MongoDBModuleParamsV2).[`moduleIdentifierTransformers`](MongoDBModuleParamsV2.md#moduleidentifiertransformers)
308
+
309
+ ***
310
+
311
+ ### statusReporter?
312
+
313
+ ```ts
314
+ optional statusReporter?: ModuleStatusReporter;
315
+ ```
316
+
317
+ Optional reporter for broadcasting status changes.
318
+
319
+ ### Inherited from
320
+
321
+ [`MongoDBModuleParamsV2`](#MongoDBModuleParamsV2).[`statusReporter`](MongoDBModuleParamsV2.md#statusreporter)
322
+
323
+ ***
324
+
325
+ ### boundWitnessSdkConfig?
326
+
327
+ ```ts
328
+ optional boundWitnessSdkConfig?: BaseMongoSdkPrivateConfig & Partial<BaseMongoSdkPublicConfig>;
329
+ ```
330
+
331
+ ***
332
+
333
+ ### jobQueue?
334
+
335
+ ```ts
336
+ optional jobQueue?: JobQueue;
337
+ ```
338
+
339
+ ***
340
+
341
+ ### payloadSdkConfig?
342
+
343
+ ```ts
344
+ optional payloadSdkConfig?: BaseMongoSdkPrivateConfig & Partial<BaseMongoSdkPublicConfig>;
345
+ ```
346
+
347
+ ### <a id="MongoDBModuleParamsV2"></a>MongoDBModuleParamsV2
348
+
349
+ [**@xyo-network/module-mongodb**](#../README)
350
+
351
+ ***
352
+
353
+ ## Extends
354
+
355
+ - `QueryableModuleParams`\<`TConfig`\>
356
+
357
+ ## Type Parameters
358
+
359
+ ### TConfig
360
+
361
+ `TConfig` *extends* `AnyConfigSchema`\<[`MongoDBModuleConfigV2`](#../type-aliases/MongoDBModuleConfigV2)\> = `AnyConfigSchema`\<[`MongoDBModuleConfigV2`](#../type-aliases/MongoDBModuleConfigV2)\>
362
+
363
+ ## Properties
364
+
365
+ ### account?
366
+
367
+ ```ts
368
+ optional account?: AccountInstance | "random";
369
+ ```
370
+
371
+ ### Inherited from
372
+
373
+ ```ts
374
+ QueryableModuleParams.account
375
+ ```
376
+
377
+ ***
378
+
379
+ ### addToResolvers?
380
+
381
+ ```ts
382
+ optional addToResolvers?: boolean;
383
+ ```
384
+
385
+ ### Inherited from
386
+
387
+ ```ts
388
+ QueryableModuleParams.addToResolvers
389
+ ```
390
+
391
+ ***
392
+
393
+ ### additionalSigners?
394
+
395
+ ```ts
396
+ optional additionalSigners?: AccountInstance[];
397
+ ```
398
+
399
+ ### Inherited from
400
+
401
+ ```ts
402
+ QueryableModuleParams.additionalSigners
403
+ ```
404
+
405
+ ***
406
+
407
+ ### allowNameResolution?
408
+
409
+ ```ts
410
+ optional allowNameResolution?: boolean;
411
+ ```
412
+
413
+ ### Inherited from
414
+
415
+ ```ts
416
+ QueryableModuleParams.allowNameResolution
417
+ ```
418
+
419
+ ***
420
+
421
+ ### config
422
+
423
+ ```ts
424
+ config: Partial<TConfig>;
425
+ ```
426
+
427
+ ### Inherited from
428
+
429
+ ```ts
430
+ QueryableModuleParams.config
431
+ ```
432
+
433
+ ***
434
+
435
+ ### ephemeralQueryAccountEnabled?
436
+
437
+ ```ts
438
+ optional ephemeralQueryAccountEnabled?: boolean;
439
+ ```
440
+
441
+ ### Inherited from
442
+
443
+ ```ts
444
+ QueryableModuleParams.ephemeralQueryAccountEnabled
445
+ ```
446
+
447
+ ***
448
+
449
+ ### moduleIdentifierTransformers?
450
+
451
+ ```ts
452
+ optional moduleIdentifierTransformers?: ModuleIdentifierTransformer[];
453
+ ```
454
+
455
+ ### Inherited from
456
+
457
+ ```ts
458
+ QueryableModuleParams.moduleIdentifierTransformers
459
+ ```
460
+
461
+ ***
462
+
463
+ ### statusReporter?
464
+
465
+ ```ts
466
+ optional statusReporter?: ModuleStatusReporter;
467
+ ```
468
+
469
+ Optional reporter for broadcasting status changes.
470
+
471
+ ### Inherited from
472
+
473
+ ```ts
474
+ QueryableModuleParams.statusReporter
475
+ ```
476
+
477
+ ***
478
+
479
+ ### jobQueue?
480
+
481
+ ```ts
482
+ optional jobQueue?: JobQueue;
483
+ ```
484
+
485
+ ***
486
+
487
+ ### payloadSdkConfig?
488
+
489
+ ```ts
490
+ optional payloadSdkConfig?: BaseMongoSdkPrivateConfig & Partial<BaseMongoSdkPublicConfig>;
491
+ ```
492
+
493
+ ### <a id="MongoDBModuleStatic"></a>MongoDBModuleStatic
494
+
495
+ [**@xyo-network/module-mongodb**](#../README)
496
+
497
+ ***
498
+
499
+ ## Type Parameters
500
+
501
+ ### T
502
+
503
+ `T` *extends* [`MongoDBStorageClassLabels`](#MongoDBStorageClassLabels) = [`MongoDBStorageClassLabels`](#MongoDBStorageClassLabels)
504
+
505
+ ## Properties
506
+
507
+ ### labels
508
+
509
+ ```ts
510
+ labels: T;
511
+ ```
512
+
513
+ ### <a id="MongoDBModuleV2"></a>MongoDBModuleV2
514
+
515
+ [**@xyo-network/module-mongodb**](#../README)
516
+
517
+ ***
518
+
519
+ ## Accessors
520
+
521
+ ### payloadSdkConfig
522
+
523
+ ### Get Signature
524
+
525
+ ```ts
526
+ get payloadSdkConfig(): BaseMongoSdkConfig;
527
+ ```
528
+
529
+ #### Returns
530
+
531
+ `BaseMongoSdkConfig`
532
+
533
+ ***
534
+
535
+ ### payloads
536
+
537
+ ### Get Signature
538
+
539
+ ```ts
540
+ get payloads(): BaseMongoSdk<PayloadWithMongoMeta>;
541
+ ```
542
+
543
+ #### Returns
544
+
545
+ `BaseMongoSdk`\<[`PayloadWithMongoMeta`](#../type-aliases/PayloadWithMongoMeta)\>
546
+
547
+ ### <a id="MongoDBStorageClassLabels"></a>MongoDBStorageClassLabels
548
+
549
+ [**@xyo-network/module-mongodb**](#../README)
550
+
551
+ ***
552
+
553
+ ## Extends
554
+
555
+ - `Labels`
556
+
557
+ ## Indexable
558
+
559
+ ```ts
560
+ [key: string]: string | undefined
561
+ ```
562
+
563
+ ## Properties
564
+
565
+ ### network.xyo.storage.class
566
+
567
+ ```ts
568
+ network.xyo.storage.class: "mongodb";
569
+ ```
570
+
571
+ ### <a id="PayloadMongoMeta"></a>PayloadMongoMeta
572
+
573
+ [**@xyo-network/module-mongodb**](#../README)
574
+
575
+ ***
576
+
577
+ ## Extends
578
+
579
+ - `StorageMeta`
580
+
581
+ ## Properties
582
+
583
+ ### \_hash
584
+
585
+ ```ts
586
+ _hash: BrandedHash;
587
+ ```
588
+
589
+ ### Inherited from
590
+
591
+ ```ts
592
+ StorageMeta._hash
593
+ ```
594
+
595
+ ***
596
+
597
+ ### \_dataHash
598
+
599
+ ```ts
600
+ _dataHash: BrandedHash;
601
+ ```
602
+
603
+ ### Inherited from
604
+
605
+ ```ts
606
+ StorageMeta._dataHash
607
+ ```
608
+
609
+ ***
610
+
611
+ ### \_sequence
612
+
613
+ ```ts
614
+ _sequence: LocalSequence | QualifiedSequence;
615
+ ```
616
+
617
+ ### Inherited from
618
+
619
+ ```ts
620
+ StorageMeta._sequence
621
+ ```
622
+
623
+ ***
624
+
625
+ ### \_\_archive?
626
+
627
+ ```ts
628
+ optional __archive?: string;
629
+ ```
630
+
631
+ ***
632
+
633
+ ### \_\_client?
634
+
635
+ ```ts
636
+ optional __client?: string;
637
+ ```
638
+
639
+ ***
640
+
641
+ ### \_\_observeDuration?
642
+
643
+ ```ts
644
+ optional __observeDuration?: number;
645
+ ```
646
+
647
+ ***
648
+
649
+ ### \_\_schemaValid?
650
+
651
+ ```ts
652
+ optional __schemaValid?: boolean;
653
+ ```
654
+
655
+ ***
656
+
657
+ ### \_\_sources?
658
+
659
+ ```ts
660
+ optional __sources?: Payload[];
661
+ ```
662
+
663
+ ***
664
+
665
+ ### \_\_timestamp
666
+
667
+ ```ts
668
+ __timestamp: number;
669
+ ```
670
+
671
+ ***
672
+
673
+ ### \_\_user\_agent?
674
+
675
+ ```ts
676
+ optional __user_agent?: string;
677
+ ```
678
+
679
+ ### type-aliases
680
+
681
+ ### <a id="BoundWitnessMongoMeta"></a>BoundWitnessMongoMeta
682
+
683
+ [**@xyo-network/module-mongodb**](#../README)
684
+
685
+ ***
686
+
687
+ ```ts
688
+ type BoundWitnessMongoMeta<P> = PayloadWithMongoMeta<P & object>;
689
+ ```
690
+
691
+ ## Type Parameters
692
+
693
+ ### P
694
+
695
+ `P` *extends* `Payload` = `Payload`
696
+
697
+ ### <a id="BoundWitnessWithMongoMeta"></a>BoundWitnessWithMongoMeta
698
+
699
+ [**@xyo-network/module-mongodb**](#../README)
700
+
701
+ ***
702
+
703
+ ```ts
704
+ type BoundWitnessWithMongoMeta<T, P> = T & BoundWitnessMongoMeta<P>;
705
+ ```
706
+
707
+ ## Type Parameters
708
+
709
+ ### T
710
+
711
+ `T` *extends* `BoundWitness` = `BoundWitness`
712
+
713
+ ### P
714
+
715
+ `P` *extends* [`PayloadWithPartialMongoMeta`](#PayloadWithPartialMongoMeta)\<`T`\> = [`PayloadWithPartialMongoMeta`](#PayloadWithPartialMongoMeta)\<`T`\>
716
+
717
+ ### <a id="BoundWitnessWithPartialMongoMeta"></a>BoundWitnessWithPartialMongoMeta
718
+
719
+ [**@xyo-network/module-mongodb**](#../README)
720
+
721
+ ***
722
+
723
+ ```ts
724
+ type BoundWitnessWithPartialMongoMeta<T, P> = T & Partial<BoundWitnessMongoMeta<P>>;
725
+ ```
726
+
727
+ ## Type Parameters
728
+
729
+ ### T
730
+
731
+ `T` *extends* `BoundWitness` = `BoundWitness`
732
+
733
+ ### P
734
+
735
+ `P` *extends* [`PayloadWithPartialMongoMeta`](#PayloadWithPartialMongoMeta)\<`T`\> = [`PayloadWithPartialMongoMeta`](#PayloadWithPartialMongoMeta)\<`T`\>
736
+
737
+ ### <a id="CollectionIndexFunction"></a>CollectionIndexFunction
738
+
739
+ [**@xyo-network/module-mongodb**](#../README)
740
+
741
+ ***
742
+
743
+ ```ts
744
+ type CollectionIndexFunction = (collectionName) => IndexDescription[];
745
+ ```
746
+
747
+ ## Parameters
748
+
749
+ ### collectionName
750
+
751
+ `string`
752
+
753
+ ## Returns
754
+
755
+ `IndexDescription`[]
756
+
757
+ ### <a id="IndexDescription"></a>IndexDescription
758
+
759
+ [**@xyo-network/module-mongodb**](#../README)
760
+
761
+ ***
762
+
763
+ ```ts
764
+ type IndexDescription = object;
765
+ ```
766
+
767
+ Description of index(es) to be created on a store
768
+
769
+ ## Properties
770
+
771
+ ### key
772
+
773
+ ```ts
774
+ key:
775
+ | {
776
+ [key: string]: IndexDirection;
777
+ }
778
+ | Map<string, IndexDirection>;
779
+ ```
780
+
781
+ The key(s) to index
782
+
783
+ ***
784
+
785
+ ### name?
786
+
787
+ ```ts
788
+ optional name?: string;
789
+ ```
790
+
791
+ The name of the index
792
+
793
+ ***
794
+
795
+ ### unique?
796
+
797
+ ```ts
798
+ optional unique?: boolean;
799
+ ```
800
+
801
+ If true, the index must enforce uniqueness on the key
802
+
803
+ ### <a id="IndexDirection"></a>IndexDirection
804
+
805
+ [**@xyo-network/module-mongodb**](#../README)
806
+
807
+ ***
808
+
809
+ ```ts
810
+ type IndexDirection = -1 | 1;
811
+ ```
812
+
813
+ The index direction (1 for ascending, -1 for descending)
814
+
815
+ ### <a id="MongoDBModuleConfig"></a>MongoDBModuleConfig
816
+
817
+ [**@xyo-network/module-mongodb**](#../README)
818
+
819
+ ***
820
+
821
+ ```ts
822
+ type MongoDBModuleConfig = ModuleConfig<{
823
+ boundWitnessSdkConfig?: Partial<BaseMongoSdkPublicConfig>;
824
+ payloadSdkConfig?: Partial<BaseMongoSdkPublicConfig>;
825
+ schema: MongoDBModuleConfigSchema;
826
+ }>;
827
+ ```
828
+
829
+ ### <a id="MongoDBModuleConfigSchema"></a>MongoDBModuleConfigSchema
830
+
831
+ [**@xyo-network/module-mongodb**](#../README)
832
+
833
+ ***
834
+
835
+ ```ts
836
+ type MongoDBModuleConfigSchema = typeof MongoDBModuleConfigSchema;
837
+ ```
838
+
839
+ ### <a id="MongoDBModuleConfigV2"></a>MongoDBModuleConfigV2
840
+
841
+ [**@xyo-network/module-mongodb**](#../README)
842
+
843
+ ***
844
+
845
+ ```ts
846
+ type MongoDBModuleConfigV2 = ModuleConfig<{
847
+ max?: number;
848
+ payloadSdkConfig?: Partial<BaseMongoSdkPublicConfig>;
849
+ schema: MongoDBModuleConfigSchema;
850
+ }>;
851
+ ```
852
+
853
+ ### <a id="MongoDbConnectionStringEnvVar"></a>MongoDbConnectionStringEnvVar
854
+
855
+ [**@xyo-network/module-mongodb**](#../README)
856
+
857
+ ***
858
+
859
+ ```ts
860
+ type MongoDbConnectionStringEnvVar = "MONGO_CONNECTION_STRING";
861
+ ```
862
+
863
+ ### <a id="MongoDbEnvVars"></a>MongoDbEnvVars
864
+
865
+ [**@xyo-network/module-mongodb**](#../README)
866
+
867
+ ***
868
+
869
+ ```ts
870
+ type MongoDbEnvVars = "MONGO_DATABASE" | "MONGO_DOMAIN" | "MONGO_PASSWORD" | "MONGO_USERNAME";
871
+ ```
872
+
873
+ ### <a id="MongoEnv"></a>MongoEnv
874
+
875
+ [**@xyo-network/module-mongodb**](#../README)
876
+
877
+ ***
878
+
879
+ ```ts
880
+ type MongoEnv = Record<
881
+ | MongoDbEnvVars
882
+ | MongoDbConnectionStringEnvVar, string | undefined>;
883
+ ```
884
+
885
+ ### <a id="PayloadWithMongoMeta"></a>PayloadWithMongoMeta
886
+
887
+ [**@xyo-network/module-mongodb**](#../README)
888
+
889
+ ***
890
+
891
+ ```ts
892
+ type PayloadWithMongoMeta<T> = T & PayloadMongoMeta;
893
+ ```
894
+
895
+ ## Type Parameters
896
+
897
+ ### T
898
+
899
+ `T` *extends* `Payload` = `Payload`
900
+
901
+ ### <a id="PayloadWithPartialMongoMeta"></a>PayloadWithPartialMongoMeta
902
+
903
+ [**@xyo-network/module-mongodb**](#../README)
904
+
905
+ ***
906
+
907
+ ```ts
908
+ type PayloadWithPartialMongoMeta<T> = T & Partial<PayloadMongoMeta>;
909
+ ```
910
+
911
+ ## Type Parameters
912
+
913
+ ### T
914
+
915
+ `T` *extends* `Payload` = `Payload`
916
+
917
+ ### variables
918
+
919
+ ### <a id="COLLECTIONS"></a>COLLECTIONS
920
+
921
+ [**@xyo-network/module-mongodb**](#../README)
922
+
923
+ ***
924
+
925
+ ```ts
926
+ const COLLECTIONS: object;
927
+ ```
928
+
929
+ ## Type Declaration
930
+
931
+ ### AddressInfo
932
+
933
+ ```ts
934
+ AddressInfo: "address_info";
935
+ ```
936
+
937
+ ### ArchivistStats
938
+
939
+ ```ts
940
+ ArchivistStats: "archivist_stats";
941
+ ```
942
+
943
+ ### BoundWitnesses
944
+
945
+ ```ts
946
+ BoundWitnesses: "bound_witnesses";
947
+ ```
948
+
949
+ ### Payloads
950
+
951
+ ```ts
952
+ Payloads: "payloads";
953
+ ```
954
+
955
+ ### Thumbnails
956
+
957
+ ```ts
958
+ Thumbnails: "thumbnails";
959
+ ```
960
+
961
+ ### Users
962
+
963
+ ```ts
964
+ Users: "users";
965
+ ```
966
+
967
+ ### <a id="DATABASES"></a>DATABASES
968
+
969
+ [**@xyo-network/module-mongodb**](#../README)
970
+
971
+ ***
972
+
973
+ ```ts
974
+ const DATABASES: object;
975
+ ```
976
+
977
+ ## Type Declaration
978
+
979
+ ### Archivist
980
+
981
+ ```ts
982
+ Archivist: "archivist";
983
+ ```
984
+
985
+ ### <a id="DefaultAggregateTimeoutMs"></a>DefaultAggregateTimeoutMs
986
+
987
+ [**@xyo-network/module-mongodb**](#../README)
988
+
989
+ ***
990
+
991
+ ```ts
992
+ const DefaultAggregateTimeoutMs: 10000 = 10000;
993
+ ```
994
+
995
+ ### <a id="DefaultLimit"></a>DefaultLimit
996
+
997
+ [**@xyo-network/module-mongodb**](#../README)
998
+
999
+ ***
1000
+
1001
+ ```ts
1002
+ const DefaultLimit: 20 = 20;
1003
+ ```
1004
+
1005
+ ### <a id="DefaultMaxTimeMS"></a>DefaultMaxTimeMS
1006
+
1007
+ [**@xyo-network/module-mongodb**](#../README)
1008
+
1009
+ ***
1010
+
1011
+ ```ts
1012
+ const DefaultMaxTimeMS: 2000 = 2000;
1013
+ ```
1014
+
1015
+ ### <a id="DefaultOrder"></a>DefaultOrder
1016
+
1017
+ [**@xyo-network/module-mongodb**](#../README)
1018
+
1019
+ ***
1020
+
1021
+ ```ts
1022
+ const DefaultOrder: "desc" = "desc";
1023
+ ```
1024
+
1025
+ ### <a id="MongoDBModuleConfigSchema"></a>MongoDBModuleConfigSchema
1026
+
1027
+ [**@xyo-network/module-mongodb**](#../README)
1028
+
1029
+ ***
1030
+
1031
+ ```ts
1032
+ const MongoDBModuleConfigSchema: "network.xyo.module.mongodb.config" & object;
1033
+ ```
1034
+
1035
+ ## Type Declaration
1036
+
1037
+ ### \_\_schema
1038
+
1039
+ ```ts
1040
+ readonly __schema: true;
1041
+ ```
1042
+
1043
+ ### <a id="MongoDBModuleMixin"></a>MongoDBModuleMixin
1044
+
1045
+ [**@xyo-network/module-mongodb**](#../README)
1046
+
1047
+ ***
1048
+
1049
+ ```ts
1050
+ const MongoDBModuleMixin: <TParams, TModule>(ModuleBase) => (...args) => object & object & TModule;
1051
+ ```
1052
+
1053
+ ## Type Parameters
1054
+
1055
+ ### TParams
1056
+
1057
+ `TParams` *extends* [`MongoDBModuleParams`](#../interfaces/MongoDBModuleParams) = [`MongoDBModuleParams`](#../interfaces/MongoDBModuleParams)
1058
+
1059
+ ### TModule
1060
+
1061
+ `TModule` *extends* `AnyAbstractModule`\<`TParams`\> = `AnyAbstractModule`\<`TParams`\>
1062
+
1063
+ ## Parameters
1064
+
1065
+ ### ModuleBase
1066
+
1067
+ `TModule`
1068
+
1069
+ ## Returns
1070
+
1071
+ (...`args`) => `object` & `object` & `TModule`
1072
+
1073
+ ### <a id="MongoDBModuleMixinV2"></a>MongoDBModuleMixinV2
1074
+
1075
+ [**@xyo-network/module-mongodb**](#../README)
1076
+
1077
+ ***
1078
+
1079
+ ```ts
1080
+ const MongoDBModuleMixinV2: <TParams, TModule>(ModuleBase) => (...args) => object & object & TModule;
1081
+ ```
1082
+
1083
+ ## Type Parameters
1084
+
1085
+ ### TParams
1086
+
1087
+ `TParams` *extends* [`MongoDBModuleParamsV2`](#../interfaces/MongoDBModuleParamsV2) = [`MongoDBModuleParamsV2`](#../interfaces/MongoDBModuleParamsV2)
1088
+
1089
+ ### TModule
1090
+
1091
+ `TModule` *extends* `AnyAbstractModule`\<`TParams`\> = `AnyAbstractModule`\<`TParams`\>
1092
+
1093
+ ## Parameters
1094
+
1095
+ ### ModuleBase
1096
+
1097
+ `TModule`
1098
+
1099
+ ## Returns
1100
+
1101
+ (...`args`) => `object` & `object` & `TModule`
1102
+
1103
+ ### <a id="MongoDBStorageClassLabels"></a>MongoDBStorageClassLabels
1104
+
1105
+ [**@xyo-network/module-mongodb**](#../README)
1106
+
1107
+ ***
1108
+
1109
+ ```ts
1110
+ MongoDBStorageClassLabels: MongoDBStorageClassLabels;
1111
+ ```
1112
+
1113
+ ### <a id="boundWitnessToDbRepresentation"></a>boundWitnessToDbRepresentation
1114
+
1115
+ [**@xyo-network/module-mongodb**](#../README)
1116
+
1117
+ ***
1118
+
1119
+ ```ts
1120
+ const boundWitnessToDbRepresentation: <T>(bw) => BoundWitnessMongoMeta<WithStorageMeta<T>>;
1121
+ ```
1122
+
1123
+ ## Type Parameters
1124
+
1125
+ ### T
1126
+
1127
+ `T` *extends* `BoundWitness`
1128
+
1129
+ ## Parameters
1130
+
1131
+ ### bw
1132
+
1133
+ `WithStorageMeta`\<`T`\>
1134
+
1135
+ ## Returns
1136
+
1137
+ [`BoundWitnessMongoMeta`](#../type-aliases/BoundWitnessMongoMeta)\<`WithStorageMeta`\<`T`\>\>
1138
+
1139
+ ### <a id="escapeChar"></a>escapeChar
1140
+
1141
+ [**@xyo-network/module-mongodb**](#../README)
1142
+
1143
+ ***
1144
+
1145
+ ```ts
1146
+ const escapeChar: "#" = "#";
1147
+ ```
1148
+
1149
+ ### <a id="fromDbProperty"></a>fromDbProperty
1150
+
1151
+ [**@xyo-network/module-mongodb**](#../README)
1152
+
1153
+ ***
1154
+
1155
+ ```ts
1156
+ const fromDbProperty: (value) => string;
1157
+ ```
1158
+
1159
+ ## Parameters
1160
+
1161
+ ### value
1162
+
1163
+ `string`
1164
+
1165
+ ## Returns
1166
+
1167
+ `string`
1168
+
1169
+ ### <a id="getBaseMongoSdk"></a>getBaseMongoSdk
1170
+
1171
+ [**@xyo-network/module-mongodb**](#../README)
1172
+
1173
+ ***
1174
+
1175
+ ```ts
1176
+ const getBaseMongoSdk: <T>(collection) => BaseMongoSdk<T>;
1177
+ ```
1178
+
1179
+ ## Type Parameters
1180
+
1181
+ ### T
1182
+
1183
+ `T` *extends* `Document`
1184
+
1185
+ ## Parameters
1186
+
1187
+ ### collection
1188
+
1189
+ `string`
1190
+
1191
+ ## Returns
1192
+
1193
+ `BaseMongoSdk`\<`T`\>
1194
+
1195
+ ### <a id="getBaseMongoSdkPrivateConfig"></a>getBaseMongoSdkPrivateConfig
1196
+
1197
+ [**@xyo-network/module-mongodb**](#../README)
1198
+
1199
+ ***
1200
+
1201
+ ```ts
1202
+ const getBaseMongoSdkPrivateConfig: () => BaseMongoSdkPrivateConfig;
1203
+ ```
1204
+
1205
+ ## Returns
1206
+
1207
+ `BaseMongoSdkPrivateConfig`
1208
+
1209
+ ### <a id="getMongoDBConfig"></a>getMongoDBConfig
1210
+
1211
+ [**@xyo-network/module-mongodb**](#../README)
1212
+
1213
+ ***
1214
+
1215
+ ```ts
1216
+ const getMongoDBConfig: () => MongoEnv;
1217
+ ```
1218
+
1219
+ ## Returns
1220
+
1221
+ [`MongoEnv`](#../type-aliases/MongoEnv)
1222
+
1223
+ ### <a id="hasMongoDBConfig"></a>hasMongoDBConfig
1224
+
1225
+ [**@xyo-network/module-mongodb**](#../README)
1226
+
1227
+ ***
1228
+
1229
+ ```ts
1230
+ const hasMongoDBConfig: () => boolean;
1231
+ ```
1232
+
1233
+ ## Returns
1234
+
1235
+ `boolean`
1236
+
1237
+ ### <a id="payloadToDbRepresentation"></a>payloadToDbRepresentation
1238
+
1239
+ [**@xyo-network/module-mongodb**](#../README)
1240
+
1241
+ ***
1242
+
1243
+ ```ts
1244
+ const payloadToDbRepresentation: <T>(payload) => PayloadWithMongoMeta<WithStorageMeta<T>>;
1245
+ ```
1246
+
1247
+ ## Type Parameters
1248
+
1249
+ ### T
1250
+
1251
+ `T` *extends* `Payload`
1252
+
1253
+ ## Parameters
1254
+
1255
+ ### payload
1256
+
1257
+ `WithStorageMeta`\<`T`\>
1258
+
1259
+ ## Returns
1260
+
1261
+ [`PayloadWithMongoMeta`](#../type-aliases/PayloadWithMongoMeta)\<`WithStorageMeta`\<`T`\>\>
1262
+
1263
+ ### <a id="toDbProperty"></a>toDbProperty
1264
+
1265
+ [**@xyo-network/module-mongodb**](#../README)
1266
+
1267
+ ***
1268
+
1269
+ ```ts
1270
+ const toDbProperty: (value) => string;
1271
+ ```
1272
+
1273
+ ## Parameters
1274
+
1275
+ ### value
1276
+
1277
+ `string`
1278
+
1279
+ ## Returns
1280
+
1281
+ `string`
1282
+
1283
+ ### <a id="toDbRepresentation"></a>toDbRepresentation
1284
+
1285
+ [**@xyo-network/module-mongodb**](#../README)
1286
+
1287
+ ***
1288
+
1289
+ ```ts
1290
+ const toDbRepresentation: <T>(value) => PayloadWithMongoMeta<WithStorageMeta<T>>;
1291
+ ```
1292
+
1293
+ ## Type Parameters
1294
+
1295
+ ### T
1296
+
1297
+ `T` *extends* `Payload` \| `BoundWitness`
1298
+
1299
+ ## Parameters
1300
+
1301
+ ### value
1302
+
1303
+ `WithStorageMeta`\<`T`\>
1304
+
1305
+ ## Returns
18
1306
 
19
- ## Credits
1307
+ [`PayloadWithMongoMeta`](#../type-aliases/PayloadWithMongoMeta)\<`WithStorageMeta`\<`T`\>\>
20
1308
 
21
- [Made with 🔥 and ❄️ by XYO](https://xyo.network)
22
1309
 
23
- [logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
1310
+ [logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
1311
+ [npm-badge]: https://img.shields.io/npm/v/@xyo-network/module-mongodb.svg
1312
+ [npm-link]: https://www.npmjs.com/package/@xyo-network/module-mongodb
1313
+ [license-badge]: https://img.shields.io/npm/l/@xyo-network/module-mongodb.svg
1314
+ [license-link]: https://github.com/xylabs/sdk-js/blob/main/LICENSE
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/module-mongodb",
3
- "version": "5.3.25",
3
+ "version": "5.3.27",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -21,7 +21,6 @@
21
21
  "type": "module",
22
22
  "exports": {
23
23
  ".": {
24
- "browser": {},
25
24
  "node": {
26
25
  "types": "./dist/node/index.d.ts",
27
26
  "default": "./dist/node/index.mjs"
@@ -29,8 +28,6 @@
29
28
  },
30
29
  "./package.json": "./package.json"
31
30
  },
32
- "module": "dist/node/index.mjs",
33
- "types": "dist/node/index.d.ts",
34
31
  "files": [
35
32
  "dist",
36
33
  "!**/*.bench.*",
@@ -39,41 +36,30 @@
39
36
  "README.md"
40
37
  ],
41
38
  "dependencies": {
42
- "@xyo-network/module-model-mongodb": "~5.3.25",
43
- "@xyo-network/payload-mongodb": "~5.3.25",
44
- "@xyo-network/module-abstract-mongodb": "~5.3.25"
39
+ "@xyo-network/module-abstract-mongodb": "~5.3.27",
40
+ "@xyo-network/payload-mongodb": "~5.3.27",
41
+ "@xyo-network/module-model-mongodb": "~5.3.27"
45
42
  },
46
43
  "devDependencies": {
47
44
  "@opentelemetry/api": "^1.9.1",
48
- "@types/node": "^25.5.0",
49
- "@xylabs/mongo": "^5.0.93",
50
- "@xylabs/sdk-js": "^5.0.93",
51
- "@xylabs/ts-scripts-common": "~7.6.16",
52
- "@xylabs/ts-scripts-pnpm": "~7.6.16",
53
- "@xylabs/tsconfig": "~7.6.16",
54
- "acorn": "^8.16.0",
45
+ "@xylabs/mongo": "^5.0.94",
46
+ "@xylabs/sdk-js": "^5.0.94",
47
+ "@xylabs/ts-scripts-common": "~7.7.15",
48
+ "@xylabs/ts-scripts-pnpm": "~7.7.15",
49
+ "@xylabs/tsconfig": "~7.7.15",
55
50
  "axios": "^1.14.0",
56
- "esbuild": "^0.28.0",
57
51
  "mongodb": "~7.1.1",
58
52
  "tslib": "^2.8.1",
59
53
  "typescript": "~5.9.3",
60
54
  "zod": "^4.3.6",
61
- "@xyo-network/module-abstract-mongodb": "~5.3.25",
62
- "@xyo-network/boundwitness-model": "~5.3.25",
63
- "@xyo-network/module-model-mongodb": "~5.3.25",
64
- "@xyo-network/payload-builder": "~5.3.25",
65
- "@xyo-network/module-model": "~5.3.25",
66
- "@xyo-network/payload-mongodb": "~5.3.25",
67
- "@xyo-network/shared": "~5.3.25",
68
- "@xyo-network/payload-model": "~5.3.25"
69
- },
70
- "peerDependencies": {
71
- "@xylabs/sdk-js": "^5",
72
- "tslib": "^2.8.1",
73
- "zod": "^4"
74
- },
75
- "engines": {
76
- "node": ">=16"
55
+ "@xyo-network/boundwitness-model": "~5.3.27",
56
+ "@xyo-network/module-abstract-mongodb": "~5.3.27",
57
+ "@xyo-network/module-model": "~5.3.27",
58
+ "@xyo-network/module-model-mongodb": "~5.3.27",
59
+ "@xyo-network/payload-builder": "~5.3.27",
60
+ "@xyo-network/payload-mongodb": "~5.3.27",
61
+ "@xyo-network/payload-model": "~5.3.27",
62
+ "@xyo-network/shared": "~5.3.27"
77
63
  },
78
64
  "publishConfig": {
79
65
  "access": "public"