Skip to content

Commit ba834e1

Browse files
authored
fix: gracefully ignore data_export event
1 parent 1f65737 commit ba834e1

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ This server synchronizes your [Orb](https://www.withorb.com/) account to a Postg
3333
- [x] customer.credit_balance_depleted
3434
- [x] customer.credit_balance_dropped
3535
- [x] customer.edited
36+
- [x] data_exports.transfer_success (ignored)
3637
- [x] subscription.created
3738
- [x] subscription.started
3839
- [x] subscription.fixed_fee_quantity_updated

packages/orb-sync-lib/src/orb-sync.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,16 @@ export class OrbSync {
9090
this.orb.webhooks.verifySignature(payload, headers || {}, this.config.orbWebhookSecret);
9191
}
9292

93-
9493
const parsedData = JSON.parse(payload) as OrbWebhook;
9594
switch (parsedData.type) {
9695
// Test event, just ignore it
9796
case 'resource_event.test': {
9897
break;
9998
}
99+
// Data export events, just ignore them
100+
case 'data_exports.transfer_success': {
101+
break;
102+
}
100103
case 'customer.created':
101104
case 'customer.edited':
102105
case 'customer.credit_balance_depleted':

packages/orb-sync-lib/src/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ export type OrbWebhookType =
3131
| 'credit_note.marked_as_void'
3232
| 'resource_event.test'
3333
| 'subscription.usage_exceeded'
34-
| 'subscription.cost_exceeded';
34+
| 'subscription.cost_exceeded'
35+
| 'data_exports.transfer_success';
3536

3637
export type OrbWebhook = {
3738
// Unique to this WebhookEvent resource, and can be used for idempotency (process-once) purposes

0 commit comments

Comments
 (0)