@shipstatic/drop 0.3.5 → 0.3.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/README.md +2 -2
- package/dist/index.cjs +36 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +36 -23
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -29,7 +29,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
29
29
|
|
|
30
30
|
// node_modules/.pnpm/mime-db@1.54.0/node_modules/mime-db/db.json
|
|
31
31
|
var require_db = __commonJS({
|
|
32
|
-
"node_modules/.pnpm/mime-db@1.54.0/node_modules/mime-db/db.json"(exports
|
|
32
|
+
"node_modules/.pnpm/mime-db@1.54.0/node_modules/mime-db/db.json"(exports, module) {
|
|
33
33
|
module.exports = {
|
|
34
34
|
"application/1d-interleaved-parityfec": {
|
|
35
35
|
source: "iana"
|
|
@@ -9377,30 +9377,43 @@ var require_db = __commonJS({
|
|
|
9377
9377
|
|
|
9378
9378
|
// node_modules/.pnpm/mime-db@1.54.0/node_modules/mime-db/index.js
|
|
9379
9379
|
var require_mime_db = __commonJS({
|
|
9380
|
-
"node_modules/.pnpm/mime-db@1.54.0/node_modules/mime-db/index.js"(exports
|
|
9380
|
+
"node_modules/.pnpm/mime-db@1.54.0/node_modules/mime-db/index.js"(exports, module) {
|
|
9381
9381
|
module.exports = require_db();
|
|
9382
9382
|
}
|
|
9383
9383
|
});
|
|
9384
9384
|
|
|
9385
|
-
// node_modules/.pnpm/@shipstatic+types@0.8
|
|
9386
|
-
var ErrorType
|
|
9387
|
-
(
|
|
9388
|
-
|
|
9389
|
-
|
|
9390
|
-
|
|
9391
|
-
|
|
9392
|
-
|
|
9393
|
-
|
|
9394
|
-
|
|
9395
|
-
|
|
9396
|
-
|
|
9397
|
-
|
|
9398
|
-
|
|
9399
|
-
(
|
|
9400
|
-
|
|
9401
|
-
|
|
9402
|
-
|
|
9403
|
-
|
|
9385
|
+
// node_modules/.pnpm/@shipstatic+types@0.9.8/node_modules/@shipstatic/types/dist/index.js
|
|
9386
|
+
var ErrorType = {
|
|
9387
|
+
/** Validation failed (400). Input shape is wrong. */
|
|
9388
|
+
Validation: "validation_failed",
|
|
9389
|
+
/** Resource not found (404). */
|
|
9390
|
+
NotFound: "not_found",
|
|
9391
|
+
/** Authenticated but not allowed (403). User lacks permission for this action. */
|
|
9392
|
+
Forbidden: "forbidden",
|
|
9393
|
+
/** Rate limit exceeded (429). */
|
|
9394
|
+
RateLimit: "rate_limit_exceeded",
|
|
9395
|
+
/** Authentication required or failed (401). Missing/invalid credentials. */
|
|
9396
|
+
Authentication: "authentication_failed",
|
|
9397
|
+
/** Business rule violation. Catch-all for 4xx state-rule errors that aren't more specific. */
|
|
9398
|
+
Business: "business_logic_error",
|
|
9399
|
+
/** API server error (500). Generic server-side fault. */
|
|
9400
|
+
Api: "internal_server_error",
|
|
9401
|
+
/** Network/connection error. Client-side only — set by HTTP clients on fetch failure; never produced server-side. */
|
|
9402
|
+
Network: "network_error",
|
|
9403
|
+
/** Operation was cancelled. Client-side only — set on `AbortSignal` abort; never produced server-side. */
|
|
9404
|
+
Cancelled: "operation_cancelled",
|
|
9405
|
+
/** File operation error. Client-side only — set by SDK during local file processing; never produced server-side. */
|
|
9406
|
+
File: "file_error",
|
|
9407
|
+
/** Configuration error. Client-side only — set by SDK during config parsing/validation; never produced server-side. */
|
|
9408
|
+
Config: "config_error"
|
|
9409
|
+
};
|
|
9410
|
+
var CLIENT_ONLY_ERROR_TYPES = /* @__PURE__ */ new Set([
|
|
9411
|
+
ErrorType.Network,
|
|
9412
|
+
ErrorType.Cancelled,
|
|
9413
|
+
ErrorType.File,
|
|
9414
|
+
ErrorType.Config
|
|
9415
|
+
]);
|
|
9416
|
+
new Set(Object.values(ErrorType).filter((t) => !CLIENT_ONLY_ERROR_TYPES.has(t)));
|
|
9404
9417
|
function isShipError(error) {
|
|
9405
9418
|
return error !== null && typeof error === "object" && "name" in error && error.name === "ShipError" && "status" in error;
|
|
9406
9419
|
}
|
|
@@ -10178,8 +10191,8 @@ function useDrop(options) {
|
|
|
10178
10191
|
// Use full path to match server-side validation
|
|
10179
10192
|
size: f.file.size
|
|
10180
10193
|
}));
|
|
10181
|
-
const
|
|
10182
|
-
const validation = validateFiles(validatableFiles,
|
|
10194
|
+
const limits = await ship.getLimits();
|
|
10195
|
+
const validation = validateFiles(validatableFiles, limits);
|
|
10183
10196
|
const filesWithStatus = finalFiles.map((processedFile, idx) => ({
|
|
10184
10197
|
...processedFile,
|
|
10185
10198
|
status: validation.files[idx]?.status || processedFile.status,
|