@zenglobal/api-client 3.1.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
@@ -4966,6 +5067,86 @@ export type SiteInfo = {
4966
5067
  */
4967
5068
  locations: Array<LocationInfo>;
4968
5069
  };
5070
+ /**
5071
+ * Address information for a site search result.
5072
+ */
5073
+ export type SiteSearchAddress = {
5074
+ /**
5075
+ * Address line 1
5076
+ */
5077
+ address1: string;
5078
+ /**
5079
+ * Address line 2
5080
+ */
5081
+ address2: string;
5082
+ /**
5083
+ * City or suburb
5084
+ */
5085
+ city: string;
5086
+ /**
5087
+ * State name
5088
+ */
5089
+ state: string;
5090
+ /**
5091
+ * Postal code
5092
+ */
5093
+ postcode: string;
5094
+ };
5095
+ /**
5096
+ * Site search response.
5097
+ */
5098
+ export type SiteSearchResponse = {
5099
+ /**
5100
+ * Total number of matching records
5101
+ */
5102
+ total_records: ApiNumeric;
5103
+ /**
5104
+ * Maximum results returned
5105
+ */
5106
+ limit: ApiNumeric;
5107
+ /**
5108
+ * Matching sites
5109
+ */
5110
+ sites: Array<SiteSearchResult>;
5111
+ };
5112
+ /**
5113
+ * Lightweight site record returned by the search endpoint.
5114
+ * Contains only the fields needed for site identification and lookup chaining.
5115
+ */
5116
+ export type SiteSearchResult = {
5117
+ /**
5118
+ * Site code
5119
+ */
5120
+ sitecode: ApiNumeric;
5121
+ /**
5122
+ * Site name
5123
+ */
5124
+ name: string;
5125
+ /**
5126
+ * Salesforce CCode identifier
5127
+ */
5128
+ ccode: string | null;
5129
+ /**
5130
+ * Whether the site is active
5131
+ */
5132
+ active: boolean;
5133
+ /**
5134
+ * Site address
5135
+ */
5136
+ address: SiteSearchAddress;
5137
+ /**
5138
+ * Point of sale provider name
5139
+ */
5140
+ point_of_sale_provider: string | null;
5141
+ /**
5142
+ * Point of sale reseller name
5143
+ */
5144
+ point_of_sale_reseller: string | null;
5145
+ /**
5146
+ * Whether POS support is enabled
5147
+ */
5148
+ point_of_sale_support: boolean;
5149
+ };
4969
5150
  /**
4970
5151
  * Sites endpoint response.
4971
5152
  */
@@ -9435,6 +9616,72 @@ export type OfferUpdateResponses = {
9435
9616
  200: OfferResult;
9436
9617
  };
9437
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];
9438
9685
  export type OrderDeleteOrderData = {
9439
9686
  body: OrderDeleteRequest;
9440
9687
  path?: never;
@@ -9609,6 +9856,43 @@ export type SitesGetSitesResponses = {
9609
9856
  200: SitesResponse;
9610
9857
  };
9611
9858
  export type SitesGetSitesResponse = SitesGetSitesResponses[keyof SitesGetSitesResponses];
9859
+ export type SitesSearchSitesData = {
9860
+ body?: never;
9861
+ path?: never;
9862
+ query: {
9863
+ /**
9864
+ * Search query (required, minimum 1 character). Searches across site name (partial match), CCode (exact), and site code (exact).
9865
+ */
9866
+ q: string;
9867
+ /**
9868
+ * Restrict search to a specific field. When omitted, searches all fields.
9869
+ */
9870
+ field?: 'name' | 'ccode' | 'sitecode';
9871
+ /**
9872
+ * Maximum number of results to return (default 50, max 200)
9873
+ */
9874
+ limit?: number;
9875
+ };
9876
+ url: '/v1/sites/search';
9877
+ };
9878
+ export type SitesSearchSitesErrors = {
9879
+ /**
9880
+ * The server could not understand the request due to invalid syntax.
9881
+ */
9882
+ 400: ValidationError;
9883
+ /**
9884
+ * Access is unauthorized.
9885
+ */
9886
+ 401: InvalidAccessKeyError;
9887
+ };
9888
+ export type SitesSearchSitesError = SitesSearchSitesErrors[keyof SitesSearchSitesErrors];
9889
+ export type SitesSearchSitesResponses = {
9890
+ /**
9891
+ * The request has succeeded.
9892
+ */
9893
+ 200: SiteSearchResponse;
9894
+ };
9895
+ export type SitesSearchSitesResponse = SitesSearchSitesResponses[keyof SitesSearchSitesResponses];
9612
9896
  export type StripeGetStripeConfigData = {
9613
9897
  body?: never;
9614
9898
  path?: never;