@xyo-network/module-abstract-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 +469 -10
  2. package/package.json +13 -24
package/README.md CHANGED
@@ -1,23 +1,482 @@
1
+ [![logo][]](https://xyo.network)
2
+
1
3
  # @xyo-network/module-abstract-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:
4
13
 
5
- Version: 5.0.2
14
+ ```sh
15
+ npm install {{name}}
16
+ ```
6
17
 
7
- Primary SDK for using XYO Protocol 2.0
18
+ Using yarn:
8
19
 
9
- ## Documentation
20
+ ```sh
21
+ yarn add {{name}}
22
+ ```
10
23
 
11
- [TypeDoc Generated Documentation](https://gitbook.xyo.network/xyo-data-lab/xyo-reference/package-documentation/xyo-network__module-abstract-mongodb)
24
+ Using pnpm:
25
+
26
+ ```sh
27
+ pnpm add {{name}}
28
+ ```
29
+
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
+ ### packages
56
+
57
+ ### abstract
58
+
59
+ ### .temp-typedoc
60
+
61
+ ### functions
62
+
63
+ ### <a id="MongoDBModuleMixin"></a>MongoDBModuleMixin
64
+
65
+ [**@xyo-network/module-abstract-mongodb**](#../README)
66
+
67
+ ***
68
+
69
+ ```ts
70
+ function MongoDBModuleMixin<TParams, TModule>(ModuleBase): {
71
+ (...args): MongoModuleBase<TParams>;
72
+ labels: MongoDBStorageClassLabels;
73
+ prototype: MongoModuleBase<any, any>;
74
+ } & TModule;
75
+ ```
76
+
77
+ ## Type Parameters
78
+
79
+ ### TParams
80
+
81
+ `TParams` *extends* `MongoDBModuleParams` = `MongoDBModuleParams`
82
+
83
+ ### TModule
84
+
85
+ `TModule` *extends* `AnyAbstractModule`\<`TParams`\> = `AnyAbstractModule`\<`TParams`\>
86
+
87
+ ## Parameters
88
+
89
+ ### ModuleBase
90
+
91
+ `TModule`
92
+
93
+ ## Returns
94
+
95
+ \{
96
+ (...`args`): `MongoModuleBase`\<`TParams`\>;
97
+ `labels`: `MongoDBStorageClassLabels`;
98
+ `prototype`: `MongoModuleBase`\<`any`, `any`\>;
99
+ \} & `TModule`
100
+
101
+ ### <a id="MongoDBModuleMixinV2"></a>MongoDBModuleMixinV2
102
+
103
+ [**@xyo-network/module-abstract-mongodb**](#../README)
104
+
105
+ ***
106
+
107
+ ```ts
108
+ function MongoDBModuleMixinV2<TParams, TModule>(ModuleBase): {
109
+ (...args): MongoModuleBase<TParams>;
110
+ labels: MongoDBStorageClassLabels;
111
+ prototype: MongoModuleBase<any, any>;
112
+ } & TModule;
113
+ ```
114
+
115
+ ## Type Parameters
116
+
117
+ ### TParams
118
+
119
+ `TParams` *extends* `MongoDBModuleParamsV2`\<`AnyConfigSchema`\<`MongoDBModuleConfigV2`\>\> = `MongoDBModuleParamsV2`\<`AnyConfigSchema`\<`MongoDBModuleConfigV2`\>\>
120
+
121
+ ### TModule
122
+
123
+ `TModule` *extends* `AnyAbstractModule`\<`TParams`\> = `AnyAbstractModule`\<`TParams`\>
124
+
125
+ ## Parameters
126
+
127
+ ### ModuleBase
128
+
129
+ `TModule`
130
+
131
+ ## Returns
132
+
133
+ \{
134
+ (...`args`): `MongoModuleBase`\<`TParams`\>;
135
+ `labels`: `MongoDBStorageClassLabels`;
136
+ `prototype`: `MongoModuleBase`\<`any`, `any`\>;
137
+ \} & `TModule`
138
+
139
+ ### <a id="fromDbProperty"></a>fromDbProperty
140
+
141
+ [**@xyo-network/module-abstract-mongodb**](#../README)
142
+
143
+ ***
144
+
145
+ ```ts
146
+ function fromDbProperty(value): string;
147
+ ```
148
+
149
+ ## Parameters
150
+
151
+ ### value
152
+
153
+ `string`
154
+
155
+ ## Returns
156
+
157
+ `string`
158
+
159
+ ### <a id="getBaseMongoSdk"></a>getBaseMongoSdk
160
+
161
+ [**@xyo-network/module-abstract-mongodb**](#../README)
162
+
163
+ ***
164
+
165
+ ```ts
166
+ function getBaseMongoSdk<T>(collection): BaseMongoSdk<T>;
167
+ ```
168
+
169
+ ## Type Parameters
170
+
171
+ ### T
172
+
173
+ `T` *extends* `Document`
174
+
175
+ ## Parameters
176
+
177
+ ### collection
178
+
179
+ `string`
180
+
181
+ ## Returns
182
+
183
+ `BaseMongoSdk`\<`T`\>
184
+
185
+ ### <a id="getBaseMongoSdkPrivateConfig"></a>getBaseMongoSdkPrivateConfig
186
+
187
+ [**@xyo-network/module-abstract-mongodb**](#../README)
188
+
189
+ ***
190
+
191
+ ```ts
192
+ function getBaseMongoSdkPrivateConfig(): BaseMongoSdkPrivateConfig;
193
+ ```
194
+
195
+ ## Returns
196
+
197
+ `BaseMongoSdkPrivateConfig`
198
+
199
+ ### <a id="getMongoDBConfig"></a>getMongoDBConfig
200
+
201
+ [**@xyo-network/module-abstract-mongodb**](#../README)
202
+
203
+ ***
204
+
205
+ ```ts
206
+ function getMongoDBConfig(): MongoEnv;
207
+ ```
208
+
209
+ ## Returns
210
+
211
+ [`MongoEnv`](#../type-aliases/MongoEnv)
212
+
213
+ ### <a id="hasMongoDBConfig"></a>hasMongoDBConfig
214
+
215
+ [**@xyo-network/module-abstract-mongodb**](#../README)
216
+
217
+ ***
218
+
219
+ ```ts
220
+ function hasMongoDBConfig(): boolean;
221
+ ```
222
+
223
+ ## Returns
224
+
225
+ `boolean`
226
+
227
+ ### <a id="toDbProperty"></a>toDbProperty
228
+
229
+ [**@xyo-network/module-abstract-mongodb**](#../README)
230
+
231
+ ***
232
+
233
+ ```ts
234
+ function toDbProperty(value): string;
235
+ ```
236
+
237
+ ## Parameters
238
+
239
+ ### value
240
+
241
+ `string`
242
+
243
+ ## Returns
244
+
245
+ `string`
246
+
247
+ ### type-aliases
248
+
249
+ ### <a id="CollectionIndexFunction"></a>CollectionIndexFunction
250
+
251
+ [**@xyo-network/module-abstract-mongodb**](#../README)
252
+
253
+ ***
254
+
255
+ ```ts
256
+ type CollectionIndexFunction = (collectionName) => IndexDescription[];
257
+ ```
258
+
259
+ ## Parameters
260
+
261
+ ### collectionName
262
+
263
+ `string`
264
+
265
+ ## Returns
266
+
267
+ `IndexDescription`[]
268
+
269
+ ### <a id="IndexDescription"></a>IndexDescription
270
+
271
+ [**@xyo-network/module-abstract-mongodb**](#../README)
272
+
273
+ ***
274
+
275
+ ```ts
276
+ type IndexDescription = object;
277
+ ```
278
+
279
+ Description of index(es) to be created on a store
280
+
281
+ ## Properties
282
+
283
+ ### key
284
+
285
+ ```ts
286
+ key:
287
+ | {
288
+ [key: string]: IndexDirection;
289
+ }
290
+ | Map<string, IndexDirection>;
291
+ ```
292
+
293
+ The key(s) to index
294
+
295
+ ***
296
+
297
+ ### name?
298
+
299
+ ```ts
300
+ optional name?: string;
301
+ ```
302
+
303
+ The name of the index
304
+
305
+ ***
306
+
307
+ ### unique?
308
+
309
+ ```ts
310
+ optional unique?: boolean;
311
+ ```
312
+
313
+ If true, the index must enforce uniqueness on the key
314
+
315
+ ### <a id="IndexDirection"></a>IndexDirection
316
+
317
+ [**@xyo-network/module-abstract-mongodb**](#../README)
318
+
319
+ ***
320
+
321
+ ```ts
322
+ type IndexDirection = -1 | 1;
323
+ ```
324
+
325
+ The index direction (1 for ascending, -1 for descending)
326
+
327
+ ### <a id="MongoDbConnectionStringEnvVar"></a>MongoDbConnectionStringEnvVar
328
+
329
+ [**@xyo-network/module-abstract-mongodb**](#../README)
330
+
331
+ ***
332
+
333
+ ```ts
334
+ type MongoDbConnectionStringEnvVar = "MONGO_CONNECTION_STRING";
335
+ ```
336
+
337
+ ### <a id="MongoDbEnvVars"></a>MongoDbEnvVars
338
+
339
+ [**@xyo-network/module-abstract-mongodb**](#../README)
340
+
341
+ ***
342
+
343
+ ```ts
344
+ type MongoDbEnvVars = "MONGO_DATABASE" | "MONGO_DOMAIN" | "MONGO_PASSWORD" | "MONGO_USERNAME";
345
+ ```
346
+
347
+ ### <a id="MongoEnv"></a>MongoEnv
348
+
349
+ [**@xyo-network/module-abstract-mongodb**](#../README)
350
+
351
+ ***
352
+
353
+ ```ts
354
+ type MongoEnv = Record<
355
+ | MongoDbEnvVars
356
+ | MongoDbConnectionStringEnvVar, string | undefined>;
357
+ ```
358
+
359
+ ### variables
360
+
361
+ ### <a id="COLLECTIONS"></a>COLLECTIONS
362
+
363
+ [**@xyo-network/module-abstract-mongodb**](#../README)
364
+
365
+ ***
366
+
367
+ ```ts
368
+ const COLLECTIONS: object;
369
+ ```
370
+
371
+ ## Type Declaration
372
+
373
+ ### AddressInfo
374
+
375
+ ```ts
376
+ AddressInfo: "address_info";
377
+ ```
378
+
379
+ ### ArchivistStats
380
+
381
+ ```ts
382
+ ArchivistStats: "archivist_stats";
383
+ ```
384
+
385
+ ### BoundWitnesses
386
+
387
+ ```ts
388
+ BoundWitnesses: "bound_witnesses";
389
+ ```
390
+
391
+ ### Payloads
392
+
393
+ ```ts
394
+ Payloads: "payloads";
395
+ ```
396
+
397
+ ### Thumbnails
398
+
399
+ ```ts
400
+ Thumbnails: "thumbnails";
401
+ ```
402
+
403
+ ### Users
404
+
405
+ ```ts
406
+ Users: "users";
407
+ ```
408
+
409
+ ### <a id="DATABASES"></a>DATABASES
410
+
411
+ [**@xyo-network/module-abstract-mongodb**](#../README)
412
+
413
+ ***
414
+
415
+ ```ts
416
+ const DATABASES: object;
417
+ ```
418
+
419
+ ## Type Declaration
420
+
421
+ ### Archivist
422
+
423
+ ```ts
424
+ Archivist: "archivist";
425
+ ```
426
+
427
+ ### <a id="DefaultAggregateTimeoutMs"></a>DefaultAggregateTimeoutMs
428
+
429
+ [**@xyo-network/module-abstract-mongodb**](#../README)
430
+
431
+ ***
432
+
433
+ ```ts
434
+ const DefaultAggregateTimeoutMs: 10000 = 10_000;
435
+ ```
436
+
437
+ ### <a id="DefaultLimit"></a>DefaultLimit
438
+
439
+ [**@xyo-network/module-abstract-mongodb**](#../README)
440
+
441
+ ***
442
+
443
+ ```ts
444
+ const DefaultLimit: 20 = 20;
445
+ ```
446
+
447
+ ### <a id="DefaultMaxTimeMS"></a>DefaultMaxTimeMS
448
+
449
+ [**@xyo-network/module-abstract-mongodb**](#../README)
450
+
451
+ ***
452
+
453
+ ```ts
454
+ const DefaultMaxTimeMS: 2000 = 2000;
455
+ ```
456
+
457
+ ### <a id="DefaultOrder"></a>DefaultOrder
458
+
459
+ [**@xyo-network/module-abstract-mongodb**](#../README)
460
+
461
+ ***
462
+
463
+ ```ts
464
+ const DefaultOrder: "desc" = 'desc';
465
+ ```
466
+
467
+ ### <a id="escapeChar"></a>escapeChar
468
+
469
+ [**@xyo-network/module-abstract-mongodb**](#../README)
470
+
471
+ ***
18
472
 
19
- ## Credits
473
+ ```ts
474
+ const escapeChar: "#" = '#';
475
+ ```
20
476
 
21
- [Made with 🔥 and ❄️ by XYO](https://xyo.network)
22
477
 
23
- [logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
478
+ [logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
479
+ [npm-badge]: https://img.shields.io/npm/v/@xyo-network/module-abstract-mongodb.svg
480
+ [npm-link]: https://www.npmjs.com/package/@xyo-network/module-abstract-mongodb
481
+ [license-badge]: https://img.shields.io/npm/l/@xyo-network/module-abstract-mongodb.svg
482
+ [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-abstract-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,38 +36,30 @@
39
36
  "README.md"
40
37
  ],
41
38
  "dependencies": {
42
- "@xyo-network/module-model": "~5.3.25",
43
- "@xyo-network/module-model-mongodb": "~5.3.25",
44
- "@xyo-network/payload-mongodb": "~5.3.25"
39
+ "@xyo-network/module-model": "~5.3.27",
40
+ "@xyo-network/module-model-mongodb": "~5.3.27",
41
+ "@xyo-network/payload-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-model": "~5.3.25",
62
- "@xyo-network/module-model-mongodb": "~5.3.25",
63
- "@xyo-network/payload-mongodb": "~5.3.25"
55
+ "@xyo-network/module-model": "~5.3.27",
56
+ "@xyo-network/module-model-mongodb": "~5.3.27",
57
+ "@xyo-network/payload-mongodb": "~5.3.27"
64
58
  },
65
59
  "peerDependencies": {
66
60
  "@xylabs/mongo": "^5",
67
61
  "@xylabs/sdk-js": "^5",
68
- "mongodb": "^6 || ^7",
69
- "tslib": "^2.8.1",
70
- "zod": "^4"
71
- },
72
- "engines": {
73
- "node": ">=16"
62
+ "mongodb": "^6 || ^7"
74
63
  },
75
64
  "publishConfig": {
76
65
  "access": "public"