@shipstatic/drop 0.3.3 → 0.3.6
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 +2 -2
- package/dist/index.cjs +2 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -22
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -9381,26 +9381,6 @@ var require_mime_db = __commonJS({
|
|
|
9381
9381
|
module.exports = require_db();
|
|
9382
9382
|
}
|
|
9383
9383
|
});
|
|
9384
|
-
|
|
9385
|
-
// node_modules/.pnpm/@shipstatic+types@0.8.0/node_modules/@shipstatic/types/dist/index.js
|
|
9386
|
-
var ErrorType;
|
|
9387
|
-
(function(ErrorType2) {
|
|
9388
|
-
ErrorType2["Validation"] = "validation_failed";
|
|
9389
|
-
ErrorType2["NotFound"] = "not_found";
|
|
9390
|
-
ErrorType2["RateLimit"] = "rate_limit_exceeded";
|
|
9391
|
-
ErrorType2["Authentication"] = "authentication_failed";
|
|
9392
|
-
ErrorType2["Business"] = "business_logic_error";
|
|
9393
|
-
ErrorType2["Api"] = "internal_server_error";
|
|
9394
|
-
ErrorType2["Network"] = "network_error";
|
|
9395
|
-
ErrorType2["Cancelled"] = "operation_cancelled";
|
|
9396
|
-
ErrorType2["File"] = "file_error";
|
|
9397
|
-
ErrorType2["Config"] = "config_error";
|
|
9398
|
-
})(ErrorType || (ErrorType = {}));
|
|
9399
|
-
({
|
|
9400
|
-
client: /* @__PURE__ */ new Set([ErrorType.Business, ErrorType.Config, ErrorType.File, ErrorType.Validation]),
|
|
9401
|
-
network: /* @__PURE__ */ new Set([ErrorType.Network]),
|
|
9402
|
-
auth: /* @__PURE__ */ new Set([ErrorType.Authentication])
|
|
9403
|
-
});
|
|
9404
9384
|
function isShipError(error) {
|
|
9405
9385
|
return error !== null && typeof error === "object" && "name" in error && error.name === "ShipError" && "status" in error;
|
|
9406
9386
|
}
|
|
@@ -10178,8 +10158,8 @@ function useDrop(options) {
|
|
|
10178
10158
|
// Use full path to match server-side validation
|
|
10179
10159
|
size: f.file.size
|
|
10180
10160
|
}));
|
|
10181
|
-
const
|
|
10182
|
-
const validation = validateFiles(validatableFiles,
|
|
10161
|
+
const limits = await ship.getLimits();
|
|
10162
|
+
const validation = validateFiles(validatableFiles, limits);
|
|
10183
10163
|
const filesWithStatus = finalFiles.map((processedFile, idx) => ({
|
|
10184
10164
|
...processedFile,
|
|
10185
10165
|
status: validation.files[idx]?.status || processedFile.status,
|