@dimah-s3/react 1.5.7 → 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.
@@ -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 APIError {
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,QAAQ;IACzC,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,EAKpB;CACF;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,WAAW,GAAG,QAAQ,CAqBzE;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"}
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"}
@@ -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,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC"}
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 +1 @@
1
- {"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../src/upload/retry.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAiC3C,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
+ {"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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dimah-s3/react",
3
- "version": "1.5.7",
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
- "author": "Hamidrezakz",
27
- "license": "MIT",
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
- "homepage": "https://s3.dimah.dev/docs/react",
34
- "bugs": {
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,14 +50,10 @@
50
50
  "dist"
51
51
  ],
52
52
  "dependencies": {
53
- "@dimah-s3/core": "1.5.7",
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.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",
@@ -73,16 +69,20 @@
73
69
  "tsc-alias": "^1.9.5",
74
70
  "tsup": "^8.5.1",
75
71
  "typescript": "7.0.2",
76
- "vitest": "^5.0.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 --max-warnings 0",
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
  }