@fiado/api-invoker 5.147.0 → 5.148.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.
@@ -1,7 +1,8 @@
1
1
  import { IPomeloApi } from "./interfaces/IPomeloApi.js";
2
- import { IHttpRequest } from "@fiado/http-client";
2
+ import type { IHttpRequest } from "@fiado/http-client";
3
3
  import { CreateBankAccountRequest, CreateBankAccountUserRequest, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account/index.js";
4
4
  import { ActivateBankAccountCardRequest, AssignCardRequest, CreateBankAccountCardShippingRequest, GetBankAccountShippingRequest, UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card/index.js";
5
+ import { PomeloThreeDSChallengeAnswerRequest, PomeloWalletProvisioningRequest } from "@fiado/type-kit/bin/card/index.js";
5
6
  export default class PomeloApi implements IPomeloApi {
6
7
  private httpRequest;
7
8
  private readonly baseUrl;
@@ -22,4 +23,9 @@ export default class PomeloApi implements IPomeloApi {
22
23
  getUserToken(externalUserId: string): Promise<any>;
23
24
  createShipment(object: CreateBankAccountCardShippingRequest): Promise<any>;
24
25
  getShipment(object: GetBankAccountShippingRequest): Promise<any>;
26
+ provisionWallet(request: PomeloWalletProvisioningRequest): Promise<any>;
27
+ getCardTokens(externalCardId: string): Promise<any>;
28
+ deleteCardToken(externalCardId: string, tokenId: string): Promise<any>;
29
+ getPendingThreeDSChallenges(externalCardIds: string[]): Promise<any>;
30
+ answerThreeDSChallenge(threedsTransactionId: string, request: PomeloThreeDSChallengeAnswerRequest): Promise<any>;
25
31
  }
@@ -84,6 +84,32 @@ let PomeloApi = class PomeloApi {
84
84
  const url = `${this.baseUrl}shipment/${object.externalShippingId}`;
85
85
  return await this.httpRequest.get(url);
86
86
  }
87
+ // public async replaceCardByExternalId(object: ExternalReplaceCardRequest): Promise<any> {
88
+ // const url: string = `${this.baseUrl}cards/${object.externalCardId}/replace`;
89
+ // return await this.httpRequest.put(url, object);
90
+ // }
91
+ // //Wallet y 3DS
92
+ async provisionWallet(request) {
93
+ const url = `${this.baseUrl}tokenization/provisioning`;
94
+ return await this.httpRequest.post(url, request);
95
+ }
96
+ async getCardTokens(externalCardId) {
97
+ const url = `${this.baseUrl}cards/${encodeURIComponent(externalCardId)}/tokens`;
98
+ return await this.httpRequest.get(url);
99
+ }
100
+ async deleteCardToken(externalCardId, tokenId) {
101
+ const url = `${this.baseUrl}tokens/${encodeURIComponent(tokenId)}/deletion`;
102
+ return await this.httpRequest.post(url, { cardId: externalCardId });
103
+ }
104
+ async getPendingThreeDSChallenges(externalCardIds) {
105
+ const cardIds = externalCardIds.map((id) => encodeURIComponent(id)).join(',');
106
+ const url = `${this.baseUrl}threeds/challenges/pending?cardIds=${cardIds}`;
107
+ return await this.httpRequest.get(url);
108
+ }
109
+ async answerThreeDSChallenge(threedsTransactionId, request) {
110
+ const url = `${this.baseUrl}threeds/challenges/${encodeURIComponent(threedsTransactionId)}/answer`;
111
+ return await this.httpRequest.post(url, request);
112
+ }
87
113
  };
88
114
  PomeloApi = __decorate([
89
115
  injectable(),
@@ -1,5 +1,6 @@
1
1
  import { CreateBankAccountRequest, CreateBankAccountUserRequest, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account/index.js";
2
2
  import { ActivateBankAccountCardRequest, AssignCardRequest, CreateBankAccountCardShippingRequest, GetBankAccountShippingRequest, UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card/index.js";
3
+ import { PomeloThreeDSChallengeAnswerRequest, PomeloWalletProvisioningRequest } from "@fiado/type-kit/bin/card/index.js";
3
4
  export interface IPomeloApi {
4
5
  updateUser(object: UpdateBankAccountUserRequest): Promise<any>;
5
6
  getUserById(externalUserId: string): Promise<any>;
@@ -16,4 +17,9 @@ export interface IPomeloApi {
16
17
  assignCardToUser(request: AssignCardRequest): Promise<any>;
17
18
  createShipment(object: CreateBankAccountCardShippingRequest): Promise<any>;
18
19
  getShipment(object: GetBankAccountShippingRequest): Promise<any>;
20
+ provisionWallet(request: PomeloWalletProvisioningRequest): Promise<any>;
21
+ getCardTokens(externalCardId: string): Promise<any>;
22
+ deleteCardToken(externalCardId: string, tokenId: string): Promise<any>;
23
+ getPendingThreeDSChallenges(externalCardIds: string[]): Promise<any>;
24
+ answerThreeDSChallenge(threedsTransactionId: string, request: PomeloThreeDSChallengeAnswerRequest): Promise<any>;
19
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "5.147.0",
3
+ "version": "5.148.0",
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
  "type": "module",
6
6
  "main": "bin/index.js",
@@ -34,7 +34,7 @@
34
34
  "@fiado/gateway-adapter": "^3.14.0",
35
35
  "@fiado/http-client": "^2.0.1",
36
36
  "@fiado/logger": "^1.1.3",
37
- "@fiado/type-kit": "^3.585.0",
37
+ "@fiado/type-kit": "^3.594.0",
38
38
  "dotenv": "^16.4.7"
39
39
  },
40
40
  "peerDependencies": {
@@ -1,8 +1,9 @@
1
1
  import { IPomeloApi } from "./interfaces/IPomeloApi.js";
2
2
  import { inject, injectable } from "inversify";
3
- import { IHttpRequest } from "@fiado/http-client";
3
+ import type { IHttpRequest } from "@fiado/http-client";
4
4
  import { CreateBankAccountRequest, CreateBankAccountUserRequest, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account/index.js";
5
5
  import { ActivateBankAccountCardRequest, AssignCardRequest, CreateBankAccountCardShippingRequest, GetBankAccountShippingRequest, UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card/index.js";
6
+ import { PomeloThreeDSChallengeAnswerRequest, PomeloWalletProvisioningRequest } from "@fiado/type-kit/bin/card/index.js";
6
7
 
7
8
 
8
9
  @injectable()
@@ -103,7 +104,31 @@ export default class PomeloApi implements IPomeloApi {
103
104
  // return await this.httpRequest.put(url, object);
104
105
  // }
105
106
 
107
+ // //Wallet y 3DS
106
108
 
109
+ public async provisionWallet(request: PomeloWalletProvisioningRequest): Promise<any> {
110
+ const url: string = `${this.baseUrl}tokenization/provisioning`;
111
+ return await this.httpRequest.post(url, request);
112
+ }
113
+
114
+ public async getCardTokens(externalCardId: string): Promise<any> {
115
+ const url: string = `${this.baseUrl}cards/${encodeURIComponent(externalCardId)}/tokens`;
116
+ return await this.httpRequest.get(url);
117
+ }
107
118
 
119
+ public async deleteCardToken(externalCardId: string, tokenId: string): Promise<any> {
120
+ const url: string = `${this.baseUrl}tokens/${encodeURIComponent(tokenId)}/deletion`;
121
+ return await this.httpRequest.post(url, { cardId: externalCardId });
122
+ }
108
123
 
124
+ public async getPendingThreeDSChallenges(externalCardIds: string[]): Promise<any> {
125
+ const cardIds = externalCardIds.map((id) => encodeURIComponent(id)).join(',');
126
+ const url: string = `${this.baseUrl}threeds/challenges/pending?cardIds=${cardIds}`;
127
+ return await this.httpRequest.get(url);
128
+ }
129
+
130
+ public async answerThreeDSChallenge(threedsTransactionId: string, request: PomeloThreeDSChallengeAnswerRequest): Promise<any> {
131
+ const url: string = `${this.baseUrl}threeds/challenges/${encodeURIComponent(threedsTransactionId)}/answer`;
132
+ return await this.httpRequest.post(url, request);
133
+ }
109
134
  }
@@ -1,5 +1,6 @@
1
1
  import {CreateBankAccountRequest, CreateBankAccountUserRequest, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account/index.js";
2
2
  import { ActivateBankAccountCardRequest, AssignCardRequest, CreateBankAccountCardShippingRequest, GetBankAccountShippingRequest, UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card/index.js";
3
+ import { PomeloThreeDSChallengeAnswerRequest, PomeloWalletProvisioningRequest } from "@fiado/type-kit/bin/card/index.js";
3
4
 
4
5
  export interface IPomeloApi {
5
6
 
@@ -25,6 +26,13 @@ export interface IPomeloApi {
25
26
  createShipment(object: CreateBankAccountCardShippingRequest): Promise<any>
26
27
  getShipment(object: GetBankAccountShippingRequest): Promise<any>
27
28
 
29
+ // //Wallet y 3DS
30
+ provisionWallet(request: PomeloWalletProvisioningRequest): Promise<any>;
31
+ getCardTokens(externalCardId: string): Promise<any>;
32
+ deleteCardToken(externalCardId: string, tokenId: string): Promise<any>;
33
+ getPendingThreeDSChallenges(externalCardIds: string[]): Promise<any>;
34
+ answerThreeDSChallenge(threedsTransactionId: string, request: PomeloThreeDSChallengeAnswerRequest): Promise<any>;
35
+
28
36
 
29
37
 
30
38
  }