@ziila/sdk 0.1.285 → 0.1.295

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.
@@ -95,6 +95,31 @@ export interface ZiilaConfig {
95
95
  theme?: Partial<ThemeStyles>;
96
96
  widgetUrl?: string;
97
97
  }
98
+ export interface CartItemData {
99
+ id: string;
100
+ name: string;
101
+ price: number;
102
+ originalPrice?: number;
103
+ currency?: string;
104
+ qty: number;
105
+ imageUrl?: string;
106
+ attributes?: string[];
107
+ }
108
+ export interface ProductCardData {
109
+ id: string;
110
+ uid: number;
111
+ name: string;
112
+ price: number;
113
+ currency?: string;
114
+ imageUrl?: string;
115
+ discountPercent?: number;
116
+ originalPrice?: number;
117
+ availableQty?: number | null;
118
+ manageStock?: boolean;
119
+ rating?: number;
120
+ reviewCount?: number;
121
+ hasVariants?: boolean;
122
+ }
98
123
  export interface AddToCartPayload {
99
124
  sku: string;
100
125
  /** The sku's new total quantity in the cart — never a delta. */
@@ -115,8 +140,21 @@ export interface CartUpdatedPayload {
115
140
  totalItems: number;
116
141
  grandTotal: number;
117
142
  }
143
+ export interface ViewCartPayload {
144
+ items: CartItemData[];
145
+ }
146
+ export interface ViewItemsListPayload {
147
+ items: ProductCardData[];
148
+ listId: string;
149
+ listName: string;
150
+ }
118
151
  export interface ProductViewedPayload {
119
- sku: string;
152
+ item: ProductCardData;
153
+ }
154
+ export interface SelectItemPayload {
155
+ item: ProductCardData;
156
+ listId: string;
157
+ listName: string;
120
158
  }
121
159
  export interface SearchPayload {
122
160
  query: string;
@@ -130,7 +168,7 @@ export interface LanguagePayload {
130
168
  language: string;
131
169
  dialect: string | null;
132
170
  }
133
- export type ZiilaEvent = 'ready' | 'conversationStarted' | 'languageChanged' | 'addToCart' | 'removeFromCart' | 'cartUpdated' | 'productViewed' | 'search' | 'error';
171
+ export type ZiilaEvent = 'ready' | 'conversationStarted' | 'languageChanged' | 'addToCart' | 'removeFromCart' | 'cartUpdated' | 'viewCart' | 'viewItemsList' | 'selectItem' | 'productViewed' | 'search' | 'error';
134
172
  export type ZiilaCommand = 'clear';
135
173
  export interface EventPayloadMap {
136
174
  ready: undefined;
@@ -139,6 +177,9 @@ export interface EventPayloadMap {
139
177
  addToCart: AddToCartPayload;
140
178
  removeFromCart: RemoveFromCartPayload;
141
179
  cartUpdated: CartUpdatedPayload;
180
+ viewCart: ViewCartPayload;
181
+ viewItemsList: ViewItemsListPayload;
182
+ selectItem: SelectItemPayload;
142
183
  productViewed: ProductViewedPayload;
143
184
  search: SearchPayload;
144
185
  error: ErrorPayload;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ziila/sdk",
3
- "version": "0.1.285",
3
+ "version": "0.1.295",
4
4
  "description": "Ziila Shopping Assistant SDK — embeddable widget loader and host-page bridge.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {