@fiado/api-invoker 1.0.38 → 1.0.40

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.
@@ -14,12 +14,14 @@ const address_1 = require("./address");
14
14
  const AccountFiadoIncApi_1 = __importDefault(require("./account-fiadoinc/AccountFiadoIncApi"));
15
15
  const AccountPagoConfiadoApi_1 = __importDefault(require("./account-pagoconfiado/AccountPagoConfiadoApi"));
16
16
  const AccountFiadoSAApi_1 = __importDefault(require("./account-fiadosa/AccountFiadoSAApi"));
17
+ const STPAccountApi_1 = __importDefault(require("./stpAccount/api/STPAccountApi"));
17
18
  exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
18
19
  bind("IDirectoryApi").to(directory_1.DirectoryApi);
19
20
  bind("IIdentityApi").to(identity_1.IdentityApi);
20
21
  bind("IAddressApi").to(address_1.AddressApi);
21
22
  bind("ITernApi").to(TernApi_1.default);
22
23
  bind("IPomeloApi").to(PomeloApi_1.default);
24
+ bind("ISTPAccountApi").to(STPAccountApi_1.default);
23
25
  bind("IAccountFiadoIncApi").to(AccountFiadoIncApi_1.default);
24
26
  bind("IAccountPagoConfiadoApi").to(AccountPagoConfiadoApi_1.default);
25
27
  bind("IAccountFiadoSAApi").to(AccountFiadoSAApi_1.default);
@@ -1,6 +1,7 @@
1
1
  import { IPomeloApi } from "./interfaces/IPomeloApi";
2
2
  import { IHttpRequest } from "@fiado/http-client";
