orange-orm 4.1.3 → 4.1.4
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/docs/changelog.md +2 -0
- package/package.json +1 -1
- package/src/client/index.mjs +7 -7
- package/src/client/netAdapter.js +6 -6
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<img src="./docs/orange.svg" alt="Orange ORM Logo" width="250"/>
|
|
3
3
|
</div>
|
|
4
4
|
|
|
5
|
-
The ultimate Object Relational Mapper for Node.js and Typescript, offering seamless integration with a variety of popular databases. Whether you're building applications in TypeScript or JavaScript
|
|
5
|
+
The ultimate Object Relational Mapper for Node.js and Typescript, offering seamless integration with a variety of popular databases. Whether you're building applications in TypeScript or JavaScript, including both CommonJS and ECMAScript, Orange ORM has got you covered.
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.org/package/orange-orm)
|
|
8
8
|
[](https://github.com/alfateam/orange-orm/actions)
|
|
@@ -20,7 +20,7 @@ The ultimate Object Relational Mapper for Node.js and Typescript, offering seaml
|
|
|
20
20
|
- **Active Record**: With a concise and expressive syntax, Orange enables you to interact with your database using the [*Active Record Pattern*](https://en.wikipedia.org/wiki/Active_record_pattern).
|
|
21
21
|
- **No Code Generation Required**: Enjoy full IntelliSense, even in table mappings, without the need for cumbersome code generation.
|
|
22
22
|
- **TypeScript and JavaScript Support**: Orange fully supports both TypeScript and JavaScript, allowing you to leverage the benefits of static typing and modern ECMAScript features.
|
|
23
|
-
- **Works in the Browser**: You can securely use Orange in the browser by utilizing the Express.js plugin, which serves to safeguard sensitive database credentials from exposure at the client level. This method mirrors a traditional REST API, augmented with advanced TypeScript tooling for enhanced functionality.
|
|
23
|
+
- **Works in the Browser**: You can securely use Orange in the browser by utilizing the Express.js plugin, which serves to safeguard sensitive database credentials from exposure at the client level and protect against SQL injection. This method mirrors a traditional REST API, augmented with advanced TypeScript tooling for enhanced functionality.
|
|
24
24
|
|
|
25
25
|
## Supported Databases
|
|
26
26
|
|
package/docs/changelog.md
CHANGED
package/package.json
CHANGED
package/src/client/index.mjs
CHANGED
|
@@ -4842,8 +4842,8 @@ function httpAdapter(baseURL, path, axiosInterceptor) {
|
|
|
4842
4842
|
return res.data;
|
|
4843
4843
|
}
|
|
4844
4844
|
catch (e) {
|
|
4845
|
-
if (e.response?.data)
|
|
4846
|
-
throw new Error(e.response
|
|
4845
|
+
if (typeof e.response?.data === 'string')
|
|
4846
|
+
throw new Error(e.response.data.replace(/^Error: /, ''));
|
|
4847
4847
|
else
|
|
4848
4848
|
throw e;
|
|
4849
4849
|
}
|
|
@@ -4857,9 +4857,9 @@ function httpAdapter(baseURL, path, axiosInterceptor) {
|
|
|
4857
4857
|
const res = await axios.request(path, { headers, method: 'patch', data: body });
|
|
4858
4858
|
return res.data;
|
|
4859
4859
|
}
|
|
4860
|
-
catch (e) {
|
|
4861
|
-
if (e.response?.data)
|
|
4862
|
-
throw new Error(e.response
|
|
4860
|
+
catch (e) {
|
|
4861
|
+
if (typeof e.response?.data === 'string')
|
|
4862
|
+
throw new Error(e.response.data.replace(/^Error: /, ''));
|
|
4863
4863
|
else
|
|
4864
4864
|
throw e;
|
|
4865
4865
|
}
|
|
@@ -4874,8 +4874,8 @@ function httpAdapter(baseURL, path, axiosInterceptor) {
|
|
|
4874
4874
|
return res.data;
|
|
4875
4875
|
}
|
|
4876
4876
|
catch (e) {
|
|
4877
|
-
if (e.response?.data)
|
|
4878
|
-
throw new Error(e.response
|
|
4877
|
+
if (typeof e.response?.data === 'string')
|
|
4878
|
+
throw new Error(e.response.data.replace(/^Error: /, ''));
|
|
4879
4879
|
else throw e;
|
|
4880
4880
|
}
|
|
4881
4881
|
}
|
package/src/client/netAdapter.js
CHANGED
|
@@ -22,8 +22,8 @@ function httpAdapter(baseURL, path, axiosInterceptor) {
|
|
|
22
22
|
return res.data;
|
|
23
23
|
}
|
|
24
24
|
catch (e) {
|
|
25
|
-
if (e.response?.data)
|
|
26
|
-
throw new Error(e.response
|
|
25
|
+
if (typeof e.response?.data === 'string')
|
|
26
|
+
throw new Error(e.response.data.replace(/^Error: /, ''));
|
|
27
27
|
else
|
|
28
28
|
throw e;
|
|
29
29
|
}
|
|
@@ -38,8 +38,8 @@ function httpAdapter(baseURL, path, axiosInterceptor) {
|
|
|
38
38
|
return res.data;
|
|
39
39
|
}
|
|
40
40
|
catch (e) {
|
|
41
|
-
if (e.response?.data)
|
|
42
|
-
throw new Error(e.response
|
|
41
|
+
if (typeof e.response?.data === 'string')
|
|
42
|
+
throw new Error(e.response.data.replace(/^Error: /, ''));
|
|
43
43
|
else
|
|
44
44
|
throw e;
|
|
45
45
|
}
|
|
@@ -54,8 +54,8 @@ function httpAdapter(baseURL, path, axiosInterceptor) {
|
|
|
54
54
|
return res.data;
|
|
55
55
|
}
|
|
56
56
|
catch (e) {
|
|
57
|
-
if (e.response?.data)
|
|
58
|
-
throw new Error(e.response
|
|
57
|
+
if (typeof e.response?.data === 'string')
|
|
58
|
+
throw new Error(e.response.data.replace(/^Error: /, ''));
|
|
59
59
|
else throw e;
|
|
60
60
|
}
|
|
61
61
|
}
|