@fiado/api-invoker 1.3.55 → 1.3.57

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.
@@ -1,9 +1,11 @@
1
1
  import { IHttpRequest } from "@fiado/http-client";
2
2
  import { IEstafetaApi } from "./api/interfaces/IEstafetaApi";
3
3
  import { CreateBankAccountCardShippingRequest } from "@fiado/type-kit/bin/card";
4
+ import { CreateBankAccountCardShippingResponse } from "@fiado/type-kit/bin/card";
5
+ import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
4
6
  export default class EstafetaApi implements IEstafetaApi {
5
7
  private httpRequest;
6
8
  private readonly baseUrl;
7
9
  constructor(httpRequest: IHttpRequest);
8
- createShipment(object: CreateBankAccountCardShippingRequest): Promise<any>;
10
+ createShipment(object: CreateBankAccountCardShippingRequest): Promise<FiadoApiResponse<CreateBankAccountCardShippingResponse>>;
9
11
  }
@@ -20,7 +20,7 @@ let EstafetaApi = class EstafetaApi {
20
20
  this.baseUrl = process.env.ESTAFETA_LAMBDA_URL || "";
21
21
  }
22
22
  async createShipment(object) {
23
- const url = `${this.baseUrl}shipments/create`;
23
+ const url = `${this.baseUrl}estafeta/shipping/card`;
24
24
  return await this.httpRequest.post(url, object);
25
25
  }
26
26
  };
@@ -0,0 +1,11 @@
1
+ import { IHttpRequest } from "@fiado/http-client";
2
+ import { IEstafetaApi } from "./interfaces/IEstafetaApi";
3
+ import { CreateBankAccountCardShippingRequest } from "@fiado/type-kit/bin/card";
4
+ import { CreateBankAccountCardShippingResponse } from "@fiado/type-kit/bin/card";
5
+ import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
6
+ export default class EstafetaApi implements IEstafetaApi {
7
+ private httpRequest;
8
+ private readonly baseUrl;
9
+ constructor(httpRequest: IHttpRequest);
10
+ createShipment(object: CreateBankAccountCardShippingRequest): Promise<FiadoApiResponse<CreateBankAccountCardShippingResponse>>;
11
+ }
@@ -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}estafeta/shipping/card`;
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;
@@ -0,0 +1,2 @@
1
+ export * from './api/interfaces/IEstafetaApi';
2
+ export * from './api/EstafetaApi';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./api/interfaces/IEstafetaApi"), exports);
18
+ __exportStar(require("./api/EstafetaApi"), exports);
package/bin/index.d.ts CHANGED
@@ -44,3 +44,4 @@ export * from "./pricelist-business";
44
44
  export * from "./card";
45
45
  export * from "./document-image-processor";
46
46
  export * from "./order-collector-business";
47
+ export * from "./estafeta";
package/bin/index.js CHANGED
@@ -60,3 +60,4 @@ __exportStar(require("./pricelist-business"), exports);
60
60
  __exportStar(require("./card"), exports);
61
61
  __exportStar(require("./document-image-processor"), exports);
62
62
  __exportStar(require("./order-collector-business"), exports);
63
+ __exportStar(require("./estafeta"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "1.3.55",
3
+ "version": "1.3.57",
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",
@@ -3,8 +3,10 @@ import {injectable} from "inversify";
3
3
  import {inject} from "inversify/lib/esm";
4
4
  import {IHttpRequest} from "@fiado/http-client";
5
5
 
6
- import {IEstafetaApi} from "./api/interfaces/IEstafetaApi";
6
+ import {IEstafetaApi} from "./interfaces/IEstafetaApi";
7
7
  import {CreateBankAccountCardShippingRequest} from "@fiado/type-kit/bin/card";
8
+ import {CreateBankAccountCardShippingResponse} from "@fiado/type-kit/bin/card";
9
+ import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
8
10
 
9
11
 
10
12
  @injectable()
@@ -14,8 +16,8 @@ export default class EstafetaApi implements IEstafetaApi {
14
16
 
15
17
  constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
16
18
  }
17
- public async createShipment(object: CreateBankAccountCardShippingRequest): Promise<any> {
18
- const url: string = `${this.baseUrl}shipments/create`;
19
+ public async createShipment(object: CreateBankAccountCardShippingRequest): Promise<FiadoApiResponse<CreateBankAccountCardShippingResponse>> {
20
+ const url: string = `${this.baseUrl}estafeta/shipping/card`;
19
21
  return await this.httpRequest.post(url, object);
20
22
  }
21
23
  }
@@ -0,0 +1,2 @@
1
+ export * from './api/interfaces/IEstafetaApi';
2
+ export * from './api/EstafetaApi';
package/src/index.ts CHANGED
@@ -43,5 +43,6 @@ export * from "./service-business";
43
43
  export * from "./pricelist-business";
44
44
  export * from "./card";
45
45
  export * from "./document-image-processor";
46
- export * from "./order-collector-business"
46
+ export * from "./order-collector-business";
47
+ export * from "./estafeta";
47
48