@aouda/client 0.1.13 → 0.1.14

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.
@@ -421,7 +421,7 @@ var import_node_url = require("url");
421
421
  // package.json
422
422
  var package_default = {
423
423
  name: "@aouda/client",
424
- version: "0.1.13",
424
+ version: "0.1.14",
425
425
  description: "Official TypeScript/JavaScript client library for Aouda",
426
426
  type: "module",
427
427
  main: "./dist/index.cjs",
@@ -2504,6 +2504,9 @@ var TableSubscription = class {
2504
2504
  if (this._identity.args !== void 0) {
2505
2505
  message.args = this._identity.args;
2506
2506
  }
2507
+ if (this._identity.orderByIndex !== void 0) {
2508
+ message.orderByIndex = this._identity.orderByIndex;
2509
+ }
2507
2510
  } else {
2508
2511
  message.target = this._identity.target;
2509
2512
  if (this._identity.filter !== void 0) {
@@ -2552,12 +2555,16 @@ var TableSubscription = class {
2552
2555
  }
2553
2556
  const rows = this._pendingSnapshotRows;
2554
2557
  this._pendingSnapshotRows = [];
2555
- this._onSnapshot?.(rows, message.version);
2556
- this._queue.push({
2558
+ this._onSnapshot?.(rows, message.version, message.total_matches);
2559
+ const snapshot = {
2557
2560
  type: "snapshot",
2558
2561
  rows,
2559
2562
  version: message.version
2560
- });
2563
+ };
2564
+ if (message.total_matches !== void 0) {
2565
+ snapshot.totalMatches = message.total_matches;
2566
+ }
2567
+ this._queue.push(snapshot);
2561
2568
  }
2562
2569
  async _handleGap(message) {
2563
2570
  this._pendingSnapshotRows = [];
@@ -5113,9 +5120,15 @@ var NamedQueriesApi = class {
5113
5120
  }
5114
5121
  const prefix = databasePath2(this.database);
5115
5122
  const path4 = `${prefix}/named-queries/${encodeURIComponent(hash)}/query?format=columnar`;
5123
+ const body = {
5124
+ args: args ?? {}
5125
+ };
5126
+ if (options?.orderByIndex !== void 0) {
5127
+ body.orderByIndex = options.orderByIndex;
5128
+ }
5116
5129
  const response = await this.transport.post(
5117
5130
  path4,
5118
- { args: args ?? {} },
5131
+ body,
5119
5132
  { signal: options?.signal }
5120
5133
  );
5121
5134
  const rows = columnarToRows(response);
@@ -5123,7 +5136,8 @@ var NamedQueriesApi = class {
5123
5136
  return {
5124
5137
  rows,
5125
5138
  stats: response.stats,
5126
- warnings: response.warnings
5139
+ warnings: response.warnings,
5140
+ totalMatches: response.totalMatches
5127
5141
  };
5128
5142
  }
5129
5143
  async batch(items, options) {
@@ -5162,12 +5176,14 @@ var NamedQueriesApi = class {
5162
5176
  data: slot.data ?? [],
5163
5177
  rowCount: slot.rowCount ?? 0,
5164
5178
  stats: slot.stats ?? emptyStats(),
5165
- warnings: slot.warnings
5179
+ warnings: slot.warnings,
5180
+ totalMatches: slot.totalMatches
5166
5181
  };
5167
5182
  const result = {
5168
5183
  rows: columnarToRows(columnar),
5169
5184
  stats: columnar.stats,
5170
- warnings: slot.warnings
5185
+ warnings: slot.warnings,
5186
+ totalMatches: slot.totalMatches
5171
5187
  };
5172
5188
  raiseDeprecationWarnings(this.onWarning, slot.warnings);
5173
5189
  return { isError: false, result };
@@ -5179,7 +5195,7 @@ var NamedQueriesApi = class {
5179
5195
  }
5180
5196
  const subscription = new TableSubscription(
5181
5197
  this.getStreamingTransport(),
5182
- { kind: "named", hash, args },
5198
+ { kind: "named", hash, args, orderByIndex: options.orderByIndex },
5183
5199
  {
5184
5200
  onSnapshot: options.onSnapshot,
5185
5201
  onChange: options.onChange,