@swp/swipe-sdk
Advanced tools
Comparing version 0.12.59 to 0.12.60
@@ -1,2 +0,2 @@ | ||
export interface Document { | ||
export interface DocumentAnalysisPayload { | ||
image: string; | ||
@@ -6,7 +6,89 @@ documentType: string; | ||
} | ||
export interface DocumentsAnalysis { | ||
rg: Document; | ||
cnh: Document; | ||
selfie: Document; | ||
export interface NewCustomerPF { | ||
registerName: string; | ||
socialName: string; | ||
phone: { | ||
countryCode: string; | ||
number: string; | ||
}; | ||
address: { | ||
zipCode: string; | ||
addressLine: string; | ||
buildingNumber: string; | ||
complement: string; | ||
neighborhood: string; | ||
city: string; | ||
state: string; | ||
country: string; | ||
}; | ||
birthDate: Date; | ||
motherName: string; | ||
email: string; | ||
} | ||
export interface ResultCustomerPF extends BasicResultCustomerPF { | ||
registerName: string; | ||
socialName: string; | ||
phone?: { | ||
countryCode: string; | ||
number: string; | ||
}; | ||
address?: { | ||
zipCode: string; | ||
addressLine: string; | ||
buildingNumber: string; | ||
complement: string; | ||
neighborhood: string; | ||
city: string; | ||
state: string; | ||
country: string; | ||
}; | ||
birthDate: Date; | ||
motherName?: string; | ||
email?: string; | ||
createdAt: string; | ||
updatedAt: string; | ||
status: string; | ||
profile: string; | ||
isPoliticallyExposedPerson: boolean; | ||
documentNumber: string; | ||
reasons?: Array<string>; | ||
} | ||
export interface BasicResultCustomerPF { | ||
registerName: string; | ||
socialName: string; | ||
birthDate: Date; | ||
status: string; | ||
profile: string; | ||
createdAt: string; | ||
updatedAt: string; | ||
documentNumber: string; | ||
isPoliticallyExposedPerson: boolean; | ||
} | ||
export interface CreatePaymentAccountPayload { | ||
documentNumber: string; | ||
accountType: string; | ||
} | ||
export interface CreatePaymentAccountResponse { | ||
balance: { | ||
inProcess: { | ||
amount: number; | ||
currency: string; | ||
}; | ||
available: { | ||
amount: number; | ||
currency: string; | ||
}; | ||
blocked: { | ||
amount: number; | ||
currency: string; | ||
}; | ||
}; | ||
} | ||
export interface CustomerAccount { | ||
status: string; | ||
branch: string; | ||
number: string; | ||
} | ||
export interface BanklyCustomerAccount extends Array<CustomerAccount> { | ||
} | ||
export interface ResultSendDocuments { | ||
@@ -77,2 +159,4 @@ token: string; | ||
} | ||
export interface DocumentAnalysisResultTokens extends Array<DocumentAnalysisResult> { | ||
} | ||
export interface AnalysisTokenDTO { | ||
@@ -93,2 +177,413 @@ frontSideToken: string; | ||
} | ||
export declare enum DOCUMENTS_STATUS_ANALYSIS { | ||
ANALYZING = "ANALYZING", | ||
PARTIALLY_ANALYZED = "PARTIALLY_ANALYZED", | ||
ANALYSIS_COMPLETED = "ANALYSIS_COMPLETED", | ||
UNEXPECTED_ERROR = "UNEXPECTED_ERROR" | ||
} | ||
export declare enum SELFIE_STATUS_ANALYSIS { | ||
LIVENESS_FOUND = "LIVENESS_FOUND", | ||
NO_LIVENESS = "NO_LIVENESS", | ||
COULD_NOT_DETECT_FACE = "COULD_NOT_DETECT_FACE" | ||
} | ||
export declare enum FACE_DETAILS_STATUS { | ||
DETECTED_FACE = "DETECTED_FACE", | ||
MANY_FACES_DETECTED = "MANY_FACES_DETECTED", | ||
COULD_NOT_DETECT_FACE = "COULD_NOT_DETECT_FACE" | ||
} | ||
export declare enum RG_FRONT_STATUS { | ||
HAS_FACE_MATCH = "HAS_FACE_MATCH", | ||
UNMATCHED_DOCUMENT = "UNMATCHED_DOCUMENT", | ||
MANY_FACES_DETECTED = "MANY_FACES_DETECTED" | ||
} | ||
export declare enum TEXT_DOCUMENT_STATUS_OCR { | ||
DETECTED_DOCUMENT = "DETECTED_DOCUMENT", | ||
NO_DOCUMENT_FOUND = "NO_DOCUMENT_FOUND", | ||
NO_INFO_FOUND = "NO_INFO_FOUND" | ||
} | ||
export declare enum RG_BACK_STATUS_OCR { | ||
DETECTED_DOCUMENT = "DETECTED_DOCUMENT", | ||
NO_DOCUMENT_FOUND = "NO_DOCUMENT_FOUND", | ||
NO_INFO_FOUND = "NO_INFO_FOUND" | ||
} | ||
export declare enum CUSTOMER_STATUS { | ||
PENDING_APPROVAL = "PENDING_APPROVAL", | ||
APPROVED = "APPROVED", | ||
REPROVED = "REPROVED", | ||
BLOCKLISTED = "BLOCKLISTED" | ||
} | ||
export declare type ResponseSendDocuments = ResultSendDocuments[]; | ||
export interface BusinessAddressDTO { | ||
zipCode: string; | ||
addressLine: string; | ||
buildingNumber: string; | ||
complement: string; | ||
neighborhood: string; | ||
city: string; | ||
state: string; | ||
country: string; | ||
} | ||
export interface Phone { | ||
countryCode: string; | ||
number: string; | ||
} | ||
export interface LegalRepresentativeDTO { | ||
phone: Phone; | ||
documentNumber: string; | ||
registerName: string; | ||
socialName: string; | ||
birthDate: string; | ||
motherName: string; | ||
email: string; | ||
} | ||
export interface BasicBusinessRegister { | ||
businessName: string; | ||
tradingName: string; | ||
businessType: string; | ||
businessSize: string; | ||
} | ||
export interface NewBusinessRegisterDTO extends BasicBusinessRegister { | ||
businessEmail: string; | ||
businessAddress: BusinessAddressDTO; | ||
legalRepresentative: LegalRepresentativeDTO; | ||
} | ||
export interface BusinessRegisterResponseDTO extends BasicBusinessRegister { | ||
businessAddress?: BusinessAddressDTO; | ||
owners?: LegalRepresentativeDTO[]; | ||
reasons?: Array<string>; | ||
legalRepresentatives?: LegalRepresentativeDTO[]; | ||
documentNumber: string; | ||
tradingName: string; | ||
status: string; | ||
createdAt: Date; | ||
updatedAt: Date; | ||
} | ||
export interface RegisterResultDTO { | ||
status: string; | ||
reasons?: Array<string>; | ||
} | ||
export interface BanklyBaseBalance { | ||
amount: number; | ||
currency: string; | ||
} | ||
export interface BanklyBalance { | ||
inProcess: BanklyBaseBalance; | ||
available: BanklyBaseBalance; | ||
blocked: BanklyBaseBalance; | ||
} | ||
export interface BasicAccount { | ||
branch: string; | ||
number: string; | ||
} | ||
export interface BanklyBusinessPaymentAccount extends BasicAccount { | ||
status: string; | ||
} | ||
export interface BanklyPaymentAccount extends BanklyBusinessPaymentAccount { | ||
balance: BanklyBalance; | ||
} | ||
export declare enum BanklyApiResultLevels { | ||
BASIC = "BASIC", | ||
DETAILED = "DETAILED" | ||
} | ||
export declare enum BanklyDocumentsResultLevels { | ||
DETAILED = "DETAILED", | ||
ONLY_STATUS = "ONLY_STATUS" | ||
} | ||
export declare enum BankSlipTypes { | ||
DEPOSIT = "Deposit", | ||
LEVY = "Levy" | ||
} | ||
export interface PayerAddress { | ||
addressLine: string; | ||
city: string; | ||
state: string; | ||
zipCode: string; | ||
} | ||
export interface Payer { | ||
address: PayerAddress; | ||
document: string; | ||
name: string; | ||
tradeName: string; | ||
} | ||
export declare enum BanklySlipType { | ||
DEPOSIT = "Deposit", | ||
LEVY = "Levy" | ||
} | ||
export interface NewBankSlipRequestDTO { | ||
account: BasicAccount; | ||
amount: number; | ||
type: BanklySlipType; | ||
dueDate: Date; | ||
emissionFee: boolean; | ||
documentNumber: string; | ||
payer?: Payer; | ||
} | ||
export interface NewBankSlipResponseDTO { | ||
account: BasicAccount; | ||
authenticationCode: string; | ||
} | ||
export interface BanklyPayment { | ||
id: string; | ||
amount: number; | ||
paymentChannel: string; | ||
paidOutDate: Date; | ||
} | ||
export interface BankSlipDTO { | ||
authenticationCode: string; | ||
updatedAt: Date; | ||
ourNumber: string; | ||
digitable: string; | ||
status: string; | ||
account: { | ||
number: number; | ||
}; | ||
document: string; | ||
amount: BanklyBaseBalance; | ||
dueDate: Date; | ||
emissionDate: Date; | ||
type: string; | ||
payer: Payer; | ||
recipientFinal: Payer; | ||
recipientOrigin: Payer; | ||
payments: BanklyPayment[]; | ||
} | ||
export interface NewTransferExternalResult { | ||
authenticationCode: string; | ||
} | ||
export interface GetTransferAccount { | ||
companyKey: string; | ||
authenticationCode: string; | ||
amount: number; | ||
correlationId: string; | ||
sender: { | ||
document: string; | ||
name: string; | ||
account: { | ||
branch: string; | ||
number: string; | ||
bank: { | ||
ispb: string; | ||
name: string; | ||
compe: string; | ||
}; | ||
}; | ||
}; | ||
recipient: { | ||
document: string; | ||
name: string; | ||
account: { | ||
branch: string; | ||
number: string; | ||
bank: { | ||
ispb: string; | ||
name: string; | ||
compe: string; | ||
}; | ||
}; | ||
}; | ||
channel: string; | ||
status: string; | ||
createdAt: Date; | ||
updatedAt: Date; | ||
} | ||
export interface GetTransferAccountResult extends Array<GetTransferAccount> { | ||
} | ||
export interface GetTransferAccountData { | ||
branch: string; | ||
account: string; | ||
pageSize?: number; | ||
nextPage?: string; | ||
} | ||
export interface NewTransferExternalData { | ||
amount: number; | ||
description?: string; | ||
sender: { | ||
branch: string; | ||
account: string; | ||
document: string; | ||
name: string; | ||
}; | ||
recipient: { | ||
bankCode: string; | ||
branch: string; | ||
account: string; | ||
document: string; | ||
name: string; | ||
accountType: BanklyTedAccountType; | ||
}; | ||
} | ||
export declare enum BanklyTedAccountType { | ||
'SAVINGS' = "SAVINGS", | ||
'INTERNAL' = 365 | ||
} | ||
export interface GetTransferAccountDTO { | ||
companyKey: string; | ||
authenticationCode: string; | ||
amount: number; | ||
correlationId: string; | ||
sender: { | ||
document: string; | ||
name: string; | ||
account: { | ||
branch: string; | ||
number: string; | ||
bank: { | ||
ispb: string; | ||
name: string; | ||
compe: string; | ||
}; | ||
}; | ||
}; | ||
recipient: { | ||
document: string; | ||
name: string; | ||
account: { | ||
branch: string; | ||
number: string; | ||
bank: { | ||
ispb: string; | ||
name: string; | ||
compe: string; | ||
}; | ||
}; | ||
}; | ||
channel: string; | ||
status: string; | ||
createdAt: Date; | ||
updatedAt: Date; | ||
} | ||
export interface TransactionEventQueryConfig { | ||
page: number; | ||
pageSize: number; | ||
includeDetails: boolean; | ||
beginDateTime?: string; | ||
endDateTime?: string; | ||
cardProxy?: string; | ||
correlationId: string; | ||
} | ||
export interface TransactionReceipt { | ||
AuthenticationCode: string; | ||
TransactionDate: Date; | ||
DestinationName: string; | ||
DestinationAgency: string; | ||
DestinationAccount: string; | ||
DestinationDocument: string; | ||
DestinationBankName: string; | ||
DestinationCompe: string; | ||
Amount: number; | ||
Description: string | null; | ||
} | ||
export interface BasicTransactionEvent { | ||
aggregateId: string; | ||
type: string; | ||
category: string; | ||
documentNumber: string; | ||
bankBranch: string; | ||
bankAccount: string; | ||
amount: number; | ||
index: string; | ||
name: string; | ||
timestamp: Date; | ||
status: string; | ||
} | ||
export interface DetailedTransactionEvent extends BasicTransactionEvent { | ||
data?: { | ||
TransactionReceipt: TransactionReceipt; | ||
}; | ||
} | ||
export interface NewTransferExternalPayload { | ||
credentialName: string; | ||
account: string; | ||
documentNumber: string; | ||
newTransferExternal: NewTransferExternalData; | ||
uuid: string; | ||
} | ||
export interface GetTransferAccountDataPayload { | ||
credentialName: string; | ||
account: string; | ||
payload: GetTransferAccountData; | ||
authenticationCode: string; | ||
uuid: string; | ||
} | ||
export interface NewCustomerRegisterPayload { | ||
credentialName: string; | ||
account: string; | ||
documentNumber: string; | ||
customer: NewCustomerPF; | ||
} | ||
export interface NewCustomerPaymentAccountPayload { | ||
credentialName: string; | ||
account: string; | ||
documentNumber: string; | ||
} | ||
export interface GetCustomerRegisterPayload { | ||
credentialName: string; | ||
account: string; | ||
documentNumber: string; | ||
tokens: ResultCustomerPF; | ||
resultLevel?: BanklyApiResultLevels; | ||
} | ||
export interface GetCustomerPaymentAccountPayload { | ||
credentialName: string; | ||
account: string; | ||
documentNumber: string; | ||
tokens: ResultCustomerPF; | ||
} | ||
export interface GetBusinessPaymentAccountPayload { | ||
credentialName: string; | ||
account: string; | ||
documentNumber: string; | ||
} | ||
export interface GetBusinessRegisterPayload { | ||
credentialName: string; | ||
account: string; | ||
documentNumber: string; | ||
resultLevel?: BanklyApiResultLevels; | ||
} | ||
export interface NewBusinessRegisterPayload { | ||
credentialName: string; | ||
account: string; | ||
documentNumber: string; | ||
newBusiness: NewBusinessRegisterDTO; | ||
} | ||
export interface NewBusinessPaymentAccountPayload { | ||
credentialName: string; | ||
account: string; | ||
documentNumber: string; | ||
} | ||
export interface CancelBankSlipPayload { | ||
credentialName: string; | ||
account: string; | ||
paymentAccount: BasicAccount; | ||
authenticationCode: string; | ||
} | ||
export interface GetBankSlipPayload { | ||
credentialName: string; | ||
account: string; | ||
paymentAccount: BasicAccount; | ||
authenticationCode: string; | ||
} | ||
export interface NewBankSlipPayload { | ||
credentialName: string; | ||
account: string; | ||
bankSlip: NewBankSlipRequestDTO; | ||
} | ||
export interface PayBankSlipPayload { | ||
credentialName: string; | ||
account: string; | ||
paymentAccount: BasicAccount; | ||
authenticationCode: string; | ||
} | ||
export interface GetDocumentsAnalysisPayload { | ||
tokens: AnalysisTokenDTO; | ||
credentialName: string; | ||
account: string; | ||
documentNumber: string; | ||
resultLevel?: BanklyDocumentsResultLevels; | ||
} | ||
export interface SendDocumentsToAnalysisPayload { | ||
documents: DocumentAnalysisPayload[]; | ||
credentialName: string; | ||
account: string; | ||
documentNumber: string; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.BanklyTedAccountType = exports.BanklySlipType = exports.BankSlipTypes = exports.BanklyDocumentsResultLevels = exports.BanklyApiResultLevels = exports.CUSTOMER_STATUS = exports.RG_BACK_STATUS_OCR = exports.TEXT_DOCUMENT_STATUS_OCR = exports.RG_FRONT_STATUS = exports.FACE_DETAILS_STATUS = exports.SELFIE_STATUS_ANALYSIS = exports.DOCUMENTS_STATUS_ANALYSIS = void 0; | ||
var DOCUMENTS_STATUS_ANALYSIS; | ||
(function (DOCUMENTS_STATUS_ANALYSIS) { | ||
DOCUMENTS_STATUS_ANALYSIS["ANALYZING"] = "ANALYZING"; | ||
DOCUMENTS_STATUS_ANALYSIS["PARTIALLY_ANALYZED"] = "PARTIALLY_ANALYZED"; | ||
DOCUMENTS_STATUS_ANALYSIS["ANALYSIS_COMPLETED"] = "ANALYSIS_COMPLETED"; | ||
DOCUMENTS_STATUS_ANALYSIS["UNEXPECTED_ERROR"] = "UNEXPECTED_ERROR"; | ||
})(DOCUMENTS_STATUS_ANALYSIS = exports.DOCUMENTS_STATUS_ANALYSIS || (exports.DOCUMENTS_STATUS_ANALYSIS = {})); | ||
var SELFIE_STATUS_ANALYSIS; | ||
(function (SELFIE_STATUS_ANALYSIS) { | ||
SELFIE_STATUS_ANALYSIS["LIVENESS_FOUND"] = "LIVENESS_FOUND"; | ||
SELFIE_STATUS_ANALYSIS["NO_LIVENESS"] = "NO_LIVENESS"; | ||
SELFIE_STATUS_ANALYSIS["COULD_NOT_DETECT_FACE"] = "COULD_NOT_DETECT_FACE"; | ||
})(SELFIE_STATUS_ANALYSIS = exports.SELFIE_STATUS_ANALYSIS || (exports.SELFIE_STATUS_ANALYSIS = {})); | ||
var FACE_DETAILS_STATUS; | ||
(function (FACE_DETAILS_STATUS) { | ||
FACE_DETAILS_STATUS["DETECTED_FACE"] = "DETECTED_FACE"; | ||
FACE_DETAILS_STATUS["MANY_FACES_DETECTED"] = "MANY_FACES_DETECTED"; | ||
FACE_DETAILS_STATUS["COULD_NOT_DETECT_FACE"] = "COULD_NOT_DETECT_FACE"; | ||
})(FACE_DETAILS_STATUS = exports.FACE_DETAILS_STATUS || (exports.FACE_DETAILS_STATUS = {})); | ||
var RG_FRONT_STATUS; | ||
(function (RG_FRONT_STATUS) { | ||
RG_FRONT_STATUS["HAS_FACE_MATCH"] = "HAS_FACE_MATCH"; | ||
RG_FRONT_STATUS["UNMATCHED_DOCUMENT"] = "UNMATCHED_DOCUMENT"; | ||
RG_FRONT_STATUS["MANY_FACES_DETECTED"] = "MANY_FACES_DETECTED"; | ||
})(RG_FRONT_STATUS = exports.RG_FRONT_STATUS || (exports.RG_FRONT_STATUS = {})); | ||
var TEXT_DOCUMENT_STATUS_OCR; | ||
(function (TEXT_DOCUMENT_STATUS_OCR) { | ||
TEXT_DOCUMENT_STATUS_OCR["DETECTED_DOCUMENT"] = "DETECTED_DOCUMENT"; | ||
TEXT_DOCUMENT_STATUS_OCR["NO_DOCUMENT_FOUND"] = "NO_DOCUMENT_FOUND"; | ||
TEXT_DOCUMENT_STATUS_OCR["NO_INFO_FOUND"] = "NO_INFO_FOUND"; | ||
})(TEXT_DOCUMENT_STATUS_OCR = exports.TEXT_DOCUMENT_STATUS_OCR || (exports.TEXT_DOCUMENT_STATUS_OCR = {})); | ||
var RG_BACK_STATUS_OCR; | ||
(function (RG_BACK_STATUS_OCR) { | ||
RG_BACK_STATUS_OCR["DETECTED_DOCUMENT"] = "DETECTED_DOCUMENT"; | ||
RG_BACK_STATUS_OCR["NO_DOCUMENT_FOUND"] = "NO_DOCUMENT_FOUND"; | ||
RG_BACK_STATUS_OCR["NO_INFO_FOUND"] = "NO_INFO_FOUND"; | ||
})(RG_BACK_STATUS_OCR = exports.RG_BACK_STATUS_OCR || (exports.RG_BACK_STATUS_OCR = {})); | ||
var CUSTOMER_STATUS; | ||
(function (CUSTOMER_STATUS) { | ||
CUSTOMER_STATUS["PENDING_APPROVAL"] = "PENDING_APPROVAL"; | ||
CUSTOMER_STATUS["APPROVED"] = "APPROVED"; | ||
CUSTOMER_STATUS["REPROVED"] = "REPROVED"; | ||
CUSTOMER_STATUS["BLOCKLISTED"] = "BLOCKLISTED"; | ||
})(CUSTOMER_STATUS = exports.CUSTOMER_STATUS || (exports.CUSTOMER_STATUS = {})); | ||
var BanklyApiResultLevels; | ||
(function (BanklyApiResultLevels) { | ||
BanklyApiResultLevels["BASIC"] = "BASIC"; | ||
BanklyApiResultLevels["DETAILED"] = "DETAILED"; | ||
})(BanklyApiResultLevels = exports.BanklyApiResultLevels || (exports.BanklyApiResultLevels = {})); | ||
var BanklyDocumentsResultLevels; | ||
(function (BanklyDocumentsResultLevels) { | ||
BanklyDocumentsResultLevels["DETAILED"] = "DETAILED"; | ||
BanklyDocumentsResultLevels["ONLY_STATUS"] = "ONLY_STATUS"; | ||
})(BanklyDocumentsResultLevels = exports.BanklyDocumentsResultLevels || (exports.BanklyDocumentsResultLevels = {})); | ||
var BankSlipTypes; | ||
(function (BankSlipTypes) { | ||
BankSlipTypes["DEPOSIT"] = "Deposit"; | ||
BankSlipTypes["LEVY"] = "Levy"; | ||
})(BankSlipTypes = exports.BankSlipTypes || (exports.BankSlipTypes = {})); | ||
var BanklySlipType; | ||
(function (BanklySlipType) { | ||
BanklySlipType["DEPOSIT"] = "Deposit"; | ||
BanklySlipType["LEVY"] = "Levy"; | ||
})(BanklySlipType = exports.BanklySlipType || (exports.BanklySlipType = {})); | ||
var BanklyTedAccountType; | ||
(function (BanklyTedAccountType) { | ||
BanklyTedAccountType["SAVINGS"] = "SAVINGS"; | ||
BanklyTedAccountType[BanklyTedAccountType["INTERNAL"] = 365] = "INTERNAL"; | ||
})(BanklyTedAccountType = exports.BanklyTedAccountType || (exports.BanklyTedAccountType = {})); | ||
//# sourceMappingURL=bankly.js.map |
@@ -88,3 +88,4 @@ import { SwpError } from '../error/error'; | ||
Celcoin = "CELCOIN", | ||
Zoop = "ZOOP" | ||
Zoop = "ZOOP", | ||
Bankly = "BANKLY" | ||
} | ||
@@ -278,3 +279,20 @@ export interface IntegrationDTO { | ||
ZoopFindReceivablesById = "ZOOP_FIND_RECEIVABLES_BY_ID", | ||
BanklySendDocuments = "BANKLY_SEND_DOCUMENTS" | ||
BanklySendDocuments = "BANKLY_SEND_DOCUMENTS", | ||
BanklyGetRegister = "BANKLY_GET_BUSINESS_REGISTER", | ||
BanklyNewCustomerAccount = "BANKLY_NEW_CUSTOMER_ACCOUNT", | ||
BanklyGetCustomer = "BANKLY_GET_CUSTOMER_ACCOUNT", | ||
BanklyCreatePaymentAccount = "BANKLY_CREATE_PAYMENT_ACCOUNT", | ||
BanklyGetCustomerResultAccount = "BANKLY_GET_CUSTOMER_RESULT_ACCOUNT", | ||
BanklyGetDataPaymentAccount = "BANKLY_GET_DATA_PAYMENT_ACCOUNT", | ||
BanklyRegisterNewBusiness = "BANKLY_REGISTER_NEW_BUSINESS", | ||
BanklyNewBusinessPaymentAccount = "BANKLY_NEW_BUSINESS_PAYMENT_ACCOUNT", | ||
BanklyGetBusinessPaymentAccounts = "BANKLY_GET_BUSINESS_PAYMENT_ACCOUNTS", | ||
BanklyGetDocumentsAnalysisStatus = "BANKLY_DOCUMENTS_ANALYSIS_STATUS", | ||
BanklyNewBankSlip = "BANKLY_NEW_BANK_SLIP", | ||
BanklyGetBankSlip = "BANKLY_GET_BANK_SLIP", | ||
BanklyPayBankSlip = "BANKLY_PAY_BANK_SLIP", | ||
BanklyCancelBankSlip = "BANKLY_CANCEL_BANK_SLIP", | ||
BanklyNewTransferExternal = "BANKLY_NEW_TRANSFER_EXTERNAL", | ||
BanklyGetTransfersAccount = "BANKLY_GET_TRANSFERS_ACCOUNT", | ||
BanklyGetEvents = "BANKLY_GET_ACCOUNT_EVENTS" | ||
} | ||
@@ -281,0 +299,0 @@ export interface BalanceDataResponse { |
@@ -9,2 +9,3 @@ "use strict"; | ||
IntegrationName["Zoop"] = "ZOOP"; | ||
IntegrationName["Bankly"] = "BANKLY"; | ||
})(IntegrationName = exports.IntegrationName || (exports.IntegrationName = {})); | ||
@@ -79,3 +80,20 @@ var ExternalStatusIntegration; | ||
ExternalServiceResponseType["BanklySendDocuments"] = "BANKLY_SEND_DOCUMENTS"; | ||
ExternalServiceResponseType["BanklyGetRegister"] = "BANKLY_GET_BUSINESS_REGISTER"; | ||
ExternalServiceResponseType["BanklyNewCustomerAccount"] = "BANKLY_NEW_CUSTOMER_ACCOUNT"; | ||
ExternalServiceResponseType["BanklyGetCustomer"] = "BANKLY_GET_CUSTOMER_ACCOUNT"; | ||
ExternalServiceResponseType["BanklyCreatePaymentAccount"] = "BANKLY_CREATE_PAYMENT_ACCOUNT"; | ||
ExternalServiceResponseType["BanklyGetCustomerResultAccount"] = "BANKLY_GET_CUSTOMER_RESULT_ACCOUNT"; | ||
ExternalServiceResponseType["BanklyGetDataPaymentAccount"] = "BANKLY_GET_DATA_PAYMENT_ACCOUNT"; | ||
ExternalServiceResponseType["BanklyRegisterNewBusiness"] = "BANKLY_REGISTER_NEW_BUSINESS"; | ||
ExternalServiceResponseType["BanklyNewBusinessPaymentAccount"] = "BANKLY_NEW_BUSINESS_PAYMENT_ACCOUNT"; | ||
ExternalServiceResponseType["BanklyGetBusinessPaymentAccounts"] = "BANKLY_GET_BUSINESS_PAYMENT_ACCOUNTS"; | ||
ExternalServiceResponseType["BanklyGetDocumentsAnalysisStatus"] = "BANKLY_DOCUMENTS_ANALYSIS_STATUS"; | ||
ExternalServiceResponseType["BanklyNewBankSlip"] = "BANKLY_NEW_BANK_SLIP"; | ||
ExternalServiceResponseType["BanklyGetBankSlip"] = "BANKLY_GET_BANK_SLIP"; | ||
ExternalServiceResponseType["BanklyPayBankSlip"] = "BANKLY_PAY_BANK_SLIP"; | ||
ExternalServiceResponseType["BanklyCancelBankSlip"] = "BANKLY_CANCEL_BANK_SLIP"; | ||
ExternalServiceResponseType["BanklyNewTransferExternal"] = "BANKLY_NEW_TRANSFER_EXTERNAL"; | ||
ExternalServiceResponseType["BanklyGetTransfersAccount"] = "BANKLY_GET_TRANSFERS_ACCOUNT"; | ||
ExternalServiceResponseType["BanklyGetEvents"] = "BANKLY_GET_ACCOUNT_EVENTS"; | ||
})(ExternalServiceResponseType = exports.ExternalServiceResponseType || (exports.ExternalServiceResponseType = {})); | ||
//# sourceMappingURL=dto.js.map |
@@ -8,3 +8,7 @@ import { CreditCardDTO } from './cash-in'; | ||
BASIC_IN_ANALYSIS = "BASIC_IN_ANALYSIS", | ||
BASIC_IN_ANALYSIS_BANK = "BASIC_IN_ANALYSIS_BANK", | ||
BASIC_IN_ANALYSIS_BANKLY = "BASIC_IN_ANALYSIS_BANKLY", | ||
BASIC_IN_ANALYSIS_FIRST_VALIDATION_BANKLY = "BASIC_IN_ANALYSIS_FIRST_VALIDATION_BANKLY", | ||
BASIC_IN_ANALYSIS_SECOND_VALIDATION_BANKLY = "BASIC_IN_ANALYSIS_SECOND_VALIDATION_BANKLY", | ||
BASIC_IN_ANALYSIS_THIRD_VALIDATION_BANKLY = "BASIC_IN_ANALYSIS_THIRD_VALIDATION_BANKLY", | ||
BASIC_REJECTED_BANKLY = "BASIC_REJECTED_BANKLY", | ||
BASIC_REJECTED = "BASIC_REJECTED" | ||
@@ -16,2 +20,6 @@ } | ||
} | ||
export declare enum DocPersonType { | ||
COMPANY = "COMPANY", | ||
INDIVIDUAL = "INDIVIDUAL" | ||
} | ||
export interface NewPhoneValidationResult { | ||
@@ -29,2 +37,3 @@ data: Object; | ||
fields?: Fields; | ||
address?: AddressDTO; | ||
} | ||
@@ -42,14 +51,2 @@ export interface PersonProfileDTO extends NewProfileDTO { | ||
} | ||
export interface ProfileDTO { | ||
id: string; | ||
accountId: string; | ||
person?: PersonProfileDTO; | ||
company?: CompanyProfileDTO; | ||
address?: AddressDTO; | ||
status: DocumentStatus; | ||
documents?: DocumentsDTO; | ||
creditCards?: Array<CreditCardDTO>; | ||
accounts?: AccountsStatsDTO; | ||
createdAt: string; | ||
} | ||
export interface ValidatePhoneDTO { | ||
@@ -62,14 +59,17 @@ accountId: string; | ||
export interface CompanyProfileDTO { | ||
name: string; | ||
corporateName: string; | ||
fantasyName?: string; | ||
companyType?: string; | ||
companySize?: number; | ||
cnpj: string; | ||
phone: string; | ||
email: string; | ||
phone: string; | ||
cnae?: string; | ||
openingDate: string; | ||
fields?: Fields; | ||
companyPartner: CompanyPartnerDTO[]; | ||
companyPartner?: CompanyPartnerDTO[]; | ||
address?: AddressDTO; | ||
} | ||
export interface NewProfileCompanyDTO { | ||
name: string; | ||
fantasyName?: string; | ||
corporateName: string; | ||
@@ -82,15 +82,18 @@ cnpj: string; | ||
fields?: Fields; | ||
companyPartner: CompanyPartnerDTO; | ||
companySize: number; | ||
companyType: string; | ||
} | ||
export interface CompanyPartnerDTO { | ||
export interface PersonDTO { | ||
name: string; | ||
email: string; | ||
phone: string; | ||
} | ||
export interface CompanyPartnerDTO extends PersonDTO { | ||
cpf: string; | ||
birthDate: string; | ||
motherName: string; | ||
cellphone?: string; | ||
fields?: Fields; | ||
address?: AddressDTO; | ||
} | ||
export interface AddressDTO extends NewAddressDTO { | ||
} | ||
export interface NewAddressDTO { | ||
export interface AddressDTO { | ||
zipCode: string; | ||
@@ -105,6 +108,13 @@ city: string; | ||
} | ||
export interface NewAddressDTO extends AddressDTO { | ||
personType: AddressPersonType; | ||
} | ||
export declare enum AddressPersonType { | ||
INDIVIDUAL = "INDIVIDUAL", | ||
COMPANY = "COMPANY", | ||
COMPANY_PARTNER = "COMPANY_PARTNER" | ||
} | ||
export interface NewDocumentsDTO { | ||
frontSide: string; | ||
backSide?: string; | ||
proofOfResidence: string; | ||
selfie: string; | ||
@@ -119,12 +129,6 @@ } | ||
backSide: boolean; | ||
proofOfResidence: boolean; | ||
selfie: boolean; | ||
proofActivity: boolean; | ||
proofOfResidence: boolean; | ||
} | ||
export interface DocumentsStatusDTO { | ||
selfie: string; | ||
backSide: string; | ||
frontSide: string; | ||
approved: boolean; | ||
} | ||
export interface DocumentsCnpjDTO extends DocumentsDTO { | ||
@@ -253,6 +257,8 @@ socialContract: boolean; | ||
creditCards?: Array<CreditCardDTO>; | ||
accounts?: AccountsStatsDTO; | ||
createdAt: string; | ||
bankAccountIntegration?: BankAccountIntegrationDTO; | ||
} | ||
export interface ProfileDTO extends Profile { | ||
documents?: DocumentsDTO; | ||
documents?: DocumentsDTO | DocumentsCnpjDTO; | ||
} | ||
@@ -265,5 +271,5 @@ export interface ProfileDocStringDTO extends Profile { | ||
backSide: string; | ||
proofOfResidence: string; | ||
selfie: string; | ||
proofActivity: string; | ||
proofOfResidence: string; | ||
socialContract: string; | ||
@@ -273,4 +279,4 @@ cnpjCard: string; | ||
export interface NewProofActivity { | ||
accountId: string; | ||
proofActivity: string; | ||
proofActivity: object; | ||
proofOfResidence: object; | ||
} | ||
@@ -288,1 +294,11 @@ export interface getUserBalanceDTO { | ||
} | ||
export interface BanklyDocumentsTokenDTO { | ||
profile: ProfileDTO; | ||
token: string; | ||
documentType: string; | ||
documentSide: string; | ||
} | ||
export interface BankAccountIntegrationDTO { | ||
account: string; | ||
branch: string; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ProfileFetchTypes = exports.DocumentStatus = void 0; | ||
exports.AddressPersonType = exports.DocPersonType = exports.ProfileFetchTypes = exports.DocumentStatus = void 0; | ||
var DocumentStatus; | ||
@@ -9,3 +9,7 @@ (function (DocumentStatus) { | ||
DocumentStatus["BASIC_IN_ANALYSIS"] = "BASIC_IN_ANALYSIS"; | ||
DocumentStatus["BASIC_IN_ANALYSIS_BANK"] = "BASIC_IN_ANALYSIS_BANK"; | ||
DocumentStatus["BASIC_IN_ANALYSIS_BANKLY"] = "BASIC_IN_ANALYSIS_BANKLY"; | ||
DocumentStatus["BASIC_IN_ANALYSIS_FIRST_VALIDATION_BANKLY"] = "BASIC_IN_ANALYSIS_FIRST_VALIDATION_BANKLY"; | ||
DocumentStatus["BASIC_IN_ANALYSIS_SECOND_VALIDATION_BANKLY"] = "BASIC_IN_ANALYSIS_SECOND_VALIDATION_BANKLY"; | ||
DocumentStatus["BASIC_IN_ANALYSIS_THIRD_VALIDATION_BANKLY"] = "BASIC_IN_ANALYSIS_THIRD_VALIDATION_BANKLY"; | ||
DocumentStatus["BASIC_REJECTED_BANKLY"] = "BASIC_REJECTED_BANKLY"; | ||
DocumentStatus["BASIC_REJECTED"] = "BASIC_REJECTED"; | ||
@@ -18,2 +22,13 @@ })(DocumentStatus = exports.DocumentStatus || (exports.DocumentStatus = {})); | ||
})(ProfileFetchTypes = exports.ProfileFetchTypes || (exports.ProfileFetchTypes = {})); | ||
var DocPersonType; | ||
(function (DocPersonType) { | ||
DocPersonType["COMPANY"] = "COMPANY"; | ||
DocPersonType["INDIVIDUAL"] = "INDIVIDUAL"; | ||
})(DocPersonType = exports.DocPersonType || (exports.DocPersonType = {})); | ||
var AddressPersonType; | ||
(function (AddressPersonType) { | ||
AddressPersonType["INDIVIDUAL"] = "INDIVIDUAL"; | ||
AddressPersonType["COMPANY"] = "COMPANY"; | ||
AddressPersonType["COMPANY_PARTNER"] = "COMPANY_PARTNER"; | ||
})(AddressPersonType = exports.AddressPersonType || (exports.AddressPersonType = {})); | ||
//# sourceMappingURL=profile.js.map |
@@ -12,2 +12,3 @@ import { ErrorCode, SubError, SwpError } from './error'; | ||
export declare const newNotFoundValidParent: (index: number) => SwpError; | ||
export declare const newNotFoundValidParentToAccount: (account: string) => SwpError; | ||
export declare const newAccountCantHaveBalance: () => SwpError; | ||
@@ -27,2 +28,3 @@ export declare const newMissingHeaderField: (field: string) => SwpError; | ||
export declare const newInvalidIntegration: (id: string) => SwpError; | ||
export declare const newInvalidIntegrationBank: () => SwpError; | ||
export declare const newIntegrationConfigNotFound: () => SwpError; | ||
@@ -82,1 +84,10 @@ export declare const newIntegrationConfigAlreadyExist: () => SwpError; | ||
export declare const newAccountNotFound: () => SwpError; | ||
export declare const newProfileNotFound: () => SwpError; | ||
export declare const newProfileCompanyPerson: () => SwpError; | ||
export declare const newProfilePersonMissingAddress: () => SwpError; | ||
export declare const newProfileCompanyMissingAddress: () => SwpError; | ||
export declare const newProfileCompanyPartnerMissingAddress: () => SwpError; | ||
export declare const newProfileCompanyPersonNotExist: () => SwpError; | ||
export declare const newNextCodeEmptyResult: () => SwpError; | ||
export declare const newInvalidProfile: () => SwpError; | ||
export declare const newInvalidProfileType: (type: string) => SwpError; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.newInvalidCpf = exports.newIProfileAlreadyApprovedOrRefusedError = exports.newInvalidAlreadyExistsError = exports.newInvalidPhoneError = exports.newCardExpired = exports.newInvalidexpirationDate = exports.newInvalidCard = exports.newSellerUnauthorized = exports.newInvalidSplitPercentage = exports.newInvalidTerm = exports.newMissingTerm = exports.newInvalidEmail = exports.newInvalidToken = exports.newLoginNotFound = exports.newInvalidLoginOrPasswordOrPermission = exports.newInvalidLoginOrPassword = exports.newLoginAlreadyInUse = exports.newAccountAlreadyHasLogin = exports.newInvalidPassword = exports.newInvalidDateRange = exports.newInsufficientFounds = exports.newIntegrationNotEnabled = exports.newInvalidDate = exports.newInvalidAction = exports.newActionExist = exports.newInvalidAmount = exports.newIntegrationNotFound = exports.newIntegrationConfigAlreadyExist = exports.newIntegrationConfigNotFound = exports.newInvalidIntegration = exports.newInvalidIntegrationConfig = exports.newExternalServiceError = exports.newFieldsWithInvalidValue = exports.newInvalidFieldValue = exports.newCannotExecuteWhileProcessing = exports.newParamEmptyOrNull = exports.newParamBodyNotFound = exports.newParamNotFound = exports.newPastDueDate = exports.newInvalidAccount = exports.newInvalidBody = exports.newMissingHeaderField = exports.newAccountCantHaveBalance = exports.newNotFoundValidParent = exports.newPermissionDenied = exports.newForbidden = exports.newNotFound = exports.newValidationError = exports.newInternalServerError = exports.newUnauthorized = void 0; | ||
exports.newAccountNotFound = exports.newAlreadyExistPlan = exports.newInvalidPlanItems = exports.newInvalidPlan = exports.newInvalidHistoryStatus = exports.newInvalidServiceType = exports.newInvalidService = exports.newInvalidProofActivity = exports.newInvalidPerson = exports.newCelcoinTransactionNotFound = exports.newServiceNotFound = exports.newCpfAlreadyExist = exports.newInvalidAmountCelcoin = exports.newInvalidBoletoBarCode = exports.newInvalidProviderError = exports.newInvalidCNPJ = exports.newCNPJAlreadyExists = exports.newAccountDoesntHaveALogin = exports.newAccountDoesntHaveAPhone = exports.newAccountAlreadyHasAValidPhone = exports.newPhoneAlreadyValidated = exports.newCodeDoesntMatch = exports.newInvalidOperationProfile = exports.newMissingKYC = exports.newInvalidDocument = void 0; | ||
exports.newInvalidAlreadyExistsError = exports.newInvalidPhoneError = exports.newCardExpired = exports.newInvalidexpirationDate = exports.newInvalidCard = exports.newSellerUnauthorized = exports.newInvalidSplitPercentage = exports.newInvalidTerm = exports.newMissingTerm = exports.newInvalidEmail = exports.newInvalidToken = exports.newLoginNotFound = exports.newInvalidLoginOrPasswordOrPermission = exports.newInvalidLoginOrPassword = exports.newLoginAlreadyInUse = exports.newAccountAlreadyHasLogin = exports.newInvalidPassword = exports.newInvalidDateRange = exports.newInsufficientFounds = exports.newIntegrationNotEnabled = exports.newInvalidDate = exports.newInvalidAction = exports.newActionExist = exports.newInvalidAmount = exports.newIntegrationNotFound = exports.newIntegrationConfigAlreadyExist = exports.newIntegrationConfigNotFound = exports.newInvalidIntegrationBank = exports.newInvalidIntegration = exports.newInvalidIntegrationConfig = exports.newExternalServiceError = exports.newFieldsWithInvalidValue = exports.newInvalidFieldValue = exports.newCannotExecuteWhileProcessing = exports.newParamEmptyOrNull = exports.newParamBodyNotFound = exports.newParamNotFound = exports.newPastDueDate = exports.newInvalidAccount = exports.newInvalidBody = exports.newMissingHeaderField = exports.newAccountCantHaveBalance = exports.newNotFoundValidParentToAccount = exports.newNotFoundValidParent = exports.newPermissionDenied = exports.newForbidden = exports.newNotFound = exports.newValidationError = exports.newInternalServerError = exports.newUnauthorized = void 0; | ||
exports.newInvalidProfileType = exports.newInvalidProfile = exports.newNextCodeEmptyResult = exports.newProfileCompanyPersonNotExist = exports.newProfileCompanyPartnerMissingAddress = exports.newProfileCompanyMissingAddress = exports.newProfilePersonMissingAddress = exports.newProfileCompanyPerson = exports.newProfileNotFound = exports.newAccountNotFound = exports.newAlreadyExistPlan = exports.newInvalidPlanItems = exports.newInvalidPlan = exports.newInvalidHistoryStatus = exports.newInvalidServiceType = exports.newInvalidService = exports.newInvalidProofActivity = exports.newInvalidPerson = exports.newCelcoinTransactionNotFound = exports.newServiceNotFound = exports.newCpfAlreadyExist = exports.newInvalidAmountCelcoin = exports.newInvalidBoletoBarCode = exports.newInvalidProviderError = exports.newInvalidCNPJ = exports.newCNPJAlreadyExists = exports.newAccountDoesntHaveALogin = exports.newAccountDoesntHaveAPhone = exports.newAccountAlreadyHasAValidPhone = exports.newPhoneAlreadyValidated = exports.newCodeDoesntMatch = exports.newInvalidOperationProfile = exports.newMissingKYC = exports.newInvalidDocument = exports.newInvalidCpf = exports.newIProfileAlreadyApprovedOrRefusedError = void 0; | ||
const error_1 = require("./error"); | ||
@@ -38,2 +38,9 @@ const profile_1 = require("../dto/profile"); | ||
exports.newNotFoundValidParent = newNotFoundValidParent; | ||
const newNotFoundValidParentToAccount = (account) => newSwpError(error_1.ErrorCode.NotFound, 'Recurso não encontrado.', [ | ||
{ | ||
code: error_1.SubErrorCode.NOT_FOUND, | ||
msg: `Recurso não encontrado. para a conta ${account}` | ||
} | ||
]); | ||
exports.newNotFoundValidParentToAccount = newNotFoundValidParentToAccount; | ||
const newAccountCantHaveBalance = () => exports.newValidationError([ | ||
@@ -133,2 +140,9 @@ { | ||
exports.newInvalidIntegration = newInvalidIntegration; | ||
const newInvalidIntegrationBank = () => exports.newValidationError([ | ||
{ | ||
code: error_1.SubErrorCode.INVALID_INTEGRATION, | ||
msg: `Mais de 1 integração com bancos` | ||
} | ||
]); | ||
exports.newInvalidIntegrationBank = newInvalidIntegrationBank; | ||
const newIntegrationConfigNotFound = () => exports.newValidationError([ | ||
@@ -500,3 +514,3 @@ { | ||
code: error_1.SubErrorCode.INVALID_PLAN, | ||
msg: "Plano inválido" | ||
msg: 'Plano inválido' | ||
} | ||
@@ -508,3 +522,3 @@ ]); | ||
code: error_1.SubErrorCode.INVALID_PLAN_ITEM, | ||
msg: "Itens do Plano inválido" | ||
msg: 'Itens do Plano inválido' | ||
} | ||
@@ -516,3 +530,3 @@ ]); | ||
code: error_1.SubErrorCode.INVALID_PLAN, | ||
msg: "Plano já existente" | ||
msg: 'Plano já existente' | ||
} | ||
@@ -528,2 +542,65 @@ ]); | ||
exports.newAccountNotFound = newAccountNotFound; | ||
const newProfileNotFound = () => exports.newValidationError([ | ||
{ | ||
code: error_1.SubErrorCode.NOT_FOUND, | ||
msg: 'Profile não existe' | ||
} | ||
]); | ||
exports.newProfileNotFound = newProfileNotFound; | ||
const newProfileCompanyPerson = () => exports.newValidationError([ | ||
{ | ||
code: error_1.SubErrorCode.COMPANY_PARTNER_PROFILE_ALREADY_EXIST, | ||
msg: `Esse profile já possui um partner associado.` | ||
} | ||
]); | ||
exports.newProfileCompanyPerson = newProfileCompanyPerson; | ||
const newProfilePersonMissingAddress = () => exports.newValidationError([ | ||
{ | ||
code: error_1.SubErrorCode.PERSON_PROFILE_MISSING_ADDRESS, | ||
msg: `Esse profile não tem um endereço associado.` | ||
} | ||
]); | ||
exports.newProfilePersonMissingAddress = newProfilePersonMissingAddress; | ||
const newProfileCompanyMissingAddress = () => exports.newValidationError([ | ||
{ | ||
code: error_1.SubErrorCode.COMPANY_PROFILE_MISSING_ADDRESS, | ||
msg: `Esse profile não tem um endereço associado.` | ||
} | ||
]); | ||
exports.newProfileCompanyMissingAddress = newProfileCompanyMissingAddress; | ||
const newProfileCompanyPartnerMissingAddress = () => exports.newValidationError([ | ||
{ | ||
code: error_1.SubErrorCode.COMPANY_PARTNER_PROFILE_MISSING_ADDRESS, | ||
msg: `Esse profile não tem um endereço associado.` | ||
} | ||
]); | ||
exports.newProfileCompanyPartnerMissingAddress = newProfileCompanyPartnerMissingAddress; | ||
const newProfileCompanyPersonNotExist = () => exports.newValidationError([ | ||
{ | ||
code: error_1.SubErrorCode.COMPANY_PARTNER_PROFILE_NOT_EXIST, | ||
msg: `Esse profile não possui responsavel associado.` | ||
} | ||
]); | ||
exports.newProfileCompanyPersonNotExist = newProfileCompanyPersonNotExist; | ||
const newNextCodeEmptyResult = () => exports.newValidationError([ | ||
{ | ||
code: error_1.SubErrorCode.NEXTCODE_EMPTY_RESPONSE, | ||
msg: `Consulta sem resultados.` | ||
} | ||
]); | ||
exports.newNextCodeEmptyResult = newNextCodeEmptyResult; | ||
const newInvalidProfile = () => exports.newValidationError([ | ||
{ | ||
code: error_1.SubErrorCode.INVALID_PROFILE_APPROVED, | ||
msg: `Problemas no profile.` | ||
} | ||
]); | ||
exports.newInvalidProfile = newInvalidProfile; | ||
const newInvalidProfileType = (type) => exports.newValidationError([ | ||
{ | ||
code: error_1.SubErrorCode.INVALID_PROFILE_TYPE, | ||
msg: `Profile invalido. este profile é um ${type}.` | ||
} | ||
]); | ||
exports.newInvalidProfileType = newInvalidProfileType; | ||
//# sourceMappingURL=constructors.js.map |
@@ -74,3 +74,11 @@ export declare enum ErrorCode { | ||
INVALID_PLAN = "INVALID_PLAN", | ||
INVALID_PLAN_ITEM = "INVALID_PLAN_ITEM" | ||
INVALID_PLAN_ITEM = "INVALID_PLAN_ITEM", | ||
COMPANY_PARTNER_PROFILE_ALREADY_EXIST = "COMPANY_PARTNER_PROFILE_ALREADY_EXIST", | ||
PERSON_PROFILE_MISSING_ADDRESS = "PERSON_PROFILE_MISSING_ADDRESS", | ||
COMPANY_PROFILE_MISSING_ADDRESS = "COMPANY_PROFILE_MISSING_ADDRESS", | ||
COMPANY_PARTNER_PROFILE_MISSING_ADDRESS = "COMPANY_PARTNER_PROFILE_MISSING_ADDRESS", | ||
COMPANY_PARTNER_PROFILE_NOT_EXIST = "COMPANY_PARTNER_PROFILE_NOT_EXIST", | ||
NEXTCODE_EMPTY_RESPONSE = "NEXTCODE_EMPTY_RESPONSE", | ||
INVALID_PROFILE_APPROVED = "INVALID_PROFILE_APPROVED", | ||
INVALID_PROFILE_TYPE = "INVALID_PROFILE_TYPE" | ||
} | ||
@@ -77,0 +85,0 @@ export interface SubError { |
@@ -80,3 +80,11 @@ "use strict"; | ||
SubErrorCode["INVALID_PLAN_ITEM"] = "INVALID_PLAN_ITEM"; | ||
SubErrorCode["COMPANY_PARTNER_PROFILE_ALREADY_EXIST"] = "COMPANY_PARTNER_PROFILE_ALREADY_EXIST"; | ||
SubErrorCode["PERSON_PROFILE_MISSING_ADDRESS"] = "PERSON_PROFILE_MISSING_ADDRESS"; | ||
SubErrorCode["COMPANY_PROFILE_MISSING_ADDRESS"] = "COMPANY_PROFILE_MISSING_ADDRESS"; | ||
SubErrorCode["COMPANY_PARTNER_PROFILE_MISSING_ADDRESS"] = "COMPANY_PARTNER_PROFILE_MISSING_ADDRESS"; | ||
SubErrorCode["COMPANY_PARTNER_PROFILE_NOT_EXIST"] = "COMPANY_PARTNER_PROFILE_NOT_EXIST"; | ||
SubErrorCode["NEXTCODE_EMPTY_RESPONSE"] = "NEXTCODE_EMPTY_RESPONSE"; | ||
SubErrorCode["INVALID_PROFILE_APPROVED"] = "INVALID_PROFILE_APPROVED"; | ||
SubErrorCode["INVALID_PROFILE_TYPE"] = "INVALID_PROFILE_TYPE"; | ||
})(SubErrorCode = exports.SubErrorCode || (exports.SubErrorCode = {})); | ||
//# sourceMappingURL=error.js.map |
import { Options } from '../swipe'; | ||
import { AxiosResponse } from 'axios'; | ||
import { SearchOptions, SwpSuccessResponse } from './dto/dto'; | ||
import { HttpServiceVerbs } from "./http-service-verbs"; | ||
import { HttpServiceVerbs } from './http-service-verbs'; | ||
interface RequestOptions { | ||
@@ -22,8 +22,5 @@ searchOptions?: SearchOptions; | ||
constructor(opt: Options, basePath?: string); | ||
private baseRequest; | ||
private static getQueryParams; | ||
private static getHeaders; | ||
private static getJsonBody; | ||
private debugRequestLog; | ||
private debugResponseLog; | ||
get<T>(path: string, options?: RequestOptions): Promise<AxiosResponse<SwpSuccessResponse<T>>>; | ||
@@ -33,3 +30,6 @@ post<T>(path: string, options?: RequestOptions): Promise<AxiosResponse<SwpSuccessResponse<T>>>; | ||
delete<T>(path: string, options?: RequestOptions): Promise<AxiosResponse<SwpSuccessResponse<T>>>; | ||
private baseRequest; | ||
private debugRequestLog; | ||
private debugResponseLog; | ||
} | ||
export {}; |
@@ -27,22 +27,2 @@ "use strict"; | ||
} | ||
async baseRequest(requestPath, method, options) { | ||
const queryParams = HttpService.getQueryParams(options); | ||
const url = `${this.baseUrl}${this.basePath}${requestPath}${queryParams.toString()}`; | ||
const headers = HttpService.getHeaders(options); | ||
console.log(headers); | ||
const axiosOptions = { | ||
method, | ||
headers, | ||
url, | ||
data: options === null || options === void 0 ? void 0 : options.body, | ||
validateStatus: (status) => status >= 200 && status < 300 | ||
}; | ||
this.debugRequestLog(url, headers, options); | ||
const res = await axios_1.default(axiosOptions).catch((e) => { | ||
var _a, _b; | ||
throw ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.error) || constructors_1.newInternalServerError(); | ||
}); | ||
this.debugResponseLog(res); | ||
return res; | ||
} | ||
static getQueryParams(options) { | ||
@@ -75,2 +55,34 @@ let queryParams = new path_query_1.PathQuery(); | ||
} | ||
async get(path, options) { | ||
return this.baseRequest(path, Method.GET, options); | ||
} | ||
async post(path, options) { | ||
return this.baseRequest(path, Method.POST, options); | ||
} | ||
async put(path, options) { | ||
return this.baseRequest(path, Method.PUT, options); | ||
} | ||
async delete(path, options) { | ||
return this.baseRequest(path, Method.DELETE, options); | ||
} | ||
async baseRequest(requestPath, method, options) { | ||
const queryParams = HttpService.getQueryParams(options); | ||
const url = `${this.baseUrl}${this.basePath}${requestPath}${queryParams.toString()}`; | ||
const headers = HttpService.getHeaders(options); | ||
console.log(headers); | ||
const axiosOptions = { | ||
method, | ||
headers, | ||
url, | ||
data: options === null || options === void 0 ? void 0 : options.body, | ||
validateStatus: (status) => status >= 200 && status < 300 | ||
}; | ||
this.debugRequestLog(url, headers, options); | ||
const res = await axios_1.default(axiosOptions).catch((e) => { | ||
var _a, _b; | ||
throw ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.error) || constructors_1.newInternalServerError(); | ||
}); | ||
this.debugResponseLog(res); | ||
return res; | ||
} | ||
debugRequestLog(url, headers, options) { | ||
@@ -91,16 +103,4 @@ if (this.opt.debug) { | ||
} | ||
async get(path, options) { | ||
return this.baseRequest(path, Method.GET, options); | ||
} | ||
async post(path, options) { | ||
return this.baseRequest(path, Method.POST, options); | ||
} | ||
async put(path, options) { | ||
return this.baseRequest(path, Method.PUT, options); | ||
} | ||
async delete(path, options) { | ||
return this.baseRequest(path, Method.DELETE, options); | ||
} | ||
} | ||
exports.HttpService = HttpService; | ||
//# sourceMappingURL=http-service.js.map |
@@ -9,6 +9,6 @@ import { AxiosInstance, AxiosRequestConfig, AxiosStatic } from 'axios'; | ||
static createInstance(client: AxiosStatic, config: AxiosRequestConfig, serviceName: InternalService): WebClient; | ||
private request; | ||
getRequest(): any; | ||
get<T>(url: string, config?: AxiosRequestConfig): Promise<T>; | ||
delete<T>(url: string, config?: AxiosRequestConfig): Promise<T>; | ||
deleteWithBody<T>(url: string, data?: any, config?: AxiosRequestConfig): Promise<T>; | ||
head<T>(url: string, config?: AxiosRequestConfig): Promise<T>; | ||
@@ -18,2 +18,3 @@ post<T>(url: string, data?: any, config?: AxiosRequestConfig): Promise<T>; | ||
patch<T>(url: string, data?: any, config?: AxiosRequestConfig): Promise<T>; | ||
private request; | ||
} |
@@ -16,15 +16,2 @@ "use strict"; | ||
} | ||
async request(config) { | ||
var _a, _b; | ||
try { | ||
const res = await this.api.request(config); | ||
this.currentRequest = res.request; | ||
return res.data; | ||
} | ||
catch (reason) { | ||
console.log('error de verdade', reason.response); | ||
this.currentRequest = reason.request; | ||
throw constructors_1.newExternalServiceError(this.serviceName, JSON.stringify((_b = (_a = reason.response) === null || _a === void 0 ? void 0 : _a.data) !== null && _b !== void 0 ? _b : reason)); | ||
} | ||
} | ||
getRequest() { | ||
@@ -39,2 +26,5 @@ return this.currentRequest; | ||
} | ||
deleteWithBody(url, data, config) { | ||
return this.request(Object.assign(Object.assign({}, config), { url, method: 'delete', data })); | ||
} | ||
head(url, config) { | ||
@@ -52,4 +42,16 @@ return this.request(Object.assign(Object.assign({}, config), { url, method: 'head' })); | ||
} | ||
async request(config) { | ||
var _a, _b; | ||
try { | ||
const res = await this.api.request(config); | ||
this.currentRequest = res.config; | ||
return res.data; | ||
} | ||
catch (reason) { | ||
this.currentRequest = reason.config; | ||
throw constructors_1.newExternalServiceError(this.serviceName, JSON.stringify((_b = (_a = reason.response) === null || _a === void 0 ? void 0 : _a.data) !== null && _b !== void 0 ? _b : reason)); | ||
} | ||
} | ||
} | ||
exports.WebClient = WebClient; | ||
//# sourceMappingURL=web-client.js.map |
import { HttpServiceVerbs } from './http/http-service-verbs'; | ||
import { AxiosResponse } from 'axios'; | ||
import { NewAddressDTO, NewProfileDTO, NewDocumentsDTO, NewProfileCompanyDTO, NewDocumentsCnpjDTO, ProfileDTO, getUserBalanceDTO } from './http/dto/profile'; | ||
import { SwpSuccessResponse, SearchOptions } from './http/dto/dto'; | ||
import { AccountDTO } from "./http/dto/ledger"; | ||
import { getUserBalanceDTO, NewAddressDTO, NewDocumentsCnpjDTO, NewDocumentsDTO, NewProfileCompanyDTO, NewProfileDTO, ProfileDTO } from './http/dto/profile'; | ||
import { SearchOptions, SwpSuccessResponse } from './http/dto/dto'; | ||
import { AccountDTO } from './http/dto/ledger'; | ||
export declare class Profile { | ||
@@ -13,6 +13,6 @@ private readonly http; | ||
addProfileToAccountCompany(id: string, newProfile: NewProfileCompanyDTO): Promise<AxiosResponse<SwpSuccessResponse<ProfileDTO>>>; | ||
addProfileToAccountCompanyPartner(id: string, newProfile: NewProfileDTO): Promise<AxiosResponse<SwpSuccessResponse<ProfileDTO>>>; | ||
addAddressToProfile(id: string, newAddress: NewAddressDTO): Promise<AxiosResponse<SwpSuccessResponse<ProfileDTO>>>; | ||
addDocumentsToProfile(id: string, newDocuments: NewDocumentsDTO): Promise<AxiosResponse<SwpSuccessResponse<ProfileDTO>>>; | ||
addDocumentsToProfileCompany(id: string, newDocuments: NewDocumentsCnpjDTO): Promise<AxiosResponse<SwpSuccessResponse<ProfileDTO>>>; | ||
private createDocumentsBody; | ||
getProfile(id: string): Promise<AxiosResponse<SwpSuccessResponse<ProfileDTO>>>; | ||
@@ -24,2 +24,3 @@ resetRejectedProfile(id: string): Promise<AxiosResponse<SwpSuccessResponse<null>>>; | ||
getUsers(opt?: SearchOptions): Promise<AxiosResponse<SwpSuccessResponse<getUserBalanceDTO[]>>>; | ||
private createDocumentsBody; | ||
} |
@@ -11,6 +11,10 @@ "use strict"; | ||
createPhoneValidation(id, phone) { | ||
return this.http.post(`/accounts/${id}/create-phone-validation`, { body: { phone } }); | ||
return this.http.post(`/accounts/${id}/create-phone-validation`, { | ||
body: { phone } | ||
}); | ||
} | ||
validatePhone(id, code) { | ||
return this.http.post(`/accounts/${id}/validate-phone`, { body: { code } }); | ||
return this.http.post(`/accounts/${id}/validate-phone`, { | ||
body: { code } | ||
}); | ||
} | ||
@@ -23,2 +27,7 @@ addProfileToAccount(id, newProfile) { | ||
} | ||
addProfileToAccountCompanyPartner(id, newProfile) { | ||
return this.http.post(`/accounts/company/partner/${id}`, { | ||
body: newProfile | ||
}); | ||
} | ||
addAddressToProfile(id, newAddress) { | ||
@@ -33,3 +42,3 @@ return this.http.post(`/accounts/${id}/address`, { body: newAddress }); | ||
headerExtra: Object.assign({}, headers), | ||
body: body, | ||
body: body | ||
}); | ||
@@ -43,15 +52,5 @@ } | ||
headerExtra: Object.assign({}, headers), | ||
body: body, | ||
body: body | ||
}); | ||
} | ||
createDocumentsBody(newDocuments) { | ||
const data = new FormData(); | ||
data.append('frontSide', fs.createReadStream(newDocuments.frontSide)); | ||
data.append('proofOfResidence', fs.createReadStream(newDocuments.proofOfResidence)); | ||
data.append('selfie', fs.createReadStream(newDocuments.selfie)); | ||
if (newDocuments.backSide) { | ||
data.append('backSide', fs.createReadStream(newDocuments.backSide)); | ||
} | ||
return data; | ||
} | ||
getProfile(id) { | ||
@@ -75,4 +74,13 @@ return this.http.get(`/accounts/${id}`); | ||
} | ||
createDocumentsBody(newDocuments) { | ||
const data = new FormData(); | ||
data.append('frontSide', fs.createReadStream(newDocuments.frontSide)); | ||
data.append('selfie', fs.createReadStream(newDocuments.selfie)); | ||
if (newDocuments.backSide) { | ||
data.append('backSide', fs.createReadStream(newDocuments.backSide)); | ||
} | ||
return data; | ||
} | ||
} | ||
exports.Profile = Profile; | ||
//# sourceMappingURL=profile.js.map |
@@ -5,2 +5,3 @@ "use strict"; | ||
const http_service_1 = require("./http/http-service"); | ||
const profile_1 = require("./http/dto/profile"); | ||
const axios_1 = require("axios"); | ||
@@ -13,3 +14,3 @@ const constants_1 = require("./http/constants"); | ||
status: 200, | ||
data: "hello!" | ||
data: 'hello!' | ||
}; | ||
@@ -19,3 +20,3 @@ axios_1.default.mockImplementation(() => { | ||
}); | ||
const id = "id"; | ||
const id = 'id'; | ||
const res = await func(id, newDocuments); | ||
@@ -27,3 +28,3 @@ expect(res).toBe(expectedResult); | ||
expect(call.headers[constants_1.HttpHeaders.SwpApiKey]).not.toBeUndefined(); | ||
expect(call.headers["content-type"]).toContain("multipart/form-data; boundary="); | ||
expect(call.headers['content-type']).toContain('multipart/form-data; boundary='); | ||
expect(call.method).toBe(http_service_1.Method.POST); | ||
@@ -36,3 +37,3 @@ expect(call.data).not.toBeUndefined(); | ||
status: 200, | ||
data: "" | ||
data: '' | ||
}; | ||
@@ -42,4 +43,4 @@ axios_1.default.mockImplementation(() => { | ||
}); | ||
const id = "id"; | ||
const phoneOrCode = "phoneOrCode"; | ||
const id = 'id'; | ||
const phoneOrCode = 'phoneOrCode'; | ||
const res = await func(id, phoneOrCode); | ||
@@ -51,87 +52,134 @@ expect(res).toBe(expectedResult); | ||
expect(call.headers[constants_1.HttpHeaders.SwpApiKey]).not.toBeUndefined(); | ||
expect(call.headers["content-type"]).toContain("application/json"); | ||
expect(call.headers['content-type']).toContain('application/json'); | ||
expect(call.method).toBe(http_service_1.Method.POST); | ||
expect(call.url).toContain(path); | ||
}; | ||
test("addProfileToAccount", ledger_test_1._baseSwipeModuleTest(() => ledger_test_1._swipeTest.Profile.withToken(token).addProfileToAccount("id", { | ||
name: "name", | ||
email: "email", | ||
phone: "phone", | ||
cpf: "cpf", | ||
birthDate: "birthDate", | ||
motherName: "motherName", | ||
}), http_service_1.Method.POST, "/profile/accounts/id", { | ||
name: "name", | ||
email: "email", | ||
phone: "phone", | ||
cpf: "cpf", | ||
birthDate: "birthDate", | ||
motherName: "motherName", | ||
test('addProfileToAccount', ledger_test_1._baseSwipeModuleTest(() => ledger_test_1._swipeTest.Profile.withToken(token).addProfileToAccount('id', { | ||
name: 'name', | ||
email: 'email', | ||
phone: 'phone', | ||
cpf: 'cpf', | ||
birthDate: 'birthDate', | ||
motherName: 'motherName' | ||
}), http_service_1.Method.POST, '/profile/accounts/id', { | ||
name: 'name', | ||
email: 'email', | ||
phone: 'phone', | ||
cpf: 'cpf', | ||
birthDate: 'birthDate', | ||
motherName: 'motherName' | ||
})); | ||
test("addProfileToAccountCompany", ledger_test_1._baseSwipeModuleTest(() => ledger_test_1._swipeTest.Profile.withToken(token).addProfileToAccountCompany("id", { | ||
name: "name", | ||
email: "email", | ||
phone: "phone", | ||
cnpj: "cnpj", | ||
openingDate: "openingDate", | ||
corporateName: "corporateName", | ||
companyPartner: { | ||
name: "name", | ||
cpf: "cpf", | ||
birthDate: "birthDate", | ||
motherName: "motherName", | ||
}, | ||
}), http_service_1.Method.POST, "/profile/accounts/company/id", { | ||
name: "name", | ||
email: "email", | ||
phone: "phone", | ||
cnpj: "cnpj", | ||
openingDate: "openingDate", | ||
corporateName: "corporateName", | ||
companyPartner: { | ||
name: "name", | ||
cpf: "cpf", | ||
birthDate: "birthDate", | ||
motherName: "motherName", | ||
}, | ||
test('addProfileToAccountCompany', ledger_test_1._baseSwipeModuleTest(() => ledger_test_1._swipeTest.Profile.withToken(token).addProfileToAccountCompany('id', { | ||
email: 'email', | ||
phone: 'phone', | ||
cnpj: 'cnpj', | ||
openingDate: 'openingDate', | ||
corporateName: 'corporateName', | ||
companySize: 10, | ||
companyType: 'MEI' | ||
}), http_service_1.Method.POST, '/profile/accounts/company/id', { | ||
email: 'email', | ||
phone: 'phone', | ||
cnpj: 'cnpj', | ||
openingDate: 'openingDate', | ||
corporateName: 'corporateName', | ||
companySize: 10, | ||
companyType: 'MEI' | ||
})); | ||
test("addAddressToProfile", ledger_test_1._baseSwipeModuleTest(() => ledger_test_1._swipeTest.Profile.withToken(token).addAddressToProfile("id", { | ||
zipCode: "zipCode", | ||
city: "city", | ||
complement: "complement", | ||
country: "country", | ||
neighborhood: "neighborhood", | ||
number: "number", | ||
state: "state", | ||
street: "street", | ||
}), http_service_1.Method.POST, "/profile/accounts/id/address", { | ||
zipCode: "zipCode", | ||
city: "city", | ||
complement: "complement", | ||
country: "country", | ||
neighborhood: "neighborhood", | ||
number: "number", | ||
state: "state", | ||
street: "street", | ||
test('addProfileToAccountCompanyPartner', ledger_test_1._baseSwipeModuleTest(() => ledger_test_1._swipeTest.Profile.withToken(token).addProfileToAccountCompanyPartner('id', { | ||
name: 'name', | ||
email: 'email', | ||
phone: 'phone', | ||
cpf: 'cpf', | ||
birthDate: 'birthDate', | ||
motherName: 'motherName' | ||
}), http_service_1.Method.POST, '/profile/accounts/company/partner/id', { | ||
name: 'name', | ||
email: 'email', | ||
phone: 'phone', | ||
cpf: 'cpf', | ||
birthDate: 'birthDate', | ||
motherName: 'motherName' | ||
})); | ||
test("addDocumentsToProfile", _baseDocument((id, d) => ledger_test_1._swipeTest.Profile.withToken(token).addDocumentsToProfile(id, d), { | ||
frontSide: "frontSide", | ||
backSide: "backSide", | ||
proofOfResidence: "proofOfResidence", | ||
selfie: "selfie", | ||
}, "/profile/accounts/id/documents")); | ||
test("addDocumentsToProfileCompany", _baseDocument((id, d) => ledger_test_1._swipeTest.Profile.withToken(token).addDocumentsToProfileCompany(id, d), { | ||
frontSide: "frontSide", | ||
proofOfResidence: "proofOfResidence", | ||
selfie: "selfie", | ||
socialContract: "socialContract", | ||
cnpjCard: "cnpjCard", | ||
}, "/profile/accounts/id/documents/cnpj")); | ||
test("getProfile", ledger_test_1._baseSwipeModuleTest(() => ledger_test_1._swipeTest.Profile.withToken(token).getProfile("id"), http_service_1.Method.GET, "/profile/accounts/id")); | ||
test("resetRejectedProfile", ledger_test_1._baseSwipeModuleTest(() => ledger_test_1._swipeTest.Profile.withToken(token).resetRejectedProfile("id"), http_service_1.Method.DELETE, "/profile/accounts/id")); | ||
test("approveProfile", ledger_test_1._baseSwipeModuleTest(() => ledger_test_1._swipeTest.Profile.withToken(token).approveProfile("id"), http_service_1.Method.POST, "/profile/accounts/id/approve")); | ||
test("getAccountByCNPJ", ledger_test_1._baseSwipeModuleTest(() => ledger_test_1._swipeTest.Profile.withToken(token).getAccountByCnpf("id"), http_service_1.Method.GET, "/profile/accounts/cnpj/id")); | ||
test("rejectProfile", ledger_test_1._baseSwipeModuleTest(() => ledger_test_1._swipeTest.Profile.withToken(token).rejectProfile("id"), http_service_1.Method.POST, "/profile/accounts/id/reject")); | ||
test('createPhoneValidation', _basePhoneValidation(() => ledger_test_1._swipeTest.Profile.withToken(token).createPhoneValidation("id", "phone"), "/profile/accounts/id/create-phone-validation")); | ||
test('validatePhone', _basePhoneValidation(() => ledger_test_1._swipeTest.Profile.withToken(token).validatePhone("id", "code"), "/profile/accounts/id/validate-phone")); | ||
test('addAddressToProfile Individual', ledger_test_1._baseSwipeModuleTest(() => ledger_test_1._swipeTest.Profile.withToken(token).addAddressToProfile('id', { | ||
zipCode: 'zipCode', | ||
city: 'city', | ||
complement: 'complement', | ||
country: 'country', | ||
neighborhood: 'neighborhood', | ||
number: 'number', | ||
state: 'state', | ||
street: 'street', | ||
personType: profile_1.AddressPersonType.INDIVIDUAL | ||
}), http_service_1.Method.POST, '/profile/accounts/id/address', { | ||
zipCode: 'zipCode', | ||
city: 'city', | ||
complement: 'complement', | ||
country: 'country', | ||
neighborhood: 'neighborhood', | ||
number: 'number', | ||
state: 'state', | ||
street: 'street', | ||
personType: profile_1.AddressPersonType.INDIVIDUAL | ||
})); | ||
test('addAddressToProfile Company', ledger_test_1._baseSwipeModuleTest(() => ledger_test_1._swipeTest.Profile.withToken(token).addAddressToProfile('id', { | ||
zipCode: 'zipCode', | ||
city: 'city', | ||
complement: 'complement', | ||
country: 'country', | ||
neighborhood: 'neighborhood', | ||
number: 'number', | ||
state: 'state', | ||
street: 'street', | ||
personType: profile_1.AddressPersonType.COMPANY | ||
}), http_service_1.Method.POST, '/profile/accounts/id/address', { | ||
zipCode: 'zipCode', | ||
city: 'city', | ||
complement: 'complement', | ||
country: 'country', | ||
neighborhood: 'neighborhood', | ||
number: 'number', | ||
state: 'state', | ||
street: 'street', | ||
personType: profile_1.AddressPersonType.COMPANY | ||
})); | ||
test('addAddressToProfile COMPANY Partner', ledger_test_1._baseSwipeModuleTest(() => ledger_test_1._swipeTest.Profile.withToken(token).addAddressToProfile('id', { | ||
zipCode: 'zipCode', | ||
city: 'city', | ||
complement: 'complement', | ||
country: 'country', | ||
neighborhood: 'neighborhood', | ||
number: 'number', | ||
state: 'state', | ||
street: 'street', | ||
personType: profile_1.AddressPersonType.COMPANY_PARTNER | ||
}), http_service_1.Method.POST, '/profile/accounts/id/address', { | ||
zipCode: 'zipCode', | ||
city: 'city', | ||
complement: 'complement', | ||
country: 'country', | ||
neighborhood: 'neighborhood', | ||
number: 'number', | ||
state: 'state', | ||
street: 'street', | ||
personType: profile_1.AddressPersonType.COMPANY_PARTNER | ||
})); | ||
test('addDocumentsToProfile', _baseDocument((id, d) => ledger_test_1._swipeTest.Profile.withToken(token).addDocumentsToProfile(id, d), { | ||
frontSide: 'frontSide', | ||
backSide: 'backSide', | ||
selfie: 'selfie' | ||
}, '/profile/accounts/id/documents')); | ||
test('addDocumentsToProfileCompany', _baseDocument((id, d) => ledger_test_1._swipeTest.Profile.withToken(token).addDocumentsToProfileCompany(id, d), { | ||
frontSide: 'frontSide', | ||
selfie: 'selfie', | ||
socialContract: 'socialContract', | ||
cnpjCard: 'cnpjCard' | ||
}, '/profile/accounts/id/documents/cnpj')); | ||
test('getProfile', ledger_test_1._baseSwipeModuleTest(() => ledger_test_1._swipeTest.Profile.withToken(token).getProfile('id'), http_service_1.Method.GET, '/profile/accounts/id')); | ||
test('resetRejectedProfile', ledger_test_1._baseSwipeModuleTest(() => ledger_test_1._swipeTest.Profile.withToken(token).resetRejectedProfile('id'), http_service_1.Method.DELETE, '/profile/accounts/id')); | ||
test('approveProfile', ledger_test_1._baseSwipeModuleTest(() => ledger_test_1._swipeTest.Profile.withToken(token).approveProfile('id'), http_service_1.Method.POST, '/profile/accounts/id/approve')); | ||
test('getAccountByCNPJ', ledger_test_1._baseSwipeModuleTest(() => ledger_test_1._swipeTest.Profile.withToken(token).getAccountByCnpf('id'), http_service_1.Method.GET, '/profile/accounts/cnpj/id')); | ||
test('rejectProfile', ledger_test_1._baseSwipeModuleTest(() => ledger_test_1._swipeTest.Profile.withToken(token).rejectProfile('id'), http_service_1.Method.POST, '/profile/accounts/id/reject')); | ||
test('createPhoneValidation', _basePhoneValidation(() => ledger_test_1._swipeTest.Profile.withToken(token).createPhoneValidation('id', 'phone'), '/profile/accounts/id/create-phone-validation')); | ||
test('validatePhone', _basePhoneValidation(() => ledger_test_1._swipeTest.Profile.withToken(token).validatePhone('id', 'code'), '/profile/accounts/id/validate-phone')); | ||
//# sourceMappingURL=profile.test.js.map |
134
package.json
{ | ||
"name": "@swp/swipe-sdk", | ||
"version": "0.12.59", | ||
"description": "", | ||
"private": false, | ||
"isBundle": false, | ||
"main": "build/index.js", | ||
"types": "build/index.d.ts", | ||
"scripts": { | ||
"build": " tsc", | ||
"prepublishOnly": "npm run build", | ||
"test": "jest --collectCoverage --collectCoverageFrom=src/**/*.{js,ts}" | ||
"name": "@swp/swipe-sdk", | ||
"version": "0.12.60", | ||
"description": "", | ||
"private": false, | ||
"isBundle": false, | ||
"main": "build/index.js", | ||
"types": "build/index.d.ts", | ||
"engines": { | ||
"node": "14.17.5", | ||
"npm": "7.24.1" | ||
}, | ||
"scripts": { | ||
"build": " tsc", | ||
"prepublishOnly": "npm run build", | ||
"test": "jest --collectCoverage --collectCoverageFrom=src/**/*.{js,ts}" | ||
}, | ||
"keywords": [ | ||
"swp", | ||
"swipe", | ||
"ledger", | ||
"wallet", | ||
"sdk", | ||
"fintech" | ||
], | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"author": { | ||
"name": "Swipe", | ||
"url": "https://www.swipetech.io" | ||
}, | ||
"contributors": [ | ||
{ | ||
"name": "Eduardo Nuzzi", | ||
"email": "eduardo@swipetech.io" | ||
}, | ||
"keywords": [ | ||
"swp", | ||
"swipe", | ||
"ledger", | ||
"wallet", | ||
"sdk", | ||
"fintech" | ||
], | ||
"publishConfig": { | ||
"access": "public" | ||
{ | ||
"name": "Ezequiel Matos", | ||
"email": "ezequiel@swipetech.io" | ||
}, | ||
"author": { | ||
"name": "Swipe", | ||
"url": "https://www.swipetech.io" | ||
{ | ||
"name": "Angelica Zordan", | ||
"email": "angelica@swipetech.io" | ||
}, | ||
"contributors": [ | ||
{ | ||
"name": "Eduardo Nuzzi", | ||
"email": "eduardo@swipetech.io" | ||
}, | ||
{ | ||
"name": "Ezequiel Matos", | ||
"email": "ezequiel@swipetech.io" | ||
}, | ||
{ | ||
"name": "Angelica Zordan", | ||
"email": "angelica@swipetech.io" | ||
}, | ||
{ | ||
"name": "Joseildo Silva", | ||
"email": "joseildo@swipetech.io" | ||
} | ||
], | ||
"license": "ISC", | ||
"devDependencies": { | ||
"@types/chai": "^4.2.18", | ||
"@types/crypto-js": "3.1.43", | ||
"@types/jsonwebtoken": "8.3.3", | ||
"@types/node": "12.7.2", | ||
"@types/node-fetch": "2.5.0", | ||
"@types/form-data": "2.5.0", | ||
"nyc": "^15.1.0", | ||
"ts-node": "8.3.0", | ||
"typescript": "^4.3.2", | ||
"chai": "^4.3.4", | ||
"@types/jest": "^26.0.23", | ||
"jest": "^27.0.3", | ||
"ts-jest": "^27.0.2" | ||
}, | ||
"dependencies": { | ||
"axios": "^0.21.1", | ||
"bitcoinjs-lib": "^5.1.7", | ||
"class-validator": "^0.11.0", | ||
"crypto-js": "^4.0.0", | ||
"form-data": "3.0.0", | ||
"jsonwebtoken": "8.5.1" | ||
{ | ||
"name": "Joseildo Silva", | ||
"email": "joseildo@swipetech.io" | ||
} | ||
], | ||
"license": "ISC", | ||
"devDependencies": { | ||
"@types/chai": "4.2.18", | ||
"@types/crypto-js": "3.1.43", | ||
"@types/jsonwebtoken": "8.3.3", | ||
"@types/node": "12.7.2", | ||
"@types/node-fetch": "2.5.0", | ||
"@types/form-data": "2.5.0", | ||
"nyc": "15.1.0", | ||
"ts-node": "8.3.0", | ||
"typescript": "4.3.2", | ||
"chai": "4.3.4", | ||
"@types/jest": "27.0.2", | ||
"jest": "27.0.2", | ||
"ts-jest": "27.0.5" | ||
}, | ||
"dependencies": { | ||
"axios": "0.21.1", | ||
"bitcoinjs-lib": "5.1.7", | ||
"class-validator": "0.11.0", | ||
"crypto-js": "4.0.0", | ||
"form-data": "3.0.0", | ||
"jsonwebtoken": "8.5.1" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
407008
6247
+ Addedaxios@0.21.1(transitive)
+ Addedbip174@1.0.1(transitive)
+ Addedbitcoinjs-lib@5.1.7(transitive)
+ Addedclass-validator@0.11.0(transitive)
+ Addedcrypto-js@4.0.0(transitive)
- Removedaxios@0.21.4(transitive)
- Removedbip174@2.1.1(transitive)
- Removedbitcoinjs-lib@5.2.0(transitive)
- Removedclass-validator@0.11.1(transitive)
- Removedcrypto-js@4.2.0(transitive)
Updatedaxios@0.21.1
Updatedbitcoinjs-lib@5.1.7
Updatedclass-validator@0.11.0
Updatedcrypto-js@4.0.0