@snabcentr/common-lib 4.5.0-dev → 4.7.0-dev
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/dist/manifest.json +1 -1
- package/dist/sc-common-lib.js +674 -566
- package/dist/sc-common-lib.js.map +1 -1
- package/dist/sc-common-lib.umd.cjs +1 -1
- package/dist/sc-common-lib.umd.cjs.map +1 -1
- package/dist/src/catalog/classes/category-filter.d.ts +4 -0
- package/dist/src/catalog/classes/category-filter.d.ts.map +1 -1
- package/dist/src/catalog/classes/filter-settings.d.ts +4 -0
- package/dist/src/catalog/classes/filter-settings.d.ts.map +1 -1
- package/dist/src/catalog/enums/product-filter-type-enum.d.ts +5 -1
- package/dist/src/catalog/enums/product-filter-type-enum.d.ts.map +1 -1
- package/dist/src/catalog/interfaces/i-category-filter-setting-update-data.d.ts +7 -2
- package/dist/src/catalog/interfaces/i-category-filter-setting-update-data.d.ts.map +1 -1
- package/dist/src/catalog/interfaces/i-category-filter.d.ts +4 -0
- package/dist/src/catalog/interfaces/i-category-filter.d.ts.map +1 -1
- package/dist/src/catalog/interfaces/i-filter-settings.d.ts +5 -0
- package/dist/src/catalog/interfaces/i-filter-settings.d.ts.map +1 -1
- package/dist/src/catalog/providers/properties-provider.d.ts +8 -0
- package/dist/src/catalog/providers/properties-provider.d.ts.map +1 -1
- package/dist/src/config/interfaces/i-pagination-config.d.ts +20 -0
- package/dist/src/config/interfaces/i-pagination-config.d.ts.map +1 -0
- package/dist/src/config/interfaces/index.d.ts +1 -0
- package/dist/src/config/interfaces/index.d.ts.map +1 -1
- package/dist/src/documents/classes/document-item.d.ts +53 -0
- package/dist/src/documents/classes/document-item.d.ts.map +1 -0
- package/dist/src/documents/classes/index.d.ts +2 -0
- package/dist/src/documents/classes/index.d.ts.map +1 -0
- package/dist/src/documents/enums/document-content-type-enum.d.ts +22 -0
- package/dist/src/documents/enums/document-content-type-enum.d.ts.map +1 -0
- package/dist/src/documents/enums/document-type-enum.d.ts +18 -0
- package/dist/src/documents/enums/document-type-enum.d.ts.map +1 -0
- package/dist/src/documents/enums/index.d.ts +3 -0
- package/dist/src/documents/enums/index.d.ts.map +1 -0
- package/dist/src/documents/index.d.ts +5 -0
- package/dist/src/documents/index.d.ts.map +1 -0
- package/dist/src/documents/interfaces/i-document-item-save-data.d.ts +12 -0
- package/dist/src/documents/interfaces/i-document-item-save-data.d.ts.map +1 -0
- package/dist/src/documents/interfaces/i-document-item.d.ts +43 -0
- package/dist/src/documents/interfaces/i-document-item.d.ts.map +1 -0
- package/dist/src/documents/interfaces/index.d.ts +3 -0
- package/dist/src/documents/interfaces/index.d.ts.map +1 -0
- package/dist/src/documents/providers/document-provider.d.ts +53 -0
- package/dist/src/documents/providers/document-provider.d.ts.map +1 -0
- package/dist/src/documents/providers/index.d.ts +2 -0
- package/dist/src/documents/providers/index.d.ts.map +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/orders/classes/orders-list-filters.d.ts +5 -1
- package/dist/src/orders/classes/orders-list-filters.d.ts.map +1 -1
- package/dist/src/orders/interfaces/i-orders-list-filters.d.ts +5 -1
- package/dist/src/orders/interfaces/i-orders-list-filters.d.ts.map +1 -1
- package/dist/src/pagination/helpers/index.d.ts +2 -0
- package/dist/src/pagination/helpers/index.d.ts.map +1 -0
- package/dist/src/pagination/helpers/pagination-helper.d.ts +40 -0
- package/dist/src/pagination/helpers/pagination-helper.d.ts.map +1 -0
- package/dist/src/pagination/index.d.ts +1 -0
- package/dist/src/pagination/index.d.ts.map +1 -1
- package/dist/src/table-data/classes/table-data-pagination-request-params.d.ts +5 -2
- package/dist/src/table-data/classes/table-data-pagination-request-params.d.ts.map +1 -1
- package/dist/src/table-data/classes/table-data-pagination.d.ts +6 -3
- package/dist/src/table-data/classes/table-data-pagination.d.ts.map +1 -1
- package/dist/src/table-data/helpers/index.d.ts +2 -0
- package/dist/src/table-data/helpers/index.d.ts.map +1 -0
- package/dist/src/table-data/helpers/pagination-settings-helper.d.ts +39 -0
- package/dist/src/table-data/helpers/pagination-settings-helper.d.ts.map +1 -0
- package/dist/src/table-data/index.d.ts +2 -0
- package/dist/src/table-data/index.d.ts.map +1 -1
- package/dist/src/table-data/interfaces/i-pagination-preset.d.ts +11 -0
- package/dist/src/table-data/interfaces/i-pagination-preset.d.ts.map +1 -0
- package/dist/src/table-data/interfaces/i-pagination-settings.d.ts +30 -0
- package/dist/src/table-data/interfaces/i-pagination-settings.d.ts.map +1 -0
- package/dist/src/table-data/interfaces/index.d.ts +2 -0
- package/dist/src/table-data/interfaces/index.d.ts.map +1 -1
- package/dist/src/table-data/values/index.d.ts +2 -0
- package/dist/src/table-data/values/index.d.ts.map +1 -0
- package/dist/src/table-data/values/pagination-default-settings.d.ts +6 -0
- package/dist/src/table-data/values/pagination-default-settings.d.ts.map +1 -0
- package/package.json +2 -2
package/dist/sc-common-lib.js
CHANGED
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import { BasePaginationProvider as e, ChannelPrimaryInterest as t, CityWithRegionAndCountry as n, ContactLinks as r, Country as i, CuratedDirection as a, Currency as o, DateHelper as s, DeliveryType as c, FieldValidationResultData as
|
|
2
|
-
import { cloneDeep as Se, endsWith as Ce, forEach as we, includes as Te, isArray as Ee, isDate as De, isEmpty as
|
|
3
|
-
import { addBusinessDays as Re, addDays as
|
|
1
|
+
import { BasePaginationProvider as e, ChannelPrimaryInterest as t, CityWithRegionAndCountry as n, ContactLinks as r, Country as i, CuratedDirection as a, Currency as o, DateHelper as s, DeliveryType as c, FieldValidationResultData as l, FilterGroup as u, FilterOpEnum as ee, GeoCoordinates as te, HttpRequester as d, Identity as f, Manager as p, ManagerCommon as ne, ManagerDataProvider as re, NamedIdentity as m, Operator as ie, Opf as ae, OpfEnum as oe, OrderStatus as se, PartnerGroup as h, PaymentType as ce, PriceCoefficient as le, PropertyType as ue, Reference as de, Region as fe, ResourceType as pe, SalesDirection as g, Shop as me, SourcePrimaryInterest as he, TypedInstanceFactory as _, UpdatableNamedIdentity as ge, User as _e, UserCommonInfo as ve, UserRegionShortInfo as ye, Warehouse as be, useBaseConfigStore as v } from "@snabcentr/common-core";
|
|
2
|
+
import { clamp as xe, cloneDeep as Se, endsWith as Ce, forEach as we, includes as Te, isArray as Ee, isDate as De, isEmpty as y, isFunction as Oe, isNil as b, isObject as ke, isString as x, isUndefined as Ae, map as S, merge as je, omitBy as Me, round as Ne, slice as Pe, some as Fe, startsWith as Ie, toUpper as Le } from "lodash-es";
|
|
3
|
+
import { addBusinessDays as Re, addDays as C, addMonths as w, addQuarters as ze, addWeeks as Be, addYears as Ve, differenceInCalendarDays as He, differenceInCalendarMonths as Ue, endOfDay as T, endOfMonth as E, endOfQuarter as We, endOfToday as Ge, endOfTomorrow as Ke, endOfWeek as qe, endOfYear as Je, endOfYesterday as Ye, format as D, getDate as Xe, getDaysInMonth as Ze, parseISO as O, setDate as Qe, startOfDay as k, startOfMonth as A, startOfQuarter as $e, startOfToday as et, startOfTomorrow as tt, startOfWeek as j, startOfYear as M, startOfYesterday as nt, subDays as rt, subMonths as it, subQuarters as at, subWeeks as ot, subYears as st } from "date-fns";
|
|
4
|
+
import { getActivePinia as ct } from "pinia";
|
|
4
5
|
export * from "@snabcentr/common-core";
|
|
5
6
|
//#region src/admins/classes/admin-short-info.ts
|
|
6
|
-
var
|
|
7
|
+
var lt = class extends _e {
|
|
7
8
|
isSuperadmin;
|
|
8
9
|
constructor(e) {
|
|
9
10
|
super(e), this.isSuperadmin = e?.isSuperadmin ?? !1;
|
|
10
11
|
}
|
|
11
|
-
},
|
|
12
|
+
}, ut = class extends lt {
|
|
12
13
|
showAllCosts;
|
|
13
14
|
constructor(e) {
|
|
14
15
|
super(e), this.showAllCosts = e?.showAllCosts;
|
|
15
16
|
}
|
|
16
|
-
},
|
|
17
|
+
}, N = class {
|
|
17
18
|
asClearRaw() {
|
|
18
19
|
let e = {};
|
|
19
20
|
return Object.keys(this).forEach((t) => {
|
|
20
21
|
let n = this[t];
|
|
21
|
-
|
|
22
|
+
b(n) || x(n) && n.trim().length === 0 || Oe(n.isNewRec) && n.isNewRec() || (e[t] = n);
|
|
22
23
|
}), e;
|
|
23
24
|
}
|
|
24
|
-
},
|
|
25
|
+
}, dt = class extends N {
|
|
25
26
|
name;
|
|
26
27
|
phone;
|
|
27
28
|
email;
|
|
@@ -40,7 +41,7 @@ var ct = class extends ve {
|
|
|
40
41
|
}
|
|
41
42
|
return this;
|
|
42
43
|
}
|
|
43
|
-
},
|
|
44
|
+
}, ft = class t extends e {
|
|
44
45
|
static transformAdminDataToRequest(e) {
|
|
45
46
|
return {
|
|
46
47
|
name: e.name,
|
|
@@ -54,53 +55,53 @@ var ct = class extends ve {
|
|
|
54
55
|
};
|
|
55
56
|
}
|
|
56
57
|
getAdminsList(e, t, n, r) {
|
|
57
|
-
return this.getTypedPaginated(
|
|
58
|
+
return this.getTypedPaginated(lt, "/internal/admins", e, t, n, {}, void 0, r);
|
|
58
59
|
}
|
|
59
60
|
getAdmin(e, t = !1) {
|
|
60
|
-
return this.get(`/internal/admins/${e}`, {}, (e) => new
|
|
61
|
+
return this.get(`/internal/admins/${e}`, {}, (e) => new ut(e.data), t);
|
|
61
62
|
}
|
|
62
63
|
createAdmin(e, n = {}) {
|
|
63
|
-
return this.post("/internal/admins", t.transformAdminDataToRequest(e), (e) => new
|
|
64
|
+
return this.post("/internal/admins", t.transformAdminDataToRequest(e), (e) => new ut(e.data), n);
|
|
64
65
|
}
|
|
65
66
|
updateAdmin(e, n = {}) {
|
|
66
|
-
return this.patch(`/internal/admins/${e.id}`, t.transformAdminDataToRequest(e), (e) => new
|
|
67
|
+
return this.patch(`/internal/admins/${e.id}`, t.transformAdminDataToRequest(e), (e) => new ut(e.data), n);
|
|
67
68
|
}
|
|
68
69
|
deleteAdmin(e) {
|
|
69
70
|
return this.delete(`/internal/admins/${e}`);
|
|
70
71
|
}
|
|
71
|
-
},
|
|
72
|
+
}, pt = /* @__PURE__ */ function(e) {
|
|
72
73
|
return e.Image = "image", e.Video = "video", e;
|
|
73
|
-
}({}),
|
|
74
|
+
}({}), mt = class extends f {
|
|
74
75
|
mediaType;
|
|
75
76
|
isCover;
|
|
76
77
|
isUnused;
|
|
77
78
|
url;
|
|
78
79
|
urlWebp;
|
|
79
80
|
constructor(e) {
|
|
80
|
-
super(e, ""), this.mediaType = e?.mediaType ??
|
|
81
|
+
super(e, ""), this.mediaType = e?.mediaType ?? pt.Image, this.isCover = e?.isCover ?? !1, this.isUnused = e?.isUnused ?? !1, this.url = e?.url ?? "", this.urlWebp = e?.urlWebp;
|
|
81
82
|
}
|
|
82
83
|
isImage() {
|
|
83
|
-
return this.mediaType ===
|
|
84
|
+
return this.mediaType === pt.Image;
|
|
84
85
|
}
|
|
85
86
|
isVideo() {
|
|
86
|
-
return this.mediaType ===
|
|
87
|
+
return this.mediaType === pt.Video;
|
|
87
88
|
}
|
|
88
|
-
},
|
|
89
|
+
}, ht = /* @__PURE__ */ function(e) {
|
|
89
90
|
return e.Draft = "draft", e.Published = "published", e.Scheduled = "scheduled", e;
|
|
90
|
-
}({}),
|
|
91
|
+
}({}), P = class extends f {
|
|
91
92
|
createdAt;
|
|
92
93
|
constructor(e, t) {
|
|
93
94
|
super(e, t), this.createdAt = s.parse(e?.createdAt) ?? /* @__PURE__ */ new Date();
|
|
94
95
|
}
|
|
95
|
-
},
|
|
96
|
+
}, gt = class e extends P {
|
|
96
97
|
static resolvePublicationStatus(e) {
|
|
97
|
-
return
|
|
98
|
+
return b(e) ? ht.Draft : e.getTime() > Date.now() ? ht.Scheduled : ht.Published;
|
|
98
99
|
}
|
|
99
100
|
static getSlugError(e) {
|
|
100
101
|
return e ? /[^a-z0-9-]/.test(e) ? "Допустимы только строчные латинские буквы, цифры и дефис: пример «kak-vybrat-podokonnik»." : Ie(e, "-") || Ce(e, "-") ? "Обозначение не может начинаться или заканчиваться дефисом." : Te(e, "--") ? "Дефисы не могут идти подряд: разделяйте слова одним дефисом." : "" : "";
|
|
101
102
|
}
|
|
102
103
|
static parseDate(e) {
|
|
103
|
-
return
|
|
104
|
+
return b(e) ? null : x(e) ? O(e) : e;
|
|
104
105
|
}
|
|
105
106
|
slug;
|
|
106
107
|
title;
|
|
@@ -111,11 +112,11 @@ var ct = class extends ve {
|
|
|
111
112
|
getPublicationStatus() {
|
|
112
113
|
return e.resolvePublicationStatus(this.publishedAt);
|
|
113
114
|
}
|
|
114
|
-
},
|
|
115
|
+
}, _t = class extends gt {
|
|
115
116
|
content;
|
|
116
117
|
media;
|
|
117
118
|
constructor(e) {
|
|
118
|
-
super(e), this.content = e?.content ?? "", this.media = (e?.media ?? []).map((e) => new
|
|
119
|
+
super(e), this.content = e?.content ?? "", this.media = (e?.media ?? []).map((e) => new mt(e));
|
|
119
120
|
}
|
|
120
121
|
toSaveData(e = !1) {
|
|
121
122
|
return {
|
|
@@ -131,13 +132,13 @@ var ct = class extends ve {
|
|
|
131
132
|
getUnusedMedia() {
|
|
132
133
|
return this.media.filter((e) => e.isUnused);
|
|
133
134
|
}
|
|
134
|
-
},
|
|
135
|
+
}, F = class {
|
|
135
136
|
from;
|
|
136
137
|
to;
|
|
137
138
|
constructor(e) {
|
|
138
|
-
this.from =
|
|
139
|
+
this.from = x(e?.from) ? O(e.from) : e?.from ?? null, this.to = x(e?.to) ? O(e.to) : e?.to ?? null;
|
|
139
140
|
}
|
|
140
|
-
},
|
|
141
|
+
}, vt = class extends N {
|
|
141
142
|
id;
|
|
142
143
|
title;
|
|
143
144
|
slug;
|
|
@@ -146,7 +147,7 @@ var ct = class extends ve {
|
|
|
146
147
|
publishedAt;
|
|
147
148
|
createdAt;
|
|
148
149
|
constructor(e) {
|
|
149
|
-
super(), this.id = e?.id, this.title = e?.title, this.slug = e?.slug, this.content = e?.content, this.publicationStatus = e?.publicationStatus, this.publishedAt = new
|
|
150
|
+
super(), this.id = e?.id, this.title = e?.title, this.slug = e?.slug, this.content = e?.content, this.publicationStatus = e?.publicationStatus, this.publishedAt = new F(e?.publishedAt), this.createdAt = new F(e?.createdAt);
|
|
150
151
|
}
|
|
151
152
|
resetFilterValue(e) {
|
|
152
153
|
switch (e) {
|
|
@@ -168,29 +169,29 @@ var ct = class extends ve {
|
|
|
168
169
|
let e = super.asClearRaw();
|
|
169
170
|
return !e?.publishedAt?.from && !e?.publishedAt?.to && delete e.publishedAt, !e?.createdAt?.from && !e?.createdAt?.to && delete e.createdAt, e;
|
|
170
171
|
}
|
|
171
|
-
},
|
|
172
|
+
}, yt = class t extends e {
|
|
172
173
|
static preparePostSaveData(e) {
|
|
173
174
|
let t = {};
|
|
174
|
-
if (
|
|
175
|
-
let n =
|
|
176
|
-
t.publishedAt =
|
|
175
|
+
if (Ae(e.title) || (t.title = e.title), Ae(e.slug) || (t.slug = e.slug), Ae(e.content) || (t.content = e.content), !Ae(e.publishedAt)) {
|
|
176
|
+
let n = v().config.dateFormats.api;
|
|
177
|
+
t.publishedAt = b(e.publishedAt) ? null : D(e.publishedAt, n);
|
|
177
178
|
}
|
|
178
179
|
return t;
|
|
179
180
|
}
|
|
180
181
|
getPostList(e, t, n) {
|
|
181
182
|
return this.getPaginated("/internal/blog", e, t, n, {}, (e) => ({
|
|
182
183
|
...e.data,
|
|
183
|
-
data: e.data.data.map((e) => new
|
|
184
|
+
data: e.data.data.map((e) => new gt(e))
|
|
184
185
|
}));
|
|
185
186
|
}
|
|
186
187
|
getPost(e) {
|
|
187
|
-
return this.get(`/internal/blog/${e}`, {}, (e) => new
|
|
188
|
+
return this.get(`/internal/blog/${e}`, {}, (e) => new _t(e.data));
|
|
188
189
|
}
|
|
189
190
|
createPost(e, n = {}) {
|
|
190
|
-
return this.post("/internal/blog", t.preparePostSaveData(e), (e) => new
|
|
191
|
+
return this.post("/internal/blog", t.preparePostSaveData(e), (e) => new _t(e.data), n);
|
|
191
192
|
}
|
|
192
193
|
updatePost(e, n, r = {}) {
|
|
193
|
-
return this.patch(`/internal/blog/${e}`, t.preparePostSaveData(n), (e) => new
|
|
194
|
+
return this.patch(`/internal/blog/${e}`, t.preparePostSaveData(n), (e) => new _t(e.data), r);
|
|
194
195
|
}
|
|
195
196
|
removePost(e) {
|
|
196
197
|
return this.delete(`/internal/blog/${e}`);
|
|
@@ -206,26 +207,26 @@ var ct = class extends ve {
|
|
|
206
207
|
onUploadProgress: (e) => {
|
|
207
208
|
r && r(e.total ? Math.round(e.loaded / e.total * 100) : 0);
|
|
208
209
|
}
|
|
209
|
-
}, (e) => new
|
|
210
|
+
}, (e) => new mt(e.data), i);
|
|
210
211
|
}
|
|
211
212
|
updateMedia(e, t, n, r = {}) {
|
|
212
|
-
return this.patch(`/internal/blog/${e}/media/${t}`, { isCover: n }, (e) => new
|
|
213
|
+
return this.patch(`/internal/blog/${e}/media/${t}`, { isCover: n }, (e) => new mt(e.data), r);
|
|
213
214
|
}
|
|
214
215
|
removeMedia(e, t) {
|
|
215
216
|
return this.delete(`/internal/blog/${e}/media/${t}`);
|
|
216
217
|
}
|
|
217
|
-
},
|
|
218
|
+
}, bt = class extends ge {
|
|
218
219
|
deletedAt;
|
|
219
220
|
constructor(e) {
|
|
220
221
|
super(e), this.deletedAt = s.parse(e?.deletedAt);
|
|
221
222
|
}
|
|
222
|
-
},
|
|
223
|
+
}, I = class extends m {
|
|
223
224
|
type;
|
|
224
225
|
isActive;
|
|
225
226
|
constructor(e) {
|
|
226
227
|
super(e), this.type = e?.type, this.isActive = e?.isActive ?? !0;
|
|
227
228
|
}
|
|
228
|
-
},
|
|
229
|
+
}, xt = class extends bt {
|
|
229
230
|
costCoefficient;
|
|
230
231
|
isLowPriceAllowed;
|
|
231
232
|
publishedAt;
|
|
@@ -233,30 +234,30 @@ var ct = class extends ve {
|
|
|
233
234
|
percent;
|
|
234
235
|
owner;
|
|
235
236
|
constructor(e) {
|
|
236
|
-
super(e), this.costCoefficient = e?.costCoefficient ?? 0, this.isLowPriceAllowed = e?.isLowPriceAllowed ?? !1, this.publishedAt = s.parse(e?.publishedAt), this.description = e?.description ?? void 0, this.percent = e?.percent ?? 0, this.owner = new
|
|
237
|
+
super(e), this.costCoefficient = e?.costCoefficient ?? 0, this.isLowPriceAllowed = e?.isLowPriceAllowed ?? !1, this.publishedAt = s.parse(e?.publishedAt), this.description = e?.description ?? void 0, this.percent = e?.percent ?? 0, this.owner = new I(e?.owner);
|
|
237
238
|
}
|
|
238
|
-
},
|
|
239
|
+
}, L = class extends ge {
|
|
239
240
|
description;
|
|
240
241
|
owner;
|
|
241
242
|
constructor(e) {
|
|
242
|
-
super(e), this.description = e?.description ?? "", this.owner = e?.owner ? new
|
|
243
|
+
super(e), this.description = e?.description ?? "", this.owner = e?.owner ? new I(e.owner) : void 0;
|
|
243
244
|
}
|
|
244
|
-
},
|
|
245
|
+
}, St = class {
|
|
245
246
|
coefficient;
|
|
246
247
|
value;
|
|
247
248
|
cost;
|
|
248
249
|
percent;
|
|
249
250
|
readOnly;
|
|
250
251
|
constructor(e) {
|
|
251
|
-
this.coefficient = new
|
|
252
|
+
this.coefficient = new le(e?.coefficient), this.value = e?.value ?? 0, this.cost = e?.cost ?? 0, this.percent = e?.percent ?? 0, this.readOnly = e?.readOnly ?? !0;
|
|
252
253
|
}
|
|
253
|
-
},
|
|
254
|
+
}, Ct = class {
|
|
254
255
|
warehouse;
|
|
255
256
|
count;
|
|
256
257
|
constructor(e) {
|
|
257
|
-
this.warehouse = new
|
|
258
|
+
this.warehouse = new be(e?.warehouse), this.count = e?.count ?? 0;
|
|
258
259
|
}
|
|
259
|
-
},
|
|
260
|
+
}, wt = class extends m {
|
|
260
261
|
slug = "";
|
|
261
262
|
description;
|
|
262
263
|
isSquare = !1;
|
|
@@ -264,35 +265,35 @@ var ct = class extends ve {
|
|
|
264
265
|
constructor(e) {
|
|
265
266
|
super(e), e && (this.slug = e.slug ?? "", this.description = e.description, this.isSquare = e.isSquare ?? !1, this.isLinear = e.isLinear ?? !1);
|
|
266
267
|
}
|
|
267
|
-
},
|
|
268
|
+
}, R = class extends m {
|
|
268
269
|
code = "";
|
|
269
270
|
constructor(e) {
|
|
270
271
|
super(e), this.code = e?.code ?? "";
|
|
271
272
|
}
|
|
272
|
-
},
|
|
273
|
+
}, Tt = class extends R {
|
|
273
274
|
slug;
|
|
274
275
|
type;
|
|
275
276
|
constructor(e) {
|
|
276
277
|
super(e), this.slug = e?.slug ?? "";
|
|
277
278
|
}
|
|
278
|
-
},
|
|
279
|
+
}, Et = class extends Tt {
|
|
279
280
|
isHidden;
|
|
280
281
|
constructor(e) {
|
|
281
282
|
super(e), this.isHidden = e?.isHidden ?? !1;
|
|
282
283
|
}
|
|
283
|
-
},
|
|
284
|
+
}, Dt = class {
|
|
284
285
|
image;
|
|
285
286
|
preview;
|
|
286
287
|
isDefault;
|
|
287
288
|
constructor(e, t) {
|
|
288
289
|
this.image = `${t ?? ""}${e.image}`, this.preview = `${t ?? ""}${e.preview}`, this.isDefault = e.isDefault;
|
|
289
290
|
}
|
|
290
|
-
},
|
|
291
|
+
}, Ot = class extends Tt {
|
|
291
292
|
isPrimary;
|
|
292
293
|
constructor(e) {
|
|
293
294
|
super(e), this.isPrimary = e?.isPrimary ?? !1;
|
|
294
295
|
}
|
|
295
|
-
},
|
|
296
|
+
}, z = class extends Et {
|
|
296
297
|
supplierSku;
|
|
297
298
|
unit;
|
|
298
299
|
pack;
|
|
@@ -311,12 +312,12 @@ var ct = class extends ve {
|
|
|
311
312
|
retailCostRub;
|
|
312
313
|
priceCoefficients;
|
|
313
314
|
constructor(e) {
|
|
314
|
-
super(e), this.supplierSku = e?.supplierSku, this.unit = e?.unit ? new
|
|
315
|
+
super(e), this.supplierSku = e?.supplierSku, this.unit = e?.unit ? new wt(e.unit) : new wt(), this.pack = e?.pack, this.minCount = e?.minCount, this.currency = e?.currency ? new o(e.currency) : new o(), this.cost = e?.cost ?? 0, this.costRub = e?.costRub ?? 0, this.costDate = x(e?.costDate) ? O(e.costDate) : e?.costDate, this.onOrder = e?.onOrder ?? !1, this.stockCount = e?.stockCount?.map((e) => new Ct(e)) ?? [], this.type = "product";
|
|
315
316
|
let t = e?.category ?? e?.categories?.find((e) => e.isPrimary);
|
|
316
|
-
t && (this.category = new
|
|
317
|
+
t && (this.category = new Ot({
|
|
317
318
|
...t,
|
|
318
319
|
isPrimary: !0
|
|
319
|
-
}), this.categories = [this.category]), e?.categories && (this.categories = e.categories.map((e) => new
|
|
320
|
+
}), this.categories = [this.category]), e?.categories && (this.categories = e.categories.map((e) => new Ot(e))), this.images = e?.images?.map((e) => new Dt(e, v().config.http.mediaUrl)) ?? [], this.properties = e?.properties ?? {}, this.retailCost = e?.retailCost, this.retailCostRub = e?.retailCostRub, this.priceCoefficients = e?.priceCoefficients?.map((e) => new St(e)) ?? [], e && "codeNumber" in e && !e.code && (this.code = e?.codeNumber);
|
|
320
321
|
}
|
|
321
322
|
getIsMeasurable() {
|
|
322
323
|
return this.unit.isLinear || this.unit.isSquare;
|
|
@@ -327,9 +328,9 @@ var ct = class extends ve {
|
|
|
327
328
|
getRetailCostRub() {
|
|
328
329
|
return this.retailCostRub ?? this.costRub;
|
|
329
330
|
}
|
|
330
|
-
},
|
|
331
|
+
}, kt = /* @__PURE__ */ function(e) {
|
|
331
332
|
return e.Discount = "discount", e.PriceTemplate = "price_template", e.ClientPrice = "client_price", e.Product = "product", e;
|
|
332
|
-
}({}),
|
|
333
|
+
}({}), B = class extends z {
|
|
333
334
|
costCoefficient;
|
|
334
335
|
costSource;
|
|
335
336
|
discount;
|
|
@@ -340,9 +341,9 @@ var ct = class extends ve {
|
|
|
340
341
|
isRequired;
|
|
341
342
|
isFavorite;
|
|
342
343
|
constructor(e) {
|
|
343
|
-
super(e), this.costCoefficient = e?.costCoefficient ?? 0, this.costSource = e?.costSource ??
|
|
344
|
+
super(e), this.costCoefficient = e?.costCoefficient ?? 0, this.costSource = e?.costSource ?? kt.Product, this.discount = e?.discount ? new xt(e.discount) : void 0, this.priceTemplate = e?.priceTemplate ? new L(e.priceTemplate) : void 0, this.priceCoefficient = e?.priceCoefficient ? new le(e.priceCoefficient) : void 0, this.increasePercent = e?.increasePercent, this.isPreviouslyOrdered = e?.isPreviouslyOrdered, this.isRequired = e?.isRequired, this.isFavorite = e?.isFavorite;
|
|
344
345
|
}
|
|
345
|
-
},
|
|
346
|
+
}, V = class extends Ot {
|
|
346
347
|
isHidden;
|
|
347
348
|
parentCategoryId;
|
|
348
349
|
properties;
|
|
@@ -350,7 +351,7 @@ var ct = class extends ve {
|
|
|
350
351
|
constructor(e) {
|
|
351
352
|
super(e), this.isHidden = e?.isHidden ?? !1, this.parentCategoryId = e?.parentCategoryId, this.properties = e?.properties, this.type = "category", this.currencyRates = e?.currencyRates ? Object.fromEntries(Object.entries(e.currencyRates).map(([e, t]) => [Le(e), t])) : void 0;
|
|
352
353
|
}
|
|
353
|
-
},
|
|
354
|
+
}, At = class extends f {
|
|
354
355
|
category;
|
|
355
356
|
product;
|
|
356
357
|
quantity;
|
|
@@ -369,9 +370,9 @@ var ct = class extends ve {
|
|
|
369
370
|
originalId;
|
|
370
371
|
replacementId;
|
|
371
372
|
constructor(e) {
|
|
372
|
-
super(e), this.product = new
|
|
373
|
+
super(e), this.product = new B(e.product), this.quantity = e.quantity ?? 0, this.marker = e.marker, this.category = e.category ?? new V(), this.currency = e.currency ? new o(e.currency) : void 0, this.height = e.height, this.length = e.length, this.width = e.width, this.configurator = e.configurator, this.configuratorParams = e.configuratorParams && Se(e.configuratorParams), this.isAdditionalSale = e.isAdditionalSale, this.creator = e.creator && new I(e.creator), this.isRemoved = e.isRemoved, this.ord = e.ord, this.onOrder = e.onOrder, this.originalId = e.originalId, this.replacementId = e.replacementId;
|
|
373
374
|
}
|
|
374
|
-
},
|
|
375
|
+
}, jt = class extends At {
|
|
375
376
|
cost;
|
|
376
377
|
costOne;
|
|
377
378
|
costOneRub;
|
|
@@ -384,16 +385,16 @@ var ct = class extends ve {
|
|
|
384
385
|
constructor(e) {
|
|
385
386
|
super(e), this.cost = e.cost, this.costOne = e.costOne, this.costOneRub = e.costOneRub, this.costRub = e.costRub, this.logicGroupId = e.logicGroupId, this.salesDirection = e.salesDirection, this.specificationImgUrl = e.specificationImgUrl, this.sawing = Ee(e.sawing) ? e.sawing : e.sawing ? [e.sawing] : void 0, this.currency = new o(e.currency);
|
|
386
387
|
}
|
|
387
|
-
},
|
|
388
|
+
}, H = class {
|
|
388
389
|
items;
|
|
389
390
|
resultSum;
|
|
390
391
|
directionsSum;
|
|
391
392
|
constructor(e) {
|
|
392
|
-
this.items = e.items.map((e) => new
|
|
393
|
+
this.items = e.items.map((e) => new jt(e)), this.resultSum = e.resultSum, this.directionsSum = e.directionsSum;
|
|
393
394
|
}
|
|
394
|
-
},
|
|
395
|
+
}, Mt = class extends d {
|
|
395
396
|
getCart(e) {
|
|
396
|
-
return this.get(`internal/clients/${e.id}/cart`, {}, (e) => new
|
|
397
|
+
return this.get(`internal/clients/${e.id}/cart`, {}, (e) => new H(e.data));
|
|
397
398
|
}
|
|
398
399
|
deleteCart(e) {
|
|
399
400
|
return this.delete(`internal/clients/${e.id}/cart`);
|
|
@@ -410,7 +411,7 @@ var ct = class extends ve {
|
|
|
410
411
|
marker: t.marker,
|
|
411
412
|
is_additional_sale: t.isAdditionalSale,
|
|
412
413
|
...t.configuratorParams
|
|
413
|
-
}, (e) => new
|
|
414
|
+
}, (e) => new H(e.data), n);
|
|
414
415
|
}
|
|
415
416
|
patchCartItem(e, t, n = {}) {
|
|
416
417
|
return this.patch(`internal/clients/${e.id}/cart/${t.id}`, {
|
|
@@ -424,65 +425,65 @@ var ct = class extends ve {
|
|
|
424
425
|
marker: t.marker,
|
|
425
426
|
is_additional_sale: t.isAdditionalSale,
|
|
426
427
|
...t.configuratorParams
|
|
427
|
-
}, (e) => new
|
|
428
|
+
}, (e) => new H(e.data), n);
|
|
428
429
|
}
|
|
429
430
|
deleteCartItem(e, t) {
|
|
430
|
-
return this.delete(`internal/clients/${e.id}/cart/${t.id}`, (e) => new
|
|
431
|
+
return this.delete(`internal/clients/${e.id}/cart/${t.id}`, (e) => new H(e.data));
|
|
431
432
|
}
|
|
432
433
|
addCartItemFromCSV(e, t) {
|
|
433
|
-
return this.post(`internal/clients/${e.id}/cart/add-products-from-csv`, t, (e) => new
|
|
434
|
+
return this.post(`internal/clients/${e.id}/cart/add-products-from-csv`, t, (e) => new H(e.data));
|
|
434
435
|
}
|
|
435
436
|
getCartItemFromCSVExample(e) {
|
|
436
437
|
return this.get(`internal/clients/${e.id}/cart/add-products-from-csv/example`, {}, (e) => new Blob([e.data], { type: "text/csv" }));
|
|
437
438
|
}
|
|
438
|
-
},
|
|
439
|
+
}, Nt = /* @__PURE__ */ function(e) {
|
|
439
440
|
return e.m2Cost = "m2Cost", e.percent = "percent", e.value = "value", e;
|
|
440
|
-
}({}),
|
|
441
|
-
return e.Checkbox = "checkbox", e.Range = "range", e.Toggle = "toggle", e;
|
|
442
|
-
}({}),
|
|
441
|
+
}({}), Pt = /* @__PURE__ */ function(e) {
|
|
442
|
+
return e.Checkbox = "checkbox", e.Range = "range", e.Toggle = "toggle", e.Group = "group", e;
|
|
443
|
+
}({}), U = class e extends V {
|
|
443
444
|
categories;
|
|
444
445
|
products;
|
|
445
446
|
constructor(t) {
|
|
446
|
-
super(t), this.categories = t?.categories?.map((t) => new e(t)), this.products = t?.products?.map((e) => new
|
|
447
|
+
super(t), this.categories = t?.categories?.map((t) => new e(t)), this.products = t?.products?.map((e) => new z(e));
|
|
447
448
|
}
|
|
448
|
-
},
|
|
449
|
+
}, Ft = class extends V {
|
|
449
450
|
isDisabled;
|
|
450
451
|
isRequired;
|
|
451
452
|
isFavorite;
|
|
452
453
|
hidingComment;
|
|
453
454
|
manager;
|
|
454
455
|
constructor(e) {
|
|
455
|
-
super(e), this.isDisabled = e?.isDisabled ?? !1, this.isRequired = e?.isRequired ?? !1, this.isFavorite = e?.isFavorite ?? !1, this.hidingComment = e?.hidingComment, this.manager = e?.manager ? new
|
|
456
|
+
super(e), this.isDisabled = e?.isDisabled ?? !1, this.isRequired = e?.isRequired ?? !1, this.isFavorite = e?.isFavorite ?? !1, this.hidingComment = e?.hidingComment, this.manager = e?.manager ? new p(e.manager) : void 0;
|
|
456
457
|
}
|
|
457
|
-
},
|
|
458
|
+
}, It = class e extends Ft {
|
|
458
459
|
categories;
|
|
459
460
|
products;
|
|
460
461
|
constructor(t) {
|
|
461
|
-
super(t), this.categories = t?.categories?.map((t) => new e(t)), this.products = t?.products?.map((e) => new
|
|
462
|
+
super(t), this.categories = t?.categories?.map((t) => new e(t)), this.products = t?.products?.map((e) => new B(e));
|
|
462
463
|
}
|
|
463
|
-
},
|
|
464
|
+
}, Lt = class {
|
|
464
465
|
priceCoefficient;
|
|
465
466
|
increasePercent;
|
|
466
467
|
constructor(e) {
|
|
467
|
-
this.priceCoefficient = e?.priceCoefficient && new
|
|
468
|
+
this.priceCoefficient = e?.priceCoefficient && new le(e.priceCoefficient), this.increasePercent = e?.increasePercent;
|
|
468
469
|
}
|
|
469
|
-
},
|
|
470
|
+
}, Rt = class extends Lt {
|
|
470
471
|
constructor(e) {
|
|
471
472
|
super(e);
|
|
472
473
|
}
|
|
473
|
-
},
|
|
474
|
+
}, zt = class extends Rt {
|
|
474
475
|
productCategory;
|
|
475
476
|
constructor(e) {
|
|
476
|
-
super(e), this.productCategory = new
|
|
477
|
+
super(e), this.productCategory = new V(e?.productCategory);
|
|
477
478
|
}
|
|
478
|
-
},
|
|
479
|
+
}, Bt = class extends m {
|
|
479
480
|
photo;
|
|
480
481
|
contacts;
|
|
481
482
|
curatedDirection;
|
|
482
483
|
constructor(e) {
|
|
483
484
|
super(e), this.photo = e.photo, this.contacts = new r(e.contacts), this.curatedDirection = new a(e.curatedDirection);
|
|
484
485
|
}
|
|
485
|
-
},
|
|
486
|
+
}, W = class extends ve {
|
|
486
487
|
salesDirection;
|
|
487
488
|
debt;
|
|
488
489
|
alternativeName;
|
|
@@ -493,47 +494,47 @@ var ct = class extends ve {
|
|
|
493
494
|
managers;
|
|
494
495
|
curators;
|
|
495
496
|
constructor(e) {
|
|
496
|
-
super(e), this.salesDirection = new
|
|
497
|
+
super(e), this.salesDirection = new g(e?.salesDirection), this.debt = e?.debt ?? 0, this.alternativeName = e?.alternativeName ?? "", this.city = new n(e?.city), this.comment = e?.comment, this.isPhoneApproved = e?.isPhoneApproved ?? !1, this.isEmailApproved = e?.isEmailApproved ?? !1, this.managers = e?.managers?.map((e) => new ne(e)) ?? [], this.curators = e?.curators?.map((e) => new Bt(e)) ?? void 0;
|
|
497
498
|
}
|
|
498
|
-
},
|
|
499
|
+
}, Vt = class extends P {
|
|
499
500
|
deletedAt;
|
|
500
501
|
constructor(e, t) {
|
|
501
502
|
super(e, t), this.deletedAt = s.parse(e?.deletedAt);
|
|
502
503
|
}
|
|
503
|
-
},
|
|
504
|
+
}, G = class extends Vt {
|
|
504
505
|
client;
|
|
505
506
|
priceTemplate;
|
|
506
507
|
constructor(e) {
|
|
507
|
-
super(e), this.client = new
|
|
508
|
+
super(e), this.client = new W(e?.client), this.priceTemplate = new L(e?.priceTemplate);
|
|
508
509
|
}
|
|
509
|
-
},
|
|
510
|
+
}, Ht = class extends Rt {
|
|
510
511
|
product;
|
|
511
512
|
constructor(e) {
|
|
512
|
-
super(e), this.product = new
|
|
513
|
+
super(e), this.product = new z(e?.product);
|
|
513
514
|
}
|
|
514
|
-
},
|
|
515
|
+
}, K = class extends m {
|
|
515
516
|
type;
|
|
516
517
|
description;
|
|
517
518
|
metadata;
|
|
518
519
|
isFilterable;
|
|
519
520
|
constructor(e) {
|
|
520
|
-
super(e), this.type = new
|
|
521
|
+
super(e), this.type = new ue(e?.type), this.description = e?.description ?? "", this.metadata = e?.metadata, this.isFilterable = e?.isFilterable;
|
|
521
522
|
}
|
|
522
|
-
},
|
|
523
|
+
}, q = class {
|
|
523
524
|
property;
|
|
524
525
|
value;
|
|
525
526
|
constructor(e) {
|
|
526
|
-
this.property = new
|
|
527
|
+
this.property = new K(e?.property), this.value = e?.value ?? "";
|
|
527
528
|
}
|
|
528
|
-
},
|
|
529
|
+
}, Ut = class {
|
|
529
530
|
id;
|
|
530
531
|
name;
|
|
531
532
|
description;
|
|
532
533
|
ownerName;
|
|
533
|
-
createdAt = new
|
|
534
|
-
updatedAt = new
|
|
534
|
+
createdAt = new F();
|
|
535
|
+
updatedAt = new F();
|
|
535
536
|
constructor(e) {
|
|
536
|
-
this.id = e?.id, this.name = e?.name, this.description = e?.description, this.ownerName = e?.ownerName, this.createdAt = new
|
|
537
|
+
this.id = e?.id, this.name = e?.name, this.description = e?.description, this.ownerName = e?.ownerName, this.createdAt = new F(e?.createdAt), this.updatedAt = new F(e?.updatedAt);
|
|
537
538
|
}
|
|
538
539
|
resetFilterValue(e) {
|
|
539
540
|
switch (e) {
|
|
@@ -554,26 +555,26 @@ var ct = class extends ve {
|
|
|
554
555
|
let e = {};
|
|
555
556
|
return Object.keys(this).forEach((t) => {
|
|
556
557
|
let n = this[t];
|
|
557
|
-
|
|
558
|
+
b(n) || x(n) && n.trim().length === 0 || Oe(n.isNewRec) && n.isNewRec() || (e[t] = n);
|
|
558
559
|
}), !e?.createdAt?.from && !e?.createdAt?.to && delete e.createdAt, !e?.updatedAt?.from && !e?.updatedAt?.to && delete e.updatedAt, e;
|
|
559
560
|
}
|
|
560
|
-
},
|
|
561
|
+
}, Wt = class extends Lt {
|
|
561
562
|
executor;
|
|
562
563
|
createdAt;
|
|
563
564
|
constructor(e) {
|
|
564
|
-
super(e), this.executor = e?.executor ? new
|
|
565
|
+
super(e), this.executor = e?.executor ? new I(e.executor) : void 0, this.createdAt = s.parse(e?.createdAt);
|
|
565
566
|
}
|
|
566
|
-
},
|
|
567
|
+
}, Gt = class extends Wt {
|
|
567
568
|
product;
|
|
568
569
|
constructor(e) {
|
|
569
|
-
super(e), this.product = new
|
|
570
|
+
super(e), this.product = new z(e?.product);
|
|
570
571
|
}
|
|
571
|
-
},
|
|
572
|
+
}, Kt = class extends Wt {
|
|
572
573
|
productCategory;
|
|
573
574
|
constructor(e) {
|
|
574
|
-
super(e), this.productCategory = new
|
|
575
|
+
super(e), this.productCategory = new V(e?.productCategory);
|
|
575
576
|
}
|
|
576
|
-
},
|
|
577
|
+
}, J = class extends m {
|
|
577
578
|
description;
|
|
578
579
|
canChangeLowCost;
|
|
579
580
|
parentRoleId;
|
|
@@ -583,36 +584,37 @@ var ct = class extends ve {
|
|
|
583
584
|
constructor(e) {
|
|
584
585
|
super(e), this.description = e?.description, this.canChangeLowCost = e?.canChangeLowCost ?? !1, this.parentRoleId = e?.parentRoleId;
|
|
585
586
|
}
|
|
586
|
-
},
|
|
587
|
+
}, qt = class {
|
|
587
588
|
role;
|
|
588
589
|
category;
|
|
589
590
|
minCoefficient;
|
|
590
591
|
constructor(e) {
|
|
591
|
-
this.role = new
|
|
592
|
+
this.role = new J(e?.role), this.category = new V(e?.category), this.minCoefficient = new le(e?.minCoefficient);
|
|
592
593
|
}
|
|
593
|
-
},
|
|
594
|
+
}, Jt = class {
|
|
594
595
|
isFake;
|
|
595
596
|
isHidden;
|
|
596
597
|
isMultiple;
|
|
597
598
|
type;
|
|
598
599
|
ord;
|
|
600
|
+
group;
|
|
599
601
|
constructor(e) {
|
|
600
|
-
this.isFake = e?.isFake ?? !1, this.isHidden = e?.isHidden ?? !1, this.isMultiple = e?.isMultiple ?? null, this.type = e?.type ?? null, this.ord = e?.ord ?? 0;
|
|
602
|
+
this.isFake = e?.isFake ?? !1, this.isHidden = e?.isHidden ?? !1, this.isMultiple = e?.isMultiple ?? null, this.type = e?.type ?? null, this.ord = e?.ord ?? 0, this.group = e?.group;
|
|
601
603
|
}
|
|
602
|
-
},
|
|
604
|
+
}, Yt = class {
|
|
603
605
|
category;
|
|
604
606
|
property;
|
|
605
607
|
settings;
|
|
606
608
|
constructor(e) {
|
|
607
|
-
this.category = new
|
|
609
|
+
this.category = new V(e?.category), this.property = new K(e?.property), this.settings = new Jt(e?.settings);
|
|
608
610
|
}
|
|
609
|
-
},
|
|
611
|
+
}, Xt = class {
|
|
610
612
|
id;
|
|
611
613
|
label;
|
|
612
614
|
constructor(e) {
|
|
613
615
|
this.id = e?.id ?? "", this.label = e?.label ?? "";
|
|
614
616
|
}
|
|
615
|
-
},
|
|
617
|
+
}, Zt = class e {
|
|
616
618
|
id;
|
|
617
619
|
label;
|
|
618
620
|
type;
|
|
@@ -621,10 +623,11 @@ var ct = class extends ve {
|
|
|
621
623
|
values;
|
|
622
624
|
min;
|
|
623
625
|
max;
|
|
624
|
-
|
|
625
|
-
|
|
626
|
+
filters;
|
|
627
|
+
constructor(t) {
|
|
628
|
+
this.id = t?.id ?? "", this.label = t?.label ?? "", this.type = t?.type ?? Pt.Checkbox, this.ord = t?.ord ?? 0, this.isMultiple = t?.isMultiple ?? null, this.values = t?.values?.map((e) => new Xt(e)) ?? [], this.min = t?.min ?? null, this.max = t?.max ?? null, this.filters = t?.filters?.map((t) => new e(t)) ?? [];
|
|
626
629
|
}
|
|
627
|
-
},
|
|
630
|
+
}, Qt = class extends d {
|
|
628
631
|
search(e, t = !1) {
|
|
629
632
|
return this.get("/internal/catalog/search", {
|
|
630
633
|
term: e,
|
|
@@ -632,18 +635,18 @@ var ct = class extends ve {
|
|
|
632
635
|
});
|
|
633
636
|
}
|
|
634
637
|
getPriceExportLink(e = "csv", t = !1, n = void 0, r = void 0) {
|
|
635
|
-
let i = `${
|
|
638
|
+
let i = `${v().config.http.portalApiUrl}/api/internal/price/export?format=${e}&show_hidden=${t}`;
|
|
636
639
|
return n && (i += `&category_id=${n}`), r && (i += `&client_id=${r}`), i;
|
|
637
640
|
}
|
|
638
|
-
},
|
|
641
|
+
}, $t = class extends d {
|
|
639
642
|
importPrices(e, t, n = !1) {
|
|
640
643
|
return this.post(`/internal/clients/${e}/price/import`, t, void 0, {}, n);
|
|
641
644
|
}
|
|
642
645
|
getCategoryPrices(e) {
|
|
643
|
-
return this.getTypedList(
|
|
646
|
+
return this.getTypedList(Kt, `/internal/clients/${e}/price/categories`);
|
|
644
647
|
}
|
|
645
648
|
getCategoryPrice(e, t) {
|
|
646
|
-
return this.get(`/internal/clients/${e}/price/categories/${t}`, {}, (e) => new
|
|
649
|
+
return this.get(`/internal/clients/${e}/price/categories/${t}`, {}, (e) => new Kt(e.data));
|
|
647
650
|
}
|
|
648
651
|
updateCategoryPrices(e, t, n, r = !1) {
|
|
649
652
|
return this.request({
|
|
@@ -689,16 +692,16 @@ var ct = class extends ve {
|
|
|
689
692
|
return this.delete(`/internal/clients/${e}/price/categories/${t}/manager`);
|
|
690
693
|
}
|
|
691
694
|
getProductPrices(e) {
|
|
692
|
-
return this.getTypedList(
|
|
695
|
+
return this.getTypedList(Gt, `/internal/clients/${e}/price/products`);
|
|
693
696
|
}
|
|
694
697
|
getProductPrice(e, t) {
|
|
695
|
-
return this.get(`/internal/clients/${e}/price/products/${t}`, {}, (e) => new
|
|
698
|
+
return this.get(`/internal/clients/${e}/price/products/${t}`, {}, (e) => new Gt(e.data));
|
|
696
699
|
}
|
|
697
700
|
updateProductPrice(e, t, n) {
|
|
698
701
|
return this.patch(`/internal/clients/${e}/price/products/${t}`, {
|
|
699
702
|
price_coefficient_id: n.coefficient?.id,
|
|
700
703
|
increase_percent: n.value
|
|
701
|
-
}, (e) => new
|
|
704
|
+
}, (e) => new Gt(e.data));
|
|
702
705
|
}
|
|
703
706
|
removeProductPrice(e, t) {
|
|
704
707
|
return this.delete(`/internal/clients/${e}/price/products/${t}`);
|
|
@@ -718,96 +721,96 @@ var ct = class extends ve {
|
|
|
718
721
|
sendCommercialOffer(e, t) {
|
|
719
722
|
return this.post(`/internal/clients/${e}/price/commercial-offer/send`, t);
|
|
720
723
|
}
|
|
721
|
-
},
|
|
724
|
+
}, en = class extends d {
|
|
722
725
|
getTemplateList(e) {
|
|
723
|
-
return this.getTypedList(
|
|
726
|
+
return this.getTypedList(G, `/internal/clients/${e}/price/templates`);
|
|
724
727
|
}
|
|
725
728
|
getActiveTemplate(e) {
|
|
726
|
-
return this.get(`/internal/clients/${e}/price/templates/active`, {}, (e) => new
|
|
729
|
+
return this.get(`/internal/clients/${e}/price/templates/active`, {}, (e) => new G(e.data), !0);
|
|
727
730
|
}
|
|
728
731
|
attachTemplate(e, t, n) {
|
|
729
|
-
let r =
|
|
732
|
+
let r = v().config.dateFormats.api;
|
|
730
733
|
return this.post(`/internal/clients/${e}/price/templates/${t}`, n && {
|
|
731
|
-
startAt: n.startAt &&
|
|
732
|
-
endAt: n.endAt &&
|
|
733
|
-
}, (e) => new
|
|
734
|
+
startAt: n.startAt && D(n.startAt, r),
|
|
735
|
+
endAt: n.endAt && D(n.endAt, r)
|
|
736
|
+
}, (e) => new G(e.data), {}, !0);
|
|
734
737
|
}
|
|
735
738
|
applyTemplate(e, t) {
|
|
736
739
|
return this.post(`/internal/clients/${e}/price/templates/${t}/apply`, {}, void 0, {}, !0);
|
|
737
740
|
}
|
|
738
741
|
changeTemplate(e, t, n, r) {
|
|
739
|
-
let i =
|
|
742
|
+
let i = v().config.dateFormats.api;
|
|
740
743
|
return this.patch(`/internal/clients/${e}/price/templates/${t}/${n}`, r && {
|
|
741
|
-
startAt: r.startAt &&
|
|
742
|
-
endAt: r.endAt &&
|
|
743
|
-
}, (e) => new
|
|
744
|
+
startAt: r.startAt && D(r.startAt, i),
|
|
745
|
+
endAt: r.endAt && D(r.endAt, i)
|
|
746
|
+
}, (e) => new G(e.data));
|
|
744
747
|
}
|
|
745
748
|
detachTemplate(e, t, n) {
|
|
746
749
|
return this.delete(`/internal/clients/${e}/price/templates/${t}/${n}`);
|
|
747
750
|
}
|
|
748
|
-
},
|
|
751
|
+
}, tn = class extends d {
|
|
749
752
|
getRootCategoriesList(e = !1) {
|
|
750
|
-
return this.getTypedList(
|
|
753
|
+
return this.getTypedList(U, "/internal/catalog/categories", { showHidden: e });
|
|
751
754
|
}
|
|
752
755
|
getCategoryData(e, t = !1, n = !1) {
|
|
753
756
|
return this.get(`/internal/catalog/categories/${e}`, {
|
|
754
757
|
showHidden: t,
|
|
755
758
|
withNestedCategories: n
|
|
756
|
-
}, (e) => new
|
|
759
|
+
}, (e) => new U(e.data));
|
|
757
760
|
}
|
|
758
761
|
getPublicCategoryData(e) {
|
|
759
|
-
return this.get(`/public/catalog/categories/${e}`, {}, (e) => new
|
|
762
|
+
return this.get(`/public/catalog/categories/${e}`, {}, (e) => new U(e.data));
|
|
760
763
|
}
|
|
761
764
|
getCategoryProductsList(e, t = !0, n = !1) {
|
|
762
765
|
return this.get(`/internal/catalog/categories/${e}/products`, {
|
|
763
766
|
showHidden: n,
|
|
764
767
|
withPriceCoefficients: t
|
|
765
|
-
}, (e) =>
|
|
768
|
+
}, (e) => S(e.data, (e) => new z(e)));
|
|
766
769
|
}
|
|
767
770
|
getCategoryProductsCoefficients(e) {
|
|
768
771
|
return this.get(`/internal/catalog/categories/${e}/products/coefficients`, {}, (e) => {
|
|
769
772
|
let { data: t } = e;
|
|
770
|
-
return we(t, (e) => e.map((e) => new
|
|
773
|
+
return we(t, (e) => e.map((e) => new St(e))), t;
|
|
771
774
|
});
|
|
772
775
|
}
|
|
773
776
|
publicSimpleSearch(e, t = 10) {
|
|
774
777
|
return new Promise((n, r) => {
|
|
775
778
|
this.get(`/public/catalog/search/simple?limit=${t}&term=${e}`).then((e) => {
|
|
776
|
-
n(e.categories.map((e) => new
|
|
779
|
+
n(e.categories.map((e) => new U(e)));
|
|
777
780
|
}).catch((e) => {
|
|
778
781
|
r(e);
|
|
779
782
|
});
|
|
780
783
|
});
|
|
781
784
|
}
|
|
782
|
-
},
|
|
785
|
+
}, nn = class extends e {
|
|
783
786
|
getProductData(e, t = !1) {
|
|
784
|
-
return this.get(`/internal/catalog/products/${e}`, { withPriceCoefficients: t }, (e) => new
|
|
787
|
+
return this.get(`/internal/catalog/products/${e}`, { withPriceCoefficients: t }, (e) => new z(e.data));
|
|
785
788
|
}
|
|
786
789
|
getPublicProductData(e) {
|
|
787
|
-
return this.get(`/public/catalog/products/${e}`, {}, (e) => new
|
|
790
|
+
return this.get(`/public/catalog/products/${e}`, {}, (e) => new z(e.data));
|
|
788
791
|
}
|
|
789
792
|
getProductPriceCoefficients(e) {
|
|
790
|
-
return this.get(`/internal/catalog/products/${e}/coefficients`, {}, (e) =>
|
|
793
|
+
return this.get(`/internal/catalog/products/${e}/coefficients`, {}, (e) => S(e.data, (e) => new St(e)));
|
|
791
794
|
}
|
|
792
795
|
getNewProducts(e, t, n = !0) {
|
|
793
|
-
let r =
|
|
794
|
-
return this.getTypedPaginated(
|
|
795
|
-
period: { from:
|
|
796
|
+
let r = v().config.dateFormats.api;
|
|
797
|
+
return this.getTypedPaginated(z, "/internal/catalog/products/new", void 0, void 0, t, {
|
|
798
|
+
period: { from: D(e, r) },
|
|
796
799
|
withPriceCoefficients: n
|
|
797
800
|
});
|
|
798
801
|
}
|
|
799
802
|
publicSimpleSearch(e, t = 10) {
|
|
800
803
|
return new Promise((n, r) => {
|
|
801
804
|
this.get(`/public/catalog/search/simple?limit=${t}&term=${e}`).then((e) => {
|
|
802
|
-
n(e.products.map((e) => new
|
|
805
|
+
n(e.products.map((e) => new z(e)));
|
|
803
806
|
}).catch((e) => {
|
|
804
807
|
r(e);
|
|
805
808
|
});
|
|
806
809
|
});
|
|
807
810
|
}
|
|
808
|
-
},
|
|
811
|
+
}, rn = class extends d {
|
|
809
812
|
getRootCategoriesList(e, t = !1) {
|
|
810
|
-
return this.getTypedList(
|
|
813
|
+
return this.getTypedList(It, "/internal/catalog/categories", {
|
|
811
814
|
clientId: e,
|
|
812
815
|
showHidden: t
|
|
813
816
|
});
|
|
@@ -817,66 +820,66 @@ var ct = class extends ve {
|
|
|
817
820
|
clientId: e,
|
|
818
821
|
showHidden: n,
|
|
819
822
|
withNestedCategories: r
|
|
820
|
-
}, (e) => new
|
|
823
|
+
}, (e) => new It(e.data));
|
|
821
824
|
}
|
|
822
825
|
getCategoryProductsList(e, t, n = !0, r = !1) {
|
|
823
826
|
return this.get(`/internal/catalog/categories/${t}/products`, {
|
|
824
827
|
client_id: e,
|
|
825
828
|
showHidden: r,
|
|
826
829
|
withPriceCoefficients: n
|
|
827
|
-
}, (e) =>
|
|
830
|
+
}, (e) => S(e.data, (e) => new B(e)));
|
|
828
831
|
}
|
|
829
|
-
},
|
|
832
|
+
}, an = class extends e {
|
|
830
833
|
getProductData(e, t, n = !1) {
|
|
831
834
|
return this.get(`/internal/catalog/products/${e}`, {
|
|
832
835
|
clientId: t,
|
|
833
836
|
withPriceCoefficients: n
|
|
834
|
-
}, (e) => new
|
|
837
|
+
}, (e) => new B(e.data));
|
|
835
838
|
}
|
|
836
839
|
getNewProducts(e, t, n, r = !0) {
|
|
837
|
-
let i =
|
|
838
|
-
return this.getTypedPaginated(
|
|
840
|
+
let i = v().config.dateFormats.api;
|
|
841
|
+
return this.getTypedPaginated(B, "/internal/catalog/products/new", void 0, void 0, n, {
|
|
839
842
|
clientId: e,
|
|
840
|
-
period: { from:
|
|
843
|
+
period: { from: D(t, i) },
|
|
841
844
|
withPriceCoefficients: r
|
|
842
845
|
});
|
|
843
846
|
}
|
|
844
|
-
},
|
|
847
|
+
}, on = class extends e {
|
|
845
848
|
getTemplateList(e, t, n) {
|
|
846
|
-
return this.getTypedPaginated(
|
|
849
|
+
return this.getTypedPaginated(L, "/internal/price/templates", e, t, n);
|
|
847
850
|
}
|
|
848
851
|
createTemplate(e, t = {}) {
|
|
849
|
-
return this.post("/internal/price/templates", e, (e) => new
|
|
852
|
+
return this.post("/internal/price/templates", e, (e) => new L(e.data), t);
|
|
850
853
|
}
|
|
851
854
|
getTemplate(e) {
|
|
852
|
-
return this.get(`/internal/price/templates/${e}`, {}, (e) => new
|
|
855
|
+
return this.get(`/internal/price/templates/${e}`, {}, (e) => new L(e.data));
|
|
853
856
|
}
|
|
854
857
|
updateTemplate(e, t, n = {}) {
|
|
855
|
-
return this.patch(`/internal/price/templates/${e}`, t, (e) => new
|
|
858
|
+
return this.patch(`/internal/price/templates/${e}`, t, (e) => new L(e.data), n);
|
|
856
859
|
}
|
|
857
860
|
removeTemplate(e) {
|
|
858
861
|
return this.delete(`/internal/price/templates/${e}`);
|
|
859
862
|
}
|
|
860
863
|
getProductTemplatePrices(e) {
|
|
861
|
-
return this.getTypedList(
|
|
864
|
+
return this.getTypedList(Ht, `/internal/price/templates/${e}/products`);
|
|
862
865
|
}
|
|
863
866
|
getProductTemplatePrice(e, t) {
|
|
864
|
-
return this.get(`/internal/price/templates/${e}/products/${t}`, {}, (e) => new
|
|
867
|
+
return this.get(`/internal/price/templates/${e}/products/${t}`, {}, (e) => new Ht(e.data));
|
|
865
868
|
}
|
|
866
869
|
saveProductTemplatePrice(e, t, n) {
|
|
867
870
|
return this.post(`/internal/price/templates/${e}/products/${t}`, {
|
|
868
871
|
price_coefficient_id: n.coefficient?.id,
|
|
869
872
|
increase_percent: n.value
|
|
870
|
-
}, (e) => new
|
|
873
|
+
}, (e) => new Ht(e.data));
|
|
871
874
|
}
|
|
872
875
|
deleteProductTemplatePrice(e, t) {
|
|
873
876
|
return this.delete(`/internal/price/templates/${e}/products/${t}`);
|
|
874
877
|
}
|
|
875
878
|
getCategoryTemplatePrices(e) {
|
|
876
|
-
return this.getTypedList(
|
|
879
|
+
return this.getTypedList(zt, `/internal/price/templates/${e}/categories`);
|
|
877
880
|
}
|
|
878
881
|
getCategoryTemplatePrice(e, t) {
|
|
879
|
-
return this.get(`/internal/price/templates/${e}/categories/${t}`, {}, (e) => new
|
|
882
|
+
return this.get(`/internal/price/templates/${e}/categories/${t}`, {}, (e) => new zt(e.data));
|
|
880
883
|
}
|
|
881
884
|
saveCategoryTemplatePrice(e, t, n, r = !1) {
|
|
882
885
|
return this.request({
|
|
@@ -887,7 +890,7 @@ var ct = class extends ve {
|
|
|
887
890
|
increase_percent: n.value
|
|
888
891
|
},
|
|
889
892
|
params: r ? { recursively: !0 } : {}
|
|
890
|
-
}, (e) => new
|
|
893
|
+
}, (e) => new zt(e.data));
|
|
891
894
|
}
|
|
892
895
|
deleteCategoryTemplatePrice(e, t, n = !1) {
|
|
893
896
|
return this.request({
|
|
@@ -897,62 +900,73 @@ var ct = class extends ve {
|
|
|
897
900
|
});
|
|
898
901
|
}
|
|
899
902
|
getTemplateClients(e) {
|
|
900
|
-
return this.getTypedList(
|
|
903
|
+
return this.getTypedList(G, `/internal/price/templates/${e}/clients`);
|
|
901
904
|
}
|
|
902
|
-
},
|
|
905
|
+
}, sn = class extends d {
|
|
903
906
|
getRoles() {
|
|
904
|
-
return this.getTypedList(
|
|
907
|
+
return this.getTypedList(J, "/internal/price/roles");
|
|
905
908
|
}
|
|
906
909
|
createRole(e) {
|
|
907
|
-
return this.post("/internal/price/roles", e, (e) => new
|
|
910
|
+
return this.post("/internal/price/roles", e, (e) => new J(e.data));
|
|
908
911
|
}
|
|
909
912
|
getRole(e) {
|
|
910
|
-
return this.get(`/internal/price/roles/${e}`, {}, (e) => new
|
|
913
|
+
return this.get(`/internal/price/roles/${e}`, {}, (e) => new J(e.data));
|
|
911
914
|
}
|
|
912
915
|
updateRole(e, t) {
|
|
913
|
-
return this.patch(`/internal/price/roles/${e}`, t, (e) => new
|
|
916
|
+
return this.patch(`/internal/price/roles/${e}`, t, (e) => new J(e.data));
|
|
914
917
|
}
|
|
915
918
|
deleteRole(e) {
|
|
916
919
|
return this.delete(`/internal/price/roles/${e}`);
|
|
917
920
|
}
|
|
918
921
|
getCategoryRules(e) {
|
|
919
|
-
return this.getTypedList(
|
|
922
|
+
return this.getTypedList(qt, `/internal/price/roles/rules/categories/${e}`);
|
|
920
923
|
}
|
|
921
924
|
updateCategoryRules(e, t) {
|
|
922
|
-
return this.patch(`/internal/price/roles/rules/categories/${e}`, t, (e) =>
|
|
925
|
+
return this.patch(`/internal/price/roles/rules/categories/${e}`, t, (e) => _.instanceListInitializer(qt, e.data));
|
|
923
926
|
}
|
|
924
|
-
},
|
|
927
|
+
}, cn = class extends e {
|
|
925
928
|
getProperties(e, t, n) {
|
|
926
|
-
return this.getTypedPaginated(
|
|
929
|
+
return this.getTypedPaginated(K, "/internal/catalog/properties", e, t, n);
|
|
930
|
+
}
|
|
931
|
+
getFilterGroups(e) {
|
|
932
|
+
return this.getProperties({
|
|
933
|
+
groupOp: "and",
|
|
934
|
+
filters: [{
|
|
935
|
+
field: "is_filter_group",
|
|
936
|
+
op: ee.Equals,
|
|
937
|
+
value: !0
|
|
938
|
+
}],
|
|
939
|
+
groups: []
|
|
940
|
+
}, void 0, e);
|
|
927
941
|
}
|
|
928
942
|
createProperty(e) {
|
|
929
943
|
let { typeId: t, ...n } = e;
|
|
930
944
|
return this.post("/internal/catalog/properties", {
|
|
931
945
|
...n,
|
|
932
946
|
type: t
|
|
933
|
-
}, (e) => new
|
|
947
|
+
}, (e) => new K(e.data));
|
|
934
948
|
}
|
|
935
949
|
getProperty(e) {
|
|
936
|
-
return this.get(`/internal/catalog/properties/${e}`, {}, (e) => new
|
|
950
|
+
return this.get(`/internal/catalog/properties/${e}`, {}, (e) => new K(e.data));
|
|
937
951
|
}
|
|
938
952
|
updateProperty(e, t) {
|
|
939
953
|
let { typeId: n, ...r } = t;
|
|
940
954
|
return this.patch(`/internal/catalog/properties/${e}`, {
|
|
941
955
|
...r,
|
|
942
956
|
type: n
|
|
943
|
-
}, (e) => new
|
|
957
|
+
}, (e) => new K(e.data));
|
|
944
958
|
}
|
|
945
959
|
deleteProperty(e) {
|
|
946
960
|
return this.delete(`/internal/catalog/properties/${e}`);
|
|
947
961
|
}
|
|
948
962
|
getProductProperties(e) {
|
|
949
|
-
return this.getTypedList(
|
|
963
|
+
return this.getTypedList(q, `/internal/catalog/products/${e}/properties`);
|
|
950
964
|
}
|
|
951
965
|
getProductProperty(e, t) {
|
|
952
|
-
return this.get(`/internal/catalog/products/${e}/properties/${t}`, {}, (e) => new
|
|
966
|
+
return this.get(`/internal/catalog/products/${e}/properties/${t}`, {}, (e) => new q(e.data));
|
|
953
967
|
}
|
|
954
968
|
updateProductProperty(e, t, n) {
|
|
955
|
-
return this.patch(`/internal/catalog/products/${e}/properties/${t}`, { value: n }, (e) => new
|
|
969
|
+
return this.patch(`/internal/catalog/products/${e}/properties/${t}`, { value: n }, (e) => new q(e.data));
|
|
956
970
|
}
|
|
957
971
|
deleteProductProperty(e, t) {
|
|
958
972
|
return this.delete(`/internal/catalog/products/${e}/properties/${t}`);
|
|
@@ -991,13 +1005,13 @@ var ct = class extends ve {
|
|
|
991
1005
|
return this.patch(`/internal/catalog/products/${e}/properties/slug`, { slug: t });
|
|
992
1006
|
}
|
|
993
1007
|
getCategoryProperties(e) {
|
|
994
|
-
return this.getTypedList(
|
|
1008
|
+
return this.getTypedList(q, `/internal/catalog/categories/${e}/properties`);
|
|
995
1009
|
}
|
|
996
1010
|
getCategoryProperty(e, t) {
|
|
997
|
-
return this.get(`/internal/catalog/categories/${e}/properties/${t}`, {}, (e) => new
|
|
1011
|
+
return this.get(`/internal/catalog/categories/${e}/properties/${t}`, {}, (e) => new q(e.data));
|
|
998
1012
|
}
|
|
999
1013
|
updateCategoryProperty(e, t, n) {
|
|
1000
|
-
return this.patch(`/internal/catalog/categories/${e}/properties/${t}`, { value: n }, (e) => new
|
|
1014
|
+
return this.patch(`/internal/catalog/categories/${e}/properties/${t}`, { value: n }, (e) => new q(e.data));
|
|
1001
1015
|
}
|
|
1002
1016
|
deleteCategoryProperty(e, t) {
|
|
1003
1017
|
return this.delete(`/internal/catalog/categories/${e}/properties/${t}`);
|
|
@@ -1039,20 +1053,20 @@ var ct = class extends ve {
|
|
|
1039
1053
|
return this.post(`/internal/catalog/categories/${e}/image`, { image: t });
|
|
1040
1054
|
}
|
|
1041
1055
|
getCategoryFilters(e, t = !1) {
|
|
1042
|
-
return this.get(`/internal/catalog/categories/${e}/filters`, { recursively: t }, (e) => e.data.map((e) => new
|
|
1056
|
+
return this.get(`/internal/catalog/categories/${e}/filters`, { recursively: t }, (e) => e.data.map((e) => new Zt(e)));
|
|
1043
1057
|
}
|
|
1044
1058
|
getCategoryFilterSettings(e) {
|
|
1045
|
-
return this.getTypedList(
|
|
1059
|
+
return this.getTypedList(Yt, `/internal/catalog/categories/${e}/filter-settings`);
|
|
1046
1060
|
}
|
|
1047
1061
|
saveCategoryFilterSetting(e, t, n) {
|
|
1048
|
-
return this.patch(`/internal/catalog/categories/${e}/filter-settings/${t}`, n, (e) => new
|
|
1062
|
+
return this.patch(`/internal/catalog/categories/${e}/filter-settings/${t}`, n, (e) => new Yt(e.data));
|
|
1049
1063
|
}
|
|
1050
1064
|
deleteCategoryFilterSetting(e, t) {
|
|
1051
1065
|
return this.delete(`/internal/catalog/categories/${e}/filter-settings/${t}`);
|
|
1052
1066
|
}
|
|
1053
|
-
},
|
|
1067
|
+
}, ln = class extends d {
|
|
1054
1068
|
getRootCategoriesList(e, t = !1) {
|
|
1055
|
-
return this.getTypedList(
|
|
1069
|
+
return this.getTypedList(U, "/internal/catalog/categories", {
|
|
1056
1070
|
priceTemplateId: e,
|
|
1057
1071
|
showHidden: t
|
|
1058
1072
|
});
|
|
@@ -1062,30 +1076,30 @@ var ct = class extends ve {
|
|
|
1062
1076
|
priceTemplateId: e,
|
|
1063
1077
|
showHidden: n,
|
|
1064
1078
|
withNestedCategories: r
|
|
1065
|
-
}, (e) => new
|
|
1079
|
+
}, (e) => new U(e.data));
|
|
1066
1080
|
}
|
|
1067
1081
|
getCategoryProductsList(e, t, n = !0, r = !1) {
|
|
1068
1082
|
return this.get(`/internal/catalog/categories/${t}/products`, {
|
|
1069
1083
|
priceTemplateId: e,
|
|
1070
1084
|
showHidden: r,
|
|
1071
1085
|
withPriceCoefficients: n
|
|
1072
|
-
}, (e) =>
|
|
1086
|
+
}, (e) => S(e.data, (e) => new z(e)));
|
|
1073
1087
|
}
|
|
1074
1088
|
};
|
|
1075
1089
|
//#endregion
|
|
1076
1090
|
//#region src/catalog/methods/find-catalog-item.ts
|
|
1077
|
-
function
|
|
1091
|
+
function un(e, t, n) {
|
|
1078
1092
|
let r;
|
|
1079
1093
|
return e.some((e) => {
|
|
1080
1094
|
if (e.type === n && e.id === t) return r = e, !0;
|
|
1081
1095
|
if (e.type === "product") return !1;
|
|
1082
1096
|
let i = e;
|
|
1083
1097
|
if (i.products && i.products.length > 0) {
|
|
1084
|
-
let e =
|
|
1098
|
+
let e = un(i.products, t, n);
|
|
1085
1099
|
if (e) return r = e, !0;
|
|
1086
1100
|
}
|
|
1087
1101
|
if (i.categories && i.categories.length > 0) {
|
|
1088
|
-
let e =
|
|
1102
|
+
let e = un(i.categories, t, n);
|
|
1089
1103
|
if (e) return r = e, !0;
|
|
1090
1104
|
}
|
|
1091
1105
|
return !1;
|
|
@@ -1093,20 +1107,20 @@ function cn(e, t, n) {
|
|
|
1093
1107
|
}
|
|
1094
1108
|
//#endregion
|
|
1095
1109
|
//#region src/catalog/methods/flatten-catalog-items.ts
|
|
1096
|
-
function
|
|
1110
|
+
function dn(e) {
|
|
1097
1111
|
let t = [];
|
|
1098
1112
|
return e.forEach((e) => {
|
|
1099
1113
|
if (t.push(e), e.type === "category") {
|
|
1100
1114
|
let n = e;
|
|
1101
|
-
n.products && n.products.length > 0 && t.push(...
|
|
1115
|
+
n.products && n.products.length > 0 && t.push(...dn(n.products)), n.categories && n.categories.length > 0 && t.push(...dn(n.categories));
|
|
1102
1116
|
}
|
|
1103
1117
|
}), t;
|
|
1104
1118
|
}
|
|
1105
1119
|
//#endregion
|
|
1106
1120
|
//#region src/clients/enums/clients-additional-data-request-type-enum.ts
|
|
1107
|
-
var
|
|
1121
|
+
var fn = /* @__PURE__ */ function(e) {
|
|
1108
1122
|
return e.LastOrder = "last_order", e.Contacts = "contacts", e.PartnerGroups = "partner_groups", e.PreferredDeliveryType = "preferred_delivery_type", e.SalesDirection = "sales_direction", e.Managers = "managers", e.Curators = "curators", e;
|
|
1109
|
-
}({}),
|
|
1123
|
+
}({}), pn = class extends f {
|
|
1110
1124
|
bankName = "";
|
|
1111
1125
|
bic = "";
|
|
1112
1126
|
accountNumber = "";
|
|
@@ -1115,13 +1129,13 @@ var un = /* @__PURE__ */ function(e) {
|
|
|
1115
1129
|
constructor(e) {
|
|
1116
1130
|
super(e), e && (this.bankName = e.bankName ?? "", this.bic = e.bic ?? "", this.accountNumber = e.accountNumber ?? "", this.correspondentAccount = e.correspondentAccount ?? "", this.currency = new o(e.currency));
|
|
1117
1131
|
}
|
|
1118
|
-
},
|
|
1132
|
+
}, mn = class extends bt {
|
|
1119
1133
|
phone;
|
|
1120
1134
|
email;
|
|
1121
1135
|
constructor(e) {
|
|
1122
1136
|
super(e), this.email = e?.email, this.phone = /^\d+$/.test(e?.phone ?? "") ? `+${e?.phone}` : e?.phone;
|
|
1123
1137
|
}
|
|
1124
|
-
},
|
|
1138
|
+
}, Y = class extends mn {
|
|
1125
1139
|
isPrimary;
|
|
1126
1140
|
position;
|
|
1127
1141
|
notDisturb;
|
|
@@ -1129,9 +1143,9 @@ var un = /* @__PURE__ */ function(e) {
|
|
|
1129
1143
|
constructor(e) {
|
|
1130
1144
|
super(e), this.isPrimary = e?.isPrimary ?? !1, this.position = e?.position, this.notDisturb = e?.notDisturb ?? !1, this.comment = e?.comment;
|
|
1131
1145
|
}
|
|
1132
|
-
},
|
|
1133
|
-
opf =
|
|
1134
|
-
partnerGroup = new
|
|
1146
|
+
}, hn = class extends bt {
|
|
1147
|
+
opf = ae.generatePersonItem();
|
|
1148
|
+
partnerGroup = new h();
|
|
1135
1149
|
contacts = [];
|
|
1136
1150
|
bankAccounts = [];
|
|
1137
1151
|
comment;
|
|
@@ -1140,25 +1154,25 @@ var un = /* @__PURE__ */ function(e) {
|
|
|
1140
1154
|
updater;
|
|
1141
1155
|
constructor(e) {
|
|
1142
1156
|
if (super(e), e) {
|
|
1143
|
-
if (this.opf = new
|
|
1157
|
+
if (this.opf = new ae(e.opf), this.comment = e.comment, this.alternativeName = e.alternativeName, this.creator = e.creator ? new I(e.creator) : void 0, this.updater = e.updater ? new I(e.updater) : void 0, e.partnerGroup && (this.partnerGroup = new h(e.partnerGroup)), e.contacts) {
|
|
1144
1158
|
let t = [];
|
|
1145
1159
|
e.contacts.forEach((e) => {
|
|
1146
|
-
t.push(new
|
|
1160
|
+
t.push(new Y(e));
|
|
1147
1161
|
}), this.contacts = t;
|
|
1148
1162
|
}
|
|
1149
1163
|
if (e.bankAccounts) {
|
|
1150
1164
|
let t = [];
|
|
1151
1165
|
e.bankAccounts.forEach((e) => {
|
|
1152
|
-
t.push(new
|
|
1166
|
+
t.push(new pn(e));
|
|
1153
1167
|
}), this.bankAccounts = t;
|
|
1154
1168
|
}
|
|
1155
1169
|
}
|
|
1156
1170
|
}
|
|
1157
|
-
},
|
|
1171
|
+
}, gn = class extends hn {
|
|
1158
1172
|
constructor(e) {
|
|
1159
1173
|
super(e);
|
|
1160
1174
|
}
|
|
1161
|
-
},
|
|
1175
|
+
}, _n = class extends hn {
|
|
1162
1176
|
inn = "";
|
|
1163
1177
|
okpo = "";
|
|
1164
1178
|
ogrn = "";
|
|
@@ -1171,34 +1185,34 @@ var un = /* @__PURE__ */ function(e) {
|
|
|
1171
1185
|
constructor(e) {
|
|
1172
1186
|
super(e), e && (this.inn = e.inn ?? "", this.okpo = e.okpo ?? "", this.ogrn = e.ogrn ?? "", this.directorName = e.directorName ?? "", this.directorPosition = e.directorPosition ?? "", this.directorActsOn = e.directorActsOn ?? "", this.legalAddress = e.legalAddress ?? "", this.postalAddress = e.postalAddress ?? "", this.actualAddress = e.actualAddress ?? "");
|
|
1173
1187
|
}
|
|
1174
|
-
},
|
|
1188
|
+
}, vn = class extends _n {
|
|
1175
1189
|
kpp = "";
|
|
1176
1190
|
constructor(e) {
|
|
1177
1191
|
super(e), e && (this.kpp = e.kpp ?? "");
|
|
1178
1192
|
}
|
|
1179
|
-
},
|
|
1193
|
+
}, yn = class extends vn {
|
|
1180
1194
|
registrationCountry = new i();
|
|
1181
1195
|
registrationNumber = "";
|
|
1182
1196
|
taxNumber = "";
|
|
1183
1197
|
constructor(e) {
|
|
1184
1198
|
super(e), e && (this.registrationCountry = new i(e.registrationCountry), this.registrationNumber = e.registrationNumber ?? "", this.taxNumber = e.taxNumber ?? "");
|
|
1185
1199
|
}
|
|
1186
|
-
},
|
|
1200
|
+
}, bn = class {
|
|
1187
1201
|
static createInstance(e) {
|
|
1188
1202
|
switch (e.opf.slug) {
|
|
1189
|
-
case
|
|
1190
|
-
case
|
|
1191
|
-
case
|
|
1192
|
-
default: return new
|
|
1203
|
+
case oe.Ic: return new _n(e);
|
|
1204
|
+
case oe.UlR: return new vn(e);
|
|
1205
|
+
case oe.UlNr: return new yn(e);
|
|
1206
|
+
default: return new gn(e);
|
|
1193
1207
|
}
|
|
1194
1208
|
}
|
|
1195
|
-
},
|
|
1209
|
+
}, xn = class extends m {
|
|
1196
1210
|
city;
|
|
1197
1211
|
isActive;
|
|
1198
1212
|
constructor(e) {
|
|
1199
1213
|
super(e), this.city = e?.city ? new n(e.city) : void 0, this.isActive = e?.isActive ?? !1;
|
|
1200
1214
|
}
|
|
1201
|
-
},
|
|
1215
|
+
}, Sn = class extends bt {
|
|
1202
1216
|
address = "";
|
|
1203
1217
|
coordinates;
|
|
1204
1218
|
contacts;
|
|
@@ -1207,9 +1221,9 @@ var un = /* @__PURE__ */ function(e) {
|
|
|
1207
1221
|
isOneTime;
|
|
1208
1222
|
isTransportCompanyAddress;
|
|
1209
1223
|
constructor(e) {
|
|
1210
|
-
super(e), this.address = e?.address ?? "", this.coordinates = new
|
|
1224
|
+
super(e), this.address = e?.address ?? "", this.coordinates = new te(e?.coordinates), this.contacts = e?.contacts?.map((e) => new Y(e)) ?? [], this.comment = e?.comment, this.operatingHours = e?.operatingHours, this.isOneTime = e?.isOneTime, this.isTransportCompanyAddress = e?.isTransportCompanyAddress;
|
|
1211
1225
|
}
|
|
1212
|
-
},
|
|
1226
|
+
}, Cn = class extends W {
|
|
1213
1227
|
contragents;
|
|
1214
1228
|
partnerGroups;
|
|
1215
1229
|
contacts;
|
|
@@ -1221,9 +1235,9 @@ var un = /* @__PURE__ */ function(e) {
|
|
|
1221
1235
|
preferredWarehouse;
|
|
1222
1236
|
extraData;
|
|
1223
1237
|
constructor(e) {
|
|
1224
|
-
super(e), this.contragents = e?.contragents?.map((e) =>
|
|
1238
|
+
super(e), this.contragents = e?.contragents?.map((e) => bn.createInstance(e)) ?? [], this.partnerGroups = e?.partnerGroups?.map((e) => new h(e)) ?? [], this.contacts = e?.contacts?.map((e) => new Y(e)) ?? [], this.deliveryAddresses = e?.deliveryAddresses?.map((e) => new Sn(e)) ?? [], this.channelPrimaryInterest = new t(e?.channelPrimaryInterest), this.sourcePrimaryInterest = new he(e?.sourcePrimaryInterest), this.preferredDeliveryType = new c(e?.preferredDeliveryType), this.primaryDemand = e?.primaryDemand, this.preferredWarehouse = e?.preferredWarehouse ? new be(e.preferredWarehouse) : void 0, this.extraData = e?.extraData ?? {};
|
|
1225
1239
|
}
|
|
1226
|
-
},
|
|
1240
|
+
}, wn = class extends N {
|
|
1227
1241
|
id;
|
|
1228
1242
|
guid;
|
|
1229
1243
|
name;
|
|
@@ -1235,8 +1249,8 @@ var un = /* @__PURE__ */ function(e) {
|
|
|
1235
1249
|
phone;
|
|
1236
1250
|
email;
|
|
1237
1251
|
isActive;
|
|
1238
|
-
createdAt = new
|
|
1239
|
-
lastLoginDate = new
|
|
1252
|
+
createdAt = new F();
|
|
1253
|
+
lastLoginDate = new F();
|
|
1240
1254
|
lastLoginDateHasOrder;
|
|
1241
1255
|
managers;
|
|
1242
1256
|
includeSubordinateManagers;
|
|
@@ -1249,13 +1263,13 @@ var un = /* @__PURE__ */ function(e) {
|
|
|
1249
1263
|
partnerGroups;
|
|
1250
1264
|
contact;
|
|
1251
1265
|
lastOrder;
|
|
1252
|
-
noOrdersPeriod = new
|
|
1266
|
+
noOrdersPeriod = new F();
|
|
1253
1267
|
constructor(e) {
|
|
1254
|
-
super(), this.id = e?.id, this.guid = e?.guid, this.name = e?.name, this.alternativeName = e?.alternativeName, this.searchTerm = e?.searchTerm, this.cities = e?.cities?.map((e) => new n(e)), this.region = new
|
|
1255
|
-
createdAt: new
|
|
1268
|
+
super(), this.id = e?.id, this.guid = e?.guid, this.name = e?.name, this.alternativeName = e?.alternativeName, this.searchTerm = e?.searchTerm, this.cities = e?.cities?.map((e) => new n(e)), this.region = new fe(e?.region), this.country = new i(e?.country), this.phone = e?.phone, this.email = e?.email, this.isActive = e && Object.prototype.hasOwnProperty.call(e, "isActive") ? e?.isActive : !0, this.createdAt = new F(e?.createdAt), this.lastLoginDate = new F(e?.lastLoginDate), this.lastLoginDateHasOrder = e?.lastLoginDateHasOrder ?? void 0, this.managers = e?.managers?.map((e) => new p(e)) ?? [], this.includeSubordinateManagers = e?.includeSubordinateManagers ?? !0, this.curators = e?.curators?.map((e) => new Bt(e)) ?? [], this.salesDirections = e?.salesDirections?.map((e) => new g(e)), this.contragentInn = e?.contragentInn, this.contragentType = new ae(e?.contragentType), this.preferredDeliveryType = e?.preferredDeliveryType ? new c(e?.preferredDeliveryType) : void 0, this.partnerGroups = e?.partnerGroups?.map((e) => new h(e)), this.contact = new mn(e?.contact), this.lastOrder = {
|
|
1269
|
+
createdAt: new F(e?.lastOrder?.createdAt),
|
|
1256
1270
|
creator: e?.lastOrder?.creator,
|
|
1257
1271
|
isApproved: e?.lastOrder?.isApproved
|
|
1258
|
-
}, this.noOrdersPeriod = new
|
|
1272
|
+
}, this.noOrdersPeriod = new F(e?.noOrdersPeriod);
|
|
1259
1273
|
}
|
|
1260
1274
|
resetFilterValue(e) {
|
|
1261
1275
|
switch (e) {
|
|
@@ -1263,7 +1277,7 @@ var un = /* @__PURE__ */ function(e) {
|
|
|
1263
1277
|
this.cities = [];
|
|
1264
1278
|
break;
|
|
1265
1279
|
case "region":
|
|
1266
|
-
this.region = new
|
|
1280
|
+
this.region = new fe();
|
|
1267
1281
|
break;
|
|
1268
1282
|
case "isActive":
|
|
1269
1283
|
this.isActive = !0;
|
|
@@ -1290,7 +1304,7 @@ var un = /* @__PURE__ */ function(e) {
|
|
|
1290
1304
|
this.salesDirections = [];
|
|
1291
1305
|
break;
|
|
1292
1306
|
case "contragentType":
|
|
1293
|
-
this.contragentType = new
|
|
1307
|
+
this.contragentType = new ae();
|
|
1294
1308
|
break;
|
|
1295
1309
|
case "preferredDeliveryType":
|
|
1296
1310
|
this.preferredDeliveryType = new c();
|
|
@@ -1299,7 +1313,7 @@ var un = /* @__PURE__ */ function(e) {
|
|
|
1299
1313
|
this.partnerGroups = [];
|
|
1300
1314
|
break;
|
|
1301
1315
|
case "contact":
|
|
1302
|
-
this.contact = new
|
|
1316
|
+
this.contact = new mn();
|
|
1303
1317
|
break;
|
|
1304
1318
|
default: this[e] = void 0;
|
|
1305
1319
|
}
|
|
@@ -1309,12 +1323,12 @@ var un = /* @__PURE__ */ function(e) {
|
|
|
1309
1323
|
let e = super.asClearRaw();
|
|
1310
1324
|
return !e?.createdAt?.from && !e?.createdAt?.to && delete e.createdAt, !e?.lastLoginDate?.from && !e?.lastLoginDate?.to && delete e.lastLoginDate, !e?.noOrdersPeriod?.from && !e?.noOrdersPeriod?.to && delete e.noOrdersPeriod, e;
|
|
1311
1325
|
}
|
|
1312
|
-
},
|
|
1326
|
+
}, Tn = class extends P {
|
|
1313
1327
|
creator;
|
|
1314
1328
|
constructor(e) {
|
|
1315
|
-
super(e), this.creator = new
|
|
1329
|
+
super(e), this.creator = new I(e?.creator);
|
|
1316
1330
|
}
|
|
1317
|
-
},
|
|
1331
|
+
}, En = class extends m {
|
|
1318
1332
|
contacts = [];
|
|
1319
1333
|
preferredDeliveryType;
|
|
1320
1334
|
partnerGroups = [];
|
|
@@ -1323,23 +1337,23 @@ var un = /* @__PURE__ */ function(e) {
|
|
|
1323
1337
|
managers;
|
|
1324
1338
|
curators;
|
|
1325
1339
|
constructor(e) {
|
|
1326
|
-
super(e), this.contacts = e.contacts?.map((e) => new
|
|
1340
|
+
super(e), this.contacts = e.contacts?.map((e) => new Y(e)) ?? void 0, this.lastOrder = e.lastOrder ? new Tn(e.lastOrder) : void 0, this.partnerGroups = e.partnerGroups?.map((e) => new h(e)) ?? void 0, this.preferredDeliveryType = e.preferredDeliveryType ? new c(e.preferredDeliveryType) : void 0, this.salesDirection = e.salesDirection ? new g(e.salesDirection) : void 0, this.managers = e.managers?.map((e) => new ne(e)) ?? void 0, this.curators = e.curators?.map((e) => new Bt(e)) ?? void 0;
|
|
1327
1341
|
}
|
|
1328
|
-
},
|
|
1342
|
+
}, Dn = class extends f {
|
|
1329
1343
|
isPrimary;
|
|
1330
1344
|
constructor(e) {
|
|
1331
1345
|
super(e), this.isPrimary = e.isPrimary;
|
|
1332
1346
|
}
|
|
1333
|
-
},
|
|
1347
|
+
}, On = class extends Y {
|
|
1334
1348
|
relations = {
|
|
1335
1349
|
clients: [],
|
|
1336
1350
|
contragents: [],
|
|
1337
1351
|
addresses: []
|
|
1338
1352
|
};
|
|
1339
1353
|
constructor(e) {
|
|
1340
|
-
super(e), e.relations && (e.relations.addresses && (this.relations.addresses = e.relations.addresses.map((e) => new
|
|
1354
|
+
super(e), e.relations && (e.relations.addresses && (this.relations.addresses = e.relations.addresses.map((e) => new Dn(e))), e.relations.clients && (this.relations.clients = e.relations.clients.map((e) => new Dn(e))), e.relations.contragents && (this.relations.contragents = e.relations.contragents.map((e) => new Dn(e))));
|
|
1341
1355
|
}
|
|
1342
|
-
},
|
|
1356
|
+
}, kn = class t extends e {
|
|
1343
1357
|
static transformClientDataToRequest(e) {
|
|
1344
1358
|
return {
|
|
1345
1359
|
name: e.name,
|
|
@@ -1358,7 +1372,7 @@ var un = /* @__PURE__ */ function(e) {
|
|
|
1358
1372
|
static transformContragentClientDataToRequest(e) {
|
|
1359
1373
|
let t, n = e, r = e, i = e;
|
|
1360
1374
|
switch (e.opf.slug) {
|
|
1361
|
-
case
|
|
1375
|
+
case oe.Ic:
|
|
1362
1376
|
t = {
|
|
1363
1377
|
opf: n.opf.slug,
|
|
1364
1378
|
name: n.name,
|
|
@@ -1376,7 +1390,7 @@ var un = /* @__PURE__ */ function(e) {
|
|
|
1376
1390
|
actual_address: n.actualAddress
|
|
1377
1391
|
};
|
|
1378
1392
|
break;
|
|
1379
|
-
case
|
|
1393
|
+
case oe.UlR:
|
|
1380
1394
|
t = {
|
|
1381
1395
|
opf: r.opf.slug,
|
|
1382
1396
|
name: r.name,
|
|
@@ -1395,7 +1409,7 @@ var un = /* @__PURE__ */ function(e) {
|
|
|
1395
1409
|
actual_address: r.actualAddress
|
|
1396
1410
|
};
|
|
1397
1411
|
break;
|
|
1398
|
-
case
|
|
1412
|
+
case oe.UlNr:
|
|
1399
1413
|
t = {
|
|
1400
1414
|
opf: i.opf.slug,
|
|
1401
1415
|
name: i.name,
|
|
@@ -1448,10 +1462,10 @@ var un = /* @__PURE__ */ function(e) {
|
|
|
1448
1462
|
};
|
|
1449
1463
|
}
|
|
1450
1464
|
getClient(e) {
|
|
1451
|
-
return this.get(`/internal/clients/${e}`, {}, (e) => new
|
|
1465
|
+
return this.get(`/internal/clients/${e}`, {}, (e) => new Cn(e.data));
|
|
1452
1466
|
}
|
|
1453
1467
|
getClientsList(e, t, n, r, i) {
|
|
1454
|
-
return this.getTypedPaginated(
|
|
1468
|
+
return this.getTypedPaginated(W, "/internal/clients", e, t, n, r, void 0, i);
|
|
1455
1469
|
}
|
|
1456
1470
|
searchClient(e) {
|
|
1457
1471
|
return this.getClientsList(void 0, void 0, void 0, { searchTerm: e }).then((e) => e.data);
|
|
@@ -1462,7 +1476,7 @@ var un = /* @__PURE__ */ function(e) {
|
|
|
1462
1476
|
groups: [],
|
|
1463
1477
|
filters: [{
|
|
1464
1478
|
field: "phone",
|
|
1465
|
-
op:
|
|
1479
|
+
op: ee.Contains,
|
|
1466
1480
|
value: e
|
|
1467
1481
|
}]
|
|
1468
1482
|
});
|
|
@@ -1472,13 +1486,13 @@ var un = /* @__PURE__ */ function(e) {
|
|
|
1472
1486
|
return this.post("/internal/clients/additional-data", {
|
|
1473
1487
|
clients: n,
|
|
1474
1488
|
requested_data_types: t
|
|
1475
|
-
}, (e) =>
|
|
1489
|
+
}, (e) => _.instanceListInitializer(En, e.data));
|
|
1476
1490
|
}
|
|
1477
1491
|
getAllClientContacts(e) {
|
|
1478
|
-
return this.getTypedList(
|
|
1492
|
+
return this.getTypedList(On, `/internal/clients/${e}/contacts/all`);
|
|
1479
1493
|
}
|
|
1480
1494
|
createClientCommonData(e, n = {}) {
|
|
1481
|
-
return this.post("/internal/clients", t.transformClientDataToRequest(e), (e) => new
|
|
1495
|
+
return this.post("/internal/clients", t.transformClientDataToRequest(e), (e) => new Cn(e.data), n);
|
|
1482
1496
|
}
|
|
1483
1497
|
updateClientCommonData(e, n = {}) {
|
|
1484
1498
|
return this.patch(`/internal/clients/${e.id}`, t.transformClientDataToRequest(e), void 0, n);
|
|
@@ -1520,31 +1534,31 @@ var un = /* @__PURE__ */ function(e) {
|
|
|
1520
1534
|
})) });
|
|
1521
1535
|
}
|
|
1522
1536
|
createContragentClientData(e, n, r = {}) {
|
|
1523
|
-
return this.post(`/internal/clients/${e}/contragents`, t.transformContragentClientDataToRequest(n), (e) =>
|
|
1537
|
+
return this.post(`/internal/clients/${e}/contragents`, t.transformContragentClientDataToRequest(n), (e) => bn.createInstance(e.data), r);
|
|
1524
1538
|
}
|
|
1525
1539
|
updateContragentClientData(e, n, r = {}) {
|
|
1526
|
-
return this.patch(`/internal/clients/${e}/contragents/${n.id}`, t.transformContragentClientDataToRequest(n), (e) =>
|
|
1540
|
+
return this.patch(`/internal/clients/${e}/contragents/${n.id}`, t.transformContragentClientDataToRequest(n), (e) => bn.createInstance(e.data), r);
|
|
1527
1541
|
}
|
|
1528
1542
|
deleteClientContragent(e, t) {
|
|
1529
1543
|
return this.delete(`/internal/clients/${e}/contragents/${t.id}`);
|
|
1530
1544
|
}
|
|
1531
1545
|
getClientDeliveryAddresses(e) {
|
|
1532
|
-
return this.getTypedList(
|
|
1546
|
+
return this.getTypedList(Sn, `/internal/clients/${e}/delivery-addresses`);
|
|
1533
1547
|
}
|
|
1534
1548
|
createClientDeliveryAddress(e, n, r = {}) {
|
|
1535
|
-
return this.post(`/internal/clients/${e}/delivery-addresses`, t.transformClientDeliveryAddressToRequest(n), (e) => new
|
|
1549
|
+
return this.post(`/internal/clients/${e}/delivery-addresses`, t.transformClientDeliveryAddressToRequest(n), (e) => new Sn(e.data), r);
|
|
1536
1550
|
}
|
|
1537
1551
|
updateClientDeliveryAddress(e, n, r = {}) {
|
|
1538
|
-
return this.patch(`/internal/clients/${e}/delivery-addresses/${n.id}`, t.transformClientDeliveryAddressToRequest(n), (e) => new
|
|
1552
|
+
return this.patch(`/internal/clients/${e}/delivery-addresses/${n.id}`, t.transformClientDeliveryAddressToRequest(n), (e) => new Sn(e.data), r);
|
|
1539
1553
|
}
|
|
1540
1554
|
deleteClientDeliveryAddress(e, t) {
|
|
1541
1555
|
return this.delete(`/internal/clients/${e}/delivery-addresses/${t.id}`);
|
|
1542
1556
|
}
|
|
1543
1557
|
createContragentBankAccount(e, n, r, i = {}) {
|
|
1544
|
-
return this.post(`/internal/clients/${e}/contragents/${n}/bank-accounts`, t.transformClientContragentBankAccountToRequest(r), (e) => new
|
|
1558
|
+
return this.post(`/internal/clients/${e}/contragents/${n}/bank-accounts`, t.transformClientContragentBankAccountToRequest(r), (e) => new pn(e.data), i);
|
|
1545
1559
|
}
|
|
1546
1560
|
updateContragentBankAccount(e, n, r, i = {}) {
|
|
1547
|
-
return this.patch(`/internal/clients/${e}/contragents/${n}/bank-accounts/${r.id}`, t.transformClientContragentBankAccountToRequest(r), (e) => new
|
|
1561
|
+
return this.patch(`/internal/clients/${e}/contragents/${n}/bank-accounts/${r.id}`, t.transformClientContragentBankAccountToRequest(r), (e) => new pn(e.data), i);
|
|
1548
1562
|
}
|
|
1549
1563
|
deleteContragentBankAccount(e, t, n) {
|
|
1550
1564
|
return this.delete(`/internal/clients/${e}/contragents/${t}/bank-accounts/${n.id}`);
|
|
@@ -1564,7 +1578,7 @@ var un = /* @__PURE__ */ function(e) {
|
|
|
1564
1578
|
email: t.email,
|
|
1565
1579
|
comment: t.comment,
|
|
1566
1580
|
not_disturb: t.notDisturb
|
|
1567
|
-
}, (e) => new
|
|
1581
|
+
}, (e) => new Y(e.data), n);
|
|
1568
1582
|
}
|
|
1569
1583
|
setPrimaryClientContact(e, t) {
|
|
1570
1584
|
return this.setPrimaryContact(`/internal/clients/${e}/contacts/${t.id}/primary`, t.isPrimary ?? !1);
|
|
@@ -1605,7 +1619,7 @@ var un = /* @__PURE__ */ function(e) {
|
|
|
1605
1619
|
comment: t.comment,
|
|
1606
1620
|
...n
|
|
1607
1621
|
};
|
|
1608
|
-
return t.phone?.length && (i.phone = t.phone), t.email?.length && (i.email = t.email), this.post(`/internal/clients/${e}/contacts`, i, (e) => new
|
|
1622
|
+
return t.phone?.length && (i.phone = t.phone), t.email?.length && (i.email = t.email), this.post(`/internal/clients/${e}/contacts`, i, (e) => new Y(e.data), r);
|
|
1609
1623
|
}
|
|
1610
1624
|
setPrimaryContact(e, t) {
|
|
1611
1625
|
return this.patch(e, { is_primary: t });
|
|
@@ -1616,7 +1630,7 @@ var un = /* @__PURE__ */ function(e) {
|
|
|
1616
1630
|
sendClientEmailConfirmation(e) {
|
|
1617
1631
|
return this.get(`/internal/clients/${e.id}/verification/email?email=${e.email}`);
|
|
1618
1632
|
}
|
|
1619
|
-
},
|
|
1633
|
+
}, An = class extends d {
|
|
1620
1634
|
checkPhoneIsBusy(e) {
|
|
1621
1635
|
return new Promise((t, n) => {
|
|
1622
1636
|
this.request({
|
|
@@ -1628,16 +1642,16 @@ var un = /* @__PURE__ */ function(e) {
|
|
|
1628
1642
|
}).catch(n);
|
|
1629
1643
|
});
|
|
1630
1644
|
}
|
|
1631
|
-
},
|
|
1645
|
+
}, jn = class {
|
|
1632
1646
|
date;
|
|
1633
1647
|
name;
|
|
1634
1648
|
version;
|
|
1635
1649
|
constructor(e) {
|
|
1636
|
-
this.date =
|
|
1650
|
+
this.date = x(e?.date) ? O(e.date) : e?.date ?? /* @__PURE__ */ new Date(), this.name = e?.name ?? "", this.version = e?.version ?? "0.0.0";
|
|
1637
1651
|
}
|
|
1638
|
-
},
|
|
1652
|
+
}, Mn = /* @__PURE__ */ function(e) {
|
|
1639
1653
|
return e.Kozyrek = "kozyrek", e.Mosquitto = "mosquitto", e.Strip = "strip", e.MetalForDoors = "metal_for_doors", e.Sandwich = "sandwich", e.SandwichM2 = "sandwich_m2", e;
|
|
1640
|
-
}({}),
|
|
1654
|
+
}({}), Nn = class extends d {
|
|
1641
1655
|
getConfiguratorSettings(e, t) {
|
|
1642
1656
|
return this.get(`internal/catalog/categories/${e.id}/configurators/${e.properties?.configurator}/settings?client_id=${t}`);
|
|
1643
1657
|
}
|
|
@@ -1649,7 +1663,7 @@ var un = /* @__PURE__ */ function(e) {
|
|
|
1649
1663
|
params: n,
|
|
1650
1664
|
client_id: t
|
|
1651
1665
|
}
|
|
1652
|
-
}, (e) => new
|
|
1666
|
+
}, (e) => new z(e.data), r);
|
|
1653
1667
|
}
|
|
1654
1668
|
createTemplate(e, t, n, r = {}) {
|
|
1655
1669
|
return this.post(`internal/catalog/categories/${e.id}/configurators/${e.properties?.configurator}/template?client_id=${t}`, { ...n }, () => {}, r);
|
|
@@ -1663,30 +1677,60 @@ var un = /* @__PURE__ */ function(e) {
|
|
|
1663
1677
|
...n
|
|
1664
1678
|
});
|
|
1665
1679
|
}
|
|
1666
|
-
},
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
constructor(e) {
|
|
1670
|
-
this.page = e?.page ?? 1, this.pageSize = e?.pageSize ?? 50;
|
|
1671
|
-
}
|
|
1672
|
-
}, Mn = class extends jn {
|
|
1673
|
-
itemCount = 0;
|
|
1674
|
-
pageCount = 1;
|
|
1675
|
-
pageSlot = 5;
|
|
1676
|
-
pageSizes = [
|
|
1680
|
+
}, Pn = Object.freeze({
|
|
1681
|
+
pageSize: 50,
|
|
1682
|
+
pageSizes: Object.freeze([
|
|
1677
1683
|
25,
|
|
1678
1684
|
50,
|
|
1679
1685
|
100
|
|
1680
|
-
]
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1686
|
+
]),
|
|
1687
|
+
pageSlot: 5,
|
|
1688
|
+
showSizePicker: !0,
|
|
1689
|
+
maxPageSize: 100,
|
|
1690
|
+
maxPages: 10
|
|
1691
|
+
}), Fn = class e {
|
|
1692
|
+
static resolve(t) {
|
|
1693
|
+
let n = e.getConfig(), { name: r, ...i } = t ?? {}, a = {
|
|
1694
|
+
...Pn,
|
|
1695
|
+
...Me(n?.defaults, b),
|
|
1696
|
+
...Me(i, b),
|
|
1697
|
+
...b(r) ? {} : Me(n?.presets?.[r], b)
|
|
1698
|
+
};
|
|
1699
|
+
return {
|
|
1700
|
+
...a,
|
|
1701
|
+
pageSize: e.limitPageSize(a.pageSize, a.maxPageSize),
|
|
1702
|
+
pageSizes: e.limitPageSizes(a.pageSizes, a.maxPageSize)
|
|
1703
|
+
};
|
|
1704
|
+
}
|
|
1705
|
+
static limitPageSize(e, t) {
|
|
1706
|
+
return Math.min(e, t);
|
|
1707
|
+
}
|
|
1708
|
+
static limitPageSizes(e, t) {
|
|
1709
|
+
let n = e.filter((e) => e <= t);
|
|
1710
|
+
return (y(n) || n.length < e.length) && !Te(n, t) ? [...n, t] : n;
|
|
1711
|
+
}
|
|
1712
|
+
static getConfig() {
|
|
1713
|
+
if (ct()) return v().getConfig().pagination;
|
|
1688
1714
|
}
|
|
1689
|
-
},
|
|
1715
|
+
}, In = class {
|
|
1716
|
+
page;
|
|
1717
|
+
pageSize;
|
|
1718
|
+
constructor(e, t) {
|
|
1719
|
+
let n = Fn.resolve(t);
|
|
1720
|
+
this.page = e?.page ?? 1, this.pageSize = Fn.limitPageSize(e?.pageSize ?? n.pageSize, n.maxPageSize);
|
|
1721
|
+
}
|
|
1722
|
+
}, Ln = class extends In {
|
|
1723
|
+
itemCount;
|
|
1724
|
+
pageCount;
|
|
1725
|
+
pageSlot;
|
|
1726
|
+
pageSizes;
|
|
1727
|
+
showSizePicker;
|
|
1728
|
+
constructor(e, t) {
|
|
1729
|
+
super(e, t);
|
|
1730
|
+
let n = Fn.resolve(t);
|
|
1731
|
+
this.itemCount = e?.itemCount ?? 0, this.pageCount = e?.pageCount ?? 1, this.pageSlot = e?.pageSlot ?? n.pageSlot, this.pageSizes = Fn.limitPageSizes(e?.pageSizes ?? n.pageSizes, n.maxPageSize), this.showSizePicker = e?.showSizePicker ?? n.showSizePicker;
|
|
1732
|
+
}
|
|
1733
|
+
}, Rn = class {
|
|
1690
1734
|
field;
|
|
1691
1735
|
direction;
|
|
1692
1736
|
constructor(e) {
|
|
@@ -1711,47 +1755,47 @@ var un = /* @__PURE__ */ function(e) {
|
|
|
1711
1755
|
return new Date(e.getFullYear(), e.getMonth() < 6 ? 0 : 6, 1);
|
|
1712
1756
|
}
|
|
1713
1757
|
static endOfHalfYear(e) {
|
|
1714
|
-
return
|
|
1758
|
+
return E(new Date(e.getFullYear(), e.getMonth() < 6 ? 5 : 11, 1));
|
|
1715
1759
|
}
|
|
1716
1760
|
static addHalfYears(e, t) {
|
|
1717
|
-
return
|
|
1761
|
+
return w(e, t * 6);
|
|
1718
1762
|
}
|
|
1719
1763
|
static intervalTillSameDate(e, t, n) {
|
|
1720
|
-
let r = Ue(
|
|
1764
|
+
let r = Ue(A(n), A(e)), i = A(w(t, r)), a = Math.min(Xe(n), Ze(i));
|
|
1721
1765
|
return {
|
|
1722
|
-
from:
|
|
1723
|
-
to:
|
|
1766
|
+
from: k(t),
|
|
1767
|
+
to: T(Qe(i, a))
|
|
1724
1768
|
};
|
|
1725
1769
|
}
|
|
1726
1770
|
static weekTillSameWeekday(e, t) {
|
|
1727
|
-
let n =
|
|
1771
|
+
let n = j(Be(e, t), { weekStartsOn: 1 }), r = He(e, j(e, { weekStartsOn: 1 }));
|
|
1728
1772
|
return {
|
|
1729
1773
|
from: n,
|
|
1730
|
-
to: C(
|
|
1774
|
+
to: T(C(n, r))
|
|
1731
1775
|
};
|
|
1732
1776
|
}
|
|
1733
1777
|
static decadeTillSameDayNumber(t, n) {
|
|
1734
1778
|
let [r] = e.shiftedDecadeBounds(t, 0), i = He(t, r) + 1, [a, o] = e.shiftedDecadeBounds(t, n), s = He(o, a) + 1;
|
|
1735
1779
|
return {
|
|
1736
1780
|
from: a,
|
|
1737
|
-
to: C(
|
|
1781
|
+
to: T(C(a, Math.min(i, s) - 1))
|
|
1738
1782
|
};
|
|
1739
1783
|
}
|
|
1740
1784
|
static shiftedDecadeBounds(e, t) {
|
|
1741
1785
|
let n = Xe(e), r = 2;
|
|
1742
1786
|
n <= 10 ? r = 0 : n <= 20 && (r = 1);
|
|
1743
|
-
let i = r + t, a = Math.floor(i / 3), o = (i % 3 + 3) % 3, s =
|
|
1744
|
-
return [c, o === 2 ?
|
|
1787
|
+
let i = r + t, a = Math.floor(i / 3), o = (i % 3 + 3) % 3, s = A(w(e, a)), c = C(s, o * 10);
|
|
1788
|
+
return [c, o === 2 ? E(s) : T(C(c, 9))];
|
|
1745
1789
|
}
|
|
1746
1790
|
};
|
|
1747
1791
|
//#endregion
|
|
1748
1792
|
//#region src/date-time/helpers/days-ago-iso.ts
|
|
1749
|
-
function
|
|
1750
|
-
return
|
|
1793
|
+
function zn(e) {
|
|
1794
|
+
return D(rt(et(), e), "yyyy-MM-dd");
|
|
1751
1795
|
}
|
|
1752
1796
|
//#endregion
|
|
1753
1797
|
//#region src/i18n/helpers/pluralize.ts
|
|
1754
|
-
function
|
|
1798
|
+
function Bn(e, t) {
|
|
1755
1799
|
let n = [
|
|
1756
1800
|
2,
|
|
1757
1801
|
0,
|
|
@@ -1764,13 +1808,13 @@ function Fn(e, t) {
|
|
|
1764
1808
|
}
|
|
1765
1809
|
//#endregion
|
|
1766
1810
|
//#region src/date-time/helpers/format-relative-date.ts
|
|
1767
|
-
function
|
|
1768
|
-
let t =
|
|
1811
|
+
function Vn(e) {
|
|
1812
|
+
let t = O(e), n = He(et(), t);
|
|
1769
1813
|
switch (!0) {
|
|
1770
1814
|
case n === 0: return "Сегодня";
|
|
1771
1815
|
case n === 1: return "Вчера";
|
|
1772
1816
|
case n < 0: return e;
|
|
1773
|
-
default: return `${n} ${
|
|
1817
|
+
default: return `${n} ${Bn(n, [
|
|
1774
1818
|
"день",
|
|
1775
1819
|
"дня",
|
|
1776
1820
|
"дней"
|
|
@@ -1779,14 +1823,14 @@ function In(e) {
|
|
|
1779
1823
|
}
|
|
1780
1824
|
//#endregion
|
|
1781
1825
|
//#region src/date-time/providers/date-time-provider.ts
|
|
1782
|
-
var
|
|
1826
|
+
var Hn = class {
|
|
1783
1827
|
static defaultDateRanges(e) {
|
|
1784
|
-
let t = Re(/* @__PURE__ */ new Date(), 1), n = /* @__PURE__ */ new Date(), r =
|
|
1828
|
+
let t = Re(/* @__PURE__ */ new Date(), 1), n = /* @__PURE__ */ new Date(), r = M(e === void 0 ? n : new Date(e, 0, 1)), i = Je(r);
|
|
1785
1829
|
return {
|
|
1786
1830
|
nextWorkingDay: {
|
|
1787
1831
|
label: "Следующий рабочий день",
|
|
1788
|
-
from:
|
|
1789
|
-
to:
|
|
1832
|
+
from: k(t),
|
|
1833
|
+
to: T(t)
|
|
1790
1834
|
},
|
|
1791
1835
|
today: {
|
|
1792
1836
|
label: "Сегодня",
|
|
@@ -1805,57 +1849,57 @@ var Ln = class {
|
|
|
1805
1849
|
},
|
|
1806
1850
|
currentWeek: {
|
|
1807
1851
|
label: "Неделя",
|
|
1808
|
-
from:
|
|
1852
|
+
from: j(n, { weekStartsOn: 1 }),
|
|
1809
1853
|
to: qe(n, { weekStartsOn: 1 })
|
|
1810
1854
|
},
|
|
1811
1855
|
currentMonth: {
|
|
1812
1856
|
label: "Месяц",
|
|
1813
|
-
from:
|
|
1814
|
-
to:
|
|
1857
|
+
from: A(n),
|
|
1858
|
+
to: E(n)
|
|
1815
1859
|
},
|
|
1816
1860
|
oneMonth: {
|
|
1817
1861
|
label: "1 месяц",
|
|
1818
1862
|
from: r,
|
|
1819
|
-
to:
|
|
1863
|
+
to: E(r)
|
|
1820
1864
|
},
|
|
1821
1865
|
threeMonths: {
|
|
1822
1866
|
label: "3 месяца",
|
|
1823
1867
|
from: r,
|
|
1824
|
-
to: w(
|
|
1868
|
+
to: E(w(r, 2))
|
|
1825
1869
|
},
|
|
1826
1870
|
nineMonths: {
|
|
1827
1871
|
label: "9 месяцев",
|
|
1828
1872
|
from: r,
|
|
1829
|
-
to: w(
|
|
1873
|
+
to: E(w(r, 8))
|
|
1830
1874
|
},
|
|
1831
1875
|
firstQuarter: {
|
|
1832
1876
|
label: "I квартал",
|
|
1833
1877
|
from: r,
|
|
1834
|
-
to: w(
|
|
1878
|
+
to: E(w(r, 2))
|
|
1835
1879
|
},
|
|
1836
1880
|
secondQuarter: {
|
|
1837
1881
|
label: "II квартал",
|
|
1838
|
-
from:
|
|
1839
|
-
to: w(
|
|
1882
|
+
from: w(r, 3),
|
|
1883
|
+
to: E(w(r, 5))
|
|
1840
1884
|
},
|
|
1841
1885
|
thirdQuarter: {
|
|
1842
1886
|
label: "III квартал",
|
|
1843
|
-
from:
|
|
1844
|
-
to: w(
|
|
1887
|
+
from: w(r, 6),
|
|
1888
|
+
to: E(w(r, 8))
|
|
1845
1889
|
},
|
|
1846
1890
|
fourthQuarter: {
|
|
1847
1891
|
label: "IV квартал",
|
|
1848
|
-
from:
|
|
1849
|
-
to: w(
|
|
1892
|
+
from: w(r, 9),
|
|
1893
|
+
to: E(w(r, 11))
|
|
1850
1894
|
},
|
|
1851
1895
|
firstHalfYear: {
|
|
1852
1896
|
label: "I полугодие",
|
|
1853
1897
|
from: r,
|
|
1854
|
-
to: w(
|
|
1898
|
+
to: E(w(r, 5))
|
|
1855
1899
|
},
|
|
1856
1900
|
secondHalfYear: {
|
|
1857
1901
|
label: "II полугодие",
|
|
1858
|
-
from:
|
|
1902
|
+
from: w(r, 6),
|
|
1859
1903
|
to: i
|
|
1860
1904
|
},
|
|
1861
1905
|
currentYear: {
|
|
@@ -1866,13 +1910,13 @@ var Ln = class {
|
|
|
1866
1910
|
};
|
|
1867
1911
|
}
|
|
1868
1912
|
static standardPeriods(e = /* @__PURE__ */ new Date()) {
|
|
1869
|
-
let t = { weekStartsOn: 1 }, n =
|
|
1913
|
+
let t = { weekStartsOn: 1 }, n = k(e), r = T(e), i = X.decadeInterval(e), a = A(e), o = $e(e), s = X.startOfHalfYear(e), c = M(e), l = X.addHalfYears(e, -1), u = X.addHalfYears(e, 1);
|
|
1870
1914
|
return {
|
|
1871
1915
|
yesterday: {
|
|
1872
1916
|
label: "Вчера",
|
|
1873
1917
|
group: "day",
|
|
1874
|
-
from:
|
|
1875
|
-
to:
|
|
1918
|
+
from: k(rt(e, 1)),
|
|
1919
|
+
to: T(rt(e, 1))
|
|
1876
1920
|
},
|
|
1877
1921
|
today: {
|
|
1878
1922
|
label: "Сегодня",
|
|
@@ -1883,25 +1927,25 @@ var Ln = class {
|
|
|
1883
1927
|
tomorrow: {
|
|
1884
1928
|
label: "Завтра",
|
|
1885
1929
|
group: "day",
|
|
1886
|
-
from:
|
|
1887
|
-
to: C(
|
|
1930
|
+
from: k(C(e, 1)),
|
|
1931
|
+
to: T(C(e, 1))
|
|
1888
1932
|
},
|
|
1889
1933
|
lastWeek: {
|
|
1890
1934
|
label: "Прошлая неделя",
|
|
1891
1935
|
group: "week",
|
|
1892
|
-
from:
|
|
1936
|
+
from: j(ot(e, 1), t),
|
|
1893
1937
|
to: qe(ot(e, 1), t)
|
|
1894
1938
|
},
|
|
1895
1939
|
thisWeek: {
|
|
1896
1940
|
label: "Эта неделя",
|
|
1897
1941
|
group: "week",
|
|
1898
|
-
from:
|
|
1942
|
+
from: j(e, t),
|
|
1899
1943
|
to: qe(e, t)
|
|
1900
1944
|
},
|
|
1901
1945
|
nextWeek: {
|
|
1902
1946
|
label: "Следующая неделя",
|
|
1903
1947
|
group: "week",
|
|
1904
|
-
from:
|
|
1948
|
+
from: j(Be(e, 1), t),
|
|
1905
1949
|
to: qe(Be(e, 1), t)
|
|
1906
1950
|
},
|
|
1907
1951
|
lastTenDays: {
|
|
@@ -1922,20 +1966,20 @@ var Ln = class {
|
|
|
1922
1966
|
lastMonth: {
|
|
1923
1967
|
label: "Прошлый месяц",
|
|
1924
1968
|
group: "month",
|
|
1925
|
-
from:
|
|
1926
|
-
to:
|
|
1969
|
+
from: A(it(e, 1)),
|
|
1970
|
+
to: E(it(e, 1))
|
|
1927
1971
|
},
|
|
1928
1972
|
thisMonth: {
|
|
1929
1973
|
label: "Этот месяц",
|
|
1930
1974
|
group: "month",
|
|
1931
1975
|
from: a,
|
|
1932
|
-
to:
|
|
1976
|
+
to: E(e)
|
|
1933
1977
|
},
|
|
1934
1978
|
nextMonth: {
|
|
1935
1979
|
label: "Следующий месяц",
|
|
1936
1980
|
group: "month",
|
|
1937
|
-
from:
|
|
1938
|
-
to: w(
|
|
1981
|
+
from: A(w(e, 1)),
|
|
1982
|
+
to: E(w(e, 1))
|
|
1939
1983
|
},
|
|
1940
1984
|
lastQuarter: {
|
|
1941
1985
|
label: "Прошлый квартал",
|
|
@@ -1958,8 +2002,8 @@ var Ln = class {
|
|
|
1958
2002
|
lastHalfYear: {
|
|
1959
2003
|
label: "Прошлое полугодие",
|
|
1960
2004
|
group: "halfYear",
|
|
1961
|
-
from: X.startOfHalfYear(
|
|
1962
|
-
to: X.endOfHalfYear(
|
|
2005
|
+
from: X.startOfHalfYear(l),
|
|
2006
|
+
to: X.endOfHalfYear(l)
|
|
1963
2007
|
},
|
|
1964
2008
|
thisHalfYear: {
|
|
1965
2009
|
label: "Это полугодие",
|
|
@@ -1970,13 +2014,13 @@ var Ln = class {
|
|
|
1970
2014
|
nextHalfYear: {
|
|
1971
2015
|
label: "Следующее полугодие",
|
|
1972
2016
|
group: "halfYear",
|
|
1973
|
-
from: X.startOfHalfYear(
|
|
1974
|
-
to: X.endOfHalfYear(
|
|
2017
|
+
from: X.startOfHalfYear(u),
|
|
2018
|
+
to: X.endOfHalfYear(u)
|
|
1975
2019
|
},
|
|
1976
2020
|
lastYear: {
|
|
1977
2021
|
label: "Прошлый год",
|
|
1978
2022
|
group: "year",
|
|
1979
|
-
from:
|
|
2023
|
+
from: M(st(e, 1)),
|
|
1980
2024
|
to: Je(st(e, 1))
|
|
1981
2025
|
},
|
|
1982
2026
|
thisYear: {
|
|
@@ -1988,14 +2032,14 @@ var Ln = class {
|
|
|
1988
2032
|
nextYear: {
|
|
1989
2033
|
label: "Следующий год",
|
|
1990
2034
|
group: "year",
|
|
1991
|
-
from:
|
|
2035
|
+
from: M(Ve(e, 1)),
|
|
1992
2036
|
to: Je(Ve(e, 1))
|
|
1993
2037
|
},
|
|
1994
2038
|
fromBeginningOfThisWeek: {
|
|
1995
2039
|
label: "С начала этой недели",
|
|
1996
2040
|
group: "other",
|
|
1997
2041
|
section: "fromBeginning",
|
|
1998
|
-
from:
|
|
2042
|
+
from: j(e, t),
|
|
1999
2043
|
to: r
|
|
2000
2044
|
},
|
|
2001
2045
|
fromBeginningOfThisTenDays: {
|
|
@@ -2052,7 +2096,7 @@ var Ln = class {
|
|
|
2052
2096
|
group: "other",
|
|
2053
2097
|
section: "tillEnd",
|
|
2054
2098
|
from: n,
|
|
2055
|
-
to:
|
|
2099
|
+
to: E(e)
|
|
2056
2100
|
},
|
|
2057
2101
|
tillEndOfThisQuarter: {
|
|
2058
2102
|
label: "До конца этого квартала",
|
|
@@ -2091,7 +2135,7 @@ var Ln = class {
|
|
|
2091
2135
|
label: "Прошлый месяц, до такой же даты",
|
|
2092
2136
|
group: "other",
|
|
2093
2137
|
section: "lastTillSame",
|
|
2094
|
-
...X.intervalTillSameDate(a,
|
|
2138
|
+
...X.intervalTillSameDate(a, A(it(e, 1)), e)
|
|
2095
2139
|
},
|
|
2096
2140
|
lastQuarterTillSameDate: {
|
|
2097
2141
|
label: "Прошлый квартал, до такой же даты",
|
|
@@ -2103,13 +2147,13 @@ var Ln = class {
|
|
|
2103
2147
|
label: "Прошлое полугодие, до такой же даты",
|
|
2104
2148
|
group: "other",
|
|
2105
2149
|
section: "lastTillSame",
|
|
2106
|
-
...X.intervalTillSameDate(s, X.startOfHalfYear(
|
|
2150
|
+
...X.intervalTillSameDate(s, X.startOfHalfYear(l), e)
|
|
2107
2151
|
},
|
|
2108
2152
|
lastYearTillSameDate: {
|
|
2109
2153
|
label: "Прошлый год, до такой же даты",
|
|
2110
2154
|
group: "other",
|
|
2111
2155
|
section: "lastTillSame",
|
|
2112
|
-
...X.intervalTillSameDate(c,
|
|
2156
|
+
...X.intervalTillSameDate(c, M(st(e, 1)), e)
|
|
2113
2157
|
},
|
|
2114
2158
|
nextWeekTillSameWeekDay: {
|
|
2115
2159
|
label: "Следующая неделя, до такого же дня недели",
|
|
@@ -2127,7 +2171,7 @@ var Ln = class {
|
|
|
2127
2171
|
label: "Следующий месяц, до такой же даты",
|
|
2128
2172
|
group: "other",
|
|
2129
2173
|
section: "nextTillSame",
|
|
2130
|
-
...X.intervalTillSameDate(a,
|
|
2174
|
+
...X.intervalTillSameDate(a, A(w(e, 1)), e)
|
|
2131
2175
|
},
|
|
2132
2176
|
nextQuarterTillSameDate: {
|
|
2133
2177
|
label: "Следующий квартал, до такой же даты",
|
|
@@ -2139,19 +2183,19 @@ var Ln = class {
|
|
|
2139
2183
|
label: "Следующее полугодие, до такой же даты",
|
|
2140
2184
|
group: "other",
|
|
2141
2185
|
section: "nextTillSame",
|
|
2142
|
-
...X.intervalTillSameDate(s, X.startOfHalfYear(
|
|
2186
|
+
...X.intervalTillSameDate(s, X.startOfHalfYear(u), e)
|
|
2143
2187
|
},
|
|
2144
2188
|
nextYearTillSameDate: {
|
|
2145
2189
|
label: "Следующий год, до такой же даты",
|
|
2146
2190
|
group: "other",
|
|
2147
2191
|
section: "nextTillSame",
|
|
2148
|
-
...X.intervalTillSameDate(c,
|
|
2192
|
+
...X.intervalTillSameDate(c, M(Ve(e, 1)), e)
|
|
2149
2193
|
},
|
|
2150
2194
|
last7Days: {
|
|
2151
2195
|
label: "Последние 7 дней",
|
|
2152
2196
|
group: "other",
|
|
2153
2197
|
section: "rollingDays",
|
|
2154
|
-
from:
|
|
2198
|
+
from: k(rt(e, 6)),
|
|
2155
2199
|
to: r
|
|
2156
2200
|
},
|
|
2157
2201
|
next7Days: {
|
|
@@ -2159,11 +2203,11 @@ var Ln = class {
|
|
|
2159
2203
|
group: "other",
|
|
2160
2204
|
section: "rollingDays",
|
|
2161
2205
|
from: n,
|
|
2162
|
-
to: C(
|
|
2206
|
+
to: T(C(e, 6))
|
|
2163
2207
|
}
|
|
2164
2208
|
};
|
|
2165
2209
|
}
|
|
2166
|
-
},
|
|
2210
|
+
}, Un = [
|
|
2167
2211
|
{
|
|
2168
2212
|
key: "day",
|
|
2169
2213
|
label: "День"
|
|
@@ -2196,7 +2240,7 @@ var Ln = class {
|
|
|
2196
2240
|
key: "other",
|
|
2197
2241
|
label: "Прочее"
|
|
2198
2242
|
}
|
|
2199
|
-
],
|
|
2243
|
+
], Wn = [
|
|
2200
2244
|
{
|
|
2201
2245
|
key: "fromBeginning",
|
|
2202
2246
|
label: "С начала периода"
|
|
@@ -2217,7 +2261,7 @@ var Ln = class {
|
|
|
2217
2261
|
key: "rollingDays",
|
|
2218
2262
|
label: "7 дней"
|
|
2219
2263
|
}
|
|
2220
|
-
],
|
|
2264
|
+
], Gn = class extends xn {}, Kn = class {
|
|
2221
2265
|
salesDirections;
|
|
2222
2266
|
partnerGroups;
|
|
2223
2267
|
managers;
|
|
@@ -2228,7 +2272,7 @@ var Ln = class {
|
|
|
2228
2272
|
lastLoginDate;
|
|
2229
2273
|
lastOrderDate;
|
|
2230
2274
|
constructor(e) {
|
|
2231
|
-
this.salesDirections =
|
|
2275
|
+
this.salesDirections = S(e?.salesDirections ?? [], (e) => new g(e)), this.partnerGroups = S(e?.partnerGroups ?? [], (e) => new h(e)), this.managers = S(e?.managers ?? [], (e) => new I(e)), this.additionalClients = S(e?.additionalClients ?? [], (e) => new Gn(e)), this.fixedClients = S(e?.fixedClients ?? [], (e) => new Gn(e)), this.regions = S(e?.regions ?? [], (e) => new fe(e)), this.cities = S(e?.cities ?? [], (e) => new n(e)), this.lastLoginDate = new F(e?.lastLoginDate), this.lastOrderDate = new F(e?.lastOrderDate);
|
|
2232
2276
|
}
|
|
2233
2277
|
hasClientConditions() {
|
|
2234
2278
|
return Fe([
|
|
@@ -2239,33 +2283,33 @@ var Ln = class {
|
|
|
2239
2283
|
this.fixedClients,
|
|
2240
2284
|
this.regions,
|
|
2241
2285
|
this.cities
|
|
2242
|
-
], (e) => !
|
|
2286
|
+
], (e) => !y(e)) || Fe([this.lastLoginDate, this.lastOrderDate], (e) => !!e.from || !!e.to);
|
|
2243
2287
|
}
|
|
2244
2288
|
setPeriod(e, t) {
|
|
2245
|
-
return this[e] = new
|
|
2246
|
-
from: t?.from ?
|
|
2247
|
-
to: t?.to ?
|
|
2289
|
+
return this[e] = new F({
|
|
2290
|
+
from: t?.from ? k(t.from) : null,
|
|
2291
|
+
to: t?.to ? T(t.to) : null
|
|
2248
2292
|
}), this;
|
|
2249
2293
|
}
|
|
2250
2294
|
toSaveData() {
|
|
2251
2295
|
return {
|
|
2252
|
-
salesDirections:
|
|
2253
|
-
partnerGroups:
|
|
2254
|
-
managers:
|
|
2255
|
-
additionalClients:
|
|
2256
|
-
regions:
|
|
2257
|
-
cities:
|
|
2258
|
-
lastLoginDate: new
|
|
2259
|
-
lastOrderDate: new
|
|
2296
|
+
salesDirections: S(this.salesDirections, "id"),
|
|
2297
|
+
partnerGroups: S(this.partnerGroups, "id"),
|
|
2298
|
+
managers: S(this.managers, "id"),
|
|
2299
|
+
additionalClients: S(this.additionalClients, "id"),
|
|
2300
|
+
regions: S(this.regions, "id"),
|
|
2301
|
+
cities: S(this.cities, "id"),
|
|
2302
|
+
lastLoginDate: new F(this.lastLoginDate),
|
|
2303
|
+
lastOrderDate: new F(this.lastOrderDate)
|
|
2260
2304
|
};
|
|
2261
2305
|
}
|
|
2262
|
-
},
|
|
2306
|
+
}, qn = /* @__PURE__ */ function(e) {
|
|
2263
2307
|
return e.Active = "active", e.Scheduled = "scheduled", e.Completed = "completed", e;
|
|
2264
|
-
}({}),
|
|
2308
|
+
}({}), Jn = class {
|
|
2265
2309
|
static resolve(e, t = /* @__PURE__ */ new Date()) {
|
|
2266
|
-
return e.deletedAt && e.deletedAt.getTime() <= t.getTime() ?
|
|
2310
|
+
return e.deletedAt && e.deletedAt.getTime() <= t.getTime() ? qn.Completed : e.publishedAt && e.publishedAt.getTime() > t.getTime() ? qn.Scheduled : qn.Active;
|
|
2267
2311
|
}
|
|
2268
|
-
},
|
|
2312
|
+
}, Yn = class extends xt {
|
|
2269
2313
|
conditions;
|
|
2270
2314
|
products;
|
|
2271
2315
|
productCategories;
|
|
@@ -2274,10 +2318,10 @@ var Ln = class {
|
|
|
2274
2318
|
countDiscountedProducts;
|
|
2275
2319
|
countDiscountedClients;
|
|
2276
2320
|
constructor(e) {
|
|
2277
|
-
super(e), this.conditions = new
|
|
2321
|
+
super(e), this.conditions = new Kn(e?.conditions), this.products = S(e?.products ?? [], (e) => new z(e)), this.productCategories = S(e?.productCategories ?? [], (e) => new U(e)), this.countDiscountedPrices = e?.countDiscountedPrices ?? 0, this.expectedCountDiscountedPrices = e?.expectedCountDiscountedPrices ?? 0, this.countDiscountedProducts = e?.countDiscountedProducts ?? 0, this.countDiscountedClients = e?.countDiscountedClients ?? 0;
|
|
2278
2322
|
}
|
|
2279
2323
|
getState(e = /* @__PURE__ */ new Date()) {
|
|
2280
|
-
return
|
|
2324
|
+
return Jn.resolve(this, e);
|
|
2281
2325
|
}
|
|
2282
2326
|
assignCounters(e) {
|
|
2283
2327
|
this.countDiscountedPrices = e.countDiscountedPrices, this.expectedCountDiscountedPrices = e.expectedCountDiscountedPrices, this.countDiscountedProducts = e.countDiscountedProducts, this.countDiscountedClients = e.countDiscountedClients;
|
|
@@ -2293,12 +2337,12 @@ var Ln = class {
|
|
|
2293
2337
|
publishedAt: this.publishedAt ?? null,
|
|
2294
2338
|
deletedAt: this.deletedAt ?? null,
|
|
2295
2339
|
description: this.description ?? "",
|
|
2296
|
-
products:
|
|
2297
|
-
productCategories:
|
|
2340
|
+
products: S(this.products, "id"),
|
|
2341
|
+
productCategories: S(this.productCategories, "id"),
|
|
2298
2342
|
conditions: this.conditions.toSaveData()
|
|
2299
2343
|
};
|
|
2300
2344
|
}
|
|
2301
|
-
},
|
|
2345
|
+
}, Xn = class {
|
|
2302
2346
|
client;
|
|
2303
2347
|
additionalClientsCondition;
|
|
2304
2348
|
fixedClientsCondition;
|
|
@@ -2308,12 +2352,12 @@ var Ln = class {
|
|
|
2308
2352
|
regionsCondition;
|
|
2309
2353
|
salesDirectionsCondition;
|
|
2310
2354
|
constructor(e) {
|
|
2311
|
-
this.client = new
|
|
2355
|
+
this.client = new Gn(e?.client), this.additionalClientsCondition = e?.additionalClientsCondition ?? !1, this.fixedClientsCondition = e?.fixedClientsCondition ?? !1, this.partnerGroupsCondition = e?.partnerGroupsCondition ?? !1, this.managersCondition = e?.managersCondition ?? !1, this.citiesCondition = e?.citiesCondition ?? !1, this.regionsCondition = e?.regionsCondition ?? !1, this.salesDirectionsCondition = e?.salesDirectionsCondition ?? !1;
|
|
2312
2356
|
}
|
|
2313
2357
|
isEligible() {
|
|
2314
2358
|
return this.additionalClientsCondition || this.fixedClientsCondition || this.partnerGroupsCondition || this.managersCondition || this.citiesCondition || this.regionsCondition || this.salesDirectionsCondition;
|
|
2315
2359
|
}
|
|
2316
|
-
},
|
|
2360
|
+
}, Zn = class extends N {
|
|
2317
2361
|
id;
|
|
2318
2362
|
name;
|
|
2319
2363
|
states;
|
|
@@ -2328,7 +2372,7 @@ var Ln = class {
|
|
|
2328
2372
|
}
|
|
2329
2373
|
return this;
|
|
2330
2374
|
}
|
|
2331
|
-
},
|
|
2375
|
+
}, Qn = class t extends e {
|
|
2332
2376
|
static prepareSaveData(e, t) {
|
|
2333
2377
|
return {
|
|
2334
2378
|
...e,
|
|
@@ -2343,32 +2387,74 @@ var Ln = class {
|
|
|
2343
2387
|
};
|
|
2344
2388
|
}
|
|
2345
2389
|
getDiscountsList(e, t, n, r) {
|
|
2346
|
-
return this.getTypedPaginated(
|
|
2390
|
+
return this.getTypedPaginated(xt, "/internal/price/discounts", e, t, n, {}, void 0, r);
|
|
2347
2391
|
}
|
|
2348
2392
|
getDiscount(e) {
|
|
2349
|
-
return this.get(`/internal/price/discounts/${e}`, {}, (e) => new
|
|
2393
|
+
return this.get(`/internal/price/discounts/${e}`, {}, (e) => new Yn(e.data));
|
|
2350
2394
|
}
|
|
2351
2395
|
createDiscount(e, n, r = {}) {
|
|
2352
|
-
return this.post("/internal/price/discounts", t.prepareSaveData(e, n), (e) => new
|
|
2396
|
+
return this.post("/internal/price/discounts", t.prepareSaveData(e, n), (e) => new Yn(e.data), r);
|
|
2353
2397
|
}
|
|
2354
2398
|
updateDiscount(e, n, r, i = {}) {
|
|
2355
|
-
return this.patch(`/internal/price/discounts/${e}`, t.prepareSaveData(n, r), (e) => new
|
|
2399
|
+
return this.patch(`/internal/price/discounts/${e}`, t.prepareSaveData(n, r), (e) => new Yn(e.data), i);
|
|
2356
2400
|
}
|
|
2357
2401
|
removeDiscount(e) {
|
|
2358
2402
|
return this.delete(`/internal/price/discounts/${e}`);
|
|
2359
2403
|
}
|
|
2360
2404
|
getEligibleClients(e) {
|
|
2361
|
-
return this.getTypedList(
|
|
2405
|
+
return this.getTypedList(Xn, `/internal/price/discounts/${e}/clients`);
|
|
2362
2406
|
}
|
|
2363
2407
|
checkClient(e, t) {
|
|
2364
|
-
return this.get(`/internal/price/discounts/${e}/clients/${t}/check`, {}, (e) => new
|
|
2408
|
+
return this.get(`/internal/price/discounts/${e}/clients/${t}/check`, {}, (e) => new Xn(e.data));
|
|
2409
|
+
}
|
|
2410
|
+
}, $n = /* @__PURE__ */ function(e) {
|
|
2411
|
+
return e.Directory = "dir", e.File = "file", e.Link = "link", e;
|
|
2412
|
+
}({}), er = class extends P {
|
|
2413
|
+
parentId;
|
|
2414
|
+
type;
|
|
2415
|
+
name;
|
|
2416
|
+
description;
|
|
2417
|
+
documentType;
|
|
2418
|
+
extension;
|
|
2419
|
+
url;
|
|
2420
|
+
level;
|
|
2421
|
+
creator;
|
|
2422
|
+
constructor(e) {
|
|
2423
|
+
super(e, -1), this.parentId = e?.parentId ?? void 0, this.type = e?.type ?? $n.File, this.name = e?.name ?? "", this.description = e?.description ?? void 0, this.documentType = e?.documentType ?? void 0, this.extension = e?.extension ?? void 0, this.url = e?.url ?? void 0, this.level = e?.level ?? 0, this.creator = b(e?.creator) ? void 0 : new I(e.creator);
|
|
2365
2424
|
}
|
|
2366
|
-
},
|
|
2425
|
+
}, tr = /* @__PURE__ */ function(e) {
|
|
2426
|
+
return e.Youtube = "youtube", e.Document = "document", e.File = "file", e.Image = "image", e;
|
|
2427
|
+
}({}), nr = class e extends d {
|
|
2428
|
+
static transformDocumentDataToRequest(e) {
|
|
2429
|
+
return {
|
|
2430
|
+
parentId: e.parentId,
|
|
2431
|
+
type: e.type,
|
|
2432
|
+
name: e.name,
|
|
2433
|
+
description: e.description,
|
|
2434
|
+
file: e.type === $n.File ? e.file : void 0,
|
|
2435
|
+
link: e.type === $n.Link ? e.url : void 0,
|
|
2436
|
+
documentType: e.type === $n.Link ? e.documentType : void 0
|
|
2437
|
+
};
|
|
2438
|
+
}
|
|
2439
|
+
static transformListParamsToRequest(e, t) {
|
|
2440
|
+
let n = {};
|
|
2441
|
+
return e && (n.filters = JSON.stringify((e instanceof u ? e : new u(e)).toPrimitive())), y(t) || (n.sort = Ee(t) ? t : [t]), n;
|
|
2442
|
+
}
|
|
2443
|
+
getDocumentsList(t, n, r) {
|
|
2444
|
+
return this.getTypedList(er, "/internal/documents", e.transformListParamsToRequest(t, n), !1, r);
|
|
2445
|
+
}
|
|
2446
|
+
createDocument(t, n = {}) {
|
|
2447
|
+
return this.post("/internal/documents", e.transformDocumentDataToRequest(t), (e) => new er(e.data), n);
|
|
2448
|
+
}
|
|
2449
|
+
deleteDocument(e) {
|
|
2450
|
+
return this.delete(`/internal/documents/${e}`);
|
|
2451
|
+
}
|
|
2452
|
+
}, rr = class extends _e {
|
|
2367
2453
|
showAllCosts;
|
|
2368
2454
|
constructor(e) {
|
|
2369
2455
|
super(e), this.showAllCosts = e?.showAllCosts;
|
|
2370
2456
|
}
|
|
2371
|
-
},
|
|
2457
|
+
}, ir = class extends N {
|
|
2372
2458
|
name;
|
|
2373
2459
|
phone;
|
|
2374
2460
|
email;
|
|
@@ -2385,7 +2471,7 @@ var Ln = class {
|
|
|
2385
2471
|
}
|
|
2386
2472
|
return this;
|
|
2387
2473
|
}
|
|
2388
|
-
},
|
|
2474
|
+
}, ar = class t extends e {
|
|
2389
2475
|
static transformExternalSeoDataToRequest(e) {
|
|
2390
2476
|
return {
|
|
2391
2477
|
name: e.name,
|
|
@@ -2398,62 +2484,62 @@ var Ln = class {
|
|
|
2398
2484
|
};
|
|
2399
2485
|
}
|
|
2400
2486
|
getExternalSeoList(e, t, n, r) {
|
|
2401
|
-
return this.getTypedPaginated(
|
|
2487
|
+
return this.getTypedPaginated(_e, "/internal/external-seo", e, t, n, {}, void 0, r);
|
|
2402
2488
|
}
|
|
2403
2489
|
getExternalSeo(e, t = !1) {
|
|
2404
|
-
return this.get(`/internal/external-seo/${e}`, {}, (e) => new
|
|
2490
|
+
return this.get(`/internal/external-seo/${e}`, {}, (e) => new rr(e.data), t);
|
|
2405
2491
|
}
|
|
2406
2492
|
createExternalSeo(e, n = {}) {
|
|
2407
|
-
return this.post("/internal/external-seo", t.transformExternalSeoDataToRequest(e), (e) => new
|
|
2493
|
+
return this.post("/internal/external-seo", t.transformExternalSeoDataToRequest(e), (e) => new rr(e.data), n);
|
|
2408
2494
|
}
|
|
2409
2495
|
updateExternalSeo(e, n = {}) {
|
|
2410
|
-
return this.patch(`/internal/external-seo/${e.id}`, t.transformExternalSeoDataToRequest(e), (e) => new
|
|
2496
|
+
return this.patch(`/internal/external-seo/${e.id}`, t.transformExternalSeoDataToRequest(e), (e) => new rr(e.data), n);
|
|
2411
2497
|
}
|
|
2412
2498
|
deleteExternalSeo(e) {
|
|
2413
2499
|
return this.delete(`/internal/external-seo/${e}`);
|
|
2414
2500
|
}
|
|
2415
|
-
},
|
|
2501
|
+
}, or = class extends m {
|
|
2416
2502
|
constructor(e) {
|
|
2417
2503
|
super(e);
|
|
2418
2504
|
}
|
|
2419
|
-
},
|
|
2505
|
+
}, sr = class extends f {
|
|
2420
2506
|
question;
|
|
2421
2507
|
answer;
|
|
2422
2508
|
groups;
|
|
2423
2509
|
constructor(e) {
|
|
2424
|
-
super(e, -1), this.question = e?.question ?? "", this.answer = e?.answer ?? "", this.groups =
|
|
2510
|
+
super(e, -1), this.question = e?.question ?? "", this.answer = e?.answer ?? "", this.groups = S(e?.groups ?? [], (e) => new or(e));
|
|
2425
2511
|
}
|
|
2426
2512
|
toSaveData() {
|
|
2427
2513
|
return {
|
|
2428
2514
|
question: this.question,
|
|
2429
2515
|
answer: this.answer,
|
|
2430
|
-
groups:
|
|
2516
|
+
groups: S(this.groups, "id")
|
|
2431
2517
|
};
|
|
2432
2518
|
}
|
|
2433
|
-
},
|
|
2519
|
+
}, cr = class extends e {
|
|
2434
2520
|
getFaqList(e, t) {
|
|
2435
|
-
return this.getTypedPaginated(
|
|
2521
|
+
return this.getTypedPaginated(sr, "/internal/faq", void 0, void 0, t, b(e) ? {} : { group: e });
|
|
2436
2522
|
}
|
|
2437
2523
|
getFaq(e) {
|
|
2438
|
-
return this.get(`/internal/faq/${e}`, {}, (e) => new
|
|
2524
|
+
return this.get(`/internal/faq/${e}`, {}, (e) => new sr(e.data));
|
|
2439
2525
|
}
|
|
2440
2526
|
createFaq(e, t = {}) {
|
|
2441
|
-
return this.post("/internal/faq", e, (e) => new
|
|
2527
|
+
return this.post("/internal/faq", e, (e) => new sr(e.data), t);
|
|
2442
2528
|
}
|
|
2443
2529
|
updateFaq(e, t, n = {}) {
|
|
2444
|
-
return this.patch(`/internal/faq/${e}`, t, (e) => new
|
|
2530
|
+
return this.patch(`/internal/faq/${e}`, t, (e) => new sr(e.data), n);
|
|
2445
2531
|
}
|
|
2446
2532
|
removeFaq(e) {
|
|
2447
2533
|
return this.delete(`/internal/faq/${e}`);
|
|
2448
2534
|
}
|
|
2449
2535
|
getGroupsList() {
|
|
2450
|
-
return this.getTypedList(
|
|
2536
|
+
return this.getTypedList(or, "/internal/faq/groups");
|
|
2451
2537
|
}
|
|
2452
2538
|
createGroup(e, t = {}) {
|
|
2453
|
-
return this.post("/internal/faq/groups", e, (e) => new
|
|
2539
|
+
return this.post("/internal/faq/groups", e, (e) => new or(e.data), t);
|
|
2454
2540
|
}
|
|
2455
2541
|
updateGroup(e, t, n = {}) {
|
|
2456
|
-
return this.patch(`/internal/faq/groups/${e}`, t, (e) => new
|
|
2542
|
+
return this.patch(`/internal/faq/groups/${e}`, t, (e) => new or(e.data), n);
|
|
2457
2543
|
}
|
|
2458
2544
|
removeGroup(e) {
|
|
2459
2545
|
return this.delete(`/internal/faq/groups/${e}`);
|
|
@@ -2461,13 +2547,13 @@ var Ln = class {
|
|
|
2461
2547
|
};
|
|
2462
2548
|
//#endregion
|
|
2463
2549
|
//#region src/helpers/format-percent-change.ts
|
|
2464
|
-
function
|
|
2465
|
-
let t =
|
|
2550
|
+
function lr(e) {
|
|
2551
|
+
let t = Ne(e * 100);
|
|
2466
2552
|
return `${t >= 0 ? "+" : ""}${t}%`;
|
|
2467
2553
|
}
|
|
2468
2554
|
//#endregion
|
|
2469
2555
|
//#region src/helpers/units-helper.ts
|
|
2470
|
-
var
|
|
2556
|
+
var ur = class e {
|
|
2471
2557
|
static productIsMeasurable(e) {
|
|
2472
2558
|
return e.unit.isLinear || e.unit.isSquare;
|
|
2473
2559
|
}
|
|
@@ -2477,9 +2563,9 @@ var tr = class e {
|
|
|
2477
2563
|
static getProductLengthMultiplicity(e) {
|
|
2478
2564
|
return e.properties?.lengthStep == null ? !e.properties?.ignoreMinCountCheck && e.properties?.minCount != null ? e.properties.minCount : .01 : e.properties.lengthStep;
|
|
2479
2565
|
}
|
|
2480
|
-
},
|
|
2566
|
+
}, dr = class {
|
|
2481
2567
|
static generateUndefinedManagerInstance() {
|
|
2482
|
-
return new
|
|
2568
|
+
return new p({
|
|
2483
2569
|
id: 0,
|
|
2484
2570
|
name: "- Не назначен -",
|
|
2485
2571
|
isActive: !0,
|
|
@@ -2489,7 +2575,7 @@ var tr = class e {
|
|
|
2489
2575
|
static isUndefinedManagerInstance(e) {
|
|
2490
2576
|
return e.id === 0 && e.guid === "-undefined-";
|
|
2491
2577
|
}
|
|
2492
|
-
},
|
|
2578
|
+
}, fr = class extends N {
|
|
2493
2579
|
name;
|
|
2494
2580
|
phone;
|
|
2495
2581
|
email;
|
|
@@ -2498,7 +2584,7 @@ var tr = class e {
|
|
|
2498
2584
|
isSupervisor;
|
|
2499
2585
|
canDoReclamations;
|
|
2500
2586
|
constructor(e) {
|
|
2501
|
-
super(), this.name = e?.name, this.phone = e?.phone, this.email = e?.email, this.salesDirections = e?.salesDirections?.map((e) => new
|
|
2587
|
+
super(), this.name = e?.name, this.phone = e?.phone, this.email = e?.email, this.salesDirections = e?.salesDirections?.map((e) => new g(e)), this.isActive = e?.isActive, this.isSupervisor = e?.isSupervisor, this.canDoReclamations = e?.canDoReclamations;
|
|
2502
2588
|
}
|
|
2503
2589
|
resetFilterValue(e) {
|
|
2504
2590
|
switch (e) {
|
|
@@ -2512,7 +2598,7 @@ var tr = class e {
|
|
|
2512
2598
|
}
|
|
2513
2599
|
return this;
|
|
2514
2600
|
}
|
|
2515
|
-
},
|
|
2601
|
+
}, pr = class e extends re {
|
|
2516
2602
|
static transformManagerDataToRequest(e) {
|
|
2517
2603
|
return {
|
|
2518
2604
|
name: e.name,
|
|
@@ -2526,37 +2612,37 @@ var tr = class e {
|
|
|
2526
2612
|
salesDirectionId: e.salesDirection.id,
|
|
2527
2613
|
pricingRoleId: e.pricingRole?.id,
|
|
2528
2614
|
showAllCosts: e.showAllCosts ?? !1,
|
|
2529
|
-
storeIds:
|
|
2530
|
-
curatedDirectionIds:
|
|
2531
|
-
managerRegionIds:
|
|
2532
|
-
managerIds:
|
|
2615
|
+
storeIds: S(e.stores, "id"),
|
|
2616
|
+
curatedDirectionIds: S(e.curatedDirections, "id"),
|
|
2617
|
+
managerRegionIds: S(e.managerRegions, "id"),
|
|
2618
|
+
managerIds: S(e.managers, "id"),
|
|
2533
2619
|
photo: e.photoFile
|
|
2534
2620
|
};
|
|
2535
2621
|
}
|
|
2536
2622
|
getManagersList(e, t, n, r) {
|
|
2537
|
-
return this.getTypedPaginated(
|
|
2623
|
+
return this.getTypedPaginated(p, "/internal/managers", e, t, n, {}, void 0, r);
|
|
2538
2624
|
}
|
|
2539
2625
|
createManager(t, n = {}) {
|
|
2540
|
-
return this.post("/internal/managers", e.transformManagerDataToRequest(t), (e) => new
|
|
2626
|
+
return this.post("/internal/managers", e.transformManagerDataToRequest(t), (e) => new p(e.data), n);
|
|
2541
2627
|
}
|
|
2542
2628
|
updateManager(t, n = {}) {
|
|
2543
|
-
return this.patch(`/internal/managers/${t.id}`, e.transformManagerDataToRequest(t), (e) => new
|
|
2629
|
+
return this.patch(`/internal/managers/${t.id}`, e.transformManagerDataToRequest(t), (e) => new p(e.data), n);
|
|
2544
2630
|
}
|
|
2545
2631
|
getManagerRegionsList(e, t, n) {
|
|
2546
|
-
return this.getTypedPaginated(
|
|
2632
|
+
return this.getTypedPaginated(ye, "/internal/managers/regions", e, t, n);
|
|
2547
2633
|
}
|
|
2548
|
-
},
|
|
2634
|
+
}, mr = /* @__PURE__ */ function(e) {
|
|
2549
2635
|
return e.Processing = "processing", e.Completed = "completed", e.Error = "error", e.NeedsActualization = "needs_actualization", e;
|
|
2550
|
-
}({}),
|
|
2636
|
+
}({}), hr = class {
|
|
2551
2637
|
status;
|
|
2552
2638
|
actualizedAt;
|
|
2553
2639
|
expiresAt;
|
|
2554
2640
|
error;
|
|
2555
2641
|
constructor(e) {
|
|
2556
|
-
this.status = e?.status ??
|
|
2642
|
+
this.status = e?.status ?? mr.Processing, this.actualizedAt = s.parse(e?.actualizedAt), this.expiresAt = s.parse(e?.expiresAt), this.error = e?.error;
|
|
2557
2643
|
}
|
|
2558
2644
|
get isProcessing() {
|
|
2559
|
-
return this.status ===
|
|
2645
|
+
return this.status === mr.Processing;
|
|
2560
2646
|
}
|
|
2561
2647
|
get isOutdated() {
|
|
2562
2648
|
return this.isOutdatedAt(/* @__PURE__ */ new Date());
|
|
@@ -2565,12 +2651,12 @@ var tr = class e {
|
|
|
2565
2651
|
return this.isOrderAllowedAt(/* @__PURE__ */ new Date());
|
|
2566
2652
|
}
|
|
2567
2653
|
isOutdatedAt(e) {
|
|
2568
|
-
return this.status !==
|
|
2654
|
+
return this.status !== mr.Completed || b(this.actualizedAt) ? !0 : !b(this.expiresAt) && this.expiresAt.getTime() < e.getTime();
|
|
2569
2655
|
}
|
|
2570
2656
|
isOrderAllowedAt(e) {
|
|
2571
|
-
return this.status ===
|
|
2657
|
+
return this.status === mr.Completed && !this.isOutdatedAt(e);
|
|
2572
2658
|
}
|
|
2573
|
-
},
|
|
2659
|
+
}, gr = class extends P {
|
|
2574
2660
|
name;
|
|
2575
2661
|
client;
|
|
2576
2662
|
sum;
|
|
@@ -2578,9 +2664,9 @@ var tr = class e {
|
|
|
2578
2664
|
actualization;
|
|
2579
2665
|
file;
|
|
2580
2666
|
constructor(e) {
|
|
2581
|
-
super(e), this.name = e?.name, this.client = new
|
|
2667
|
+
super(e), this.name = e?.name, this.client = new W(e?.client), this.sum = e?.sum, this.isProfstroy = e?.isProfstroy, this.actualization = e?.actualization && new hr(e.actualization), this.file = e?.file;
|
|
2582
2668
|
}
|
|
2583
|
-
},
|
|
2669
|
+
}, _r = class extends jt {
|
|
2584
2670
|
groupName;
|
|
2585
2671
|
supplierSku;
|
|
2586
2672
|
isIgnored;
|
|
@@ -2589,24 +2675,24 @@ var tr = class e {
|
|
|
2589
2675
|
super(e), this.groupName = e.groupName, this.supplierSku = e.supplierSku ?? e.product.supplierSku, this.isIgnored = e.isIgnored, this.lineError = e.lineError;
|
|
2590
2676
|
}
|
|
2591
2677
|
get isProductStub() {
|
|
2592
|
-
return
|
|
2678
|
+
return b(this.product.id);
|
|
2593
2679
|
}
|
|
2594
2680
|
get isOrderable() {
|
|
2595
|
-
return !this.isProductStub && !this.isIgnored &&
|
|
2681
|
+
return !this.isProductStub && !this.isIgnored && y(this.lineError);
|
|
2596
2682
|
}
|
|
2597
|
-
}, Z = class extends
|
|
2683
|
+
}, Z = class extends gr {
|
|
2598
2684
|
sum;
|
|
2599
2685
|
products;
|
|
2600
2686
|
constructor(e) {
|
|
2601
|
-
super(e), this.sum = e.sum ?? 0, this.products = (e.products ?? []).map((t) => e.isProfstroy ? new
|
|
2687
|
+
super(e), this.sum = e.sum ?? 0, this.products = (e.products ?? []).map((t) => e.isProfstroy ? new _r(t) : new jt(t));
|
|
2602
2688
|
}
|
|
2603
|
-
},
|
|
2689
|
+
}, vr = class extends N {
|
|
2604
2690
|
id;
|
|
2605
2691
|
clientSearchTerm;
|
|
2606
2692
|
name;
|
|
2607
|
-
createdAt = new
|
|
2693
|
+
createdAt = new F();
|
|
2608
2694
|
constructor(e) {
|
|
2609
|
-
super(), this.id = e?.id, this.clientSearchTerm = e?.clientSearchTerm, this.name = e?.name, this.createdAt = new
|
|
2695
|
+
super(), this.id = e?.id, this.clientSearchTerm = e?.clientSearchTerm, this.name = e?.name, this.createdAt = new F(e?.createdAt);
|
|
2610
2696
|
}
|
|
2611
2697
|
resetFilterValue(e) {
|
|
2612
2698
|
return e === "createdAt" ? (this.createdAt.from = null, this.createdAt.to = null) : this[e] = void 0, this;
|
|
@@ -2615,7 +2701,7 @@ var tr = class e {
|
|
|
2615
2701
|
let e = super.asClearRaw();
|
|
2616
2702
|
return !e?.createdAt?.from && !e?.createdAt?.to && delete e.createdAt, e;
|
|
2617
2703
|
}
|
|
2618
|
-
},
|
|
2704
|
+
}, yr = class extends Tn {
|
|
2619
2705
|
client;
|
|
2620
2706
|
payment;
|
|
2621
2707
|
delivery;
|
|
@@ -2630,20 +2716,20 @@ var tr = class e {
|
|
|
2630
2716
|
sum;
|
|
2631
2717
|
isLargeOrder;
|
|
2632
2718
|
constructor(e) {
|
|
2633
|
-
super(e), this.client = new
|
|
2719
|
+
super(e), this.client = new W(e?.client), this.payment = {
|
|
2634
2720
|
type: e?.payment?.type ?? -1,
|
|
2635
2721
|
status: e?.payment?.status ?? -1,
|
|
2636
2722
|
onlinePaymentLink: e?.payment?.onlinePaymentLink
|
|
2637
2723
|
}, this.delivery = {
|
|
2638
2724
|
type: e?.delivery?.type ?? -1,
|
|
2639
|
-
date:
|
|
2640
|
-
address: e?.delivery?.address ? new
|
|
2641
|
-
warehouse: e?.delivery?.warehouse ? new
|
|
2642
|
-
}, this.attachedUser = e?.attachedUser ? new
|
|
2725
|
+
date: x(e?.delivery?.date) ? O(e.delivery.date) : e?.delivery?.date ?? /* @__PURE__ */ new Date(),
|
|
2726
|
+
address: e?.delivery?.address ? new Sn(e.delivery.address) : void 0,
|
|
2727
|
+
warehouse: e?.delivery?.warehouse ? new be(e.delivery.warehouse) : void 0
|
|
2728
|
+
}, this.attachedUser = e?.attachedUser ? new I(e?.attachedUser) : void 0, this.status = new se(e?.status), this.statusDetail = e?.statusDetail ? new de(e.statusDetail) : void 0, this.salesDirection = new g(e?.salesDirection);
|
|
2643
2729
|
let t = e?.attachedAt;
|
|
2644
|
-
this.attachedAt =
|
|
2730
|
+
this.attachedAt = x(t) ? O(t) : e?.attachedAt, this.isOnOrder = e?.isOnOrder ?? !1, this.isProfstroy = e?.isProfstroy ?? !1, this.isNotInStock = e?.isNotInStock ?? !1, this.sum = e?.sum ?? 0, this.isLargeOrder = e?.isLargeOrder ?? !1;
|
|
2645
2731
|
}
|
|
2646
|
-
},
|
|
2732
|
+
}, br = class extends At {
|
|
2647
2733
|
product;
|
|
2648
2734
|
cost;
|
|
2649
2735
|
costOne;
|
|
@@ -2657,9 +2743,9 @@ var tr = class e {
|
|
|
2657
2743
|
changedFields = [];
|
|
2658
2744
|
replacement;
|
|
2659
2745
|
constructor(e, t) {
|
|
2660
|
-
super(e), this.product = new
|
|
2746
|
+
super(e), this.product = new B(e.product), this.currency = new o(e.currency), this.cost = e.cost, this.costOne = e.costOne, this.costOneRub = e.costOneRub, this.costRub = e.costRub, this.logicGroupId = e.logicGroupId, this.salesDirection = e.salesDirection, this.specificationImgUrl = e.specificationImgUrl, this.sawing = Ee(e.sawing) ? e.sawing : e.sawing ? [e.sawing] : void 0, t && (this.replacement = t, this.quantity !== t.quantity && this.changedFields.push("quantity"), this.length !== t.length && this.changedFields.push("length"));
|
|
2661
2747
|
}
|
|
2662
|
-
}, Q = class extends
|
|
2748
|
+
}, Q = class extends yr {
|
|
2663
2749
|
products;
|
|
2664
2750
|
invoices;
|
|
2665
2751
|
comment;
|
|
@@ -2675,11 +2761,11 @@ var tr = class e {
|
|
|
2675
2761
|
erpOrderUrl;
|
|
2676
2762
|
numberDoc;
|
|
2677
2763
|
constructor(e) {
|
|
2678
|
-
super(e), this.products = (e.products ?? []).map((t) => new
|
|
2764
|
+
super(e), this.products = (e.products ?? []).map((t) => new br(t, t.replacementId ? e.products?.find((e) => e.id === t.replacementId) : void 0)), this.invoices = e.invoices ?? [], this.comment = e.comment, this.image = e.image, this.contragent = e.contragent ? bn.createInstance(e.contragent) : void 0, this.barcode = e.barcode, this.orderSource = e.orderSource ? new de(e.orderSource) : void 0, this.isAllowProcessingWithoutPayment = e.isAllowProcessingWithoutPayment, this.nextStatuses = e.nextStatuses?.map((e) => new se(e)), this.actions = e.actions, this.operatorsComment = e.operatorsComment, this.operatorsForWarehouseComment = e.operatorsForWarehouseComment, this.erpOrderUrl = e.erpOrderUrl, this.numberDoc = e.numberDoc;
|
|
2679
2765
|
}
|
|
2680
|
-
},
|
|
2766
|
+
}, xr = class extends e {
|
|
2681
2767
|
getOffers(e, t, n, r) {
|
|
2682
|
-
return this.getTypedPaginated(
|
|
2768
|
+
return this.getTypedPaginated(gr, "/internal/orders/offers", e, t, n, {}, void 0, r);
|
|
2683
2769
|
}
|
|
2684
2770
|
createOfferFromCart(e, t, n) {
|
|
2685
2771
|
return this.post(`/internal/orders/offers/${e}`, {
|
|
@@ -2709,12 +2795,12 @@ var tr = class e {
|
|
|
2709
2795
|
return this.delete(`/internal/orders/offers/${e}`);
|
|
2710
2796
|
}
|
|
2711
2797
|
createOrderFromDraft(e, t, n, r = {}) {
|
|
2712
|
-
let i =
|
|
2798
|
+
let i = v().config.dateFormats.api;
|
|
2713
2799
|
return this.post(`/internal/orders/offers/${e}/create-order`, {
|
|
2714
2800
|
...t,
|
|
2715
|
-
deliveryDate: t.deliveryDate ?
|
|
2801
|
+
deliveryDate: t.deliveryDate ? D(t.deliveryDate, i) : void 0,
|
|
2716
2802
|
items: n?.length ? n : void 0
|
|
2717
|
-
}, (e) =>
|
|
2803
|
+
}, (e) => _.instanceListInitializer(Q, e.data), r);
|
|
2718
2804
|
}
|
|
2719
2805
|
addOfferProduct(e, t, n = {}) {
|
|
2720
2806
|
return this.post(`/internal/orders/offers/${e}/products`, {
|
|
@@ -2763,25 +2849,25 @@ var tr = class e {
|
|
|
2763
2849
|
sendOffer(e, t) {
|
|
2764
2850
|
return this.post(`/internal/orders/offers/${e}/send`, t);
|
|
2765
2851
|
}
|
|
2766
|
-
},
|
|
2852
|
+
}, Sr = class {
|
|
2767
2853
|
static isProfstroy(e) {
|
|
2768
2854
|
return !!e?.isProfstroy;
|
|
2769
2855
|
}
|
|
2770
2856
|
static isProfstroyOffer(e) {
|
|
2771
|
-
return !
|
|
2857
|
+
return !b(e) && e.isProfstroy === !0 && !b(e.actualization);
|
|
2772
2858
|
}
|
|
2773
|
-
},
|
|
2859
|
+
}, Cr = class extends _e {
|
|
2774
2860
|
isBillingSupervisor;
|
|
2775
2861
|
constructor(e) {
|
|
2776
2862
|
super(e), this.isBillingSupervisor = e?.isBillingSupervisor ?? !1;
|
|
2777
2863
|
}
|
|
2778
|
-
},
|
|
2864
|
+
}, wr = class extends Cr {
|
|
2779
2865
|
showAllCosts;
|
|
2780
2866
|
stores;
|
|
2781
2867
|
constructor(e) {
|
|
2782
|
-
super(e), this.showAllCosts = e?.showAllCosts, this.stores = e?.stores?.map((e) => new
|
|
2868
|
+
super(e), this.showAllCosts = e?.showAllCosts, this.stores = e?.stores?.map((e) => new me(e));
|
|
2783
2869
|
}
|
|
2784
|
-
},
|
|
2870
|
+
}, Tr = class extends N {
|
|
2785
2871
|
name;
|
|
2786
2872
|
phone;
|
|
2787
2873
|
email;
|
|
@@ -2790,7 +2876,7 @@ var tr = class e {
|
|
|
2790
2876
|
isBillingSupervisor;
|
|
2791
2877
|
canDoReclamations;
|
|
2792
2878
|
constructor(e) {
|
|
2793
|
-
super(), this.name = e?.name, this.phone = e?.phone, this.email = e?.email, this.salesDirections = e?.salesDirections?.map((e) => new
|
|
2879
|
+
super(), this.name = e?.name, this.phone = e?.phone, this.email = e?.email, this.salesDirections = e?.salesDirections?.map((e) => new g(e)), this.isActive = e?.isActive, this.isBillingSupervisor = e?.isBillingSupervisor, this.canDoReclamations = e?.canDoReclamations;
|
|
2794
2880
|
}
|
|
2795
2881
|
resetFilterValue(e) {
|
|
2796
2882
|
switch (e) {
|
|
@@ -2804,7 +2890,7 @@ var tr = class e {
|
|
|
2804
2890
|
}
|
|
2805
2891
|
return this;
|
|
2806
2892
|
}
|
|
2807
|
-
},
|
|
2893
|
+
}, Er = class t extends e {
|
|
2808
2894
|
static transformOperatorDataToRequest(e) {
|
|
2809
2895
|
return {
|
|
2810
2896
|
name: e.name,
|
|
@@ -2817,25 +2903,25 @@ var tr = class e {
|
|
|
2817
2903
|
salesDirectionId: e.salesDirection?.id,
|
|
2818
2904
|
pricingRoleId: e.pricingRole?.id,
|
|
2819
2905
|
showAllCosts: e.showAllCosts ?? !1,
|
|
2820
|
-
storeIds:
|
|
2906
|
+
storeIds: S(e.stores, "id"),
|
|
2821
2907
|
photo: e.photoFile
|
|
2822
2908
|
};
|
|
2823
2909
|
}
|
|
2824
2910
|
getOperatorsList(e, t, n, r) {
|
|
2825
|
-
return this.getTypedPaginated(
|
|
2911
|
+
return this.getTypedPaginated(Cr, "/internal/operators", e, t, n, {}, void 0, r);
|
|
2826
2912
|
}
|
|
2827
2913
|
getOperator(e, t = !1) {
|
|
2828
|
-
return this.get(`/internal/operators/${e}`, {}, (e) => new
|
|
2914
|
+
return this.get(`/internal/operators/${e}`, {}, (e) => new wr(e.data), t);
|
|
2829
2915
|
}
|
|
2830
2916
|
createOperator(e, n = {}) {
|
|
2831
|
-
return this.post("/internal/operators", t.transformOperatorDataToRequest(e), (e) => new
|
|
2917
|
+
return this.post("/internal/operators", t.transformOperatorDataToRequest(e), (e) => new wr(e.data), n);
|
|
2832
2918
|
}
|
|
2833
2919
|
updateOperator(e, n = {}) {
|
|
2834
|
-
return this.patch(`/internal/operators/${e.id}`, t.transformOperatorDataToRequest(e), (e) => new
|
|
2920
|
+
return this.patch(`/internal/operators/${e.id}`, t.transformOperatorDataToRequest(e), (e) => new wr(e.data), n);
|
|
2835
2921
|
}
|
|
2836
|
-
},
|
|
2922
|
+
}, Dr = /* @__PURE__ */ function(e) {
|
|
2837
2923
|
return e.View = "view", e.Share = "share", e.EditTags = "edit_tags", e.SaveOrderIgnoredProducts = "save_order_ignored_products", e.ChangeStatus = "change_status", e.ChangeProducts = "change_products", e.ChangeOrderParameters = "change_order_parameters", e.Recalculate = "recalculate", e.AttachOrder = "attach_order", e.DetachOrder = "detach_order", e.ChangeAttachedOperator = "change_attached_operator", e.SendOnlinePaymentLink = "send_online_payment_link", e.ConfirmOnlineFullPayment = "confirm_online_full_payment", e.MergeOrders = "merge_orders", e.GetHistory = "get_history", e.CloneOrder = "clone_order", e.DeleteAttachedFile = "delete_attached_file", e;
|
|
2838
|
-
}({}),
|
|
2924
|
+
}({}), Or = class {
|
|
2839
2925
|
paymentType;
|
|
2840
2926
|
deliveryType;
|
|
2841
2927
|
contragentId;
|
|
@@ -2853,21 +2939,21 @@ var tr = class e {
|
|
|
2853
2939
|
constructor(e) {
|
|
2854
2940
|
this.paymentType = e?.payment.type, this.deliveryType = e?.delivery.type, this.contragentId = e?.contragent?.id, this.deliveryDate = e?.delivery.date ? new Date(e.delivery.date) : void 0, this.addressId = e?.delivery.address?.id, this.warehouseId = e?.delivery.warehouse?.id, this.comment = e?.comment, this.barcode = e?.barcode, this.operatorsComment = e?.operatorsComment, this.operatorsForWarehouseComment = e?.operatorsForWarehouseComment, this.isAllowProcessingWithoutPayment = e?.isAllowProcessingWithoutPayment;
|
|
2855
2941
|
}
|
|
2856
|
-
},
|
|
2942
|
+
}, kr = class extends N {
|
|
2857
2943
|
attachedUsers;
|
|
2858
2944
|
clientSearchTerm;
|
|
2859
2945
|
client;
|
|
2860
2946
|
contragent;
|
|
2861
|
-
createdAt = new
|
|
2947
|
+
createdAt = new F();
|
|
2862
2948
|
creator;
|
|
2863
|
-
deliveryDate = new
|
|
2949
|
+
deliveryDate = new F();
|
|
2864
2950
|
deliveryAddressSearch;
|
|
2865
2951
|
clientCities;
|
|
2866
2952
|
id;
|
|
2867
2953
|
isApproved;
|
|
2868
2954
|
isNotInStock;
|
|
2869
2955
|
isOnOrder;
|
|
2870
|
-
attachedAt = new
|
|
2956
|
+
attachedAt = new F();
|
|
2871
2957
|
salesDirections;
|
|
2872
2958
|
status;
|
|
2873
2959
|
statusDetail;
|
|
@@ -2876,9 +2962,10 @@ var tr = class e {
|
|
|
2876
2962
|
warehouses;
|
|
2877
2963
|
isLargeOrder;
|
|
2878
2964
|
isToProcess;
|
|
2965
|
+
userRegions;
|
|
2879
2966
|
onlyMyRegions;
|
|
2880
2967
|
constructor(e) {
|
|
2881
|
-
super(), this.attachedUsers = e?.attachedUsers?.map((e) => "isActive" in e ? new
|
|
2968
|
+
super(), this.attachedUsers = e?.attachedUsers?.map((e) => "isActive" in e ? new p(e) : new ie(e)), this.clientSearchTerm = e?.clientSearchTerm, this.client = e?.client ? new W(e.client) : void 0, this.contragent = e?.contragent, this.createdAt = new F(e?.createdAt), this.creator = e?.creator ? new I(e.creator) : void 0, this.deliveryDate = new F(e?.deliveryDate), this.deliveryAddressSearch = e?.deliveryAddressSearch, this.clientCities = e?.clientCities?.map((e) => new n(e)), this.id = e?.id, this.isApproved = e?.isApproved, this.isNotInStock = e?.isNotInStock, this.isOnOrder = e?.isOnOrder, this.isLargeOrder = e?.isLargeOrder, this.attachedAt = new F(e?.attachedAt), this.salesDirections = e?.salesDirections?.map((e) => new g(e)), this.status = e?.status, this.statusDetail = e?.statusDetail, this.deliveryType = e?.deliveryType ? new c(e.deliveryType) : void 0, this.paymentType = e?.paymentType ? new ce(e.paymentType) : void 0, this.warehouses = e?.warehouses?.map((e) => new be(e)), this.isToProcess = e?.isToProcess, this.userRegions = e?.userRegions?.map((e) => new ye(e));
|
|
2882
2969
|
}
|
|
2883
2970
|
resetFilterValue(e) {
|
|
2884
2971
|
switch (e) {
|
|
@@ -2911,6 +2998,9 @@ var tr = class e {
|
|
|
2911
2998
|
case "warehouses":
|
|
2912
2999
|
this.warehouses = [];
|
|
2913
3000
|
break;
|
|
3001
|
+
case "userRegions":
|
|
3002
|
+
this.userRegions = [];
|
|
3003
|
+
break;
|
|
2914
3004
|
default: this[e] = void 0;
|
|
2915
3005
|
}
|
|
2916
3006
|
return this;
|
|
@@ -2919,22 +3009,22 @@ var tr = class e {
|
|
|
2919
3009
|
let e = super.asClearRaw();
|
|
2920
3010
|
return !e?.createdAt?.from && !e?.createdAt?.to && delete e.createdAt, !e?.deliveryDate?.from && !e?.deliveryDate?.to && delete e.deliveryDate, !e?.attachedAt?.from && !e?.attachedAt?.to && delete e.attachedAt, e;
|
|
2921
3011
|
}
|
|
2922
|
-
},
|
|
3012
|
+
}, Ar = class {
|
|
2923
3013
|
user;
|
|
2924
3014
|
status;
|
|
2925
3015
|
statusDetail;
|
|
2926
3016
|
createdAt;
|
|
2927
3017
|
constructor(e) {
|
|
2928
|
-
this.user = new
|
|
3018
|
+
this.user = new I(e?.user), this.status = new se(e?.status), this.statusDetail = e?.statusDetail ? new de(e.statusDetail) : void 0;
|
|
2929
3019
|
let t = e?.createdAt;
|
|
2930
|
-
this.createdAt =
|
|
3020
|
+
this.createdAt = x(t) ? O(t) : e?.createdAt ?? /* @__PURE__ */ new Date();
|
|
2931
3021
|
}
|
|
2932
|
-
},
|
|
3022
|
+
}, jr = class extends e {
|
|
2933
3023
|
getOrders(e, t, n, r) {
|
|
2934
|
-
return this.getTypedPaginated(
|
|
3024
|
+
return this.getTypedPaginated(yr, "/internal/orders", e, t, n, {}, void 0, r);
|
|
2935
3025
|
}
|
|
2936
3026
|
getOrdersCount(e, t) {
|
|
2937
|
-
return this.get("/internal/orders/count", e ? { filters: JSON.stringify((e instanceof
|
|
3027
|
+
return this.get("/internal/orders/count", e ? { filters: JSON.stringify((e instanceof u ? e : new u(e)).toPrimitive()) } : {}, void 0, void 0, t).then((e) => e.count);
|
|
2938
3028
|
}
|
|
2939
3029
|
getClientOrderStatistics(e, t) {
|
|
2940
3030
|
return this.get(`/internal/clients/${e}/orders/statistics`, t ? { period: t } : {});
|
|
@@ -2943,12 +3033,12 @@ var tr = class e {
|
|
|
2943
3033
|
return this.get(`/internal/orders/${e}`, {}, (e) => new Q(e.data));
|
|
2944
3034
|
}
|
|
2945
3035
|
createClientOrder(e, t, n, r = {}) {
|
|
2946
|
-
let i =
|
|
3036
|
+
let i = v().config.dateFormats.api;
|
|
2947
3037
|
return this.post(`/internal/clients/${e}/orders`, {
|
|
2948
3038
|
...t,
|
|
2949
|
-
deliveryDate:
|
|
3039
|
+
deliveryDate: D(t.deliveryDate, i),
|
|
2950
3040
|
items: n?.length ? n : void 0
|
|
2951
|
-
}, (e) =>
|
|
3041
|
+
}, (e) => _.instanceListInitializer(Q, e.data), r);
|
|
2952
3042
|
}
|
|
2953
3043
|
attachOrder(e) {
|
|
2954
3044
|
return this.patch(`/internal/orders/${e}/attach`, {}, (e) => new Q(e.data));
|
|
@@ -2966,10 +3056,10 @@ var tr = class e {
|
|
|
2966
3056
|
return this.get(`/internal/orders/${e}/clone`, {});
|
|
2967
3057
|
}
|
|
2968
3058
|
updateOrder(e, t, n = {}) {
|
|
2969
|
-
let r =
|
|
3059
|
+
let r = v().config.dateFormats.api;
|
|
2970
3060
|
return this.patch(`/internal/orders/${e}`, {
|
|
2971
3061
|
...t,
|
|
2972
|
-
deliveryDate: t.deliveryDate ?
|
|
3062
|
+
deliveryDate: t.deliveryDate ? D(t.deliveryDate, r) : void 0
|
|
2973
3063
|
}, (e) => new Q(e.data), n);
|
|
2974
3064
|
}
|
|
2975
3065
|
addOrderProduct(e, t, n = {}) {
|
|
@@ -2996,7 +3086,7 @@ var tr = class e {
|
|
|
2996
3086
|
return this.patch(`/internal/orders/${e}/status`, { statusDetail: t }, (e) => new Q(e.data));
|
|
2997
3087
|
}
|
|
2998
3088
|
getOrderStatusHistory(e) {
|
|
2999
|
-
return this.getTypedList(
|
|
3089
|
+
return this.getTypedList(Ar, `/internal/orders/${e}/history`);
|
|
3000
3090
|
}
|
|
3001
3091
|
getOrderPrintHtml(e, t) {
|
|
3002
3092
|
return this.get(`/internal/orders/${e}/print/view`, { ...t }, (e) => new Blob([e.data], { type: "text/html" }));
|
|
@@ -3037,51 +3127,69 @@ var tr = class e {
|
|
|
3037
3127
|
return this.get(`/internal/orders/self-delivery/${e}/nearest-dates`, {}, (e) => e.data, void 0, t);
|
|
3038
3128
|
}
|
|
3039
3129
|
getDeliveryCost(e, t, n, r) {
|
|
3040
|
-
let i =
|
|
3130
|
+
let i = v().config.dateFormats.api;
|
|
3041
3131
|
return this.get(`/internal/orders/delivery/${e}/cost`, {
|
|
3042
|
-
date:
|
|
3132
|
+
date: D(t, i),
|
|
3043
3133
|
warehouse_id: n
|
|
3044
3134
|
}, (e) => e.data, void 0, r);
|
|
3045
3135
|
}
|
|
3046
|
-
},
|
|
3136
|
+
}, Mr = Symbol("currentOrder"), Nr = class e {
|
|
3137
|
+
static async loadAllPages(e, t) {
|
|
3138
|
+
let { maxPageSize: n, maxPages: r } = Fn.resolve(t), i = /* @__PURE__ */ new Set(), a = (e, t) => [...e, ...t.filter((e) => !i.has(e.id) && (i.add(e.id), !0))], o = async (t, i) => {
|
|
3139
|
+
let s = await e({
|
|
3140
|
+
page: t,
|
|
3141
|
+
pageSize: n
|
|
3142
|
+
}), c = a(i, s.data), l = s.meta?.lastPage;
|
|
3143
|
+
return y(s.data) || t >= r || !Number.isFinite(l) || t >= (l ?? 0) ? c : o(t + 1, c);
|
|
3144
|
+
};
|
|
3145
|
+
return o(1, []);
|
|
3146
|
+
}
|
|
3147
|
+
static clampPage(e, t, n) {
|
|
3148
|
+
return xe(e, 1, Math.max(1, Math.ceil(t / n)));
|
|
3149
|
+
}
|
|
3150
|
+
static getPageItems(t, n, r) {
|
|
3151
|
+
let i = (e.clampPage(n, t.length, r) - 1) * r;
|
|
3152
|
+
return Pe(t, i, i + r);
|
|
3153
|
+
}
|
|
3154
|
+
}, Pr = class {
|
|
3047
3155
|
client;
|
|
3048
3156
|
product;
|
|
3049
3157
|
cost;
|
|
3050
3158
|
costCoefficient;
|
|
3051
3159
|
source;
|
|
3052
3160
|
constructor(e) {
|
|
3053
|
-
this.client = new
|
|
3161
|
+
this.client = new W(e?.client), this.product = new z(e?.product), this.cost = e?.cost ?? 0, this.costCoefficient = e?.costCoefficient ?? 0, this.source = e?.source ?? kt.Product;
|
|
3054
3162
|
}
|
|
3055
|
-
},
|
|
3163
|
+
}, Fr = (e) => e ? Me({
|
|
3056
3164
|
cities: e.cities?.map((e) => e.id),
|
|
3057
3165
|
clients: e.clients?.map((e) => e.id),
|
|
3058
3166
|
managers: e.managers?.map((e) => e.id),
|
|
3059
3167
|
partnerGroups: e.partnerGroups?.map((e) => e.id),
|
|
3060
3168
|
salesDirections: e.salesDirections?.map((e) => e.id),
|
|
3061
3169
|
hideNotActive: e.hideNotActive
|
|
3062
|
-
}, (e) =>
|
|
3170
|
+
}, (e) => b(e) || (Ee(e) || ke(e)) && y(e)) : {}, Ir = (e) => {
|
|
3063
3171
|
let t = {};
|
|
3064
3172
|
return e.from && (e.from.coefficient || e.from.value) && (t.from = {}, e.from.coefficient && (t.from.priceCoefficientId = e.from.coefficient.id), e.from.value && (t.from.increasePercent = e.from.value)), e.to && (e.to.coefficient || e.to.value) && (t.to = {}, e.to.coefficient && (t.to.priceCoefficientId = e.to.coefficient.id), e.to.value && (t.to.increasePercent = e.to.value)), t;
|
|
3065
|
-
},
|
|
3173
|
+
}, Lr = class extends d {
|
|
3066
3174
|
analyzeProductPrices(e, t, n) {
|
|
3067
3175
|
return this.get(`/internal/price/products/${e}/analyze`, {
|
|
3068
|
-
...
|
|
3069
|
-
filters:
|
|
3070
|
-
}, (e) =>
|
|
3176
|
+
...Ir(t),
|
|
3177
|
+
filters: Fr(n)
|
|
3178
|
+
}, (e) => _.instanceListInitializer(Pr, e.data));
|
|
3071
3179
|
}
|
|
3072
3180
|
analyzeCategoryPrices(e, t, n) {
|
|
3073
3181
|
return this.get(`/internal/price/categories/${e}/analyze`, {
|
|
3074
|
-
...
|
|
3075
|
-
filters:
|
|
3076
|
-
}, (e) =>
|
|
3182
|
+
...Ir(t),
|
|
3183
|
+
filters: Fr(n)
|
|
3184
|
+
}, (e) => _.instanceListInitializer(Pr, e.data));
|
|
3077
3185
|
}
|
|
3078
3186
|
analyzeCategoryPricesBySquare(e, t, n) {
|
|
3079
3187
|
return this.get(`/internal/price/categories/${e}/analyze/square`, {
|
|
3080
3188
|
...t,
|
|
3081
|
-
filters:
|
|
3082
|
-
}, (e) =>
|
|
3189
|
+
filters: Fr(n)
|
|
3190
|
+
}, (e) => _.instanceListInitializer(Pr, e.data));
|
|
3083
3191
|
}
|
|
3084
|
-
},
|
|
3192
|
+
}, Rr = class {
|
|
3085
3193
|
cost;
|
|
3086
3194
|
isLowCost;
|
|
3087
3195
|
isRetail;
|
|
@@ -3093,43 +3201,43 @@ var tr = class e {
|
|
|
3093
3201
|
executor;
|
|
3094
3202
|
currency;
|
|
3095
3203
|
constructor(e) {
|
|
3096
|
-
this.cost = e.cost ?? 0, this.isLowCost = e.isLowCost ?? !1, this.isRetail = e.isRetail ?? !1, this.costDate =
|
|
3204
|
+
this.cost = e.cost ?? 0, this.isLowCost = e.isLowCost ?? !1, this.isRetail = e.isRetail ?? !1, this.costDate = x(e.costDate) ? O(e.costDate) : e.costDate ?? /* @__PURE__ */ new Date(), this.discountName = e.discountName, this.priceTemplateName = e.priceTemplateName, this.product = e.product ? new R(e.product) : void 0, this.client = e.client ? new I(e.client) : void 0, this.executor = e.executor ? new I(e.executor) : void 0, this.currency = e.currency ? new o(e.currency) : void 0;
|
|
3097
3205
|
}
|
|
3098
|
-
},
|
|
3206
|
+
}, zr = class extends R {
|
|
3099
3207
|
history;
|
|
3100
3208
|
constructor(e) {
|
|
3101
|
-
super(e), this.history =
|
|
3209
|
+
super(e), this.history = S(e.history, (e) => new Rr(e));
|
|
3102
3210
|
}
|
|
3103
|
-
},
|
|
3211
|
+
}, Br = class extends d {
|
|
3104
3212
|
getProductPriceHistory(e) {
|
|
3105
|
-
let t =
|
|
3106
|
-
from: De(e.costDate?.from) ?
|
|
3107
|
-
to: De(e.costDate?.to) ?
|
|
3108
|
-
} }), (e) =>
|
|
3109
|
-
return delete n.product, this.get(`/internal/price/products/${r}/history`, n).then((e) => [new
|
|
3213
|
+
let t = v().config.dateFormats.api, n = Me(je(e, { costDate: {
|
|
3214
|
+
from: De(e.costDate?.from) ? D(e.costDate.from, t) : e.costDate?.from,
|
|
3215
|
+
to: De(e.costDate?.to) ? D(e.costDate.to, t) : e.costDate?.to
|
|
3216
|
+
} }), (e) => b(e) || (Ee(e) || ke(e)) && y(e)), r = e.product?.[0] ?? 0;
|
|
3217
|
+
return delete n.product, this.get(`/internal/price/products/${r}/history`, n).then((e) => [new zr(je(e[0], { history: e }))]);
|
|
3110
3218
|
}
|
|
3111
|
-
},
|
|
3219
|
+
}, Vr = class {
|
|
3112
3220
|
createdAt;
|
|
3113
3221
|
creator;
|
|
3114
3222
|
files;
|
|
3115
3223
|
text;
|
|
3116
3224
|
status;
|
|
3117
3225
|
constructor(e) {
|
|
3118
|
-
this.createdAt = s.parse(e?.createdAt) ?? /* @__PURE__ */ new Date(), this.creator =
|
|
3226
|
+
this.createdAt = s.parse(e?.createdAt) ?? /* @__PURE__ */ new Date(), this.creator = b(e?.creator) ? void 0 : new I(e.creator), this.files = e?.files ?? [], this.text = e?.text ?? void 0, this.status = e?.status ?? void 0;
|
|
3119
3227
|
}
|
|
3120
3228
|
isStatusChanged() {
|
|
3121
|
-
return !
|
|
3229
|
+
return !b(this.status);
|
|
3122
3230
|
}
|
|
3123
3231
|
}, $ = /* @__PURE__ */ function(e) {
|
|
3124
3232
|
return e[e.Initiated = 1] = "Initiated", e[e.InfoRequired = 2] = "InfoRequired", e[e.Pending = 3] = "Pending", e[e.Completed = 4] = "Completed", e;
|
|
3125
|
-
}({}),
|
|
3233
|
+
}({}), Hr = class extends P {
|
|
3126
3234
|
status;
|
|
3127
3235
|
closedAt;
|
|
3128
3236
|
isRead;
|
|
3129
3237
|
isDeleted;
|
|
3130
3238
|
client;
|
|
3131
3239
|
constructor(e) {
|
|
3132
|
-
super(e), this.status = e?.status ?? $.Initiated, this.closedAt = s.parse(e?.closedAt), this.isRead = e?.isRead ?? !1, this.isDeleted = e?.isDeleted ?? !1, this.client = new
|
|
3240
|
+
super(e), this.status = e?.status ?? $.Initiated, this.closedAt = s.parse(e?.closedAt), this.isRead = e?.isRead ?? !1, this.isDeleted = e?.isDeleted ?? !1, this.client = new xn(e?.client);
|
|
3133
3241
|
}
|
|
3134
3242
|
isClosed() {
|
|
3135
3243
|
return this.status === $.Completed;
|
|
@@ -3143,15 +3251,15 @@ var tr = class e {
|
|
|
3143
3251
|
getConsiderationDays(e = /* @__PURE__ */ new Date()) {
|
|
3144
3252
|
return Math.max(He(this.closedAt ?? e, this.createdAt), 0);
|
|
3145
3253
|
}
|
|
3146
|
-
},
|
|
3254
|
+
}, Ur = class extends Hr {
|
|
3147
3255
|
items;
|
|
3148
3256
|
constructor(e) {
|
|
3149
|
-
super(e), this.items =
|
|
3257
|
+
super(e), this.items = S(e?.items ?? [], (e) => new Vr(e));
|
|
3150
3258
|
}
|
|
3151
3259
|
isClientMessage(e) {
|
|
3152
3260
|
return e.creator?.id === this.client.id;
|
|
3153
3261
|
}
|
|
3154
|
-
},
|
|
3262
|
+
}, Wr = class extends N {
|
|
3155
3263
|
id;
|
|
3156
3264
|
statuses;
|
|
3157
3265
|
createdAt;
|
|
@@ -3164,7 +3272,7 @@ var tr = class e {
|
|
|
3164
3272
|
super(), this.id = {
|
|
3165
3273
|
from: e?.id?.from ?? null,
|
|
3166
3274
|
to: e?.id?.to ?? null
|
|
3167
|
-
}, this.statuses = e?.statuses, this.createdAt = new
|
|
3275
|
+
}, this.statuses = e?.statuses, this.createdAt = new F(e?.createdAt), this.closedAt = new F(e?.closedAt), this.isRead = e?.isRead, this.isDeleted = e?.isDeleted, this.clientName = e?.clientName, this.cityName = e?.cityName;
|
|
3168
3276
|
}
|
|
3169
3277
|
resetFilterValue(e) {
|
|
3170
3278
|
switch (e) {
|
|
@@ -3187,7 +3295,7 @@ var tr = class e {
|
|
|
3187
3295
|
}
|
|
3188
3296
|
return this;
|
|
3189
3297
|
}
|
|
3190
|
-
},
|
|
3298
|
+
}, Gr = class e {
|
|
3191
3299
|
static apiCodes = {
|
|
3192
3300
|
[$.Initiated]: "initiated",
|
|
3193
3301
|
[$.InfoRequired]: "info_required",
|
|
@@ -3198,23 +3306,23 @@ var tr = class e {
|
|
|
3198
3306
|
return e.apiCodes[t];
|
|
3199
3307
|
}
|
|
3200
3308
|
static toApiCodes(t) {
|
|
3201
|
-
return
|
|
3309
|
+
return S(t, (t) => e.toApiCode(t));
|
|
3202
3310
|
}
|
|
3203
|
-
},
|
|
3311
|
+
}, Kr = class extends e {
|
|
3204
3312
|
getReclamationsList(e, t, n, r, i = !1) {
|
|
3205
|
-
return this.getTypedPaginated(
|
|
3313
|
+
return this.getTypedPaginated(Hr, "/internal/reclamations", e, t, n, {}, i, r);
|
|
3206
3314
|
}
|
|
3207
3315
|
getReclamation(e, t, n = !1) {
|
|
3208
|
-
return this.get(`/internal/reclamations/${e}`, {}, (e) => new
|
|
3316
|
+
return this.get(`/internal/reclamations/${e}`, {}, (e) => new Ur(e.data), n, t);
|
|
3209
3317
|
}
|
|
3210
3318
|
createMessage(e, t, n = {}) {
|
|
3211
|
-
return this.post(`/internal/reclamations/${e}/messages`, t, (e) => new
|
|
3319
|
+
return this.post(`/internal/reclamations/${e}/messages`, t, (e) => new Ur(e.data), n);
|
|
3212
3320
|
}
|
|
3213
3321
|
deleteReclamation(e) {
|
|
3214
3322
|
return this.delete(`/internal/reclamations/${e}`);
|
|
3215
3323
|
}
|
|
3216
3324
|
restoreReclamation(e) {
|
|
3217
|
-
return this.post(`/internal/reclamations/${e}/restore`, {}, (e) => new
|
|
3325
|
+
return this.post(`/internal/reclamations/${e}/restore`, {}, (e) => new Ur(e.data));
|
|
3218
3326
|
}
|
|
3219
3327
|
downloadReclamation(e, t = !1) {
|
|
3220
3328
|
return this.getBlob(`/internal/reclamations/${e}/download`, {}, (e) => new Blob([e.request.response], { type: "application/pdf" }), t);
|
|
@@ -3222,18 +3330,18 @@ var tr = class e {
|
|
|
3222
3330
|
getUpdates(e, t = !1) {
|
|
3223
3331
|
return this.get("/internal/reclamations/updates", {}, void 0, t, e);
|
|
3224
3332
|
}
|
|
3225
|
-
},
|
|
3333
|
+
}, qr = class {
|
|
3226
3334
|
products = [];
|
|
3227
3335
|
productCategories = [];
|
|
3228
3336
|
constructor(e) {
|
|
3229
|
-
e?.products && (this.products = e.products.map((e) => new
|
|
3337
|
+
e?.products && (this.products = e.products.map((e) => new R(e))), e?.productCategories && (this.productCategories = e.productCategories.map((e) => new R(e)));
|
|
3230
3338
|
}
|
|
3231
|
-
},
|
|
3339
|
+
}, Jr = class extends d {
|
|
3232
3340
|
getProductCategoryRecommendations(e) {
|
|
3233
|
-
return this.get(`/internal/catalog/recommendations/categories/${e.id}`, {}, (e) => new
|
|
3341
|
+
return this.get(`/internal/catalog/recommendations/categories/${e.id}`, {}, (e) => new qr(e.data));
|
|
3234
3342
|
}
|
|
3235
3343
|
getProductRecommendations(e) {
|
|
3236
|
-
return this.get(`/internal/catalog/recommendations/products/${e.id}`, {}, (e) => new
|
|
3344
|
+
return this.get(`/internal/catalog/recommendations/products/${e.id}`, {}, (e) => new qr(e.data));
|
|
3237
3345
|
}
|
|
3238
3346
|
saveProductCategoryRecommendations(e, t) {
|
|
3239
3347
|
return this.post(`/internal/catalog/recommendations/categories/${e.id}`, {
|
|
@@ -3247,7 +3355,7 @@ var tr = class e {
|
|
|
3247
3355
|
products: t.products.map((e) => e.id)
|
|
3248
3356
|
});
|
|
3249
3357
|
}
|
|
3250
|
-
},
|
|
3358
|
+
}, Yr = class {
|
|
3251
3359
|
static generateUndefinedInstance(e, t = "- Не определён -") {
|
|
3252
3360
|
return new e({
|
|
3253
3361
|
id: 0,
|
|
@@ -3258,13 +3366,13 @@ var tr = class e {
|
|
|
3258
3366
|
static isUndefinedInstance(e) {
|
|
3259
3367
|
return e.id === 0 && e.slug === "-undefined-";
|
|
3260
3368
|
}
|
|
3261
|
-
},
|
|
3369
|
+
}, Xr = class {
|
|
3262
3370
|
name;
|
|
3263
3371
|
content;
|
|
3264
3372
|
constructor(e) {
|
|
3265
3373
|
this.name = e.name, this.content = e.content;
|
|
3266
3374
|
}
|
|
3267
|
-
},
|
|
3375
|
+
}, Zr = class {
|
|
3268
3376
|
resourceType;
|
|
3269
3377
|
resourceId;
|
|
3270
3378
|
h1;
|
|
@@ -3274,42 +3382,42 @@ var tr = class e {
|
|
|
3274
3382
|
meta;
|
|
3275
3383
|
tags;
|
|
3276
3384
|
constructor(e) {
|
|
3277
|
-
this.resourceType = new
|
|
3385
|
+
this.resourceType = new pe(e?.resourceType), this.resourceId = e?.resourceId ?? "", this.h1 = e?.h1, this.title = e?.title, this.description = e?.description, this.keywords = e?.keywords, this.meta = e?.meta?.map((e) => new Xr(e)) ?? [], this.tags = e?.tags;
|
|
3278
3386
|
}
|
|
3279
|
-
},
|
|
3387
|
+
}, Qr = class extends d {
|
|
3280
3388
|
getResourceSeoData(e, t) {
|
|
3281
|
-
return this.get(`/internal/seo/${e.slug}/${t}`, {}, (e) => new
|
|
3389
|
+
return this.get(`/internal/seo/${e.slug}/${t}`, {}, (e) => new Zr(e.data));
|
|
3282
3390
|
}
|
|
3283
3391
|
saveResourceSeoData(e, t = {}) {
|
|
3284
|
-
return this.post(`/internal/seo/${e.resourceType.slug}/${e.resourceId}`, e, (e) => new
|
|
3392
|
+
return this.post(`/internal/seo/${e.resourceType.slug}/${e.resourceId}`, e, (e) => new Zr(e.data), t);
|
|
3285
3393
|
}
|
|
3286
3394
|
deleteResourceSeoData(e, t) {
|
|
3287
3395
|
return this.delete(`/internal/seo/${e.slug}/${t}`);
|
|
3288
3396
|
}
|
|
3289
|
-
},
|
|
3397
|
+
}, $r = class extends f {
|
|
3290
3398
|
text;
|
|
3291
3399
|
searchCount;
|
|
3292
3400
|
lastSearchedAt;
|
|
3293
3401
|
constructor(e) {
|
|
3294
3402
|
super(e), this.text = e?.text ?? "", this.searchCount = e?.searchCount ?? 0, this.lastSearchedAt = s.parse(e?.lastSearchedAt);
|
|
3295
3403
|
}
|
|
3296
|
-
},
|
|
3404
|
+
}, ei = class extends d {
|
|
3297
3405
|
getSearchProductsStatistics(e, t) {
|
|
3298
|
-
return this.getTypedList(
|
|
3406
|
+
return this.getTypedList($r, "/internal/statistics/search/products", { date: s.periodToApiFormat(e) }, !1, t);
|
|
3299
3407
|
}
|
|
3300
3408
|
removeSearchProductStatistic(e) {
|
|
3301
3409
|
return this.delete(`/internal/statistics/search/products/${e}`);
|
|
3302
3410
|
}
|
|
3303
|
-
},
|
|
3411
|
+
}, ti = /* @__PURE__ */ function(e) {
|
|
3304
3412
|
return e[e.Undetermined = 0] = "Undetermined", e[e.Complete = 1] = "Complete", e[e.Incomplete = 2] = "Incomplete", e;
|
|
3305
|
-
}({}),
|
|
3413
|
+
}({}), ni = class e {
|
|
3306
3414
|
static isBlocked(e, t) {
|
|
3307
|
-
return t && e ===
|
|
3415
|
+
return t && e === ti.Incomplete;
|
|
3308
3416
|
}
|
|
3309
3417
|
static getValidationResult(t, n) {
|
|
3310
|
-
return e.isBlocked(t, n) ? new
|
|
3418
|
+
return e.isBlocked(t, n) ? new l("Проверьте адрес и выберите более точный вариант из подсказок", "error") : t === ti.Incomplete || t === ti.Undetermined ? new l("Проверьте правильность адреса", "warning") : void 0;
|
|
3311
3419
|
}
|
|
3312
|
-
},
|
|
3420
|
+
}, ri = class extends d {
|
|
3313
3421
|
searchAddresses(e) {
|
|
3314
3422
|
return this.execSuggestionQuery("/public/suggestions/address", e);
|
|
3315
3423
|
}
|
|
@@ -3327,26 +3435,26 @@ var tr = class e {
|
|
|
3327
3435
|
}), t;
|
|
3328
3436
|
});
|
|
3329
3437
|
}
|
|
3330
|
-
},
|
|
3438
|
+
}, ii = class extends d {
|
|
3331
3439
|
constructor() {
|
|
3332
|
-
super(), this.baseUrl = `${
|
|
3440
|
+
super(), this.baseUrl = `${v().config.http.portalApiUrl}/api`, this.interceptorIds.request.authRequestInterceptor && this.httpClient.interceptors.request.eject(this.interceptorIds.request.authRequestInterceptor);
|
|
3333
3441
|
}
|
|
3334
3442
|
getAccessToken() {
|
|
3335
3443
|
return this.get("internal/users/current-tokens").then((e) => e.accessToken);
|
|
3336
3444
|
}
|
|
3337
|
-
},
|
|
3445
|
+
}, ai = class {
|
|
3338
3446
|
user;
|
|
3339
3447
|
salesDirection;
|
|
3340
3448
|
constructor(e) {
|
|
3341
|
-
this.user = new
|
|
3449
|
+
this.user = new I(e?.user), this.salesDirection = new g(e?.salesDirection);
|
|
3342
3450
|
}
|
|
3343
|
-
},
|
|
3451
|
+
}, oi = class extends ye {
|
|
3344
3452
|
cities;
|
|
3345
3453
|
users;
|
|
3346
3454
|
constructor(e) {
|
|
3347
|
-
super(e), this.cities = e?.cities?.map((e) => new n(e)) ?? [], this.users = e?.users?.map((e) => new
|
|
3455
|
+
super(e), this.cities = e?.cities?.map((e) => new n(e)) ?? [], this.users = e?.users?.map((e) => new ai(e)) ?? [];
|
|
3348
3456
|
}
|
|
3349
|
-
},
|
|
3457
|
+
}, si = class extends N {
|
|
3350
3458
|
id;
|
|
3351
3459
|
name;
|
|
3352
3460
|
abbr;
|
|
@@ -3361,27 +3469,27 @@ var tr = class e {
|
|
|
3361
3469
|
}
|
|
3362
3470
|
return this;
|
|
3363
3471
|
}
|
|
3364
|
-
},
|
|
3472
|
+
}, ci = class extends e {
|
|
3365
3473
|
getRegionsList(e, t, n) {
|
|
3366
|
-
return this.getTypedPaginated(
|
|
3474
|
+
return this.getTypedPaginated(ye, "/internal/users/regions", e, t, n);
|
|
3367
3475
|
}
|
|
3368
3476
|
getRegion(e) {
|
|
3369
|
-
return this.get(`/internal/users/regions/${e}`, {}, (e) => new
|
|
3477
|
+
return this.get(`/internal/users/regions/${e}`, {}, (e) => new oi(e.data));
|
|
3370
3478
|
}
|
|
3371
3479
|
createRegion(e, t = {}) {
|
|
3372
|
-
return this.post("/internal/users/regions", e, (e) => new
|
|
3480
|
+
return this.post("/internal/users/regions", e, (e) => new oi(e.data), t);
|
|
3373
3481
|
}
|
|
3374
3482
|
updateRegion(e, t, n = {}) {
|
|
3375
|
-
return this.patch(`/internal/users/regions/${e}`, t, (e) => new
|
|
3483
|
+
return this.patch(`/internal/users/regions/${e}`, t, (e) => new oi(e.data), n);
|
|
3376
3484
|
}
|
|
3377
3485
|
removeRegion(e) {
|
|
3378
3486
|
return this.delete(`/internal/users/regions/${e}`);
|
|
3379
3487
|
}
|
|
3380
3488
|
getRegionEmployees(e) {
|
|
3381
|
-
return this.getTypedList(
|
|
3489
|
+
return this.getTypedList(ai, `/internal/users/regions/${e}/users`);
|
|
3382
3490
|
}
|
|
3383
3491
|
attachRegionEmployee(e, t, n) {
|
|
3384
|
-
return this.post(`/internal/users/regions/${e}/users/${t}`, { salesDirectionId: n }, (e) => new
|
|
3492
|
+
return this.post(`/internal/users/regions/${e}/users/${t}`, { salesDirectionId: n }, (e) => new ai(e.data));
|
|
3385
3493
|
}
|
|
3386
3494
|
detachRegionEmployee(e, t, n) {
|
|
3387
3495
|
return this.request({
|
|
@@ -3392,4 +3500,4 @@ var tr = class e {
|
|
|
3392
3500
|
}
|
|
3393
3501
|
};
|
|
3394
3502
|
//#endregion
|
|
3395
|
-
export {
|
|
3503
|
+
export { ti as AddressQualityEnum, ni as AddressQualityHelper, ut as AdminFullInfo, ft as AdminProvider, lt as AdminShortInfo, dt as AdminsListFilters, pn as BankAccount, _t as BlogPost, mt as BlogPostMediaFile, pt as BlogPostMediaTypeEnum, ht as BlogPostPublicationStatusEnum, gt as BlogPostShortInfo, vt as BlogPostsListFilters, yt as BlogProvider, Nt as CalculationTypeEnum, X as CalendarHelper, H as Cart, Mt as CartProvider, Qt as CatalogProvider, Tt as CatalogableItem, U as Category, Zt as CategoryFilter, Yt as CategoryFilterSetting, Xt as CategoryFilterValue, qt as CategoryPricingRule, Cn as Client, En as ClientAdditionalData, xn as ClientBaseInfo, It as ClientCategory, kn as ClientDataProvider, Wt as ClientPriceCatalogableItem, Kt as ClientPriceCategory, Gt as ClientPriceProduct, $t as ClientPriceProvider, en as ClientPriceTemplateProvider, B as ClientProduct, rn as ClientProductCategoryDataProvider, an as ClientProductDataProvider, W as ClientShortInfo, fn as ClientsAdditionalDataRequestTypeEnum, wn as ClientsListFilters, R as CodedIdentity, Nn as ConfiguratorProvider, Mn as ConfiguratorsEnum, mn as Contact, Y as ContactPerson, On as ContactPersonRelated, Dn as ContactRelation, hn as ContragentBase, bn as ContragentFactory, _n as ContragentIc, gn as ContragentPerson, yn as ContragentUlNr, vn as ContragentUlR, kt as CostSourceEnum, P as CreatableIdentity, Bt as Curator, ri as DataSuggestionProvider, Hn as DateTimeProvider, Vt as DeletableIdentity, bt as DeletableNamedIdentity, Sn as DeliveryAddress, Yn as Discount, Gn as DiscountClient, Xn as DiscountClientEligibility, Kn as DiscountConditions, Qn as DiscountProvider, xt as DiscountShortInfo, qn as DiscountStateEnum, Jn as DiscountStateHelper, Zn as DiscountsListFilters, tr as DocumentContentTypeEnum, er as DocumentItem, nr as DocumentProvider, $n as DocumentTypeEnum, rr as ExternalSeoFullInfo, ir as ExternalSeoListFilters, ar as ExternalSeoProvider, sr as Faq, or as FaqGroup, cr as FaqProvider, Jt as FilterSettings, Et as HiddenCatalogableItem, Dt as Image, dr as ManagerDataFactory, pr as ManagerProvider, fr as ManagersListFilters, Xr as MetaTagItem, Z as Offer, hr as OfferActualization, mr as OfferActualizationStatus, Sr as OfferHelper, gr as OfferShortInfo, xr as OffersDataProvider, vr as OffersListFilters, wr as OperatorFullInfo, Er as OperatorProvider, Cr as OperatorShortInfo, Tr as OperatorsListFilters, Q as Order, Dr as OrderAction, Or as OrderEditorData, yr as OrderInfo, br as OrderItem, At as OrderItemBase, Tn as OrderShortInfo, Ar as OrderStatusHistoryInfo, jr as OrdersDataProvider, kr as OrdersListFilters, Pn as PAGINATION_DEFAULT_SETTINGS, N as PaginationFiltersBase, Nr as PaginationHelper, Fn as PaginationSettingsHelper, Pr as PriceAnalyze, Lr as PriceAnalyzeProvider, Lt as PriceCatalogableItem, Br as PriceHistoryDataProvider, Rr as PriceHistoryItem, L as PriceTemplate, zt as PriceTemplateCategory, G as PriceTemplateClient, Rt as PriceTemplateICatalogableItem, Ht as PriceTemplateProduct, on as PriceTemplateProvider, J as PricingRole, sn as PricingRoleProvider, Ot as PrimaryCatalogableItem, z as Product, tn as ProductCategoryDataProvider, nn as ProductDataProvider, Pt as ProductFilterTypeEnum, St as ProductPriceCoefficient, zr as ProductPriceHistory, wt as ProductUnit, _r as ProfstroyOfferItem, cn as PropertiesProvider, K as Property, q as PropertyValue, Ur as Reclamation, Vr as ReclamationItem, Kr as ReclamationProvider, Hr as ReclamationShortInfo, $ as ReclamationStatusEnum, Gr as ReclamationStatusHelper, Wr as ReclamationsListFilters, Jr as RecommendationsDataProvider, qr as RecommendationsList, Yr as ReferenceDataFactory, Un as STANDARD_PERIOD_GROUPS, Wn as STANDARD_PERIOD_SECTIONS, $r as SearchProductStatistic, Zr as Seo, Qr as SeoDataProvider, ei as StatisticsProvider, Ct as StockCount, Ln as TableDataPagination, In as TableDataPaginationRequestParams, Rn as TableDataSortRequestParams, ln as TemplateProductCategoryDataProvider, Ut as TemplatesListFilters, ur as UnitsHelper, An as UnknownClientDataProvider, ii as UserAuthDataProvider, oi as UserRegion, ai as UserRegionEmployee, ci as UserRegionProvider, si as UserRegionsListFilters, I as UserShortInfo, jn as VersionConfig, Mr as currentOrderInjectionKey, zn as daysAgoIso, un as findCatalogItemByIdRecursive, dn as flattenCatalogItems, lr as formatPercentChange, Vn as formatRelativeDate, Bn as pluralize };
|