@twin.org/core 0.0.2-next.12 → 0.0.2-next.14

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.
@@ -1817,10 +1817,11 @@ class AlreadyExistsError extends BaseError {
1817
1817
  * @param source The source of the error.
1818
1818
  * @param message The message as a code.
1819
1819
  * @param existingId The id for the item.
1820
+ * @param properties Any additional information for the error.
1820
1821
  * @param cause The cause of the error if we have wrapped another error.
1821
1822
  */
1822
- constructor(source, message, existingId, cause) {
1823
- super(AlreadyExistsError.CLASS_NAME, source, message, { existingId });
1823
+ constructor(source, message, existingId, properties, cause) {
1824
+ super(AlreadyExistsError.CLASS_NAME, source, message, { existingId, ...properties }, cause);
1824
1825
  }
1825
1826
  }
1826
1827
 
@@ -1838,10 +1839,11 @@ class ConflictError extends BaseError {
1838
1839
  * @param message The message as a code.
1839
1840
  * @param conflictId The id that has conflicts.
1840
1841
  * @param conflicts The conflicts that occurred.
1842
+ * @param properties Any additional information for the error.
1841
1843
  * @param cause The cause or the error if we have wrapped another error.
1842
1844
  */
1843
- constructor(source, message, conflictId, conflicts, cause) {
1844
- super(ConflictError.CLASS_NAME, source, message, { conflictId, conflicts }, cause);
1845
+ constructor(source, message, conflictId, conflicts, properties, cause) {
1846
+ super(ConflictError.CLASS_NAME, source, message, { conflictId, conflicts, ...properties }, cause);
1845
1847
  }
1846
1848
  }
1847
1849
 
@@ -1858,10 +1860,11 @@ class NotFoundError extends BaseError {
1858
1860
  * @param source The source of the error.
1859
1861
  * @param message The message as a code.
1860
1862
  * @param notFoundId The id for the item.
1863
+ * @param properties Any additional information for the error.
1861
1864
  * @param cause The cause of the error if we have wrapped another error.
1862
1865
  */
1863
- constructor(source, message, notFoundId, cause) {
1864
- super(NotFoundError.CLASS_NAME, source, message, { notFoundId }, cause);
1866
+ constructor(source, message, notFoundId, properties, cause) {
1867
+ super(NotFoundError.CLASS_NAME, source, message, { notFoundId, ...properties }, cause);
1865
1868
  }
1866
1869
  }
1867
1870
 
@@ -1877,11 +1880,14 @@ class NotImplementedError extends BaseError {
1877
1880
  * Create a new instance of NotImplementedError.
1878
1881
  * @param source The source of the error.
1879
1882
  * @param method The method for the error.
1883
+ * @param properties Any additional information for the error.
1884
+ * @param cause The cause of the error if we have wrapped another error.
1880
1885
  */
1881
- constructor(source, method) {
1886
+ constructor(source, method, properties, cause) {
1882
1887
  super(NotImplementedError.CLASS_NAME, source, "common.notImplementedMethod", {
1883
- method
1884
- });
1888
+ method,
1889
+ ...properties
1890
+ }, cause);
1885
1891
  }
1886
1892
  }
1887
1893
 
@@ -1897,10 +1903,11 @@ class NotSupportedError extends BaseError {
1897
1903
  * Create a new instance of NotSupportedError.
1898
1904
  * @param source The source of the error.
1899
1905
  * @param message The message as a code.
1906
+ * @param properties Any additional information for the error.
1900
1907
  * @param cause The cause of the error if we have wrapped another error.
1901
1908
  */
1902
- constructor(source, message, cause) {
1903
- super(NotSupportedError.CLASS_NAME, source, message, undefined, cause);
1909
+ constructor(source, message, properties, cause) {
1910
+ super(NotSupportedError.CLASS_NAME, source, message, properties, cause);
1904
1911
  }
1905
1912
  }
1906
1913
 
@@ -1916,10 +1923,11 @@ class UnauthorizedError extends BaseError {
1916
1923
  * Create a new instance of UnauthorizedError.
1917
1924
  * @param source The source of the error.
1918
1925
  * @param message The message as a code.
1926
+ * @param properties Any additional information for the error.
1919
1927
  * @param cause The cause of the error if we have wrapped another error.
1920
1928
  */
1921
- constructor(source, message, cause) {
1922
- super(UnauthorizedError.CLASS_NAME, source, message, undefined, cause);
1929
+ constructor(source, message, properties, cause) {
1930
+ super(UnauthorizedError.CLASS_NAME, source, message, properties, cause);
1923
1931
  }
1924
1932
  }
1925
1933
 
@@ -1815,10 +1815,11 @@ class AlreadyExistsError extends BaseError {
1815
1815
  * @param source The source of the error.
1816
1816
  * @param message The message as a code.
1817
1817
  * @param existingId The id for the item.
1818
+ * @param properties Any additional information for the error.
1818
1819
  * @param cause The cause of the error if we have wrapped another error.
1819
1820
  */
1820
- constructor(source, message, existingId, cause) {
1821
- super(AlreadyExistsError.CLASS_NAME, source, message, { existingId });
1821
+ constructor(source, message, existingId, properties, cause) {
1822
+ super(AlreadyExistsError.CLASS_NAME, source, message, { existingId, ...properties }, cause);
1822
1823
  }
1823
1824
  }
1824
1825
 
@@ -1836,10 +1837,11 @@ class ConflictError extends BaseError {
1836
1837
  * @param message The message as a code.
1837
1838
  * @param conflictId The id that has conflicts.
1838
1839
  * @param conflicts The conflicts that occurred.
1840
+ * @param properties Any additional information for the error.
1839
1841
  * @param cause The cause or the error if we have wrapped another error.
1840
1842
  */
1841
- constructor(source, message, conflictId, conflicts, cause) {
1842
- super(ConflictError.CLASS_NAME, source, message, { conflictId, conflicts }, cause);
1843
+ constructor(source, message, conflictId, conflicts, properties, cause) {
1844
+ super(ConflictError.CLASS_NAME, source, message, { conflictId, conflicts, ...properties }, cause);
1843
1845
  }
1844
1846
  }
1845
1847
 
@@ -1856,10 +1858,11 @@ class NotFoundError extends BaseError {
1856
1858
  * @param source The source of the error.
1857
1859
  * @param message The message as a code.
1858
1860
  * @param notFoundId The id for the item.
1861
+ * @param properties Any additional information for the error.
1859
1862
  * @param cause The cause of the error if we have wrapped another error.
1860
1863
  */
1861
- constructor(source, message, notFoundId, cause) {
1862
- super(NotFoundError.CLASS_NAME, source, message, { notFoundId }, cause);
1864
+ constructor(source, message, notFoundId, properties, cause) {
1865
+ super(NotFoundError.CLASS_NAME, source, message, { notFoundId, ...properties }, cause);
1863
1866
  }
1864
1867
  }
1865
1868
 
@@ -1875,11 +1878,14 @@ class NotImplementedError extends BaseError {
1875
1878
  * Create a new instance of NotImplementedError.
1876
1879
  * @param source The source of the error.
1877
1880
  * @param method The method for the error.
1881
+ * @param properties Any additional information for the error.
1882
+ * @param cause The cause of the error if we have wrapped another error.
1878
1883
  */
1879
- constructor(source, method) {
1884
+ constructor(source, method, properties, cause) {
1880
1885
  super(NotImplementedError.CLASS_NAME, source, "common.notImplementedMethod", {
1881
- method
1882
- });
1886
+ method,
1887
+ ...properties
1888
+ }, cause);
1883
1889
  }
1884
1890
  }
1885
1891
 
@@ -1895,10 +1901,11 @@ class NotSupportedError extends BaseError {
1895
1901
  * Create a new instance of NotSupportedError.
1896
1902
  * @param source The source of the error.
1897
1903
  * @param message The message as a code.
1904
+ * @param properties Any additional information for the error.
1898
1905
  * @param cause The cause of the error if we have wrapped another error.
1899
1906
  */
1900
- constructor(source, message, cause) {
1901
- super(NotSupportedError.CLASS_NAME, source, message, undefined, cause);
1907
+ constructor(source, message, properties, cause) {
1908
+ super(NotSupportedError.CLASS_NAME, source, message, properties, cause);
1902
1909
  }
1903
1910
  }
1904
1911
 
@@ -1914,10 +1921,11 @@ class UnauthorizedError extends BaseError {
1914
1921
  * Create a new instance of UnauthorizedError.
1915
1922
  * @param source The source of the error.
1916
1923
  * @param message The message as a code.
1924
+ * @param properties Any additional information for the error.
1917
1925
  * @param cause The cause of the error if we have wrapped another error.
1918
1926
  */
1919
- constructor(source, message, cause) {
1920
- super(UnauthorizedError.CLASS_NAME, source, message, undefined, cause);
1927
+ constructor(source, message, properties, cause) {
1928
+ super(UnauthorizedError.CLASS_NAME, source, message, properties, cause);
1921
1929
  }
1922
1930
  }
1923
1931
 
@@ -12,7 +12,10 @@ export declare class AlreadyExistsError extends BaseError {
12
12
  * @param source The source of the error.
13
13
  * @param message The message as a code.
14
14
  * @param existingId The id for the item.
15
+ * @param properties Any additional information for the error.
15
16
  * @param cause The cause of the error if we have wrapped another error.
16
17
  */
17
- constructor(source: string, message: string, existingId?: string, cause?: unknown);
18
+ constructor(source: string, message: string, existingId?: string, properties?: {
19
+ [id: string]: unknown;
20
+ }, cause?: unknown);
18
21
  }
@@ -13,7 +13,10 @@ export declare class ConflictError extends BaseError {
13
13
  * @param message The message as a code.
14
14
  * @param conflictId The id that has conflicts.
15
15
  * @param conflicts The conflicts that occurred.
16
+ * @param properties Any additional information for the error.
16
17
  * @param cause The cause or the error if we have wrapped another error.
17
18
  */
18
- constructor(source: string, message: string, conflictId?: string, conflicts?: string[], cause?: unknown);
19
+ constructor(source: string, message: string, conflictId?: string, conflicts?: string[], properties?: {
20
+ [id: string]: unknown;
21
+ }, cause?: unknown);
19
22
  }
@@ -12,7 +12,10 @@ export declare class NotFoundError extends BaseError {
12
12
  * @param source The source of the error.
13
13
  * @param message The message as a code.
14
14
  * @param notFoundId The id for the item.
15
+ * @param properties Any additional information for the error.
15
16
  * @param cause The cause of the error if we have wrapped another error.
16
17
  */
17
- constructor(source: string, message: string, notFoundId?: string, cause?: unknown);
18
+ constructor(source: string, message: string, notFoundId?: string, properties?: {
19
+ [id: string]: unknown;
20
+ }, cause?: unknown);
18
21
  }
@@ -11,6 +11,10 @@ export declare class NotImplementedError extends BaseError {
11
11
  * Create a new instance of NotImplementedError.
12
12
  * @param source The source of the error.
13
13
  * @param method The method for the error.
14
+ * @param properties Any additional information for the error.
15
+ * @param cause The cause of the error if we have wrapped another error.
14
16
  */
15
- constructor(source: string, method: string);
17
+ constructor(source: string, method: string, properties?: {
18
+ [id: string]: unknown;
19
+ }, cause?: unknown);
16
20
  }
@@ -11,7 +11,10 @@ export declare class NotSupportedError extends BaseError {
11
11
  * Create a new instance of NotSupportedError.
12
12
  * @param source The source of the error.
13
13
  * @param message The message as a code.
14
+ * @param properties Any additional information for the error.
14
15
  * @param cause The cause of the error if we have wrapped another error.
15
16
  */
16
- constructor(source: string, message: string, cause?: unknown);
17
+ constructor(source: string, message: string, properties?: {
18
+ [id: string]: unknown;
19
+ }, cause?: unknown);
17
20
  }
@@ -11,7 +11,10 @@ export declare class UnauthorizedError extends BaseError {
11
11
  * Create a new instance of UnauthorizedError.
12
12
  * @param source The source of the error.
13
13
  * @param message The message as a code.
14
+ * @param properties Any additional information for the error.
14
15
  * @param cause The cause of the error if we have wrapped another error.
15
16
  */
16
- constructor(source: string, message: string, cause?: unknown);
17
+ constructor(source: string, message: string, properties?: {
18
+ [id: string]: unknown;
19
+ }, cause?: unknown);
17
20
  }
package/docs/changelog.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # @twin.org/core - Changelog
2
2
 
3
+ ## [0.0.2-next.14](https://github.com/twinfoundation/framework/compare/core-v0.0.2-next.13...core-v0.0.2-next.14) (2025-09-22)
4
+
5
+
6
+ ### Miscellaneous Chores
7
+
8
+ * **core:** Synchronize repo versions
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @twin.org/nameof bumped from 0.0.2-next.13 to 0.0.2-next.14
16
+ * devDependencies
17
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.13 to 0.0.2-next.14
18
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.13 to 0.0.2-next.14
19
+
20
+ ## [0.0.2-next.13](https://github.com/twinfoundation/framework/compare/core-v0.0.2-next.12...core-v0.0.2-next.13) (2025-09-22)
21
+
22
+
23
+ ### Features
24
+
25
+ * expand error params to accept properties ([032e9fd](https://github.com/twinfoundation/framework/commit/032e9fd1388e457cde32ca1005dfe014a5a9c077))
26
+
27
+
28
+ ### Dependencies
29
+
30
+ * The following workspace dependencies were updated
31
+ * dependencies
32
+ * @twin.org/nameof bumped from 0.0.2-next.12 to 0.0.2-next.13
33
+ * devDependencies
34
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.12 to 0.0.2-next.13
35
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.12 to 0.0.2-next.13
36
+
3
37
  ## [0.0.2-next.12](https://github.com/twinfoundation/framework/compare/core-v0.0.2-next.11...core-v0.0.2-next.12) (2025-09-15)
4
38
 
5
39
 
@@ -10,7 +10,7 @@ Class to handle errors which are triggered by data already existing.
10
10
 
11
11
  ### Constructor
12
12
 
13
- > **new AlreadyExistsError**(`source`, `message`, `existingId?`, `cause?`): `AlreadyExistsError`
13
+ > **new AlreadyExistsError**(`source`, `message`, `existingId?`, `properties?`, `cause?`): `AlreadyExistsError`
14
14
 
15
15
  Create a new instance of AlreadyExistsError.
16
16
 
@@ -34,6 +34,10 @@ The message as a code.
34
34
 
35
35
  The id for the item.
36
36
 
37
+ ##### properties?
38
+
39
+ Any additional information for the error.
40
+
37
41
  ##### cause?
38
42
 
39
43
  `unknown`
@@ -10,7 +10,7 @@ Class to handle errors which are triggered by conflicting data.
10
10
 
11
11
  ### Constructor
12
12
 
13
- > **new ConflictError**(`source`, `message`, `conflictId?`, `conflicts?`, `cause?`): `ConflictError`
13
+ > **new ConflictError**(`source`, `message`, `conflictId?`, `conflicts?`, `properties?`, `cause?`): `ConflictError`
14
14
 
15
15
  Create a new instance of ConflictError.
16
16
 
@@ -40,6 +40,10 @@ The id that has conflicts.
40
40
 
41
41
  The conflicts that occurred.
42
42
 
43
+ ##### properties?
44
+
45
+ Any additional information for the error.
46
+
43
47
  ##### cause?
44
48
 
45
49
  `unknown`
@@ -10,7 +10,7 @@ Class to handle errors which are triggered by data not being found.
10
10
 
11
11
  ### Constructor
12
12
 
13
- > **new NotFoundError**(`source`, `message`, `notFoundId?`, `cause?`): `NotFoundError`
13
+ > **new NotFoundError**(`source`, `message`, `notFoundId?`, `properties?`, `cause?`): `NotFoundError`
14
14
 
15
15
  Create a new instance of NotFoundError.
16
16
 
@@ -34,6 +34,10 @@ The message as a code.
34
34
 
35
35
  The id for the item.
36
36
 
37
+ ##### properties?
38
+
39
+ Any additional information for the error.
40
+
37
41
  ##### cause?
38
42
 
39
43
  `unknown`
@@ -10,7 +10,7 @@ Class to handle errors.
10
10
 
11
11
  ### Constructor
12
12
 
13
- > **new NotImplementedError**(`source`, `method`): `NotImplementedError`
13
+ > **new NotImplementedError**(`source`, `method`, `properties?`, `cause?`): `NotImplementedError`
14
14
 
15
15
  Create a new instance of NotImplementedError.
16
16
 
@@ -28,6 +28,16 @@ The source of the error.
28
28
 
29
29
  The method for the error.
30
30
 
31
+ ##### properties?
32
+
33
+ Any additional information for the error.
34
+
35
+ ##### cause?
36
+
37
+ `unknown`
38
+
39
+ The cause of the error if we have wrapped another error.
40
+
31
41
  #### Returns
32
42
 
33
43
  `NotImplementedError`
@@ -10,7 +10,7 @@ Class to handle errors when a feature is unsupported.
10
10
 
11
11
  ### Constructor
12
12
 
13
- > **new NotSupportedError**(`source`, `message`, `cause?`): `NotSupportedError`
13
+ > **new NotSupportedError**(`source`, `message`, `properties?`, `cause?`): `NotSupportedError`
14
14
 
15
15
  Create a new instance of NotSupportedError.
16
16
 
@@ -28,6 +28,10 @@ The source of the error.
28
28
 
29
29
  The message as a code.
30
30
 
31
+ ##### properties?
32
+
33
+ Any additional information for the error.
34
+
31
35
  ##### cause?
32
36
 
33
37
  `unknown`
@@ -10,7 +10,7 @@ Class to handle errors which are triggered by access not being unauthorized.
10
10
 
11
11
  ### Constructor
12
12
 
13
- > **new UnauthorizedError**(`source`, `message`, `cause?`): `UnauthorizedError`
13
+ > **new UnauthorizedError**(`source`, `message`, `properties?`, `cause?`): `UnauthorizedError`
14
14
 
15
15
  Create a new instance of UnauthorizedError.
16
16
 
@@ -28,6 +28,10 @@ The source of the error.
28
28
 
29
29
  The message as a code.
30
30
 
31
+ ##### properties?
32
+
33
+ Any additional information for the error.
34
+
31
35
  ##### cause?
32
36
 
33
37
  `unknown`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/core",
3
- "version": "0.0.2-next.12",
3
+ "version": "0.0.2-next.14",
4
4
  "description": "Helper methods/classes for data type checking/validation/guarding/error handling",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,7 +14,7 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@twin.org/nameof": "0.0.2-next.12",
17
+ "@twin.org/nameof": "0.0.2-next.14",
18
18
  "intl-messageformat": "10.7.16",
19
19
  "rfc6902": "5.1.2"
20
20
  },