@fiado/api-invoker 1.3.54 → 1.3.55
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/bin/estafeta/EstafetaApi.d.ts +9 -0
- package/bin/estafeta/EstafetaApi.js +32 -0
- package/bin/estafeta/api/interfaces/IEstafetaApi.d.ts +4 -0
- package/bin/estafeta/api/interfaces/IEstafetaApi.js +2 -0
- package/package.json +1 -1
- package/src/estafeta/EstafetaApi.ts +21 -0
- package/src/estafeta/api/interfaces/IEstafetaApi.ts +5 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
+
import { IEstafetaApi } from "./api/interfaces/IEstafetaApi";
|
|
3
|
+
import { CreateBankAccountCardShippingRequest } from "@fiado/type-kit/bin/card";
|
|
4
|
+
export default class EstafetaApi implements IEstafetaApi {
|
|
5
|
+
private httpRequest;
|
|
6
|
+
private readonly baseUrl;
|
|
7
|
+
constructor(httpRequest: IHttpRequest);
|
|
8
|
+
createShipment(object: CreateBankAccountCardShippingRequest): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const inversify_1 = require("inversify");
|
|
16
|
+
const esm_1 = require("inversify/lib/esm");
|
|
17
|
+
let EstafetaApi = class EstafetaApi {
|
|
18
|
+
constructor(httpRequest) {
|
|
19
|
+
this.httpRequest = httpRequest;
|
|
20
|
+
this.baseUrl = process.env.ESTAFETA_LAMBDA_URL || "";
|
|
21
|
+
}
|
|
22
|
+
async createShipment(object) {
|
|
23
|
+
const url = `${this.baseUrl}shipments/create`;
|
|
24
|
+
return await this.httpRequest.post(url, object);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
EstafetaApi = __decorate([
|
|
28
|
+
(0, inversify_1.injectable)(),
|
|
29
|
+
__param(0, (0, esm_1.inject)("IHttpRequest")),
|
|
30
|
+
__metadata("design:paramtypes", [Object])
|
|
31
|
+
], EstafetaApi);
|
|
32
|
+
exports.default = EstafetaApi;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.55",
|
|
4
4
|
"description": "Sirve como un puente entre diferentes funciones lambda, facilitando la comunicación entre ellas a través de invocaciones http",
|
|
5
5
|
"main": "bin/index.js",
|
|
6
6
|
"types": "bin/index.d.ts",
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {injectable} from "inversify";
|
|
2
|
+
|
|
3
|
+
import {inject} from "inversify/lib/esm";
|
|
4
|
+
import {IHttpRequest} from "@fiado/http-client";
|
|
5
|
+
|
|
6
|
+
import {IEstafetaApi} from "./api/interfaces/IEstafetaApi";
|
|
7
|
+
import {CreateBankAccountCardShippingRequest} from "@fiado/type-kit/bin/card";
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@injectable()
|
|
11
|
+
export default class EstafetaApi implements IEstafetaApi {
|
|
12
|
+
|
|
13
|
+
private readonly baseUrl = process.env.ESTAFETA_LAMBDA_URL || "";
|
|
14
|
+
|
|
15
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
16
|
+
}
|
|
17
|
+
public async createShipment(object: CreateBankAccountCardShippingRequest): Promise<any> {
|
|
18
|
+
const url: string = `${this.baseUrl}shipments/create`;
|
|
19
|
+
return await this.httpRequest.post(url, object);
|
|
20
|
+
}
|
|
21
|
+
}
|