@aouda/client 0.1.6 → 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.
- package/dist/cli/index.cjs +51 -4
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.d.cts +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +51 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/{client-Bb6UxTA4.d.cts → client-BbyXG5AL.d.cts} +80 -5
- package/dist/{client-Bb6UxTA4.d.ts → client-BbyXG5AL.d.ts} +80 -5
- package/dist/index.cjs +51 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +51 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.cjs
CHANGED
|
@@ -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.
|
|
424
|
+
version: "0.1.7",
|
|
425
425
|
description: "Official TypeScript/JavaScript client library for Aouda",
|
|
426
426
|
type: "module",
|
|
427
427
|
main: "./dist/index.cjs",
|
|
@@ -1425,7 +1425,8 @@ var BulkLoadCoordinator = class {
|
|
|
1425
1425
|
pkUniquenessOverride: options.pkUniquenessOverride,
|
|
1426
1426
|
replicationMode: options.replicationMode,
|
|
1427
1427
|
forceSingleNodeReplicationBypass: options.forceSingleNodeReplicationBypass,
|
|
1428
|
-
postLoadMqBehavior: options.postLoadMqBehavior
|
|
1428
|
+
postLoadMqBehavior: options.postLoadMqBehavior,
|
|
1429
|
+
...options.identityInsert === true ? { identityInsert: true } : {}
|
|
1429
1430
|
}
|
|
1430
1431
|
};
|
|
1431
1432
|
const beginResp = await this.transport.post(
|
|
@@ -3435,6 +3436,8 @@ var TableQuery = class _TableQuery {
|
|
|
3435
3436
|
* a Promise. It does not use query builder state (where, orderBy, etc.).
|
|
3436
3437
|
*
|
|
3437
3438
|
* @param row - The row data to insert. Keys are column names.
|
|
3439
|
+
* @param row - The row object to insert. Keys are column names.
|
|
3440
|
+
* @param options - Optional insert options (e.g. `identityInsert`).
|
|
3438
3441
|
* @returns The insert result with row count, execution time, and optional generated values.
|
|
3439
3442
|
* @throws Error if `row` is null or undefined.
|
|
3440
3443
|
*
|
|
@@ -3445,9 +3448,12 @@ var TableQuery = class _TableQuery {
|
|
|
3445
3448
|
*
|
|
3446
3449
|
* console.log(result.rowsInserted); // 1
|
|
3447
3450
|
* console.log(result.generatedValues); // { "0": { id: 42 } }
|
|
3451
|
+
*
|
|
3452
|
+
* // Identity-insert (Bond isAutoIncrementDisabled: true): store explicit IDs including 0
|
|
3453
|
+
* await client.table('orders').insert({ id: 1000, status: 'seeded' }, { identityInsert: true });
|
|
3448
3454
|
* ```
|
|
3449
3455
|
*/
|
|
3450
|
-
async insert(row) {
|
|
3456
|
+
async insert(row, options) {
|
|
3451
3457
|
if (row == null) {
|
|
3452
3458
|
throw new Error("insert() requires a non-null row object");
|
|
3453
3459
|
}
|
|
@@ -3457,6 +3463,9 @@ var TableQuery = class _TableQuery {
|
|
|
3457
3463
|
database: this.database,
|
|
3458
3464
|
rows: [row]
|
|
3459
3465
|
};
|
|
3466
|
+
if (options?.identityInsert === true) {
|
|
3467
|
+
body.identityInsert = true;
|
|
3468
|
+
}
|
|
3460
3469
|
const response = await this.transport.post(path4, body);
|
|
3461
3470
|
const result = {
|
|
3462
3471
|
rowsInserted: response.rowsInserted,
|
|
@@ -3474,6 +3483,7 @@ var TableQuery = class _TableQuery {
|
|
|
3474
3483
|
* a Promise. It does not use query builder state (where, orderBy, etc.).
|
|
3475
3484
|
*
|
|
3476
3485
|
* @param rows - Array of row objects to insert. Must contain at least one row.
|
|
3486
|
+
* @param options - Optional insert options (e.g. `identityInsert`).
|
|
3477
3487
|
* @returns The insert result with total row count, execution time, and optional generated values.
|
|
3478
3488
|
* @throws Error if `rows` is empty.
|
|
3479
3489
|
*
|
|
@@ -3486,9 +3496,14 @@ var TableQuery = class _TableQuery {
|
|
|
3486
3496
|
* ]);
|
|
3487
3497
|
*
|
|
3488
3498
|
* console.log(result.rowsInserted); // 2
|
|
3499
|
+
*
|
|
3500
|
+
* await client.table('orders').insertMany(
|
|
3501
|
+
* [{ id: 10 }, { id: 20 }],
|
|
3502
|
+
* { identityInsert: true },
|
|
3503
|
+
* );
|
|
3489
3504
|
* ```
|
|
3490
3505
|
*/
|
|
3491
|
-
async insertMany(rows) {
|
|
3506
|
+
async insertMany(rows, options) {
|
|
3492
3507
|
if (!Array.isArray(rows) || rows.length === 0) {
|
|
3493
3508
|
throw new Error("insertMany() requires a non-empty array of rows");
|
|
3494
3509
|
}
|
|
@@ -3498,6 +3513,9 @@ var TableQuery = class _TableQuery {
|
|
|
3498
3513
|
database: this.database,
|
|
3499
3514
|
rows
|
|
3500
3515
|
};
|
|
3516
|
+
if (options?.identityInsert === true) {
|
|
3517
|
+
body.identityInsert = true;
|
|
3518
|
+
}
|
|
3501
3519
|
const response = await this.transport.post(path4, body);
|
|
3502
3520
|
const result = {
|
|
3503
3521
|
rowsInserted: response.rowsInserted,
|
|
@@ -4700,6 +4718,35 @@ var NotificationsAdminApi = class {
|
|
|
4700
4718
|
request
|
|
4701
4719
|
);
|
|
4702
4720
|
}
|
|
4721
|
+
/**
|
|
4722
|
+
* Get recent captured auth notifications (newest first).
|
|
4723
|
+
* GET /admin/notifications/outbox?channel=&limit=
|
|
4724
|
+
*/
|
|
4725
|
+
async getOutbox(options) {
|
|
4726
|
+
return this.transport.get(
|
|
4727
|
+
this.buildOutboxPath(options)
|
|
4728
|
+
);
|
|
4729
|
+
}
|
|
4730
|
+
/**
|
|
4731
|
+
* Clear the in-memory notification outbox.
|
|
4732
|
+
* DELETE /admin/notifications/outbox
|
|
4733
|
+
*/
|
|
4734
|
+
async clearOutbox() {
|
|
4735
|
+
return this.transport.delete(
|
|
4736
|
+
`${BASE_PATH7}/outbox`
|
|
4737
|
+
);
|
|
4738
|
+
}
|
|
4739
|
+
buildOutboxPath(options) {
|
|
4740
|
+
const params = new URLSearchParams();
|
|
4741
|
+
if (options?.channel !== void 0 && options.channel.trim().length > 0) {
|
|
4742
|
+
params.set("channel", options.channel);
|
|
4743
|
+
}
|
|
4744
|
+
if (options?.limit !== void 0) {
|
|
4745
|
+
params.set("limit", String(options.limit));
|
|
4746
|
+
}
|
|
4747
|
+
const query = params.toString();
|
|
4748
|
+
return query.length > 0 ? `${BASE_PATH7}/outbox?${query}` : `${BASE_PATH7}/outbox`;
|
|
4749
|
+
}
|
|
4703
4750
|
};
|
|
4704
4751
|
|
|
4705
4752
|
// src/admin/index.ts
|