@oino-ts/db 0.17.1 → 0.17.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.
@@ -64,6 +64,15 @@ class OINODbApiRequest extends common_1.OINOHttpRequest {
64
64
  }
65
65
  }
66
66
  }
67
+ static async fromRequest(request) {
68
+ const body = await request.arrayBuffer();
69
+ return new OINODbApiRequest({
70
+ url: new URL(request.url),
71
+ method: request.method,
72
+ headers: Object.fromEntries(request.headers),
73
+ data: Buffer.from(body),
74
+ });
75
+ }
67
76
  }
68
77
  exports.OINODbApiRequest = OINODbApiRequest;
69
78
  /**
@@ -61,6 +61,15 @@ export class OINODbApiRequest extends OINOHttpRequest {
61
61
  }
62
62
  }
63
63
  }
64
+ static async fromRequest(request) {
65
+ const body = await request.arrayBuffer();
66
+ return new OINODbApiRequest({
67
+ url: new URL(request.url),
68
+ method: request.method,
69
+ headers: Object.fromEntries(request.headers),
70
+ data: Buffer.from(body),
71
+ });
72
+ }
64
73
  }
65
74
  /**
66
75
  * OINO API request result object with returned data and/or http status code/message and
@@ -16,6 +16,7 @@ export declare class OINODbApiRequest extends OINOHttpRequest {
16
16
  readonly data: string | OINODataRow[] | Buffer | Uint8Array | object | null;
17
17
  readonly sqlParams: OINODbSqlParams;
18
18
  constructor(init: OINODbApiRequestInit);
19
+ static fromRequest(request: Request): Promise<OINODbApiRequest>;
19
20
  }
20
21
  /**
21
22
  * OINO API request result object with returned data and/or http status code/message and
package/package.json CHANGED
@@ -1,37 +1,37 @@
1
- {
2
- "name": "@oino-ts/db",
3
- "version": "0.17.1",
4
- "description": "OINO TS library package for publishing an SQL database tables as a REST API.",
5
- "author": "Matias Kiviniemi (pragmatta)",
6
- "license": "MPL-2.0",
7
- "repository": {
8
- "type": "git",
9
- "url": "https://github.com/pragmatta/oino-ts.git"
10
- },
11
- "keywords": [
12
- "sql",
13
- "database",
14
- "rest-api",
15
- "typescript",
16
- "library"
17
- ],
18
- "main": "./dist/cjs/index.js",
19
- "module": "./dist/esm/index.js",
20
- "types": "./dist/types/index.d.ts",
21
- "dependencies": {
22
- "@oino-ts/common": "0.17.1",
23
- "oino-ts": "file:.."
24
- },
25
- "devDependencies": {
26
- "@oino-ts/types": "0.17.1",
27
- "@types/bun": "^1.1.14",
28
- "@types/node": "^20.17.10",
29
- "typescript": "~5.9.0"
30
- },
31
- "files": [
32
- "src/*.ts",
33
- "dist/cjs/*.js",
34
- "dist/esm/*.js",
35
- "dist/types/*.d.ts"
36
- ]
37
- }
1
+ {
2
+ "name": "@oino-ts/db",
3
+ "version": "0.17.2",
4
+ "description": "OINO TS library package for publishing an SQL database tables as a REST API.",
5
+ "author": "Matias Kiviniemi (pragmatta)",
6
+ "license": "MPL-2.0",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/pragmatta/oino-ts.git"
10
+ },
11
+ "keywords": [
12
+ "sql",
13
+ "database",
14
+ "rest-api",
15
+ "typescript",
16
+ "library"
17
+ ],
18
+ "main": "./dist/cjs/index.js",
19
+ "module": "./dist/esm/index.js",
20
+ "types": "./dist/types/index.d.ts",
21
+ "dependencies": {
22
+ "@oino-ts/common": "0.17.2",
23
+ "oino-ts": "file:.."
24
+ },
25
+ "devDependencies": {
26
+ "@oino-ts/types": "0.17.2",
27
+ "@types/bun": "^1.1.14",
28
+ "@types/node": "^20.17.20",
29
+ "typescript": "~5.9.0"
30
+ },
31
+ "files": [
32
+ "src/*.ts",
33
+ "dist/cjs/*.js",
34
+ "dist/esm/*.js",
35
+ "dist/types/*.d.ts"
36
+ ]
37
+ }