@aouda/client 0.1.12 → 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.
@@ -1,4 +1,4 @@
1
- import { A as AoudaClient } from '../client-Q83x0Mz9.cjs';
1
+ import { A as AoudaClient } from '../client-BCMP-Fge.cjs';
2
2
 
3
3
  /**
4
4
  * CLI for @aouda/client.
@@ -1,4 +1,4 @@
1
- import { A as AoudaClient } from '../client-Q83x0Mz9.js';
1
+ import { A as AoudaClient } from '../client-BCMP-Fge.js';
2
2
 
3
3
  /**
4
4
  * CLI for @aouda/client.
package/dist/cli/index.js CHANGED
@@ -392,7 +392,7 @@ import { fileURLToPath } from "url";
392
392
  // package.json
393
393
  var package_default = {
394
394
  name: "@aouda/client",
395
- version: "0.1.12",
395
+ version: "0.1.14",
396
396
  description: "Official TypeScript/JavaScript client library for Aouda",
397
397
  type: "module",
398
398
  main: "./dist/index.cjs",
@@ -1405,7 +1405,9 @@ var BulkLoadCoordinator = class {
1405
1405
  replicationMode: options.replicationMode,
1406
1406
  forceSingleNodeReplicationBypass: options.forceSingleNodeReplicationBypass,
1407
1407
  postLoadMqBehavior: options.postLoadMqBehavior,
1408
- ...options.identityInsert === true ? { identityInsert: true } : {}
1408
+ ...options.identityInsert === true ? { identityInsert: true } : {},
1409
+ ...options.applyTransforms === true ? { applyTransforms: true } : {},
1410
+ ...options.preTransformed === true ? { preTransformed: true } : {}
1409
1411
  }
1410
1412
  };
1411
1413
  const beginResp = await this.transport.post(
@@ -1498,7 +1500,11 @@ var ERROR_CODE_MAP = {
1498
1500
  NAMED_QUERY_BATCH_MUTATION: AoudaValidationError,
1499
1501
  NAMED_QUERY_BIND_FAILED: AoudaValidationError,
1500
1502
  NAMED_QUERY_PARAM_REQUIRED: AoudaValidationError,
1501
- NAMED_MUTATION_BIND_FAILED: AoudaValidationError
1503
+ NAMED_MUTATION_BIND_FAILED: AoudaValidationError,
1504
+ AUTH_IDENTITY_INVALID: AoudaValidationError,
1505
+ AUTH_IDENTITY_NOT_FOUND: AoudaValidationError,
1506
+ BULK_LOAD_TRANSFORM_INTENT_REQUIRED: AoudaValidationError,
1507
+ BULK_LOAD_TRANSFORM_INTENT_CONFLICT: AoudaValidationError
1502
1508
  };
1503
1509
  function createComposedAbortController(...signals) {
1504
1510
  const controller = new AbortController();
@@ -2469,6 +2475,9 @@ var TableSubscription = class {
2469
2475
  if (this._identity.args !== void 0) {
2470
2476
  message.args = this._identity.args;
2471
2477
  }
2478
+ if (this._identity.orderByIndex !== void 0) {
2479
+ message.orderByIndex = this._identity.orderByIndex;
2480
+ }
2472
2481
  } else {
2473
2482
  message.target = this._identity.target;
2474
2483
  if (this._identity.filter !== void 0) {
@@ -2517,12 +2526,16 @@ var TableSubscription = class {
2517
2526
  }
2518
2527
  const rows = this._pendingSnapshotRows;
2519
2528
  this._pendingSnapshotRows = [];
2520
- this._onSnapshot?.(rows, message.version);
2521
- this._queue.push({
2529
+ this._onSnapshot?.(rows, message.version, message.total_matches);
2530
+ const snapshot = {
2522
2531
  type: "snapshot",
2523
2532
  rows,
2524
2533
  version: message.version
2525
- });
2534
+ };
2535
+ if (message.total_matches !== void 0) {
2536
+ snapshot.totalMatches = message.total_matches;
2537
+ }
2538
+ this._queue.push(snapshot);
2526
2539
  }
2527
2540
  async _handleGap(message) {
2528
2541
  this._pendingSnapshotRows = [];
@@ -5078,9 +5091,15 @@ var NamedQueriesApi = class {
5078
5091
  }
5079
5092
  const prefix = databasePath2(this.database);
5080
5093
  const path4 = `${prefix}/named-queries/${encodeURIComponent(hash)}/query?format=columnar`;
5094
+ const body = {
5095
+ args: args ?? {}
5096
+ };
5097
+ if (options?.orderByIndex !== void 0) {
5098
+ body.orderByIndex = options.orderByIndex;
5099
+ }
5081
5100
  const response = await this.transport.post(
5082
5101
  path4,
5083
- { args: args ?? {} },
5102
+ body,
5084
5103
  { signal: options?.signal }
5085
5104
  );
5086
5105
  const rows = columnarToRows(response);
@@ -5088,7 +5107,8 @@ var NamedQueriesApi = class {
5088
5107
  return {
5089
5108
  rows,
5090
5109
  stats: response.stats,
5091
- warnings: response.warnings
5110
+ warnings: response.warnings,
5111
+ totalMatches: response.totalMatches
5092
5112
  };
5093
5113
  }
5094
5114
  async batch(items, options) {
@@ -5127,12 +5147,14 @@ var NamedQueriesApi = class {
5127
5147
  data: slot.data ?? [],
5128
5148
  rowCount: slot.rowCount ?? 0,
5129
5149
  stats: slot.stats ?? emptyStats(),
5130
- warnings: slot.warnings
5150
+ warnings: slot.warnings,
5151
+ totalMatches: slot.totalMatches
5131
5152
  };
5132
5153
  const result = {
5133
5154
  rows: columnarToRows(columnar),
5134
5155
  stats: columnar.stats,
5135
- warnings: slot.warnings
5156
+ warnings: slot.warnings,
5157
+ totalMatches: slot.totalMatches
5136
5158
  };
5137
5159
  raiseDeprecationWarnings(this.onWarning, slot.warnings);
5138
5160
  return { isError: false, result };
@@ -5144,7 +5166,7 @@ var NamedQueriesApi = class {
5144
5166
  }
5145
5167
  const subscription = new TableSubscription(
5146
5168
  this.getStreamingTransport(),
5147
- { kind: "named", hash, args },
5169
+ { kind: "named", hash, args, orderByIndex: options.orderByIndex },
5148
5170
  {
5149
5171
  onSnapshot: options.onSnapshot,
5150
5172
  onChange: options.onChange,
@@ -5201,6 +5223,20 @@ var NamedMutationsApi = class {
5201
5223
  }
5202
5224
  };
5203
5225
 
5226
+ // src/policy.ts
5227
+ var PolicyApi = class {
5228
+ constructor(transport, database) {
5229
+ this.transport = transport;
5230
+ this.database = database;
5231
+ }
5232
+ inspect(body, options) {
5233
+ const path4 = `${databasePath2(this.database)}/policy/inspect`;
5234
+ return this.transport.post(path4, body, {
5235
+ signal: options?.signal
5236
+ });
5237
+ }
5238
+ };
5239
+
5204
5240
  // src/streaming/websocket-transport.ts
5205
5241
  import { decode as decodeMessagePack, encode as encodeMessagePack } from "@msgpack/msgpack";
5206
5242
  var DEFAULT_PING_INTERVAL_MS = 2e4;
@@ -5989,6 +6025,7 @@ var AoudaClient = class {
5989
6025
  this.database,
5990
6026
  onNamedArtifactWarning
5991
6027
  );
6028
+ this._policy = new PolicyApi(this.transport, this.database);
5992
6029
  }
5993
6030
  /**
5994
6031
  * Connects to the Aouda server.
@@ -6143,6 +6180,12 @@ var AoudaClient = class {
6143
6180
  get namedMutations() {
6144
6181
  return this._namedMutations;
6145
6182
  }
6183
+ /**
6184
+ * Policy inspect (`POST …/policy/inspect`). Admin on the data DB.
6185
+ */
6186
+ get policy() {
6187
+ return this._policy;
6188
+ }
6146
6189
  /**
6147
6190
  * Access auth operations (signUp, signIn, signOut, refresh, me, changePassword).
6148
6191
  * @returns The auth API.