@wix/himalaya-cli 0.1611.0 → 0.1613.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.
@@ -910,6 +910,7 @@ export declare function segmentedControl(props: {
910
910
  export declare function carousel(props: {
911
911
  items: Component[];
912
912
  paged?: boolean;
913
+ /** #4673 — `$service:` page index, two-way with onChange (literal or `paged` bound pages). */
913
914
  currentIndexPath?: string;
914
915
  currentIndex?: number;
915
916
  onChange?: ActionShape;
@@ -925,6 +926,10 @@ export declare function pager(props: {
925
926
  onChange?: ActionShape;
926
927
  showIndicator?: boolean;
927
928
  liveWindow?: number;
929
+ /** #4673 — `$service:` page index, two-way with onChange. */
930
+ currentIndexPath?: string;
931
+ /** #4673 — `$service:` array; pages[0] is the page template ($item.* substitution). */
932
+ pagesPath?: string;
928
933
  }, opts?: {
929
934
  id?: string;
930
935
  }): Component;
@@ -1278,7 +1278,12 @@ export interface SegmentedControlProps {
1278
1278
  export interface CarouselProps {
1279
1279
  /** Opt-in paging for itemsPath; absent preserves the horizontal card rail. */
1280
1280
  paged?: boolean;
1281
- /** Worker-driven page index; clamped to the current page count. */
1281
+ /** #4673 — `$service:` path to the page index, two-way with `onChange`: a CHANGE of the resolved
1282
+ * value animates the carousel there (instantly under reduced motion); a swipe still fires
1283
+ * `onChange` with `args.index`, which the worker writes back. Out of range ⇒ clamped; not an
1284
+ * integer ⇒ ignored; equal to the current page ⇒ nothing; a move the binding made fires no
1285
+ * `onChange`. Drives literal `items` and `paged` bound ones; inside a bound row a substituted
1286
+ * literal places the page like `currentIndex`. A rail (`itemsPath` without `paged`) ignores it. */
1282
1287
  currentIndexPath?: string;
1283
1288
  items: Component[];
1284
1289
  currentIndex?: number;
@@ -1296,6 +1301,12 @@ export interface PagerProps {
1296
1301
  showIndicator?: boolean;
1297
1302
  /** RFC 0073 §4.5 — as {@link CarouselProps.liveWindow}. */
1298
1303
  liveWindow?: number;
1304
+ /** #4673 — as {@link CarouselProps.currentIndexPath}: a worker-driven page, two-way with `onChange`. */
1305
+ currentIndexPath?: string;
1306
+ /** #4673 — `$service:` path to an array: `pages[0]` is the page TEMPLATE, instantiated once per
1307
+ * element with `$item.` substitution (as `Carousel.itemsPath`). Pages are keyed by `$item.id`, so
1308
+ * the page on screen stays on screen when items are inserted before it. */
1309
+ pagesPath?: string;
1299
1310
  }
1300
1311
  export interface StepIndicatorProps {
1301
1312
  steps: string[];
@@ -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";
@@ -14883,6 +14883,7 @@ var propsOf = (c) => {
14883
14883
  return isRec(p) ? p : {};
14884
14884
  };
14885
14885
  var hasItemsPath = (props) => typeof props.itemsPath === "string" && props.itemsPath !== "";
14886
+ var hasPagesPath = (props) => typeof props.pagesPath === "string" && /^\$(service|app):/.test(props.pagesPath);
14886
14887
  function childComponents(value, path, inTemplate, out) {
14887
14888
  if (Array.isArray(value)) {
14888
14889
  value.forEach((v, i) => childComponents(v, `${path}[${i}]`, inTemplate, out));
@@ -14899,9 +14900,10 @@ function childrenOf(c, path, inTemplate) {
14899
14900
  const props = propsOf(c);
14900
14901
  const type = typeOf(c);
14901
14902
  const boundList = (type === "LazyList" || type === "Grid" || type === "Carousel") && hasItemsPath(props);
14903
+ const boundPages = type === "Pager" && hasPagesPath(props);
14902
14904
  const out = [];
14903
14905
  for (const [k, v] of Object.entries(props)) {
14904
- const templ = inTemplate || /Template$/.test(k) || boundList && k === "items";
14906
+ const templ = inTemplate || /Template$/.test(k) || boundList && k === "items" || boundPages && k === "pages";
14905
14907
  childComponents(v, `${path}.body.props.${k}`, templ, out);
14906
14908
  }
14907
14909
  return out;
@@ -14949,7 +14951,7 @@ function mountable(c, inTemplate = false) {
14949
14951
  const pages = type === "Carousel" ? props.items : props.pages;
14950
14952
  const perPage = Array.isArray(pages) ? pages.map((p) => isComponent(p) ? mountable(p) : 0) : [];
14951
14953
  const window = typeof props.liveWindow === "number" && props.liveWindow > 0 ? Math.floor(props.liveWindow) : 0;
14952
- const bound = type === "Carousel" && hasItemsPath(props);
14954
+ const bound = type === "Carousel" ? hasItemsPath(props) : hasPagesPath(props);
14953
14955
  if (bound) {
14954
14956
  const template = perPage[0] ?? 0;
14955
14957
  if (template === 0) return 0;
@@ -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