diff --git a/.changeset/tidy-comics-tall.md b/.changeset/tidy-comics-tall.md index c86d76af5..d966fceec 100644 --- a/.changeset/tidy-comics-tall.md +++ b/.changeset/tidy-comics-tall.md @@ -4,6 +4,4 @@ Add support for 3 missing endpoints in loyalties api. Corrected a typo in one of loyalties api method. - Added support for new endpoints: `GET /loyalties/{campaignId}/earning-rules/{earningRuleId}`, `POST /loyalties/{campaignId}/earning-rules/{earningRuleId}/enable` and `POST /loyalties/{campaignId}/earning-rules/{earningRuleId}/disable` [(examples available in readme.md)](..%2F..%2Fpackages%2Fsdk%2FREADME.md) - - - +- New exported types/interfaces: `LoyaltiesGetEarningRuleResponseBody`, `LoyaltiesEnableEarningRulesResponseBody`, `LoyaltiesDisableEarningRulesResponseBody`, `EarningRuleEvent`, `EarningRuleBase`, `EarningRuleLoyaltyFixed`, `EarningRuleLoyaltyProportionalOrder`, `EarningRuleLoyaltyProportionalOrderAmount`, `EarningRuleLoyaltyProportionalOrderTotalAmount`, `EarningRuleLoyaltyProportionalOrderMetadata`, `EarningRuleLoyaltyProportionalOrderItems`, `EarningRuleLoyaltyProportionalOrderItemsQuantity`, `EarningRuleLoyaltyProportionalOrderItemsAmount`, `EarningRuleLoyaltyProportionalOrderItemsSubtotalAmount`, `EarningRuleLoyaltyProportionalCustomer`, `EarningRuleLoyaltyProportionalCustomEvent`, `EarningRuleLoyaltyProportional` diff --git a/packages/sdk/src/types/Loyalties.ts b/packages/sdk/src/types/Loyalties.ts index 0b6309df8..34b1b175e 100644 --- a/packages/sdk/src/types/Loyalties.ts +++ b/packages/sdk/src/types/Loyalties.ts @@ -517,16 +517,6 @@ export type LoyaltiesDisableEarningRulesResponseBody = EarningRuleBase & { } // Domain types - -export type EarningRuleEvent = - | 'order.paid' - | 'customer.segment.entered' - | 'custom_event' - | 'customer.loyalty.tier.upgraded' - | 'customer.loyalty.tier.downgraded' - | 'customer.loyalty.tier.prolonged' - | 'customer.loyalty.tier.joined' - | 'customer.loyalty.tier.left' export interface EarningRuleBase { id: string created_at: string @@ -558,6 +548,16 @@ export interface EarningRuleBase { metadata: Record } +export type EarningRuleEvent = + | 'order.paid' + | 'customer.segment.entered' + | 'custom_event' + | 'customer.loyalty.tier.upgraded' + | 'customer.loyalty.tier.downgraded' + | 'customer.loyalty.tier.prolonged' + | 'customer.loyalty.tier.joined' + | 'customer.loyalty.tier.left' + export interface EarningRuleLoyaltyFixed { type: 'FIXED' points: number