sk-front-lib 0.16.1 → 0.16.2

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