@dimah-s3/react 1.5.6 → 1.5.8
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/LICENSE +1 -1
- package/dist/engine.js +17 -11
- package/dist/engine.js.map +1 -1
- package/dist/helpers/throttled-speed.d.ts +1 -1
- package/dist/hooks/use-delete.d.ts +1 -1
- package/dist/hooks/use-download.d.ts +3 -3
- package/dist/hooks/use-file-upload.d.ts +1 -1
- package/dist/hooks/use-route-upload-policy.d.ts +1 -1
- package/dist/hooks/use-route-upload-policy.d.ts.map +1 -1
- package/dist/hooks/use-upload.d.ts +1 -1
- package/dist/index.js +41 -34
- package/dist/index.js.map +1 -1
- package/dist/store/index.d.ts +1 -1
- package/dist/store/local-storage-store.d.ts +1 -1
- package/dist/store/memory-store.d.ts +1 -1
- package/dist/types/error.d.ts +6 -2
- package/dist/types/error.d.ts.map +1 -1
- package/dist/types/index.d.ts +4 -4
- package/dist/types/index.d.ts.map +1 -1
- package/dist/upload/multipart.d.ts +2 -2
- package/dist/upload/presigned-http.d.ts +1 -1
- package/dist/upload/retry.d.ts +1 -1
- package/dist/upload/retry.d.ts.map +1 -1
- package/dist/upload/upload-file.d.ts +1 -1
- package/dist/upload/upload-files.d.ts +1 -1
- package/package.json +18 -18
package/dist/store/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { StoredUpload, UploadStore } from "../types/upload-store";
|
|
1
|
+
export type { StoredUpload, UploadStore } from "../types/upload-store.d.ts";
|
|
2
2
|
export { createLocalStorageStore } from "./local-storage-store";
|
|
3
3
|
export { createMemoryStore } from "./memory-store";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { UploadStore } from "../types/upload-store";
|
|
1
|
+
import type { UploadStore } from "../types/upload-store.d.ts";
|
|
2
2
|
/**
|
|
3
3
|
* Default `UploadStore` implementation backed by `localStorage`.
|
|
4
4
|
* Stores one pending upload per resume identity (`route:name:size:mtime`).
|
package/dist/types/error.d.ts
CHANGED
|
@@ -6,15 +6,19 @@ import type { UploadPhase } from "./upload";
|
|
|
6
6
|
* Protocol errors from `S3Api` stay {@link APIError} — do not wrap them
|
|
7
7
|
* or the stable `code` is lost for i18n.
|
|
8
8
|
*/
|
|
9
|
-
export declare class S3UploadError extends
|
|
9
|
+
export declare class S3UploadError extends Error {
|
|
10
|
+
readonly name = "S3UploadError";
|
|
11
|
+
readonly code: string;
|
|
12
|
+
readonly status: number;
|
|
10
13
|
readonly phase: UploadPhase | undefined;
|
|
11
14
|
constructor(message: string, code: string, status?: number, phase?: UploadPhase);
|
|
15
|
+
get statusCode(): number;
|
|
12
16
|
}
|
|
13
17
|
/**
|
|
14
18
|
* Normalize unknown throws for the upload engine.
|
|
15
19
|
* Preserves AbortError and {@link APIError}; wraps everything else.
|
|
16
20
|
*/
|
|
17
|
-
export declare function toUploadError(err: unknown, phase?: UploadPhase): APIError;
|
|
21
|
+
export declare function toUploadError(err: unknown, phase?: UploadPhase): APIError | S3UploadError;
|
|
18
22
|
/** Normalize unknown throws for hook `error` state. */
|
|
19
23
|
export declare function toHookError(err: unknown, fallback?: string): APIError;
|
|
20
24
|
export declare function isAbortError(err: unknown): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/types/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAc,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C;;;;;GAKG;AACH,qBAAa,aAAc,SAAQ,
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/types/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAc,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C;;;;;GAKG;AACH,qBAAa,aAAc,SAAQ,KAAK;IACtC,SAAkB,IAAI,mBAAmB;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,CAAC;IAExC,YACE,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,MAAM,SAAM,EACZ,KAAK,CAAC,EAAE,WAAW,EAMpB;IAED,IAAI,UAAU,IAAI,MAAM,CAEvB;CACF;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,OAAO,EACZ,KAAK,CAAC,EAAE,WAAW,GAClB,QAAQ,GAAG,aAAa,CAgB1B;AAED,uDAAuD;AACvD,wBAAgB,WAAW,CACzB,GAAG,EAAE,OAAO,EACZ,QAAQ,SAAmB,GAC1B,QAAQ,CAIV;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAUlD;AAED,gEAAgE;AAChE,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,CAE1D"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from "./upload";
|
|
2
|
-
export * from "./upload-store";
|
|
1
|
+
export type * from "./upload";
|
|
2
|
+
export type * from "./upload-store";
|
|
3
3
|
export * from "./error";
|
|
4
|
-
export * from "./download";
|
|
5
|
-
export * from "./delete";
|
|
4
|
+
export type * from "./download";
|
|
5
|
+
export type * from "./delete";
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,UAAU,CAAC;AAC9B,mBAAmB,gBAAgB,CAAC;AACpC,cAAc,SAAS,CAAC;AACxB,mBAAmB,YAAY,CAAC;AAChC,mBAAmB,UAAU,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { UploadProgress, UploadRequestOptions, RetryConfig, UploadResult } from "../types";
|
|
1
|
+
import type { UploadProgress, UploadRequestOptions, RetryConfig, UploadResult } from "../types/index.d.ts";
|
|
2
2
|
import { type S3Api } from "@dimah-s3/core";
|
|
3
|
-
import type { UploadStore } from "../types/upload-store";
|
|
3
|
+
import type { UploadStore } from "../types/upload-store.d.ts";
|
|
4
4
|
export declare function uploadMultipart(api: S3Api, file: File, route: string, partSize: number, concurrentParts: number, onProgress?: (progress: UploadProgress) => void, signal?: AbortSignal, requestOptions?: UploadRequestOptions, retryConfig?: RetryConfig, uploadStore?: UploadStore | false, onPartUpload?: (partNumber: number, totalParts: number) => void, onMultipartInit?: (uploadId: string, key: string) => void): Promise<UploadResult>;
|
|
5
5
|
//# sourceMappingURL=multipart.d.ts.map
|
package/dist/upload/retry.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { RetryConfig } from "../types";
|
|
1
|
+
import type { RetryConfig } from "../types/index.d.ts";
|
|
2
2
|
export declare function withRetry<T>(fn: () => Promise<T>, retryConfig: RetryConfig | undefined, signal?: AbortSignal): Promise<T>;
|
|
3
3
|
//# sourceMappingURL=retry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../src/upload/retry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../src/upload/retry.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAsC3C,wBAAsB,SAAS,CAAC,CAAC,EAC/B,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,WAAW,EAAE,WAAW,GAAG,SAAS,EACpC,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,CAAC,CAAC,CAkBZ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FileUploadConfig, UploadProgress, UploadResult, UploadRequestOptions } from "../types";
|
|
1
|
+
import type { FileUploadConfig, UploadProgress, UploadResult, UploadRequestOptions } from "../types/index.d.ts";
|
|
2
2
|
import { type S3Api } from "@dimah-s3/core";
|
|
3
3
|
export type UploadEngineCallbacks = {
|
|
4
4
|
onProgress?: (progress: UploadProgress) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FileUploadConfig, UploadPhase, UploadProgress, UploadResult, UploadRequestOptions } from "../types";
|
|
1
|
+
import type { FileUploadConfig, UploadPhase, UploadProgress, UploadResult, UploadRequestOptions } from "../types/index.d.ts";
|
|
2
2
|
import type { APIError, S3Api } from "@dimah-s3/core";
|
|
3
3
|
export type FileItemStatus = "pending" | "uploading" | "success" | "error";
|
|
4
4
|
export type FileItem = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dimah-s3/react",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.8",
|
|
4
4
|
"description": "Headless React hooks for presigned S3 file uploads, downloads, and deletes",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"s3",
|
|
@@ -23,17 +23,17 @@
|
|
|
23
23
|
"headless",
|
|
24
24
|
"typescript"
|
|
25
25
|
],
|
|
26
|
-
"
|
|
27
|
-
"
|
|
26
|
+
"homepage": "https://s3.dimah.dev/docs/react",
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/dimah-kz/dimah-s3/issues"
|
|
29
|
+
},
|
|
28
30
|
"repository": {
|
|
29
31
|
"type": "git",
|
|
30
32
|
"url": "https://github.com/dimah-kz/dimah-s3.git",
|
|
31
33
|
"directory": "packages/react"
|
|
32
34
|
},
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"url": "https://github.com/dimah-kz/dimah-s3/issues"
|
|
36
|
-
},
|
|
35
|
+
"license": "MIT",
|
|
36
|
+
"author": "dimah",
|
|
37
37
|
"sideEffects": false,
|
|
38
38
|
"type": "module",
|
|
39
39
|
"exports": {
|
|
@@ -50,39 +50,39 @@
|
|
|
50
50
|
"dist"
|
|
51
51
|
],
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@dimah-s3/core": "1.5.
|
|
53
|
+
"@dimah-s3/core": "1.5.8",
|
|
54
54
|
"@fuma-translate/react": "^1.0.2",
|
|
55
55
|
"immer": "^11.1.18",
|
|
56
|
-
"react-dropzone": "^20.1.
|
|
57
|
-
},
|
|
58
|
-
"peerDependencies": {
|
|
59
|
-
"@fuma-translate/react": "^1.0.2",
|
|
60
|
-
"react": ">=18"
|
|
56
|
+
"react-dropzone": "^20.1.2"
|
|
61
57
|
},
|
|
62
58
|
"devDependencies": {
|
|
63
59
|
"@types/react": "^19.3.0",
|
|
64
60
|
"@types/react-dom": "^19.3.0",
|
|
65
61
|
"@workspace/eslint-config": "0.0.1",
|
|
66
62
|
"@workspace/typescript-config": "0.0.1",
|
|
67
|
-
"@workspace/vitest-config": "0.0.
|
|
63
|
+
"@workspace/vitest-config": "0.0.7",
|
|
68
64
|
"eslint": "^10.10.0",
|
|
69
65
|
"fuma-translate": "^1.0.2",
|
|
70
66
|
"jsdom": "^30.0.1",
|
|
71
67
|
"react": "^19.3.0",
|
|
72
68
|
"react-dom": "^19.3.0",
|
|
73
|
-
"tsc-alias": "^1.9.
|
|
69
|
+
"tsc-alias": "^1.9.5",
|
|
74
70
|
"tsup": "^8.5.1",
|
|
75
71
|
"typescript": "7.0.2",
|
|
76
|
-
"vitest": "^5.0.
|
|
72
|
+
"vitest": "^5.0.1"
|
|
73
|
+
},
|
|
74
|
+
"peerDependencies": {
|
|
75
|
+
"@fuma-translate/react": "^1.0.2",
|
|
76
|
+
"react": ">=18"
|
|
77
77
|
},
|
|
78
78
|
"publishConfig": {
|
|
79
79
|
"access": "public"
|
|
80
80
|
},
|
|
81
81
|
"scripts": {
|
|
82
|
-
"compile:translations": "node ./scripts/compile-translations.mjs",
|
|
83
82
|
"build": "pnpm compile:translations && tsup --config tsup.config.ts && tsc --emitDeclarationOnly -p tsconfig.build.json && tsc-alias",
|
|
84
|
-
"lint": "eslint",
|
|
85
83
|
"check-types": "pnpm compile:translations && tsc --noEmit",
|
|
84
|
+
"compile:translations": "node ./scripts/compile-translations.mjs",
|
|
85
|
+
"lint": "eslint --cache --cache-strategy content --max-warnings 0",
|
|
86
86
|
"test": "vitest run"
|
|
87
87
|
}
|
|
88
88
|
}
|