cry-synced-db-client 0.1.101 → 0.1.102

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.
package/dist/index.js CHANGED
@@ -4057,7 +4057,7 @@ var SyncedDb = class _SyncedDb {
4057
4057
  return null;
4058
4058
  }
4059
4059
  await this.connectionManager.withRestTimeout(
4060
- this.restInterface.deleteOne(collection, { _id: id }),
4060
+ this.restInterface.call("hardDeleteOne", { collection, query: { _id: id } }),
4061
4061
  "hardDeleteOne"
4062
4062
  );
4063
4063
  await this.dexieDb.deleteOne(collection, id);
@@ -4093,7 +4093,7 @@ var SyncedDb = class _SyncedDb {
4093
4093
  if (!item) break;
4094
4094
  try {
4095
4095
  await this.connectionManager.withRestTimeout(
4096
- this.restInterface.deleteOne(collection, { _id: item.id }),
4096
+ this.restInterface.call("hardDeleteOne", { collection, query: { _id: item.id } }),
4097
4097
  "hardDelete"
4098
4098
  );
4099
4099
  await this.dexieDb.deleteOne(collection, item.id);
@@ -1,6 +1,7 @@
1
1
  import type { Timestamp, Document, SchemaMember, CollationOptions, ReadPreference, FindOneAndUpdateOptions, AggregateOptions } from "mongodb";
2
2
  import type { Types } from "cry-db";
3
3
  import type { Id } from "./DbEntity";
4
+ import type { Rdb2CallMap, Rdb2Operation } from "./Rdb2CallMap";
4
5
  export type CollectionUpdateResult = Types.CollectionUpdateResult;
5
6
  export type Obj = {
6
7
  [key: string]: any;
@@ -79,4 +80,9 @@ export interface I_RestInterface {
79
80
  upsertBatch<T>(collection: string, batch: BatchSpec<T>): Promise<T[]>;
80
81
  /** Pošlje batch update/delete za več kolekcij naenkrat */
81
82
  updateCollections<T>(collectionsBatches: CollectionUpdateRequest<T>[]): Promise<CollectionUpdateResult[]>;
83
+ /** Generic rdb2 operation call for operations beyond the minimal sync interface */
84
+ call<K extends Rdb2Operation, T = unknown>(operation: K, payload?: Rdb2CallMap[K], options?: {
85
+ timeoutMs?: number;
86
+ signal?: AbortSignal;
87
+ }): Promise<T>;
82
88
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cry-synced-db-client",
3
- "version": "0.1.101",
3
+ "version": "0.1.102",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",