@zenglobal/api-client 4.0.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3626,6 +3626,90 @@ export type OfferDeleteResult = {
3626
3626
  result: number;
3627
3627
  errormessage: string;
3628
3628
  };
3629
+ export type OfferDetailAmount = {
3630
+ type: string;
3631
+ value: number;
3632
+ };
3633
+ export type OfferDetailBirthday = {
3634
+ enabled: boolean;
3635
+ delta_days?: number;
3636
+ direction?: string;
3637
+ };
3638
+ export type OfferDetailConditions = {
3639
+ active_on?: string;
3640
+ expires_on?: string;
3641
+ minimum_trigger_amount: number;
3642
+ maximum_trigger_amount: number;
3643
+ limits: OfferDetailLimits;
3644
+ time_of_day?: OfferDetailTimeOfDay;
3645
+ birthday: OfferDetailBirthday;
3646
+ new_member_window: OfferDetailNewMemberWindow;
3647
+ trigger_days_valid_after?: number;
3648
+ filters: OfferDetailFilters;
3649
+ };
3650
+ export type OfferDetailDiscountItem = {
3651
+ number?: string;
3652
+ type?: string;
3653
+ };
3654
+ export type OfferDetailEffect = {
3655
+ type: string;
3656
+ amount: OfferDetailAmount;
3657
+ apply_to: string;
3658
+ apply_upto_quantity: number;
3659
+ apply_to_items: Array<string>;
3660
+ per_item: boolean;
3661
+ points_multiplier: number;
3662
+ discount_item: OfferDetailDiscountItem;
3663
+ department: number;
3664
+ };
3665
+ export type OfferDetailFilters = {
3666
+ site?: OfferFilterValue;
3667
+ location?: OfferFilterValue;
3668
+ location_type?: OfferFilterValue;
3669
+ region?: OfferFilterValue;
3670
+ state?: OfferFilterValue;
3671
+ day_of_week?: OfferFilterValue;
3672
+ };
3673
+ export type OfferDetailLimits = {
3674
+ number_allowed_per_card?: number;
3675
+ number_allowed_per_site?: number;
3676
+ every?: string;
3677
+ };
3678
+ export type OfferDetailNewMemberWindow = {
3679
+ start?: string;
3680
+ end?: string;
3681
+ };
3682
+ /**
3683
+ * Full offer detail returned by GET /v1/offers/{id}
3684
+ */
3685
+ export type OfferDetailResponse = {
3686
+ id: number;
3687
+ description?: string;
3688
+ enabled: boolean;
3689
+ reference?: string;
3690
+ comment?: string;
3691
+ loyalty_only: boolean;
3692
+ auto_applied: boolean;
3693
+ image_url?: string;
3694
+ updated_at?: string;
3695
+ conditions: OfferDetailConditions;
3696
+ effect: OfferDetailEffect;
3697
+ targeting: OfferDetailTargeting;
3698
+ linked_to: boolean;
3699
+ card_active: boolean;
3700
+ card_complete: boolean;
3701
+ event_id?: number;
3702
+ };
3703
+ export type OfferDetailTargeting = {
3704
+ card_type_flag?: string;
3705
+ loyalty_card_types: Array<number | null>;
3706
+ group_flag?: string;
3707
+ groups: Array<number | null>;
3708
+ };
3709
+ export type OfferDetailTimeOfDay = {
3710
+ start_hour: string;
3711
+ end_hour: string;
3712
+ };
3629
3713
  export type OfferEffect = {
3630
3714
  /**
3631
3715
  * The type and amount of discount offered with the offer
@@ -3642,6 +3726,10 @@ export type OfferEffect = {
3642
3726
  */
3643
3727
  apply_to_items?: Array<string>;
3644
3728
  };
3729
+ export type OfferFilterValue = {
3730
+ operator: string;
3731
+ values: Array<number>;
3732
+ };
3645
3733
  /**
3646
3734
  * The limits imposed upon the offer
3647
3735
  */
@@ -3755,6 +3843,19 @@ export type OfferResult = {
3755
3843
  */
3756
3844
  id: string;
3757
3845
  };
3846
+ export type OfferSearchResponse = {
3847
+ total_records: number;
3848
+ limit: number;
3849
+ results: Array<OfferSearchResult>;
3850
+ };
3851
+ export type OfferSearchResult = {
3852
+ id: number;
3853
+ description?: string;
3854
+ reference?: string;
3855
+ enabled: boolean;
3856
+ active_on?: string;
3857
+ expires_on?: string;
3858
+ };
3758
3859
  /**
3759
3860
  * The type of offer discount
3760
3861
  * * `fixed_per_item` - Each item in the apply to list should be set to this dollar amount
@@ -9515,6 +9616,72 @@ export type OfferUpdateResponses = {
9515
9616
  200: OfferResult;
9516
9617
  };
9517
9618
  export type OfferUpdateResponse = OfferUpdateResponses[keyof OfferUpdateResponses];
9619
+ export type OffersSearchData = {
9620
+ body?: never;
9621
+ path?: never;
9622
+ query: {
9623
+ /**
9624
+ * Search term to match against reference and/or description
9625
+ */
9626
+ q: string;
9627
+ /**
9628
+ * Constrain search to a specific field
9629
+ */
9630
+ field?: 'reference' | 'description';
9631
+ /**
9632
+ * Maximum number of results to return (default: 50)
9633
+ */
9634
+ limit?: number;
9635
+ };
9636
+ url: '/v1/offers/search';
9637
+ };
9638
+ export type OffersSearchErrors = {
9639
+ /**
9640
+ * The server could not understand the request due to invalid syntax.
9641
+ */
9642
+ 400: ValidationError;
9643
+ /**
9644
+ * Access is unauthorized.
9645
+ */
9646
+ 401: InvalidAccessKeyError;
9647
+ };
9648
+ export type OffersSearchError = OffersSearchErrors[keyof OffersSearchErrors];
9649
+ export type OffersSearchResponses = {
9650
+ /**
9651
+ * The request has succeeded.
9652
+ */
9653
+ 200: OfferSearchResponse;
9654
+ };
9655
+ export type OffersSearchResponse = OffersSearchResponses[keyof OffersSearchResponses];
9656
+ export type OffersGetByIdData = {
9657
+ body?: never;
9658
+ path: {
9659
+ /**
9660
+ * Unique identifier of the offer
9661
+ */
9662
+ id: number;
9663
+ };
9664
+ query?: never;
9665
+ url: '/v1/offers/{id}';
9666
+ };
9667
+ export type OffersGetByIdErrors = {
9668
+ /**
9669
+ * The server could not understand the request due to invalid syntax.
9670
+ */
9671
+ 400: ValidationError;
9672
+ /**
9673
+ * Access is unauthorized.
9674
+ */
9675
+ 401: InvalidAccessKeyError;
9676
+ };
9677
+ export type OffersGetByIdError = OffersGetByIdErrors[keyof OffersGetByIdErrors];
9678
+ export type OffersGetByIdResponses = {
9679
+ /**
9680
+ * The request has succeeded.
9681
+ */
9682
+ 200: OfferDetailResponse;
9683
+ };
9684
+ export type OffersGetByIdResponse = OffersGetByIdResponses[keyof OffersGetByIdResponses];
9518
9685
  export type OrderDeleteOrderData = {
9519
9686
  body: OrderDeleteRequest;
9520
9687
  path?: never;