@lossless.org/client 1.6.0 → 1.8.0

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 (51) hide show
  1. package/dist_ts/00_commitinfo_data.js +1 -1
  2. package/dist_ts/nosqldb/classes.atomicdelete.d.ts +1 -0
  3. package/dist_ts/nosqldb/classes.atomicdelete.js +10 -7
  4. package/dist_ts/nosqldb/classes.atomicfindoneandupdate.d.ts +2 -0
  5. package/dist_ts/nosqldb/classes.atomicfindoneandupdate.js +9 -5
  6. package/dist_ts/nosqldb/classes.atomicupdate.d.ts +2 -0
  7. package/dist_ts/nosqldb/classes.atomicupdate.js +13 -8
  8. package/dist_ts/nosqldb/classes.collection.d.ts +13 -4
  9. package/dist_ts/nosqldb/classes.collection.js +57 -64
  10. package/dist_ts/nosqldb/classes.db.d.ts +1 -1
  11. package/dist_ts/nosqldb/classes.doc.d.ts +60 -3
  12. package/dist_ts/nosqldb/classes.doc.js +68 -26
  13. package/dist_ts/nosqldb/classes.exactpersistence.d.ts +36 -7
  14. package/dist_ts/nosqldb/classes.exactpersistence.js +92 -81
  15. package/dist_ts/nosqldb/classes.operationdeadline.d.ts +61 -0
  16. package/dist_ts/nosqldb/classes.operationdeadline.js +149 -0
  17. package/dist_ts/nosqldb/classes.persistence.d.ts +16 -1
  18. package/dist_ts/nosqldb/classes.persistence.js +20 -1
  19. package/dist_ts/nosqldb/classes.session.d.ts +73 -2
  20. package/dist_ts/nosqldb/classes.session.js +164 -38
  21. package/dist_ts/objectstorage/classes.bucket.d.ts +61 -3
  22. package/dist_ts/objectstorage/classes.bucket.js +243 -184
  23. package/dist_ts/objectstorage/classes.directory.js +17 -28
  24. package/dist_ts/objectstorage/classes.smartbucket.d.ts +13 -6
  25. package/dist_ts/objectstorage/classes.smartbucket.js +18 -12
  26. package/dist_ts/objectstorage/classes.watcher.js +1 -2
  27. package/dist_ts/objectstorage/interfaces.d.ts +8 -0
  28. package/dist_ts/objectstorage/internal.bucketrequests.d.ts +14 -0
  29. package/dist_ts/objectstorage/internal.bucketrequests.js +53 -0
  30. package/dist_ts/objectstorage/internal.exactupload.capability.d.ts +12 -0
  31. package/dist_ts/objectstorage/internal.exactupload.capability.js +46 -17
  32. package/package.json +3 -3
  33. package/readme.md +13 -2
  34. package/ts/00_commitinfo_data.ts +1 -1
  35. package/ts/nosqldb/classes.atomicdelete.ts +10 -6
  36. package/ts/nosqldb/classes.atomicfindoneandupdate.ts +10 -4
  37. package/ts/nosqldb/classes.atomicupdate.ts +14 -7
  38. package/ts/nosqldb/classes.collection.ts +82 -73
  39. package/ts/nosqldb/classes.db.ts +1 -1
  40. package/ts/nosqldb/classes.doc.ts +162 -33
  41. package/ts/nosqldb/classes.exactpersistence.ts +131 -93
  42. package/ts/nosqldb/classes.operationdeadline.ts +179 -0
  43. package/ts/nosqldb/classes.persistence.ts +36 -1
  44. package/ts/nosqldb/classes.session.ts +221 -39
  45. package/ts/objectstorage/classes.bucket.ts +350 -218
  46. package/ts/objectstorage/classes.directory.ts +18 -27
  47. package/ts/objectstorage/classes.smartbucket.ts +21 -11
  48. package/ts/objectstorage/classes.watcher.ts +0 -1
  49. package/ts/objectstorage/interfaces.ts +9 -0
  50. package/ts/objectstorage/internal.bucketrequests.ts +70 -0
  51. package/ts/objectstorage/internal.exactupload.capability.ts +105 -24
