@aouda/client 0.1.15 → 0.1.16
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/README.md +1 -1
- package/dist/cli/index.cjs +46 -17
- 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 +46 -17
- package/dist/cli/index.js.map +1 -1
- package/dist/{client-CXfjcF61.d.cts → client-CsE8Vd6m.d.cts} +70 -4
- package/dist/{client-CXfjcF61.d.ts → client-CsE8Vd6m.d.ts} +70 -4
- package/dist/index.cjs +46 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -10
- package/dist/index.d.ts +13 -10
- package/dist/index.js +46 -17
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.d.cts
CHANGED
package/dist/cli/index.d.ts
CHANGED
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.
|
|
395
|
+
version: "0.1.16",
|
|
396
396
|
description: "Official TypeScript/JavaScript client library for Aouda",
|
|
397
397
|
type: "module",
|
|
398
398
|
main: "./dist/index.cjs",
|
|
@@ -485,9 +485,10 @@ var AoudaError = class extends Error {
|
|
|
485
485
|
}
|
|
486
486
|
};
|
|
487
487
|
var AoudaConnectionError = class extends AoudaError {
|
|
488
|
-
constructor(message, cause) {
|
|
488
|
+
constructor(message, cause, rowErrors) {
|
|
489
489
|
super(message);
|
|
490
490
|
this.cause = cause;
|
|
491
|
+
this.rowErrors = rowErrors;
|
|
491
492
|
this.name = "AoudaConnectionError";
|
|
492
493
|
}
|
|
493
494
|
};
|
|
@@ -507,7 +508,7 @@ var AoudaResponseError = class extends AoudaError {
|
|
|
507
508
|
}
|
|
508
509
|
};
|
|
509
510
|
var AoudaApiError = class extends AoudaError {
|
|
510
|
-
constructor(message, code, statusCode, details, requestId, retryAfterSeconds, token) {
|
|
511
|
+
constructor(message, code, statusCode, details, requestId, retryAfterSeconds, token, rowErrors) {
|
|
511
512
|
super(message);
|
|
512
513
|
this.code = code;
|
|
513
514
|
this.statusCode = statusCode;
|
|
@@ -515,36 +516,37 @@ var AoudaApiError = class extends AoudaError {
|
|
|
515
516
|
this.requestId = requestId;
|
|
516
517
|
this.retryAfterSeconds = retryAfterSeconds;
|
|
517
518
|
this.token = token;
|
|
519
|
+
this.rowErrors = rowErrors;
|
|
518
520
|
this.name = "AoudaApiError";
|
|
519
521
|
}
|
|
520
522
|
};
|
|
521
523
|
var AoudaNotFoundError = class extends AoudaApiError {
|
|
522
|
-
constructor(message, code, statusCode, details, requestId, retryAfterSeconds, token) {
|
|
523
|
-
super(message, code, statusCode, details, requestId, retryAfterSeconds, token);
|
|
524
|
+
constructor(message, code, statusCode, details, requestId, retryAfterSeconds, token, rowErrors) {
|
|
525
|
+
super(message, code, statusCode, details, requestId, retryAfterSeconds, token, rowErrors);
|
|
524
526
|
this.name = "AoudaNotFoundError";
|
|
525
527
|
}
|
|
526
528
|
};
|
|
527
529
|
var AoudaConflictError = class extends AoudaApiError {
|
|
528
|
-
constructor(message, code, statusCode, details, requestId, retryAfterSeconds, token) {
|
|
529
|
-
super(message, code, statusCode, details, requestId, retryAfterSeconds, token);
|
|
530
|
+
constructor(message, code, statusCode, details, requestId, retryAfterSeconds, token, rowErrors) {
|
|
531
|
+
super(message, code, statusCode, details, requestId, retryAfterSeconds, token, rowErrors);
|
|
530
532
|
this.name = "AoudaConflictError";
|
|
531
533
|
}
|
|
532
534
|
};
|
|
533
535
|
var AoudaValidationError = class extends AoudaApiError {
|
|
534
|
-
constructor(message, code, statusCode, details, requestId, retryAfterSeconds, token) {
|
|
535
|
-
super(message, code, statusCode, details, requestId, retryAfterSeconds, token);
|
|
536
|
+
constructor(message, code, statusCode, details, requestId, retryAfterSeconds, token, rowErrors) {
|
|
537
|
+
super(message, code, statusCode, details, requestId, retryAfterSeconds, token, rowErrors);
|
|
536
538
|
this.name = "AoudaValidationError";
|
|
537
539
|
}
|
|
538
540
|
};
|
|
539
541
|
var AoudaServerError = class extends AoudaApiError {
|
|
540
|
-
constructor(message, code, statusCode, details, requestId, retryAfterSeconds, token) {
|
|
541
|
-
super(message, code, statusCode, details, requestId, retryAfterSeconds, token);
|
|
542
|
+
constructor(message, code, statusCode, details, requestId, retryAfterSeconds, token, rowErrors) {
|
|
543
|
+
super(message, code, statusCode, details, requestId, retryAfterSeconds, token, rowErrors);
|
|
542
544
|
this.name = "AoudaServerError";
|
|
543
545
|
}
|
|
544
546
|
};
|
|
545
547
|
var AoudaAuthenticationError = class extends AoudaApiError {
|
|
546
|
-
constructor(message, code, statusCode, details, requestId, retryAfterSeconds, token) {
|
|
547
|
-
super(message, code, statusCode, details, requestId, retryAfterSeconds, token);
|
|
548
|
+
constructor(message, code, statusCode, details, requestId, retryAfterSeconds, token, rowErrors) {
|
|
549
|
+
super(message, code, statusCode, details, requestId, retryAfterSeconds, token, rowErrors);
|
|
548
550
|
this.name = "AoudaAuthenticationError";
|
|
549
551
|
}
|
|
550
552
|
};
|
|
@@ -1481,6 +1483,10 @@ var ERROR_CODE_MAP = {
|
|
|
1481
1483
|
INVALID_OPERATOR: AoudaValidationError,
|
|
1482
1484
|
INVALID_COLUMN: AoudaValidationError,
|
|
1483
1485
|
INVALID_VALUE: AoudaValidationError,
|
|
1486
|
+
CONSTRAINT_CHECK_VIOLATION: AoudaValidationError,
|
|
1487
|
+
TRANSFORM_DERIVED_READONLY: AoudaValidationError,
|
|
1488
|
+
TRANSFORM_ROUTE_UNMATCHED: AoudaValidationError,
|
|
1489
|
+
TRANSFORM_ROUTE_AMBIGUOUS: AoudaValidationError,
|
|
1484
1490
|
UNSUPPORTED_VERSION: AoudaValidationError,
|
|
1485
1491
|
MALFORMED_REQUEST: AoudaValidationError,
|
|
1486
1492
|
INTERNAL_ERROR: AoudaServerError,
|
|
@@ -1541,6 +1547,9 @@ function parseRetryAfterSeconds(header) {
|
|
|
1541
1547
|
if (!Number.isFinite(n) || n < 0) return void 0;
|
|
1542
1548
|
return n;
|
|
1543
1549
|
}
|
|
1550
|
+
function nonEmptyRowErrors(rowErrors) {
|
|
1551
|
+
return Array.isArray(rowErrors) && rowErrors.length > 0 ? rowErrors : void 0;
|
|
1552
|
+
}
|
|
1544
1553
|
function createApiError(statusCode, statusText, body, retryAfterHeader) {
|
|
1545
1554
|
const message = body.error ?? `${statusCode} ${statusText}`;
|
|
1546
1555
|
const code = body.code ?? "UNKNOWN";
|
|
@@ -1548,7 +1557,16 @@ function createApiError(statusCode, statusText, body, retryAfterHeader) {
|
|
|
1548
1557
|
const requestId = body.requestId;
|
|
1549
1558
|
const retryAfterSeconds = parseRetryAfterSeconds(retryAfterHeader ?? null);
|
|
1550
1559
|
const Ctor = ERROR_CODE_MAP[code] ?? AoudaApiError;
|
|
1551
|
-
return new Ctor(
|
|
1560
|
+
return new Ctor(
|
|
1561
|
+
message,
|
|
1562
|
+
code,
|
|
1563
|
+
statusCode,
|
|
1564
|
+
details,
|
|
1565
|
+
requestId,
|
|
1566
|
+
retryAfterSeconds,
|
|
1567
|
+
body.token,
|
|
1568
|
+
nonEmptyRowErrors(body.rowErrors)
|
|
1569
|
+
);
|
|
1552
1570
|
}
|
|
1553
1571
|
var HttpTransport = class {
|
|
1554
1572
|
constructor(options) {
|
|
@@ -1662,7 +1680,8 @@ var HttpTransport = class {
|
|
|
1662
1680
|
errorBody?.details,
|
|
1663
1681
|
errorBody?.requestId,
|
|
1664
1682
|
void 0,
|
|
1665
|
-
errorBody?.token
|
|
1683
|
+
errorBody?.token,
|
|
1684
|
+
nonEmptyRowErrors(errorBody?.rowErrors)
|
|
1666
1685
|
);
|
|
1667
1686
|
}
|
|
1668
1687
|
if (errorBody?.code != null) {
|
|
@@ -1781,7 +1800,8 @@ var HttpTransport = class {
|
|
|
1781
1800
|
errorBody?.details,
|
|
1782
1801
|
errorBody?.requestId,
|
|
1783
1802
|
void 0,
|
|
1784
|
-
errorBody?.token
|
|
1803
|
+
errorBody?.token,
|
|
1804
|
+
nonEmptyRowErrors(errorBody?.rowErrors)
|
|
1785
1805
|
);
|
|
1786
1806
|
}
|
|
1787
1807
|
if (errorBody?.code != null) {
|
|
@@ -2871,8 +2891,11 @@ var TableWriteStream = class {
|
|
|
2871
2891
|
resolve4?.();
|
|
2872
2892
|
}
|
|
2873
2893
|
_handleServerError(message) {
|
|
2894
|
+
const rowErrors = Array.isArray(message.errors) && message.errors.length > 0 ? message.errors : void 0;
|
|
2874
2895
|
const error = new AoudaConnectionError(
|
|
2875
|
-
`Write stream error (${message.code}): ${message.message}
|
|
2896
|
+
`Write stream error (${message.code}): ${message.message}`,
|
|
2897
|
+
void 0,
|
|
2898
|
+
rowErrors
|
|
2876
2899
|
);
|
|
2877
2900
|
const openReject = this._openReject;
|
|
2878
2901
|
this._openResolve = null;
|
|
@@ -3324,6 +3347,12 @@ var TableQuery = class _TableQuery {
|
|
|
3324
3347
|
* evaluated per row on the server. Computed columns are appended after any physical-column
|
|
3325
3348
|
* `select()` projection.
|
|
3326
3349
|
*
|
|
3350
|
+
* Result types are inferred by the server where the expression permits
|
|
3351
|
+
* (e.g. Int32 → `number`). Uninferable expressions use wire `"Unknown"` /
|
|
3352
|
+
* codegen `unknown`. Computed columns are always nullable. Named-query
|
|
3353
|
+
* `*Row` properties pick this up when regenerated against a post-S08 server.
|
|
3354
|
+
* See aouda-docs/guides/browser-tier-read-limits.md#selectexpr-result-types
|
|
3355
|
+
*
|
|
3327
3356
|
* @param projections - One or more `{ alias, expr }` pairs.
|
|
3328
3357
|
* @returns A new TableQuery with computed columns set.
|
|
3329
3358
|
*
|