@oino-ts/db 0.5.0 → 0.5.2
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/dist/cjs/OINODbApi.js +2 -1
- package/dist/esm/OINODbApi.js +2 -1
- package/dist/types/OINODbApi.d.ts +1 -1
- package/package.json +3 -3
- package/src/OINODbApi.ts +2 -1
package/dist/cjs/OINODbApi.js
CHANGED
|
@@ -38,7 +38,7 @@ class OINODbApiResult extends common_1.OINOResult {
|
|
|
38
38
|
* @param headers Headers to include in the response
|
|
39
39
|
*
|
|
40
40
|
*/
|
|
41
|
-
async
|
|
41
|
+
async writeApiResponse(headers = {}) {
|
|
42
42
|
let response = null;
|
|
43
43
|
if (this.success && this.data) {
|
|
44
44
|
const body = await this.data.writeString(this.params.responseType);
|
|
@@ -121,6 +121,7 @@ class OINODbHtmlTemplate extends index_js_1.OINOHtmlTemplate {
|
|
|
121
121
|
for (let i = 0; i < datamodel.fields.length; i++) {
|
|
122
122
|
const f = datamodel.fields[i];
|
|
123
123
|
let value;
|
|
124
|
+
// OINOLog.debug("OINOHtmlTemplate.renderFromDbData", {field:f.name, row_value:row[i], value_type:typeof row[i]})
|
|
124
125
|
if ((this._locale != null) && (f instanceof index_js_1.OINODatetimeDataField)) {
|
|
125
126
|
value = f.serializeCellWithLocale(row[i], this._locale);
|
|
126
127
|
}
|
package/dist/esm/OINODbApi.js
CHANGED
|
@@ -35,7 +35,7 @@ export class OINODbApiResult extends OINOResult {
|
|
|
35
35
|
* @param headers Headers to include in the response
|
|
36
36
|
*
|
|
37
37
|
*/
|
|
38
|
-
async
|
|
38
|
+
async writeApiResponse(headers = {}) {
|
|
39
39
|
let response = null;
|
|
40
40
|
if (this.success && this.data) {
|
|
41
41
|
const body = await this.data.writeString(this.params.responseType);
|
|
@@ -117,6 +117,7 @@ export class OINODbHtmlTemplate extends OINOHtmlTemplate {
|
|
|
117
117
|
for (let i = 0; i < datamodel.fields.length; i++) {
|
|
118
118
|
const f = datamodel.fields[i];
|
|
119
119
|
let value;
|
|
120
|
+
// OINOLog.debug("OINOHtmlTemplate.renderFromDbData", {field:f.name, row_value:row[i], value_type:typeof row[i]})
|
|
120
121
|
if ((this._locale != null) && (f instanceof OINODatetimeDataField)) {
|
|
121
122
|
value = f.serializeCellWithLocale(row[i], this._locale);
|
|
122
123
|
}
|
|
@@ -25,7 +25,7 @@ export declare class OINODbApiResult extends OINOResult {
|
|
|
25
25
|
* @param headers Headers to include in the response
|
|
26
26
|
*
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
writeApiResponse(headers?: Record<string, string>): Promise<Response>;
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
31
|
* Specialized HTML template that can render ´OINODbApiResult´.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oino-ts/db",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "OINO TS library package for publishing an SQL database tables as a REST API.",
|
|
5
5
|
"author": "Matias Kiviniemi (pragmatta)",
|
|
6
6
|
"license": "MPL-2.0",
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
"module": "./dist/esm/index.js",
|
|
20
20
|
"types": "./dist/types/index.d.ts",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@oino-ts/common": "0.5.
|
|
22
|
+
"@oino-ts/common": "0.5.2"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/node": "^20.14.10",
|
|
26
26
|
"@types/bun": "^1.1.14",
|
|
27
|
-
"@oino-ts/types": "0.5.
|
|
27
|
+
"@oino-ts/types": "0.5.2",
|
|
28
28
|
"typedoc": "^0.25.13"
|
|
29
29
|
},
|
|
30
30
|
"files": [
|
package/src/OINODbApi.ts
CHANGED
|
@@ -41,7 +41,7 @@ export class OINODbApiResult extends OINOResult {
|
|
|
41
41
|
* @param headers Headers to include in the response
|
|
42
42
|
*
|
|
43
43
|
*/
|
|
44
|
-
async
|
|
44
|
+
async writeApiResponse(headers:Record<string, string> = {}):Promise<Response> {
|
|
45
45
|
let response:Response|null = null
|
|
46
46
|
if (this.success && this.data) {
|
|
47
47
|
const body = await this.data.writeString(this.params.responseType)
|
|
@@ -124,6 +124,7 @@ export class OINODbHtmlTemplate extends OINOHtmlTemplate {
|
|
|
124
124
|
for (let i=0; i<datamodel.fields.length; i++) {
|
|
125
125
|
const f:OINODbDataField = datamodel.fields[i]
|
|
126
126
|
let value:string|null|undefined
|
|
127
|
+
// OINOLog.debug("OINOHtmlTemplate.renderFromDbData", {field:f.name, row_value:row[i], value_type:typeof row[i]})
|
|
127
128
|
if ((this._locale != null) && (f instanceof OINODatetimeDataField)) {
|
|
128
129
|
value = f.serializeCellWithLocale(row[i], this._locale)
|
|
129
130
|
} else {
|