@pisell/pisellos 0.0.5
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.
- package/README.md +180 -0
- package/dist/core/index.d.ts +30 -0
- package/dist/core/index.js +360 -0
- package/dist/effects/index.d.ts +17 -0
- package/dist/effects/index.js +162 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +17 -0
- package/dist/modules/Account/index.d.ts +21 -0
- package/dist/modules/Account/index.js +212 -0
- package/dist/modules/Account/types.d.ts +41 -0
- package/dist/modules/Account/types.js +19 -0
- package/dist/modules/BaseModule.d.ts +11 -0
- package/dist/modules/BaseModule.js +27 -0
- package/dist/modules/Cart/index.d.ts +33 -0
- package/dist/modules/Cart/index.js +242 -0
- package/dist/modules/Cart/types.d.ts +35 -0
- package/dist/modules/Cart/types.js +19 -0
- package/dist/modules/Date/index.d.ts +17 -0
- package/dist/modules/Date/index.js +133 -0
- package/dist/modules/Date/types.d.ts +32 -0
- package/dist/modules/Date/types.js +17 -0
- package/dist/modules/Guests/index.d.ts +17 -0
- package/dist/modules/Guests/index.js +259 -0
- package/dist/modules/Guests/types.d.ts +43 -0
- package/dist/modules/Guests/types.js +23 -0
- package/dist/modules/Order/index.d.ts +17 -0
- package/dist/modules/Order/index.js +228 -0
- package/dist/modules/Order/types.d.ts +57 -0
- package/dist/modules/Order/types.js +29 -0
- package/dist/modules/Payment/index.d.ts +18 -0
- package/dist/modules/Payment/index.js +243 -0
- package/dist/modules/Payment/types.d.ts +49 -0
- package/dist/modules/Payment/types.js +31 -0
- package/dist/modules/Product/index.d.ts +39 -0
- package/dist/modules/Product/index.js +118 -0
- package/dist/modules/Product/types.d.ts +387 -0
- package/dist/modules/Product/types.js +1 -0
- package/dist/modules/ProductList/index.d.ts +16 -0
- package/dist/modules/ProductList/index.js +158 -0
- package/dist/modules/ProductList/types.d.ts +9 -0
- package/dist/modules/ProductList/types.js +5 -0
- package/dist/modules/Resource/index.d.ts +15 -0
- package/dist/modules/Resource/index.js +219 -0
- package/dist/modules/Resource/types.d.ts +44 -0
- package/dist/modules/Resource/types.js +22 -0
- package/dist/modules/index.d.ts +3 -0
- package/dist/modules/index.js +3 -0
- package/dist/plugins/index.d.ts +2 -0
- package/dist/plugins/index.js +2 -0
- package/dist/plugins/request.d.ts +127 -0
- package/dist/plugins/request.js +592 -0
- package/dist/plugins/window.d.ts +115 -0
- package/dist/plugins/window.js +328 -0
- package/dist/solution/BookingByStep/index.d.ts +12 -0
- package/dist/solution/BookingByStep/index.js +77 -0
- package/dist/solution/BookingByStep/types.d.ts +27 -0
- package/dist/solution/BookingByStep/types.js +10 -0
- package/dist/solution/BuyTickets/index.d.ts +26 -0
- package/dist/solution/BuyTickets/index.js +339 -0
- package/dist/solution/BuyTickets/types.d.ts +24 -0
- package/dist/solution/BuyTickets/types.js +19 -0
- package/dist/solution/PlaceOrder/index.d.ts +0 -0
- package/dist/solution/PlaceOrder/index.js +54 -0
- package/dist/solution/index.d.ts +1 -0
- package/dist/solution/index.js +1 -0
- package/dist/store/createStore.d.ts +3 -0
- package/dist/store/createStore.js +43 -0
- package/dist/types/index.d.ts +85 -0
- package/dist/types/index.js +1 -0
- package/lib/core/index.d.ts +30 -0
- package/lib/core/index.js +212 -0
- package/lib/effects/index.d.ts +17 -0
- package/lib/effects/index.js +78 -0
- package/lib/index.d.ts +11 -0
- package/lib/index.js +51 -0
- package/lib/modules/Account/index.d.ts +21 -0
- package/lib/modules/Account/index.js +93 -0
- package/lib/modules/Account/types.d.ts +41 -0
- package/lib/modules/Account/types.js +35 -0
- package/lib/modules/BaseModule.d.ts +11 -0
- package/lib/modules/BaseModule.js +40 -0
- package/lib/modules/Cart/index.d.ts +33 -0
- package/lib/modules/Cart/index.js +104 -0
- package/lib/modules/Cart/types.d.ts +35 -0
- package/lib/modules/Cart/types.js +35 -0
- package/lib/modules/Date/index.d.ts +17 -0
- package/lib/modules/Date/index.js +75 -0
- package/lib/modules/Date/types.d.ts +32 -0
- package/lib/modules/Date/types.js +33 -0
- package/lib/modules/Guests/index.d.ts +17 -0
- package/lib/modules/Guests/index.js +95 -0
- package/lib/modules/Guests/types.d.ts +43 -0
- package/lib/modules/Guests/types.js +35 -0
- package/lib/modules/Order/index.d.ts +17 -0
- package/lib/modules/Order/index.js +95 -0
- package/lib/modules/Order/types.d.ts +57 -0
- package/lib/modules/Order/types.js +35 -0
- package/lib/modules/Payment/index.d.ts +18 -0
- package/lib/modules/Payment/index.js +103 -0
- package/lib/modules/Payment/types.d.ts +49 -0
- package/lib/modules/Payment/types.js +35 -0
- package/lib/modules/Product/index.d.ts +39 -0
- package/lib/modules/Product/index.js +87 -0
- package/lib/modules/Product/types.d.ts +387 -0
- package/lib/modules/Product/types.js +17 -0
- package/lib/modules/ProductList/index.d.ts +16 -0
- package/lib/modules/ProductList/index.js +71 -0
- package/lib/modules/ProductList/types.d.ts +9 -0
- package/lib/modules/ProductList/types.js +33 -0
- package/lib/modules/Resource/index.d.ts +15 -0
- package/lib/modules/Resource/index.js +91 -0
- package/lib/modules/Resource/types.d.ts +44 -0
- package/lib/modules/Resource/types.js +34 -0
- package/lib/modules/index.d.ts +3 -0
- package/lib/modules/index.js +27 -0
- package/lib/plugins/index.d.ts +2 -0
- package/lib/plugins/index.js +25 -0
- package/lib/plugins/request.d.ts +127 -0
- package/lib/plugins/request.js +297 -0
- package/lib/plugins/window.d.ts +115 -0
- package/lib/plugins/window.js +252 -0
- package/lib/solution/BookingByStep/index.d.ts +12 -0
- package/lib/solution/BookingByStep/index.js +53 -0
- package/lib/solution/BookingByStep/types.d.ts +27 -0
- package/lib/solution/BookingByStep/types.js +38 -0
- package/lib/solution/BuyTickets/index.d.ts +26 -0
- package/lib/solution/BuyTickets/index.js +122 -0
- package/lib/solution/BuyTickets/types.d.ts +24 -0
- package/lib/solution/BuyTickets/types.js +40 -0
- package/lib/solution/PlaceOrder/index.d.ts +0 -0
- package/lib/solution/PlaceOrder/index.js +0 -0
- package/lib/solution/index.d.ts +1 -0
- package/lib/solution/index.js +23 -0
- package/lib/store/createStore.d.ts +3 -0
- package/lib/store/createStore.js +46 -0
- package/lib/types/index.d.ts +85 -0
- package/lib/types/index.js +17 -0
- package/package.json +65 -0
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 商品基本信息接口
|
|
3
|
+
*/
|
|
4
|
+
export interface ProductData {
|
|
5
|
+
/** 商品id */
|
|
6
|
+
id: number;
|
|
7
|
+
/** 扩展类型id */
|
|
8
|
+
extension_id: number;
|
|
9
|
+
/** 扩展类型 */
|
|
10
|
+
extension_type: string;
|
|
11
|
+
/** 商品所属商户id */
|
|
12
|
+
shop_id: number;
|
|
13
|
+
/** 商品标题 */
|
|
14
|
+
title: string;
|
|
15
|
+
/** 商品slug */
|
|
16
|
+
slug: string;
|
|
17
|
+
/** draft:草稿;published:已发布;pending:待发布;archived:已归档 */
|
|
18
|
+
status: 'draft' | 'published' | 'pending' | 'archived';
|
|
19
|
+
/** 库存数量 */
|
|
20
|
+
stock_quantity: number;
|
|
21
|
+
/** 销售数量 */
|
|
22
|
+
sales_quantity: number;
|
|
23
|
+
/** 总库存数量包含组合规格商品 */
|
|
24
|
+
sum_stock: number;
|
|
25
|
+
/** 商品价格 */
|
|
26
|
+
price: string;
|
|
27
|
+
/** 商品原价 */
|
|
28
|
+
original_price: string;
|
|
29
|
+
/** 商品成本价 */
|
|
30
|
+
cost_price: string;
|
|
31
|
+
/** 商品封面图 */
|
|
32
|
+
cover: string;
|
|
33
|
+
/** 销售渠道 */
|
|
34
|
+
channel_application: string[];
|
|
35
|
+
/** 0:不限库存;1:跟踪库存 */
|
|
36
|
+
is_track: number;
|
|
37
|
+
/** 0:缺货后不允许售卖;1:缺货后继续售卖; */
|
|
38
|
+
over_sold: number;
|
|
39
|
+
/** 0:不含税;1:含税 */
|
|
40
|
+
is_gst: number;
|
|
41
|
+
/** 商品编码 */
|
|
42
|
+
code: string;
|
|
43
|
+
/** 商品条码 */
|
|
44
|
+
barcode: string;
|
|
45
|
+
/** 是否支持配送 */
|
|
46
|
+
is_delivery: number;
|
|
47
|
+
/** 重量单位 */
|
|
48
|
+
weight_unit: string;
|
|
49
|
+
/** 重量值 */
|
|
50
|
+
weight_value: string;
|
|
51
|
+
/** 商品类型 */
|
|
52
|
+
type: string;
|
|
53
|
+
/** 单位 */
|
|
54
|
+
unit: string;
|
|
55
|
+
/** 排序 */
|
|
56
|
+
sort: number;
|
|
57
|
+
/** 是否有规格 */
|
|
58
|
+
is_variant: number;
|
|
59
|
+
/** 规格数量 */
|
|
60
|
+
variant_count: number;
|
|
61
|
+
/** 截止时间配置 */
|
|
62
|
+
cut_off_time: {
|
|
63
|
+
/** 单位值 */
|
|
64
|
+
unit: number;
|
|
65
|
+
/** 单位类型 */
|
|
66
|
+
unit_type: string;
|
|
67
|
+
/** 未来天数 */
|
|
68
|
+
future_day: number;
|
|
69
|
+
/** 类型 */
|
|
70
|
+
type: string;
|
|
71
|
+
/** 进行中配置 */
|
|
72
|
+
ongoing: {
|
|
73
|
+
/** 类型 */
|
|
74
|
+
type: string;
|
|
75
|
+
/** 单位值 */
|
|
76
|
+
unit: number;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
/** 政策 */
|
|
80
|
+
policy: number;
|
|
81
|
+
/** 机器码配置 */
|
|
82
|
+
machine_code: {
|
|
83
|
+
/** 是否允许改期 */
|
|
84
|
+
make_over: number;
|
|
85
|
+
/** 是否允许提前 */
|
|
86
|
+
beforehand: number;
|
|
87
|
+
/** 限制数量 */
|
|
88
|
+
limit_count: number;
|
|
89
|
+
/** 客户限制 */
|
|
90
|
+
customer: number;
|
|
91
|
+
/** 发送动作 */
|
|
92
|
+
send_action: string;
|
|
93
|
+
/** 是否隐藏充值 */
|
|
94
|
+
hide_recharge: number;
|
|
95
|
+
/** 是否自动分销 */
|
|
96
|
+
distributor_automatic: number;
|
|
97
|
+
};
|
|
98
|
+
/** 时长配置 */
|
|
99
|
+
duration: {
|
|
100
|
+
/** 类型 */
|
|
101
|
+
type: string;
|
|
102
|
+
/** 值 */
|
|
103
|
+
value: number;
|
|
104
|
+
};
|
|
105
|
+
/** 商品显示设置 */
|
|
106
|
+
product_display_setting: {
|
|
107
|
+
/** kiosk配置 */
|
|
108
|
+
kiosk: {
|
|
109
|
+
/** 是否使用显示模式 */
|
|
110
|
+
use_display_mode: number;
|
|
111
|
+
/** 商品选项模式 */
|
|
112
|
+
product_option_mode: any;
|
|
113
|
+
/** 商品选项模式分页 */
|
|
114
|
+
product_option_mode_paging: any;
|
|
115
|
+
/** 商品套餐模式 */
|
|
116
|
+
product_bundle_mode: any;
|
|
117
|
+
/** 商品套餐模式分页 */
|
|
118
|
+
product_bundle_mode_paging: any;
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
/** 货架商品数据 */
|
|
122
|
+
shelf_product_datas: any[];
|
|
123
|
+
/** 步进值 */
|
|
124
|
+
step_value: number;
|
|
125
|
+
/** 最小数量单位 */
|
|
126
|
+
min_num_unit: number;
|
|
127
|
+
/** 是否收取税费 */
|
|
128
|
+
is_charge_tax: number;
|
|
129
|
+
/** 基础价格 */
|
|
130
|
+
base_price: string;
|
|
131
|
+
/** 规格列表 */
|
|
132
|
+
variant: any[];
|
|
133
|
+
media: ProductMedia[];
|
|
134
|
+
tags: ProductTag[];
|
|
135
|
+
categories: ProductCategory[];
|
|
136
|
+
bundle_groups: ProductBundleGroup[];
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* 商品媒体信息接口
|
|
140
|
+
*/
|
|
141
|
+
export interface ProductMedia {
|
|
142
|
+
/** 媒体id */
|
|
143
|
+
id: number;
|
|
144
|
+
/** 商品id */
|
|
145
|
+
product_id: number;
|
|
146
|
+
/** 店铺id */
|
|
147
|
+
shop_id: number;
|
|
148
|
+
/** 媒体标题 */
|
|
149
|
+
title: string;
|
|
150
|
+
/** 完整的url */
|
|
151
|
+
url: string;
|
|
152
|
+
/** 媒体资源扩展名mp4,jpg,png */
|
|
153
|
+
extension: string;
|
|
154
|
+
/** 媒体资源类型:video,image */
|
|
155
|
+
type: string;
|
|
156
|
+
/** 排序字段asc */
|
|
157
|
+
sort: number;
|
|
158
|
+
/** 创建账号id */
|
|
159
|
+
create_account_id: number;
|
|
160
|
+
/** 更新账号id */
|
|
161
|
+
update_account_id: number;
|
|
162
|
+
/** 删除时间 */
|
|
163
|
+
deleted_at: string | null;
|
|
164
|
+
/** 创建时间 */
|
|
165
|
+
created_at: string;
|
|
166
|
+
/** 更新时间 */
|
|
167
|
+
updated_at: string;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* 商品标签接口
|
|
171
|
+
*/
|
|
172
|
+
export interface ProductTag {
|
|
173
|
+
/** 标签id */
|
|
174
|
+
id: number;
|
|
175
|
+
/** 店铺id */
|
|
176
|
+
shop_id: number;
|
|
177
|
+
/** 标签名称 */
|
|
178
|
+
name: string;
|
|
179
|
+
/** 标签名称首字母 */
|
|
180
|
+
name_letter: string;
|
|
181
|
+
/** 最后应用时间 */
|
|
182
|
+
last_applicable_time: number;
|
|
183
|
+
/** 创建账号id */
|
|
184
|
+
create_account_id: number;
|
|
185
|
+
/** 更新账号id */
|
|
186
|
+
update_account_id: number;
|
|
187
|
+
/** 删除时间 */
|
|
188
|
+
deleted_at: string | null;
|
|
189
|
+
/** 创建时间 */
|
|
190
|
+
created_at: string;
|
|
191
|
+
/** 更新时间 */
|
|
192
|
+
updated_at: string;
|
|
193
|
+
/** 关联信息 */
|
|
194
|
+
pivot: {
|
|
195
|
+
/** 商品id */
|
|
196
|
+
product_id: number;
|
|
197
|
+
/** 标签id */
|
|
198
|
+
product_tag_id: number;
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* 商品分类接口
|
|
203
|
+
*/
|
|
204
|
+
export interface ProductCategory {
|
|
205
|
+
/** 类别id */
|
|
206
|
+
id: number;
|
|
207
|
+
/** 店铺id */
|
|
208
|
+
shop_id: number;
|
|
209
|
+
/** 类别名称 */
|
|
210
|
+
name: string;
|
|
211
|
+
/** 类别名称首字母 */
|
|
212
|
+
name_letter: string;
|
|
213
|
+
/** 最后应用时间 */
|
|
214
|
+
last_applicable_time: number;
|
|
215
|
+
/** 创建账号id */
|
|
216
|
+
create_account_id: number;
|
|
217
|
+
/** 更新账号id */
|
|
218
|
+
update_account_id: number;
|
|
219
|
+
/** 删除时间 */
|
|
220
|
+
deleted_at: string | null;
|
|
221
|
+
/** 创建时间 */
|
|
222
|
+
created_at: string;
|
|
223
|
+
/** 更新时间 */
|
|
224
|
+
updated_at: string;
|
|
225
|
+
/** 关联信息 */
|
|
226
|
+
pivot: {
|
|
227
|
+
/** 商品id */
|
|
228
|
+
product_id: number;
|
|
229
|
+
/** 分类id */
|
|
230
|
+
product_category_id: number;
|
|
231
|
+
/** 创建时间 */
|
|
232
|
+
created_at: string;
|
|
233
|
+
/** 更新时间 */
|
|
234
|
+
updated_at: string;
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* 商品规格组接口
|
|
239
|
+
*/
|
|
240
|
+
export interface ProductVariantGroup {
|
|
241
|
+
/** 组合规格组id */
|
|
242
|
+
id: number;
|
|
243
|
+
/** 商品id */
|
|
244
|
+
product_id: number;
|
|
245
|
+
/** 店铺id */
|
|
246
|
+
shop_id: number;
|
|
247
|
+
/** 组合规格组名称 */
|
|
248
|
+
name: string;
|
|
249
|
+
/** 组合规格组位置标识 */
|
|
250
|
+
position_id: number;
|
|
251
|
+
/** 排序 */
|
|
252
|
+
sort: number;
|
|
253
|
+
/** 创建账号id */
|
|
254
|
+
create_account_id: number;
|
|
255
|
+
/** 更新账号id */
|
|
256
|
+
update_account_id: number;
|
|
257
|
+
/** 删除时间 */
|
|
258
|
+
deleted_at: string | null;
|
|
259
|
+
/** 创建时间 */
|
|
260
|
+
created_at: string;
|
|
261
|
+
/** 更新时间 */
|
|
262
|
+
updated_at: string;
|
|
263
|
+
/** 0正常 */
|
|
264
|
+
status: number;
|
|
265
|
+
/** 组合规格选项集合列表 */
|
|
266
|
+
variant_item: ProductVariantItem[];
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* 商品规格项接口
|
|
270
|
+
*/
|
|
271
|
+
export interface ProductVariantItem {
|
|
272
|
+
/** 选项id */
|
|
273
|
+
id: number;
|
|
274
|
+
/** 规格组id */
|
|
275
|
+
variant_group_id: number;
|
|
276
|
+
/** 商品id */
|
|
277
|
+
product_id: number;
|
|
278
|
+
/** 店铺id */
|
|
279
|
+
shop_id: number;
|
|
280
|
+
/** 选项位置标识 */
|
|
281
|
+
position_id: number;
|
|
282
|
+
/** 选项名称 */
|
|
283
|
+
name: string;
|
|
284
|
+
/** 排序 */
|
|
285
|
+
sort: number;
|
|
286
|
+
/** 创建账号id */
|
|
287
|
+
create_account_id: number;
|
|
288
|
+
/** 更新账号id */
|
|
289
|
+
update_account_id: number;
|
|
290
|
+
/** 删除时间 */
|
|
291
|
+
deleted_at: string | null;
|
|
292
|
+
/** 创建时间 */
|
|
293
|
+
created_at: string;
|
|
294
|
+
/** 更新时间 */
|
|
295
|
+
updated_at: string;
|
|
296
|
+
/** 0正常 */
|
|
297
|
+
status: number;
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* 商品规格接口
|
|
301
|
+
*/
|
|
302
|
+
export interface ProductVariant {
|
|
303
|
+
/** 组合商品id */
|
|
304
|
+
id: number;
|
|
305
|
+
/** 商品id */
|
|
306
|
+
product_id: number;
|
|
307
|
+
/** 店铺id */
|
|
308
|
+
shop_id: number;
|
|
309
|
+
/** 规格键 */
|
|
310
|
+
sku_key: string;
|
|
311
|
+
/** 规格id */
|
|
312
|
+
sku_ids: string;
|
|
313
|
+
/** 组合商品的封面图 */
|
|
314
|
+
cover: string;
|
|
315
|
+
/** 组合商品的价格 */
|
|
316
|
+
price: string;
|
|
317
|
+
/** 组合商品的成本价 */
|
|
318
|
+
original_price: number;
|
|
319
|
+
/** 0:不含税;1:含税 */
|
|
320
|
+
is_gst: number;
|
|
321
|
+
/** 组合商品的编码 */
|
|
322
|
+
code: string;
|
|
323
|
+
/** 组合商品条码 */
|
|
324
|
+
barcode: string;
|
|
325
|
+
/** 0:不限库存;1:跟踪库存 */
|
|
326
|
+
is_track: number;
|
|
327
|
+
/** 库存数量 */
|
|
328
|
+
stock_quantity: number;
|
|
329
|
+
/** 排序 */
|
|
330
|
+
sort: number;
|
|
331
|
+
/** 0:缺货后不允许售卖;1:缺货后继续售卖; */
|
|
332
|
+
over_sold: number;
|
|
333
|
+
/** 0:启用 1:禁用 */
|
|
334
|
+
disabled: number;
|
|
335
|
+
/** 创建账号id */
|
|
336
|
+
create_account_id: number;
|
|
337
|
+
/** 更新账号id */
|
|
338
|
+
update_account_id: number;
|
|
339
|
+
/** 删除时间 */
|
|
340
|
+
deleted_at: string | null;
|
|
341
|
+
/** 创建时间 */
|
|
342
|
+
created_at: string;
|
|
343
|
+
/** 更新时间 */
|
|
344
|
+
updated_at: string;
|
|
345
|
+
/** 组合商品的名称 */
|
|
346
|
+
title: string[];
|
|
347
|
+
/** 0正常 */
|
|
348
|
+
status: number;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* 商品套餐组接口
|
|
352
|
+
*/
|
|
353
|
+
export interface ProductBundleGroup {
|
|
354
|
+
/** 套餐分组id */
|
|
355
|
+
id: string;
|
|
356
|
+
/** 名称 */
|
|
357
|
+
name: string;
|
|
358
|
+
/** 最小数量 */
|
|
359
|
+
min_quantity: string;
|
|
360
|
+
/** 最大数量 */
|
|
361
|
+
max_quantity: string;
|
|
362
|
+
/** 套餐明细 */
|
|
363
|
+
bundle_item: ProductBundleItem[];
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* 商品套餐项接口
|
|
367
|
+
*/
|
|
368
|
+
export interface ProductBundleItem {
|
|
369
|
+
/** 套餐明细id */
|
|
370
|
+
id: string;
|
|
371
|
+
/** 扩展类型id */
|
|
372
|
+
extension_id: string;
|
|
373
|
+
/** 扩展类型 */
|
|
374
|
+
extension_type: string;
|
|
375
|
+
/** 绑定的商品id */
|
|
376
|
+
bundle_product_id: string;
|
|
377
|
+
/** 加价:markup, 减价:markdown,product_price:商品价格 */
|
|
378
|
+
price_type: string;
|
|
379
|
+
/** 价格 */
|
|
380
|
+
price: string;
|
|
381
|
+
/** 最大数量 */
|
|
382
|
+
max_quantity: string;
|
|
383
|
+
/** 明细标题 */
|
|
384
|
+
title: string;
|
|
385
|
+
/** 明细库存 */
|
|
386
|
+
stock_quantity: string;
|
|
387
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Module, PisellCore } from '../../types';
|
|
2
|
+
import { BaseModule } from '../BaseModule';
|
|
3
|
+
import { Product } from '../Product';
|
|
4
|
+
import { ProductData } from '../Product/types';
|
|
5
|
+
export * from './types';
|
|
6
|
+
export declare class ProductList extends BaseModule implements Module {
|
|
7
|
+
protected defaultName: string;
|
|
8
|
+
protected defaultVersion: string;
|
|
9
|
+
private store;
|
|
10
|
+
constructor(name?: string, version?: string);
|
|
11
|
+
initialize(core: PisellCore, options: any): Promise<void>;
|
|
12
|
+
storeChange(path?: string, value?: any): Promise<void>;
|
|
13
|
+
getProducts(): Promise<ProductData[]>;
|
|
14
|
+
getProduct(id: number): Promise<Product | undefined>;
|
|
15
|
+
addProduct(): Promise<void>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
6
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
7
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
9
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
10
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
11
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
12
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
13
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
14
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
15
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
16
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
17
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
19
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
20
|
+
import { BaseModule } from "../BaseModule";
|
|
21
|
+
import { Product } from "../Product";
|
|
22
|
+
import { ProductListHooks } from "./types";
|
|
23
|
+
export * from "./types";
|
|
24
|
+
export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
25
|
+
_inherits(ProductList, _BaseModule);
|
|
26
|
+
var _super = _createSuper(ProductList);
|
|
27
|
+
function ProductList(name, version) {
|
|
28
|
+
var _this;
|
|
29
|
+
_classCallCheck(this, ProductList);
|
|
30
|
+
_this = _super.call(this, name, version);
|
|
31
|
+
_defineProperty(_assertThisInitialized(_this), "defaultName", 'productList');
|
|
32
|
+
_defineProperty(_assertThisInitialized(_this), "defaultVersion", '1.0.0');
|
|
33
|
+
_defineProperty(_assertThisInitialized(_this), "store", void 0);
|
|
34
|
+
return _this;
|
|
35
|
+
}
|
|
36
|
+
_createClass(ProductList, [{
|
|
37
|
+
key: "initialize",
|
|
38
|
+
value: function () {
|
|
39
|
+
var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(core, options) {
|
|
40
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
41
|
+
while (1) switch (_context.prev = _context.next) {
|
|
42
|
+
case 0:
|
|
43
|
+
this.core = core;
|
|
44
|
+
this.store = _objectSpread(_objectSpread({}, options.store || {}), {}, {
|
|
45
|
+
productMap: new Map()
|
|
46
|
+
});
|
|
47
|
+
this.storeChange();
|
|
48
|
+
case 3:
|
|
49
|
+
case "end":
|
|
50
|
+
return _context.stop();
|
|
51
|
+
}
|
|
52
|
+
}, _callee, this);
|
|
53
|
+
}));
|
|
54
|
+
function initialize(_x, _x2) {
|
|
55
|
+
return _initialize.apply(this, arguments);
|
|
56
|
+
}
|
|
57
|
+
return initialize;
|
|
58
|
+
}()
|
|
59
|
+
}, {
|
|
60
|
+
key: "storeChange",
|
|
61
|
+
value: function () {
|
|
62
|
+
var _storeChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(path, value) {
|
|
63
|
+
var _this2 = this;
|
|
64
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
65
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
66
|
+
case 0:
|
|
67
|
+
this.store.list.forEach(function (product) {
|
|
68
|
+
if (!_this2.store.productMap.has("product-".concat(product.id))) {
|
|
69
|
+
var newProductModule = new Product("product-".concat(product.id.toString()));
|
|
70
|
+
_this2.core.registerModule(newProductModule, {
|
|
71
|
+
initialState: product
|
|
72
|
+
});
|
|
73
|
+
_this2.store.productMap.set(product.id.toString(), newProductModule);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
case 1:
|
|
77
|
+
case "end":
|
|
78
|
+
return _context2.stop();
|
|
79
|
+
}
|
|
80
|
+
}, _callee2, this);
|
|
81
|
+
}));
|
|
82
|
+
function storeChange(_x3, _x4) {
|
|
83
|
+
return _storeChange.apply(this, arguments);
|
|
84
|
+
}
|
|
85
|
+
return storeChange;
|
|
86
|
+
}()
|
|
87
|
+
}, {
|
|
88
|
+
key: "getProducts",
|
|
89
|
+
value: function () {
|
|
90
|
+
var _getProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
91
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
92
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
93
|
+
case 0:
|
|
94
|
+
_context3.next = 2;
|
|
95
|
+
return this.core.effects.emit(ProductListHooks.onGetProducts, this.store.list);
|
|
96
|
+
case 2:
|
|
97
|
+
return _context3.abrupt("return", this.store.list);
|
|
98
|
+
case 3:
|
|
99
|
+
case "end":
|
|
100
|
+
return _context3.stop();
|
|
101
|
+
}
|
|
102
|
+
}, _callee3, this);
|
|
103
|
+
}));
|
|
104
|
+
function getProducts() {
|
|
105
|
+
return _getProducts.apply(this, arguments);
|
|
106
|
+
}
|
|
107
|
+
return getProducts;
|
|
108
|
+
}()
|
|
109
|
+
}, {
|
|
110
|
+
key: "getProduct",
|
|
111
|
+
value: function () {
|
|
112
|
+
var _getProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(id) {
|
|
113
|
+
var product;
|
|
114
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
115
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
116
|
+
case 0:
|
|
117
|
+
_context4.next = 2;
|
|
118
|
+
return this.core.effects.emit(ProductListHooks.onGetProduct, this.store.list);
|
|
119
|
+
case 2:
|
|
120
|
+
product = this.store.productMap.get("".concat(id));
|
|
121
|
+
if (!product) {
|
|
122
|
+
_context4.next = 5;
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
return _context4.abrupt("return", product);
|
|
126
|
+
case 5:
|
|
127
|
+
return _context4.abrupt("return", undefined);
|
|
128
|
+
case 6:
|
|
129
|
+
case "end":
|
|
130
|
+
return _context4.stop();
|
|
131
|
+
}
|
|
132
|
+
}, _callee4, this);
|
|
133
|
+
}));
|
|
134
|
+
function getProduct(_x5) {
|
|
135
|
+
return _getProduct.apply(this, arguments);
|
|
136
|
+
}
|
|
137
|
+
return getProduct;
|
|
138
|
+
}()
|
|
139
|
+
}, {
|
|
140
|
+
key: "addProduct",
|
|
141
|
+
value: function () {
|
|
142
|
+
var _addProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
143
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
144
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
145
|
+
case 0:
|
|
146
|
+
case "end":
|
|
147
|
+
return _context5.stop();
|
|
148
|
+
}
|
|
149
|
+
}, _callee5);
|
|
150
|
+
}));
|
|
151
|
+
function addProduct() {
|
|
152
|
+
return _addProduct.apply(this, arguments);
|
|
153
|
+
}
|
|
154
|
+
return addProduct;
|
|
155
|
+
}()
|
|
156
|
+
}]);
|
|
157
|
+
return ProductList;
|
|
158
|
+
}(BaseModule);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ProductData } from '../Product/types';
|
|
2
|
+
export interface ProductListData {
|
|
3
|
+
list: ProductData[];
|
|
4
|
+
productMap: Map<string, any>;
|
|
5
|
+
}
|
|
6
|
+
export declare enum ProductListHooks {
|
|
7
|
+
onGetProducts = "productList:onGetProducts",
|
|
8
|
+
onGetProduct = "productList:onGetProduct"
|
|
9
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Module, PisellCore, ModuleOptions } from '../../types';
|
|
2
|
+
import { BaseModule } from '../BaseModule';
|
|
3
|
+
import { Resource, ResourceTimeSlot, ResourceListModuleAPI } from './types';
|
|
4
|
+
export declare class ResourceListModule extends BaseModule implements Module, ResourceListModuleAPI {
|
|
5
|
+
private state;
|
|
6
|
+
constructor();
|
|
7
|
+
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
8
|
+
getResources(): Promise<Resource[]>;
|
|
9
|
+
selectResource(resourceId: string): Promise<void>;
|
|
10
|
+
getSelectedResource(): Resource | null;
|
|
11
|
+
checkAvailability(resourceId: string, start: Date, end: Date): Promise<boolean>;
|
|
12
|
+
getAvailableTimeSlots(resourceId: string): Promise<ResourceTimeSlot[]>;
|
|
13
|
+
getAvailableCapacity(resourceId: string, timeSlot: ResourceTimeSlot): number;
|
|
14
|
+
updateResource(resourceId: string, updates: Partial<Resource>): Promise<void>;
|
|
15
|
+
}
|