sk-front-lib 0.17.48 → 0.17.49

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.
Files changed (255) hide show
  1. package/api/model/api-config.d.ts +6 -0
  2. package/api/model/api-pageable-param.d.ts +11 -0
  3. package/api/model/api-pageable.d.ts +11 -0
  4. package/api/model/api-response.d.ts +8 -0
  5. package/api/model/index.d.ts +4 -0
  6. package/api/package.json +10 -0
  7. package/api/public_api.d.ts +3 -0
  8. package/api/sk-api.module.d.ts +12 -0
  9. package/api/sk-api.service.d.ts +34 -0
  10. package/api/sk-front-lib-api.d.ts +5 -0
  11. package/article/package.json +10 -0
  12. package/article/public_api.d.ts +6 -0
  13. package/article/sk-article-editor-server.component.d.ts +23 -0
  14. package/article/sk-article-editor.component.d.ts +27 -0
  15. package/article/sk-article-server.module.d.ts +10 -0
  16. package/article/sk-article.module.d.ts +9 -0
  17. package/article/sk-article.service.d.ts +96 -0
  18. package/article/sk-froala-editor.directive.d.ts +40 -0
  19. package/article/sk-front-lib-article.d.ts +5 -0
  20. package/crud/package.json +10 -0
  21. package/crud/public_api.d.ts +24 -0
  22. package/crud/sk-account.service.d.ts +16 -0
  23. package/crud/sk-affiliate.service.d.ts +38 -0
  24. package/crud/sk-auth-admin.guard.d.ts +13 -0
  25. package/crud/sk-auth.guard.d.ts +13 -0
  26. package/crud/sk-auth.service.d.ts +33 -0
  27. package/crud/sk-board.service.d.ts +21 -0
  28. package/crud/sk-brand.service.d.ts +19 -0
  29. package/crud/sk-cart.service.d.ts +72 -0
  30. package/crud/sk-category.service.d.ts +28 -0
  31. package/crud/sk-comment.service.d.ts +15 -0
  32. package/crud/sk-config.service.d.ts +13 -0
  33. package/crud/sk-contact.service.d.ts +15 -0
  34. package/crud/sk-coupon.service.d.ts +24 -0
  35. package/crud/sk-document.service.d.ts +51 -0
  36. package/crud/sk-etc.service.d.ts +12 -0
  37. package/crud/sk-file.service.d.ts +18 -0
  38. package/crud/sk-front-lib-crud.d.ts +5 -0
  39. package/crud/sk-keyword.service.d.ts +19 -0
  40. package/crud/sk-order.service.d.ts +45 -0
  41. package/crud/sk-point.service.d.ts +17 -0
  42. package/crud/sk-product.service.d.ts +84 -0
  43. package/crud/sk-promotion.service.d.ts +41 -0
  44. package/crud/sk-search.service.d.ts +12 -0
  45. package/crud/sk-store.service.d.ts +17 -0
  46. package/crud/sk-user.service.d.ts +25 -0
  47. package/esm2020/api/model/api-config.mjs +2 -0
  48. package/esm2020/api/model/api-pageable-param.mjs +29 -0
  49. package/esm2020/api/model/api-pageable.mjs +3 -0
  50. package/esm2020/api/model/api-response.mjs +3 -0
  51. package/esm2020/api/model/index.mjs +4 -0
  52. package/esm2020/api/public_api.mjs +4 -0
  53. package/esm2020/api/sk-api.module.mjs +35 -0
  54. package/esm2020/api/sk-api.service.mjs +145 -0
  55. package/esm2020/api/sk-front-lib-api.mjs +5 -0
  56. package/esm2020/article/public_api.mjs +7 -0
  57. package/esm2020/article/sk-article-editor-server.component.mjs +51 -0
  58. package/esm2020/article/sk-article-editor.component.mjs +93 -0
  59. package/esm2020/article/sk-article-server.module.mjs +33 -0
  60. package/esm2020/article/sk-article.module.mjs +32 -0
  61. package/esm2020/article/sk-article.service.mjs +248 -0
  62. package/esm2020/article/sk-froala-editor.directive.mjs +325 -0
  63. package/esm2020/article/sk-front-lib-article.mjs +5 -0
  64. package/esm2020/crud/public_api.mjs +25 -0
  65. package/esm2020/crud/sk-account.service.mjs +36 -0
  66. package/esm2020/crud/sk-affiliate.service.mjs +94 -0
  67. package/esm2020/crud/sk-auth-admin.guard.mjs +31 -0
  68. package/esm2020/crud/sk-auth.guard.mjs +31 -0
  69. package/esm2020/crud/sk-auth.service.mjs +67 -0
  70. package/esm2020/crud/sk-board.service.mjs +54 -0
  71. package/esm2020/crud/sk-brand.service.mjs +46 -0
  72. package/esm2020/crud/sk-cart.service.mjs +256 -0
  73. package/esm2020/crud/sk-category.service.mjs +63 -0
  74. package/esm2020/crud/sk-comment.service.mjs +43 -0
  75. package/esm2020/crud/sk-config.service.mjs +31 -0
  76. package/esm2020/crud/sk-contact.service.mjs +39 -0
  77. package/esm2020/crud/sk-coupon.service.mjs +62 -0
  78. package/esm2020/crud/sk-document.service.mjs +110 -0
  79. package/esm2020/crud/sk-etc.service.mjs +25 -0
  80. package/esm2020/crud/sk-file.service.mjs +37 -0
  81. package/esm2020/crud/sk-front-lib-crud.mjs +5 -0
  82. package/esm2020/crud/sk-keyword.service.mjs +46 -0
  83. package/esm2020/crud/sk-order.service.mjs +133 -0
  84. package/esm2020/crud/sk-point.service.mjs +45 -0
  85. package/esm2020/crud/sk-product.service.mjs +168 -0
  86. package/esm2020/crud/sk-promotion.service.mjs +84 -0
  87. package/esm2020/crud/sk-search.service.mjs +25 -0
  88. package/esm2020/crud/sk-store.service.mjs +47 -0
  89. package/esm2020/crud/sk-user.service.mjs +73 -0
  90. package/esm2020/google-analytics/google-analytics-router.module.mjs +30 -0
  91. package/esm2020/google-analytics/google-analytics.module.mjs +40 -0
  92. package/esm2020/google-analytics/initializers/google-analytics-router.initializer.mjs +24 -0
  93. package/esm2020/google-analytics/initializers/google-analytics.initializer.mjs +46 -0
  94. package/esm2020/google-analytics/interfaces/google-analytics-command.mjs +2 -0
  95. package/esm2020/google-analytics/interfaces/google-analytics-settings.mjs +2 -0
  96. package/esm2020/google-analytics/public_api.mjs +11 -0
  97. package/esm2020/google-analytics/services/google-analytics.service.mjs +223 -0
  98. package/esm2020/google-analytics/sk-front-lib-google-analytics.mjs +5 -0
  99. package/esm2020/google-analytics/tokens/google-analytics-settings-token.mjs +5 -0
  100. package/esm2020/google-analytics/types/ga-action.type.mjs +2 -0
  101. package/esm2020/google-analytics/types/ga-bind.type.mjs +2 -0
  102. package/esm2020/image/public_api.mjs +3 -0
  103. package/esm2020/image/sk-front-lib-image.mjs +5 -0
  104. package/esm2020/image/sk-image.component.mjs +262 -0
  105. package/esm2020/image/sk-image.module.mjs +43 -0
  106. package/esm2020/lib/sk-byte.pipe.mjs +4 -4
  107. package/esm2020/lib/sk-date-time.pipe.mjs +4 -4
  108. package/esm2020/lib/sk-date.pipe.mjs +4 -4
  109. package/esm2020/lib/sk-front-lib.module.mjs +5 -5
  110. package/esm2020/lib/sk-keys.pipe.mjs +4 -4
  111. package/esm2020/lib/sk-time.pipe.mjs +4 -4
  112. package/esm2020/model/lib/article.mjs +11 -0
  113. package/esm2020/model/lib/audit.mjs +12 -0
  114. package/esm2020/model/lib/auth.mjs +2 -0
  115. package/esm2020/model/lib/board.mjs +21 -0
  116. package/esm2020/model/lib/cart.mjs +29 -0
  117. package/esm2020/model/lib/comment.mjs +25 -0
  118. package/esm2020/model/lib/contact.mjs +28 -0
  119. package/esm2020/model/lib/coupon.mjs +23 -0
  120. package/esm2020/model/lib/document.mjs +49 -0
  121. package/esm2020/model/lib/etc.mjs +57 -0
  122. package/esm2020/model/lib/file.mjs +8 -0
  123. package/esm2020/model/lib/filetype.mjs +179 -0
  124. package/esm2020/model/lib/grid.mjs +83 -0
  125. package/esm2020/model/lib/nicepay.mjs +81 -0
  126. package/esm2020/model/lib/order.mjs +106 -0
  127. package/esm2020/model/lib/payment.mjs +35 -0
  128. package/esm2020/model/lib/point.mjs +47 -0
  129. package/esm2020/model/lib/product-series.mjs +2 -0
  130. package/esm2020/model/lib/product.mjs +156 -0
  131. package/esm2020/model/lib/promotion.mjs +80 -0
  132. package/esm2020/model/lib/shipping.mjs +37 -0
  133. package/esm2020/model/lib/tosspay.mjs +61 -0
  134. package/esm2020/model/lib/user.mjs +61 -0
  135. package/esm2020/model/public_api.mjs +24 -0
  136. package/esm2020/model/sk-front-lib-model.mjs +5 -0
  137. package/esm2020/search-address/dialog/dialog.component.mjs +27 -0
  138. package/esm2020/search-address/public_api.mjs +4 -0
  139. package/esm2020/search-address/sk-front-lib-search-address.mjs +5 -0
  140. package/esm2020/search-address/sk-search-address.directive.mjs +41 -0
  141. package/esm2020/search-address/sk-search-address.model.mjs +8 -0
  142. package/esm2020/search-address/sk-search-address.module.mjs +52 -0
  143. package/esm2020/search-address/sk-search-address.service.mjs +65 -0
  144. package/esm2020/uploader/public_api.mjs +4 -0
  145. package/esm2020/uploader/sk-front-lib-uploader.mjs +5 -0
  146. package/esm2020/uploader/sk-uploader-file-item.model.mjs +95 -0
  147. package/esm2020/uploader/sk-uploader.animation.mjs +47 -0
  148. package/esm2020/uploader/sk-uploader.class.mjs +188 -0
  149. package/esm2020/uploader/sk-uploader.component.mjs +120 -0
  150. package/esm2020/uploader/sk-uploader.directive.mjs +44 -0
  151. package/esm2020/uploader/sk-uploader.module.mjs +62 -0
  152. package/fesm2015/sk-front-lib-api.mjs +218 -0
  153. package/fesm2015/sk-front-lib-api.mjs.map +1 -0
  154. package/fesm2015/sk-front-lib-article.mjs +762 -0
  155. package/fesm2015/sk-front-lib-article.mjs.map +1 -0
  156. package/fesm2015/sk-front-lib-crud.mjs +1529 -0
  157. package/fesm2015/sk-front-lib-crud.mjs.map +1 -0
  158. package/fesm2015/sk-front-lib-google-analytics.mjs +361 -0
  159. package/fesm2015/sk-front-lib-google-analytics.mjs.map +1 -0
  160. package/fesm2015/sk-front-lib-image.mjs +306 -0
  161. package/fesm2015/sk-front-lib-image.mjs.map +1 -0
  162. package/fesm2015/sk-front-lib-model.mjs +1171 -0
  163. package/fesm2015/sk-front-lib-model.mjs.map +1 -0
  164. package/fesm2015/sk-front-lib-search-address.mjs +188 -0
  165. package/fesm2015/sk-front-lib-search-address.mjs.map +1 -0
  166. package/fesm2015/sk-front-lib-uploader.mjs +551 -0
  167. package/fesm2015/sk-front-lib-uploader.mjs.map +1 -0
  168. package/fesm2015/sk-front-lib.mjs +19 -19
  169. package/fesm2015/sk-front-lib.mjs.map +1 -1
  170. package/fesm2020/sk-front-lib-api.mjs +216 -0
  171. package/fesm2020/sk-front-lib-api.mjs.map +1 -0
  172. package/fesm2020/sk-front-lib-article.mjs +771 -0
  173. package/fesm2020/sk-front-lib-article.mjs.map +1 -0
  174. package/fesm2020/sk-front-lib-crud.mjs +1525 -0
  175. package/fesm2020/sk-front-lib-crud.mjs.map +1 -0
  176. package/fesm2020/sk-front-lib-google-analytics.mjs +358 -0
  177. package/fesm2020/sk-front-lib-google-analytics.mjs.map +1 -0
  178. package/fesm2020/sk-front-lib-image.mjs +309 -0
  179. package/fesm2020/sk-front-lib-image.mjs.map +1 -0
  180. package/fesm2020/sk-front-lib-model.mjs +1171 -0
  181. package/fesm2020/sk-front-lib-model.mjs.map +1 -0
  182. package/fesm2020/sk-front-lib-search-address.mjs +186 -0
  183. package/fesm2020/sk-front-lib-search-address.mjs.map +1 -0
  184. package/fesm2020/sk-front-lib-uploader.mjs +549 -0
  185. package/fesm2020/sk-front-lib-uploader.mjs.map +1 -0
  186. package/fesm2020/sk-front-lib.mjs +19 -19
  187. package/fesm2020/sk-front-lib.mjs.map +1 -1
  188. package/google-analytics/google-analytics-router.module.d.ts +8 -0
  189. package/google-analytics/google-analytics.module.d.ts +10 -0
  190. package/google-analytics/initializers/google-analytics-router.initializer.d.ts +5 -0
  191. package/google-analytics/initializers/google-analytics.initializer.d.ts +4 -0
  192. package/google-analytics/interfaces/google-analytics-command.d.ts +4 -0
  193. package/google-analytics/interfaces/google-analytics-settings.d.ts +6 -0
  194. package/google-analytics/package.json +10 -0
  195. package/google-analytics/public_api.d.ts +10 -0
  196. package/google-analytics/services/google-analytics.service.d.ts +85 -0
  197. package/google-analytics/sk-front-lib-google-analytics.d.ts +5 -0
  198. package/google-analytics/tokens/google-analytics-settings-token.d.ts +3 -0
  199. package/google-analytics/types/ga-action.type.d.ts +1 -0
  200. package/google-analytics/types/ga-bind.type.d.ts +1 -0
  201. package/image/package.json +10 -0
  202. package/image/public_api.d.ts +3 -0
  203. package/image/sk-front-lib-image.d.ts +5 -0
  204. package/image/sk-image.component.d.ts +112 -0
  205. package/image/sk-image.module.d.ts +12 -0
  206. package/lib/sk-byte.pipe.d.ts +1 -1
  207. package/lib/sk-date-time.pipe.d.ts +1 -1
  208. package/lib/sk-date.pipe.d.ts +1 -1
  209. package/lib/sk-keys.pipe.d.ts +1 -1
  210. package/lib/sk-time.pipe.d.ts +1 -1
  211. package/model/lib/article.d.ts +13 -0
  212. package/model/lib/audit.d.ts +13 -0
  213. package/model/lib/auth.d.ts +8 -0
  214. package/model/lib/board.d.ts +39 -0
  215. package/model/lib/cart.d.ts +45 -0
  216. package/model/lib/comment.d.ts +43 -0
  217. package/model/lib/contact.d.ts +40 -0
  218. package/model/lib/coupon.d.ts +116 -0
  219. package/model/lib/document.d.ts +104 -0
  220. package/model/lib/etc.d.ts +220 -0
  221. package/model/lib/file.d.ts +24 -0
  222. package/model/lib/filetype.d.ts +10 -0
  223. package/model/lib/grid.d.ts +97 -0
  224. package/model/lib/nicepay.d.ts +39 -0
  225. package/model/lib/order.d.ts +163 -0
  226. package/model/lib/payment.d.ts +32 -0
  227. package/model/lib/point.d.ts +30 -0
  228. package/model/lib/product-series.d.ts +25 -0
  229. package/model/lib/product.d.ts +309 -0
  230. package/model/lib/promotion.d.ts +169 -0
  231. package/model/lib/shipping.d.ts +44 -0
  232. package/model/lib/tosspay.d.ts +29 -0
  233. package/model/lib/user.d.ts +54 -0
  234. package/model/package.json +10 -0
  235. package/model/public_api.d.ts +23 -0
  236. package/model/sk-front-lib-model.d.ts +5 -0
  237. package/package.json +67 -3
  238. package/search-address/dialog/dialog.component.d.ts +13 -0
  239. package/search-address/package.json +10 -0
  240. package/search-address/public_api.d.ts +3 -0
  241. package/search-address/sk-front-lib-search-address.d.ts +5 -0
  242. package/search-address/sk-search-address.directive.d.ts +15 -0
  243. package/search-address/sk-search-address.model.d.ts +40 -0
  244. package/search-address/sk-search-address.module.d.ts +14 -0
  245. package/search-address/sk-search-address.service.d.ts +13 -0
  246. package/uploader/package.json +10 -0
  247. package/uploader/public_api.d.ts +4 -0
  248. package/uploader/sk-front-lib-uploader.d.ts +5 -0
  249. package/uploader/sk-uploader-file-item.model.d.ts +29 -0
  250. package/uploader/sk-uploader.animation.d.ts +1 -0
  251. package/uploader/sk-uploader.class.d.ts +47 -0
  252. package/uploader/sk-uploader.component.d.ts +28 -0
  253. package/uploader/sk-uploader.directive.d.ts +15 -0
  254. package/uploader/sk-uploader.module.d.ts +16 -0
  255. /package/{index.d.ts → sk-front-lib.d.ts} +0 -0
