geonix 1.10.4 → 1.10.6
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.md +21 -0
- package/README.md +11 -1
- package/package.json +2 -2
- package/src/Request.js +4 -4
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Davor Tarandek <dtarandek@tria.hr>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
## Geonix
|
|
2
|
+
|
|
3
|
+
This is a compact yet robust library designed to facilitate Remote Procedure Call (RPC) communication patterns among various components in a system.
|
|
4
|
+
|
|
5
|
+
At its core, it employs [NATS](https://nats.io/), a high-performance messaging system, as the primary medium for both communication and service discovery.
|
|
6
|
+
|
|
7
|
+
This library adeptly handles the intricacies of RPC interactions, ensuring seamless and efficient communication between distributed services. It is especially tailored for scenarios requiring reliable and fast message exchanges, making it ideal for microservices architectures where components need to communicate and discover each other's services effectively and efficiently.
|
|
8
|
+
|
|
9
|
+
## License
|
|
10
|
+
|
|
11
|
+
[MIT](LICENSE)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "geonix",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "",
|
|
6
6
|
"bin": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"deploy": "npm run build && npm publish"
|
|
14
14
|
},
|
|
15
15
|
"author": "Davor Tarandek <dtarandek@tria.hr>",
|
|
16
|
-
"license": "
|
|
16
|
+
"license": "MIT",
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"cookie-parser": "^1.4.6",
|
|
19
19
|
"express": "^4.18.2",
|
package/src/Request.js
CHANGED
|
@@ -91,6 +91,10 @@ export async function Request(service, method, args = [], context = [], options)
|
|
|
91
91
|
o: originator
|
|
92
92
|
},
|
|
93
93
|
options)
|
|
94
|
+
|
|
95
|
+
// automatically process streamed response
|
|
96
|
+
if (isStream(response))
|
|
97
|
+
response = JSON.parse(await streamToString(response))
|
|
94
98
|
} catch (e) {
|
|
95
99
|
console.debug('GxError: Request', inspect({
|
|
96
100
|
originator, service, method, args, context, options,
|
|
@@ -100,10 +104,6 @@ export async function Request(service, method, args = [], context = [], options)
|
|
|
100
104
|
throw e
|
|
101
105
|
}
|
|
102
106
|
|
|
103
|
-
// automatically process streamed response
|
|
104
|
-
if (isStream(response))
|
|
105
|
-
response = JSON.parse(await streamToString(response))
|
|
106
|
-
|
|
107
107
|
if (!response)
|
|
108
108
|
throw Error(`Request: invalid response`)
|
|
109
109
|
|