@@ -6,7 +6,7 @@ import { SmartdataSession } from './classes.session.js';
6
6
  import { collectionTopologyDbInspectionSymbol } from './classes.collectiontopology.js';
7
7
  import { type ISmartdataNamespaceInspectionOptions, type ISmartdataNamespaceInspection } from './classes.namespaceinspection.js';
8
8
  export { SmartdataSession } from './classes.session.js';
9
- export type { TSmartdataOrdinarySession } from './classes.session.js';
9
+ export type { ISmartdataTransactionOptions, TSmartdataOrdinarySession } from './classes.session.js';
10
10
  import { type ISmartdataEngineIdentity } from './engineidentity.js';
11
11
  import type { ICapabilities } from '../core/interfaces.js';
12
12
  /**
@@ -194,7 +194,14 @@ export interface ISmartdataOffsetPageOptions<T> {
194
194
  projection?: TSmartdataProjection<T>;
195
195
  hint?: string;
196
196
  maxTimeMS?: number;
197
- /** Defaults to 5000ms; maximum 120000ms. Covers the cursor's entire lifetime. */
197
+ /**
198
+ * Defaults to 5000ms; maximum 120000ms. Covers the cursor up to its last
199
+ * reply. A page larger than the first batch that stalls in its `getMore`
200
+ * settles within about twice the deadline: the driver's `killCursors` runs
201
+ * on a fresh deadline of the same length before the error surfaces.
202
+ * Inside a transaction with its own deadline that deadline replaces the
203
+ * default, and an explicit value is refused.
204
+ */
198
205
  timeoutMS?: number;
199
206
  signal?: AbortSignal;
200
207
  session?: TSmartdataOrdinarySession;
