@tinycloud/sdk-services 3.6.0-beta.2 → 3.6.0
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/index.cjs +19 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +19 -2
- package/dist/index.js.map +1 -1
- package/dist/sql/index.cjs +17 -1
- package/dist/sql/index.cjs.map +1 -1
- package/dist/sql/index.js +17 -1
- package/dist/sql/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3622,6 +3622,21 @@ function requiresSecretsOptIn(space, prefix) {
|
|
|
3622
3622
|
return prefix.split("/", 1)[0] === "vault";
|
|
3623
3623
|
}
|
|
3624
3624
|
|
|
3625
|
+
// src/statementSize.ts
|
|
3626
|
+
function requestTooLargeError(engine, operation, status, errorText) {
|
|
3627
|
+
if (status !== 413) return void 0;
|
|
3628
|
+
const nodeCode = errorText.split(":", 1)[0].trim();
|
|
3629
|
+
let request;
|
|
3630
|
+
if (nodeCode === `${engine}_request_too_large`) {
|
|
3631
|
+
request = true;
|
|
3632
|
+
} else if (nodeCode === `${engine}_response_too_large`) {
|
|
3633
|
+
request = false;
|
|
3634
|
+
} else {
|
|
3635
|
+
request = ["batch", "executeStatement", "import"].includes(operation);
|
|
3636
|
+
}
|
|
3637
|
+
return request ? `${engine.toUpperCase()}_REQUEST_TOO_LARGE` : void 0;
|
|
3638
|
+
}
|
|
3639
|
+
|
|
3625
3640
|
// src/sql/SQLMigrations.ts
|
|
3626
3641
|
var SQLMigrations = class {
|
|
3627
3642
|
constructor(service, dbName) {
|
|
@@ -4041,7 +4056,8 @@ var SQLService = class extends BaseService {
|
|
|
4041
4056
|
const retryError = nodeRetryError("sql", `SQL ${operation} failed: ${response.status} - ${errorText}`, response, errorText);
|
|
4042
4057
|
if (retryError) return err(retryError);
|
|
4043
4058
|
const errorBody = parseServiceErrorBody(errorText);
|
|
4044
|
-
const
|
|
4059
|
+
const sizeCode = requestTooLargeError("sql", operation, response.status, errorText);
|
|
4060
|
+
const errorCode = sizeCode ?? this.mapHttpStatusToErrorCode(
|
|
4045
4061
|
response.status,
|
|
4046
4062
|
errorBody.error
|
|
4047
4063
|
);
|
|
@@ -4507,7 +4523,8 @@ var DuckDbService = class extends BaseService {
|
|
|
4507
4523
|
const retryError = nodeRetryError("duckdb", `DuckDB ${operation} failed: ${response.status} - ${errorText}`, response, errorText);
|
|
4508
4524
|
if (retryError) return err(retryError);
|
|
4509
4525
|
const errorBody = parseServiceErrorBody(errorText);
|
|
4510
|
-
const
|
|
4526
|
+
const sizeCode = requestTooLargeError("duckdb", operation, response.status, errorText);
|
|
4527
|
+
const errorCode = sizeCode ?? this.mapHttpStatusToErrorCode(
|
|
4511
4528
|
response.status,
|
|
4512
4529
|
errorBody.error
|
|
4513
4530
|
);
|