3
- import { CreateBankAccountUserRequest, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
3
+ import { CreateBankAccountRequest, CreateBankAccountUserRequest, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
4
+ import { ActivateBankAccountCardRequest, CreateBankAccountCardShippingRequest, GetBankAccountShippingRequest, UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card";
4
5
  export default class PomeloApi implements IPomeloApi {
5
6
  private httpRequest;
6
7
  private readonly baseUrl;
@@ -8,4 +9,14 @@ export default class PomeloApi implements IPomeloApi {
8
9
  createUser(request: CreateBankAccountUserRequest): Promise<any>;
9
10
  getUserById(externalUserId: string): Promise<any>;
10
11
  updateUser(object: UpdateBankAccountUserRequest): Promise<any>;
12
+ getCardSensitiveInformation(externalCardId: string, externalUserId?: string): Promise<any>;
13
+ getCardsById(externalCardId: string): Promise<any>;
14
+ getCardsByUserId(externalUserId: string): Promise<any>;
15
+ createCard(object: CreateBankAccountRequest): Promise<any>;
16
+ blockCard(object: UpdateBankAccountCardRequest): Promise<any>;
17
+ changePin(object: UpdateBankAccountCardRequest): Promise<any>;
18
+ activateCard(object: ActivateBankAccountCardRequest): Promise<any>;
19
+ updateCard(object: UpdateBankAccountCardRequest): Promise<any>;
20
+ createShipment(object: CreateBankAccountCardShippingRequest): Promise<any>;
21
+ getShipment(object: GetBankAccountShippingRequest): Promise<any>;
11
22
  }
@@ -31,6 +31,48 @@ let PomeloApi = class PomeloApi {
31
31
  const url = `${this.baseUrl}/users/${object.id}`;
32
32
  return await this.httpRequest.put(url, object);
33
33
  }
34
+ // //Card
35
+ async getCardSensitiveInformation(externalCardId, externalUserId) {
36
+ const url = `${this.baseUrl}cards/${externalCardId}/sensitive?externalUserId=${externalUserId}`;
37
+ return await this.httpRequest.get(url);
38
+ }
39
+ async getCardsById(externalCardId) {
40
+ const url = `${this.baseUrl}cards?externalCardId=${externalCardId}`;
41
+ return await this.httpRequest.get(url);
42
+ }
43
+ async getCardsByUserId(externalUserId) {
44
+ const url = `${this.baseUrl}cards?externalUserId=${externalUserId}`;
45
+ return await this.httpRequest.get(url);
46
+ }
47
+ async createCard(object) {
48
+ const url = `${this.baseUrl}cards/create`;
49
+ return await this.httpRequest.post(url, object);
50
+ }
51
+ async blockCard(object) {
52
+ const url = `${this.baseUrl}cards/${object.cardId}/`;
53
+ return await this.httpRequest.put(url, object);
54
+ }
55
+ async changePin(object) {
56
+ const url = `${this.baseUrl}cards/${object.cardId}/`;
57
+ return await this.httpRequest.put(url, object);
58
+ }
59
+ async activateCard(object) {
60
+ const url = `${this.baseUrl}cards/activate`;
61
+ return await this.httpRequest.post(url, object);
62
+ }
63
+ async updateCard(object) {
64
+ const url = `${this.baseUrl}cards/${object.cardId}/`;
65
+ return await this.httpRequest.put(url, object);
66
+ }
67
+ // //Shipping
68
+ async createShipment(object) {
69
+ const url = `${this.baseUrl}shipment/create`;
70
+ return await this.httpRequest.post(url, object);
71
+ }
72
+ async getShipment(object) {
73
+ const url = `${this.baseUrl}shipment/${object.externalShippingId}`;
74
+ return await this.httpRequest.get(url);
75
+ }
34
76
  };
35
77
  PomeloApi = __decorate([
36
78
  (0, inversify_1.injectable)(),
@@ -1,6 +1,14 @@
1
- import { CreateBankAccountUserRequest, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
1
+ import { CreateBankAccountRequest, CreateBankAccountUserRequest, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
2
+ import { UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card";
2
3
  export interface IPomeloApi {
3
4
  updateUser(object: UpdateBankAccountUserRequest): Promise<any>;
4
5
  getUserById(externalUserId: string): Promise<any>;
5
6
  createUser(request: CreateBankAccountUserRequest): Promise<any>;
7
+ getCardSensitiveInformation(externalCardId: string, externalUserId?: string): Promise<any>;
8
+ getCardsById(externalCardId: string): Promise<any>;
9
+ getCardsByUserId(externalUserId: string): Promise<any>;
10
+ createCard(object: CreateBankAccountRequest): Promise<any>;
11
+ blockCard(object: UpdateBankAccountCardRequest): Promise<any>;
12
+ changePin(object: UpdateBankAccountCardRequest): Promise<any>;
13
+ activateCard(object: UpdateBankAccountCardRequest): Promise<any>;
6
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "1.0.38",
3
+ "version": "1.0.40",
4
4
  "description": "Sirve como un puente entre diferentes funciones lambda, facilitando la comunicación entre ellas a traves de invocaciones http",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -14,6 +14,8 @@ import {IAccountPagoConfiadoApi} from "./account-pagoconfiado";
14
14
  import AccountPagoConfiadoApi from "./account-pagoconfiado/AccountPagoConfiadoApi";
15
15
  import {IAccountFiadoSAApi} from "./account-fiadosa";
16
16
  import AccountFiadoSAApi from "./account-fiadosa/AccountFiadoSAApi";
17
+ import { ISTPAccountApi } from "./stpAccount";
18
+ import STPAccountApi from "./stpAccount/api/STPAccountApi";
17
19
 
18
20
  export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) => {
19
21
  bind<IDirectoryApi>("IDirectoryApi").to(DirectoryApi);
@@ -21,6 +23,7 @@ export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) =>
21
23
  bind<IAddressApi>("IAddressApi").to(AddressApi);
22
24
  bind<ITernApi>("ITernApi").to(TernApi);
23
25
  bind<IPomeloApi>("IPomeloApi").to(PomeloApi);
26
+ bind<ISTPAccountApi>("ISTPAccountApi").to(STPAccountApi);
24
27
  bind<IAccountFiadoIncApi>("IAccountFiadoIncApi").to(AccountFiadoIncApi);
25
28
  bind<IAccountPagoConfiadoApi>("IAccountPagoConfiadoApi").to(AccountPagoConfiadoApi);
26
29
  bind<IAccountFiadoSAApi>("IAccountFiadoSAApi").to(AccountFiadoSAApi);
@@ -1,19 +1,18 @@
1
- import {IPomeloApi } from "./interfaces/IPomeloApi";
2
- import {inject, injectable} from "inversify";
3
- import {IHttpRequest} from "@fiado/http-client";
4
- import {CreateBankAccountUserRequest, UpdateBankAccountUserRequest} from "@fiado/type-kit/bin/account";
1
+ import { IPomeloApi } from "./interfaces/IPomeloApi";
2
+ import { inject, injectable } from "inversify";
3
+ import { IHttpRequest } from "@fiado/http-client";
4
+ import { CreateBankAccountRequest, CreateBankAccountUserRequest, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
5
+ import { ActivateBankAccountCardRequest, CreateBankAccountCardShippingRequest, GetBankAccountShippingRequest, UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card";
5
6
 
6
7
 
7
8
  @injectable()
8
9
  export default class PomeloApi implements IPomeloApi {
9
10
 
10
-
11
11
  private readonly baseUrl = process.env.POMELO_LAMBDA_URL || "";
12
12
 
13
13
  constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
14
14
  }
15
15
 
16
-
17
16
  //USER
18
17
  async createUser(request: CreateBankAccountUserRequest): Promise<any> {
19
18
  const url: string = `${this.baseUrl}users/create`;
@@ -31,65 +30,65 @@ export default class PomeloApi implements IPomeloApi {
31
30
  }
32
31
 
33
32
  // //Card
34
- // public async getCardSensitiveInformation(externalCardId: string, externalUserId?: string): Promise<GetBankAccountSensitiveInformationOutput> {
35
- // const url: string = `${this.baseUrl}cards/${externalCardId}/sensitive?externalUserId=${externalUserId}`;
36
- // return await this.httpRequest.get(url);
37
- // }
33
+ public async getCardSensitiveInformation(externalCardId: string, externalUserId?: string): Promise<any> {
34
+ const url: string = `${this.baseUrl}cards/${externalCardId}/sensitive?externalUserId=${externalUserId}`;
35
+ return await this.httpRequest.get(url);
36
+ }
38
37
 
39
- // public async getCardsById(externalCardId: string): Promise<GetBankAccountCardOutput> {
40
- // const url: string = `${this.baseUrl}cards?externalCardId=${externalCardId}`;
41
- // return await this.httpRequest.get(url);
42
- // }
38
+ public async getCardsById(externalCardId: string): Promise<any> {
39
+ const url: string = `${this.baseUrl}cards?externalCardId=${externalCardId}`;
40
+ return await this.httpRequest.get(url);
41
+ }
43
42
 
44
- // public async getCardsByUserId(externalUserId: string): Promise<GetBankAccountCardOutput> {
45
- // const url: string = `${this.baseUrl}cards?externalUserId=${externalUserId}`;
46
- // return await this.httpRequest.get(url);
47
- // }
43
+ public async getCardsByUserId(externalUserId: string): Promise<any> {
44
+ const url: string = `${this.baseUrl}cards?externalUserId=${externalUserId}`;
45
+ return await this.httpRequest.get(url);
46
+ }
48
47
 
49
- // public async createCard(object: CreateBankAccountCardInput): Promise<CreateBankAccountCardOutput> {
50
- // const url: string = `${this.baseUrl}cards/create`;
51
- // return await this.httpRequest.post(url, object);
52
- // }
48
+ public async createCard(object: CreateBankAccountRequest): Promise<any> {
49
+ const url: string = `${this.baseUrl}cards/create`;
50
+ return await this.httpRequest.post(url, object);
51
+ }
53
52
 
54
- // public async blockCard(object: UpdateBankAccountCardInput): Promise<UpdateBankAccountCardOutput> {
55
- // const url: string = `${this.baseUrl}cards/${object.cardId}/`;
56
- // return await this.httpRequest.put(url, object);
57
- // }
53
+ public async blockCard(object: UpdateBankAccountCardRequest): Promise<any> {
54
+ const url: string = `${this.baseUrl}cards/${object.cardId}/`;
55
+ return await this.httpRequest.put(url, object);
56
+ }
58
57
 
59
- // public async changePin(object: UpdateBankAccountCardInput): Promise<UpdateBankAccountCardOutput> {
60
- // const url: string = `${this.baseUrl}cards/${object.cardId}/`;
61
- // return await this.httpRequest.put(url, object);
62
- // }
58
+ public async changePin(object: UpdateBankAccountCardRequest): Promise<any> {
59
+ const url: string = `${this.baseUrl}cards/${object.cardId}/`;
60
+ return await this.httpRequest.put(url, object);
61
+ }
63
62
 
64
- // public async activateCard(object: ActivateBankAccountCardInput): Promise<ActivateBankAccountCardOutput> {
65
- // const url: string = `${this.baseUrl}cards/activate`;
66
- // return await this.httpRequest.post(url, object);
67
- // }
63
+ public async activateCard(object: ActivateBankAccountCardRequest): Promise<any> {
64
+ const url: string = `${this.baseUrl}cards/activate`;
65
+ return await this.httpRequest.post(url, object);
66
+ }
68
67
 
69
- // public async updateCard(object: UpdateBankAccountCardInput): Promise<UpdateBankAccountCardOutput> {
70
- // const url: string = `${this.baseUrl}cards/${object.cardId}/`;
71
- // return await this.httpRequest.put(url, object);
72
- // }
68
+ public async updateCard(object: UpdateBankAccountCardRequest): Promise<any> {
69
+ const url: string = `${this.baseUrl}cards/${object.cardId}/`;
70
+ return await this.httpRequest.put(url, object);
71
+ }
73
72
 
74
73
 
75
74
  // //Shipping
76
75
 
77
- // public async createShipment(object: CreateBankAccountCardShippingInput): Promise<any> {
78
- // const url: string = `${this.baseUrl}shipment/create`;
79
- // return await this.httpRequest.post(url, object);
80
- // }
76
+ public async createShipment(object: CreateBankAccountCardShippingRequest): Promise<any> {
77
+ const url: string = `${this.baseUrl}shipment/create`;
78
+ return await this.httpRequest.post(url, object);
79
+ }
81
80
 
82
- // public async getShipment(object: GetBankAccountShippingInput): Promise<GetBankAccountShippingOutput> {
83
- // const url: string = `${this.baseUrl}shipment/${object.shippingId}`;
84
- // return await this.httpRequest.get(url);
85
- // }
81
+ public async getShipment(object: GetBankAccountShippingRequest): Promise<any> {
82
+ const url: string = `${this.baseUrl}shipment/${object.externalShippingId}`;
83
+ return await this.httpRequest.get(url);
84
+ }
86
85
 
87
- // public async replaceCardByExternalId(object: ExternalReplaceCardInput): Promise<ExternalReplaceCardOutput> {
86
+ // public async replaceCardByExternalId(object: ExternalReplaceCardRequest): Promise<any> {
88
87
  // const url: string = `${this.baseUrl}cards/${object.externalCardId}/replace`;
89
88
  // return await this.httpRequest.put(url, object);
90
89
  // }
91
90
 
92
91
 
93
-
92
+
94
93
 
95
94
  }
@@ -1,8 +1,20 @@
1
- import {CreateBankAccountUserRequest, CreateBankAccountUserResponse, GetBankAccountUserRequest, GetBankAccountUserResponse, UpdateBankAccountUserRequest, UpdateBankAccountUserResponse} from "@fiado/type-kit/bin/account";
1
+ import {CreateBankAccountRequest, CreateBankAccountUserRequest, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
2
+ import { UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card";
2
3
 
3
4
  export interface IPomeloApi {
4
5
 
5
6
  updateUser(object: UpdateBankAccountUserRequest): Promise<any>
6
7
  getUserById(externalUserId: string): Promise<any>
7
8
  createUser(request: CreateBankAccountUserRequest): Promise<any>;
9
+
10
+
11
+ // //Card
12
+ getCardSensitiveInformation(externalCardId: string, externalUserId?: string): Promise<any>
13
+ getCardsById(externalCardId: string): Promise<any>
14
+ getCardsByUserId(externalUserId: string): Promise<any>
15
+ createCard(object: CreateBankAccountRequest): Promise<any>
16
+ blockCard(object: UpdateBankAccountCardRequest): Promise<any>
17
+ changePin(object: UpdateBankAccountCardRequest): Promise<any>
18
+ activateCard(object: UpdateBankAccountCardRequest): Promise<any>
19
+
8
20
  }