@wix/himalaya-cli 0.1610.0 → 0.1612.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.
@@ -1,4 +1,4 @@
1
- import { type WixCallOptions } from "./index.js";
1
+ import { type WixCallOptions, type WixLoyaltyAccount } from "./index.js";
2
2
  export interface LoyaltyOverview {
3
3
  balance?: number;
4
4
  earned?: number;
@@ -48,9 +48,5 @@ export declare function getLoyaltyBffDashboard(limit?: number): Promise<LoyaltyD
48
48
  * @scope member
49
49
  */
50
50
  export declare function getCurrentMemberLoyaltyAccount(readOptions?: WixCallOptions): Promise<{
51
- account?: {
52
- points?: {
53
- balance?: number;
54
- };
55
- };
51
+ account?: WixLoyaltyAccount;
56
52
  }>;
@@ -41,9 +41,11 @@ export interface WixLoyaltyImage {
41
41
  export interface WixLoyaltyRewardConfig {
42
42
  tierId?: string;
43
43
  costInPoints?: number;
44
- amount?: number;
44
+ amount?: string | number;
45
45
  percentage?: number;
46
46
  }
47
+ /** One reward price row: what the reward costs a member on tier `tierId` (absent = the base tier). */
48
+ export type WixLoyaltyTierConfig = WixLoyaltyRewardConfig;
47
49
  export interface WixLoyaltyProgram {
48
50
  id?: string;
49
51
  name?: string;
@@ -53,19 +55,28 @@ export interface WixLoyaltyProgram {
53
55
  customName?: string;
54
56
  icon?: WixLoyaltyImage;
55
57
  };
58
+ /** Which premium loyalty features the site's plan unlocks. Absent on older responses. */
59
+ premiumFeatures?: {
60
+ loyaltyProgram?: boolean;
61
+ tiers?: boolean;
62
+ pointsExpiration?: boolean;
63
+ };
64
+ /** The program-level expiry POLICY (not a member's date — that is `WixLoyaltyAccount.pointsExpiration`). */
65
+ pointsExpiration?: {
66
+ status?: string;
67
+ monthsOfInactivity?: number;
68
+ expiringPointsPercentage?: number;
69
+ };
56
70
  }
57
71
  export interface WixLoyaltyReward {
58
72
  id: string;
59
73
  name?: string;
74
+ /** DISCOUNT_AMOUNT | COUPON_REWARD | COUPON | SPI_DISCOUNT_AMOUNT | … */
60
75
  type?: string;
61
76
  /** Legacy adapter field. REST costs live in the reward's tier configurations. */
62
77
  requiredPoints?: number;
63
78
  discountAmount?: {
64
- configsByTier?: {
65
- tierId?: string;
66
- costInPoints?: number;
67
- amount?: string;
68
- }[];
79
+ configsByTier?: WixLoyaltyRewardConfig[];
69
80
  };
70
81
  couponReward?: {
71
82
  fixedAmount?: {
@@ -80,6 +91,55 @@ export interface WixLoyaltyReward {
80
91
  };
81
92
  active?: boolean;
82
93
  }
94
+ /** The signed-in member's loyalty account (wix.loyalty.v1.account, `/my-account`). */
95
+ export interface WixLoyaltyAccount {
96
+ id?: string;
97
+ points?: {
98
+ balance?: number;
99
+ earned?: number;
100
+ adjusted?: number;
101
+ redeemed?: number;
102
+ expired?: number;
103
+ };
104
+ /** The member's current tier; absent or without `id` while on the base tier. */
105
+ tier?: {
106
+ id?: string;
107
+ points?: number;
108
+ };
109
+ /** The member's own expiry — when and how many points lapse next. */
110
+ pointsExpiration?: {
111
+ expirationDate?: string;
112
+ expiringPointsAmount?: number;
113
+ };
114
+ rewardAvailable?: boolean;
115
+ }
116
+ /** The tiers program: settings (ACTIVE | PAUSED, the base tier's definition) plus the custom tiers. */
117
+ export interface WixLoyaltyTiersProgram {
118
+ tiers?: WixLoyaltyTier[];
119
+ programSettings?: {
120
+ status?: string;
121
+ baseTierDefinition?: {
122
+ name?: string;
123
+ description?: string;
124
+ icon?: unknown;
125
+ };
126
+ rollingWindow?: {
127
+ durationInMonths?: number;
128
+ };
129
+ };
130
+ }
131
+ /** A reward the member already claimed as a coupon (wix.loyalty.v1.coupon). */
132
+ export interface WixLoyaltyCoupon {
133
+ id?: string;
134
+ rewardName?: string;
135
+ /** ACTIVE | APPLIED | DELETED */
136
+ status?: string;
137
+ couponReference?: {
138
+ couponId?: string;
139
+ code?: string;
140
+ deleted?: boolean;
141
+ };
142
+ }
83
143
  export interface WixLoyaltyTier {
84
144
  /** REST returns `id` (proto `_id`). */
85
145
  id?: string;
@@ -128,4 +188,16 @@ export declare function listLoyaltyTiers(readOptions?: WixCallOptions): Promise<
128
188
  export declare function listLoyaltyEarningRules(readOptions?: WixCallOptions): Promise<{
129
189
  earningRules?: WixLoyaltyEarningRule[];
130
190
  }>;
191
+ /** GET /loyalty-tiers/v1/tiers/program → { tiers, programSettings }. The custom tiers plus the
192
+ * settings that carry the BASE tier's name — the one a member with no `tier.id` is on.
193
+ *
194
+ * @scope visitor — readable without signing in. */
195
+ export declare function getLoyaltyTiersProgram(readOptions?: WixCallOptions): Promise<WixLoyaltyTiersProgram>;
196
+ /** GET /loyalty-coupons/v1/coupons/my-coupons → { loyaltyCoupons }. The member's claimed
197
+ * rewards; an ACTIVE, undeleted one still counts as a reward available to use.
198
+ *
199
+ * @scope member — requires a signed-in site member. */
200
+ export declare function listMyLoyaltyCoupons(readOptions?: WixCallOptions): Promise<{
201
+ loyaltyCoupons?: WixLoyaltyCoupon[];
202
+ }>;
131
203
  export * from "./extensions.js";
@@ -42,13 +42,21 @@ function listLoyaltyTiers(readOptions) {
42
42
  function listLoyaltyEarningRules(readOptions) {
43
43
  return wixCall("GET", "/_api/loyalty-earning-rules/v1/earning-rules/rules", void 0, readOptions);
44
44
  }
45
+ function getLoyaltyTiersProgram(readOptions) {
46
+ return wixCall("GET", "/loyalty-tiers/v1/tiers/program", void 0, readOptions);
47
+ }
48
+ function listMyLoyaltyCoupons(readOptions) {
49
+ return wixCall("GET", "/loyalty-coupons/v1/coupons/my-coupons", void 0, readOptions);
50
+ }
45
51
  export {
46
52
  getCurrentMemberLoyaltyAccount,
47
53
  getLoyaltyBffDashboard,
48
54
  getLoyaltyProgram,
55
+ getLoyaltyTiersProgram,
49
56
  listLoyaltyEarningRules,
50
57
  listLoyaltyRewards,
51
58
  listLoyaltyTiers,
59
+ listMyLoyaltyCoupons,
52
60
  wixCall
53
61
  };
54
62
  //# sourceMappingURL=wix-loyalty.mjs.map