@decaf-ts/for-http 0.4.6 → 0.5.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/README.md +58 -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/adapter.cjs +141 -0
- package/lib/adapter.d.ts +16 -6
- package/lib/adapter.js.map +1 -1
- package/lib/axios/axios.cjs +39 -166
- package/lib/axios/axios.d.ts +6 -46
- package/lib/axios/axios.js.map +1 -1
- package/lib/esm/adapter.d.ts +16 -6
- package/lib/esm/adapter.js +141 -0
- package/lib/esm/adapter.js.map +1 -1
- package/lib/esm/axios/axios.d.ts +6 -46
- package/lib/esm/axios/axios.js +39 -166
- package/lib/esm/axios/axios.js.map +1 -1
- package/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/types.d.ts +36 -0
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/types.d.ts +36 -0
- package/package.json +1 -1
package/lib/esm/axios/axios.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { HttpAdapter } from "../adapter";
|
|
2
2
|
import { Axios, AxiosRequestConfig } from "axios";
|
|
3
|
-
import { HttpConfig } from "../types";
|
|
3
|
+
import { HttpConfig, HttpMethod, HttpRequestOptions } from "../types";
|
|
4
4
|
import { AxiosFlags } from "./types";
|
|
5
|
-
import { BaseError, OperationKeys
|
|
6
|
-
import { Context,
|
|
5
|
+
import { BaseError, OperationKeys } from "@decaf-ts/db-decorators";
|
|
6
|
+
import { Context, MaybeContextualArg, PreparedStatement } from "@decaf-ts/core";
|
|
7
7
|
import { Model } from "@decaf-ts/decorator-validation";
|
|
8
8
|
import { Constructor } from "@decaf-ts/decoration";
|
|
9
9
|
/**
|
|
@@ -59,6 +59,8 @@ export declare class AxiosHttpAdapter extends HttpAdapter<HttpConfig, Axios, Axi
|
|
|
59
59
|
toRequest(query: PreparedStatement<any>): AxiosRequestConfig;
|
|
60
60
|
toRequest(ctx: Context<AxiosFlags>): AxiosRequestConfig;
|
|
61
61
|
toRequest(query: PreparedStatement<any>, ctx: Context<AxiosFlags>): AxiosRequestConfig;
|
|
62
|
+
toRequest(method: HttpMethod, url: string, data?: unknown, options?: HttpRequestOptions): AxiosRequestConfig;
|
|
63
|
+
private toAxiosRequestOptions;
|
|
62
64
|
/**
|
|
63
65
|
* @description Sends an HTTP request using Axios
|
|
64
66
|
* @summary Implementation of the abstract request method from HttpAdapter.
|
|
@@ -67,50 +69,8 @@ export declare class AxiosHttpAdapter extends HttpAdapter<HttpConfig, Axios, Axi
|
|
|
67
69
|
* @param {AxiosRequestConfig} details - The Axios request configuration
|
|
68
70
|
* @return {Promise<V>} A promise that resolves with the response data
|
|
69
71
|
*/
|
|
70
|
-
request<V>(details: AxiosRequestConfig, ...args:
|
|
72
|
+
request<V>(details: AxiosRequestConfig, ...args: MaybeContextualArg<Context<AxiosFlags>>): Promise<V>;
|
|
71
73
|
parseResponse<M extends Model>(clazz: Constructor<M>, method: OperationKeys | string, res: any): any;
|
|
72
74
|
private normalizeResponseBody;
|
|
73
|
-
/**
|
|
74
|
-
* @description Creates a new resource via HTTP POST
|
|
75
|
-
* @summary Implementation of the abstract create method from HttpAdapter.
|
|
76
|
-
* This method sends a POST request to the specified endpoint with the model data.
|
|
77
|
-
* @param {string} tableName - The name of the table or endpoint
|
|
78
|
-
* @param {string|number} id - The identifier for the resource (not used in URL for POST)
|
|
79
|
-
* @param {Record<string, any>} model - The data model to create
|
|
80
|
-
* @return {Promise<Record<string, any>>} A promise that resolves with the created resource
|
|
81
|
-
*/
|
|
82
|
-
create<M extends Model>(tableName: Constructor<M>, id: PrimaryKeyType, model: M, ...args: ContextualArgs<Context<AxiosFlags>>): Promise<Record<string, any>>;
|
|
83
|
-
createAll<M extends Model>(clazz: Constructor<M>, id: PrimaryKeyType[], model: M[], ...args: ContextualArgs<Context<AxiosFlags>>): Promise<Record<string, any>[]>;
|
|
84
|
-
/**
|
|
85
|
-
* @description Retrieves a resource by ID via HTTP GET
|
|
86
|
-
* @summary Implementation of the abstract read method from HttpAdapter.
|
|
87
|
-
* This method sends a GET request to the specified endpoint with the ID as a query parameter.
|
|
88
|
-
* @param {string} tableName - The name of the table or endpoint
|
|
89
|
-
* @param {string|number|bigint} id - The identifier for the resource to retrieve
|
|
90
|
-
* @return {Promise<Record<string, any>>} A promise that resolves with the retrieved resource
|
|
91
|
-
*/
|
|
92
|
-
read<M extends Model>(tableName: Constructor<M> | string, id: PrimaryKeyType, ...args: ContextualArgs<Context<AxiosFlags>>): Promise<Record<string, any>>;
|
|
93
|
-
readAll<M extends Model>(tableName: Constructor<M> | string, ids: PrimaryKeyType[], ...args: ContextualArgs<Context<AxiosFlags>>): Promise<Record<string, any>[]>;
|
|
94
|
-
/**
|
|
95
|
-
* @description Updates an existing resource via HTTP PUT
|
|
96
|
-
* @summary Implementation of the abstract update method from HttpAdapter.
|
|
97
|
-
* This method sends a PUT request to the specified endpoint with the updated model data.
|
|
98
|
-
* @param {string} tableName - The name of the table or endpoint
|
|
99
|
-
* @param {string|number} id - The identifier for the resource (not used in URL for PUT)
|
|
100
|
-
* @param {Record<string, any>} model - The updated data model
|
|
101
|
-
* @return {Promise<Record<string, any>>} A promise that resolves with the updated resource
|
|
102
|
-
*/
|
|
103
|
-
update<M extends Model>(tableName: Constructor<M>, id: PrimaryKeyType, model: Record<string, any>, ...args: ContextualArgs<Context<AxiosFlags>>): Promise<Record<string, any>>;
|
|
104
|
-
updateAll<M extends Model>(tableName: Constructor<M>, ids: PrimaryKeyType[], model: M[], ...args: ContextualArgs<Context<AxiosFlags>>): Promise<Record<string, any>[]>;
|
|
105
|
-
/**
|
|
106
|
-
* @description Deletes a resource by ID via HTTP DELETE
|
|
107
|
-
* @summary Implementation of the abstract delete method from HttpAdapter.
|
|
108
|
-
* This method sends a DELETE request to the specified endpoint with the ID as a query parameter.
|
|
109
|
-
* @param {string} tableName - The name of the table or endpoint
|
|
110
|
-
* @param {string|number|bigint} id - The identifier for the resource to delete
|
|
111
|
-
* @return {Promise<Record<string, any>>} A promise that resolves with the deletion result
|
|
112
|
-
*/
|
|
113
|
-
delete<M extends Model>(tableName: Constructor<M> | string, id: PrimaryKeyType, ...args: ContextualArgs<Context<AxiosFlags>>): Promise<Record<string, any>>;
|
|
114
|
-
deleteAll<M extends Model>(tableName: Constructor<M> | string, ids: PrimaryKeyType[], ...args: ContextualArgs<Context<AxiosFlags>>): Promise<Record<string, any>[]>;
|
|
115
75
|
parseError<E extends BaseError>(err: Error, ...args: any[]): E;
|
|
116
76
|
}
|
package/lib/esm/axios/axios.js
CHANGED
|
@@ -3,7 +3,6 @@ import { Axios } from "axios";
|
|
|
3
3
|
import { BulkCrudOperationKeys, InternalError, OperationKeys, } from "@decaf-ts/db-decorators";
|
|
4
4
|
import { Context, PersistenceKeys, PreparedStatementKeys, } from "@decaf-ts/core";
|
|
5
5
|
import { AxiosFlavour } from "./constants.js";
|
|
6
|
-
import { ModelKeys } from "@decaf-ts/decorator-validation";
|
|
7
6
|
/**
|
|
8
7
|
* @description Axios implementation of the HTTP adapter
|
|
9
8
|
* @summary Concrete implementation of HttpAdapter using Axios as the HTTP client.
|
|
@@ -60,16 +59,25 @@ export class AxiosHttpAdapter extends HttpAdapter {
|
|
|
60
59
|
baseURL: `${this.config.protocol}://${this.config.host}`,
|
|
61
60
|
});
|
|
62
61
|
}
|
|
63
|
-
toRequest(
|
|
62
|
+
toRequest(ctxOrQueryOrMethod, ctxOrUrl, data, options) {
|
|
63
|
+
if (typeof ctxOrQueryOrMethod === "string") {
|
|
64
|
+
const req = Object.assign({
|
|
65
|
+
method: ctxOrQueryOrMethod,
|
|
66
|
+
url: ctxOrUrl,
|
|
67
|
+
}, this.toAxiosRequestOptions(options));
|
|
68
|
+
if (typeof data !== "undefined")
|
|
69
|
+
req.data = data;
|
|
70
|
+
return req;
|
|
71
|
+
}
|
|
64
72
|
let query;
|
|
65
73
|
let context;
|
|
66
|
-
if (
|
|
67
|
-
context =
|
|
74
|
+
if (ctxOrQueryOrMethod instanceof Context) {
|
|
75
|
+
context = ctxOrQueryOrMethod;
|
|
68
76
|
query = undefined; // In this overload, ctx is actually the query
|
|
69
77
|
}
|
|
70
78
|
else {
|
|
71
|
-
query =
|
|
72
|
-
context =
|
|
79
|
+
query = ctxOrQueryOrMethod;
|
|
80
|
+
context = ctxOrUrl;
|
|
73
81
|
}
|
|
74
82
|
const req = {};
|
|
75
83
|
if (context)
|
|
@@ -80,6 +88,17 @@ export class AxiosHttpAdapter extends HttpAdapter {
|
|
|
80
88
|
}
|
|
81
89
|
return req;
|
|
82
90
|
}
|
|
91
|
+
toAxiosRequestOptions(options) {
|
|
92
|
+
if (!options)
|
|
93
|
+
return {};
|
|
94
|
+
const { includeCredentials, ...rest } = options;
|
|
95
|
+
const req = Object.assign({}, rest);
|
|
96
|
+
if (typeof includeCredentials !== "undefined" &&
|
|
97
|
+
typeof req.withCredentials === "undefined") {
|
|
98
|
+
req.withCredentials = includeCredentials;
|
|
99
|
+
}
|
|
100
|
+
return req;
|
|
101
|
+
}
|
|
83
102
|
/**
|
|
84
103
|
* @description Sends an HTTP request using Axios
|
|
85
104
|
* @summary Implementation of the abstract request method from HttpAdapter.
|
|
@@ -102,8 +121,21 @@ export class AxiosHttpAdapter extends HttpAdapter {
|
|
|
102
121
|
return response;
|
|
103
122
|
}
|
|
104
123
|
parseResponse(clazz, method, res) {
|
|
105
|
-
if (!res
|
|
124
|
+
if (!res?.status && method !== PersistenceKeys.STATEMENT) {
|
|
125
|
+
const passthroughMethods = new Set([
|
|
126
|
+
OperationKeys.CREATE,
|
|
127
|
+
OperationKeys.READ,
|
|
128
|
+
OperationKeys.UPDATE,
|
|
129
|
+
OperationKeys.DELETE,
|
|
130
|
+
BulkCrudOperationKeys.CREATE_ALL,
|
|
131
|
+
BulkCrudOperationKeys.READ_ALL,
|
|
132
|
+
BulkCrudOperationKeys.UPDATE_ALL,
|
|
133
|
+
BulkCrudOperationKeys.DELETE_ALL,
|
|
134
|
+
]);
|
|
135
|
+
if (passthroughMethods.has(String(method)))
|
|
136
|
+
return res;
|
|
106
137
|
throw new InternalError("this should be impossible");
|
|
138
|
+
}
|
|
107
139
|
if (res.status >= 400)
|
|
108
140
|
throw this.parseError(res.error || res.status);
|
|
109
141
|
const body = this.normalizeResponseBody(res);
|
|
@@ -172,165 +204,6 @@ export class AxiosHttpAdapter extends HttpAdapter {
|
|
|
172
204
|
}
|
|
173
205
|
return candidate;
|
|
174
206
|
}
|
|
175
|
-
/**
|
|
176
|
-
* @description Creates a new resource via HTTP POST
|
|
177
|
-
* @summary Implementation of the abstract create method from HttpAdapter.
|
|
178
|
-
* This method sends a POST request to the specified endpoint with the model data.
|
|
179
|
-
* @param {string} tableName - The name of the table or endpoint
|
|
180
|
-
* @param {string|number} id - The identifier for the resource (not used in URL for POST)
|
|
181
|
-
* @param {Record<string, any>} model - The data model to create
|
|
182
|
-
* @return {Promise<Record<string, any>>} A promise that resolves with the created resource
|
|
183
|
-
*/
|
|
184
|
-
async create(tableName, id, model, ...args) {
|
|
185
|
-
const { log, ctx } = this.logCtx(args, this.create);
|
|
186
|
-
try {
|
|
187
|
-
const url = this.url(tableName, this.extractIdArgs(tableName, id));
|
|
188
|
-
const cfg = this.toRequest(ctx);
|
|
189
|
-
log.debug(`POSTing to ${url} with ${JSON.stringify(model)} and cfg ${JSON.stringify(cfg)}`);
|
|
190
|
-
const result = await this.request({
|
|
191
|
-
url,
|
|
192
|
-
method: "POST",
|
|
193
|
-
data: JSON.stringify(Object.assign({}, model, {
|
|
194
|
-
[ModelKeys.ANCHOR]: tableName.name,
|
|
195
|
-
})),
|
|
196
|
-
...cfg,
|
|
197
|
-
}, ctx);
|
|
198
|
-
return result;
|
|
199
|
-
}
|
|
200
|
-
catch (e) {
|
|
201
|
-
throw this.parseError(e);
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
async createAll(clazz, id, model, ...args) {
|
|
205
|
-
const { log, ctx } = this.logCtx(args, this.createAll);
|
|
206
|
-
try {
|
|
207
|
-
const url = this.url(clazz, ["bulk"]);
|
|
208
|
-
const cfg = this.toRequest(ctx);
|
|
209
|
-
log.debug(`POSTing to ${url} with ${JSON.stringify(model)} and cfg ${JSON.stringify(cfg)}`);
|
|
210
|
-
return this.request({
|
|
211
|
-
url,
|
|
212
|
-
method: "POST",
|
|
213
|
-
data: JSON.stringify(model.map((m) => Object.assign({}, m, {
|
|
214
|
-
[ModelKeys.ANCHOR]: clazz.name,
|
|
215
|
-
}))),
|
|
216
|
-
...cfg,
|
|
217
|
-
}, ctx);
|
|
218
|
-
}
|
|
219
|
-
catch (e) {
|
|
220
|
-
throw this.parseError(e);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* @description Retrieves a resource by ID via HTTP GET
|
|
225
|
-
* @summary Implementation of the abstract read method from HttpAdapter.
|
|
226
|
-
* This method sends a GET request to the specified endpoint with the ID as a query parameter.
|
|
227
|
-
* @param {string} tableName - The name of the table or endpoint
|
|
228
|
-
* @param {string|number|bigint} id - The identifier for the resource to retrieve
|
|
229
|
-
* @return {Promise<Record<string, any>>} A promise that resolves with the retrieved resource
|
|
230
|
-
*/
|
|
231
|
-
async read(tableName, id, ...args) {
|
|
232
|
-
const { log, ctx } = this.logCtx(args, this.read);
|
|
233
|
-
try {
|
|
234
|
-
const url = this.url(tableName, this.extractIdArgs(tableName, id));
|
|
235
|
-
const cfg = this.toRequest(ctx);
|
|
236
|
-
log.debug(`GETing from ${url} and cfg ${JSON.stringify(cfg)}`);
|
|
237
|
-
return await this.request({ url, method: "GET", ...cfg }, ctx);
|
|
238
|
-
}
|
|
239
|
-
catch (e) {
|
|
240
|
-
throw this.parseError(e);
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
async readAll(tableName, ids, ...args) {
|
|
244
|
-
const { log, ctx } = this.logCtx(args, this.readAll);
|
|
245
|
-
try {
|
|
246
|
-
const url = this.url(tableName, ["bulk"], { ids: ids });
|
|
247
|
-
const cfg = this.toRequest(ctx);
|
|
248
|
-
log.debug(`GETing from ${url} and cfg ${JSON.stringify(cfg)}`);
|
|
249
|
-
return await this.request({ url, method: "GET", ...cfg }, ctx);
|
|
250
|
-
}
|
|
251
|
-
catch (e) {
|
|
252
|
-
throw this.parseError(e);
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
/**
|
|
256
|
-
* @description Updates an existing resource via HTTP PUT
|
|
257
|
-
* @summary Implementation of the abstract update method from HttpAdapter.
|
|
258
|
-
* This method sends a PUT request to the specified endpoint with the updated model data.
|
|
259
|
-
* @param {string} tableName - The name of the table or endpoint
|
|
260
|
-
* @param {string|number} id - The identifier for the resource (not used in URL for PUT)
|
|
261
|
-
* @param {Record<string, any>} model - The updated data model
|
|
262
|
-
* @return {Promise<Record<string, any>>} A promise that resolves with the updated resource
|
|
263
|
-
*/
|
|
264
|
-
async update(tableName, id, model, ...args) {
|
|
265
|
-
const { log, ctx } = this.logCtx(args, this.update);
|
|
266
|
-
try {
|
|
267
|
-
const url = this.url(tableName, this.extractIdArgs(tableName, id));
|
|
268
|
-
const cfg = this.toRequest(ctx);
|
|
269
|
-
log.debug(`PUTing to ${url} with ${JSON.stringify(model)} and cfg ${JSON.stringify(cfg)}`);
|
|
270
|
-
return await this.request({
|
|
271
|
-
url,
|
|
272
|
-
method: "PUT",
|
|
273
|
-
data: JSON.stringify(Object.assign({}, model, {
|
|
274
|
-
[ModelKeys.ANCHOR]: tableName.name,
|
|
275
|
-
})),
|
|
276
|
-
...cfg,
|
|
277
|
-
}, ctx);
|
|
278
|
-
}
|
|
279
|
-
catch (e) {
|
|
280
|
-
throw this.parseError(e);
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
async updateAll(tableName, ids, model, ...args) {
|
|
284
|
-
const { log, ctx } = this.logCtx(args, this.updateAll);
|
|
285
|
-
try {
|
|
286
|
-
const url = this.url(tableName, ["bulk"]);
|
|
287
|
-
const cfg = this.toRequest(ctx);
|
|
288
|
-
log.debug(`PUTing to ${url} with ${JSON.stringify(model)} and cfg ${JSON.stringify(cfg)}`);
|
|
289
|
-
return this.request({
|
|
290
|
-
url,
|
|
291
|
-
method: "PUT",
|
|
292
|
-
data: JSON.stringify(model.map((m) => Object.assign({}, m, {
|
|
293
|
-
[ModelKeys.ANCHOR]: tableName.name,
|
|
294
|
-
}))),
|
|
295
|
-
...cfg,
|
|
296
|
-
}, ctx);
|
|
297
|
-
}
|
|
298
|
-
catch (e) {
|
|
299
|
-
throw this.parseError(e);
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
/**
|
|
303
|
-
* @description Deletes a resource by ID via HTTP DELETE
|
|
304
|
-
* @summary Implementation of the abstract delete method from HttpAdapter.
|
|
305
|
-
* This method sends a DELETE request to the specified endpoint with the ID as a query parameter.
|
|
306
|
-
* @param {string} tableName - The name of the table or endpoint
|
|
307
|
-
* @param {string|number|bigint} id - The identifier for the resource to delete
|
|
308
|
-
* @return {Promise<Record<string, any>>} A promise that resolves with the deletion result
|
|
309
|
-
*/
|
|
310
|
-
async delete(tableName, id, ...args) {
|
|
311
|
-
const { log, ctx } = this.logCtx(args, this.delete);
|
|
312
|
-
try {
|
|
313
|
-
const url = this.url(tableName, this.extractIdArgs(tableName, id));
|
|
314
|
-
const cfg = this.toRequest(ctx);
|
|
315
|
-
log.debug(`DELETEing from ${url} and cfg ${JSON.stringify(cfg)}`);
|
|
316
|
-
return await this.request({ url, method: "DELETE", ...cfg }, ctx);
|
|
317
|
-
}
|
|
318
|
-
catch (e) {
|
|
319
|
-
throw this.parseError(e);
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
async deleteAll(tableName, ids, ...args) {
|
|
323
|
-
const { log, ctx } = this.logCtx(args, this.delete);
|
|
324
|
-
try {
|
|
325
|
-
const url = this.url(tableName, ["bulk"], { ids: ids });
|
|
326
|
-
const cfg = this.toRequest(ctx);
|
|
327
|
-
log.debug(`DELETEing from ${url} and cfg ${JSON.stringify(cfg)}`);
|
|
328
|
-
return await this.request({ url, method: "DELETE", ...cfg }, ctx);
|
|
329
|
-
}
|
|
330
|
-
catch (e) {
|
|
331
|
-
throw this.parseError(e);
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
207
|
parseError(err, ...args) {
|
|
335
208
|
return HttpAdapter.parseError(err, ...args);
|
|
336
209
|
}
|
|
@@ -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,OAAO,CAAC;AAGlD,OAAO,EAEL,qBAAqB,EACrB,aAAa,EACb,aAAa,GAEd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,OAAO,EAEP,eAAe,EAEf,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,uBAAoB;AAC3C,OAAO,EAAS,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAGlE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,MAAM,OAAO,gBAAiB,SAAQ,WAMrC;IACC,YAAY,MAAkB,EAAE,KAAc;QAC5C,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC;IACrC,CAAC;IAEkB,SAAS;QAC1B,OAAO,IAAI,KAAK,CAAC;YACf,OAAO,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;SACnC,CAAC,CAAC;IAC3B,CAAC;IAQQ,SAAS,CAChB,UAAwD,EACxD,GAAyB;QAEzB,IAAI,KAAyC,CAAC;QAC9C,IAAI,OAAwC,CAAC;QAE7C,IAAI,UAAU,YAAY,OAAO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,CAAM,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;wBACpD,CAAC;6BAAM,CAAC;4BACN,MAAM,CAAC,GAAG,CAAC,GAAG,KAAY,CAAC;wBAC7B,CAAC;oBACH,CAAC;oBACD,OAAO,MAAM,CAAC;gBAChB,CAAC;gBACD,OAAO,IAAI,CAAC;YACd;gBACE,OAAO,IAAI,CAAC;QAChB,CAAC;IACH,CAAC;IAEO,qBAAqB,CAAC,GAAQ;QACpC,IAAI,CAAC,GAAG;YAAE,OAAO,GAAG,CAAC;QACrB,MAAM,SAAS,GACb,OAAO,GAAG,CAAC,IAAI,KAAK,WAAW;YAC7B,CAAC,CAAC,GAAG,CAAC,IAAI;YACV,CAAC,CAAC,OAAO,GAAG,CAAC,IAAI,KAAK,WAAW;gBAC/B,CAAC,CAAC,GAAG,CAAC,IAAI;gBACV,CAAC,CAAC,GAAG,CAAC;QACZ,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;YAClC,IAAI,CAAC;gBACH,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;YAC/B,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,SAAS,CAAC;YACnB,CAAC;QACH,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,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
package/lib/esm/index.js
CHANGED
|
@@ -22,7 +22,7 @@ export * from "./event/index.js";
|
|
|
22
22
|
* @summary Version identifier for the module
|
|
23
23
|
* @const VERSION
|
|
24
24
|
*/
|
|
25
|
-
export const VERSION = "0.4.
|
|
25
|
+
export const VERSION = "0.4.6";
|
|
26
26
|
export const PACKAGE_NAME = "@decaf-ts/for-http";
|
|
27
27
|
Metadata.registerLibrary(PACKAGE_NAME, VERSION);
|
|
28
28
|
//# sourceMappingURL=index.js.map
|
package/lib/esm/types.d.ts
CHANGED
|
@@ -17,6 +17,42 @@ export type HttpConfig = {
|
|
|
17
17
|
events?: boolean;
|
|
18
18
|
eventHeaderResolver?: () => Promise<Record<string, string>> | Record<string, string>;
|
|
19
19
|
};
|
|
20
|
+
export type HttpMethod = "GET" | "POST" | "PUT" | "DELETE";
|
|
21
|
+
export type HttpRequestTransform = (data: any, headers?: Record<string, string>) => any;
|
|
22
|
+
/**
|
|
23
|
+
* @description Generic request options for simple HttpAdapter calls
|
|
24
|
+
* @summary for-http owned request options shaped after Axios request config.
|
|
25
|
+
* The adapter maps these options to the underlying client configuration.
|
|
26
|
+
* @interface HttpRequestOptions
|
|
27
|
+
*/
|
|
28
|
+
export interface HttpRequestOptions {
|
|
29
|
+
timeout?: number;
|
|
30
|
+
headers?: Record<string, any>;
|
|
31
|
+
params?: Record<string, any>;
|
|
32
|
+
baseURL?: string;
|
|
33
|
+
responseType?: "json" | "text" | "arraybuffer" | "blob" | "document" | "stream";
|
|
34
|
+
auth?: {
|
|
35
|
+
username: string;
|
|
36
|
+
password: string;
|
|
37
|
+
};
|
|
38
|
+
signal?: AbortSignal;
|
|
39
|
+
transformRequest?: HttpRequestTransform | HttpRequestTransform[];
|
|
40
|
+
transformResponse?: HttpRequestTransform | HttpRequestTransform[];
|
|
41
|
+
validateStatus?: (status: number) => boolean;
|
|
42
|
+
includeCredentials?: boolean;
|
|
43
|
+
withCredentials?: boolean;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* @description Generic HTTP response shape used by simple HttpAdapter helpers
|
|
47
|
+
* @summary for-http owned response envelope aligned with Axios semantics by default.
|
|
48
|
+
* `code` maps to HTTP status code, `data` to response payload, and `error` to failure details.
|
|
49
|
+
* @interface HttpResponse
|
|
50
|
+
*/
|
|
51
|
+
export interface HttpResponse<T = any, E = unknown> {
|
|
52
|
+
code: number;
|
|
53
|
+
data?: T;
|
|
54
|
+
error?: E;
|
|
55
|
+
}
|
|
20
56
|
/**
|
|
21
57
|
* @description HTTP flags interface
|
|
22
58
|
* @summary Interface extending RepositoryFlags with HTTP-specific options
|
package/lib/index.cjs
CHANGED
|
@@ -39,7 +39,7 @@ __exportStar(require("./event/index.cjs"), exports);
|
|
|
39
39
|
* @summary Version identifier for the module
|
|
40
40
|
* @const VERSION
|
|
41
41
|
*/
|
|
42
|
-
exports.VERSION = "0.4.
|
|
42
|
+
exports.VERSION = "0.4.6";
|
|
43
43
|
exports.PACKAGE_NAME = "@decaf-ts/for-http";
|
|
44
44
|
decoration_1.Metadata.registerLibrary(exports.PACKAGE_NAME, exports.VERSION);
|
|
45
45
|
//# sourceMappingURL=index.js.map
|
package/lib/index.d.ts
CHANGED
package/lib/types.d.ts
CHANGED
|
@@ -17,6 +17,42 @@ export type HttpConfig = {
|
|
|
17
17
|
events?: boolean;
|
|
18
18
|
eventHeaderResolver?: () => Promise<Record<string, string>> | Record<string, string>;
|
|
19
19
|
};
|
|
20
|
+
export type HttpMethod = "GET" | "POST" | "PUT" | "DELETE";
|
|
21
|
+
export type HttpRequestTransform = (data: any, headers?: Record<string, string>) => any;
|
|
22
|
+
/**
|
|
23
|
+
* @description Generic request options for simple HttpAdapter calls
|
|
24
|
+
* @summary for-http owned request options shaped after Axios request config.
|
|
25
|
+
* The adapter maps these options to the underlying client configuration.
|
|
26
|
+
* @interface HttpRequestOptions
|
|
27
|
+
*/
|
|
28
|
+
export interface HttpRequestOptions {
|
|
29
|
+
timeout?: number;
|
|
30
|
+
headers?: Record<string, any>;
|
|
31
|
+
params?: Record<string, any>;
|
|
32
|
+
baseURL?: string;
|
|
33
|
+
responseType?: "json" | "text" | "arraybuffer" | "blob" | "document" | "stream";
|
|
34
|
+
auth?: {
|
|
35
|
+
username: string;
|
|
36
|
+
password: string;
|
|
37
|
+
};
|
|
38
|
+
signal?: AbortSignal;
|
|
39
|
+
transformRequest?: HttpRequestTransform | HttpRequestTransform[];
|
|
40
|
+
transformResponse?: HttpRequestTransform | HttpRequestTransform[];
|
|
41
|
+
validateStatus?: (status: number) => boolean;
|
|
42
|
+
includeCredentials?: boolean;
|
|
43
|
+
withCredentials?: boolean;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* @description Generic HTTP response shape used by simple HttpAdapter helpers
|
|
47
|
+
* @summary for-http owned response envelope aligned with Axios semantics by default.
|
|
48
|
+
* `code` maps to HTTP status code, `data` to response payload, and `error` to failure details.
|
|
49
|
+
* @interface HttpResponse
|
|
50
|
+
*/
|
|
51
|
+
export interface HttpResponse<T = any, E = unknown> {
|
|
52
|
+
code: number;
|
|
53
|
+
data?: T;
|
|
54
|
+
error?: E;
|
|
55
|
+
}
|
|
20
56
|
/**
|
|
21
57
|
* @description HTTP flags interface
|
|
22
58
|
* @summary Interface extending RepositoryFlags with HTTP-specific options
|