@twin.org/web 0.0.1 → 0.0.2-next.3

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.
@@ -619,12 +619,15 @@ class FetchHelper {
619
619
  }
620
620
  }
621
621
  const errorResponseData = await response.json();
622
+ const errorResponse = core.BaseError.fromError(errorResponseData);
623
+ const isErrorEmpty = core.BaseError.isEmpty(errorResponse);
622
624
  // False positive as FetchError is derived from Error
623
625
  // eslint-disable-next-line @typescript-eslint/only-throw-error
624
626
  throw new FetchError(source, `${FetchHelper._CLASS_NAME_CAMEL_CASE}.failureStatusText`, response.status, {
625
627
  statusText: response.statusText,
626
- url
627
- }, errorResponseData);
628
+ url,
629
+ data: isErrorEmpty ? errorResponseData : undefined
630
+ }, isErrorEmpty ? undefined : errorResponse);
628
631
  }
629
632
  /**
630
633
  * Perform a request for binary data.
@@ -669,12 +672,15 @@ class FetchHelper {
669
672
  }
670
673
  }
671
674
  const errorResponseData = await response.json();
675
+ const errorResponse = core.BaseError.fromError(errorResponseData);
676
+ const isErrorEmpty = core.BaseError.isEmpty(errorResponse);
672
677
  // False positive as FetchError is derived from Error
673
678
  // eslint-disable-next-line @typescript-eslint/only-throw-error
674
679
  throw new FetchError(source, `${FetchHelper._CLASS_NAME_CAMEL_CASE}.failureStatusText`, response.status, {
675
680
  statusText: response.statusText,
676
- url
677
- }, errorResponseData);
681
+ url,
682
+ data: isErrorEmpty ? errorResponseData : undefined
683
+ }, isErrorEmpty ? undefined : errorResponse);
678
684
  }
679
685
  /**
680
686
  * Clears the cache.
@@ -617,12 +617,15 @@ class FetchHelper {
617
617
  }
618
618
  }
619
619
  const errorResponseData = await response.json();
620
+ const errorResponse = BaseError.fromError(errorResponseData);
621
+ const isErrorEmpty = BaseError.isEmpty(errorResponse);
620
622
  // False positive as FetchError is derived from Error
621
623
  // eslint-disable-next-line @typescript-eslint/only-throw-error
622
624
  throw new FetchError(source, `${FetchHelper._CLASS_NAME_CAMEL_CASE}.failureStatusText`, response.status, {
623
625
  statusText: response.statusText,
624
- url
625
- }, errorResponseData);
626
+ url,
627
+ data: isErrorEmpty ? errorResponseData : undefined
628
+ }, isErrorEmpty ? undefined : errorResponse);
626
629
  }
627
630
  /**
628
631
  * Perform a request for binary data.
@@ -667,12 +670,15 @@ class FetchHelper {
667
670
  }
668
671
  }
669
672
  const errorResponseData = await response.json();
673
+ const errorResponse = BaseError.fromError(errorResponseData);
674
+ const isErrorEmpty = BaseError.isEmpty(errorResponse);
670
675
  // False positive as FetchError is derived from Error
671
676
  // eslint-disable-next-line @typescript-eslint/only-throw-error
672
677
  throw new FetchError(source, `${FetchHelper._CLASS_NAME_CAMEL_CASE}.failureStatusText`, response.status, {
673
678
  statusText: response.statusText,
674
- url
675
- }, errorResponseData);
679
+ url,
680
+ data: isErrorEmpty ? errorResponseData : undefined
681
+ }, isErrorEmpty ? undefined : errorResponse);
676
682
  }
677
683
  /**
678
684
  * Clears the cache.
package/docs/changelog.md CHANGED
@@ -1,5 +1,104 @@
1
1
  # @twin.org/web - Changelog
2
2
 
3
+ ## [0.0.2-next.3](https://github.com/twinfoundation/framework/compare/web-v0.0.2-next.2...web-v0.0.2-next.3) (2025-08-06)
4
+
5
+
6
+ ### Features
7
+
8
+ * add guards arrayEndsWith and arrayStartsWith ([95d875e](https://github.com/twinfoundation/framework/commit/95d875ec8ccb4713c145fdde941d4cfedcec2ed3))
9
+ * add kid method to Jwk ([bc9239e](https://github.com/twinfoundation/framework/commit/bc9239ed9896a053d83e00ca221e962704ebc277))
10
+ * add rsa cipher support ([7af6cc6](https://github.com/twinfoundation/framework/commit/7af6cc67512d3363bd4a2f2e87bd7733c2800147))
11
+ * add set method for async caches ([ba34b55](https://github.com/twinfoundation/framework/commit/ba34b55e651ad56ab8fc59e139e4af631c19cda0))
12
+ * add zlib/deflate mime types detection ([72c472b](https://github.com/twinfoundation/framework/commit/72c472b5a35a973e7109336f5b6cdd84dbb8bbcb))
13
+ * ensure the alg is the correct one when generating JWK or JWS ([#136](https://github.com/twinfoundation/framework/issues/136)) ([46a5af1](https://github.com/twinfoundation/framework/commit/46a5af127192d7048068275d14f555f09add3642))
14
+ * propagate includeStackTrace on error conversion ([098fc72](https://github.com/twinfoundation/framework/commit/098fc729939ea3127f2bdcc0ddb6754096c5f919))
15
+ * relocate core packages from tools ([bcab8f3](https://github.com/twinfoundation/framework/commit/bcab8f3160442ea4fcaf442947462504f3d6a17d))
16
+ * update dependencies ([f3bd015](https://github.com/twinfoundation/framework/commit/f3bd015efd169196b7e0335f5cab876ba6ca1d75))
17
+ * use new shared store mechanism ([#131](https://github.com/twinfoundation/framework/issues/131)) ([934385b](https://github.com/twinfoundation/framework/commit/934385b2fbaf9f5c00a505ebf9d093bd5a425f55))
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * wrap inner error within FetchError / 2 ([#134](https://github.com/twinfoundation/framework/issues/134)) ([2ddb101](https://github.com/twinfoundation/framework/commit/2ddb101c3778be4e99559e37aa036cd7101585fb))
23
+
24
+
25
+ ### Dependencies
26
+
27
+ * The following workspace dependencies were updated
28
+ * dependencies
29
+ * @twin.org/core bumped from 0.0.2-next.2 to 0.0.2-next.3
30
+ * @twin.org/crypto bumped from 0.0.2-next.2 to 0.0.2-next.3
31
+ * @twin.org/nameof bumped from 0.0.2-next.2 to 0.0.2-next.3
32
+ * devDependencies
33
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.2 to 0.0.2-next.3
34
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.2 to 0.0.2-next.3
35
+
36
+ ## [0.0.2-next.2](https://github.com/twinfoundation/framework/compare/web-v0.0.2-next.1...web-v0.0.2-next.2) (2025-08-06)
37
+
38
+
39
+ ### Features
40
+
41
+ * add guards arrayEndsWith and arrayStartsWith ([95d875e](https://github.com/twinfoundation/framework/commit/95d875ec8ccb4713c145fdde941d4cfedcec2ed3))
42
+ * add kid method to Jwk ([bc9239e](https://github.com/twinfoundation/framework/commit/bc9239ed9896a053d83e00ca221e962704ebc277))
43
+ * add rsa cipher support ([7af6cc6](https://github.com/twinfoundation/framework/commit/7af6cc67512d3363bd4a2f2e87bd7733c2800147))
44
+ * add set method for async caches ([ba34b55](https://github.com/twinfoundation/framework/commit/ba34b55e651ad56ab8fc59e139e4af631c19cda0))
45
+ * add zlib/deflate mime types detection ([72c472b](https://github.com/twinfoundation/framework/commit/72c472b5a35a973e7109336f5b6cdd84dbb8bbcb))
46
+ * ensure the alg is the correct one when generating JWK or JWS ([#136](https://github.com/twinfoundation/framework/issues/136)) ([46a5af1](https://github.com/twinfoundation/framework/commit/46a5af127192d7048068275d14f555f09add3642))
47
+ * propagate includeStackTrace on error conversion ([098fc72](https://github.com/twinfoundation/framework/commit/098fc729939ea3127f2bdcc0ddb6754096c5f919))
48
+ * relocate core packages from tools ([bcab8f3](https://github.com/twinfoundation/framework/commit/bcab8f3160442ea4fcaf442947462504f3d6a17d))
49
+ * update dependencies ([f3bd015](https://github.com/twinfoundation/framework/commit/f3bd015efd169196b7e0335f5cab876ba6ca1d75))
50
+ * use new shared store mechanism ([#131](https://github.com/twinfoundation/framework/issues/131)) ([934385b](https://github.com/twinfoundation/framework/commit/934385b2fbaf9f5c00a505ebf9d093bd5a425f55))
51
+
52
+
53
+ ### Bug Fixes
54
+
55
+ * wrap inner error within FetchError / 2 ([#134](https://github.com/twinfoundation/framework/issues/134)) ([2ddb101](https://github.com/twinfoundation/framework/commit/2ddb101c3778be4e99559e37aa036cd7101585fb))
56
+
57
+
58
+ ### Dependencies
59
+
60
+ * The following workspace dependencies were updated
61
+ * dependencies
62
+ * @twin.org/core bumped from 0.0.2-next.1 to 0.0.2-next.2
63
+ * @twin.org/crypto bumped from 0.0.2-next.1 to 0.0.2-next.2
64
+ * @twin.org/nameof bumped from 0.0.2-next.1 to 0.0.2-next.2
65
+ * devDependencies
66
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.1 to 0.0.2-next.2
67
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.1 to 0.0.2-next.2
68
+
69
+ ## [0.0.2-next.1](https://github.com/twinfoundation/framework/compare/web-v0.0.2-next.0...web-v0.0.2-next.1) (2025-08-06)
70
+
71
+
72
+ ### Features
73
+
74
+ * add guards arrayEndsWith and arrayStartsWith ([95d875e](https://github.com/twinfoundation/framework/commit/95d875ec8ccb4713c145fdde941d4cfedcec2ed3))
75
+ * add kid method to Jwk ([bc9239e](https://github.com/twinfoundation/framework/commit/bc9239ed9896a053d83e00ca221e962704ebc277))
76
+ * add rsa cipher support ([7af6cc6](https://github.com/twinfoundation/framework/commit/7af6cc67512d3363bd4a2f2e87bd7733c2800147))
77
+ * add set method for async caches ([ba34b55](https://github.com/twinfoundation/framework/commit/ba34b55e651ad56ab8fc59e139e4af631c19cda0))
78
+ * add zlib/deflate mime types detection ([72c472b](https://github.com/twinfoundation/framework/commit/72c472b5a35a973e7109336f5b6cdd84dbb8bbcb))
79
+ * ensure the alg is the correct one when generating JWK or JWS ([#136](https://github.com/twinfoundation/framework/issues/136)) ([46a5af1](https://github.com/twinfoundation/framework/commit/46a5af127192d7048068275d14f555f09add3642))
80
+ * propagate includeStackTrace on error conversion ([098fc72](https://github.com/twinfoundation/framework/commit/098fc729939ea3127f2bdcc0ddb6754096c5f919))
81
+ * relocate core packages from tools ([bcab8f3](https://github.com/twinfoundation/framework/commit/bcab8f3160442ea4fcaf442947462504f3d6a17d))
82
+ * update dependencies ([f3bd015](https://github.com/twinfoundation/framework/commit/f3bd015efd169196b7e0335f5cab876ba6ca1d75))
83
+ * use new shared store mechanism ([#131](https://github.com/twinfoundation/framework/issues/131)) ([934385b](https://github.com/twinfoundation/framework/commit/934385b2fbaf9f5c00a505ebf9d093bd5a425f55))
84
+
85
+
86
+ ### Bug Fixes
87
+
88
+ * wrap inner error within FetchError / 2 ([#134](https://github.com/twinfoundation/framework/issues/134)) ([2ddb101](https://github.com/twinfoundation/framework/commit/2ddb101c3778be4e99559e37aa036cd7101585fb))
89
+
90
+
91
+ ### Dependencies
92
+
93
+ * The following workspace dependencies were updated
94
+ * dependencies
95
+ * @twin.org/core bumped from 0.0.2-next.0 to 0.0.2-next.1
96
+ * @twin.org/crypto bumped from 0.0.2-next.0 to 0.0.2-next.1
97
+ * @twin.org/nameof bumped from 0.0.2-next.0 to 0.0.2-next.1
98
+ * devDependencies
99
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.0 to 0.0.2-next.1
100
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.0 to 0.0.2-next.1
101
+
3
102
  ## 0.0.1 (2025-07-03)
4
103
 
5
104
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/web",
3
- "version": "0.0.1",
3
+ "version": "0.0.2-next.3",
4
4
  "description": "Contains classes for use with web operations",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,9 +14,9 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@twin.org/core": "^0.0.1",
18
- "@twin.org/crypto": "^0.0.1",
19
- "@twin.org/nameof": "^0.0.1",
17
+ "@twin.org/core": "0.0.2-next.3",
18
+ "@twin.org/crypto": "0.0.2-next.3",
19
+ "@twin.org/nameof": "0.0.2-next.3",
20
20
  "jose": "6.0.11"
21
21
  },
22
22
  "main": "./dist/cjs/index.cjs",