npgsqlrest 1.1.7 → 1.2.0
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/package.json +3 -2
- package/postinstall.js +4 -2
- package/readme.md +24 -4
- package/uninstall.js +21 -0
- package/npgsqlrest.js +0 -21
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npgsqlrest",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Automatic REST API for PostgreSQL Databases Client Build",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"postinstall": "node postinstall.js",
|
|
7
|
+
"uninstall": "node uninstall.js",
|
|
7
8
|
"start": "npx npgsqlrest ./appsettings.json ./npgsqlrest.json"
|
|
8
9
|
},
|
|
9
10
|
"bin": {
|
|
10
|
-
"npgsqlrest": "
|
|
11
|
+
"npgsqlrest": "node_modules/.bin/npgsqlrest",
|
|
11
12
|
"npgsqlrest-config-copy": "./config-copy.js"
|
|
12
13
|
},
|
|
13
14
|
"repository": {
|
package/postinstall.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
1
3
|
const fs = require("fs");
|
|
2
4
|
const path = require("path");
|
|
3
5
|
const os = require("os");
|
|
4
6
|
const https = require("https");
|
|
5
7
|
|
|
6
|
-
const downloadDir = "
|
|
7
|
-
const downloadFrom = "https://github.com/vb-consulting/NpgsqlRest/releases/download/v2.
|
|
8
|
+
const downloadDir = "../.bin/";
|
|
9
|
+
const downloadFrom = "https://github.com/vb-consulting/NpgsqlRest/releases/download/v2.8.0-client-v1.2.0/";
|
|
8
10
|
|
|
9
11
|
function download(url, to, done) {
|
|
10
12
|
https.get(url, (response) => {
|
package/readme.md
CHANGED
|
@@ -37,8 +37,6 @@ If you try to install this package on MacOS, or any other unsupported OS, instal
|
|
|
37
37
|
|
|
38
38
|
To see how you can create your own custom build follow these instructions:
|
|
39
39
|
|
|
40
|
-
- The client application was built from the [`NpgsqlRestClient` project directory](https://github.com/vb-consulting/NpgsqlRest/tree/master/NpgsqlRestClient/).
|
|
41
|
-
|
|
42
40
|
Steps:
|
|
43
41
|
|
|
44
42
|
1) Make sure that you have .NET8 SDK installed and ready.
|
|
@@ -47,6 +45,8 @@ Steps:
|
|
|
47
45
|
4) Make your desired customizations (or not).
|
|
48
46
|
5) Run publish command, for example, `dotnet publish -r win-x64 -c Release --output [target dir]`
|
|
49
47
|
|
|
48
|
+
Notes: `win-x64` is the designated target OS for the build. Adjust this parameter appropriately for the target OS. See [https://learn.microsoft.com/en-us/dotnet/core/rid-catalog#known-rids](https://learn.microsoft.com/en-us/dotnet/core/rid-catalog#known-rids). The project is already configured for the AOT builds, but you will need to run the publish command from the same flavor OS as the build target OS (Windows for Windows builds, Linux for Linux builds, etc).
|
|
49
|
+
|
|
50
50
|
## Installation
|
|
51
51
|
|
|
52
52
|
Install `npgsqlrest` using npm:
|
|
@@ -94,12 +94,30 @@ $ npx npgsqlrest appsettings.json project-config.json
|
|
|
94
94
|
[11:29:07.083 INF] Created HTTP file: /home/vbilopav/npgsqlrest-npm-test/test_public.http [NpgsqlRest.HttpFiles]
|
|
95
95
|
[11:29:07.100 INF] Started in 00:00:00.5527040 [Program]
|
|
96
96
|
[11:29:07.100 INF] Listening on ["http://localhost:5001"] [Program]
|
|
97
|
-
^C
|
|
98
|
-
$
|
|
99
97
|
```
|
|
100
98
|
|
|
101
99
|
## Changelog
|
|
102
100
|
|
|
101
|
+
See the detailed change log here: [NpgsqlRest Changelog](https://vb-consulting.github.io/npgsqlrest/changelog/)
|
|
102
|
+
|
|
103
|
+
### 1.1.8
|
|
104
|
+
|
|
105
|
+
Changed the download target from `./node_modules/npgsqlrest/.bin/` to shared bin: `./node_modules/.bin/`.
|
|
106
|
+
|
|
107
|
+
The reason is that when using the `./node_modules/npgsqlrest/.bin/` directory, I have to use the node spawn process wrapper which slows down the startup time. When the executable is in the `./node_modules/.bin/` it can be invoked directly which is an extremely fast, almost instant startup (a couple of milliseconds).
|
|
108
|
+
|
|
109
|
+
But now, I have to use the uninstall script too, to ensure the proper cleanup on the install.
|
|
110
|
+
|
|
111
|
+
### 1.2.0
|
|
112
|
+
|
|
113
|
+
```console
|
|
114
|
+
Versions:
|
|
115
|
+
Client Build 1.2.0.0
|
|
116
|
+
Npgsql 2.8.0.0
|
|
117
|
+
NpgsqlRest.HttpFiles 1.0.2.0
|
|
118
|
+
NpgsqlRest.TsClient 1.7.0.0
|
|
119
|
+
```
|
|
120
|
+
|
|
103
121
|
### 1.1.7
|
|
104
122
|
|
|
105
123
|
Update readme.
|
|
@@ -121,7 +139,9 @@ Fixing the issue with the local .bin directory.
|
|
|
121
139
|
|
|
122
140
|
New build versions:
|
|
123
141
|
|
|
142
|
+
```console
|
|
124
143
|
Client Build 1.1.0.0
|
|
125
144
|
Npgsql 2.7.1.0
|
|
126
145
|
NpgsqlRest.HttpFiles 1.0.2.0
|
|
127
146
|
NpgsqlRest.TsClient 1.6.0.0
|
|
147
|
+
```
|
package/uninstall.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require("fs");
|
|
4
|
+
const os = require("os");
|
|
5
|
+
|
|
6
|
+
const downloadDir = "../.bin/";
|
|
7
|
+
const osType = os.type();
|
|
8
|
+
|
|
9
|
+
var downloadTo;
|
|
10
|
+
|
|
11
|
+
if (osType === "Windows_NT") {
|
|
12
|
+
downloadTo = `${downloadDir}npgsqlrest.exe`;
|
|
13
|
+
} else {
|
|
14
|
+
downloadTo = `${downloadDir}npgsqlrest`;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
if (fs.existsSync(downloadTo)) {
|
|
18
|
+
fs.unlinkSync(downloadTo);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
package/npgsqlrest.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const { spawn } = require("child_process");
|
|
4
|
-
const path = require("path");
|
|
5
|
-
|
|
6
|
-
// Path to the binary file
|
|
7
|
-
const binaryPath = path.join(__dirname, "./.bin/npgsqlrest");
|
|
8
|
-
|
|
9
|
-
// Arguments passed to the script
|
|
10
|
-
const args = process.argv.slice(2);
|
|
11
|
-
|
|
12
|
-
// Spawn a child process to run the binary file
|
|
13
|
-
const child = spawn(binaryPath, args, { stdio: "inherit" });
|
|
14
|
-
|
|
15
|
-
child.on("error", (error) => {
|
|
16
|
-
console.error(`Failed to start subprocess.\n${error}`);
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
child.on("exit", (code) => {
|
|
20
|
-
process.exit(code);
|
|
21
|
-
});
|