From 3dbf82aaa0434e7722a07c64d7796ca74f1a10bc Mon Sep 17 00:00:00 2001 From: Aaron Campbell <51107902+sleepdotexe@users.noreply.github.com> Date: Fri, 19 Jul 2024 06:07:51 +1000 Subject: [PATCH] [ts] Add discount webhook topics (#659) Fixes: https://github.com/MONEI/Shopify-api-node/issues/658 --- types/index.d.ts | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/types/index.d.ts b/types/index.d.ts index 6b28b04..44c1d9e 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -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' @@ -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' @@ -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; + } }