npgsqlrest 1.0.0 → 1.1.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npgsqlrest",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Automatic REST API for PostgreSQL Databases Client Build",
5
5
  "scripts": {
6
6
  "postinstall": "node postinstall.js",
package/postinstall.js CHANGED
@@ -4,7 +4,7 @@ const os = require("os");
4
4
  const https = require("https");
5
5
 
6
6
  const downloadDir = "../.bin/";
7
- const downloadFrom = "https://github.com/vb-consulting/NpgsqlRest/releases/download/v2.7.0/";
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) {
10
10
  https.get(url, (response) => {
package/readme.md CHANGED
@@ -8,119 +8,46 @@
8
8
 
9
9
  ## Description
10
10
 
11
- The `npgsqlrest` is an NPM distribution of AOT (ahead-of-time) native client build of the `NpgsqlRest` standalone client web application.
11
+ The `npgsqlrest` is an NPM distribution of the self-contained ahead-of-time (AOT) compiled to native code executables of the [NpgsqlRest Client Web App](https://github.com/vb-consulting/NpgsqlRest/tree/master/NpgsqlRestClient).
12
12
 
13
- - Currently, only **Windows-64** and **Linux-64** builds are supported.
14
- - The source code for this build can be found on this location: [NpgsqlRestTestWebApi](https://github.com/vb-consulting/NpgsqlRest/tree/master/NpgsqlRestTestWebApi).
15
- - Executable files are distributed from the [release download page for the latest version](https://github.com/vb-consulting/NpgsqlRest/releases).
16
- - NPM post-install script will download the appropriate build for the target OS (Windows-64v or Linux-64, sorry Mac bros) and the [default configuration file](https://github.com/vb-consulting/NpgsqlRest/blob/master/NpgsqlRestTestWebApi/appsettings.json).
17
- - Executable will be available through the NPX interface after installation:
13
+ NpgsqlRest is an Automatic REST API for PostgreSQL Database as the .NET8 Middleware. See the [GitHub Readme](https://github.com/vb-consulting/NpgsqlRest) for more info.
18
14
 
19
- ```console
20
- vbilopav@DESKTOP-O3A6QK2:~/npgsqlrest-npm-test$ npx npgsqlrest --help
21
- Usages
22
- 1: npgsqlrest-[os]
23
- 2: npgsqlrest-[os] [path to one or more configuration file(s)]
24
- 3: npgsqlrest-[os] [-v | --version | -h | --help]
25
-
26
- Where
27
- npgsqlrest-[os] is executable for the specific OS (like npgsqlrest-win64 or npgsqlrest-linux64)
28
- 1: run executable with default configuration files: appsettings.json (required) and appsettings.Development.json (optional).
29
- 2: run executable with optional configuration files from argument list.
30
- 3: show this screen.
31
-
32
- Versions
33
- Build 1.0.0.0
34
- Npgsql 2.7.0.0
35
- NpgsqlRest.HttpFiles 1.0.2.0
36
- NpgsqlRest.TsClient 1.6.0.0
37
-
38
- vbilopav@DESKTOP-O3A6QK2:~/npgsqlrest-npm-test$
39
- ```
40
-
41
- - The command expects a list of configuration files in the argument list.
42
- - If no argument is provided, the command will try to load `appsettings.json` from the current location and optionally `appsettings.Development.json`
43
- - When using multiple configuration files, the later configuration will override values from the previous one.
44
- - The [default configuration file](https://github.com/vb-consulting/NpgsqlRest/blob/master/NpgsqlRestTestWebApi/appsettings.json) can be located in `node_modules` -> `/node_modules/npgsqlrest/appsettings.json`.
45
- - The default configuration will try to connect the following database: `"Host=127.0.0.1;Port=5432;Database=test;Username=postgres;Password=postgres"`
46
- - Recommended use:
47
- 1) Copy the default configuration into the project root and adjust it to project needs.
48
- 2) - OR - use the default configuration and override it with project configuration from the root.
49
-
50
- Example, of new override config:
51
-
52
- ```json
53
- {
54
- "ApplicationName": "MyProject",
55
- "EnvironmentName": "Production",
56
- "Urls": "http://localhost:5001",
15
+ NpgsqlRest Client Web App is a command line utility that runs as a configurable Kestrel web server that can:
57
16
 
58
- "ConnectionStrings": {
59
- "Default": "Host=127.0.0.1;Port=5432;Database=test;Username=postgres;Password=postgres"
60
- },
17
+ - Create an Automatic REST API for the PostgreSQL Databases.
18
+ - Generate TypeScript Code and HTTP files for testing.
19
+ - Configure security for use the of either encrypted cookies or JWT Bearer tokens or both.
20
+ - Expose REST API endpoints for the PostgreSQL Databases as Login/Logout.
21
+ - Use external authentication providers such as Google, LinkedIn or GitHub.
22
+ - Server static content.
23
+ - Use and configure built-in Serilog structured logging.
24
+ - Configure Cross-origin resource sharing (CORS) access, SSL, Server Certificates and more, everything needed for modern Web development.
61
25
 
62
- "Auth": {
63
- "CookieAuth": true,
64
- "BearerTokenAuth": true
65
- },
26
+ See the [default configuration file](https://vb-consulting.github.io/npgsqlrest/config/) with descriptions for more information.
66
27
 
67
- "Log": {
68
- "ToConsole": true,
69
- "ToFile": true
70
- },
28
+ ## Usage
71
29
 
72
- "StaticFiles": {
73
- "Enabled": true
74
- },
75
-
76
- "NpgsqlRest": {
77
- "HttpFileOptions": {
78
- "Enabled": true
79
- },
80
-
81
- "TsClient": {
82
- "Enabled": true
83
- },
30
+ ```console
31
+ $ npx npgsqlrest --help
32
+ Usage:
33
+ npgsqlrest Run with the default configuration files: appsettings.json (required) and appsettings.Development.json (optional).
34
+ npgsqlrest [files...] Run with the custom configuration files. All configuration files are required.
35
+ npgsqlrest [file1 -o file2...] Use the -o switch to mark the next configuration file as optional. The first file after the -o switch is optional.
36
+ npgsqlrest [file1 --optional file2...] Use --optional switch to mark the next configuration file as optional. The first file after the --optional switch is optional.
84
37
 
85
- "CrudSource": {
86
- "Enabled": false
87
- }
88
- }
89
- }
90
- ```
38
+ npgsqlrest -v, --version Show version information.
39
+ npgsqlrest -h, --help Show command line help.
91
40
 
92
- Command:
41
+ Note: Values in the later file will override the values in the previous one.
93
42
 
94
- ```console
95
- vbilopav@DESKTOP-O3A6QK2:~/npgsqlrest-npm-test$ npx npgsqlrest ./node_modules/npgsqlrest/appsettings.json project-config.json
96
- [15:04:49.409 INF] ----> Starting with configuration(s): ["EnvironmentVariablesConfigurationProvider", "JsonConfigurationProvider for 'appsettings.json' (Required)", "JsonConfigurationProvider for 'project-config.json' (Required)"] [Program]
97
- [15:04:49.409 INF] Using Cookie Authentication with scheme Cookies. Cookie expires in 14 days. [Program]
98
- [15:04:49.410 INF] Using Bearer Token Authentication with scheme BearerToken. Token expires in 1 hours and refresh token expires in 14 days. [Program]
99
- [15:04:49.410 INF] Using connection: Host=127.0.0.1;Port=5432;Database=test;Username=postgres;Application Name=MyProject [Program]
100
- [15:04:49.412 INF] Serving static files from /home/vbilopav/npgsqlrest-npm-test/wwwroot [Program]
101
- [15:04:49.574 INF] Created endpoint POST /api/case-return-long-table1 [NpgsqlRest]
102
- [15:04:49.574 INF] Created HTTP file: /home/vbilopav/npgsqlrest-npm-test/test_public.http [NpgsqlRest.HttpFiles]
103
- [15:04:49.582 INF] Started in 00:00:00.1752748 [Program]
104
- [15:04:49.582 INF] Listening on ["http://localhost:5001"] [Program]
43
+ Example: npgsqlrest appsettings.json appsettings.Development.json
44
+ Example: npgsqlrest appsettings.json -o appsettings.Development.json
105
45
  ```
106
46
 
107
- ## Features
108
-
109
- - Automatic **generation of the HTTP REST endpoints** from PostgreSQL functions, procedures, tables or views.
110
- - **Customization** of endpoints with comment annotations. You can easily configure any endpoint by adding comment annotation labels to [PostgreSQL Comments](https://www.postgresql.org/docs/current/sql-comment.html).
111
- - **High performance** with or without native AOT, up to 6 times higher throughput than similar solutions.
112
- - Authentication out of the box, encrypted cookies, or, bearer token or both.
113
- - Logging to console or rolling files (Serilog implementation) with fine tuning.
114
- - Serving static files.
115
- - CORS configuration.
116
- - HTTP file automatic generartion.
117
- - TypeScript client automatic generation.
118
- - And more.
119
-
120
47
  ## Installation
121
48
 
122
49
  Install `npgsqlrest` using npm:
123
50
 
124
51
  ```console
125
52
  npm install npgsqlrest --save-dev
126
- ```
53
+ ```