@@ -202,6 +209,8 @@ export interface ISmartdataOffsetPageOptions<T> {
202
209
  export interface ISmartdataFindOneOptions<T> {
203
210
  projection?: TSmartdataProjection<T>;
204
211
  maxTimeMS?: number;
212
+ /** Client-side deadline for the call's database work (1..120000 ms), including model initialization, server selection and pool waits. */
213
+ timeoutMS?: number;
205
214
  session?: TSmartdataOrdinarySession;
206
215
  }
207
216
  type TSmartdataAtomicSet<T> = Partial<Pick<T, TSmartdataDocumentPath<T>>> & Partial<Record<TSmartdataAtomicNestedDocumentPath<T>, unknown>>;
@@ -260,7 +269,12 @@ export interface ISmartdataGroupedTotalsOptions<T> {
260
269
  */
261
270
  limit: number;
262
271
  maxTimeMS?: number;
263
- /** Client-side deadline for the complete aggregation cursor lifetime. */
272
+ /**
273
+ * Client-side deadline for the aggregation cursor up to its last reply. More
274
+ * groups than the first batch holds need a `getMore`; when that times out the
275
+ * driver's `killCursors` runs on a fresh deadline of the same length, so a
276
+ * stalled database settles the call within about twice the deadline.
277
+ */
264
278
  timeoutMS?: number;
265
279
  signal?: AbortSignal;
266
280
  session?: TSmartdataOrdinarySession;
@@ -361,6 +375,8 @@ export type TSmartdataAtomicFilter<T> = TSmartdataAtomicFilterBranch<T> & {
361
375
  export interface ISmartdataAtomicUpdateOptions {
362
376
  upsert?: boolean;
363
377
  session?: TSmartdataOrdinarySession;
378
+ /** Client-side deadline for the call's database work (1..120000 ms), including model initialization, server selection and pool waits. */
379
+ timeoutMS?: number;
364
380
  }
365
381
  export interface ISmartdataAtomicUpdateResult {
366
382
  acknowledged: boolean;
@@ -381,6 +397,8 @@ export interface ISmartdataAtomicFindOneAndUpdateOptions<TReturnDocument extends
381
397
  */
382
398
  sort?: TSmartdataSort<TModel>;
383
399
  session?: TSmartdataOrdinarySession;
400
+ /** Client-side deadline for the call's database work (1..120000 ms), including model initialization, server selection and pool waits. */
401
+ timeoutMS?: number;
384
402
  }
385
403
  export type TSmartdataAtomicFindOneAndUpdateResult<T, TReturnDocument extends TSmartdataAtomicReturnDocument> = {
386
404
  status: 'matched';
@@ -399,12 +417,21 @@ export interface ISmartdataAtomicFindOneAndReplaceOptions {
399
417
  */
400
418
  returnDocument?: TSmartdataAtomicReturnDocument;
401
419
  session?: TSmartdataOrdinarySession;
420
+ /** Client-side deadline for the call's database work (1..120000 ms), including model initialization, server selection and pool waits. */
421
+ timeoutMS?: number;
402
422
  }
403
423
  export interface ISmartdataAtomicDeleteOptions {
404
424
  session?: TSmartdataOrdinarySession;
405
425
  /** Client-side operation deadline, including server selection and pool waits. */
406
426
  timeoutMS?: number;
407
427
  }
428
+ export interface ISmartdataAtomicDeleteManyOptions extends ISmartdataAtomicDeleteOptions {
429
+ /**
430
+ * Cancels the call. An abort before the delete is sent deletes nothing; an
431
+ * abort in flight closes the connection and leaves the outcome unknown.
432
+ */
433
+ signal?: AbortSignal;
434
+ }
408
435
  export interface ISmartdataInsertManyIfAbsentOptions<T> {
409
436
  /** A declared, non-serialized @unI identity field. */
410
437
  identityField: TSmartdataDocumentPath<T>;
@@ -422,6 +449,8 @@ export interface ISmartdataAtomicDeleteResult {
422
449
  }
423
450
  export interface ISmartdataAtomicUpdateManyOptions {
424
451
  session?: TSmartdataOrdinarySession;
452
+ /** Client-side deadline for the call's database work (1..120000 ms), including model initialization, server selection and pool waits. */
453
+ timeoutMS?: number;
425
454
  }
426
455
  export interface ISmartdataAtomicUpdateManyResult {
427
456
  acknowledged: boolean;
@@ -461,6 +490,8 @@ export interface ISmartdataSaveIfOptions {
461
490
  session?: TSmartdataOrdinarySession;
462
491
  /** Defaults to `'ignore'`. */
463
492
  absentDeclaredFields?: TSmartdataAbsentDeclaredFields;
493
+ /** Client-side deadline for the write (1..120000 ms); `beforeSave()` and `afterSave()` run outside it. */
494
+ timeoutMS?: number;
464
495
  }
465
496
  export interface ISmartdataSaveIfResult {
466
497
  acknowledged: boolean;
@@ -548,6 +579,8 @@ export declare class SmartDataDbDoc<T extends TImplements, TImplements, TManager
548
579
  */
549
580
  static insert<T extends SmartDataDbDoc<any, any>>(this: plugins.tsclass.typeFest.Class<T>, documentArg: T, opts?: {
550
581
  session?: TSmartdataOrdinarySession;
582
+ /** Client-side deadline for the call's database work (1..120000 ms), including model initialization, server selection and pool waits. */
583
+ timeoutMS?: number;
551
584
  }): Promise<plugins.mongodb.InsertOneResult<{
552
585
  _id: TSmartdataPrimaryId<T>;
553
586
  }>>;
@@ -562,6 +595,8 @@ export declare class SmartDataDbDoc<T extends TImplements, TImplements, TManager
562
595
  static insertMany<T extends SmartDataDbDoc<any, any>>(this: plugins.tsclass.typeFest.Class<T>, documentsArg: T[], opts?: {
563
596
  session?: TSmartdataOrdinarySession;
564
597
  ordered?: boolean;
598
+ /** Client-side deadline for the call's database work (1..120000 ms), including model initialization, server selection and pool waits. */
599
+ timeoutMS?: number;
565
600
  }): Promise<plugins.mongodb.InsertManyResult<{
566
601
  _id: TSmartdataPrimaryId<T>;
567
602
  }>>;
@@ -633,7 +668,7 @@ export declare class SmartDataDbDoc<T extends TImplements, TImplements, TManager
633
668
  * still requires declared fields and at least one top-level equality
634
669
  * anchor.
635
670
  */
636
- static atomicDeleteMany<T>(this: plugins.tsclass.typeFest.Class<T>, filterArg: TSmartdataAtomicFilter<T>, opts?: ISmartdataAtomicDeleteOptions): Promise<ISmartdataAtomicDeleteResult>;
671
+ static atomicDeleteMany<T>(this: plugins.tsclass.typeFest.Class<T>, filterArg: TSmartdataAtomicFilter<T>, opts?: ISmartdataAtomicDeleteManyOptions): Promise<ISmartdataAtomicDeleteResult>;
637
672
  /**
638
673
  * Atomically updates every ordinary model document matching a strict
639
674
  * selector. Each matched document is updated atomically; the batch as a
@@ -672,6 +707,14 @@ export declare class SmartDataDbDoc<T extends TImplements, TImplements, TManager
672
707
  */
673
708
  static getInstances<T>(this: plugins.tsclass.typeFest.Class<T>, filterArg: MongoFilter<T>, opts?: {
674
709
  session?: TSmartdataOrdinarySession;
710
+ /**
711
+ * Client-side deadline for the read (1..120000 ms), from model
712
+ * initialization to the cursor's last reply. A timed-out `getMore` is
713
+ * followed by the driver's `killCursors` on a fresh deadline of the same
714
+ * length, so a read that needs more than one batch settles within about
715
+ * twice `timeoutMS` against a stalled database.
716
+ */
717
+ timeoutMS?: number;
675
718
  }): Promise<T[]>;
676
719
  /**
677
720
  * Cursor-paged query with stable seek pagination — the org-standard way to
@@ -698,6 +741,14 @@ export declare class SmartDataDbDoc<T extends TImplements, TImplements, TManager
698
741
  /** Also count all filter matches (extra query). */
699
742
  withTotal?: boolean;
700
743
  session?: TSmartdataOrdinarySession;
744
+ /**
745
+ * Client-side deadline for the page and its optional count together
746
+ * (1..120000 ms). A page that needs more than one batch can settle
747
+ * within about twice `timeoutMS` against a stalled database: the
748
+ * driver's `killCursors` after a timed-out `getMore` gets a fresh
749
+ * deadline of the same length.
750
+ */
751
+ timeoutMS?: number;
701
752
  }): Promise<{
702
753
  documents: T[];
703
754
  nextCursor?: {
@@ -715,6 +766,8 @@ export declare class SmartDataDbDoc<T extends TImplements, TImplements, TManager
715
766
  static getInstance<T>(this: plugins.tsclass.typeFest.Class<T>, filterArg: MongoFilter<T>, opts?: ISmartdataFindOneOptions<T>): Promise<T>;
716
767
  static exists<T>(this: plugins.tsclass.typeFest.Class<T>, filterArg: MongoFilter<T>, opts?: {
717
768
  maxTimeMS?: number;
769
+ /** Client-side deadline for the call's database work (1..120000 ms), including model initialization, server selection and pool waits. */
770
+ timeoutMS?: number;
718
771
  session?: TSmartdataOrdinarySession;
719
772
  }): Promise<boolean>;
720
773
  /**
@@ -856,6 +909,8 @@ export declare class SmartDataDbDoc<T extends TImplements, TImplements, TManager
856
909
  */
857
910
  save(opts?: {
858
911
  session?: TSmartdataOrdinarySession;
912
+ /** Client-side deadline for the write (1..120000 ms); `beforeSave()` and `afterSave()` run outside it. */
913
+ timeoutMS?: number;
859
914
  }): Promise<any>;
860
915
  /**
861
916
  * Saves this instance only while the stored document still matches `fence`.
@@ -885,6 +940,8 @@ export declare class SmartDataDbDoc<T extends TImplements, TImplements, TManager
885
940
  */
886
941
  delete(opts?: {
887
942
  session?: TSmartdataOrdinarySession;
943
+ /** Client-side deadline for the write (1..120000 ms); `beforeDelete()` and `afterDelete()` run outside it. */
944
+ timeoutMS?: number;
888
945
  }): Promise<any>;
889
946
  /**
890
947
  * also store any referenced objects to DB