Skip to content

Commit

Permalink
[ts] Add discount webhook topics (#659)
Browse files Browse the repository at this point in the history
Fixes: #658
  • Loading branch information
sleepdotexe authored Jul 18, 2024
1 parent 159c2e7 commit 3dbf82a
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3233,6 +3233,11 @@ declare namespace Shopify {
| 'customers/update'
| 'customers_email_marketing_consent/update'
| 'customers_marketing_consent/update'
| 'discounts/create'
| 'discounts/delete'
| 'discounts/redeemcode_added'
| 'discounts/redeemcode_removed'
| 'discounts/update'
| 'disputes/create'
| 'disputes/update'
| 'domains/create'
Expand Down Expand Up @@ -3399,6 +3404,16 @@ declare namespace Shopify {
? ICustomerSavedSearch
: T extends 'customer_groups/delete'
? IDeletedItem
: T extends 'discounts/create'
? IDiscountUpsertWebhook
: T extends 'discounts/delete'
? IDiscountDeleteWebhook
: T extends 'discounts/redeemcode_added'
? IDiscountRedeemCodeWebhook
: T extends 'discounts/redeemcode_removed'
? IDiscountRedeemCodeWebhook
: T extends 'discounts/update'
? IDiscountUpsertWebhook
: T extends 'draft_orders/create'
? IDraftOrder
: T extends 'draft_orders/update'
Expand Down Expand Up @@ -3528,4 +3543,28 @@ declare namespace Shopify {
min_delivery_date?: string;
max_delivery_date?: string;
}

type DiscountStatus = 'ACTIVE' | 'EXPIRED' | 'SCHEDULED';

interface IDiscountUpsertWebhook {
admin_graphql_api_id: string;
title: string;
status: DiscountStatus;
created_at: string;
updated_at: string;
}

interface IDiscountDeleteWebhook {
admin_graphql_api_id: string;
deleted_at: string;
}

interface IDiscountRedeemCodeWebhook {
admin_graphql_api_id: string;
redeem_code: {
id: string;
code: string;
};
updated_at: string;
}
}

0 comments on commit 3dbf82a

Please sign in to comment.