Skip to content

Commit

Permalink
Update types (#373)
Browse files Browse the repository at this point in the history
  • Loading branch information
armando-rodriguez-cko authored Jan 3, 2024
1 parent 4eaa148 commit ad7ba8f
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/api/access/access.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default class Access {
* Update the access details in the config.
*
* @param {Object} body Access response body.
* @return {Promise<Object>} A promise to the Access response.
* @return {void}
*/
updateAccessToken(body) {
this.config.access = {
Expand Down
6 changes: 2 additions & 4 deletions src/api/payment-contexts/payment-contexts.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ export default class PaymentContexts {
*
* @memberof PaymentContexts
* @param {object} body PaymentContexts Request body.
* @param {string} [idempotencyKey] Idempotency Key.
* @return {Promise<object>} A promise to payment context response.
*/
async request(body, idempotencyKey) {
async request(body) {
try {
validatePayment(body);

Expand All @@ -30,8 +29,7 @@ export default class PaymentContexts {
`${this.config.host}/payment-contexts`,
this.config,
this.config.sk,
body,
idempotencyKey
body
);
return await response.json;
} catch (error) {
Expand Down
4 changes: 4 additions & 0 deletions types/dist/Checkout.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ import {
HostedPayments,
Ideal,
Instruments,
Issuing,
Klarna,
Oxxo,
PagoFacil,
PaymentContexts,
PaymentLinks,
PaymentSessions,
Payments,
Expand Down Expand Up @@ -109,6 +111,8 @@ export default class Checkout {
cardMetadata: CardMetadata;
reports: Reports;
financial: Financial;
issuing: Issuing;
paymentContexts: PaymentContexts;
paymentSessions: PaymentSessions;
config: config;

Expand Down
1 change: 1 addition & 0 deletions types/dist/api/access/access.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ export default class Access {
constructor(config: config);

request: (body: Object) => Promise<Object>;
updateAccessToken: (body: Object) => void;
}
2 changes: 1 addition & 1 deletion types/dist/api/payment-contexts/payment-contexts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import { config } from '../../Checkout';
export default class PaymentContexts {
constructor(config: config);

request: (body: object, idempotencyKey?: string) => Promise<object>;
request: (body: object) => Promise<object>;
get: (id: string) => Promise<object>;
}
4 changes: 4 additions & 0 deletions types/dist/api/platforms/platforms.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ export default class Platforms {

uploadFile: (purpose: string, path: string) => Promise<Object>;
onboardSubEntity: (body: Object) => Promise<Object>;
uploadAFile: (entityId: string, body: Object) => Promise<Object>;
retrieveAFile: (entityId: string, fileId: string) => Promise<Object>;
getSubEntityMembers: (entityId: string) => Promise<Object>;
getSubEntityDetails: (id: string) => Promise<Object>;
updateSubEntityDetails: (id: string, body: Object) => Promise<Object>;
getPaymentInstrumentDetails: (entityId: string, id: string) => Promise<Object>;
updatePaymentInstrumentDetails: (entityId: string, id: string, body: Object) => Promise<Object>;
createPaymentInstrument: (id: string, body: Object) => Promise<Object>;
addPaymentInstrument: (id: string, body: Object) => Promise<Object>;
queryPaymentInstruments: (id: string, status?: string) => Promise<Object>;
retrieveSubEntityPayoutSchedule: (id: string) => Promise<Object>;
Expand Down
2 changes: 2 additions & 0 deletions types/dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ export { default as Balances } from './api/balances/balances';
export { default as CardMetadata } from './api/card-metadata/card-metadata';
export { default as Reports } from './api/reports/reports';
export { default as Financial } from './api/financial/financial';
export { default as Issuing } from './api/issuing/issuing';
export { default as PaymentContexts } from './api/payment-contexts/payment-contexts';
export { default as PaymentSessions } from './api/payment-sessions/payment-sessions';
export { default as Checkout } from './Checkout';
export { default } from './Checkout';
12 changes: 6 additions & 6 deletions types/dist/services/http.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export function get(fetch: any, path: any, config: any, auth: any): Promise<any>;
export function post(fetch: any, path: any, config: any, auth: any, request: any, idempotencyKey: any): Promise<any>;
export function patch(fetch: any, path: any, config: any, auth: any, request: any): Promise<any>;
export function put(fetch: any, path: any, config: any, auth: any, request: any): Promise<any>;
export function _delete(fetch: any, path: any, config: any, auth: any): Promise<any>;
export function createAccessToken(config: any, fetch: any, body: any): Promise<any>;
export function get(httpClient: any, path: any, config: any, auth: any): Promise<any>;
export function post(httpClient: any, path: any, config: any, auth: any, request: any, idempotencyKey: any): Promise<any>;
export function patch(httpClient: any, path: any, config: any, auth: any, request: any): Promise<any>;
export function put(httpClient: any, path: any, config: any, auth: any, request: any): Promise<any>;
export function _delete(httpClient: any, path: any, config: any, auth: any): Promise<any>;
export function createAccessToken(config: any, httpClient: any, body: any): Promise<any>;
export default createAccessToken;

0 comments on commit ad7ba8f

Please sign in to comment.