Skip to content

Commit 362f04f

Browse files
committed
Update plugins to use Debug log level instead of Info
1 parent 4f8f37e commit 362f04f

5 files changed

Lines changed: 48 additions & 30 deletions

File tree

README.md

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ NpgsqlRest is the superior alternative to existing automatic PostgreSQL REST API
8787

8888
And more!
8989

90+
91+
92+
----------
93+
9094
## Get Started in Seconds
9195

9296
Starting is easy:
@@ -163,7 +167,7 @@ $$;
163167
comment on function hello_world() is '
164168
HTTP GET /hello
165169
Content-Type: text/plain
166-
authorize admin' ||
170+
authorize admin
167171
';
168172
```
169173

@@ -176,34 +180,48 @@ Depending on distribution used, run the executable, NPX command or Docker comman
176180
#### 3) Auto-Generated HTTP File
177181

178182
```console
179-
@host=http://localhost:8080
183+
@host=http://localhost:8080
180184

181185
// function public.hello_world()
182186
// returns text
187+
//
188+
// comment on function public.hello_world is 'HTTP GET /hello
189+
// Content-Type: text/plain
190+
// authorize admin';
183191
GET {{host}}/hello
192+
193+
###
184194
```
185195

186196
#### 4) Auto-Generated Typescript Client Module
187197

188198
```ts
189-
const _baseUrl = "http://localhost:8080";
199+
// autogenerated at 2025-08-17T11:06:58.6605710+02:00
200+
const baseUrl = "http://localhost:8080";
190201

202+
export const publicHelloWorldUrl = () => baseUrl + "/hello";
191203

192204
/**
193-
* function public.hello_world()
194-
* returns text
195-
*
196-
* @remarks
197-
* GET /hello
198-
*
199-
* @see FUNCTION public.hello_world
200-
*/
201-
export async function getHelloWorld() : Promise<string> {
202-
const response = await fetch(_baseUrl + "/hello", {
205+
* function public.hello_world()
206+
* returns text
207+
*
208+
* @remarks
209+
* comment on function public.hello_world is 'HTTP GET /hello
210+
* Content-Type: text/plain
211+
* authorize admin';
212+
*
213+
* @returns {{status: number, response: string}}
214+
*
215+
* @see FUNCTION public.hello_world
216+
*/
217+
export async function publicHelloWorld() : Promise<{status: number, response: string}> {
218+
const response = await fetch(publicHelloWorldUrl(), {
203219
method: "GET",
204-
headers: { "Content-Type": "application/json" },
205220
});
206-
return await response.text() as string;
221+
return {
222+
status: response.status,
223+
response: await response.text()
224+
};
207225
}
208226
```
209227

plugins/NpgsqlRest.HttpFiles/HttpFile.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public void Cleanup()
200200
await context.Response.WriteAsync(content.ToString());
201201
});
202202
var host = GetHost();
203-
_logger?.LogInformation("Exposed HTTP file content on URL: {host}{path}", host, path);
203+
_logger?.LogDebug("Exposed HTTP file content on URL: {host}{path}", host, path);
204204
}
205205
}
206206

@@ -219,7 +219,7 @@ public void Cleanup()
219219
Directory.CreateDirectory(dir);
220220
}
221221
File.WriteAllText(fullFileName, content.ToString());
222-
_logger?.LogInformation("Created HTTP file: {fullFileName}", fullFileName);
222+
_logger?.LogDebug("Created HTTP file: {fullFileName}", fullFileName);
223223
}
224224
}
225225
}

plugins/NpgsqlRest.HttpFiles/NpgsqlRest.HttpFiles.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
<GenerateDocumentationFile>true</GenerateDocumentationFile>
2929
<PackageReadmeFile>README.MD</PackageReadmeFile>
3030
<DocumentationFile>bin\$(Configuration)\$(AssemblyName).xml</DocumentationFile>
31-
<Version>1.3.0</Version>
32-
<AssemblyVersion>1.3.0</AssemblyVersion>
33-
<FileVersion>1.3.0</FileVersion>
34-
<PackageVersion>1.3.0</PackageVersion>
31+
<Version>1.3.1</Version>
32+
<AssemblyVersion>1.3.1</AssemblyVersion>
33+
<FileVersion>1.3.1</FileVersion>
34+
<PackageVersion>1.3.1</PackageVersion>
3535
</PropertyGroup>
3636

3737
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">

plugins/NpgsqlRest.TsClient/NpgsqlRest.TsClient.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
<GenerateDocumentationFile>true</GenerateDocumentationFile>
2929
<PackageReadmeFile>README.MD</PackageReadmeFile>
3030
<DocumentationFile>bin\$(Configuration)\$(AssemblyName).xml</DocumentationFile>
31-
<Version>1.21.0</Version>
32-
<AssemblyVersion>1.21.0</AssemblyVersion>
33-
<FileVersion>1.21.0</FileVersion>
34-
<PackageVersion>1.21.0</PackageVersion>
31+
<Version>1.21.1</Version>
32+
<AssemblyVersion>1.21.1</AssemblyVersion>
33+
<FileVersion>1.21.1</FileVersion>
34+
<PackageVersion>1.21.1</PackageVersion>
3535
</PropertyGroup>
3636

3737
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">

plugins/NpgsqlRest.TsClient/TsClient.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ options.ImportBaseUrlFrom is not null ?
191191
try
192192
{
193193
File.Delete(fileName);
194-
_logger?.LogInformation("Deleted file: {fileName}", fileName);
194+
_logger?.LogDebug("Deleted file: {fileName}", fileName);
195195
}
196196
catch (Exception ex)
197197
{
@@ -233,7 +233,7 @@ options.ImportBaseUrlFrom is not null ?
233233
}
234234
AddHeader(interfaces);
235235
File.WriteAllText(fileName, interfaces.ToString());
236-
_logger?.LogInformation("Created Typescript file: {fileName}", fileName);
236+
_logger?.LogDebug("Created Typescript file: {fileName}", fileName);
237237
}
238238
}
239239
else
@@ -243,7 +243,7 @@ options.ImportBaseUrlFrom is not null ?
243243
var typeFile = fileName.Replace(".ts", "Types.d.ts");
244244
AddHeader(interfaces);
245245
File.WriteAllText(typeFile, interfaces.ToString());
246-
_logger?.LogInformation("Created Typescript type file: {typeFile}", typeFile);
246+
_logger?.LogDebug("Created Typescript type file: {typeFile}", typeFile);
247247
}
248248

249249
if (contentHeader.Length > 0)
@@ -254,11 +254,11 @@ options.ImportBaseUrlFrom is not null ?
254254
File.WriteAllText(fileName, content.ToString());
255255
if (options.SkipTypes is false)
256256
{
257-
_logger?.LogInformation("Created Typescript file: {fileName}", fileName);
257+
_logger?.LogDebug("Created Typescript file: {fileName}", fileName);
258258
}
259259
else
260260
{
261-
_logger?.LogInformation("Created Javascript file: {fileName}", fileName);
261+
_logger?.LogDebug("Created Javascript file: {fileName}", fileName);
262262
}
263263
}
264264
return;

0 commit comments

Comments
 (0)