@@ -0,0 +1,1525 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, PLATFORM_ID, Inject } from '@angular/core';
3
+ import { map, tap, catchError, switchMap, take } from 'rxjs/operators';
4
+ import * as i1 from 'sk-front-lib/api';
5
+ import { ApiPageableParam } from 'sk-front-lib/api';
6
+ import { SkFile, SkUser, SkDocument, SkBoard, SkProduct, SkPromotion, SkCart, SkOrderDetail, SkPoint, SkDocumentCommentParent, SkStore } from 'sk-front-lib/model';
7
+ import { BehaviorSubject, of } from 'rxjs';
8
+ import * as i2 from '@angular/router';
9
+ import { HttpParams } from '@angular/common/http';
10
+ import { SkUtils } from 'sk-front-lib';
11
+ import { isPlatformBrowser } from '@angular/common';
12
+
13
+ class SkAffiliateService {
14
+ constructor(_apiService) {
15
+ this._apiService = _apiService;
16
+ }
17
+ registerAffiliate(data) {
18
+ return this._apiService.post(`/api/public/affiliate`, data).pipe(map(response => response.data));
19
+ }
20
+ getMyAffiliateData() {
21
+ return this._apiService.get(`/api/public/affiliate/me`).pipe(map(response => response.data));
22
+ }
23
+ getMyAffiliateStats() {
24
+ return this._apiService.get(`/api/public/affiliate/me/stats`).pipe(map(response => response.data));
25
+ }
26
+ getAdminAffiliateStats(id) {
27
+ return this._apiService.get(`/api/admin/affiliate/user-id/${id}/stats`).pipe(map(response => response.data));
28
+ }
29
+ productViewEvent(productId, affiliateKey) {
30
+ return this._apiService.get(`/api/public/affiliate/event/product-view?id=${productId}&affiliate=${affiliateKey}`).pipe(map(response => response.data));
31
+ }
32
+ getAdminList(params = new ApiPageableParam()) {
33
+ return this._apiService.getPageable(`/api/admin/affiliate`, params.buildHttpParams()).pipe(map(response => response.data));
34
+ }
35
+ getAdminAffiliate(id) {
36
+ return this._apiService.get(`/api/admin/affiliate/${id}`).pipe(map(response => response.data));
37
+ }
38
+ getAdminAffiliateByUserId(userId) {
39
+ return this._apiService.get(`/api/admin/affiliate/user-id/${userId}`).pipe(map(response => response.data));
40
+ }
41
+ updateAdminStatus(id, data) {
42
+ return this._apiService.put(`/api/admin/affiliate/${id}/update-status`, data).pipe(map(response => response.data));
43
+ }
44
+ activateAdminAffiliates(affiliates) {
45
+ return this._apiService.put(`/api/admin/affiliate/activate/${affiliates.map(i => i.id).join(',')}`, null);
46
+ }
47
+ deactivateAdminAffiliates(affiliates) {
48
+ return this._apiService.put(`/api/admin/affiliate/deactivate/${affiliates.map(i => i.id).join(',')}`, null);
49
+ }
50
+ deleteAffiliates(affiliates) {
51
+ return this._apiService.delete(`/api/admin/affiliate/delete/${affiliates.map(i => i.id).join(',')}`);
52
+ }
53
+ getAdminAffiliateTargets(params = new ApiPageableParam()) {
54
+ return this._apiService.getPageable(`/api/admin/affiliate/targets`, params.buildHttpParams()).pipe(map(response => response.data));
55
+ }
56
+ getAdminAffiliateTarget(id) {
57
+ return this._apiService.get(`/api/admin/affiliate/targets/${id}`).pipe(map(response => response.data));
58
+ }
59
+ createAdminAffiliateTarget(data) {
60
+ return this._apiService.post(`/api/admin/affiliate/targets`, {
61
+ type: data.type,
62
+ apply: data.apply,
63
+ orderIndex: data.orderIndex,
64
+ startDate: data.startDate,
65
+ endDate: data.endDate,
66
+ brand: data.brand?.id,
67
+ category: data.category?.id,
68
+ products: (data.products || []).map(i => i.id),
69
+ rebateAmount: data.rebateAmount,
70
+ rebateType: data.rebateType,
71
+ activated: data.activated
72
+ }).pipe(map(response => response.data));
73
+ }
74
+ updateAdminAffiliateTarget(id, data) {
75
+ return this._apiService.put(`/api/admin/affiliate/targets/${id}`, {
76
+ type: data.type,
77
+ apply: data.apply,
78
+ orderIndex: data.orderIndex,
79
+ startDate: data.startDate,
80
+ endDate: data.endDate,
81
+ brand: data.brand?.id,
82
+ category: data.category?.id,
83
+ products: (data.products || []).map(i => i.id),
84
+ rebateAmount: data.rebateAmount,
85
+ rebateType: data.rebateType,
86
+ activated: data.activated
87
+ }).pipe(map(response => response.data));
88
+ }
89
+ deleteAdminAffiliateTargets(target = []) {
90
+ return this._apiService.delete(`/api/admin/affiliate/targets/${target.map(i => i.id).join(',')}`);
91
+ }
92
+ }
93
+ SkAffiliateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkAffiliateService, deps: [{ token: i1.SkApiService }], target: i0.ɵɵFactoryTarget.Injectable });
94
+ SkAffiliateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkAffiliateService, providedIn: 'root' });
95
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkAffiliateService, decorators: [{
96
+ type: Injectable,
97
+ args: [{
98
+ providedIn: 'root'
99
+ }]
100
+ }], ctorParameters: function () { return [{ type: i1.SkApiService }]; } });
101
+
102
+ class SkFileService {
103
+ constructor(_apiService) {
104
+ this._apiService = _apiService;
105
+ this.apiServer = _apiService.apiServer;
106
+ }
107
+ getFile(id) {
108
+ return this._apiService.get(`/api/admin/files/${id}`)
109
+ .pipe(map(result => new SkFile(result.data)));
110
+ }
111
+ getAdminFiles(params = new ApiPageableParam()) {
112
+ return this._apiService.getPageable(`/api/admin/files`, params.buildHttpParams()).pipe(map(response => {
113
+ response.data.content = (response.data.content || []).map(item => new SkFile(item));
114
+ return response.data;
115
+ }));
116
+ }
117
+ deleteAdminFile(id) {
118
+ return this._apiService.delete(`/api/admin/files/${id}`);
119
+ }
120
+ updateAdminFile(id, data) {
121
+ return this._apiService.put(`/api/admin/files/${id}`, data).pipe(map(result => new SkFile(result.data)));
122
+ }
123
+ }
124
+ SkFileService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkFileService, deps: [{ token: i1.SkApiService }], target: i0.ɵɵFactoryTarget.Injectable });
125
+ SkFileService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkFileService, providedIn: 'root' });
126
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkFileService, decorators: [{
127
+ type: Injectable,
128
+ args: [{
129
+ providedIn: 'root'
130
+ }]
131
+ }], ctorParameters: function () { return [{ type: i1.SkApiService }]; } });
132
+
133
+ class SkAuthService {
134
+ constructor(_router, apiService) {
135
+ this._router = _router;
136
+ this.apiService = apiService;
137
+ this.baseUrl = '/api/auth';
138
+ this._userinfo$ = new BehaviorSubject(new SkUser());
139
+ }
140
+ get userinfo$() {
141
+ return this._userinfo$.asObservable();
142
+ }
143
+ moveLoginPage() {
144
+ return this._router.navigate([this.apiService.loginUrl, { returnUrl: this._router.url }]);
145
+ }
146
+ login(data) {
147
+ return this.apiService.post(this.baseUrl + '/signin', data).pipe(tap(response => {
148
+ if (response.status === 200) {
149
+ this.apiService.setToken(response.data.token);
150
+ }
151
+ }), map(response => response.data));
152
+ }
153
+ logout() {
154
+ this._userinfo$.next(new SkUser());
155
+ this.apiService.clearToken();
156
+ }
157
+ loadMyInfo(refresh = false) {
158
+ if (this.apiService.getToken()) {
159
+ if (this._userinfo$.getValue().isAnonymous() || refresh) {
160
+ return this.apiService.get(this.baseUrl + '/me').pipe(map(result => !!result.data ? new SkUser(result.data) : new SkUser()), catchError(err => of(new SkUser())), tap(user => this._userinfo$.next(user)), switchMap(() => of(this._userinfo$.getValue())));
161
+ }
162
+ }
163
+ return of(this._userinfo$.getValue());
164
+ }
165
+ checkAdminAccessable() {
166
+ return this.loadMyInfo().pipe(map(result => result.isAdminAccessable()));
167
+ }
168
+ checkLogin() {
169
+ return this.loadMyInfo().pipe(map(result => !result.isAnonymous()));
170
+ }
171
+ sendMailForActivateAccount(email) {
172
+ return this.apiService.post(this.baseUrl + '/activate-account', { email }).pipe(map(response => response.data));
173
+ }
174
+ sendMailForResetPassword(email) {
175
+ return this.apiService.post(this.baseUrl + '/reset-password', { email }).pipe(map(response => response.data));
176
+ }
177
+ requestActivateAccount(data) {
178
+ return this.apiService.post(this.baseUrl + '/activate-account-complete', data).pipe(map(response => response.data));
179
+ }
180
+ updatePassword(data) {
181
+ return this.apiService.post(this.baseUrl + '/update-password', data).pipe(map(response => response.data));
182
+ }
183
+ }
184
+ SkAuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkAuthService, deps: [{ token: i2.Router }, { token: i1.SkApiService }], target: i0.ɵɵFactoryTarget.Injectable });
185
+ SkAuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkAuthService, providedIn: 'root' });
186
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkAuthService, decorators: [{
187
+ type: Injectable,
188
+ args: [{
189
+ providedIn: 'root'
190
+ }]
191
+ }], ctorParameters: function () { return [{ type: i2.Router }, { type: i1.SkApiService }]; } });
192
+
193
+ class SkAuthGuard {
194
+ constructor(authService, router) {
195
+ this.authService = authService;
196
+ this.router = router;
197
+ }
198
+ canActivate(route, state) {
199
+ return this.authService.checkLogin()
200
+ .pipe(tap(logged => {
201
+ if (!logged) {
202
+ this.router.navigate(['/login', { returnUrl: state.url }]);
203
+ }
204
+ }));
205
+ }
206
+ canActivateChild(route, state) {
207
+ return this.canActivate(route, state);
208
+ }
209
+ }
210
+ SkAuthGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkAuthGuard, deps: [{ token: SkAuthService }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Injectable });
211
+ SkAuthGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkAuthGuard, providedIn: 'root' });
212
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkAuthGuard, decorators: [{
213
+ type: Injectable,
214
+ args: [{
215
+ providedIn: 'root'
216
+ }]
217
+ }], ctorParameters: function () { return [{ type: SkAuthService }, { type: i2.Router }]; } });
218
+
219
+ class SkAuthAdminGuard {
220
+ constructor(authService, router) {
221
+ this.authService = authService;
222
+ this.router = router;
223
+ }
224
+ canActivate(route, state) {
225
+ return this.authService.checkAdminAccessable()
226
+ .pipe(tap(logged => {
227
+ if (!logged) {
228
+ this.router.navigate(['/login', { returnUrl: state.url }]);
229
+ }
230
+ }));
231
+ }
232
+ canActivateChild(route, state) {
233
+ return this.canActivate(route, state);
234
+ }
235
+ }
236
+ SkAuthAdminGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkAuthAdminGuard, deps: [{ token: SkAuthService }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Injectable });
237
+ SkAuthAdminGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkAuthAdminGuard, providedIn: 'root' });
238
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkAuthAdminGuard, decorators: [{
239
+ type: Injectable,
240
+ args: [{
241
+ providedIn: 'root'
242
+ }]
243
+ }], ctorParameters: function () { return [{ type: SkAuthService }, { type: i2.Router }]; } });
244
+
245
+ class SkUserService {
246
+ constructor(_apiService) {
247
+ this._apiService = _apiService;
248
+ }
249
+ getUser(id) {
250
+ return this._apiService.get(`/api/public/users/${id}`).pipe(map(response => new SkUser(response.data)));
251
+ }
252
+ getAdminUser(id) {
253
+ return this._apiService.get(`/api/admin/users/${id}`).pipe(map(response => new SkUser(response.data)));
254
+ }
255
+ getAdminUserByEmail(email) {
256
+ return this._apiService.get(`/api/admin/users/email/${email}`).pipe(map(response => new SkUser(response.data)));
257
+ }
258
+ getUsers(params = new ApiPageableParam()) {
259
+ return this._apiService.getPageable(`/api/public/users`, params.buildHttpParams()).pipe(map(response => response.data));
260
+ }
261
+ getAdminUsers(params = new ApiPageableParam()) {
262
+ return this._apiService.getPageable(`/api/admin/users`, params.buildHttpParams()).pipe(map(response => response.data));
263
+ }
264
+ createAdminUser(data) {
265
+ return this._apiService.post(`/api/admin/users`, data).pipe(map(response => new SkUser(response.data)));
266
+ }
267
+ updateUser(data) {
268
+ return this._apiService.put(`/api/public/users/me`, data).pipe(map(response => new SkUser(response.data)));
269
+ }
270
+ updateAdminUser(id, data) {
271
+ return this._apiService.put(`/api/admin/users/${id}`, data).pipe(map(response => new SkUser(response.data)));
272
+ }
273
+ activateAdminUsers(users) {
274
+ return this._apiService.put(`/api/admin/users/activate/${users.map(user => user.id).join(',')}`, null);
275
+ }
276
+ deactivateAdminUsers(users) {
277
+ return this._apiService.put(`/api/admin/users/deactivate/${users.map(user => user.id).join(',')}`, null);
278
+ }
279
+ deleteAdminUsers(users) {
280
+ return this._apiService.delete(`/api/admin/users/delete/${users.map(user => user.id).join(',')}`);
281
+ }
282
+ getAdminUsersCount() {
283
+ return this._apiService.get('/api/admin/users/count')
284
+ .pipe(map(response => response.data));
285
+ }
286
+ signup(data) {
287
+ return this._apiService.post('/api/auth/signup', data)
288
+ .pipe(tap(response => {
289
+ if (response.status === 200) {
290
+ this._apiService.setToken(response.data.token);
291
+ }
292
+ }), map(response => response.data));
293
+ }
294
+ leave() {
295
+ return this._apiService.put('/api/auth/leave', {})
296
+ .pipe(map(response => response.data));
297
+ }
298
+ isEmailExists(email) {
299
+ return this._apiService.get('/api/public/users/exists/email', new HttpParams().append('email', email)).pipe(map(response => response.data));
300
+ }
301
+ }
302
+ SkUserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkUserService, deps: [{ token: i1.SkApiService }], target: i0.ɵɵFactoryTarget.Injectable });
303
+ SkUserService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkUserService, providedIn: 'root' });
304
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkUserService, decorators: [{
305
+ type: Injectable,
306
+ args: [{
307
+ providedIn: 'root'
308
+ }]
309
+ }], ctorParameters: function () { return [{ type: i1.SkApiService }]; } });
310
+
311
+ class SkDocumentService {
312
+ constructor(_apiService) {
313
+ this._apiService = _apiService;
314
+ }
315
+ getDocument(id) {
316
+ return this._apiService.get(`/api/public/documents/${id}`).pipe(map(response => new SkDocument(response.data)));
317
+ }
318
+ getDocumentByUrl(url) {
319
+ return this._apiService.get(`/api/public/documents/url/${url}`).pipe(map(response => new SkDocument(response.data)));
320
+ }
321
+ getAdminDocument(id) {
322
+ return this._apiService.get(`/api/admin/documents/${id}`).pipe(map(response => new SkDocument(response.data)));
323
+ }
324
+ getDocumentProduct(id) {
325
+ return this._apiService.get(`/api/public/documents/${id}/product`).pipe(map(response => response.data));
326
+ }
327
+ getAdminDocumentProduct(id) {
328
+ return this._apiService.get(`/api/admin/documents/${id}/product`).pipe(map(response => response.data));
329
+ }
330
+ getDocuments(params = new ApiPageableParam()) {
331
+ return this._apiService.getPageable(`/api/public/documents`, params.buildHttpParams()).pipe(map(response => response.data));
332
+ }
333
+ getAdminDocuments(params = new ApiPageableParam()) {
334
+ return this._apiService.getPageable(`/api/admin/documents`, params.buildHttpParams()).pipe(map(response => response.data));
335
+ }
336
+ getDocumentsArray(ids) {
337
+ return this._apiService.get(`/api/public/documents/array/${ids.join(',')}`).pipe(map(response => response.data));
338
+ }
339
+ getAdminDocumentsArray(ids) {
340
+ return this._apiService.get(`/api/admin/documents/array/${ids.join(',')}`).pipe(map(response => response.data));
341
+ }
342
+ createAdminDocument(data) {
343
+ return this._apiService.post(`/api/admin/documents`, data).pipe(map(response => new SkDocument(response.data)));
344
+ }
345
+ copyAdminDocument(id) {
346
+ return this._apiService.post(`/api/admin/documents/${id}/copy`, {}).pipe(map(response => new SkDocument(response.data)));
347
+ }
348
+ writePost(data) {
349
+ return this._apiService.post(`/api/public/documents`, data).pipe(map(response => response.data));
350
+ }
351
+ deletePost(id) {
352
+ return this._apiService.delete(`/api/public/documents/${id}`).pipe(map(response => response.data));
353
+ }
354
+ updateDocument(id, data) {
355
+ return this._apiService.put(`/api/public/documents/${id}`, data).pipe(map(response => new SkDocument(response.data)));
356
+ }
357
+ updateAdminDocument(id, data) {
358
+ return this._apiService.put(`/api/admin/documents/${id}`, data).pipe(map(response => new SkDocument(response.data)));
359
+ }
360
+ updateAdminDocumentArticle(id, data) {
361
+ return this._apiService.put(`/api/admin/documents/${id}/article`, data).pipe(map(response => new SkDocument(response.data)));
362
+ }
363
+ updateAdminDocumentImage(id, data) {
364
+ return this._apiService.put(`/api/admin/documents/${id}/image`, data).pipe(map(response => new SkDocument(response.data)));
365
+ }
366
+ updateAdminDocumentProduct(id, data) {
367
+ return this._apiService.put(`/api/admin/documents/${id}/product`, data).pipe(map(response => response.data));
368
+ }
369
+ updateAdminDocumentOpengraph(id, data) {
370
+ return this._apiService.put(`/api/admin/documents/${id}/opengraph`, data).pipe(map(response => new SkDocument(response.data)));
371
+ }
372
+ activateAdminDocuments(documents) {
373
+ return this._apiService.put(`/api/admin/documents/activate/${documents.map(document => document.id).join(',')}`, null);
374
+ }
375
+ deactivateAdminDocuments(documents) {
376
+ return this._apiService.put(`/api/admin/documents/deactivate/${documents.map(document => document.id).join(',')}`, null);
377
+ }
378
+ deleteAdminDocuments(documents) {
379
+ return this._apiService.delete(`/api/admin/documents/delete/${documents.map(document => document.id).join(',')}`);
380
+ }
381
+ getAdminDocumentsCount() {
382
+ return this._apiService.get('/api/admin/documents/count')
383
+ .pipe(map(response => response.data));
384
+ }
385
+ getNextDocumentId(id) {
386
+ return this._apiService.get(`/api/public/documents/${id}/next`)
387
+ .pipe(map(response => response.data));
388
+ }
389
+ getPrevDocumentId(id) {
390
+ return this._apiService.get(`/api/public/documents/${id}/prev`)
391
+ .pipe(map(response => response.data));
392
+ }
393
+ getAdminPublish(documentId) {
394
+ return this._apiService.get(`/api/admin/documents/${documentId}/publish`).pipe(map(response => response.data));
395
+ }
396
+ deleteAdminPublish(documentId, id) {
397
+ return this._apiService.delete(`/api/admin/documents/${documentId}/publish/${id}`).pipe(map(response => response.data));
398
+ }
399
+ createAdminPublish(documentId, data) {
400
+ return this._apiService.post(`/api/admin/documents/${documentId}/publish`, data).pipe(map(response => response.data));
401
+ }
402
+ updateAdminPublish(documentId, data) {
403
+ return this._apiService.put(`/api/admin/documents/${documentId}/publish`, data).pipe(map(response => response.data));
404
+ }
405
+ }
406
+ SkDocumentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkDocumentService, deps: [{ token: i1.SkApiService }], target: i0.ɵɵFactoryTarget.Injectable });
407
+ SkDocumentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkDocumentService, providedIn: 'root' });
408
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkDocumentService, decorators: [{
409
+ type: Injectable,
410
+ args: [{
411
+ providedIn: 'root'
412
+ }]
413
+ }], ctorParameters: function () { return [{ type: i1.SkApiService }]; } });
414
+
415
+ class SkBoardService {
416
+ constructor(_apiService) {
417
+ this._apiService = _apiService;
418
+ }
419
+ getBoard(url, params = new ApiPageableParam()) {
420
+ return this._apiService.get(`/api/public/boards/${url}`, params.buildHttpParams()).pipe(map(response => response.data));
421
+ }
422
+ getAdminBoard(id) {
423
+ return this._apiService.get(`/api/admin/boards/${id}`).pipe(map(response => new SkBoard(response.data)));
424
+ }
425
+ getBoards(showSupport = false) {
426
+ return this._apiService.get(`/api/public/boards`, new HttpParams().append('showSupport', String(showSupport))).pipe(map(response => response.data));
427
+ }
428
+ getAdminBoards(params = new ApiPageableParam()) {
429
+ return this._apiService.getPageable(`/api/admin/boards`, params.buildHttpParams()).pipe(map(response => response.data));
430
+ }
431
+ createAdminBoard(data) {
432
+ return this._apiService.post(`/api/admin/boards`, data).pipe(map(response => new SkBoard(response.data)));
433
+ }
434
+ updateBoard(id, data) {
435
+ return this._apiService.put(`/api/public/boards/${id}`, data).pipe(map(response => new SkBoard(response.data)));
436
+ }
437
+ updateAdminBoard(id, data) {
438
+ return this._apiService.put(`/api/admin/boards/${id}`, data).pipe(map(response => new SkBoard(response.data)));
439
+ }
440
+ getAllNoticeDocuments() {
441
+ return this._apiService.get(`/api/public/boards/notices`).pipe(map(response => (response.data || [])));
442
+ }
443
+ activateAdminBoards(boards) {
444
+ return this._apiService.put(`/api/admin/boards/activate/${boards.map(board => board.id).join(',')}`, null);
445
+ }
446
+ deactivateAdminBoards(boards) {
447
+ return this._apiService.put(`/api/admin/boards/deactivate/${boards.map(board => board.id).join(',')}`, null);
448
+ }
449
+ deleteAdminBoards(boards) {
450
+ return this._apiService.delete(`/api/admin/boards/delete/${boards.map(board => board.id).join(',')}`);
451
+ }
452
+ }
453
+ SkBoardService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkBoardService, deps: [{ token: i1.SkApiService }], target: i0.ɵɵFactoryTarget.Injectable });
454
+ SkBoardService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkBoardService, providedIn: 'root' });
455
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkBoardService, decorators: [{
456
+ type: Injectable,
457
+ args: [{
458
+ providedIn: 'root'
459
+ }]
460
+ }], ctorParameters: function () { return [{ type: i1.SkApiService }]; } });
461
+
462
+ class SkBrandService {
463
+ constructor(_apiService) {
464
+ this._apiService = _apiService;
465
+ }
466
+ getBrand(id) {
467
+ return this._apiService.get(`/api/public/brands/${id}`).pipe(map(response => response.data));
468
+ }
469
+ getAdminBrand(id) {
470
+ return this._apiService.get(`/api/admin/brands/${id}`).pipe(map(response => response.data));
471
+ }
472
+ getBrands(params = new ApiPageableParam()) {
473
+ return this._apiService.getPageable(`/api/public/brands`, params.buildHttpParams()).pipe(map(response => response.data));
474
+ }
475
+ getAllBrands(params = new ApiPageableParam()) {
476
+ return this._apiService.get(`/api/public/brands/all`, params.buildHttpParams()).pipe(map(response => response.data));
477
+ }
478
+ getAdminBrands(params = new ApiPageableParam()) {
479
+ return this._apiService.getPageable(`/api/admin/brands`, params.buildHttpParams()).pipe(map(response => response.data));
480
+ }
481
+ getAdminAllBrands() {
482
+ return this._apiService.get(`/api/admin/brands/all`).pipe(map(response => response.data));
483
+ }
484
+ createAdminBrand(data) {
485
+ return this._apiService.post(`/api/admin/brands`, data).pipe(map(response => response.data));
486
+ }
487
+ updateAdminBrand(id, data) {
488
+ return this._apiService.put(`/api/admin/brands/${id}`, data).pipe(map(response => response.data));
489
+ }
490
+ deleteAdminBrands(brands) {
491
+ return this._apiService.delete(`/api/admin/brands/delete/${brands.map(brand => brand.id).join(',')}`);
492
+ }
493
+ }
494
+ SkBrandService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkBrandService, deps: [{ token: i1.SkApiService }], target: i0.ɵɵFactoryTarget.Injectable });
495
+ SkBrandService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkBrandService, providedIn: 'root' });
496
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkBrandService, decorators: [{
497
+ type: Injectable,
498
+ args: [{
499
+ providedIn: 'root'
500
+ }]
501
+ }], ctorParameters: function () { return [{ type: i1.SkApiService }]; } });
502
+
503
+ class SkCategoryService {
504
+ constructor(_apiService) {
505
+ this._apiService = _apiService;
506
+ }
507
+ getCategory(id) {
508
+ return this._apiService.get(`/api/public/categories/${id}`).pipe(map(response => response.data));
509
+ }
510
+ getAdminCategory(id) {
511
+ return this._apiService.get(`/api/admin/categories/${id}`).pipe(map(response => response.data));
512
+ }
513
+ getCategories(type) {
514
+ return this._apiService.get(`/api/public/categories`).pipe(map(response => response.data.filter(item => item.type === type)));
515
+ }
516
+ getAdminAllCategories() {
517
+ return this._apiService.get(`/api/admin/categories/all`).pipe(map(response => response.data));
518
+ }
519
+ getAdminCategories(params = new ApiPageableParam()) {
520
+ return this._apiService.getPageable(`/api/admin/categories`, params.buildHttpParams()).pipe(map(response => response.data));
521
+ }
522
+ getAdminSsubCategoryItems(params = new ApiPageableParam()) {
523
+ return this._apiService.getPageable(`/api/admin/categories/subitems`, params.buildHttpParams()).pipe(map(response => response.data));
524
+ }
525
+ getAdminCategoriesDetail(idArray) {
526
+ return this._apiService.get(`/api/admin/categories/detail/${idArray.join(',')}`).pipe(map(response => (response.data || []).map(value => {
527
+ return Object.assign({}, { subCategories: [] }, value);
528
+ })));
529
+ }
530
+ createAdminCategory(data) {
531
+ return this._apiService.post(`/api/admin/categories`, data).pipe(map(response => response.data));
532
+ }
533
+ updateAdminCategory(id, data) {
534
+ return this._apiService.put(`/api/admin/categories/${id}`, data).pipe(map(response => response.data));
535
+ }
536
+ deleteAdminCategories(categories) {
537
+ return this._apiService.delete(`/api/admin/categories/delete/${categories.map(category => category.id).join(',')}`);
538
+ }
539
+ createAdminSubCategory(categoryId, data) {
540
+ return this._apiService.post(`/api/admin/categories/${categoryId}/sub`, data).pipe(map(response => response.data));
541
+ }
542
+ createAdminSubCategoryItem(categoryId, subCategoryId, data) {
543
+ return this._apiService.post(`/api/admin/categories/${categoryId}/sub/${subCategoryId}`, data).pipe(map(response => response.data));
544
+ }
545
+ deleteAdminSubCategory(categoryId, subCategoryId) {
546
+ return this._apiService.delete(`/api/admin/categories/${categoryId}/sub/${subCategoryId}`).pipe(map(response => response.data));
547
+ }
548
+ deleteAdminSubCategoryItem(categoryId, subCategoryId, subCategoryItemId) {
549
+ return this._apiService.delete(`/api/admin/categories/${categoryId}/sub/${subCategoryId}/${subCategoryItemId}`).pipe(map(response => response.data));
550
+ }
551
+ }
552
+ SkCategoryService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkCategoryService, deps: [{ token: i1.SkApiService }], target: i0.ɵɵFactoryTarget.Injectable });
553
+ SkCategoryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkCategoryService, providedIn: 'root' });
554
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkCategoryService, decorators: [{
555
+ type: Injectable,
556
+ args: [{
557
+ providedIn: 'root'
558
+ }]
559
+ }], ctorParameters: function () { return [{ type: i1.SkApiService }]; } });
560
+
561
+ class SkProductService {
562
+ constructor(_apiService) {
563
+ this._apiService = _apiService;
564
+ }
565
+ getProduct(url) {
566
+ return this._apiService.get(`/api/public/products/${url}`).pipe(map(response => response.data));
567
+ }
568
+ getAdminProduct(id) {
569
+ return this._apiService.get(`/api/admin/products/${id}`).pipe(map(response => new SkProduct(response.data)));
570
+ }
571
+ getProducts(params = new ApiPageableParam()) {
572
+ return this._apiService.getPageable(`/api/public/products`, params.buildHttpParams()).pipe(map(response => response.data));
573
+ }
574
+ getAdminProducts(params = new ApiPageableParam()) {
575
+ return this._apiService.getPageable(`/api/admin/products`, params.buildHttpParams()).pipe(map(response => response.data));
576
+ }
577
+ getProductsArray(ids) {
578
+ return this._apiService.get(`/api/public/products/array/${ids.join(',')}`).pipe(map(response => response.data));
579
+ }
580
+ getAdminProductsArray(ids) {
581
+ return this._apiService.get(`/api/admin/products/array/${ids.join(',')}`).pipe(map(response => response.data));
582
+ }
583
+ createAdminProduct(data) {
584
+ return this._apiService.post(`/api/admin/products`, data).pipe(map(response => new SkProduct(response.data)));
585
+ }
586
+ copyAdminProduct(id) {
587
+ return this._apiService.post(`/api/admin/products/${id}/copy`, {}).pipe(map(response => new SkProduct(response.data)));
588
+ }
589
+ updateProduct(id, data) {
590
+ return this._apiService.put(`/api/public/products/${id}`, data).pipe(map(response => new SkProduct(response.data)));
591
+ }
592
+ updateAdminProduct(id, data) {
593
+ return this._apiService.put(`/api/admin/products/${id}`, data).pipe(map(response => new SkProduct(response.data)));
594
+ }
595
+ updateAdminProductPrice(id, data) {
596
+ return this._apiService.put(`/api/admin/products/${id}/price`, data).pipe(map(response => new SkProduct(response.data)));
597
+ }
598
+ updateAdminProductOpengraph(id, data) {
599
+ return this._apiService.put(`/api/admin/products/${id}/opengraph`, data).pipe(map(response => new SkProduct(response.data)));
600
+ }
601
+ updateAdminProductNaverEP(id, data) {
602
+ return this._apiService.put(`/api/admin/products/${id}/naverep`, data).pipe(map(response => new SkProduct(response.data)));
603
+ }
604
+ updateAdminProductCatalog(id, data) {
605
+ return this._apiService.put(`/api/admin/products/${id}/catalog`, data).pipe(map(response => new SkProduct(response.data)));
606
+ }
607
+ updateAdminProductOption(id, data) {
608
+ return this._apiService.put(`/api/admin/products/${id}/option`, data).pipe(map(response => new SkProduct(response.data)));
609
+ }
610
+ updateAdminProductPackage(id, data) {
611
+ return this._apiService.put(`/api/admin/products/${id}/package`, data).pipe(map(response => new SkProduct(response.data)));
612
+ }
613
+ getAdminPackageChildrenOptions(id) {
614
+ return this._apiService.get(`/api/admin/products/${id}/package/children-options`).pipe(map(response => response.data));
615
+ }
616
+ getAdminPackageChildrenImages(id) {
617
+ return this._apiService.get(`/api/admin/products/${id}/package/children-images`).pipe(map(response => (response.data || []).map(item => new SkFile(item))));
618
+ }
619
+ updateAdminProductArticleDesc(id, data) {
620
+ return this._apiService.put(`/api/admin/products/${id}/article-desc`, data).pipe(map(response => new SkProduct(response.data)));
621
+ }
622
+ updateAdminProductArticleSpec(id, data) {
623
+ return this._apiService.put(`/api/admin/products/${id}/article-spec`, data).pipe(map(response => new SkProduct(response.data)));
624
+ }
625
+ updateAdminProductImage(id, data) {
626
+ return this._apiService.put(`/api/admin/products/${id}/image`, data).pipe(map(response => new SkProduct(response.data)));
627
+ }
628
+ updateAdminProductEDelivery(id, data) {
629
+ return this._apiService.put(`/api/admin/products/${id}/edelivery`, data).pipe(map(response => new SkProduct(response.data)));
630
+ }
631
+ updateAdminProductFurnitureDelivery(id, data) {
632
+ return this._apiService.put(`/api/admin/products/${id}/furniture-delivery`, data).pipe(map(response => new SkProduct(response.data)));
633
+ }
634
+ activateAdminProducts(products) {
635
+ return this._apiService.put(`/api/admin/products/activate/${products.map(product => product.id).join(',')}`, null);
636
+ }
637
+ deactivateAdminProducts(products) {
638
+ return this._apiService.put(`/api/admin/products/deactivate/${products.map(product => product.id).join(',')}`, null);
639
+ }
640
+ deleteAdminProducts(products) {
641
+ return this._apiService.delete(`/api/admin/products/delete/${products.map(product => product.id).join(',')}`);
642
+ }
643
+ getAdminProductsCount() {
644
+ return this._apiService.get('/api/admin/products/count')
645
+ .pipe(map(response => response.data));
646
+ }
647
+ updateWishlist(id) {
648
+ return this._apiService.put(`/api/public/products/${id}/wishlist`, {}).pipe(map(response => response.data));
649
+ }
650
+ getWishlist(id) {
651
+ return this._apiService.get(`/api/public/products/${id}/wishlist`).pipe(map(response => response.data));
652
+ }
653
+ getProductOptions(id) {
654
+ return this._apiService.get(`/api/public/products/${id}/options`).pipe(map(response => response.data));
655
+ }
656
+ getAdminProductSubCategoryItem(id) {
657
+ return this._apiService.get(`/api/admin/products/${id}/categories`).pipe(map(response => response.data || []));
658
+ }
659
+ updateAdminProductSubCategoryItems(id, idArr) {
660
+ return this._apiService.put(`/api/admin/products/${id}/categories`, { subCategoryItems: idArr }).pipe(map(response => response.data || []));
661
+ }
662
+ getProductsFilterData(params = new ApiPageableParam()) {
663
+ return this._apiService.get(`/api/public/products/filter-data`, params.buildHttpParams()).pipe(map(response => response.data));
664
+ }
665
+ getIncludedPackages(id) {
666
+ return this._apiService.get(`/api/public/products/${id}/included-packages`).pipe(map(response => response.data || []));
667
+ }
668
+ updateAdminStockConfig(id, data) {
669
+ return this._apiService.put(`/api/admin/products/${id}/stocks`, data).pipe(map(response => response.data));
670
+ }
671
+ getAdminStockCount(id) {
672
+ return this._apiService.get(`/api/admin/products/${id}/stocks/count`).pipe(map(response => Object.assign({ totalIn: 0, totalOut: 0, current: 0 }, response.data)));
673
+ }
674
+ getAdminStocks(id, params = new ApiPageableParam()) {
675
+ return this._apiService.getPageable(`/api/admin/products/${id}/stocks`, params.buildHttpParams()).pipe(map(response => response.data));
676
+ }
677
+ addAdminStock(id, data) {
678
+ return this._apiService.post(`/api/admin/products/${id}/stocks`, data).pipe(map(response => Object.assign({ totalIn: 0, totalOut: 0, current: 0 }, response.data)));
679
+ }
680
+ updateAdminStock(productId, stockId, data) {
681
+ return this._apiService.put(`/api/admin/products/${productId}/stocks/${stockId}`, data).pipe(map(response => response.data));
682
+ }
683
+ deleteAdminStock(productId, stockId) {
684
+ return this._apiService.delete(`/api/admin/products/${productId}/stocks/${stockId}`).pipe(map(response => response.data));
685
+ }
686
+ getAdminSeriesList(params = new ApiPageableParam()) {
687
+ return this._apiService.getPageable(`/api/admin/product-series`, params.buildHttpParams()).pipe(map(response => response.data));
688
+ }
689
+ getAdminSeries(id) {
690
+ return this._apiService.get(`/api/admin/product-series/${id}`).pipe(map(response => response.data));
691
+ }
692
+ createAdminSeries(data) {
693
+ return this._apiService.post(`/api/admin/product-series`, data).pipe(map(response => response.data));
694
+ }
695
+ updateAdminSeries(id, data) {
696
+ return this._apiService.put(`/api/admin/product-series/${id}`, data).pipe(map(response => response.data));
697
+ }
698
+ deleteAdminSeries(id) {
699
+ return this._apiService.delete(`/api/admin/product-series/${id}`).pipe(map(response => response.data));
700
+ }
701
+ getAdminPublish(productId) {
702
+ return this._apiService.get(`/api/admin/products/${productId}/publish`).pipe(map(response => response.data));
703
+ }
704
+ deleteAdminPublish(productId, id) {
705
+ return this._apiService.delete(`/api/admin/products/${productId}/publish/${id}`).pipe(map(response => response.data));
706
+ }
707
+ createAdminPublish(productId, data) {
708
+ return this._apiService.post(`/api/admin/products/${productId}/publish`, data).pipe(map(response => response.data));
709
+ }
710
+ updateAdminPublish(productId, data) {
711
+ return this._apiService.put(`/api/admin/products/${productId}/publish`, data).pipe(map(response => response.data));
712
+ }
713
+ }
714
+ SkProductService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkProductService, deps: [{ token: i1.SkApiService }], target: i0.ɵɵFactoryTarget.Injectable });
715
+ SkProductService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkProductService, providedIn: 'root' });
716
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkProductService, decorators: [{
717
+ type: Injectable,
718
+ args: [{
719
+ providedIn: 'root'
720
+ }]
721
+ }], ctorParameters: function () { return [{ type: i1.SkApiService }]; } });
722
+
723
+ class SkPromotionService {
724
+ constructor(_apiService) {
725
+ this._apiService = _apiService;
726
+ }
727
+ getPromotion(id) {
728
+ return this._apiService.get(`/api/public/promotions/${id}`).pipe(map(response => response.data));
729
+ }
730
+ getPromotionPreview(id) {
731
+ return this._apiService.get(`/api/admin/promotions/${id}/preview`).pipe(map(response => response.data));
732
+ }
733
+ getAdminPromotion(id) {
734
+ return this._apiService.get(`/api/admin/promotions/${id}`).pipe(map(response => new SkPromotion(response.data)));
735
+ }
736
+ getAdminPromotionTarget(id) {
737
+ return this._apiService.get(`/api/admin/promotions/${id}/target`).pipe(map(response => response.data));
738
+ }
739
+ getPromotions(params = new ApiPageableParam()) {
740
+ return this._apiService.getPageable(`/api/public/promotions`, params.buildHttpParams()).pipe(map(response => response.data));
741
+ }
742
+ getAdminPromotions(params = new ApiPageableParam()) {
743
+ return this._apiService.getPageable(`/api/admin/promotions`, params.buildHttpParams()).pipe(map(response => response.data));
744
+ }
745
+ getPromotionsArray(ids) {
746
+ return this._apiService.get(`/api/public/promotions/array/${ids.join(',')}`).pipe(map(response => response.data));
747
+ }
748
+ getAdminPromotionsArray(ids) {
749
+ return this._apiService.get(`/api/admin/promotions/array/${ids.join(',')}`).pipe(map(response => response.data));
750
+ }
751
+ createAdminPromotion(data) {
752
+ return this._apiService.post(`/api/admin/promotions`, data).pipe(map(response => new SkPromotion(response.data)));
753
+ }
754
+ updatePromotion(id, data) {
755
+ return this._apiService.put(`/api/public/promotions/${id}`, data).pipe(map(response => new SkPromotion(response.data)));
756
+ }
757
+ updateAdminPromotion(id, data) {
758
+ return this._apiService.put(`/api/admin/promotions/${id}`, data).pipe(map(response => new SkPromotion(response.data)));
759
+ }
760
+ updateAdminPromotionTarget(id, data) {
761
+ return this._apiService.put(`/api/admin/promotions/${id}/target`, data).pipe(map(response => response.data));
762
+ }
763
+ updateAdminPromotionGift(id, data) {
764
+ return this._apiService.put(`/api/admin/promotions/${id}/gift`, data).pipe(map(response => new SkPromotion(response.data)));
765
+ }
766
+ updateAdminPromotionContent(id, data) {
767
+ return this._apiService.put(`/api/admin/promotions/${id}/content`, data).pipe(map(response => new SkPromotion(response.data)));
768
+ }
769
+ updateAdminPromotionBenefit(id, data) {
770
+ return this._apiService.put(`/api/admin/promotions/${id}/benefit`, data).pipe(map(response => new SkPromotion(response.data)));
771
+ }
772
+ updateAdminPromotionImage(id, data) {
773
+ return this._apiService.put(`/api/admin/promotions/${id}/image`, data).pipe(map(response => new SkPromotion(response.data)));
774
+ }
775
+ updateAdminPromotionOpengraph(id, data) {
776
+ return this._apiService.put(`/api/admin/promotions/${id}/opengraph`, data).pipe(map(response => new SkPromotion(response.data)));
777
+ }
778
+ activateAdminPromotions(promotions) {
779
+ return this._apiService.put(`/api/admin/promotions/activate/${promotions.map(promotion => promotion.id).join(',')}`, null);
780
+ }
781
+ deactivateAdminPromotions(promotions) {
782
+ return this._apiService.put(`/api/admin/promotions/deactivate/${promotions.map(promotion => promotion.id).join(',')}`, null);
783
+ }
784
+ deleteAdminPromotions(promotions) {
785
+ return this._apiService.delete(`/api/admin/promotions/delete/${promotions.map(promotion => promotion.id).join(',')}`);
786
+ }
787
+ getAdminPromotionsCount() {
788
+ return this._apiService.get('/api/admin/promotions/count')
789
+ .pipe(map(response => response.data));
790
+ }
791
+ }
792
+ SkPromotionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkPromotionService, deps: [{ token: i1.SkApiService }], target: i0.ɵɵFactoryTarget.Injectable });
793
+ SkPromotionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkPromotionService, providedIn: 'root' });
794
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkPromotionService, decorators: [{
795
+ type: Injectable,
796
+ args: [{
797
+ providedIn: 'root'
798
+ }]
799
+ }], ctorParameters: function () { return [{ type: i1.SkApiService }]; } });
800
+
801
+ class SkConfigService {
802
+ constructor(_apiService) {
803
+ this._apiService = _apiService;
804
+ }
805
+ getConfig(key, nullValue = null) {
806
+ return this._apiService.get(`/api/public/config/${key}`)
807
+ .pipe(map(result => result.data ? SkUtils.decodeBase64(result.data.value, nullValue) : nullValue));
808
+ }
809
+ setConfig(key, data, nullValue = []) {
810
+ return this._apiService.put(`/api/admin/config/${key}`, { value: SkUtils.encodeBase64(data) })
811
+ .pipe(map(result => result.data ? SkUtils.decodeBase64(result.data.value, nullValue) : nullValue));
812
+ }
813
+ getBankList() {
814
+ return this._apiService.get('/api/public/bank-list')
815
+ .pipe(map(result => result.data || []));
816
+ }
817
+ }
818
+ SkConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkConfigService, deps: [{ token: i1.SkApiService }], target: i0.ɵɵFactoryTarget.Injectable });
819
+ SkConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkConfigService, providedIn: 'root' });
820
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkConfigService, decorators: [{
821
+ type: Injectable,
822
+ args: [{
823
+ providedIn: 'root'
824
+ }]
825
+ }], ctorParameters: function () { return [{ type: i1.SkApiService }]; } });
826
+
827
+ class SkCartApiService {
828
+ constructor(_apiService) {
829
+ this._apiService = _apiService;
830
+ }
831
+ load() {
832
+ return this._apiService.get(`/api/public/carts`).pipe(map(response => (response.data || []).map(item => new SkCart(item))));
833
+ }
834
+ add(cart) {
835
+ const data = {
836
+ product: cart.product.id,
837
+ selectedOptions: cart.options.map(item => ({
838
+ value: item.value.id,
839
+ option: item.option.id,
840
+ amount: item.amount
841
+ })),
842
+ amount: cart.amount,
843
+ selectedGifts: (cart.gifts || []).map(item => ({ id: item.id }))
844
+ };
845
+ return this._apiService.post(`/api/public/carts`, data).pipe(map(response => (response.data || []).map(item => new SkCart(item))));
846
+ }
847
+ clear() {
848
+ return undefined;
849
+ }
850
+ remove(carts) {
851
+ return this.removeByIdArray(carts.map(cart => cart.id));
852
+ }
853
+ removeByIdArray(idArray) {
854
+ const ids = idArray.filter(id => Number(id) >= 1);
855
+ return this._apiService.delete(`/api/public/carts`, new HttpParams().append('target', ids.join(','))).pipe(map(response => (response.data || []).map(item => new SkCart(item))));
856
+ }
857
+ update(cart) {
858
+ return this._apiService.put(`/api/public/carts/${cart.id}`, { amount: cart.amount }).pipe(map(response => (response.data || []).map(item => new SkCart(item))));
859
+ }
860
+ }
861
+ SkCartApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkCartApiService, deps: [{ token: i1.SkApiService }], target: i0.ɵɵFactoryTarget.Injectable });
862
+ SkCartApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkCartApiService, providedIn: 'root' });
863
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkCartApiService, decorators: [{
864
+ type: Injectable,
865
+ args: [{
866
+ providedIn: 'root'
867
+ }]
868
+ }], ctorParameters: function () { return [{ type: i1.SkApiService }]; } });
869
+ class SkCartLocalService {
870
+ constructor(platformId) {
871
+ this.platformId = platformId;
872
+ this.isPlatformBrowser = isPlatformBrowser(this.platformId);
873
+ }
874
+ loadRaw() {
875
+ let data = [];
876
+ try {
877
+ if (this.isPlatformBrowser) {
878
+ data = (SkUtils.decodeBase64(localStorage.getItem('cartData')) || []).map(item => new SkCart(item));
879
+ }
880
+ }
881
+ catch (e) {
882
+ data = [];
883
+ }
884
+ return data;
885
+ }
886
+ load() {
887
+ return of(this.loadRaw());
888
+ }
889
+ add(cart) {
890
+ cart.id = Math.random();
891
+ const cartList = [cart, ...this.loadRaw()];
892
+ localStorage.setItem('cartData', SkUtils.encodeBase64(cartList));
893
+ return of(cartList);
894
+ }
895
+ clear() {
896
+ const cartList = [];
897
+ localStorage.setItem('cartData', SkUtils.encodeBase64(cartList));
898
+ return of(cartList);
899
+ }
900
+ remove(carts) {
901
+ return this.removeByIdArray(carts.map(cart => cart.id));
902
+ }
903
+ removeByIdArray(idArray) {
904
+ const removedItems = this.loadRaw().filter(item => idArray.findIndex(id => id === item.id) < 0);
905
+ localStorage.setItem('cartData', SkUtils.encodeBase64(removedItems));
906
+ return of(removedItems);
907
+ }
908
+ update(cart) {
909
+ const cartList = this.loadRaw();
910
+ const index = this.loadRaw().findIndex(item => item.id === cart.id);
911
+ if (index > -1) {
912
+ cartList[index] = cart;
913
+ localStorage.setItem('cartData', SkUtils.encodeBase64(cartList));
914
+ }
915
+ return of(cartList);
916
+ }
917
+ }
918
+ SkCartLocalService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkCartLocalService, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
919
+ SkCartLocalService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkCartLocalService, providedIn: 'root' });
920
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkCartLocalService, decorators: [{
921
+ type: Injectable,
922
+ args: [{
923
+ providedIn: 'root'
924
+ }]
925
+ }], ctorParameters: function () { return [{ type: Object, decorators: [{
926
+ type: Inject,
927
+ args: [PLATFORM_ID]
928
+ }] }]; } });
929
+ class SkCartService {
930
+ constructor(_authService, _apiService, _apiCartService, _apiLocalService) {
931
+ this._authService = _authService;
932
+ this._apiService = _apiService;
933
+ this._apiCartService = _apiCartService;
934
+ this._apiLocalService = _apiLocalService;
935
+ this._cartItems$ = new BehaviorSubject([]);
936
+ this.cartItems$ = this._cartItems$.asObservable();
937
+ this._selectedItems$ = new BehaviorSubject([]);
938
+ this.selectedItems$ = this._selectedItems$.asObservable();
939
+ // this._myInfoSubscription = this._authService.userinfo$.subscribe(() => {
940
+ // this.load();
941
+ // });
942
+ }
943
+ get cartItems() {
944
+ return this._cartItems$.getValue();
945
+ }
946
+ set cartItems(value) {
947
+ this._cartItems$.next(value);
948
+ }
949
+ get selectedItems() {
950
+ return this._selectedItems$.getValue();
951
+ }
952
+ set selectedItems(value) {
953
+ this._selectedItems$.next(value);
954
+ }
955
+ load() {
956
+ this._authService.checkLogin()
957
+ .pipe(switchMap(result => result ? this._apiCartService.load() : this._apiLocalService.load()))
958
+ .subscribe(result => this._cartItems$.next(result));
959
+ }
960
+ clear() {
961
+ this._authService.checkLogin()
962
+ .pipe(switchMap(result => result ? this._apiCartService.clear() : this._apiLocalService.clear()))
963
+ .subscribe(result => this._cartItems$.next(result));
964
+ }
965
+ add(cart) {
966
+ return this._authService.checkLogin()
967
+ .pipe(switchMap(result => result ? this._apiCartService.add(cart) : this._apiLocalService.add(cart)), tap(result => this._cartItems$.next(result)));
968
+ }
969
+ remove(carts) {
970
+ this._authService.checkLogin()
971
+ .pipe(switchMap(result => result ? this._apiCartService.remove(carts) : this._apiLocalService.remove(carts)))
972
+ .subscribe(result => {
973
+ this._cartItems$.next(result);
974
+ this.checkSelectedItems();
975
+ });
976
+ }
977
+ removeByIdArray(idArray) {
978
+ this._authService.checkLogin()
979
+ .pipe(switchMap(result => result ? this._apiCartService.removeByIdArray(idArray) : this._apiLocalService.removeByIdArray(idArray)))
980
+ .subscribe(result => {
981
+ this._cartItems$.next(result);
982
+ this.checkSelectedItems();
983
+ });
984
+ }
985
+ update(cart) {
986
+ this._authService.checkLogin()
987
+ .pipe(switchMap(result => result ? this._apiCartService.update(cart) : this._apiLocalService.update(cart)))
988
+ .subscribe(result => this._cartItems$.next(result));
989
+ }
990
+ getCart(id) {
991
+ return this._cartItems$.getValue().find(value => value.id === id);
992
+ }
993
+ checkSelectedItems() {
994
+ this.selectedItems = this.selectedItems.filter(value => !!this.getCart(value));
995
+ }
996
+ selectAll() {
997
+ this.selectedItems = this._cartItems$.getValue().map(item => item.id);
998
+ }
999
+ deSelectAll() {
1000
+ this.selectedItems = [];
1001
+ }
1002
+ toggleSelectAll() {
1003
+ if (this.selectedItems.length === this._cartItems$.getValue().length) {
1004
+ this.deSelectAll();
1005
+ }
1006
+ else {
1007
+ this.selectAll();
1008
+ }
1009
+ }
1010
+ toggleSelect(cart) {
1011
+ const targetIndex = this.selectedItems.findIndex(item => item === cart.id);
1012
+ if (targetIndex === -1) {
1013
+ this.selectedItems = [...this.selectedItems, cart.id];
1014
+ }
1015
+ else {
1016
+ const target = this.selectedItems;
1017
+ target.splice(targetIndex, 1);
1018
+ this.selectedItems = target;
1019
+ }
1020
+ }
1021
+ isSelected(cart) {
1022
+ return this.selectedItems.findIndex(item => item === cart.id) > -1;
1023
+ }
1024
+ isSelectedAll() {
1025
+ return this.selectedItems.length > 0 && this.selectedItems.length === this._cartItems$.getValue().length;
1026
+ }
1027
+ isIntermediate() {
1028
+ return this.selectedItems.length > 0 && this.selectedItems.length !== this._cartItems$.getValue().length;
1029
+ }
1030
+ createOrder(paymentType, affiliateKey) {
1031
+ return this._authService.checkLogin()
1032
+ .pipe(take(1), map(result => {
1033
+ if (result) {
1034
+ return {
1035
+ apiUrl: `/api/public/orders/from-cart`,
1036
+ items: this.selectedItems
1037
+ };
1038
+ }
1039
+ else {
1040
+ return {
1041
+ apiUrl: `/api/public/orders/from-data`,
1042
+ items: this.selectedItems
1043
+ .map(id => this.getCart(id))
1044
+ .map(cart => ({
1045
+ id: cart.id,
1046
+ productId: cart.product.id,
1047
+ amount: cart.amount,
1048
+ options: (cart.options || []).map(option => ({
1049
+ optionId: option.option.id,
1050
+ valueId: option.value.id,
1051
+ amount: option.amount || 1
1052
+ })),
1053
+ gifts: (cart.gifts || []).map(item => ({ id: item.id }))
1054
+ }))
1055
+ };
1056
+ }
1057
+ }), switchMap(result => this._apiService.post(result.apiUrl, {
1058
+ items: result.items,
1059
+ affiliateKey,
1060
+ paymentType
1061
+ })), map(result => result.data));
1062
+ }
1063
+ }
1064
+ SkCartService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkCartService, deps: [{ token: SkAuthService }, { token: i1.SkApiService }, { token: SkCartApiService }, { token: SkCartLocalService }], target: i0.ɵɵFactoryTarget.Injectable });
1065
+ SkCartService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkCartService, providedIn: 'root' });
1066
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkCartService, decorators: [{
1067
+ type: Injectable,
1068
+ args: [{
1069
+ providedIn: 'root'
1070
+ }]
1071
+ }], ctorParameters: function () { return [{ type: SkAuthService }, { type: i1.SkApiService }, { type: SkCartApiService }, { type: SkCartLocalService }]; } });
1072
+
1073
+ class SkOrderService {
1074
+ constructor(_apiService) {
1075
+ this._apiService = _apiService;
1076
+ }
1077
+ getAdminOrders(params = new ApiPageableParam()) {
1078
+ return this._apiService.getPageable(`/api/admin/orders`, params.buildHttpParams())
1079
+ .pipe(map(result => result.data));
1080
+ }
1081
+ getAdminOrdersCount() {
1082
+ return this._apiService.get(`/api/admin/orders/count`)
1083
+ .pipe(map(result => result.data));
1084
+ }
1085
+ getAdminOrder(id) {
1086
+ return this._apiService.get(`/api/admin/orders/${id}`)
1087
+ .pipe(map(result => new SkOrderDetail(result.data)));
1088
+ }
1089
+ getMyOrders() {
1090
+ return this._apiService.get(`/api/public/orders/me`)
1091
+ .pipe(map(result => result.data));
1092
+ }
1093
+ getMyLatestOrders() {
1094
+ return this._apiService.get(`/api/public/orders/me/latest`)
1095
+ .pipe(map(result => result.data));
1096
+ }
1097
+ getOrderDetail(id) {
1098
+ return this._apiService.get(`/api/public/orders/${id}`)
1099
+ .pipe(map(result => new SkOrderDetail(result.data)));
1100
+ }
1101
+ getOrderStatus(id) {
1102
+ return this._apiService.get(`/api/public/orders/${id}/status`)
1103
+ .pipe(map(result => result.data));
1104
+ }
1105
+ getOrderLogs(id) {
1106
+ return this._apiService.get(`/api/admin/orders/${id}/logs`)
1107
+ .pipe(map(result => result.data || []));
1108
+ }
1109
+ createAdminOrder(data) {
1110
+ return this._apiService.post(`/api/admin/orders`, data)
1111
+ .pipe(map(result => new SkOrderDetail(result.data)));
1112
+ }
1113
+ addOrderLog(id, message) {
1114
+ return this._apiService.post(`/api/admin/orders/${id}/logs`, { message })
1115
+ .pipe(map(result => result.data || []));
1116
+ }
1117
+ updateAdminOrderBaseInfo(id, data) {
1118
+ return this._apiService.put(`/api/admin/orders/${id}/info`, data)
1119
+ .pipe(map(result => result.data));
1120
+ }
1121
+ updateAdminConfirmTransferPayment(id) {
1122
+ return this._apiService.put(`/api/admin/orders/${id}/confirm-payment/transfer`, null)
1123
+ .pipe(map(result => result.data));
1124
+ }
1125
+ updateAdminCancel(id) {
1126
+ return this._apiService.put(`/api/admin/orders/${id}/cancel`, {})
1127
+ .pipe(map(result => result.data));
1128
+ }
1129
+ updateAdminCancelForce(id) {
1130
+ return this._apiService.put(`/api/admin/orders/${id}/cancel/force`, {})
1131
+ .pipe(map(result => result.data));
1132
+ }
1133
+ updateAdminProcessStart(id) {
1134
+ return this._apiService.put(`/api/admin/orders/${id}/process-start`, {})
1135
+ .pipe(map(result => result.data));
1136
+ }
1137
+ updateAdminComplete(id) {
1138
+ return this._apiService.put(`/api/admin/orders/${id}/complete`, {})
1139
+ .pipe(map(result => result.data));
1140
+ }
1141
+ updateAdminPayment(id, data) {
1142
+ return this._apiService.put(`/api/admin/orders/${id}/update-payment`, data)
1143
+ .pipe(map(result => result.data));
1144
+ }
1145
+ updateAdminShippingStatus(id, data) {
1146
+ return this._apiService.put(`/api/admin/orders/${id}/update-shipping-status`, data)
1147
+ .pipe(map(result => result.data));
1148
+ }
1149
+ deleteAdminOrders(orders) {
1150
+ return this._apiService.delete(`/api/admin/orders/${orders.map(order => order.id).join(',')}`);
1151
+ }
1152
+ cancelOrder(id, data) {
1153
+ return this._apiService.put(`/api/public/orders/${id}/cancel`, data)
1154
+ .pipe(map(result => result.data));
1155
+ }
1156
+ startProgress(id, data) {
1157
+ return this._apiService.put(`/api/public/orders/${id}/progress`, data)
1158
+ .pipe(map(result => result.data));
1159
+ }
1160
+ moveToMyOrder(id) {
1161
+ return this._apiService.put(`/api/public/orders/${id}/move`, {})
1162
+ .pipe(map(result => result.data));
1163
+ }
1164
+ getAdminShippingFeeList() {
1165
+ return this._apiService.get(`/api/admin/orders/shipping-fees`)
1166
+ .pipe(map(result => result.data));
1167
+ }
1168
+ createAdminShippingFee(data) {
1169
+ return this._apiService.post(`/api/admin/orders/shipping-fees`, data)
1170
+ .pipe(map(result => result.data));
1171
+ }
1172
+ updateAdminShippingFee(id, data) {
1173
+ return this._apiService.put(`/api/admin/orders/shipping-fees/${id}`, data)
1174
+ .pipe(map(result => result.data));
1175
+ }
1176
+ deleteAdminShippingFee(id) {
1177
+ return this._apiService.delete(`/api/admin/orders/shipping-fees/${id}`)
1178
+ .pipe(map(result => result.data));
1179
+ }
1180
+ calculateShippingFee(id, method, zipCode, serials = []) {
1181
+ return this._apiService.get(`/api/public/orders/${id}/calculate-shipping-fee`, new HttpParams().append('method', method).append('zipCode', zipCode).append('serials', serials.join(',')))
1182
+ .pipe(map(result => result.data || 0));
1183
+ }
1184
+ validateCoupon(id, serials) {
1185
+ return this._apiService.post(`/api/public/orders/${id}/check-coupon`, {
1186
+ couponSerials: serials
1187
+ }).pipe(map(result => result.data || { discountAmount: 0, couponData: [] }));
1188
+ }
1189
+ }
1190
+ SkOrderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkOrderService, deps: [{ token: i1.SkApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1191
+ SkOrderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkOrderService, providedIn: 'root' });
1192
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkOrderService, decorators: [{
1193
+ type: Injectable,
1194
+ args: [{
1195
+ providedIn: 'root'
1196
+ }]
1197
+ }], ctorParameters: function () { return [{ type: i1.SkApiService }]; } });
1198
+
1199
+ class SkAccountService {
1200
+ constructor(_apiService) {
1201
+ this._apiService = _apiService;
1202
+ }
1203
+ getDefaultAddress() {
1204
+ return this._apiService.get(`/api/public/users/me/address/default`).pipe(map(response => response.data));
1205
+ }
1206
+ getAddressList() {
1207
+ return this._apiService.get(`/api/public/users/me/address`).pipe(map(response => response.data || []));
1208
+ }
1209
+ updateAddress(id, data) {
1210
+ return this._apiService.put(`/api/public/users/me/address/${id}`, data).pipe(map(response => response.data));
1211
+ }
1212
+ deleteAddress(id) {
1213
+ return this._apiService.delete(`/api/public/users/me/address/${id}`);
1214
+ }
1215
+ getWishList() {
1216
+ return this._apiService.get(`/api/public/users/me/wishlist`).pipe(map(response => response.data || []));
1217
+ }
1218
+ getWishListShowBadge() {
1219
+ return this._apiService.get(`/api/public/users/me/wishlist/badge`).pipe(map(response => response.data || false));
1220
+ }
1221
+ }
1222
+ SkAccountService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkAccountService, deps: [{ token: i1.SkApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1223
+ SkAccountService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkAccountService, providedIn: 'root' });
1224
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkAccountService, decorators: [{
1225
+ type: Injectable,
1226
+ args: [{
1227
+ providedIn: 'root'
1228
+ }]
1229
+ }], ctorParameters: function () { return [{ type: i1.SkApiService }]; } });
1230
+
1231
+ class SkSearchService {
1232
+ constructor(_apiService) {
1233
+ this._apiService = _apiService;
1234
+ }
1235
+ getSearchResults(params = new ApiPageableParam()) {
1236
+ return this._apiService.get(`/api/public/search`, params.buildHttpParams()).pipe(map(response => response.data));
1237
+ }
1238
+ getSearchKeywords() {
1239
+ return this._apiService.get(`/api/public/search/keywords`).pipe(map(response => response.data));
1240
+ }
1241
+ }
1242
+ SkSearchService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkSearchService, deps: [{ token: i1.SkApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1243
+ SkSearchService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkSearchService, providedIn: 'root' });
1244
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkSearchService, decorators: [{
1245
+ type: Injectable,
1246
+ args: [{
1247
+ providedIn: 'root'
1248
+ }]
1249
+ }], ctorParameters: function () { return [{ type: i1.SkApiService }]; } });
1250
+
1251
+ class SkPointService {
1252
+ constructor(_apiService) {
1253
+ this._apiService = _apiService;
1254
+ this.apiServer = _apiService.apiServer;
1255
+ }
1256
+ getMyCurrentPoint() {
1257
+ return this._apiService.get(`/api/public/points/me`).pipe(map(response => Number(response.data || 0)));
1258
+ }
1259
+ getMyPointHistory(params = new ApiPageableParam()) {
1260
+ return this._apiService.getPageable(`/api/public/points/me/history`, params.buildHttpParams()).pipe(map(response => response.data), map(value => {
1261
+ value.content = (value.content || []).map(item => new SkPoint(item));
1262
+ return value;
1263
+ }));
1264
+ }
1265
+ getUserCurrentPoint(userId) {
1266
+ return this._apiService.get(`/api/admin/points/${userId}`).pipe(map(response => Number(response.data || 0)));
1267
+ }
1268
+ getUserPointHistory(userId, params = new ApiPageableParam()) {
1269
+ return this._apiService.getPageable(`/api/admin/points/${userId}/history`, params.buildHttpParams()).pipe(map(response => response.data), map(value => {
1270
+ value.content = (value.content || []).map(item => new SkPoint(item));
1271
+ return value;
1272
+ }));
1273
+ }
1274
+ addPointToUser(data) {
1275
+ return this._apiService.put(`/api/admin/points/add`, data).pipe(map(response => Number(response.data || 0)));
1276
+ }
1277
+ usePointToUser(data) {
1278
+ return this._apiService.put(`/api/admin/points/use`, data).pipe(map(response => Number(response.data || 0)));
1279
+ }
1280
+ }
1281
+ SkPointService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkPointService, deps: [{ token: i1.SkApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1282
+ SkPointService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkPointService, providedIn: 'root' });
1283
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkPointService, decorators: [{
1284
+ type: Injectable,
1285
+ args: [{
1286
+ providedIn: 'root'
1287
+ }]
1288
+ }], ctorParameters: function () { return [{ type: i1.SkApiService }]; } });
1289
+
1290
+ class SkCouponService {
1291
+ constructor(_apiService) {
1292
+ this._apiService = _apiService;
1293
+ }
1294
+ getCoupon(code) {
1295
+ return this._apiService.get(`/api/public/coupons/${code}`).pipe(map(response => response.data));
1296
+ }
1297
+ getAdminCoupon(id) {
1298
+ return this._apiService.get(`/api/admin/coupons/${id}`).pipe(map(response => response.data));
1299
+ }
1300
+ getCoupons(params = new ApiPageableParam()) {
1301
+ return this._apiService.getPageable(`/api/public/coupons`, params.buildHttpParams()).pipe(map(response => response.data));
1302
+ }
1303
+ getCouponTickets(id) {
1304
+ return this._apiService.get(`/api/admin/coupons/${id}/list`).pipe(map(response => response.data || []));
1305
+ }
1306
+ getAdminCoupons(params = new ApiPageableParam()) {
1307
+ return this._apiService.getPageable(`/api/admin/coupons`, params.buildHttpParams()).pipe(map(response => response.data));
1308
+ }
1309
+ getCouponsArray(ids) {
1310
+ return this._apiService.get(`/api/public/coupons/array/${ids.join(',')}`).pipe(map(response => response.data));
1311
+ }
1312
+ getAdminCouponsArray(ids) {
1313
+ return this._apiService.get(`/api/admin/coupons/array/${ids.join(',')}`).pipe(map(response => response.data));
1314
+ }
1315
+ createAdminCoupon(data) {
1316
+ return this._apiService.post(`/api/admin/coupons`, data).pipe(map(response => response.data));
1317
+ }
1318
+ updateAdminCoupon(id, data) {
1319
+ return this._apiService.put(`/api/admin/coupons/${id}`, data).pipe(map(response => response.data));
1320
+ }
1321
+ updateAdminCouponTrigger(id, data) {
1322
+ return this._apiService.put(`/api/admin/coupons/${id}/trigger`, data).pipe(map(response => response.data));
1323
+ }
1324
+ activateAdminCoupons(coupons) {
1325
+ return this._apiService.put(`/api/admin/coupons/activate/${coupons.map(coupon => coupon.id).join(',')}`, null);
1326
+ }
1327
+ deactivateAdminCoupons(coupons) {
1328
+ return this._apiService.put(`/api/admin/coupons/deactivate/${coupons.map(coupon => coupon.id).join(',')}`, null);
1329
+ }
1330
+ deleteAdminCoupons(coupons) {
1331
+ return this._apiService.delete(`/api/admin/coupons/delete/${coupons.map(coupon => coupon.id).join(',')}`);
1332
+ }
1333
+ getAdminCouponsCount() {
1334
+ return this._apiService.get('/api/admin/coupons/count')
1335
+ .pipe(map(response => response.data));
1336
+ }
1337
+ }
1338
+ SkCouponService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkCouponService, deps: [{ token: i1.SkApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1339
+ SkCouponService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkCouponService, providedIn: 'root' });
1340
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkCouponService, decorators: [{
1341
+ type: Injectable,
1342
+ args: [{
1343
+ providedIn: 'root'
1344
+ }]
1345
+ }], ctorParameters: function () { return [{ type: i1.SkApiService }]; } });
1346
+
1347
+ class SkCommentService {
1348
+ constructor(_apiService) {
1349
+ this._apiService = _apiService;
1350
+ }
1351
+ getDocumentComments(param = new ApiPageableParam()) {
1352
+ return this._apiService.getPageable(`/api/public/document-comments`, param.buildHttpParams())
1353
+ .pipe(map(response => {
1354
+ response.data.content = response.data.content.map(item => new SkDocumentCommentParent(item));
1355
+ return response.data;
1356
+ }));
1357
+ }
1358
+ getDocumentComment(id) {
1359
+ return this._apiService.get(`/api/public/document-comments/${id}`)
1360
+ .pipe(map(response => new SkDocumentCommentParent(response.data)));
1361
+ }
1362
+ writeDocumentComment(data) {
1363
+ return this._apiService.post(`/api/public/document-comments`, data)
1364
+ .pipe(map(response => response.data));
1365
+ }
1366
+ updateDocumentComment(id, data) {
1367
+ return this._apiService.put(`/api/public/document-comments/${id}`, data)
1368
+ .pipe(map(response => response.data));
1369
+ }
1370
+ deleteDocumentComment(id) {
1371
+ return this._apiService.delete(`/api/public/document-comments/${id}`)
1372
+ .pipe(map(response => response.data));
1373
+ }
1374
+ }
1375
+ SkCommentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkCommentService, deps: [{ token: i1.SkApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1376
+ SkCommentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkCommentService, providedIn: 'root' });
1377
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkCommentService, decorators: [{
1378
+ type: Injectable,
1379
+ args: [{
1380
+ providedIn: 'root'
1381
+ }]
1382
+ }], ctorParameters: function () { return [{ type: i1.SkApiService }]; } });
1383
+
1384
+ class SkContactService {
1385
+ constructor(_apiService) {
1386
+ this._apiService = _apiService;
1387
+ }
1388
+ writeContact(data) {
1389
+ return this._apiService.post(`/api/public/contacts`, data)
1390
+ .pipe(map(response => response.data));
1391
+ }
1392
+ getContacts(params = new ApiPageableParam()) {
1393
+ return this._apiService.getPageable(`/api/admin/contacts`, params.buildHttpParams())
1394
+ .pipe(map(response => response.data));
1395
+ }
1396
+ getContact(id) {
1397
+ return this._apiService.get(`/api/admin/contacts/${id}`)
1398
+ .pipe(map(response => response.data));
1399
+ }
1400
+ writeAnswerAdmin(id, data) {
1401
+ return this._apiService.post(`/api/admin/contacts/${id}/answer`, data)
1402
+ .pipe(map(response => response.data));
1403
+ }
1404
+ closeContact(id) {
1405
+ return this._apiService.put(`/api/admin/contacts/${id}/close`, null)
1406
+ .pipe(map(response => response.data));
1407
+ }
1408
+ }
1409
+ SkContactService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkContactService, deps: [{ token: i1.SkApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1410
+ SkContactService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkContactService, providedIn: 'root' });
1411
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkContactService, decorators: [{
1412
+ type: Injectable,
1413
+ args: [{
1414
+ providedIn: 'root'
1415
+ }]
1416
+ }], ctorParameters: function () { return [{ type: i1.SkApiService }]; } });
1417
+
1418
+ class SkEtcService {
1419
+ constructor(_apiService) {
1420
+ this._apiService = _apiService;
1421
+ }
1422
+ sendTestEmail(key, params) {
1423
+ return this._apiService.get(`/api/admin/notifications/email/${key}`, params).pipe(map(response => response.data));
1424
+ }
1425
+ sendTestSms(key, to) {
1426
+ return this._apiService.get(`/api/admin/notifications/sms/${key}`, new HttpParams().append('to', to)).pipe(map(response => response.data));
1427
+ }
1428
+ }
1429
+ SkEtcService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkEtcService, deps: [{ token: i1.SkApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1430
+ SkEtcService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkEtcService, providedIn: 'root' });
1431
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkEtcService, decorators: [{
1432
+ type: Injectable,
1433
+ args: [{
1434
+ providedIn: 'root'
1435
+ }]
1436
+ }], ctorParameters: function () { return [{ type: i1.SkApiService }]; } });
1437
+
1438
+ class SkStoreService {
1439
+ constructor(_apiService) {
1440
+ this._apiService = _apiService;
1441
+ }
1442
+ getStore(id) {
1443
+ return this._apiService.get(`/api/public/stores/${id}`).pipe(map(response => new SkStore(response.data)));
1444
+ }
1445
+ getAdminStore(id) {
1446
+ return this._apiService.get(`/api/admin/stores/${id}`).pipe(map(response => new SkStore(response.data)));
1447
+ }
1448
+ getStores(params = new ApiPageableParam()) {
1449
+ return this._apiService.getPageable(`/api/public/stores`, params.buildHttpParams()).pipe(map(response => {
1450
+ response.data.content = (response.data.content || []).map(item => new SkStore(item));
1451
+ return response.data;
1452
+ }));
1453
+ }
1454
+ getAdminStores(params = new ApiPageableParam()) {
1455
+ return this._apiService.getPageable(`/api/admin/stores`, params.buildHttpParams()).pipe(map(response => {
1456
+ response.data.content = (response.data.content || []).map(item => new SkStore(item));
1457
+ return response.data;
1458
+ }));
1459
+ }
1460
+ createAdminStore(data) {
1461
+ return this._apiService.post(`/api/admin/stores`, data).pipe(map(response => response.data));
1462
+ }
1463
+ updateAdminStore(id, data) {
1464
+ return this._apiService.put(`/api/admin/stores/${id}`, data).pipe(map(response => response.data));
1465
+ }
1466
+ deleteAdminStores(stores) {
1467
+ return this._apiService.delete(`/api/admin/stores/delete/${stores.map(store => store.id).join(',')}`);
1468
+ }
1469
+ }
1470
+ SkStoreService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkStoreService, deps: [{ token: i1.SkApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1471
+ SkStoreService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkStoreService, providedIn: 'root' });
1472
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkStoreService, decorators: [{
1473
+ type: Injectable,
1474
+ args: [{
1475
+ providedIn: 'root'
1476
+ }]
1477
+ }], ctorParameters: function () { return [{ type: i1.SkApiService }]; } });
1478
+
1479
+ class SkKeywordService {
1480
+ constructor(_apiService) {
1481
+ this._apiService = _apiService;
1482
+ }
1483
+ getKeyword(id) {
1484
+ return this._apiService.get(`/api/public/keywords/${id}`).pipe(map(response => response.data));
1485
+ }
1486
+ getAdminKeyword(id) {
1487
+ return this._apiService.get(`/api/admin/keywords/${id}`).pipe(map(response => response.data));
1488
+ }
1489
+ getKeywords(params = new ApiPageableParam()) {
1490
+ return this._apiService.getPageable(`/api/public/keywords`, params.buildHttpParams()).pipe(map(response => response.data));
1491
+ }
1492
+ getAllKeywords(params = new ApiPageableParam()) {
1493
+ return this._apiService.get(`/api/public/keywords/all`, params.buildHttpParams()).pipe(map(response => response.data));
1494
+ }
1495
+ getAdminKeywords(params = new ApiPageableParam()) {
1496
+ return this._apiService.getPageable(`/api/admin/keywords`, params.buildHttpParams()).pipe(map(response => response.data));
1497
+ }
1498
+ getAdminAllKeywords() {
1499
+ return this._apiService.get(`/api/admin/keywords/all`).pipe(map(response => response.data));
1500
+ }
1501
+ createAdminKeyword(data) {
1502
+ return this._apiService.post(`/api/admin/keywords`, data).pipe(map(response => response.data));
1503
+ }
1504
+ updateAdminKeyword(id, data) {
1505
+ return this._apiService.put(`/api/admin/keywords/${id}`, data).pipe(map(response => response.data));
1506
+ }
1507
+ deleteAdminKeywords(keywords) {
1508
+ return this._apiService.delete(`/api/admin/keywords/delete/${keywords.map(keyword => keyword.id).join(',')}`);
1509
+ }
1510
+ }
1511
+ SkKeywordService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkKeywordService, deps: [{ token: i1.SkApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1512
+ SkKeywordService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkKeywordService, providedIn: 'root' });
1513
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkKeywordService, decorators: [{
1514
+ type: Injectable,
1515
+ args: [{
1516
+ providedIn: 'root'
1517
+ }]
1518
+ }], ctorParameters: function () { return [{ type: i1.SkApiService }]; } });
1519
+
1520
+ /**
1521
+ * Generated bundle index. Do not edit.
1522
+ */
1523
+
1524
+ export { SkAccountService, SkAffiliateService, SkAuthAdminGuard, SkAuthGuard, SkAuthService, SkBoardService, SkBrandService, SkCartService, SkCategoryService, SkCommentService, SkConfigService, SkContactService, SkCouponService, SkDocumentService, SkEtcService, SkFileService, SkKeywordService, SkOrderService, SkPointService, SkProductService, SkPromotionService, SkSearchService, SkStoreService, SkUserService };
1525
+ //# sourceMappingURL=sk-front-lib-crud.mjs.map