@aouda/client 0.1.5 → 0.1.7

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-CD9Ew5sO.cjs';
1
+ import { A as AoudaClient } from '../client-BbyXG5AL.cjs';
2
2
 
3
3
  /**
4
4
  * CLI for @aouda/client.
@@ -1,4 +1,4 @@
1
- import { A as AoudaClient } from '../client-CD9Ew5sO.js';
1
+ import { A as AoudaClient } from '../client-BbyXG5AL.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.5",
395
+ version: "0.1.7",
396
396
  description: "Official TypeScript/JavaScript client library for Aouda",
397
397
  type: "module",
398
398
  main: "./dist/index.cjs",
@@ -1396,7 +1396,8 @@ var BulkLoadCoordinator = class {
1396
1396
  pkUniquenessOverride: options.pkUniquenessOverride,
1397
1397
  replicationMode: options.replicationMode,
1398
1398
  forceSingleNodeReplicationBypass: options.forceSingleNodeReplicationBypass,
1399
- postLoadMqBehavior: options.postLoadMqBehavior
1399
+ postLoadMqBehavior: options.postLoadMqBehavior,
1400
+ ...options.identityInsert === true ? { identityInsert: true } : {}
1400
1401
  }
1401
1402
  };
1402
1403
  const beginResp = await this.transport.post(
@@ -3406,6 +3407,8 @@ var TableQuery = class _TableQuery {
3406
3407
  * a Promise. It does not use query builder state (where, orderBy, etc.).
3407
3408
  *
3408
3409
  * @param row - The row data to insert. Keys are column names.
3410
+ * @param row - The row object to insert. Keys are column names.
3411
+ * @param options - Optional insert options (e.g. `identityInsert`).
3409
3412
  * @returns The insert result with row count, execution time, and optional generated values.
3410
3413
  * @throws Error if `row` is null or undefined.
3411
3414
  *
@@ -3416,9 +3419,12 @@ var TableQuery = class _TableQuery {
3416
3419
  *
3417
3420
  * console.log(result.rowsInserted); // 1
3418
3421
  * console.log(result.generatedValues); // { "0": { id: 42 } }
3422
+ *
3423
+ * // Identity-insert (Bond isAutoIncrementDisabled: true): store explicit IDs including 0
3424
+ * await client.table('orders').insert({ id: 1000, status: 'seeded' }, { identityInsert: true });
3419
3425
  * ```
3420
3426
  */
3421
- async insert(row) {
3427
+ async insert(row, options) {
3422
3428
  if (row == null) {
3423
3429
  throw new Error("insert() requires a non-null row object");
3424
3430
  }
@@ -3428,6 +3434,9 @@ var TableQuery = class _TableQuery {
3428
3434
  database: this.database,
3429
3435
  rows: [row]
3430
3436
  };
3437
+ if (options?.identityInsert === true) {
3438
+ body.identityInsert = true;
3439
+ }
3431
3440
  const response = await this.transport.post(path4, body);
3432
3441
  const result = {
3433
3442
  rowsInserted: response.rowsInserted,
@@ -3445,6 +3454,7 @@ var TableQuery = class _TableQuery {
3445
3454
  * a Promise. It does not use query builder state (where, orderBy, etc.).
3446
3455
  *
3447
3456
  * @param rows - Array of row objects to insert. Must contain at least one row.
3457
+ * @param options - Optional insert options (e.g. `identityInsert`).
3448
3458
  * @returns The insert result with total row count, execution time, and optional generated values.
3449
3459
  * @throws Error if `rows` is empty.
3450
3460
  *
@@ -3457,9 +3467,14 @@ var TableQuery = class _TableQuery {
3457
3467
  * ]);
3458
3468
  *
3459
3469
  * console.log(result.rowsInserted); // 2
3470
+ *
3471
+ * await client.table('orders').insertMany(
3472
+ * [{ id: 10 }, { id: 20 }],
3473
+ * { identityInsert: true },
3474
+ * );
3460
3475
  * ```
3461
3476
  */
3462
- async insertMany(rows) {
3477
+ async insertMany(rows, options) {
3463
3478
  if (!Array.isArray(rows) || rows.length === 0) {
3464
3479
  throw new Error("insertMany() requires a non-empty array of rows");
3465
3480
  }
@@ -3469,6 +3484,9 @@ var TableQuery = class _TableQuery {
3469
3484
  database: this.database,
3470
3485
  rows
3471
3486
  };
3487
+ if (options?.identityInsert === true) {
3488
+ body.identityInsert = true;
3489
+ }
3472
3490
  const response = await this.transport.post(path4, body);
3473
3491
  const result = {
3474
3492
  rowsInserted: response.rowsInserted,
@@ -4671,6 +4689,35 @@ var NotificationsAdminApi = class {
4671
4689
  request
4672
4690
  );
4673
4691
  }
4692
+ /**
4693
+ * Get recent captured auth notifications (newest first).
4694
+ * GET /admin/notifications/outbox?channel=&limit=
4695
+ */
4696
+ async getOutbox(options) {
4697
+ return this.transport.get(
4698
+ this.buildOutboxPath(options)
4699
+ );
4700
+ }
4701
+ /**
4702
+ * Clear the in-memory notification outbox.
4703
+ * DELETE /admin/notifications/outbox
4704
+ */
4705
+ async clearOutbox() {
4706
+ return this.transport.delete(
4707
+ `${BASE_PATH7}/outbox`
4708
+ );
4709
+ }
4710
+ buildOutboxPath(options) {
4711
+ const params = new URLSearchParams();
4712
+ if (options?.channel !== void 0 && options.channel.trim().length > 0) {
4713
+ params.set("channel", options.channel);
4714
+ }
4715
+ if (options?.limit !== void 0) {
4716
+ params.set("limit", String(options.limit));
4717
+ }
4718
+ const query = params.toString();
4719
+ return query.length > 0 ? `${BASE_PATH7}/outbox?${query}` : `${BASE_PATH7}/outbox`;
4720
+ }
4674
4721
  };
4675
4722
 
4676
4723
  // src/admin/index.ts