npgsqlrest 1.1.0 → 1.1.1

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/config-copy.js ADDED
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+
6
+ // Get the destination directory from the command line arguments, or use the current directory
7
+ const destDir = process.argv[2] || process.cwd();
8
+
9
+ // Path to the source file
10
+ const srcFile = path.join(__dirname, 'node_modules', 'npgsqlrest', '.bin', 'appsettings.json');
11
+
12
+ // Path to the destination file
13
+ const destFile = path.join(destDir, 'appsettings.json');
14
+
15
+ // Copy the file
16
+ fs.copyFileSync(srcFile, destFile);
17
+
18
+ console.log(`Copied appsettings.json to ${destFile}`);
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "npgsqlrest",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Automatic REST API for PostgreSQL Databases Client Build",
5
5
  "scripts": {
6
6
  "postinstall": "node postinstall.js",
7
7
  "start": "npx npgsqlrest ./appsettings.json ./npgsqlrest.json"
8
8
  },
9
- "bin": "node_modules/.bin/npgsqlrest",
9
+ "bin": {
10
+ "npgsqlrest": "./.bin/npgsqlrest",
11
+ "npgsqlrest-config-copy": "./config-copy.js"
12
+ },
10
13
  "repository": {
11
14
  "type": "git",
12
15
  "url": "git+https://github.com/vb-consulting/NpgsqlRest.git"
package/postinstall.js CHANGED
@@ -3,7 +3,7 @@ const path = require("path");
3
3
  const os = require("os");
4
4
  const https = require("https");
5
5
 
6
- const downloadDir = "../.bin/";
6
+ const downloadDir = "./.bin/";
7
7
  const downloadFrom = "https://github.com/vb-consulting/NpgsqlRest/releases/download/v2.7.1-client-v1.1.0/";
8
8
 
9
9
  function download(url, to, done) {
@@ -50,11 +50,14 @@ if (!fs.existsSync(path.dirname(downloadTo))) {
50
50
  }
51
51
 
52
52
  if (!fs.existsSync(downloadTo)) {
53
- download(downloadFileUrl, downloadTo);
53
+ fs.unlinkSync(downloadTo);
54
54
  }
55
+ download(downloadFileUrl, downloadTo);
56
+
55
57
 
56
58
  downloadFileUrl = `${downloadFrom}appsettings.json`;
57
59
  downloadTo = "./appsettings.json";
58
- if (!fs.existsSync(downloadTo)) {
59
- download(downloadFileUrl, downloadTo);
60
+ if (!fs.existsSync(downloadFileUrl)) {
61
+ fs.unlinkSync(downloadFileUrl, downloadTo);
60
62
  }
63
+ download(downloadFileUrl, downloadTo);
package/readme.md CHANGED
@@ -51,3 +51,21 @@ Install `npgsqlrest` using npm:
51
51
  ```console
52
52
  npm install npgsqlrest --save-dev
53
53
  ```
54
+
55
+ ## Changelog
56
+
57
+ ### 1.1.1
58
+
59
+ - Move the download bin directory from share `/node_modules/.bin/` to package local `/node_modules/npgsqlrest/.bin/`
60
+ - Added copy default configuration command that, well, copies the default configuration `npx npgsqlrest-config-copy [optional dir]`
61
+
62
+ ### 1.1.0
63
+
64
+ New build versions:
65
+
66
+ Client Build 1.1.0.0
67
+ Npgsql 2.7.1.0
68
+ NpgsqlRest.HttpFiles 1.0.2.0
69
+ NpgsqlRest.TsClient 1.6.0.0
70
+
71
+ https://github.com/vb-consulting/NpgsqlRest/releases/tag/v2.7.1-client-v1.1.0