@pague-dev/sdk-node 2.1.0 → 2.2.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.
- package/dist/index.cjs +3 -1
- package/dist/index.d.cts +69 -3
- package/dist/index.d.mts +69 -3
- package/dist/index.mjs +3 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -228,7 +228,9 @@ function isValidWebhookEvent(event) {
|
|
|
228
228
|
"withdrawal_completed",
|
|
229
229
|
"withdrawal_failed",
|
|
230
230
|
"withdrawal_reversed",
|
|
231
|
-
"balance_block_created"
|
|
231
|
+
"balance_block_created",
|
|
232
|
+
"balance_block_approved",
|
|
233
|
+
"balance_block_rejected"
|
|
232
234
|
].includes(obj.event);
|
|
233
235
|
}
|
|
234
236
|
/**
|
package/dist/index.d.cts
CHANGED
|
@@ -385,7 +385,7 @@ declare class Pdev {
|
|
|
385
385
|
/**
|
|
386
386
|
* Available webhook event types
|
|
387
387
|
*/
|
|
388
|
-
type WebhookEventType = 'payment_completed' | 'payment_expired' | 'refund_completed' | 'withdrawal_completed' | 'withdrawal_failed' | 'withdrawal_reversed' | 'balance_block_created';
|
|
388
|
+
type WebhookEventType = 'payment_completed' | 'payment_expired' | 'refund_completed' | 'withdrawal_completed' | 'withdrawal_failed' | 'withdrawal_reversed' | 'balance_block_created' | 'balance_block_approved' | 'balance_block_rejected';
|
|
389
389
|
/**
|
|
390
390
|
* Base webhook payload structure
|
|
391
391
|
*/
|
|
@@ -612,10 +612,76 @@ interface BalanceBlockCreatedData {
|
|
|
612
612
|
* Balance block created webhook event
|
|
613
613
|
*/
|
|
614
614
|
type BalanceBlockCreatedEvent = WebhookPayload<'balance_block_created', BalanceBlockCreatedData>;
|
|
615
|
+
/**
|
|
616
|
+
* Data payload for balance_block_approved event
|
|
617
|
+
*/
|
|
618
|
+
interface BalanceBlockApprovedData {
|
|
619
|
+
/** Balance block identifier */
|
|
620
|
+
blockId: string;
|
|
621
|
+
/** Transaction ID of the blocked transaction */
|
|
622
|
+
transactionId: string;
|
|
623
|
+
/** Environment where the block was created */
|
|
624
|
+
environment: 'production' | 'sandbox';
|
|
625
|
+
/** Blocked amount in BRL */
|
|
626
|
+
amount: number;
|
|
627
|
+
/** Currency code (e.g., "BRL") */
|
|
628
|
+
currency: string;
|
|
629
|
+
/** Type of block (med, judicial, administrative) */
|
|
630
|
+
blockType: 'med' | 'judicial' | 'administrative';
|
|
631
|
+
/** Block reference number */
|
|
632
|
+
referenceNumber: string;
|
|
633
|
+
/** Original reason for the block */
|
|
634
|
+
reason: string;
|
|
635
|
+
/** Reason for resolution (optional) */
|
|
636
|
+
resolutionReason: string | null;
|
|
637
|
+
/** Block status */
|
|
638
|
+
status: 'approved';
|
|
639
|
+
/** ISO 8601 timestamp of when block was created */
|
|
640
|
+
createdAt: string;
|
|
641
|
+
/** ISO 8601 timestamp of when block was resolved */
|
|
642
|
+
resolvedAt: string | null;
|
|
643
|
+
}
|
|
644
|
+
/**
|
|
645
|
+
* Balance block approved webhook event
|
|
646
|
+
*/
|
|
647
|
+
type BalanceBlockApprovedEvent = WebhookPayload<'balance_block_approved', BalanceBlockApprovedData>;
|
|
648
|
+
/**
|
|
649
|
+
* Data payload for balance_block_rejected event
|
|
650
|
+
*/
|
|
651
|
+
interface BalanceBlockRejectedData {
|
|
652
|
+
/** Balance block identifier */
|
|
653
|
+
blockId: string;
|
|
654
|
+
/** Transaction ID of the blocked transaction */
|
|
655
|
+
transactionId: string;
|
|
656
|
+
/** Environment where the block was created */
|
|
657
|
+
environment: 'production' | 'sandbox';
|
|
658
|
+
/** Blocked amount in BRL */
|
|
659
|
+
amount: number;
|
|
660
|
+
/** Currency code (e.g., "BRL") */
|
|
661
|
+
currency: string;
|
|
662
|
+
/** Type of block (med, judicial, administrative) */
|
|
663
|
+
blockType: 'med' | 'judicial' | 'administrative';
|
|
664
|
+
/** Block reference number */
|
|
665
|
+
referenceNumber: string;
|
|
666
|
+
/** Original reason for the block */
|
|
667
|
+
reason: string;
|
|
668
|
+
/** Reason for resolution (optional) */
|
|
669
|
+
resolutionReason: string | null;
|
|
670
|
+
/** Block status */
|
|
671
|
+
status: 'rejected';
|
|
672
|
+
/** ISO 8601 timestamp of when block was created */
|
|
673
|
+
createdAt: string;
|
|
674
|
+
/** ISO 8601 timestamp of when block was resolved */
|
|
675
|
+
resolvedAt: string | null;
|
|
676
|
+
}
|
|
677
|
+
/**
|
|
678
|
+
* Balance block rejected webhook event
|
|
679
|
+
*/
|
|
680
|
+
type BalanceBlockRejectedEvent = WebhookPayload<'balance_block_rejected', BalanceBlockRejectedData>;
|
|
615
681
|
/**
|
|
616
682
|
* Union type of all possible webhook events
|
|
617
683
|
*/
|
|
618
|
-
type WebhookEvent = PaymentCompletedEvent | PaymentExpiredEvent | RefundCompletedEvent | WithdrawalCompletedEvent | WithdrawalFailedEvent | WithdrawalReversedEvent | BalanceBlockCreatedEvent;
|
|
684
|
+
type WebhookEvent = PaymentCompletedEvent | PaymentExpiredEvent | RefundCompletedEvent | WithdrawalCompletedEvent | WithdrawalFailedEvent | WithdrawalReversedEvent | BalanceBlockCreatedEvent | BalanceBlockApprovedEvent | BalanceBlockRejectedEvent;
|
|
619
685
|
/**
|
|
620
686
|
* Webhook headers sent with each request
|
|
621
687
|
*/
|
|
@@ -705,4 +771,4 @@ interface WebhookHeaders {
|
|
|
705
771
|
declare function verifyWebhookSignature(payload: string, signature: string, secret: string): boolean;
|
|
706
772
|
declare function parseWebhook(payload: string): WebhookEvent | null;
|
|
707
773
|
//#endregion
|
|
708
|
-
export { AccountDetail, AccountInfo, AccountStatus, BalanceAmount, BalanceBlockCreatedData, BalanceBlockCreatedEvent, BalanceDetail, Charge, ChargeStatus, CompanyDetail, CompanyStatus, CreateChargeOptions, CreateChargeResponse, CreateCustomerOptions, CreateCustomerResponse, CreatePixCustomer, CreatePixOptions, CreatePixResponse, CreateProjectOptions, CreateProjectResponse, CreateStaticQrCodeOptions, CreateStaticQrCodeResponse, CreateWithdrawalOptions, CreateWithdrawalResponse, Customer, DocumentType, type ErrorResponse, GetChargeResponse, GetTransactionResponse, ListChargesOptions, ListChargesResponse, ListCustomersOptions, ListCustomersResponse, ListProjectsOptions, ListProjectsResponse, NotificationType, type PaginatedResponse, type PaginationOptions, PaymentCompletedData, PaymentCompletedEvent, PaymentExpiredData, PaymentExpiredEvent, PaymentMethod, Pdev, PixCharge, PixKeyType, PixStatus, Project, RefundCompletedData, RefundCompletedEvent, type Response, SortBy, SortOrder, StaticQrCode, Transaction, TransactionPaymentMethod, TransactionStatus, TransactionType, WebhookEvent, WebhookEventType, WebhookHeaders, WebhookPayload, Withdrawal, WithdrawalCompletedData, WithdrawalCompletedEvent, WithdrawalFailedData, WithdrawalFailedEvent, WithdrawalReversedData, WithdrawalReversedEvent, WithdrawalStatus, parseWebhook, verifyWebhookSignature };
|
|
774
|
+
export { AccountDetail, AccountInfo, AccountStatus, BalanceAmount, BalanceBlockApprovedData, BalanceBlockApprovedEvent, BalanceBlockCreatedData, BalanceBlockCreatedEvent, BalanceBlockRejectedData, BalanceBlockRejectedEvent, BalanceDetail, Charge, ChargeStatus, CompanyDetail, CompanyStatus, CreateChargeOptions, CreateChargeResponse, CreateCustomerOptions, CreateCustomerResponse, CreatePixCustomer, CreatePixOptions, CreatePixResponse, CreateProjectOptions, CreateProjectResponse, CreateStaticQrCodeOptions, CreateStaticQrCodeResponse, CreateWithdrawalOptions, CreateWithdrawalResponse, Customer, DocumentType, type ErrorResponse, GetChargeResponse, GetTransactionResponse, ListChargesOptions, ListChargesResponse, ListCustomersOptions, ListCustomersResponse, ListProjectsOptions, ListProjectsResponse, NotificationType, type PaginatedResponse, type PaginationOptions, PaymentCompletedData, PaymentCompletedEvent, PaymentExpiredData, PaymentExpiredEvent, PaymentMethod, Pdev, PixCharge, PixKeyType, PixStatus, Project, RefundCompletedData, RefundCompletedEvent, type Response, SortBy, SortOrder, StaticQrCode, Transaction, TransactionPaymentMethod, TransactionStatus, TransactionType, WebhookEvent, WebhookEventType, WebhookHeaders, WebhookPayload, Withdrawal, WithdrawalCompletedData, WithdrawalCompletedEvent, WithdrawalFailedData, WithdrawalFailedEvent, WithdrawalReversedData, WithdrawalReversedEvent, WithdrawalStatus, parseWebhook, verifyWebhookSignature };
|
package/dist/index.d.mts
CHANGED
|
@@ -385,7 +385,7 @@ declare class Pdev {
|
|
|
385
385
|
/**
|
|
386
386
|
* Available webhook event types
|
|
387
387
|
*/
|
|
388
|
-
type WebhookEventType = 'payment_completed' | 'payment_expired' | 'refund_completed' | 'withdrawal_completed' | 'withdrawal_failed' | 'withdrawal_reversed' | 'balance_block_created';
|
|
388
|
+
type WebhookEventType = 'payment_completed' | 'payment_expired' | 'refund_completed' | 'withdrawal_completed' | 'withdrawal_failed' | 'withdrawal_reversed' | 'balance_block_created' | 'balance_block_approved' | 'balance_block_rejected';
|
|
389
389
|
/**
|
|
390
390
|
* Base webhook payload structure
|
|
391
391
|
*/
|
|
@@ -612,10 +612,76 @@ interface BalanceBlockCreatedData {
|
|
|
612
612
|
* Balance block created webhook event
|
|
613
613
|
*/
|
|
614
614
|
type BalanceBlockCreatedEvent = WebhookPayload<'balance_block_created', BalanceBlockCreatedData>;
|
|
615
|
+
/**
|
|
616
|
+
* Data payload for balance_block_approved event
|
|
617
|
+
*/
|
|
618
|
+
interface BalanceBlockApprovedData {
|
|
619
|
+
/** Balance block identifier */
|
|
620
|
+
blockId: string;
|
|
621
|
+
/** Transaction ID of the blocked transaction */
|
|
622
|
+
transactionId: string;
|
|
623
|
+
/** Environment where the block was created */
|
|
624
|
+
environment: 'production' | 'sandbox';
|
|
625
|
+
/** Blocked amount in BRL */
|
|
626
|
+
amount: number;
|
|
627
|
+
/** Currency code (e.g., "BRL") */
|
|
628
|
+
currency: string;
|
|
629
|
+
/** Type of block (med, judicial, administrative) */
|
|
630
|
+
blockType: 'med' | 'judicial' | 'administrative';
|
|
631
|
+
/** Block reference number */
|
|
632
|
+
referenceNumber: string;
|
|
633
|
+
/** Original reason for the block */
|
|
634
|
+
reason: string;
|
|
635
|
+
/** Reason for resolution (optional) */
|
|
636
|
+
resolutionReason: string | null;
|
|
637
|
+
/** Block status */
|
|
638
|
+
status: 'approved';
|
|
639
|
+
/** ISO 8601 timestamp of when block was created */
|
|
640
|
+
createdAt: string;
|
|
641
|
+
/** ISO 8601 timestamp of when block was resolved */
|
|
642
|
+
resolvedAt: string | null;
|
|
643
|
+
}
|
|
644
|
+
/**
|
|
645
|
+
* Balance block approved webhook event
|
|
646
|
+
*/
|
|
647
|
+
type BalanceBlockApprovedEvent = WebhookPayload<'balance_block_approved', BalanceBlockApprovedData>;
|
|
648
|
+
/**
|
|
649
|
+
* Data payload for balance_block_rejected event
|
|
650
|
+
*/
|
|
651
|
+
interface BalanceBlockRejectedData {
|
|
652
|
+
/** Balance block identifier */
|
|
653
|
+
blockId: string;
|
|
654
|
+
/** Transaction ID of the blocked transaction */
|
|
655
|
+
transactionId: string;
|
|
656
|
+
/** Environment where the block was created */
|
|
657
|
+
environment: 'production' | 'sandbox';
|
|
658
|
+
/** Blocked amount in BRL */
|
|
659
|
+
amount: number;
|
|
660
|
+
/** Currency code (e.g., "BRL") */
|
|
661
|
+
currency: string;
|
|
662
|
+
/** Type of block (med, judicial, administrative) */
|
|
663
|
+
blockType: 'med' | 'judicial' | 'administrative';
|
|
664
|
+
/** Block reference number */
|
|
665
|
+
referenceNumber: string;
|
|
666
|
+
/** Original reason for the block */
|
|
667
|
+
reason: string;
|
|
668
|
+
/** Reason for resolution (optional) */
|
|
669
|
+
resolutionReason: string | null;
|
|
670
|
+
/** Block status */
|
|
671
|
+
status: 'rejected';
|
|
672
|
+
/** ISO 8601 timestamp of when block was created */
|
|
673
|
+
createdAt: string;
|
|
674
|
+
/** ISO 8601 timestamp of when block was resolved */
|
|
675
|
+
resolvedAt: string | null;
|
|
676
|
+
}
|
|
677
|
+
/**
|
|
678
|
+
* Balance block rejected webhook event
|
|
679
|
+
*/
|
|
680
|
+
type BalanceBlockRejectedEvent = WebhookPayload<'balance_block_rejected', BalanceBlockRejectedData>;
|
|
615
681
|
/**
|
|
616
682
|
* Union type of all possible webhook events
|
|
617
683
|
*/
|
|
618
|
-
type WebhookEvent = PaymentCompletedEvent | PaymentExpiredEvent | RefundCompletedEvent | WithdrawalCompletedEvent | WithdrawalFailedEvent | WithdrawalReversedEvent | BalanceBlockCreatedEvent;
|
|
684
|
+
type WebhookEvent = PaymentCompletedEvent | PaymentExpiredEvent | RefundCompletedEvent | WithdrawalCompletedEvent | WithdrawalFailedEvent | WithdrawalReversedEvent | BalanceBlockCreatedEvent | BalanceBlockApprovedEvent | BalanceBlockRejectedEvent;
|
|
619
685
|
/**
|
|
620
686
|
* Webhook headers sent with each request
|
|
621
687
|
*/
|
|
@@ -705,4 +771,4 @@ interface WebhookHeaders {
|
|
|
705
771
|
declare function verifyWebhookSignature(payload: string, signature: string, secret: string): boolean;
|
|
706
772
|
declare function parseWebhook(payload: string): WebhookEvent | null;
|
|
707
773
|
//#endregion
|
|
708
|
-
export { AccountDetail, AccountInfo, AccountStatus, BalanceAmount, BalanceBlockCreatedData, BalanceBlockCreatedEvent, BalanceDetail, Charge, ChargeStatus, CompanyDetail, CompanyStatus, CreateChargeOptions, CreateChargeResponse, CreateCustomerOptions, CreateCustomerResponse, CreatePixCustomer, CreatePixOptions, CreatePixResponse, CreateProjectOptions, CreateProjectResponse, CreateStaticQrCodeOptions, CreateStaticQrCodeResponse, CreateWithdrawalOptions, CreateWithdrawalResponse, Customer, DocumentType, type ErrorResponse, GetChargeResponse, GetTransactionResponse, ListChargesOptions, ListChargesResponse, ListCustomersOptions, ListCustomersResponse, ListProjectsOptions, ListProjectsResponse, NotificationType, type PaginatedResponse, type PaginationOptions, PaymentCompletedData, PaymentCompletedEvent, PaymentExpiredData, PaymentExpiredEvent, PaymentMethod, Pdev, PixCharge, PixKeyType, PixStatus, Project, RefundCompletedData, RefundCompletedEvent, type Response, SortBy, SortOrder, StaticQrCode, Transaction, TransactionPaymentMethod, TransactionStatus, TransactionType, WebhookEvent, WebhookEventType, WebhookHeaders, WebhookPayload, Withdrawal, WithdrawalCompletedData, WithdrawalCompletedEvent, WithdrawalFailedData, WithdrawalFailedEvent, WithdrawalReversedData, WithdrawalReversedEvent, WithdrawalStatus, parseWebhook, verifyWebhookSignature };
|
|
774
|
+
export { AccountDetail, AccountInfo, AccountStatus, BalanceAmount, BalanceBlockApprovedData, BalanceBlockApprovedEvent, BalanceBlockCreatedData, BalanceBlockCreatedEvent, BalanceBlockRejectedData, BalanceBlockRejectedEvent, BalanceDetail, Charge, ChargeStatus, CompanyDetail, CompanyStatus, CreateChargeOptions, CreateChargeResponse, CreateCustomerOptions, CreateCustomerResponse, CreatePixCustomer, CreatePixOptions, CreatePixResponse, CreateProjectOptions, CreateProjectResponse, CreateStaticQrCodeOptions, CreateStaticQrCodeResponse, CreateWithdrawalOptions, CreateWithdrawalResponse, Customer, DocumentType, type ErrorResponse, GetChargeResponse, GetTransactionResponse, ListChargesOptions, ListChargesResponse, ListCustomersOptions, ListCustomersResponse, ListProjectsOptions, ListProjectsResponse, NotificationType, type PaginatedResponse, type PaginationOptions, PaymentCompletedData, PaymentCompletedEvent, PaymentExpiredData, PaymentExpiredEvent, PaymentMethod, Pdev, PixCharge, PixKeyType, PixStatus, Project, RefundCompletedData, RefundCompletedEvent, type Response, SortBy, SortOrder, StaticQrCode, Transaction, TransactionPaymentMethod, TransactionStatus, TransactionType, WebhookEvent, WebhookEventType, WebhookHeaders, WebhookPayload, Withdrawal, WithdrawalCompletedData, WithdrawalCompletedEvent, WithdrawalFailedData, WithdrawalFailedEvent, WithdrawalReversedData, WithdrawalReversedEvent, WithdrawalStatus, parseWebhook, verifyWebhookSignature };
|
package/dist/index.mjs
CHANGED
|
@@ -228,7 +228,9 @@ function isValidWebhookEvent(event) {
|
|
|
228
228
|
"withdrawal_completed",
|
|
229
229
|
"withdrawal_failed",
|
|
230
230
|
"withdrawal_reversed",
|
|
231
|
-
"balance_block_created"
|
|
231
|
+
"balance_block_created",
|
|
232
|
+
"balance_block_approved",
|
|
233
|
+
"balance_block_rejected"
|
|
232
234
|
].includes(obj.event);
|
|
233
235
|
}
|
|
234
236
|
/**
|