@pague-dev/sdk-node 2.0.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 +4 -1
- package/dist/index.d.cts +98 -3
- package/dist/index.d.mts +98 -3
- package/dist/index.mjs +4 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -227,7 +227,10 @@ function isValidWebhookEvent(event) {
|
|
|
227
227
|
"refund_completed",
|
|
228
228
|
"withdrawal_completed",
|
|
229
229
|
"withdrawal_failed",
|
|
230
|
-
"withdrawal_reversed"
|
|
230
|
+
"withdrawal_reversed",
|
|
231
|
+
"balance_block_created",
|
|
232
|
+
"balance_block_approved",
|
|
233
|
+
"balance_block_rejected"
|
|
231
234
|
].includes(obj.event);
|
|
232
235
|
}
|
|
233
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';
|
|
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
|
*/
|
|
@@ -583,10 +583,105 @@ type WithdrawalFailedEvent = WebhookPayload<'withdrawal_failed', WithdrawalFaile
|
|
|
583
583
|
* Withdrawal reversed webhook event
|
|
584
584
|
*/
|
|
585
585
|
type WithdrawalReversedEvent = WebhookPayload<'withdrawal_reversed', WithdrawalReversedData>;
|
|
586
|
+
/**
|
|
587
|
+
* Data payload for balance_block_created event
|
|
588
|
+
*/
|
|
589
|
+
interface BalanceBlockCreatedData {
|
|
590
|
+
/** Balance block identifier */
|
|
591
|
+
blockId: string;
|
|
592
|
+
/** Transaction ID of the blocked transaction */
|
|
593
|
+
transactionId: string;
|
|
594
|
+
/** Environment where the block was created */
|
|
595
|
+
environment: 'production' | 'sandbox';
|
|
596
|
+
/** Blocked amount in BRL */
|
|
597
|
+
amount: number;
|
|
598
|
+
/** Currency code (e.g., "BRL") */
|
|
599
|
+
currency: string;
|
|
600
|
+
/** Type of block (med, judicial, administrative) */
|
|
601
|
+
blockType: 'med' | 'judicial' | 'administrative';
|
|
602
|
+
/** Block reference number */
|
|
603
|
+
referenceNumber: string;
|
|
604
|
+
/** Reason for the block */
|
|
605
|
+
reason: string;
|
|
606
|
+
/** Block status */
|
|
607
|
+
status: 'awaiting_response';
|
|
608
|
+
/** ISO 8601 timestamp of when block was created */
|
|
609
|
+
createdAt: string;
|
|
610
|
+
}
|
|
611
|
+
/**
|
|
612
|
+
* Balance block created webhook event
|
|
613
|
+
*/
|
|
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>;
|
|
586
681
|
/**
|
|
587
682
|
* Union type of all possible webhook events
|
|
588
683
|
*/
|
|
589
|
-
type WebhookEvent = PaymentCompletedEvent | PaymentExpiredEvent | RefundCompletedEvent | WithdrawalCompletedEvent | WithdrawalFailedEvent | WithdrawalReversedEvent;
|
|
684
|
+
type WebhookEvent = PaymentCompletedEvent | PaymentExpiredEvent | RefundCompletedEvent | WithdrawalCompletedEvent | WithdrawalFailedEvent | WithdrawalReversedEvent | BalanceBlockCreatedEvent | BalanceBlockApprovedEvent | BalanceBlockRejectedEvent;
|
|
590
685
|
/**
|
|
591
686
|
* Webhook headers sent with each request
|
|
592
687
|
*/
|
|
@@ -676,4 +771,4 @@ interface WebhookHeaders {
|
|
|
676
771
|
declare function verifyWebhookSignature(payload: string, signature: string, secret: string): boolean;
|
|
677
772
|
declare function parseWebhook(payload: string): WebhookEvent | null;
|
|
678
773
|
//#endregion
|
|
679
|
-
export { AccountDetail, AccountInfo, AccountStatus, BalanceAmount, 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';
|
|
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
|
*/
|
|
@@ -583,10 +583,105 @@ type WithdrawalFailedEvent = WebhookPayload<'withdrawal_failed', WithdrawalFaile
|
|
|
583
583
|
* Withdrawal reversed webhook event
|
|
584
584
|
*/
|
|
585
585
|
type WithdrawalReversedEvent = WebhookPayload<'withdrawal_reversed', WithdrawalReversedData>;
|
|
586
|
+
/**
|
|
587
|
+
* Data payload for balance_block_created event
|
|
588
|
+
*/
|
|
589
|
+
interface BalanceBlockCreatedData {
|
|
590
|
+
/** Balance block identifier */
|
|
591
|
+
blockId: string;
|
|
592
|
+
/** Transaction ID of the blocked transaction */
|
|
593
|
+
transactionId: string;
|
|
594
|
+
/** Environment where the block was created */
|
|
595
|
+
environment: 'production' | 'sandbox';
|
|
596
|
+
/** Blocked amount in BRL */
|
|
597
|
+
amount: number;
|
|
598
|
+
/** Currency code (e.g., "BRL") */
|
|
599
|
+
currency: string;
|
|
600
|
+
/** Type of block (med, judicial, administrative) */
|
|
601
|
+
blockType: 'med' | 'judicial' | 'administrative';
|
|
602
|
+
/** Block reference number */
|
|
603
|
+
referenceNumber: string;
|
|
604
|
+
/** Reason for the block */
|
|
605
|
+
reason: string;
|
|
606
|
+
/** Block status */
|
|
607
|
+
status: 'awaiting_response';
|
|
608
|
+
/** ISO 8601 timestamp of when block was created */
|
|
609
|
+
createdAt: string;
|
|
610
|
+
}
|
|
611
|
+
/**
|
|
612
|
+
* Balance block created webhook event
|
|
613
|
+
*/
|
|
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>;
|
|
586
681
|
/**
|
|
587
682
|
* Union type of all possible webhook events
|
|
588
683
|
*/
|
|
589
|
-
type WebhookEvent = PaymentCompletedEvent | PaymentExpiredEvent | RefundCompletedEvent | WithdrawalCompletedEvent | WithdrawalFailedEvent | WithdrawalReversedEvent;
|
|
684
|
+
type WebhookEvent = PaymentCompletedEvent | PaymentExpiredEvent | RefundCompletedEvent | WithdrawalCompletedEvent | WithdrawalFailedEvent | WithdrawalReversedEvent | BalanceBlockCreatedEvent | BalanceBlockApprovedEvent | BalanceBlockRejectedEvent;
|
|
590
685
|
/**
|
|
591
686
|
* Webhook headers sent with each request
|
|
592
687
|
*/
|
|
@@ -676,4 +771,4 @@ interface WebhookHeaders {
|
|
|
676
771
|
declare function verifyWebhookSignature(payload: string, signature: string, secret: string): boolean;
|
|
677
772
|
declare function parseWebhook(payload: string): WebhookEvent | null;
|
|
678
773
|
//#endregion
|
|
679
|
-
export { AccountDetail, AccountInfo, AccountStatus, BalanceAmount, 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
|
@@ -227,7 +227,10 @@ function isValidWebhookEvent(event) {
|
|
|
227
227
|
"refund_completed",
|
|
228
228
|
"withdrawal_completed",
|
|
229
229
|
"withdrawal_failed",
|
|
230
|
-
"withdrawal_reversed"
|
|
230
|
+
"withdrawal_reversed",
|
|
231
|
+
"balance_block_created",
|
|
232
|
+
"balance_block_approved",
|
|
233
|
+
"balance_block_rejected"
|
|
231
234
|
].includes(obj.event);
|
|
232
235
|
}
|
|
233
236
|
/**
|