feeef 0.5.38-dev.4 → 0.6.2
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/build/index.js +1222 -40
- package/build/index.js.map +1 -1
- package/build/src/core/entities/category.d.ts +21 -0
- package/build/src/core/entities/feedback.d.ts +100 -0
- package/build/src/core/entities/order.d.ts +93 -0
- package/build/src/core/entities/product.d.ts +76 -0
- package/build/src/core/entities/shipping_method.d.ts +28 -0
- package/build/src/core/entities/shipping_price.d.ts +19 -0
- package/build/src/core/entities/store.d.ts +105 -0
- package/build/src/feeef/feeef.d.ts +28 -1
- package/build/src/feeef/repositories/categories.d.ts +43 -3
- package/build/src/feeef/repositories/deposits.d.ts +67 -4
- package/build/src/feeef/repositories/feedbacks.d.ts +43 -0
- package/build/src/feeef/repositories/orders.d.ts +69 -13
- package/build/src/feeef/repositories/products.d.ts +43 -5
- package/build/src/feeef/repositories/repository.d.ts +6 -2
- package/build/src/feeef/repositories/shipping_methods.d.ts +38 -0
- package/build/src/feeef/repositories/shipping_prices.d.ts +19 -8
- package/build/src/feeef/repositories/stores.d.ts +90 -7
- package/build/src/feeef/repositories/transfers.d.ts +61 -4
- package/build/src/feeef/services/integrations.d.ts +330 -0
- package/build/src/feeef/services/notifications.d.ts +68 -0
- package/build/src/feeef/services/storage.d.ts +134 -0
- package/build/src/index.d.ts +17 -2
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -55,12 +55,32 @@ var ModelRepository = class {
|
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
57
|
* Creates a new model.
|
|
58
|
-
*
|
|
58
|
+
* Supports two call patterns:
|
|
59
|
+
* 1. `create(data, params?)` - Pass data directly with optional params
|
|
60
|
+
* 2. `create({ data, params })` - Pass options object
|
|
61
|
+
* @param dataOrOptions - The data to create or options object containing data and params
|
|
62
|
+
* @param params - Optional query parameters (only used when data is passed directly)
|
|
59
63
|
* @returns A promise that resolves to the created model.
|
|
60
64
|
*/
|
|
61
|
-
async create(
|
|
62
|
-
|
|
63
|
-
|
|
65
|
+
async create(dataOrOptions, params) {
|
|
66
|
+
if (dataOrOptions && typeof dataOrOptions === "object" && "data" in dataOrOptions) {
|
|
67
|
+
const options2 = dataOrOptions;
|
|
68
|
+
const { data, params: optionsParams } = options2;
|
|
69
|
+
const requestParams = optionsParams || params;
|
|
70
|
+
const res2 = await this.client.post(`/${this.resource}`, data, {
|
|
71
|
+
params: requestParams
|
|
72
|
+
});
|
|
73
|
+
return res2.data;
|
|
74
|
+
}
|
|
75
|
+
const options = {
|
|
76
|
+
data: dataOrOptions
|
|
77
|
+
};
|
|
78
|
+
if (params) {
|
|
79
|
+
options.params = params;
|
|
80
|
+
}
|
|
81
|
+
const res = await this.client.post(`/${this.resource}`, options.data, {
|
|
82
|
+
params: options.params
|
|
83
|
+
});
|
|
64
84
|
return res.data;
|
|
65
85
|
}
|
|
66
86
|
/**
|
|
@@ -92,6 +112,16 @@ var ModelRepository = class {
|
|
|
92
112
|
};
|
|
93
113
|
|
|
94
114
|
// src/feeef/repositories/orders.ts
|
|
115
|
+
var DeliveryServiceFilter = /* @__PURE__ */ ((DeliveryServiceFilter2) => {
|
|
116
|
+
DeliveryServiceFilter2["yalidine"] = "yalidine";
|
|
117
|
+
DeliveryServiceFilter2["ecotrack"] = "ecotrack";
|
|
118
|
+
DeliveryServiceFilter2["procolis"] = "procolis";
|
|
119
|
+
DeliveryServiceFilter2["noest"] = "noest";
|
|
120
|
+
DeliveryServiceFilter2["zimou"] = "zimou";
|
|
121
|
+
DeliveryServiceFilter2["maystro"] = "maystro";
|
|
122
|
+
DeliveryServiceFilter2["ecomanager"] = "ecomanager";
|
|
123
|
+
return DeliveryServiceFilter2;
|
|
124
|
+
})(DeliveryServiceFilter || {});
|
|
95
125
|
var OrderRepository = class extends ModelRepository {
|
|
96
126
|
/**
|
|
97
127
|
* Constructs a new OrderRepository instance.
|
|
@@ -100,44 +130,104 @@ var OrderRepository = class extends ModelRepository {
|
|
|
100
130
|
constructor(client) {
|
|
101
131
|
super("orders", client);
|
|
102
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* Lists orders with optional filtering.
|
|
135
|
+
* @param options - The options for listing orders.
|
|
136
|
+
* @returns A Promise that resolves to a list of Order entities.
|
|
137
|
+
*/
|
|
138
|
+
async list(options) {
|
|
139
|
+
const params = { ...options?.params };
|
|
140
|
+
if (options) {
|
|
141
|
+
if (options.page) params.page = options.page;
|
|
142
|
+
if (options.offset) params.offset = options.offset;
|
|
143
|
+
if (options.limit) params.limit = options.limit;
|
|
144
|
+
if (options.storeId) params.store_id = options.storeId;
|
|
145
|
+
if (options.status) {
|
|
146
|
+
params.status = Array.isArray(options.status) ? options.status : [options.status];
|
|
147
|
+
}
|
|
148
|
+
if (options.deliveryStatus) params.deliveryStatus = options.deliveryStatus;
|
|
149
|
+
if (options.paymentStatus) params.paymentStatus = options.paymentStatus;
|
|
150
|
+
if (options.customStatus) params.customStatus = options.customStatus;
|
|
151
|
+
if (options.source) params.source = options.source;
|
|
152
|
+
if (options.tags) params.tags = options.tags;
|
|
153
|
+
if (options.createdBefore) {
|
|
154
|
+
params.created_before = options.createdBefore instanceof Date ? options.createdBefore.toISOString() : options.createdBefore;
|
|
155
|
+
}
|
|
156
|
+
if (options.createdAfter) {
|
|
157
|
+
params.created_after = options.createdAfter instanceof Date ? options.createdAfter.toISOString() : options.createdAfter;
|
|
158
|
+
}
|
|
159
|
+
if (options.q) params.q = options.q;
|
|
160
|
+
if (options.confirmer) params.confirmer = options.confirmer;
|
|
161
|
+
if (options.products) params.products = options.products;
|
|
162
|
+
if (options.shippingState) params.shippingState = options.shippingState;
|
|
163
|
+
if (options.shippingCity) params.shippingCity = options.shippingCity;
|
|
164
|
+
if (options.deliveryService) params.deliveryService = options.deliveryService;
|
|
165
|
+
}
|
|
166
|
+
return super.list({ params });
|
|
167
|
+
}
|
|
103
168
|
/**
|
|
104
169
|
* Sends an order from an anonymous user.
|
|
105
170
|
* @param data - The data representing the order to be sent.
|
|
106
171
|
* @returns A Promise that resolves to the sent OrderEntity.
|
|
107
172
|
*/
|
|
108
173
|
async send(data) {
|
|
109
|
-
const
|
|
110
|
-
const res = await this.client.post(`/${this.resource}/send`, output);
|
|
174
|
+
const res = await this.client.post(`/${this.resource}/send`, data);
|
|
111
175
|
return res.data;
|
|
112
176
|
}
|
|
113
177
|
/**
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* @param options - The options for
|
|
117
|
-
* @returns A promise that resolves to the
|
|
178
|
+
* Tracks the order by the order ID.
|
|
179
|
+
* Returns the order status and history.
|
|
180
|
+
* @param options - The options for tracking the order.
|
|
181
|
+
* @returns A promise that resolves to the order track entity.
|
|
118
182
|
*/
|
|
119
183
|
async track(options) {
|
|
120
184
|
const { id, params } = options;
|
|
121
185
|
const res = await this.client.get(`/${this.resource}/${id}/track`, {
|
|
122
|
-
params
|
|
123
|
-
...params
|
|
124
|
-
}
|
|
186
|
+
params
|
|
125
187
|
});
|
|
126
188
|
return res.data;
|
|
127
189
|
}
|
|
128
190
|
/**
|
|
129
|
-
*
|
|
130
|
-
* @param
|
|
131
|
-
* @returns A Promise that resolves to the
|
|
191
|
+
* Calculates order pricing based on items, shipping details, etc.
|
|
192
|
+
* @param options - The calculation options.
|
|
193
|
+
* @returns A Promise that resolves to the calculated pricing.
|
|
194
|
+
*/
|
|
195
|
+
async calculate(options) {
|
|
196
|
+
const res = await this.client.post(`/${this.resource}/calculate`, {
|
|
197
|
+
storeId: options.storeId,
|
|
198
|
+
items: options.items.map((item) => ({
|
|
199
|
+
productId: item.productId,
|
|
200
|
+
quantity: item.quantity,
|
|
201
|
+
variantPath: item.variantPath,
|
|
202
|
+
offerCode: item.offerCode,
|
|
203
|
+
addons: item.addons,
|
|
204
|
+
price: item.price,
|
|
205
|
+
discount: item.discount
|
|
206
|
+
})),
|
|
207
|
+
shippingState: options.shippingState,
|
|
208
|
+
shippingCountry: options.shippingCountry,
|
|
209
|
+
shippingType: options.shippingType,
|
|
210
|
+
shippingAddress: options.shippingAddress
|
|
211
|
+
});
|
|
212
|
+
return {
|
|
213
|
+
subtotal: res.data.pricing.subtotal,
|
|
214
|
+
shippingPrice: res.data.pricing.shippingPrice,
|
|
215
|
+
calculatedTotal: res.data.pricing.calculatedTotal
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Assigns a single order to a member (as confirmer).
|
|
220
|
+
* @param data - The data containing orderId, memberId, and storeId.
|
|
221
|
+
* @returns A Promise that resolves to the updated OrderEntity.
|
|
132
222
|
*/
|
|
133
223
|
async assign(data) {
|
|
134
224
|
const res = await this.client.post(`/${this.resource}/assign`, data);
|
|
135
225
|
return res.data;
|
|
136
226
|
}
|
|
137
227
|
/**
|
|
138
|
-
* Assigns multiple orders to a member (as confirmer)
|
|
139
|
-
* @param data - The data containing orderIds, memberId, and storeId
|
|
140
|
-
* @returns A Promise that resolves to a success message
|
|
228
|
+
* Assigns multiple orders to a member (as confirmer).
|
|
229
|
+
* @param data - The data containing orderIds, memberId, and storeId.
|
|
230
|
+
* @returns A Promise that resolves to a success message.
|
|
141
231
|
*/
|
|
142
232
|
async assignMany(data) {
|
|
143
233
|
const res = await this.client.post(`/${this.resource}/assignMany`, data);
|
|
@@ -155,8 +245,43 @@ var ProductRepository = class extends ModelRepository {
|
|
|
155
245
|
super("products", client);
|
|
156
246
|
}
|
|
157
247
|
/**
|
|
158
|
-
*
|
|
159
|
-
* @param
|
|
248
|
+
* Lists products with optional filtering.
|
|
249
|
+
* @param options - The options for listing products.
|
|
250
|
+
* @returns A Promise that resolves to a list of Product entities.
|
|
251
|
+
*/
|
|
252
|
+
async list(options) {
|
|
253
|
+
const {
|
|
254
|
+
storeId,
|
|
255
|
+
categoryId,
|
|
256
|
+
status,
|
|
257
|
+
q,
|
|
258
|
+
minPrice,
|
|
259
|
+
maxPrice,
|
|
260
|
+
inStock,
|
|
261
|
+
sortBy,
|
|
262
|
+
sortOrder,
|
|
263
|
+
...listOptions
|
|
264
|
+
} = options || {};
|
|
265
|
+
const params = {
|
|
266
|
+
...listOptions.params
|
|
267
|
+
};
|
|
268
|
+
if (storeId) params.store_id = storeId;
|
|
269
|
+
if (categoryId) params.category_id = categoryId;
|
|
270
|
+
if (status) params.status = Array.isArray(status) ? status : [status];
|
|
271
|
+
if (q) params.q = q;
|
|
272
|
+
if (minPrice !== void 0) params.min_price = minPrice;
|
|
273
|
+
if (maxPrice !== void 0) params.max_price = maxPrice;
|
|
274
|
+
if (inStock !== void 0) params.in_stock = inStock;
|
|
275
|
+
if (sortBy) params.sort_by = sortBy;
|
|
276
|
+
if (sortOrder) params.sort_order = sortOrder;
|
|
277
|
+
return super.list({
|
|
278
|
+
...listOptions,
|
|
279
|
+
params
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Retrieves random products from the repository.
|
|
284
|
+
* @param limit - The number of random products to retrieve. Default is 12.
|
|
160
285
|
* @returns A promise that resolves to an array of random ProductEntity objects.
|
|
161
286
|
*/
|
|
162
287
|
async random(limit = 12) {
|
|
@@ -165,6 +290,32 @@ var ProductRepository = class extends ModelRepository {
|
|
|
165
290
|
});
|
|
166
291
|
return response.data;
|
|
167
292
|
}
|
|
293
|
+
/**
|
|
294
|
+
* Gets the sells chart for a product (last 7 days).
|
|
295
|
+
* @param productId - The product ID.
|
|
296
|
+
* @param storeId - The store ID.
|
|
297
|
+
* @returns A Promise that resolves to a map of date to number of sells.
|
|
298
|
+
*/
|
|
299
|
+
async sells(productId, storeId) {
|
|
300
|
+
const res = await this.client.get(`/stores/${storeId}/${this.resource}/${productId}/sells`);
|
|
301
|
+
const sellsData = /* @__PURE__ */ new Map();
|
|
302
|
+
if (res.data) {
|
|
303
|
+
for (const [key, value] of Object.entries(res.data)) {
|
|
304
|
+
sellsData.set(new Date(key), Number(value) || 0);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
return sellsData;
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Gets the analytics/report for a product.
|
|
311
|
+
* @param productId - The product ID.
|
|
312
|
+
* @param storeId - The store ID.
|
|
313
|
+
* @returns A Promise that resolves to the product report.
|
|
314
|
+
*/
|
|
315
|
+
async report(productId, storeId) {
|
|
316
|
+
const res = await this.client.get(`/stores/${storeId}/${this.resource}/${productId}/report`);
|
|
317
|
+
return res.data;
|
|
318
|
+
}
|
|
168
319
|
};
|
|
169
320
|
|
|
170
321
|
// src/feeef/repositories/stores.ts
|
|
@@ -177,13 +328,122 @@ var StoreRepository = class extends ModelRepository {
|
|
|
177
328
|
super("stores", client);
|
|
178
329
|
}
|
|
179
330
|
/**
|
|
180
|
-
*
|
|
181
|
-
* @param options The options for
|
|
182
|
-
* @returns A Promise that resolves to
|
|
331
|
+
* Lists stores with optional filtering.
|
|
332
|
+
* @param options - The options for listing stores.
|
|
333
|
+
* @returns A Promise that resolves to a list of Store entities.
|
|
334
|
+
*/
|
|
335
|
+
async list(options) {
|
|
336
|
+
const { userId, ...listOptions } = options || {};
|
|
337
|
+
return super.list({
|
|
338
|
+
...listOptions,
|
|
339
|
+
params: {
|
|
340
|
+
...listOptions.params,
|
|
341
|
+
...userId && { user_id: userId }
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Gets the summary for a store.
|
|
347
|
+
* @param options - The summary options including store ID and date range.
|
|
348
|
+
* @returns A Promise that resolves to the store summary.
|
|
349
|
+
*/
|
|
350
|
+
async summary(options) {
|
|
351
|
+
const { id, from, to } = options;
|
|
352
|
+
const params = {};
|
|
353
|
+
if (from) params.from = from instanceof Date ? from.toISOString() : from;
|
|
354
|
+
if (to) params.to = to instanceof Date ? to.toISOString() : to;
|
|
355
|
+
const res = await this.client.get(`/${this.resource}/${id}/summary`, { params });
|
|
356
|
+
return res.data;
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Gets the orders chart data for a store.
|
|
360
|
+
* @param id - The store ID.
|
|
361
|
+
* @returns A Promise that resolves to a map of date to order count.
|
|
183
362
|
*/
|
|
184
|
-
async
|
|
185
|
-
const
|
|
186
|
-
|
|
363
|
+
async chart(id) {
|
|
364
|
+
const res = await this.client.get(`/${this.resource}/${id}/chart`);
|
|
365
|
+
const chartData = /* @__PURE__ */ new Map();
|
|
366
|
+
if (res.data.orders) {
|
|
367
|
+
for (const [key, value] of Object.entries(res.data.orders)) {
|
|
368
|
+
chartData.set(new Date(key), Number(value));
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
return chartData;
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Adds a member to the store.
|
|
375
|
+
* @param storeId - The store ID.
|
|
376
|
+
* @param data - The member data.
|
|
377
|
+
* @returns A Promise that resolves to the added member.
|
|
378
|
+
*/
|
|
379
|
+
async addMember(storeId, data) {
|
|
380
|
+
const res = await this.client.post(`/${this.resource}/${storeId}/members`, {
|
|
381
|
+
email: data.email,
|
|
382
|
+
role: data.role,
|
|
383
|
+
name: data.name,
|
|
384
|
+
metadata: data.metadata
|
|
385
|
+
});
|
|
386
|
+
return res.data;
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Edits a store member.
|
|
390
|
+
* @param storeId - The store ID.
|
|
391
|
+
* @param memberId - The member ID.
|
|
392
|
+
* @param data - The update data.
|
|
393
|
+
* @returns A Promise that resolves to the updated member.
|
|
394
|
+
*/
|
|
395
|
+
async editMember(storeId, memberId, data) {
|
|
396
|
+
const res = await this.client.put(`/${this.resource}/${storeId}/members/${memberId}`, {
|
|
397
|
+
role: data.role,
|
|
398
|
+
name: data.name,
|
|
399
|
+
metadata: data.metadata
|
|
400
|
+
});
|
|
401
|
+
return res.data;
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Removes a member from the store.
|
|
405
|
+
* @param storeId - The store ID.
|
|
406
|
+
* @param memberId - The member ID.
|
|
407
|
+
* @returns A Promise that resolves when the member is removed.
|
|
408
|
+
*/
|
|
409
|
+
async removeMember(storeId, memberId) {
|
|
410
|
+
await this.client.delete(`/${this.resource}/${storeId}/members/${memberId}`);
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Upgrades or renews a store's subscription plan.
|
|
414
|
+
* @param id - The store ID.
|
|
415
|
+
* @param plan - The plan type to upgrade to.
|
|
416
|
+
* @param months - The number of months (1-12).
|
|
417
|
+
* @returns A Promise that resolves when the upgrade is complete.
|
|
418
|
+
*/
|
|
419
|
+
async upgrade(id, plan, months) {
|
|
420
|
+
await this.client.post(`/${this.resource}/${id}/subscription/upgrade`, {
|
|
421
|
+
plan,
|
|
422
|
+
months
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Purchases additional points for a store's subscription.
|
|
427
|
+
* @param id - The store ID.
|
|
428
|
+
* @param points - The number of points to purchase.
|
|
429
|
+
* @returns A Promise that resolves when the charge is complete.
|
|
430
|
+
*/
|
|
431
|
+
async charge(id, points) {
|
|
432
|
+
await this.client.post(`/${this.resource}/${id}/subscription/charge`, {
|
|
433
|
+
points
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* Pays store due amount.
|
|
438
|
+
* @param storeId - The store ID.
|
|
439
|
+
* @param amount - The amount of due to pay (in points).
|
|
440
|
+
* @returns A Promise that resolves to the payment result.
|
|
441
|
+
*/
|
|
442
|
+
async payDue(storeId, amount) {
|
|
443
|
+
const res = await this.client.post(`/${this.resource}/${storeId}/subscription/payDue`, {
|
|
444
|
+
amount
|
|
445
|
+
});
|
|
446
|
+
return res.data;
|
|
187
447
|
}
|
|
188
448
|
};
|
|
189
449
|
|
|
@@ -490,13 +750,40 @@ var DepositRepository = class extends ModelRepository {
|
|
|
490
750
|
super("deposits", client);
|
|
491
751
|
}
|
|
492
752
|
/**
|
|
493
|
-
*
|
|
753
|
+
* Lists deposits with optional filtering.
|
|
754
|
+
* @param options - The options for listing deposits.
|
|
755
|
+
* @returns A Promise that resolves to a list of Deposit entities.
|
|
756
|
+
*/
|
|
757
|
+
async list(options) {
|
|
758
|
+
const params = { ...options?.params };
|
|
759
|
+
if (options) {
|
|
760
|
+
if (options.page) params.page = options.page;
|
|
761
|
+
if (options.offset) params.offset = options.offset;
|
|
762
|
+
if (options.limit) params.limit = options.limit;
|
|
763
|
+
if (options.userId) params.user_id = options.userId;
|
|
764
|
+
if (options.status) {
|
|
765
|
+
params.status = Array.isArray(options.status) ? options.status : [options.status];
|
|
766
|
+
}
|
|
767
|
+
if (options.paymentMethod) params.payment_method = options.paymentMethod;
|
|
768
|
+
if (options.createdAfter) {
|
|
769
|
+
params.created_after = options.createdAfter instanceof Date ? options.createdAfter.toISOString() : options.createdAfter;
|
|
770
|
+
}
|
|
771
|
+
if (options.createdBefore) {
|
|
772
|
+
params.created_before = options.createdBefore instanceof Date ? options.createdBefore.toISOString() : options.createdBefore;
|
|
773
|
+
}
|
|
774
|
+
if (options.minAmount !== void 0) params.min_amount = options.minAmount;
|
|
775
|
+
if (options.maxAmount !== void 0) params.max_amount = options.maxAmount;
|
|
776
|
+
if (options.q) params.q = options.q;
|
|
777
|
+
}
|
|
778
|
+
return super.list({ params });
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
* Create a new deposit request (for anonymous/guest users)
|
|
494
782
|
* @param data - The deposit data
|
|
495
783
|
* @returns Promise that resolves to the created deposit
|
|
496
784
|
*/
|
|
497
785
|
async send(data) {
|
|
498
|
-
const
|
|
499
|
-
const res = await this.client.post(`/${this.resource}/send`, output);
|
|
786
|
+
const res = await this.client.post(`/${this.resource}/send`, data);
|
|
500
787
|
return res.data;
|
|
501
788
|
}
|
|
502
789
|
/**
|
|
@@ -541,6 +828,51 @@ var DepositRepository = class extends ModelRepository {
|
|
|
541
828
|
const res = await this.client.get(`/${this.resource}/paypal/order/${orderId}`);
|
|
542
829
|
return res.data;
|
|
543
830
|
}
|
|
831
|
+
/**
|
|
832
|
+
* Accept a pending deposit (admin only)
|
|
833
|
+
* @param depositId - The deposit ID to accept
|
|
834
|
+
* @param note - Optional note for the status change
|
|
835
|
+
* @returns Promise that resolves to the updated deposit
|
|
836
|
+
*/
|
|
837
|
+
async accept(depositId, note) {
|
|
838
|
+
return this.update({
|
|
839
|
+
id: depositId,
|
|
840
|
+
data: {
|
|
841
|
+
status: "completed",
|
|
842
|
+
note
|
|
843
|
+
}
|
|
844
|
+
});
|
|
845
|
+
}
|
|
846
|
+
/**
|
|
847
|
+
* Reject a pending deposit (admin only)
|
|
848
|
+
* @param depositId - The deposit ID to reject
|
|
849
|
+
* @param note - Optional note for the rejection reason
|
|
850
|
+
* @returns Promise that resolves to the updated deposit
|
|
851
|
+
*/
|
|
852
|
+
async reject(depositId, note) {
|
|
853
|
+
return this.update({
|
|
854
|
+
id: depositId,
|
|
855
|
+
data: {
|
|
856
|
+
status: "failed",
|
|
857
|
+
note
|
|
858
|
+
}
|
|
859
|
+
});
|
|
860
|
+
}
|
|
861
|
+
/**
|
|
862
|
+
* Cancel a pending deposit
|
|
863
|
+
* @param depositId - The deposit ID to cancel
|
|
864
|
+
* @param note - Optional note for the cancellation reason
|
|
865
|
+
* @returns Promise that resolves to the updated deposit
|
|
866
|
+
*/
|
|
867
|
+
async cancel(depositId, note) {
|
|
868
|
+
return this.update({
|
|
869
|
+
id: depositId,
|
|
870
|
+
data: {
|
|
871
|
+
status: "cancelled",
|
|
872
|
+
note
|
|
873
|
+
}
|
|
874
|
+
});
|
|
875
|
+
}
|
|
544
876
|
};
|
|
545
877
|
|
|
546
878
|
// src/feeef/repositories/transfers.ts
|
|
@@ -552,6 +884,62 @@ var TransferRepository = class extends ModelRepository {
|
|
|
552
884
|
constructor(client) {
|
|
553
885
|
super("transfers", client);
|
|
554
886
|
}
|
|
887
|
+
/**
|
|
888
|
+
* Lists transfers with optional filtering.
|
|
889
|
+
* @param options - The options for listing transfers.
|
|
890
|
+
* @returns A Promise that resolves to a list of Transfer entities.
|
|
891
|
+
*/
|
|
892
|
+
async list(options) {
|
|
893
|
+
const params = { ...options?.params };
|
|
894
|
+
if (options) {
|
|
895
|
+
if (options.page) params.page = options.page;
|
|
896
|
+
if (options.offset) params.offset = options.offset;
|
|
897
|
+
if (options.limit) params.limit = options.limit;
|
|
898
|
+
if (options.debitAccountId) params.debit_account_id = options.debitAccountId;
|
|
899
|
+
if (options.creditAccountId) params.credit_account_id = options.creditAccountId;
|
|
900
|
+
if (options.accountId) params.account_id = options.accountId;
|
|
901
|
+
if (options.type) {
|
|
902
|
+
params.type = Array.isArray(options.type) ? options.type : [options.type];
|
|
903
|
+
}
|
|
904
|
+
if (options.referenceId) params.reference_id = options.referenceId;
|
|
905
|
+
if (options.createdAfter) {
|
|
906
|
+
params.created_after = options.createdAfter instanceof Date ? options.createdAfter.toISOString() : options.createdAfter;
|
|
907
|
+
}
|
|
908
|
+
if (options.createdBefore) {
|
|
909
|
+
params.created_before = options.createdBefore instanceof Date ? options.createdBefore.toISOString() : options.createdBefore;
|
|
910
|
+
}
|
|
911
|
+
if (options.minAmount !== void 0) params.min_amount = options.minAmount;
|
|
912
|
+
if (options.maxAmount !== void 0) params.max_amount = options.maxAmount;
|
|
913
|
+
}
|
|
914
|
+
return super.list({ params });
|
|
915
|
+
}
|
|
916
|
+
/**
|
|
917
|
+
* Lists transfers for a specific account (either as debit or credit).
|
|
918
|
+
* @param accountId - The account ID.
|
|
919
|
+
* @param options - Optional list options.
|
|
920
|
+
* @returns A Promise that resolves to a list of Transfer entities.
|
|
921
|
+
*/
|
|
922
|
+
async listByAccount(accountId, options) {
|
|
923
|
+
return this.list({ ...options, accountId });
|
|
924
|
+
}
|
|
925
|
+
/**
|
|
926
|
+
* Lists transfers by type.
|
|
927
|
+
* @param type - The transfer type(s).
|
|
928
|
+
* @param options - Optional list options.
|
|
929
|
+
* @returns A Promise that resolves to a list of Transfer entities.
|
|
930
|
+
*/
|
|
931
|
+
async listByType(type, options) {
|
|
932
|
+
return this.list({ ...options, type });
|
|
933
|
+
}
|
|
934
|
+
/**
|
|
935
|
+
* Lists transfers by reference ID.
|
|
936
|
+
* @param referenceId - The reference ID.
|
|
937
|
+
* @param options - Optional list options.
|
|
938
|
+
* @returns A Promise that resolves to a list of Transfer entities.
|
|
939
|
+
*/
|
|
940
|
+
async listByReferenceId(referenceId, options) {
|
|
941
|
+
return this.list({ ...options, referenceId });
|
|
942
|
+
}
|
|
555
943
|
};
|
|
556
944
|
|
|
557
945
|
// src/feeef/repositories/categories.ts
|
|
@@ -563,6 +951,52 @@ var CategoryRepository = class extends ModelRepository {
|
|
|
563
951
|
constructor(client) {
|
|
564
952
|
super("categories", client);
|
|
565
953
|
}
|
|
954
|
+
/**
|
|
955
|
+
* Lists categories with optional filtering.
|
|
956
|
+
* @param options - The options for listing categories.
|
|
957
|
+
* @returns A Promise that resolves to a list of Category entities.
|
|
958
|
+
*/
|
|
959
|
+
async list(options) {
|
|
960
|
+
const { storeId, parentId, q, ...listOptions } = options || {};
|
|
961
|
+
const params = {
|
|
962
|
+
...listOptions.params
|
|
963
|
+
};
|
|
964
|
+
if (storeId) params.store_id = storeId;
|
|
965
|
+
if (parentId !== void 0) params.parent_id = parentId;
|
|
966
|
+
if (q) params.q = q;
|
|
967
|
+
return super.list({
|
|
968
|
+
...listOptions,
|
|
969
|
+
params
|
|
970
|
+
});
|
|
971
|
+
}
|
|
972
|
+
/**
|
|
973
|
+
* Lists categories for a specific store.
|
|
974
|
+
* @param storeId - The store ID.
|
|
975
|
+
* @param options - Optional list options.
|
|
976
|
+
* @returns A Promise that resolves to a list of Category entities.
|
|
977
|
+
*/
|
|
978
|
+
async listByStore(storeId, options) {
|
|
979
|
+
return this.list({ ...options, storeId });
|
|
980
|
+
}
|
|
981
|
+
/**
|
|
982
|
+
* Lists root categories (no parent) for a store.
|
|
983
|
+
* @param storeId - The store ID.
|
|
984
|
+
* @param options - Optional list options.
|
|
985
|
+
* @returns A Promise that resolves to a list of root Category entities.
|
|
986
|
+
*/
|
|
987
|
+
async listRootCategories(storeId, options) {
|
|
988
|
+
return this.list({ ...options, storeId, parentId: null });
|
|
989
|
+
}
|
|
990
|
+
/**
|
|
991
|
+
* Lists child categories for a parent category.
|
|
992
|
+
* @param storeId - The store ID.
|
|
993
|
+
* @param parentId - The parent category ID.
|
|
994
|
+
* @param options - Optional list options.
|
|
995
|
+
* @returns A Promise that resolves to a list of child Category entities.
|
|
996
|
+
*/
|
|
997
|
+
async listChildren(storeId, parentId, options) {
|
|
998
|
+
return this.list({ ...options, storeId, parentId });
|
|
999
|
+
}
|
|
566
1000
|
};
|
|
567
1001
|
|
|
568
1002
|
// src/feeef/repositories/countries.ts
|
|
@@ -837,25 +1271,198 @@ var ShippingPriceRepository = class extends ModelRepository {
|
|
|
837
1271
|
super("shipping_prices", client);
|
|
838
1272
|
}
|
|
839
1273
|
/**
|
|
840
|
-
*
|
|
841
|
-
* @param options The options for
|
|
842
|
-
* @returns A Promise that resolves to
|
|
1274
|
+
* Lists shipping prices with optional filtering.
|
|
1275
|
+
* @param options - The options for listing shipping prices.
|
|
1276
|
+
* @returns A Promise that resolves to a list of ShippingPrice entities.
|
|
843
1277
|
*/
|
|
844
|
-
async
|
|
845
|
-
const
|
|
846
|
-
|
|
1278
|
+
async list(options) {
|
|
1279
|
+
const { storeId, status, ...listOptions } = options || {};
|
|
1280
|
+
const params = {
|
|
1281
|
+
...listOptions.params
|
|
1282
|
+
};
|
|
1283
|
+
if (storeId) params.store_id = storeId;
|
|
1284
|
+
if (status) params.status = Array.isArray(status) ? status : [status];
|
|
1285
|
+
return super.list({
|
|
1286
|
+
...listOptions,
|
|
1287
|
+
params
|
|
1288
|
+
});
|
|
847
1289
|
}
|
|
848
1290
|
/**
|
|
849
|
-
*
|
|
1291
|
+
* Lists shipping prices for a specific store.
|
|
850
1292
|
* @param storeId The store ID to search for.
|
|
851
1293
|
* @returns A Promise that resolves to the ShippingPrice entities for the store.
|
|
852
1294
|
*/
|
|
853
1295
|
async listByStore(storeId) {
|
|
854
|
-
const response = await this.list({
|
|
1296
|
+
const response = await this.list({ storeId });
|
|
855
1297
|
return response.data;
|
|
856
1298
|
}
|
|
857
1299
|
};
|
|
858
1300
|
|
|
1301
|
+
// src/feeef/repositories/shipping_methods.ts
|
|
1302
|
+
var ShippingMethodRepository = class extends ModelRepository {
|
|
1303
|
+
/**
|
|
1304
|
+
* Constructs a new ShippingMethodRepository instance.
|
|
1305
|
+
* @param client The AxiosInstance used for making HTTP requests.
|
|
1306
|
+
*/
|
|
1307
|
+
constructor(client) {
|
|
1308
|
+
super("shipping_methods", client);
|
|
1309
|
+
}
|
|
1310
|
+
/**
|
|
1311
|
+
* Lists shipping methods with optional filtering.
|
|
1312
|
+
* @param options - The options for listing shipping methods.
|
|
1313
|
+
* @returns A Promise that resolves to a list of ShippingMethod entities.
|
|
1314
|
+
*/
|
|
1315
|
+
async list(options) {
|
|
1316
|
+
const { storeId, status, policy, ...listOptions } = options || {};
|
|
1317
|
+
const params = {
|
|
1318
|
+
...listOptions.params
|
|
1319
|
+
};
|
|
1320
|
+
if (storeId) params.store_id = storeId;
|
|
1321
|
+
if (status) params.status = Array.isArray(status) ? status : [status];
|
|
1322
|
+
if (policy) params.policy = policy;
|
|
1323
|
+
return super.list({
|
|
1324
|
+
...listOptions,
|
|
1325
|
+
params
|
|
1326
|
+
});
|
|
1327
|
+
}
|
|
1328
|
+
/**
|
|
1329
|
+
* Lists shipping methods for a specific store.
|
|
1330
|
+
* @param storeId - The store ID.
|
|
1331
|
+
* @param options - Optional list options.
|
|
1332
|
+
* @returns A Promise that resolves to a list of ShippingMethod entities.
|
|
1333
|
+
*/
|
|
1334
|
+
async listByStore(storeId, options) {
|
|
1335
|
+
return this.list({ ...options, storeId });
|
|
1336
|
+
}
|
|
1337
|
+
};
|
|
1338
|
+
|
|
1339
|
+
// src/feeef/repositories/feedbacks.ts
|
|
1340
|
+
var FeedbackRepository = class extends ModelRepository {
|
|
1341
|
+
/**
|
|
1342
|
+
* Constructs a new FeedbackRepository instance.
|
|
1343
|
+
* @param client The AxiosInstance used for making HTTP requests.
|
|
1344
|
+
*/
|
|
1345
|
+
constructor(client) {
|
|
1346
|
+
super("feedbacks", client);
|
|
1347
|
+
}
|
|
1348
|
+
/**
|
|
1349
|
+
* Lists feedbacks with optional filtering.
|
|
1350
|
+
* @param options - The options for listing feedbacks.
|
|
1351
|
+
* @returns A Promise that resolves to a list of Feedback entities.
|
|
1352
|
+
*/
|
|
1353
|
+
async list(options) {
|
|
1354
|
+
const params = {};
|
|
1355
|
+
if (options) {
|
|
1356
|
+
if (options.page) params.page = options.page;
|
|
1357
|
+
if (options.offset) params.offset = options.offset;
|
|
1358
|
+
if (options.limit) params.limit = options.limit;
|
|
1359
|
+
if (options.status) params.status = options.status;
|
|
1360
|
+
if (options.priority) params.priority = options.priority;
|
|
1361
|
+
if (options.tags) params.tags = options.tags;
|
|
1362
|
+
if (options.q) params.q = options.q;
|
|
1363
|
+
if (options.createdAfter) {
|
|
1364
|
+
params.created_after = options.createdAfter instanceof Date ? options.createdAfter.toISOString() : options.createdAfter;
|
|
1365
|
+
}
|
|
1366
|
+
if (options.createdBefore) {
|
|
1367
|
+
params.created_before = options.createdBefore instanceof Date ? options.createdBefore.toISOString() : options.createdBefore;
|
|
1368
|
+
}
|
|
1369
|
+
if (options.updatedAfter) {
|
|
1370
|
+
params.updated_after = options.updatedAfter instanceof Date ? options.updatedAfter.toISOString() : options.updatedAfter;
|
|
1371
|
+
}
|
|
1372
|
+
if (options.updatedBefore) {
|
|
1373
|
+
params.updated_before = options.updatedBefore instanceof Date ? options.updatedBefore.toISOString() : options.updatedBefore;
|
|
1374
|
+
}
|
|
1375
|
+
if (options.resolvedAfter) {
|
|
1376
|
+
params.resolved_after = options.resolvedAfter instanceof Date ? options.resolvedAfter.toISOString() : options.resolvedAfter;
|
|
1377
|
+
}
|
|
1378
|
+
if (options.resolvedBefore) {
|
|
1379
|
+
params.resolved_before = options.resolvedBefore instanceof Date ? options.resolvedBefore.toISOString() : options.resolvedBefore;
|
|
1380
|
+
}
|
|
1381
|
+
if (options.resolved !== void 0) params.resolved = options.resolved;
|
|
1382
|
+
}
|
|
1383
|
+
return super.list({ params });
|
|
1384
|
+
}
|
|
1385
|
+
/**
|
|
1386
|
+
* Adds a comment to existing feedback.
|
|
1387
|
+
* @param id - The feedback ID.
|
|
1388
|
+
* @param comment - The comment to add.
|
|
1389
|
+
* @returns A Promise that resolves to the updated Feedback entity.
|
|
1390
|
+
*/
|
|
1391
|
+
async addComment(id, comment) {
|
|
1392
|
+
const res = await this.client.post(`/${this.resource}/${id}/comments`, { comment });
|
|
1393
|
+
return res.data;
|
|
1394
|
+
}
|
|
1395
|
+
/**
|
|
1396
|
+
* Creates feedback with file attachments.
|
|
1397
|
+
* @param data - The feedback data.
|
|
1398
|
+
* @param files - Optional array of files to attach.
|
|
1399
|
+
* @param params - Optional query parameters.
|
|
1400
|
+
* @returns A Promise that resolves to the created Feedback entity.
|
|
1401
|
+
*/
|
|
1402
|
+
async createWithFiles(data, files, params) {
|
|
1403
|
+
const formData = new FormData();
|
|
1404
|
+
formData.append("title", data.title);
|
|
1405
|
+
if (data.details) formData.append("details", data.details);
|
|
1406
|
+
if (data.priority) formData.append("priority", data.priority);
|
|
1407
|
+
if (data.appVersion) formData.append("appVersion", data.appVersion);
|
|
1408
|
+
if (data.tags) formData.append("tags", JSON.stringify(data.tags));
|
|
1409
|
+
if (data.attachments) formData.append("attachments", JSON.stringify(data.attachments));
|
|
1410
|
+
if (data.metadata) formData.append("metadata", JSON.stringify(data.metadata));
|
|
1411
|
+
if (files) {
|
|
1412
|
+
for (const file of files) {
|
|
1413
|
+
formData.append("files", file);
|
|
1414
|
+
}
|
|
1415
|
+
}
|
|
1416
|
+
if (params) {
|
|
1417
|
+
for (const [key, value] of Object.entries(params)) {
|
|
1418
|
+
formData.append(key, String(value));
|
|
1419
|
+
}
|
|
1420
|
+
}
|
|
1421
|
+
const res = await this.client.post(`/${this.resource}`, formData, {
|
|
1422
|
+
headers: {
|
|
1423
|
+
"Content-Type": "multipart/form-data"
|
|
1424
|
+
}
|
|
1425
|
+
});
|
|
1426
|
+
return res.data;
|
|
1427
|
+
}
|
|
1428
|
+
/**
|
|
1429
|
+
* Updates feedback with additional files.
|
|
1430
|
+
* @param id - The feedback ID.
|
|
1431
|
+
* @param data - The update data.
|
|
1432
|
+
* @param files - Optional array of files to attach.
|
|
1433
|
+
* @param params - Optional query parameters.
|
|
1434
|
+
* @returns A Promise that resolves to the updated Feedback entity.
|
|
1435
|
+
*/
|
|
1436
|
+
async updateWithFiles(id, data, files, params) {
|
|
1437
|
+
const formData = new FormData();
|
|
1438
|
+
if (data.title) formData.append("title", data.title);
|
|
1439
|
+
if (data.details) formData.append("details", data.details);
|
|
1440
|
+
if (data.status) formData.append("status", data.status);
|
|
1441
|
+
if (data.priority) formData.append("priority", data.priority);
|
|
1442
|
+
if (data.appVersion) formData.append("appVersion", data.appVersion);
|
|
1443
|
+
if (data.tags) formData.append("tags", JSON.stringify(data.tags));
|
|
1444
|
+
if (data.attachments) formData.append("attachments", JSON.stringify(data.attachments));
|
|
1445
|
+
if (data.metadata) formData.append("metadata", JSON.stringify(data.metadata));
|
|
1446
|
+
if (data.comment) formData.append("comment", data.comment);
|
|
1447
|
+
if (files) {
|
|
1448
|
+
for (const file of files) {
|
|
1449
|
+
formData.append("files", file);
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
if (params) {
|
|
1453
|
+
for (const [key, value] of Object.entries(params)) {
|
|
1454
|
+
formData.append(key, String(value));
|
|
1455
|
+
}
|
|
1456
|
+
}
|
|
1457
|
+
const res = await this.client.put(`/${this.resource}/${id}`, formData, {
|
|
1458
|
+
headers: {
|
|
1459
|
+
"Content-Type": "multipart/form-data"
|
|
1460
|
+
}
|
|
1461
|
+
});
|
|
1462
|
+
return res.data;
|
|
1463
|
+
}
|
|
1464
|
+
};
|
|
1465
|
+
|
|
859
1466
|
// src/core/entities/order.ts
|
|
860
1467
|
var OrderStatus = /* @__PURE__ */ ((OrderStatus2) => {
|
|
861
1468
|
OrderStatus2["draft"] = "draft";
|
|
@@ -1795,6 +2402,512 @@ var ActionsService = class {
|
|
|
1795
2402
|
}
|
|
1796
2403
|
};
|
|
1797
2404
|
|
|
2405
|
+
// src/feeef/services/notifications.ts
|
|
2406
|
+
var NotificationsService = class {
|
|
2407
|
+
client;
|
|
2408
|
+
constructor(client) {
|
|
2409
|
+
this.client = client;
|
|
2410
|
+
}
|
|
2411
|
+
/**
|
|
2412
|
+
* Send notifications to filtered users
|
|
2413
|
+
* Admin only - uses filterator to filter users
|
|
2414
|
+
* @param options - Notification options including filterator
|
|
2415
|
+
* @returns Promise that resolves to send statistics
|
|
2416
|
+
*/
|
|
2417
|
+
async send(options) {
|
|
2418
|
+
const payload = {
|
|
2419
|
+
title: options.title,
|
|
2420
|
+
body: options.body
|
|
2421
|
+
};
|
|
2422
|
+
if (options.data) {
|
|
2423
|
+
payload.data = options.data;
|
|
2424
|
+
}
|
|
2425
|
+
if (options.clickUrl) {
|
|
2426
|
+
payload.clickUrl = options.clickUrl;
|
|
2427
|
+
}
|
|
2428
|
+
if (options.sound) {
|
|
2429
|
+
payload.sound = options.sound;
|
|
2430
|
+
}
|
|
2431
|
+
if (options.filterator) {
|
|
2432
|
+
payload.filterator = typeof options.filterator === "string" ? options.filterator : JSON.stringify(options.filterator);
|
|
2433
|
+
}
|
|
2434
|
+
if (options.q) {
|
|
2435
|
+
payload.q = options.q;
|
|
2436
|
+
}
|
|
2437
|
+
if (options.page) {
|
|
2438
|
+
payload.page = options.page;
|
|
2439
|
+
}
|
|
2440
|
+
if (options.limit) {
|
|
2441
|
+
payload.limit = options.limit;
|
|
2442
|
+
}
|
|
2443
|
+
const res = await this.client.post("/notifications/send", payload);
|
|
2444
|
+
return res.data;
|
|
2445
|
+
}
|
|
2446
|
+
};
|
|
2447
|
+
|
|
2448
|
+
// src/feeef/services/storage.ts
|
|
2449
|
+
var StorageService = class {
|
|
2450
|
+
client;
|
|
2451
|
+
constructor(client) {
|
|
2452
|
+
this.client = client;
|
|
2453
|
+
}
|
|
2454
|
+
/**
|
|
2455
|
+
* Uploads a file
|
|
2456
|
+
* @param options - Upload options
|
|
2457
|
+
* @returns Promise resolving to the upload result
|
|
2458
|
+
*/
|
|
2459
|
+
async upload(options) {
|
|
2460
|
+
const formData = new FormData();
|
|
2461
|
+
formData.append("file", options.file);
|
|
2462
|
+
if (options.folder) {
|
|
2463
|
+
formData.append("folder", options.folder);
|
|
2464
|
+
}
|
|
2465
|
+
const response = await this.client.post("/services/storage/upload", formData, {
|
|
2466
|
+
headers: {
|
|
2467
|
+
"Content-Type": "multipart/form-data"
|
|
2468
|
+
},
|
|
2469
|
+
onUploadProgress: options.onProgress ? (progressEvent) => {
|
|
2470
|
+
const total = progressEvent.total || 0;
|
|
2471
|
+
const loaded = progressEvent.loaded || 0;
|
|
2472
|
+
options.onProgress({
|
|
2473
|
+
loaded,
|
|
2474
|
+
total,
|
|
2475
|
+
percentage: total > 0 ? Math.round(loaded / total * 100) : 0
|
|
2476
|
+
});
|
|
2477
|
+
} : void 0,
|
|
2478
|
+
cancelToken: options.cancelToken
|
|
2479
|
+
});
|
|
2480
|
+
return {
|
|
2481
|
+
url: response.data.url
|
|
2482
|
+
};
|
|
2483
|
+
}
|
|
2484
|
+
/**
|
|
2485
|
+
* Uploads bytes directly
|
|
2486
|
+
* @param options - Upload options
|
|
2487
|
+
* @returns Promise resolving to the upload result
|
|
2488
|
+
*/
|
|
2489
|
+
async uploadBytes(options) {
|
|
2490
|
+
const blob = new Blob([options.bytes]);
|
|
2491
|
+
const file = new File([blob], options.filename);
|
|
2492
|
+
return this.upload({
|
|
2493
|
+
file,
|
|
2494
|
+
folder: options.folder,
|
|
2495
|
+
onProgress: options.onProgress,
|
|
2496
|
+
cancelToken: options.cancelToken
|
|
2497
|
+
});
|
|
2498
|
+
}
|
|
2499
|
+
/**
|
|
2500
|
+
* Uploads a file for a store
|
|
2501
|
+
* @param file - The file to upload
|
|
2502
|
+
* @param storeId - The store ID
|
|
2503
|
+
* @param options - Additional options
|
|
2504
|
+
* @returns Promise resolving to the upload result
|
|
2505
|
+
*/
|
|
2506
|
+
async uploadStoreFile(file, storeId, options) {
|
|
2507
|
+
const folder = options?.subfolder ? `stores/${storeId}/${options.subfolder}` : `stores/${storeId}`;
|
|
2508
|
+
return this.upload({
|
|
2509
|
+
file,
|
|
2510
|
+
folder,
|
|
2511
|
+
onProgress: options?.onProgress,
|
|
2512
|
+
cancelToken: options?.cancelToken
|
|
2513
|
+
});
|
|
2514
|
+
}
|
|
2515
|
+
/**
|
|
2516
|
+
* Uploads a product image
|
|
2517
|
+
* @param file - The file to upload
|
|
2518
|
+
* @param storeId - The store ID
|
|
2519
|
+
* @param productId - The product ID
|
|
2520
|
+
* @param options - Additional options
|
|
2521
|
+
* @returns Promise resolving to the upload result
|
|
2522
|
+
*/
|
|
2523
|
+
async uploadProductImage(file, storeId, productId, options) {
|
|
2524
|
+
return this.uploadStoreFile(file, storeId, {
|
|
2525
|
+
subfolder: `products/${productId}`,
|
|
2526
|
+
onProgress: options?.onProgress,
|
|
2527
|
+
cancelToken: options?.cancelToken
|
|
2528
|
+
});
|
|
2529
|
+
}
|
|
2530
|
+
/**
|
|
2531
|
+
* Uploads a store logo
|
|
2532
|
+
* @param file - The file to upload
|
|
2533
|
+
* @param storeId - The store ID
|
|
2534
|
+
* @param options - Additional options
|
|
2535
|
+
* @returns Promise resolving to the upload result
|
|
2536
|
+
*/
|
|
2537
|
+
async uploadStoreLogo(file, storeId, options) {
|
|
2538
|
+
return this.uploadStoreFile(file, storeId, {
|
|
2539
|
+
subfolder: "logo",
|
|
2540
|
+
onProgress: options?.onProgress,
|
|
2541
|
+
cancelToken: options?.cancelToken
|
|
2542
|
+
});
|
|
2543
|
+
}
|
|
2544
|
+
/**
|
|
2545
|
+
* Uploads a store icon
|
|
2546
|
+
* @param file - The file to upload
|
|
2547
|
+
* @param storeId - The store ID
|
|
2548
|
+
* @param options - Additional options
|
|
2549
|
+
* @returns Promise resolving to the upload result
|
|
2550
|
+
*/
|
|
2551
|
+
async uploadStoreIcon(file, storeId, options) {
|
|
2552
|
+
return this.uploadStoreFile(file, storeId, {
|
|
2553
|
+
subfolder: "icon",
|
|
2554
|
+
onProgress: options?.onProgress,
|
|
2555
|
+
cancelToken: options?.cancelToken
|
|
2556
|
+
});
|
|
2557
|
+
}
|
|
2558
|
+
/**
|
|
2559
|
+
* Uploads a user avatar
|
|
2560
|
+
* @param file - The file to upload
|
|
2561
|
+
* @param userId - The user ID
|
|
2562
|
+
* @param options - Additional options
|
|
2563
|
+
* @returns Promise resolving to the upload result
|
|
2564
|
+
*/
|
|
2565
|
+
async uploadUserAvatar(file, userId, options) {
|
|
2566
|
+
return this.upload({
|
|
2567
|
+
file,
|
|
2568
|
+
folder: `users/${userId}/avatar`,
|
|
2569
|
+
onProgress: options?.onProgress,
|
|
2570
|
+
cancelToken: options?.cancelToken
|
|
2571
|
+
});
|
|
2572
|
+
}
|
|
2573
|
+
/**
|
|
2574
|
+
* Uploads a feedback attachment
|
|
2575
|
+
* @param file - The file to upload
|
|
2576
|
+
* @param feedbackId - The feedback ID
|
|
2577
|
+
* @param options - Additional options
|
|
2578
|
+
* @returns Promise resolving to the upload result
|
|
2579
|
+
*/
|
|
2580
|
+
async uploadFeedbackAttachment(file, feedbackId, options) {
|
|
2581
|
+
return this.upload({
|
|
2582
|
+
file,
|
|
2583
|
+
folder: `feedbacks/${feedbackId}`,
|
|
2584
|
+
onProgress: options?.onProgress,
|
|
2585
|
+
cancelToken: options?.cancelToken
|
|
2586
|
+
});
|
|
2587
|
+
}
|
|
2588
|
+
};
|
|
2589
|
+
|
|
2590
|
+
// src/feeef/services/integrations.ts
|
|
2591
|
+
var EcotrackDeliveryIntegrationApi = class {
|
|
2592
|
+
client;
|
|
2593
|
+
integration;
|
|
2594
|
+
storeId;
|
|
2595
|
+
constructor(client, integration, storeId) {
|
|
2596
|
+
this.client = client;
|
|
2597
|
+
this.integration = integration;
|
|
2598
|
+
this.storeId = storeId;
|
|
2599
|
+
}
|
|
2600
|
+
/**
|
|
2601
|
+
* Gets delivery fees from Ecotrack
|
|
2602
|
+
*/
|
|
2603
|
+
async getDeliveryFees() {
|
|
2604
|
+
const res = await this.client.get(`/stores/${this.storeId}/integrations/ecotrack/fees`, {
|
|
2605
|
+
params: {
|
|
2606
|
+
baseUrl: this.integration.baseUrl,
|
|
2607
|
+
token: this.integration.token
|
|
2608
|
+
}
|
|
2609
|
+
});
|
|
2610
|
+
return res.data;
|
|
2611
|
+
}
|
|
2612
|
+
/**
|
|
2613
|
+
* Gets financial data from Ecotrack
|
|
2614
|
+
*/
|
|
2615
|
+
async getFinancialData(options) {
|
|
2616
|
+
const res = await this.client.get(`/stores/${this.storeId}/integrations/ecotrack/finance`, {
|
|
2617
|
+
params: {
|
|
2618
|
+
api_token: this.integration.token,
|
|
2619
|
+
...options
|
|
2620
|
+
}
|
|
2621
|
+
});
|
|
2622
|
+
return {
|
|
2623
|
+
success: res.data.success ?? false,
|
|
2624
|
+
amountsNotEncaissed: res.data.amounts_not_encaissed ?? 0,
|
|
2625
|
+
feesNotEncaissed: res.data.fees_not_encaissed ?? 0,
|
|
2626
|
+
notEncaissed: res.data.not_encaissed ?? 0,
|
|
2627
|
+
amountsEncaissed: res.data.amounts_encaissed ?? 0,
|
|
2628
|
+
feesEncaissed: res.data.fees_encaissed ?? 0,
|
|
2629
|
+
encaissed: res.data.encaissed ?? 0,
|
|
2630
|
+
amountsPaymentReady: res.data.amounts_payment_ready ?? 0,
|
|
2631
|
+
feesPaymentReady: res.data.fees_payment_ready ?? 0,
|
|
2632
|
+
paymentReady: res.data.payment_ready ?? 0
|
|
2633
|
+
};
|
|
2634
|
+
}
|
|
2635
|
+
/**
|
|
2636
|
+
* Gets statistics data from Ecotrack
|
|
2637
|
+
*/
|
|
2638
|
+
async getStatistics() {
|
|
2639
|
+
const res = await this.client.get(`/stores/${this.storeId}/integrations/ecotrack/statistics`);
|
|
2640
|
+
return {
|
|
2641
|
+
topWilaya: (res.data.top_wilaya || []).map((w) => ({
|
|
2642
|
+
wilayaId: w.wilaya_id ?? 0,
|
|
2643
|
+
total: w.total ?? 0,
|
|
2644
|
+
retours: w.retours ?? 0,
|
|
2645
|
+
livred: w.livred ?? 0,
|
|
2646
|
+
wilayaName: w.wilaya_name ?? ""
|
|
2647
|
+
})),
|
|
2648
|
+
todayActivity: {
|
|
2649
|
+
expedie: res.data.today_act?.expedie ?? 0,
|
|
2650
|
+
delivered: res.data.today_act?.delivered ?? 0,
|
|
2651
|
+
returned: res.data.today_act?.returned ?? 0,
|
|
2652
|
+
suspended: res.data.today_act?.suspended ?? 0
|
|
2653
|
+
},
|
|
2654
|
+
globalStats: {
|
|
2655
|
+
enTraitement: res.data.global?.enTraitement ?? 0,
|
|
2656
|
+
livred: res.data.global?.livred ?? 0,
|
|
2657
|
+
retours: res.data.global?.retours ?? 0,
|
|
2658
|
+
total: res.data.global?.total ?? 0
|
|
2659
|
+
}
|
|
2660
|
+
};
|
|
2661
|
+
}
|
|
2662
|
+
/**
|
|
2663
|
+
* Gets the sync status for this store's Ecotrack integration
|
|
2664
|
+
*/
|
|
2665
|
+
async getSyncStatus() {
|
|
2666
|
+
const res = await this.client.get(`/stores/${this.storeId}/integrations/ecotrack/sync/status`);
|
|
2667
|
+
return res.data;
|
|
2668
|
+
}
|
|
2669
|
+
/**
|
|
2670
|
+
* Triggers a sync of orders from Ecotrack
|
|
2671
|
+
*/
|
|
2672
|
+
async triggerSync(options) {
|
|
2673
|
+
const res = await this.client.post(`/stores/${this.storeId}/integrations/ecotrack/sync`, {
|
|
2674
|
+
startDate: options?.startDate instanceof Date ? options.startDate.toISOString() : options?.startDate,
|
|
2675
|
+
endDate: options?.endDate instanceof Date ? options.endDate.toISOString() : options?.endDate
|
|
2676
|
+
});
|
|
2677
|
+
return res.data;
|
|
2678
|
+
}
|
|
2679
|
+
};
|
|
2680
|
+
var YalidineAgent = /* @__PURE__ */ ((YalidineAgent2) => {
|
|
2681
|
+
YalidineAgent2["yalidine"] = "yalidine";
|
|
2682
|
+
YalidineAgent2["guepex"] = "guepex";
|
|
2683
|
+
return YalidineAgent2;
|
|
2684
|
+
})(YalidineAgent || {});
|
|
2685
|
+
var YalidineDeliveryIntegrationApi = class {
|
|
2686
|
+
client;
|
|
2687
|
+
integration;
|
|
2688
|
+
storeId;
|
|
2689
|
+
constructor(client, integration, storeId) {
|
|
2690
|
+
this.client = client;
|
|
2691
|
+
this.integration = integration;
|
|
2692
|
+
this.storeId = storeId;
|
|
2693
|
+
}
|
|
2694
|
+
/**
|
|
2695
|
+
* Gets delivery fees from Yalidine
|
|
2696
|
+
*/
|
|
2697
|
+
async getDeliveryFees() {
|
|
2698
|
+
const res = await this.client.get(`/stores/${this.storeId}/integrations/yalidine/fees`, {
|
|
2699
|
+
params: {
|
|
2700
|
+
id: this.integration.id,
|
|
2701
|
+
token: this.integration.token
|
|
2702
|
+
}
|
|
2703
|
+
});
|
|
2704
|
+
return res.data;
|
|
2705
|
+
}
|
|
2706
|
+
};
|
|
2707
|
+
var ProcolisDeliveryIntegrationApi = class {
|
|
2708
|
+
client;
|
|
2709
|
+
integration;
|
|
2710
|
+
storeId;
|
|
2711
|
+
constructor(client, integration, storeId) {
|
|
2712
|
+
this.client = client;
|
|
2713
|
+
this.integration = integration;
|
|
2714
|
+
this.storeId = storeId;
|
|
2715
|
+
}
|
|
2716
|
+
/**
|
|
2717
|
+
* Gets delivery fees from Procolis
|
|
2718
|
+
*/
|
|
2719
|
+
async getDeliveryFees() {
|
|
2720
|
+
const res = await this.client.get(`/stores/${this.storeId}/integrations/procolis/fees`, {
|
|
2721
|
+
params: {
|
|
2722
|
+
key: this.integration.key,
|
|
2723
|
+
token: this.integration.token
|
|
2724
|
+
}
|
|
2725
|
+
});
|
|
2726
|
+
return res.data;
|
|
2727
|
+
}
|
|
2728
|
+
/**
|
|
2729
|
+
* Sends an order to Procolis
|
|
2730
|
+
*/
|
|
2731
|
+
async send(orderId) {
|
|
2732
|
+
await this.client.post(`/stores/${this.storeId}/integrations/procolis/send`, {
|
|
2733
|
+
key: this.integration.key,
|
|
2734
|
+
token: this.integration.token,
|
|
2735
|
+
orderId
|
|
2736
|
+
});
|
|
2737
|
+
}
|
|
2738
|
+
};
|
|
2739
|
+
var NoestDeliveryIntegrationApi = class {
|
|
2740
|
+
client;
|
|
2741
|
+
integration;
|
|
2742
|
+
storeId;
|
|
2743
|
+
constructor(client, integration, storeId) {
|
|
2744
|
+
this.client = client;
|
|
2745
|
+
this.integration = integration;
|
|
2746
|
+
this.storeId = storeId;
|
|
2747
|
+
}
|
|
2748
|
+
/**
|
|
2749
|
+
* Gets delivery fees from Noest
|
|
2750
|
+
*/
|
|
2751
|
+
async getDeliveryFees() {
|
|
2752
|
+
const res = await this.client.get(`/stores/${this.storeId}/integrations/noest/fees`, {
|
|
2753
|
+
params: {
|
|
2754
|
+
guid: this.integration.guid,
|
|
2755
|
+
token: this.integration.token
|
|
2756
|
+
}
|
|
2757
|
+
});
|
|
2758
|
+
return res.data;
|
|
2759
|
+
}
|
|
2760
|
+
/**
|
|
2761
|
+
* Sends an order to Noest
|
|
2762
|
+
*/
|
|
2763
|
+
async send(orderId) {
|
|
2764
|
+
await this.client.post(`/stores/${this.storeId}/integrations/noest/send`, {
|
|
2765
|
+
guid: this.integration.guid,
|
|
2766
|
+
token: this.integration.token,
|
|
2767
|
+
orderId
|
|
2768
|
+
});
|
|
2769
|
+
}
|
|
2770
|
+
};
|
|
2771
|
+
var GoogleSheetIntegrationApi = class {
|
|
2772
|
+
client;
|
|
2773
|
+
integration;
|
|
2774
|
+
storeId;
|
|
2775
|
+
constructor(client, integration, storeId) {
|
|
2776
|
+
this.client = client;
|
|
2777
|
+
this.integration = integration;
|
|
2778
|
+
this.storeId = storeId;
|
|
2779
|
+
}
|
|
2780
|
+
/**
|
|
2781
|
+
* Appends a row to the Google Sheet
|
|
2782
|
+
*/
|
|
2783
|
+
async appendRow(values) {
|
|
2784
|
+
await this.client.post(`/stores/${this.storeId}/integrations/google-sheets/append-row`, {
|
|
2785
|
+
id: this.integration.id,
|
|
2786
|
+
name: this.integration.name,
|
|
2787
|
+
row: values
|
|
2788
|
+
});
|
|
2789
|
+
}
|
|
2790
|
+
/**
|
|
2791
|
+
* Creates a new spreadsheet
|
|
2792
|
+
*/
|
|
2793
|
+
async createSpreadsheet(name) {
|
|
2794
|
+
await this.client.post(
|
|
2795
|
+
`/stores/${this.storeId}/integrations/google-sheets/create-spreadsheet`,
|
|
2796
|
+
{ name }
|
|
2797
|
+
);
|
|
2798
|
+
}
|
|
2799
|
+
};
|
|
2800
|
+
var ZimouDeliveryIntegrationApi = class {
|
|
2801
|
+
client;
|
|
2802
|
+
integration;
|
|
2803
|
+
storeId;
|
|
2804
|
+
constructor(client, integration, storeId) {
|
|
2805
|
+
this.client = client;
|
|
2806
|
+
this.integration = integration;
|
|
2807
|
+
this.storeId = storeId;
|
|
2808
|
+
}
|
|
2809
|
+
/**
|
|
2810
|
+
* Gets delivery fees from Zimou
|
|
2811
|
+
*/
|
|
2812
|
+
async getDeliveryFees() {
|
|
2813
|
+
const res = await this.client.get(`/stores/${this.storeId}/integrations/zimou/fees`, {
|
|
2814
|
+
params: {
|
|
2815
|
+
apiKey: this.integration.apiKey
|
|
2816
|
+
}
|
|
2817
|
+
});
|
|
2818
|
+
return res.data;
|
|
2819
|
+
}
|
|
2820
|
+
/**
|
|
2821
|
+
* Sends an order to Zimou
|
|
2822
|
+
*/
|
|
2823
|
+
async send(orderId) {
|
|
2824
|
+
await this.client.post(`/stores/${this.storeId}/integrations/zimou/send`, {
|
|
2825
|
+
apiKey: this.integration.apiKey,
|
|
2826
|
+
orderId
|
|
2827
|
+
});
|
|
2828
|
+
}
|
|
2829
|
+
};
|
|
2830
|
+
var EcomanagerDeliveryIntegrationApi = class {
|
|
2831
|
+
client;
|
|
2832
|
+
integration;
|
|
2833
|
+
storeId;
|
|
2834
|
+
constructor(client, integration, storeId) {
|
|
2835
|
+
this.client = client;
|
|
2836
|
+
this.integration = integration;
|
|
2837
|
+
this.storeId = storeId;
|
|
2838
|
+
}
|
|
2839
|
+
/**
|
|
2840
|
+
* Gets delivery fees from Ecomanager
|
|
2841
|
+
*/
|
|
2842
|
+
async getDeliveryFees() {
|
|
2843
|
+
const res = await this.client.get(`/stores/${this.storeId}/integrations/ecomanager/fees`, {
|
|
2844
|
+
params: {
|
|
2845
|
+
baseUrl: this.integration.baseUrl,
|
|
2846
|
+
token: this.integration.token
|
|
2847
|
+
}
|
|
2848
|
+
});
|
|
2849
|
+
return res.data;
|
|
2850
|
+
}
|
|
2851
|
+
/**
|
|
2852
|
+
* Sends an order to Ecomanager
|
|
2853
|
+
*/
|
|
2854
|
+
async send(orderId) {
|
|
2855
|
+
await this.client.post(`/stores/${this.storeId}/integrations/ecomanager/send`, {
|
|
2856
|
+
baseUrl: this.integration.baseUrl,
|
|
2857
|
+
token: this.integration.token,
|
|
2858
|
+
orderId
|
|
2859
|
+
});
|
|
2860
|
+
}
|
|
2861
|
+
};
|
|
2862
|
+
var IntegrationFactory = class {
|
|
2863
|
+
client;
|
|
2864
|
+
constructor(client) {
|
|
2865
|
+
this.client = client;
|
|
2866
|
+
}
|
|
2867
|
+
/**
|
|
2868
|
+
* Creates an Ecotrack integration API
|
|
2869
|
+
*/
|
|
2870
|
+
ecotrack(integration, storeId) {
|
|
2871
|
+
return new EcotrackDeliveryIntegrationApi(this.client, integration, storeId);
|
|
2872
|
+
}
|
|
2873
|
+
/**
|
|
2874
|
+
* Creates a Yalidine integration API
|
|
2875
|
+
*/
|
|
2876
|
+
yalidine(integration, storeId) {
|
|
2877
|
+
return new YalidineDeliveryIntegrationApi(this.client, integration, storeId);
|
|
2878
|
+
}
|
|
2879
|
+
/**
|
|
2880
|
+
* Creates a Procolis integration API
|
|
2881
|
+
*/
|
|
2882
|
+
procolis(integration, storeId) {
|
|
2883
|
+
return new ProcolisDeliveryIntegrationApi(this.client, integration, storeId);
|
|
2884
|
+
}
|
|
2885
|
+
/**
|
|
2886
|
+
* Creates a Noest integration API
|
|
2887
|
+
*/
|
|
2888
|
+
noest(integration, storeId) {
|
|
2889
|
+
return new NoestDeliveryIntegrationApi(this.client, integration, storeId);
|
|
2890
|
+
}
|
|
2891
|
+
/**
|
|
2892
|
+
* Creates a Google Sheets integration API
|
|
2893
|
+
*/
|
|
2894
|
+
googleSheets(integration, storeId) {
|
|
2895
|
+
return new GoogleSheetIntegrationApi(this.client, integration, storeId);
|
|
2896
|
+
}
|
|
2897
|
+
/**
|
|
2898
|
+
* Creates a Zimou integration API
|
|
2899
|
+
*/
|
|
2900
|
+
zimou(integration, storeId) {
|
|
2901
|
+
return new ZimouDeliveryIntegrationApi(this.client, integration, storeId);
|
|
2902
|
+
}
|
|
2903
|
+
/**
|
|
2904
|
+
* Creates an Ecomanager integration API
|
|
2905
|
+
*/
|
|
2906
|
+
ecomanager(integration, storeId) {
|
|
2907
|
+
return new EcomanagerDeliveryIntegrationApi(this.client, integration, storeId);
|
|
2908
|
+
}
|
|
2909
|
+
};
|
|
2910
|
+
|
|
1798
2911
|
// src/feeef/feeef.ts
|
|
1799
2912
|
var FeeeF = class {
|
|
1800
2913
|
/**
|
|
@@ -1853,6 +2966,14 @@ var FeeeF = class {
|
|
|
1853
2966
|
* The repository for managing shipping prices.
|
|
1854
2967
|
*/
|
|
1855
2968
|
shippingPrices;
|
|
2969
|
+
/**
|
|
2970
|
+
* The repository for managing shipping methods.
|
|
2971
|
+
*/
|
|
2972
|
+
shippingMethods;
|
|
2973
|
+
/**
|
|
2974
|
+
* The repository for managing feedbacks.
|
|
2975
|
+
*/
|
|
2976
|
+
feedbacks;
|
|
1856
2977
|
/**
|
|
1857
2978
|
* The cart service for managing the cart.
|
|
1858
2979
|
*/
|
|
@@ -1861,6 +2982,18 @@ var FeeeF = class {
|
|
|
1861
2982
|
* The actions service for performing various actions (file uploads, etc.)
|
|
1862
2983
|
*/
|
|
1863
2984
|
actions;
|
|
2985
|
+
/**
|
|
2986
|
+
* The notifications service for sending push notifications
|
|
2987
|
+
*/
|
|
2988
|
+
notifications;
|
|
2989
|
+
/**
|
|
2990
|
+
* The storage service for uploading files
|
|
2991
|
+
*/
|
|
2992
|
+
storage;
|
|
2993
|
+
/**
|
|
2994
|
+
* The integration factory for creating integration API instances
|
|
2995
|
+
*/
|
|
2996
|
+
integrations;
|
|
1864
2997
|
/**
|
|
1865
2998
|
* Constructs a new instance of the FeeeF class.
|
|
1866
2999
|
* @param {FeeeFConfig} config - The configuration object.
|
|
@@ -1868,13 +3001,14 @@ var FeeeF = class {
|
|
|
1868
3001
|
* @param {AxiosInstance} config.client - The Axios instance used for making HTTP requests.
|
|
1869
3002
|
* @param {boolean | number} config.cache - The caching configuration. Set to `false` to disable caching, or provide a number to set the cache TTL in milliseconds.
|
|
1870
3003
|
*/
|
|
1871
|
-
//
|
|
1872
3004
|
constructor({ apiKey, client, cache, baseURL = "http://localhost:3333/api/v1" }) {
|
|
1873
3005
|
console.log("feeef super cache", cache);
|
|
1874
3006
|
this.apiKey = apiKey;
|
|
1875
3007
|
this.client = client || axios;
|
|
1876
3008
|
this.client.defaults.headers.common["Authorization"] = `Bearer ${this.apiKey}`;
|
|
1877
3009
|
this.client.defaults.baseURL = baseURL;
|
|
3010
|
+
this.client.defaults.headers.common["Accept"] = "application/json";
|
|
3011
|
+
this.client.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest";
|
|
1878
3012
|
this.stores = new StoreRepository(this.client);
|
|
1879
3013
|
this.products = new ProductRepository(this.client);
|
|
1880
3014
|
this.users = new UserRepository(this.client);
|
|
@@ -1887,11 +3021,18 @@ var FeeeF = class {
|
|
|
1887
3021
|
this.cities = new CityRepository(this.client);
|
|
1888
3022
|
this.currencies = new CurrencyRepository(this.client);
|
|
1889
3023
|
this.shippingPrices = new ShippingPriceRepository(this.client);
|
|
3024
|
+
this.shippingMethods = new ShippingMethodRepository(this.client);
|
|
3025
|
+
this.feedbacks = new FeedbackRepository(this.client);
|
|
1890
3026
|
this.cart = new CartService();
|
|
1891
3027
|
this.actions = new ActionsService(this.client);
|
|
3028
|
+
this.notifications = new NotificationsService(this.client);
|
|
3029
|
+
this.storage = new StorageService(this.client);
|
|
3030
|
+
this.integrations = new IntegrationFactory(this.client);
|
|
1892
3031
|
}
|
|
1893
3032
|
/**
|
|
1894
|
-
*
|
|
3033
|
+
* Sets a header for all requests
|
|
3034
|
+
* @param {string} key - The header key.
|
|
3035
|
+
* @param {string} value - The header value.
|
|
1895
3036
|
*/
|
|
1896
3037
|
setHeader(key, value) {
|
|
1897
3038
|
this.client.defaults.headers.common[key] = value;
|
|
@@ -2150,6 +3291,22 @@ var ProductType = /* @__PURE__ */ ((ProductType2) => {
|
|
|
2150
3291
|
return ProductType2;
|
|
2151
3292
|
})(ProductType || {});
|
|
2152
3293
|
|
|
3294
|
+
// src/core/entities/feedback.ts
|
|
3295
|
+
var FeedbackStatus = /* @__PURE__ */ ((FeedbackStatus2) => {
|
|
3296
|
+
FeedbackStatus2["open"] = "open";
|
|
3297
|
+
FeedbackStatus2["inProgress"] = "in_progress";
|
|
3298
|
+
FeedbackStatus2["resolved"] = "resolved";
|
|
3299
|
+
FeedbackStatus2["closed"] = "closed";
|
|
3300
|
+
return FeedbackStatus2;
|
|
3301
|
+
})(FeedbackStatus || {});
|
|
3302
|
+
var FeedbackPriority = /* @__PURE__ */ ((FeedbackPriority2) => {
|
|
3303
|
+
FeedbackPriority2["low"] = "low";
|
|
3304
|
+
FeedbackPriority2["medium"] = "medium";
|
|
3305
|
+
FeedbackPriority2["high"] = "high";
|
|
3306
|
+
FeedbackPriority2["critical"] = "critical";
|
|
3307
|
+
return FeedbackPriority2;
|
|
3308
|
+
})(FeedbackPriority || {});
|
|
3309
|
+
|
|
2153
3310
|
// src/core/embadded/contact.ts
|
|
2154
3311
|
var EmbaddedContactType = /* @__PURE__ */ ((EmbaddedContactType2) => {
|
|
2155
3312
|
EmbaddedContactType2["phone"] = "phone";
|
|
@@ -2249,23 +3406,45 @@ function validatePhoneNumber(phone) {
|
|
|
2249
3406
|
export {
|
|
2250
3407
|
ActionsService,
|
|
2251
3408
|
CartService,
|
|
3409
|
+
CategoryRepository,
|
|
3410
|
+
CityRepository,
|
|
3411
|
+
CountryRepository,
|
|
3412
|
+
CurrencyRepository,
|
|
3413
|
+
DeliveryServiceFilter,
|
|
2252
3414
|
DeliveryStatus,
|
|
2253
3415
|
DepositRepository,
|
|
3416
|
+
EcomanagerDeliveryIntegrationApi,
|
|
3417
|
+
EcotrackDeliveryIntegrationApi,
|
|
2254
3418
|
EmbaddedContactType,
|
|
3419
|
+
FeedbackPriority,
|
|
3420
|
+
FeedbackRepository,
|
|
3421
|
+
FeedbackStatus,
|
|
2255
3422
|
FeeeF,
|
|
3423
|
+
GoogleSheetIntegrationApi,
|
|
3424
|
+
IntegrationFactory,
|
|
2256
3425
|
MetaPixelEvent,
|
|
3426
|
+
ModelRepository,
|
|
3427
|
+
NoestDeliveryIntegrationApi,
|
|
3428
|
+
NotificationsService,
|
|
3429
|
+
OrderRepository,
|
|
2257
3430
|
OrderStatus,
|
|
2258
3431
|
PaymentStatus,
|
|
3432
|
+
ProcolisDeliveryIntegrationApi,
|
|
3433
|
+
ProductRepository,
|
|
2259
3434
|
ProductStatus,
|
|
2260
3435
|
ProductType,
|
|
2261
3436
|
ProductVariantView,
|
|
2262
3437
|
ShippingMethodPolicy,
|
|
3438
|
+
ShippingMethodRepository,
|
|
2263
3439
|
ShippingMethodStatus,
|
|
2264
3440
|
ShippingPriceRepository,
|
|
2265
3441
|
ShippingPriceStatus,
|
|
2266
3442
|
ShippingType,
|
|
3443
|
+
StateRepository,
|
|
3444
|
+
StorageService,
|
|
2267
3445
|
StoreActionType,
|
|
2268
3446
|
StoreMemberRole,
|
|
3447
|
+
StoreRepository,
|
|
2269
3448
|
StoreSubscriptionStatus,
|
|
2270
3449
|
StoreSubscriptionType,
|
|
2271
3450
|
TiktokPixelEvent,
|
|
@@ -2273,6 +3452,9 @@ export {
|
|
|
2273
3452
|
UserRepository,
|
|
2274
3453
|
VariantOptionType,
|
|
2275
3454
|
WebhookEvent,
|
|
3455
|
+
YalidineAgent,
|
|
3456
|
+
YalidineDeliveryIntegrationApi,
|
|
3457
|
+
ZimouDeliveryIntegrationApi,
|
|
2276
3458
|
convertDartColorToCssNumber,
|
|
2277
3459
|
convertOrderEntityToOrderTrackEntity,
|
|
2278
3460
|
cssColorToHslString,
|