Skip to content

Commit 44439bd

Browse files
authored
Merge pull request #65 from FacturAPI/chore/webhook_type
chore(webhook): add type for new webhook
2 parents 5b0a860 + f5f9724 commit 44439bd

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

8+
## [4.8.0] 2025-04-10
9+
10+
### Added
11+
12+
- Webhook events: `invoice.created_from_dashboard` and `customer.edit_link_completed`
13+
814
## [4.7.0] 2025-04-04
915

1016
### Added

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "facturapi",
3-
"version": "4.7.0",
3+
"version": "4.8.0",
44
"description": "Librería oficial de Facturapi. Crea CFDIs timbrados y enviados al SAT, XML y PDF",
55
"main": "dist/index.cjs.js",
66
"module": "dist/index.es.js",

src/types/webhook.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
import { Receipt } from './receipt';
22
import { Invoice } from './invoice';
3+
import { Customer } from './customer';
34

45
export enum ApiEventType {
56
RECEIPT_SELF_INVOICE_COMPLETE = 'receipt.self_invoice_complete',
67
INVOICE_CANCELLATION_STATUS_UPDATED = 'invoice.cancellation_status_updated',
78
RECEIPT_STATUS_UPDATED = 'receipt.status_updated',
89
GLOBAL_INVOICE = 'invoice.global_invoice_created',
910
INVOICES_STATUS_UPDATED = 'invoice.status_updated',
11+
INVOICES_CREATED_FROM_DASHBOARD = 'invoice.created_from_dashboard',
12+
CUSTOMER_EDIT_LINK_COMPLETED = 'customer.edit_link_completed',
1013
}
1114

1215
export enum ApiEventDataType {
1316
RECEIPT = 'receipt',
1417
INVOICE = 'invoice',
18+
CUSTOMER = 'customer',
1519
}
1620

1721
type ApiEventTypeMap = {
@@ -20,12 +24,15 @@ type ApiEventTypeMap = {
2024
[ApiEventType.RECEIPT_STATUS_UPDATED]: ApiEventDataType.RECEIPT;
2125
[ApiEventType.GLOBAL_INVOICE]: ApiEventDataType.INVOICE;
2226
[ApiEventType.INVOICES_STATUS_UPDATED]: ApiEventDataType.INVOICE;
27+
[ApiEventType.INVOICES_CREATED_FROM_DASHBOARD]: ApiEventDataType.INVOICE;
28+
[ApiEventType.CUSTOMER_EDIT_LINK_COMPLETED]: ApiEventDataType.CUSTOMER;
2329
'': '';
2430
};
2531

2632
type ApiEventDataTypeMap = {
2733
[ApiEventDataType.RECEIPT]: Receipt;
2834
[ApiEventDataType.INVOICE]: Invoice;
35+
[ApiEventDataType.CUSTOMER]: Customer;
2936
'': any;
3037
};
3138

0 commit comments

Comments
 (0)