@decaf-ts/for-http 0.3.11 → 0.3.13
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/README.md +1 -1
- package/dist/for-http.cjs +1 -1
- package/dist/for-http.cjs.map +1 -1
- package/dist/for-http.js +1 -1
- package/dist/for-http.js.map +1 -1
- package/lib/HttpPaginator.cjs +5 -56
- package/lib/HttpPaginator.d.ts +5 -6
- package/lib/HttpPaginator.js.map +1 -1
- package/lib/HttpStatement.cjs +7 -97
- package/lib/HttpStatement.d.ts +8 -6
- package/lib/HttpStatement.js.map +1 -1
- package/lib/ResponseParser.cjs +37 -0
- package/lib/ResponseParser.d.ts +14 -0
- package/lib/ResponseParser.js.map +1 -0
- package/lib/RestRepository.cjs +38 -10
- package/lib/RestRepository.d.ts +14 -3
- package/lib/RestRepository.js.map +1 -1
- package/lib/RestService.cjs +5 -2
- package/lib/RestService.d.ts +11 -2
- package/lib/RestService.js.map +1 -1
- package/lib/adapter.cjs +26 -14
- package/lib/adapter.d.ts +15 -15
- package/lib/adapter.js.map +1 -1
- package/lib/axios/axios.cjs +6 -6
- package/lib/axios/axios.d.ts +6 -6
- package/lib/axios/axios.js.map +1 -1
- package/lib/esm/HttpPaginator.d.ts +5 -6
- package/lib/esm/HttpPaginator.js +6 -57
- package/lib/esm/HttpPaginator.js.map +1 -1
- package/lib/esm/HttpStatement.d.ts +8 -6
- package/lib/esm/HttpStatement.js +8 -98
- package/lib/esm/HttpStatement.js.map +1 -1
- package/lib/esm/ResponseParser.d.ts +14 -0
- package/lib/esm/ResponseParser.js +32 -0
- package/lib/esm/ResponseParser.js.map +1 -0
- package/lib/esm/RestRepository.d.ts +14 -3
- package/lib/esm/RestRepository.js +38 -10
- package/lib/esm/RestRepository.js.map +1 -1
- package/lib/esm/RestService.d.ts +11 -2
- package/lib/esm/RestService.js +5 -2
- package/lib/esm/RestService.js.map +1 -1
- package/lib/esm/adapter.d.ts +15 -15
- package/lib/esm/adapter.js +27 -15
- package/lib/esm/adapter.js.map +1 -1
- package/lib/esm/axios/axios.d.ts +6 -6
- package/lib/esm/axios/axios.js +7 -7
- package/lib/esm/axios/axios.js.map +1 -1
- package/lib/esm/index.d.ts +5 -1
- package/lib/esm/index.js +7 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/types.d.ts +4 -9
- package/lib/index.cjs +8 -2
- package/lib/index.d.ts +5 -1
- package/lib/index.js.map +1 -1
- package/lib/types.d.ts +4 -9
- package/package.json +1 -1
package/lib/esm/axios/axios.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HttpAdapter } from "./../adapter.js";
|
|
2
2
|
import { Axios } from "axios";
|
|
3
|
-
import {
|
|
4
|
-
import { PersistenceKeys, } from "@decaf-ts/core";
|
|
3
|
+
import { OperationKeys, } from "@decaf-ts/db-decorators";
|
|
4
|
+
import { Context, PersistenceKeys, } from "@decaf-ts/core";
|
|
5
5
|
import { AxiosFlavour } from "./constants.js";
|
|
6
6
|
/**
|
|
7
7
|
* @description Axios implementation of the HTTP adapter
|
|
@@ -82,7 +82,7 @@ export class AxiosHttpAdapter extends HttpAdapter {
|
|
|
82
82
|
}
|
|
83
83
|
if (query) {
|
|
84
84
|
req.method = "GET";
|
|
85
|
-
req.url = this.url(query.class, [PersistenceKeys.STATEMENT, query.method, ...query.args], query.params);
|
|
85
|
+
req.url = this.url(query.class, [PersistenceKeys.STATEMENT, query.method, ...(query.args || [])], query.params);
|
|
86
86
|
}
|
|
87
87
|
return req;
|
|
88
88
|
}
|
|
@@ -121,7 +121,7 @@ export class AxiosHttpAdapter extends HttpAdapter {
|
|
|
121
121
|
const url = this.url(tableName);
|
|
122
122
|
const cfg = this.toRequest(ctx);
|
|
123
123
|
log.debug(`POSTing to ${url} with ${JSON.stringify(model)} and cfg ${JSON.stringify(cfg)}`);
|
|
124
|
-
return this.client.post(url, model, cfg);
|
|
124
|
+
return this.parseResponse(OperationKeys.CREATE, await this.client.post(url, model, cfg));
|
|
125
125
|
}
|
|
126
126
|
catch (e) {
|
|
127
127
|
throw this.parseError(e);
|
|
@@ -141,7 +141,7 @@ export class AxiosHttpAdapter extends HttpAdapter {
|
|
|
141
141
|
const url = this.url(tableName, this.extractIdArgs(tableName, id));
|
|
142
142
|
const cfg = this.toRequest(ctx);
|
|
143
143
|
log.debug(`GETing from ${url} and cfg ${JSON.stringify(cfg)}`);
|
|
144
|
-
return this.client.get(url);
|
|
144
|
+
return this.parseResponse(OperationKeys.READ, await this.client.get(url));
|
|
145
145
|
}
|
|
146
146
|
catch (e) {
|
|
147
147
|
throw this.parseError(e);
|
|
@@ -162,7 +162,7 @@ export class AxiosHttpAdapter extends HttpAdapter {
|
|
|
162
162
|
const url = this.url(tableName, this.extractIdArgs(tableName, id));
|
|
163
163
|
const cfg = this.toRequest(ctx);
|
|
164
164
|
log.debug(`PUTing to ${url} with ${JSON.stringify(model)} and cfg ${JSON.stringify(cfg)}`);
|
|
165
|
-
return this.client.put(url, model);
|
|
165
|
+
return this.parseResponse(OperationKeys.UPDATE, await this.client.put(url, model));
|
|
166
166
|
}
|
|
167
167
|
catch (e) {
|
|
168
168
|
throw this.parseError(e);
|
|
@@ -182,7 +182,7 @@ export class AxiosHttpAdapter extends HttpAdapter {
|
|
|
182
182
|
const url = this.url(tableName, this.extractIdArgs(tableName, id));
|
|
183
183
|
const cfg = this.toRequest(ctx);
|
|
184
184
|
log.debug(`DELETEing from ${url} and cfg ${JSON.stringify(cfg)}`);
|
|
185
|
-
return this.client.delete(url);
|
|
185
|
+
return this.parseResponse(OperationKeys.DELETE, await this.client.delete(url));
|
|
186
186
|
}
|
|
187
187
|
catch (e) {
|
|
188
188
|
throw this.parseError(e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"axios.js","sourceRoot":"","sources":["../../../src/axios/axios.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,wBAAmB;AACzC,OAAO,EAAE,KAAK,EAAsB,MAAM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kBAAkB,GAAG,YAAY,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAClE,OAAO,IAAI,CAAC,aAAa,CACvB,aAAa,CAAC,MAAM,EACpB,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAC9B,CAAC;QACJ,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,MAAM,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;IAEQ,UAAU,CAAsB,GAAU,EAAE,GAAG,IAAW;QACjE,OAAO,WAAW,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;IAC9C,CAAC;CACF"}
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -9,6 +9,9 @@ import "@decaf-ts/core";
|
|
|
9
9
|
*/
|
|
10
10
|
export * from "./axios";
|
|
11
11
|
export * from "./adapter";
|
|
12
|
+
export * from "./HttpPaginator";
|
|
13
|
+
export * from "./HttpStatement";
|
|
14
|
+
export * from "./ResponseParser";
|
|
12
15
|
export * from "./RestRepository";
|
|
13
16
|
export * from "./RestService";
|
|
14
17
|
export * from "./types";
|
|
@@ -17,4 +20,5 @@ export * from "./types";
|
|
|
17
20
|
* @summary Version identifier for the module
|
|
18
21
|
* @const VERSION
|
|
19
22
|
*/
|
|
20
|
-
export declare const VERSION = "0.3.
|
|
23
|
+
export declare const VERSION = "0.3.12";
|
|
24
|
+
export declare const PACKAGE_NAME = "@decaf-ts/for-http";
|
package/lib/esm/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "@decaf-ts/core";
|
|
2
|
+
import { Metadata } from "@decaf-ts/decoration";
|
|
2
3
|
/**
|
|
3
4
|
* @description HTTP client module for REST API interactions
|
|
4
5
|
* @summary This module provides classes and utilities for interacting with REST APIs.
|
|
@@ -9,6 +10,9 @@ import "@decaf-ts/core";
|
|
|
9
10
|
*/
|
|
10
11
|
export * from "./axios/index.js";
|
|
11
12
|
export * from "./adapter.js";
|
|
13
|
+
export * from "./HttpPaginator.js";
|
|
14
|
+
export * from "./HttpStatement.js";
|
|
15
|
+
export * from "./ResponseParser.js";
|
|
12
16
|
export * from "./RestRepository.js";
|
|
13
17
|
export * from "./RestService.js";
|
|
14
18
|
export * from "./types.js";
|
|
@@ -17,5 +21,7 @@ export * from "./types.js";
|
|
|
17
21
|
* @summary Version identifier for the module
|
|
18
22
|
* @const VERSION
|
|
19
23
|
*/
|
|
20
|
-
export const VERSION = "0.3.
|
|
24
|
+
export const VERSION = "0.3.12";
|
|
25
|
+
export const PACKAGE_NAME = "@decaf-ts/for-http";
|
|
26
|
+
Metadata.registerLibrary(PACKAGE_NAME, VERSION);
|
|
21
27
|
//# sourceMappingURL=index.js.map
|
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD;;;;;;;GAOG;AACH,iCAAwB;AACxB,6BAA0B;AAC1B,mCAAgC;AAChC,mCAAgC;AAChC,oCAAiC;AACjC,oCAAiC;AACjC,iCAA8B;AAC9B,2BAAwB;AAExB;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC;AAErC,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAC;AAE1C,QAAQ,CAAC,eAAe,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC"}
|
package/lib/esm/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { AdapterFlags } from "@decaf-ts/core";
|
|
2
|
+
import { ResponseParser } from "./ResponseParser";
|
|
3
3
|
/**
|
|
4
4
|
* @description HTTP configuration type
|
|
5
5
|
* @summary Configuration type for HTTP connections specifying protocol and host
|
|
@@ -11,6 +11,7 @@ import { ModelConstructor } from "@decaf-ts/decorator-validation";
|
|
|
11
11
|
export type HttpConfig = {
|
|
12
12
|
protocol: "http" | "https";
|
|
13
13
|
host: string;
|
|
14
|
+
responseParser?: ResponseParser;
|
|
14
15
|
};
|
|
15
16
|
/**
|
|
16
17
|
* @description HTTP flags interface
|
|
@@ -19,12 +20,6 @@ export type HttpConfig = {
|
|
|
19
20
|
* @property {Record<string, string>} [headers] - Optional HTTP headers to include with requests
|
|
20
21
|
* @memberOf module:for-http
|
|
21
22
|
*/
|
|
22
|
-
export interface HttpFlags extends
|
|
23
|
+
export interface HttpFlags extends AdapterFlags {
|
|
23
24
|
headers?: Record<string, string>;
|
|
24
25
|
}
|
|
25
|
-
export type HttpQuery = {
|
|
26
|
-
class: ModelConstructor<any> | string;
|
|
27
|
-
method: string;
|
|
28
|
-
args: any[];
|
|
29
|
-
params?: Record<"limit" | "skip", number>;
|
|
30
|
-
};
|
package/lib/index.cjs
CHANGED
|
@@ -14,8 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.VERSION = void 0;
|
|
17
|
+
exports.PACKAGE_NAME = exports.VERSION = void 0;
|
|
18
18
|
require("@decaf-ts/core");
|
|
19
|
+
const decoration_1 = require("@decaf-ts/decoration");
|
|
19
20
|
/**
|
|
20
21
|
* @description HTTP client module for REST API interactions
|
|
21
22
|
* @summary This module provides classes and utilities for interacting with REST APIs.
|
|
@@ -26,6 +27,9 @@ require("@decaf-ts/core");
|
|
|
26
27
|
*/
|
|
27
28
|
__exportStar(require("./axios/index.cjs"), exports);
|
|
28
29
|
__exportStar(require("./adapter.cjs"), exports);
|
|
30
|
+
__exportStar(require("./HttpPaginator.cjs"), exports);
|
|
31
|
+
__exportStar(require("./HttpStatement.cjs"), exports);
|
|
32
|
+
__exportStar(require("./ResponseParser.cjs"), exports);
|
|
29
33
|
__exportStar(require("./RestRepository.cjs"), exports);
|
|
30
34
|
__exportStar(require("./RestService.cjs"), exports);
|
|
31
35
|
__exportStar(require("./types.cjs"), exports);
|
|
@@ -34,5 +38,7 @@ __exportStar(require("./types.cjs"), exports);
|
|
|
34
38
|
* @summary Version identifier for the module
|
|
35
39
|
* @const VERSION
|
|
36
40
|
*/
|
|
37
|
-
exports.VERSION = "0.3.
|
|
41
|
+
exports.VERSION = "0.3.12";
|
|
42
|
+
exports.PACKAGE_NAME = "@decaf-ts/for-http";
|
|
43
|
+
decoration_1.Metadata.registerLibrary(exports.PACKAGE_NAME, exports.VERSION);
|
|
38
44
|
//# sourceMappingURL=index.js.map
|
package/lib/index.d.ts
CHANGED
|
@@ -9,6 +9,9 @@ import "@decaf-ts/core";
|
|
|
9
9
|
*/
|
|
10
10
|
export * from "./axios";
|
|
11
11
|
export * from "./adapter";
|
|
12
|
+
export * from "./HttpPaginator";
|
|
13
|
+
export * from "./HttpStatement";
|
|
14
|
+
export * from "./ResponseParser";
|
|
12
15
|
export * from "./RestRepository";
|
|
13
16
|
export * from "./RestService";
|
|
14
17
|
export * from "./types";
|
|
@@ -17,4 +20,5 @@ export * from "./types";
|
|
|
17
20
|
* @summary Version identifier for the module
|
|
18
21
|
* @const VERSION
|
|
19
22
|
*/
|
|
20
|
-
export declare const VERSION = "0.3.
|
|
23
|
+
export declare const VERSION = "0.3.12";
|
|
24
|
+
export declare const PACKAGE_NAME = "@decaf-ts/for-http";
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0BAAwB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0BAAwB;AACxB,qDAAgD;AAEhD;;;;;;;GAOG;AACH,oDAAwB;AACxB,gDAA0B;AAC1B,sDAAgC;AAChC,sDAAgC;AAChC,uDAAiC;AACjC,uDAAiC;AACjC,oDAA8B;AAC9B,8CAAwB;AAExB;;;;GAIG;AACU,QAAA,OAAO,GAAG,aAAa,CAAC;AAExB,QAAA,YAAY,GAAG,aAAa,CAAC;AAE1C,qBAAQ,CAAC,eAAe,CAAC,oBAAY,EAAE,eAAO,CAAC,CAAC"}
|
package/lib/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { AdapterFlags } from "@decaf-ts/core";
|
|
2
|
+
import { ResponseParser } from "./ResponseParser";
|
|
3
3
|
/**
|
|
4
4
|
* @description HTTP configuration type
|
|
5
5
|
* @summary Configuration type for HTTP connections specifying protocol and host
|
|
@@ -11,6 +11,7 @@ import { ModelConstructor } from "@decaf-ts/decorator-validation";
|
|
|
11
11
|
export type HttpConfig = {
|
|
12
12
|
protocol: "http" | "https";
|
|
13
13
|
host: string;
|
|
14
|
+
responseParser?: ResponseParser;
|
|
14
15
|
};
|
|
15
16
|
/**
|
|
16
17
|
* @description HTTP flags interface
|
|
@@ -19,12 +20,6 @@ export type HttpConfig = {
|
|
|
19
20
|
* @property {Record<string, string>} [headers] - Optional HTTP headers to include with requests
|
|
20
21
|
* @memberOf module:for-http
|
|
21
22
|
*/
|
|
22
|
-
export interface HttpFlags extends
|
|
23
|
+
export interface HttpFlags extends AdapterFlags {
|
|
23
24
|
headers?: Record<string, string>;
|
|
24
25
|
}
|
|
25
|
-
export type HttpQuery = {
|
|
26
|
-
class: ModelConstructor<any> | string;
|
|
27
|
-
method: string;
|
|
28
|
-
args: any[];
|
|
29
|
-
params?: Record<"limit" | "skip", number>;
|
|
30
|
-
};
|