seller-base-service 0.0.1-security → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of seller-base-service might be problematic. Click here for more details.

Files changed (58) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +59 -3
  3. package/dist/babel-config-for-main-project.js +74 -0
  4. package/dist/collection/index.js +189 -0
  5. package/dist/collection/index.js.map +1 -0
  6. package/dist/common/index.js +206 -0
  7. package/dist/common/index.js.map +1 -0
  8. package/dist/feedback/index.js +249 -0
  9. package/dist/feedback/index.js.map +1 -0
  10. package/dist/index.d.ts +1117 -0
  11. package/dist/index.js +3223 -0
  12. package/dist/index.js.map +1 -0
  13. package/dist/notification/index.js +2373 -0
  14. package/dist/notification/index.js.map +1 -0
  15. package/dist/otp/index.js +197 -0
  16. package/dist/otp/index.js.map +1 -0
  17. package/dist/redteam.js +47 -0
  18. package/dist/report/index.js +330 -0
  19. package/dist/report/index.js.map +1 -0
  20. package/dist/sip/index.js +191 -0
  21. package/dist/sip/index.js.map +1 -0
  22. package/dist/upload/index.js +235 -0
  23. package/dist/upload/index.js.map +1 -0
  24. package/package.json +40 -3
  25. package/src/development/index.ts +38 -0
  26. package/src/index.ts +6 -0
  27. package/src/modules/collection/constants.ts +11 -0
  28. package/src/modules/collection/index.ts +9 -0
  29. package/src/modules/collection/service.ts +53 -0
  30. package/src/modules/collection/types.ts +31 -0
  31. package/src/modules/common/index.ts +7 -0
  32. package/src/modules/common/interceptors.ts +16 -0
  33. package/src/modules/common/service.ts +60 -0
  34. package/src/modules/common/types.ts +36 -0
  35. package/src/modules/feedback/index.ts +6 -0
  36. package/src/modules/feedback/service.ts +73 -0
  37. package/src/modules/feedback/types.ts +68 -0
  38. package/src/modules/index.ts +77 -0
  39. package/src/modules/notification/action.ts +215 -0
  40. package/src/modules/notification/constants.ts +420 -0
  41. package/src/modules/notification/index.ts +23 -0
  42. package/src/modules/notification/service.ts +90 -0
  43. package/src/modules/notification/types.ts +155 -0
  44. package/src/modules/otp/constants.ts +39 -0
  45. package/src/modules/otp/index.ts +11 -0
  46. package/src/modules/otp/service.ts +28 -0
  47. package/src/modules/otp/types.ts +13 -0
  48. package/src/modules/report/constants.ts +20 -0
  49. package/src/modules/report/index.ts +19 -0
  50. package/src/modules/report/service.ts +100 -0
  51. package/src/modules/report/types.ts +31 -0
  52. package/src/modules/report/utils.ts +74 -0
  53. package/src/modules/sip/index.ts +2 -0
  54. package/src/modules/sip/service.ts +59 -0
  55. package/src/modules/sip/types.ts +33 -0
  56. package/src/modules/upload/index.ts +8 -0
  57. package/src/modules/upload/service.ts +94 -0
  58. package/src/modules/upload/types.ts +34 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Shopee Seller Center
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,5 +1,61 @@
1
- # Security holding package
1
+ # seller-base-service
2
2
 
3
- This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
3
+ ## 安装
4
+
5
+ ```bash
6
+ npm install seller-base-service --save
7
+ ```
8
+
9
+ ## 使用
10
+
11
+ ```typescript
12
+ import { CommonServiceWithSip } from 'seller-base-service';
13
+ console.log(CommonServiceWithSip);
14
+ ```
15
+
16
+ ### 按需引入
17
+
18
+ 安装`babel-plugin-import`,在babel的plugin中加入这段配置
19
+
20
+ ```js
21
+ [require('seller-base-service/dist/babel-config-for-main-project')]
22
+ ```
23
+
24
+ ### Seller Center 按需引入
25
+
26
+ Seller Center 由于是多模块模式,因此需要使用的模块需要修改构建配置
27
+
28
+ ```js
29
+ {
30
+ externals: [Object.assign(config.getExternalsConfig(), {
31
+ 'seller-base': config.getExternalsConfig(['@/framework'])['@/framework']
32
+ })],
33
+ babelPlugin: config.mode === 'production' ? [require('seller-base-service/dist/babel-config-for-main-project')] : []
34
+ }
35
+ ```
36
+
37
+ ## 注意
38
+
39
+ 1. 不要修改删除.gitignore中已有部分
40
+ 2. 不要在本项目`local.config.js`加入个人定制的开发环境代码
41
+ 3. 开发一个模块MyService需要创建`src/modules/my-service/index.ts` 和 `src/modules/my-service/service.ts`至少两个文件,`src/modules/my-service/index.ts`不能有默认导出。
42
+ 4. 跨模块引入只能从其他模块入口`index.ts`,不能从其他模块的其他文件引入。
43
+ 5. Constants 作为 MyService 的静态属性,不要额外导出。
44
+ 6. `src/modules/index.ts`代码不能重命名导入。
45
+
46
+ ## 开发
47
+
48
+ ### 开发执行
49
+
50
+ 1. CLI准备,参考CLI文档安装部分
51
+ 2. 初始化项目(scc init -d)
52
+ 3. yarn start
53
+
54
+ ## 构建
55
+
56
+ ### 构建执行
57
+
58
+ 1. CLI准备,参考CLI文档安装部分
59
+ 2. 初始化项目(scc init -b)
60
+ 3. yarn build
4
61
 
5
- Please refer to www.npmjs.com/advisories?search=seller-base-service for more information.
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Babel config template for user.
3
+ */
4
+
5
+ const moduleExportMap = new Map(Object.entries(JSON.parse(`
6
+ {
7
+ "CollectionService": "collection",
8
+ "Collection": "collection",
9
+ "PageActiveCollectionsParams": "collection",
10
+ "PageActiveCollectionsResponse": "collection",
11
+ "CollectionListResponse": "collection",
12
+ "CollectionUpdateData": "collection",
13
+ "FeedbackService": "feedback",
14
+ "Feedback": "feedback",
15
+ "FeedbackClassification": "feedback",
16
+ "FeedbackSubmitPage": "feedback",
17
+ "CommonServiceWithSip": "common",
18
+ "CommonWithSipRequestContainer": "common",
19
+ "CommonListResponse": "common",
20
+ "ErrorResponse": "common",
21
+ "BatchI": "common",
22
+ "NotificationService": "notification",
23
+ "CompiledNotification": "notification",
24
+ "Notification": "notification",
25
+ "Counts": "notification",
26
+ "Status": "notification",
27
+ "NotificationGroupRequest": "notification",
28
+ "UpdateNotificationList": "notification",
29
+ "NotificationRequest": "notification",
30
+ "TrackData": "notification",
31
+ "FoldersConfig": "notification",
32
+ "ActionCategory": "notification",
33
+ "FoldersType": "notification",
34
+ "NotiEventNames": "notification",
35
+ "compileAction": "notification",
36
+ "getMaxActionId": "notification",
37
+ "OtpSeed": "otp",
38
+ "OtpService": "otp",
39
+ "OtpVerifyData": "otp",
40
+ "FileTypeConfig": "report",
41
+ "ReportStatus": "report",
42
+ "ReportService": "report",
43
+ "downloadBlobData": "report",
44
+ "parseBlobJsonResponse": "report",
45
+ "Report": "report",
46
+ "ReportListParams": "report",
47
+ "ReportListResponse": "report",
48
+ "SipGlobalService": "sip",
49
+ "SipOrderResponse": "sip",
50
+ "SipOrder": "sip",
51
+ "SipOrderItem": "sip",
52
+ "UploadService": "upload",
53
+ "UploadOptions": "upload",
54
+ "UploadVideoData": "upload"
55
+ }
56
+ `)));
57
+
58
+ const libraryName = 'seller-base-service';
59
+ const libraryDirectory = 'dist';
60
+
61
+ module.exports = [
62
+ 'import',
63
+ {
64
+ libraryName,
65
+ libraryDirectory,
66
+ style: false,
67
+ camel2DashComponentName: false,
68
+ // https://www.npmjs.com/package/babel-plugin-import#transformtodefaultimport
69
+ // Set this option to false if your module does not have a default export.
70
+ transformToDefaultImport: false,
71
+ customName: name => `${libraryName}/${libraryDirectory}/${moduleExportMap.get(name)}`,
72
+ },
73
+ 'seller-base-service'
74
+ ];
@@ -0,0 +1,189 @@
1
+ module.exports =
2
+ /******/ (function(modules) { // webpackBootstrap
3
+ /******/ // The module cache
4
+ /******/ var installedModules = {};
5
+ /******/
6
+ /******/ // The require function
7
+ /******/ function __webpack_require__(moduleId) {
8
+ /******/
9
+ /******/ // Check if module is in cache
10
+ /******/ if(installedModules[moduleId]) {
11
+ /******/ return installedModules[moduleId].exports;
12
+ /******/ }
13
+ /******/ // Create a new module (and put it into the cache)
14
+ /******/ var module = installedModules[moduleId] = {
15
+ /******/ i: moduleId,
16
+ /******/ l: false,
17
+ /******/ exports: {}
18
+ /******/ };
19
+ /******/
20
+ /******/ // Execute the module function
21
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22
+ /******/
23
+ /******/ // Flag the module as loaded
24
+ /******/ module.l = true;
25
+ /******/
26
+ /******/ // Return the exports of the module
27
+ /******/ return module.exports;
28
+ /******/ }
29
+ /******/
30
+ /******/
31
+ /******/ // expose the modules object (__webpack_modules__)
32
+ /******/ __webpack_require__.m = modules;
33
+ /******/
34
+ /******/ // expose the module cache
35
+ /******/ __webpack_require__.c = installedModules;
36
+ /******/
37
+ /******/ // define getter function for harmony exports
38
+ /******/ __webpack_require__.d = function(exports, name, getter) {
39
+ /******/ if(!__webpack_require__.o(exports, name)) {
40
+ /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
41
+ /******/ }
42
+ /******/ };
43
+ /******/
44
+ /******/ // define __esModule on exports
45
+ /******/ __webpack_require__.r = function(exports) {
46
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
47
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
48
+ /******/ }
49
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
50
+ /******/ };
51
+ /******/
52
+ /******/ // create a fake namespace object
53
+ /******/ // mode & 1: value is a module id, require it
54
+ /******/ // mode & 2: merge all properties of value into the ns
55
+ /******/ // mode & 4: return value when already ns object
56
+ /******/ // mode & 8|1: behave like require
57
+ /******/ __webpack_require__.t = function(value, mode) {
58
+ /******/ if(mode & 1) value = __webpack_require__(value);
59
+ /******/ if(mode & 8) return value;
60
+ /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
61
+ /******/ var ns = Object.create(null);
62
+ /******/ __webpack_require__.r(ns);
63
+ /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
64
+ /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
65
+ /******/ return ns;
66
+ /******/ };
67
+ /******/
68
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
69
+ /******/ __webpack_require__.n = function(module) {
70
+ /******/ var getter = module && module.__esModule ?
71
+ /******/ function getDefault() { return module['default']; } :
72
+ /******/ function getModuleExports() { return module; };
73
+ /******/ __webpack_require__.d(getter, 'a', getter);
74
+ /******/ return getter;
75
+ /******/ };
76
+ /******/
77
+ /******/ // Object.prototype.hasOwnProperty.call
78
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
79
+ /******/
80
+ /******/ // __webpack_public_path__
81
+ /******/ __webpack_require__.p = "";
82
+ /******/
83
+ /******/
84
+ /******/ // Load entry module and return exports
85
+ /******/ return __webpack_require__(__webpack_require__.s = "I+kt");
86
+ /******/ })
87
+ /************************************************************************/
88
+ /******/ ({
89
+
90
+ /***/ "6Xvj":
91
+ /***/ (function(module, exports) {
92
+
93
+ module.exports = require("seller-base");
94
+
95
+ /***/ }),
96
+
97
+ /***/ "I+kt":
98
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
99
+
100
+ "use strict";
101
+ __webpack_require__.r(__webpack_exports__);
102
+
103
+ // EXTERNAL MODULE: external "seller-base"
104
+ var external_seller_base_ = __webpack_require__("6Xvj");
105
+
106
+ // CONCATENATED MODULE: ./src/modules/collection/constants.ts
107
+ const CollectionType = {
108
+ CUSTOMIZED: 'customized',
109
+ CATEGORY: 'category',
110
+ AUTOMATIC: 'automatic'
111
+ };
112
+ const CollectionStatus = {
113
+ DELETE: 'deleted',
114
+ ACTIVE: 'active',
115
+ INACTIVE: 'inactive'
116
+ };
117
+ // CONCATENATED MODULE: ./src/modules/collection/service.ts
118
+
119
+
120
+ class service_CollectionService extends external_seller_base_["ServiceModule"] {
121
+ constructor(service) {
122
+ super(service);
123
+ this.name = 'collection';
124
+ service_CollectionService.$instance = this;
125
+ }
126
+
127
+ getPageActiveCollections(params) {
128
+ return this.api.v3Request.get('/category/page_active_collection_list/', {
129
+ params: external_seller_base_["Service"].Utility.snakeCaseKeys(params)
130
+ });
131
+ }
132
+
133
+ getCollectionList(keyword) {
134
+ let config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
135
+ return this.api.v3Request.get('/category/get_collection_list/', Object.assign({
136
+ params: keyword ? {
137
+ keyword
138
+ } : {}
139
+ }, config));
140
+ }
141
+
142
+ getCollectionByIdList(ids) {
143
+ let config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
144
+ return this.api.v3Request.get('/category/get_collection/', Object.assign({
145
+ params: external_seller_base_["Service"].Utility.snakeCaseKeys({
146
+ collectionIds: ids.join(',')
147
+ })
148
+ }, config));
149
+ }
150
+
151
+ updateCollections(collections) {
152
+ let config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
153
+ return this.api.v3Request.post('/category/update_collection/', collections, config);
154
+ }
155
+
156
+ updateAllCollections(collections) {
157
+ let config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
158
+ return this.api.v3Request.post('/category/update_all_collections/', collections, config);
159
+ }
160
+
161
+ }
162
+ service_CollectionService.Constants = {
163
+ CollectionStatus: CollectionStatus,
164
+ CollectionType: CollectionType
165
+ };
166
+ // EXTERNAL MODULE: ./src/modules/collection/types.ts
167
+ var types = __webpack_require__("O28r");
168
+
169
+ // CONCATENATED MODULE: ./src/modules/collection/index.ts
170
+ /* concated harmony reexport CollectionService */__webpack_require__.d(__webpack_exports__, "CollectionService", function() { return service_CollectionService; });
171
+ /* concated harmony reexport Collection */__webpack_require__.d(__webpack_exports__, "Collection", function() { return types["Collection"]; });
172
+ /* concated harmony reexport PageActiveCollectionsParams */__webpack_require__.d(__webpack_exports__, "PageActiveCollectionsParams", function() { return types["PageActiveCollectionsParams"]; });
173
+ /* concated harmony reexport PageActiveCollectionsResponse */__webpack_require__.d(__webpack_exports__, "PageActiveCollectionsResponse", function() { return types["PageActiveCollectionsResponse"]; });
174
+ /* concated harmony reexport CollectionListResponse */__webpack_require__.d(__webpack_exports__, "CollectionListResponse", function() { return types["CollectionListResponse"]; });
175
+ /* concated harmony reexport CollectionUpdateData */__webpack_require__.d(__webpack_exports__, "CollectionUpdateData", function() { return types["CollectionUpdateData"]; });
176
+
177
+
178
+
179
+ /***/ }),
180
+
181
+ /***/ "O28r":
182
+ /***/ (function(module, exports) {
183
+
184
+
185
+
186
+ /***/ })
187
+
188
+ /******/ });
189
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["webpack://SellerBaseService/webpack/bootstrap","webpack://SellerBaseService/external \"seller-base\"","webpack://SellerBaseService/./src/modules/collection/constants.ts","webpack://SellerBaseService/./src/modules/collection/service.ts","webpack://SellerBaseService/./src/modules/collection/index.ts"],"names":[],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA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,SAAT,CAAmB,GAAnB,CAAuB,2BAAvB,EAAoD,MAAM,CAAC,MAAP,CAAc;AACvE,YAAM,EAAE,gCAAO,CAAC,OAAR,CAAgB,aAAhB,CAA8B;AAAE,qBAAa,EAAE,GAAG,CAAC,IAAJ,CAAS,GAAT;AAAjB,OAA9B;AAD+D,KAAd,EAExD,MAFwD,CAApD,CAAP;AAGD;;AAEM,mBAAiB,CAAC,WAAD,EAAmE;AAAA,QAA7B,MAA6B,uEAAF,EAAE;AACzF,WAAO,KAAK,GAAL,CAAS,SAAT,CAAmB,IAAnB,CAAwB,8BAAxB,EAAwD,WAAxD,EAAqE,MAArE,CAAP;AACD;;AAEM,sBAAoB,CAAC,WAAD,EAAmE;AAAA,QAA7B,MAA6B,uEAAF,EAAE;AAC5F,WAAO,KAAK,GAAL,CAAS,SAAT,CAAmB,IAAnB,CAAwB,mCAAxB,EAA6D,WAA7D,EAA0E,MAA1E,CAAP;AACD;;AApCyD;AAG5C,sCAAY;AACxB,oCADwB;AAExB,gCAAc;AAFU,CAAZ,C;;;;;AClBhB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","file":"collection/index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"I+kt\");\n","module.exports = require(\"seller-base\");","export const CollectionType = {\n CUSTOMIZED: 'customized',\n CATEGORY: 'category',\n AUTOMATIC: 'automatic'\n};\n\nexport const CollectionStatus = {\n DELETE: 'deleted',\n ACTIVE: 'active',\n INACTIVE: 'inactive'\n};\n","import { Service, ServiceModule, APIPromise, APIExternalPromise, APIRequestConfig } from 'seller-base';\nimport {\n PageActiveCollectionsParams,\n PageActiveCollectionsResponse,\n CollectionListResponse,\n CollectionUpdateData\n} from './types';\nimport {\n CollectionStatus,\n CollectionType\n} from './constants';\nimport {\n BatchI\n} from '../common';\n\nexport default class CollectionService extends ServiceModule {\n public static $instance: CollectionService;\n\n public static Constants = {\n CollectionStatus,\n CollectionType\n };\n\n constructor(service: Service) {\n super(service);\n this.name = 'collection';\n CollectionService.$instance = this;\n }\n\n public getPageActiveCollections(params: PageActiveCollectionsParams): APIPromise<PageActiveCollectionsResponse> {\n return this.api.v3Request.get('/category/page_active_collection_list/', { params: Service.Utility.snakeCaseKeys(params) }) as APIExternalPromise<PageActiveCollectionsResponse>;\n }\n\n public getCollectionList(keyword?: string, config: APIRequestConfig = {}): APIPromise<CollectionListResponse> {\n return this.api.v3Request.get('/category/get_collection_list/', Object.assign({\n params: keyword ? { keyword } : {}\n }, config)) as APIExternalPromise<CollectionListResponse>;\n }\n\n public getCollectionByIdList(ids: number[], config: APIRequestConfig = {}): APIPromise<CollectionListResponse> {\n return this.api.v3Request.get('/category/get_collection/', Object.assign({\n params: Service.Utility.snakeCaseKeys({ collectionIds: ids.join(',') })\n }, config)) as APIExternalPromise<CollectionListResponse>;\n }\n\n public updateCollections(collections: CollectionUpdateData[], config: APIRequestConfig = {}): APIPromise<BatchI> {\n return this.api.v3Request.post('/category/update_collection/', collections, config) as APIExternalPromise<BatchI>;\n }\n\n public updateAllCollections(collections: CollectionUpdateData[], config: APIRequestConfig = {}): APIPromise<BatchI> {\n return this.api.v3Request.post('/category/update_all_collections/', collections, config) as APIExternalPromise<BatchI>;\n }\n}\n","export { default as CollectionService } from './service';\n\nexport {\n Collection,\n PageActiveCollectionsParams,\n PageActiveCollectionsResponse,\n CollectionListResponse,\n CollectionUpdateData\n} from './types';\n"],"sourceRoot":""}
@@ -0,0 +1,206 @@
1
+ module.exports =
2
+ /******/ (function(modules) { // webpackBootstrap
3
+ /******/ // The module cache
4
+ /******/ var installedModules = {};
5
+ /******/
6
+ /******/ // The require function
7
+ /******/ function __webpack_require__(moduleId) {
8
+ /******/
9
+ /******/ // Check if module is in cache
10
+ /******/ if(installedModules[moduleId]) {
11
+ /******/ return installedModules[moduleId].exports;
12
+ /******/ }
13
+ /******/ // Create a new module (and put it into the cache)
14
+ /******/ var module = installedModules[moduleId] = {
15
+ /******/ i: moduleId,
16
+ /******/ l: false,
17
+ /******/ exports: {}
18
+ /******/ };
19
+ /******/
20
+ /******/ // Execute the module function
21
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22
+ /******/
23
+ /******/ // Flag the module as loaded
24
+ /******/ module.l = true;
25
+ /******/
26
+ /******/ // Return the exports of the module
27
+ /******/ return module.exports;
28
+ /******/ }
29
+ /******/
30
+ /******/
31
+ /******/ // expose the modules object (__webpack_modules__)
32
+ /******/ __webpack_require__.m = modules;
33
+ /******/
34
+ /******/ // expose the module cache
35
+ /******/ __webpack_require__.c = installedModules;
36
+ /******/
37
+ /******/ // define getter function for harmony exports
38
+ /******/ __webpack_require__.d = function(exports, name, getter) {
39
+ /******/ if(!__webpack_require__.o(exports, name)) {
40
+ /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
41
+ /******/ }
42
+ /******/ };
43
+ /******/
44
+ /******/ // define __esModule on exports
45
+ /******/ __webpack_require__.r = function(exports) {
46
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
47
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
48
+ /******/ }
49
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
50
+ /******/ };
51
+ /******/
52
+ /******/ // create a fake namespace object
53
+ /******/ // mode & 1: value is a module id, require it
54
+ /******/ // mode & 2: merge all properties of value into the ns
55
+ /******/ // mode & 4: return value when already ns object
56
+ /******/ // mode & 8|1: behave like require
57
+ /******/ __webpack_require__.t = function(value, mode) {
58
+ /******/ if(mode & 1) value = __webpack_require__(value);
59
+ /******/ if(mode & 8) return value;
60
+ /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
61
+ /******/ var ns = Object.create(null);
62
+ /******/ __webpack_require__.r(ns);
63
+ /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
64
+ /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
65
+ /******/ return ns;
66
+ /******/ };
67
+ /******/
68
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
69
+ /******/ __webpack_require__.n = function(module) {
70
+ /******/ var getter = module && module.__esModule ?
71
+ /******/ function getDefault() { return module['default']; } :
72
+ /******/ function getModuleExports() { return module; };
73
+ /******/ __webpack_require__.d(getter, 'a', getter);
74
+ /******/ return getter;
75
+ /******/ };
76
+ /******/
77
+ /******/ // Object.prototype.hasOwnProperty.call
78
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
79
+ /******/
80
+ /******/ // __webpack_public_path__
81
+ /******/ __webpack_require__.p = "";
82
+ /******/
83
+ /******/
84
+ /******/ // Load entry module and return exports
85
+ /******/ return __webpack_require__(__webpack_require__.s = "pmiW");
86
+ /******/ })
87
+ /************************************************************************/
88
+ /******/ ({
89
+
90
+ /***/ "6Xvj":
91
+ /***/ (function(module, exports) {
92
+
93
+ module.exports = require("seller-base");
94
+
95
+ /***/ }),
96
+
97
+ /***/ "lQRP":
98
+ /***/ (function(module, exports) {
99
+
100
+
101
+
102
+ /***/ }),
103
+
104
+ /***/ "pmiW":
105
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
106
+
107
+ "use strict";
108
+ __webpack_require__.r(__webpack_exports__);
109
+
110
+ // EXTERNAL MODULE: external "seller-base"
111
+ var external_seller_base_ = __webpack_require__("6Xvj");
112
+
113
+ // CONCATENATED MODULE: ./src/modules/common/interceptors.ts
114
+
115
+ /**
116
+ * 根据 URL 参数设置 Sip 请求参数
117
+ */
118
+
119
+ function addSipParams(config) {
120
+ if (config.extra && config.extra.ignoreSip || config.params && config.params.sip_region) {
121
+ return config;
122
+ }
123
+
124
+ const {
125
+ sipRegion,
126
+ sipShopid
127
+ } = external_seller_base_["Service"].Utility.camelCaseKeys(external_seller_base_["Service"].Utility.parseQueryString(window.location.search.substr(1)));
128
+
129
+ if (sipRegion && sipShopid) {
130
+ const sipParams = external_seller_base_["Service"].Utility.snakeCaseKeys({
131
+ sipRegion,
132
+ sipShopid
133
+ });
134
+ config.params = config.params ? Object.assign({}, sipParams, config.params) : sipParams;
135
+ }
136
+
137
+ return config;
138
+ }
139
+ // CONCATENATED MODULE: ./src/modules/common/service.ts
140
+
141
+
142
+ /**
143
+ * CommonServiceWithSip 类不应该直接被实例化,应该被继承,用法和 ServiceModule 一致
144
+ */
145
+
146
+ class service_CommonServiceWithSip extends external_seller_base_["ServiceModule"] {
147
+ constructor(service) {
148
+ super(service);
149
+ this.api = {};
150
+ this.api.v1Request = this.request.create(Object.assign({
151
+ path: 'api/v1',
152
+ useUnpackData: false
153
+ }, external_seller_base_["Service"].Constants.APICommonCreatorConfig, {
154
+ config: Object.assign({
155
+ namespace: external_seller_base_["Service"].Constants.APICommonNamespace.v2Request
156
+ }, external_seller_base_["Service"].Constants.APICommonRequestConfig)
157
+ }));
158
+ this.api.v1Request.interceptors.request.use(addSipParams);
159
+ this.api.v2Request = this.request.create(Object.assign({
160
+ path: 'api/v2',
161
+ useUnpackData: false
162
+ }, external_seller_base_["Service"].Constants.APICommonCreatorConfig, {
163
+ config: Object.assign({
164
+ namespace: external_seller_base_["Service"].Constants.APICommonNamespace.v2Request
165
+ }, external_seller_base_["Service"].Constants.APICommonRequestConfig)
166
+ }));
167
+ this.api.v2Request.interceptors.request.use(addSipParams);
168
+ this.api.v3Request = this.request.create(Object.assign({
169
+ path: 'api/v3',
170
+ useUnpackData: true
171
+ }, external_seller_base_["Service"].Constants.APICommonCreatorConfig, {
172
+ config: {
173
+ namespace: external_seller_base_["Service"].Constants.APICommonNamespace.v3Request
174
+ }
175
+ }));
176
+ this.api.v3Request.interceptors.request.use(addSipParams);
177
+ this.api.sipRequest = this.request.create(Object.assign({
178
+ path: 'api/sip',
179
+ useUnpackData: false
180
+ }, external_seller_base_["Service"].Constants.APICommonCreatorConfig, {
181
+ config: {
182
+ namespace: service_CommonServiceWithSip.Constants.APISipNamespace
183
+ }
184
+ }));
185
+ }
186
+
187
+ }
188
+ service_CommonServiceWithSip.Constants = {
189
+ APISipNamespace: 'sipRequest'
190
+ };
191
+ // EXTERNAL MODULE: ./src/modules/common/types.ts
192
+ var types = __webpack_require__("lQRP");
193
+
194
+ // CONCATENATED MODULE: ./src/modules/common/index.ts
195
+ /* concated harmony reexport CommonServiceWithSip */__webpack_require__.d(__webpack_exports__, "CommonServiceWithSip", function() { return service_CommonServiceWithSip; });
196
+ /* concated harmony reexport CommonWithSipRequestContainer */__webpack_require__.d(__webpack_exports__, "CommonWithSipRequestContainer", function() { return types["CommonWithSipRequestContainer"]; });
197
+ /* concated harmony reexport CommonListResponse */__webpack_require__.d(__webpack_exports__, "CommonListResponse", function() { return types["CommonListResponse"]; });
198
+ /* concated harmony reexport ErrorResponse */__webpack_require__.d(__webpack_exports__, "ErrorResponse", function() { return types["ErrorResponse"]; });
199
+ /* concated harmony reexport BatchI */__webpack_require__.d(__webpack_exports__, "BatchI", function() { return types["BatchI"]; });
200
+
201
+
202
+
203
+ /***/ })
204
+
205
+ /******/ });
206
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["webpack://SellerBaseService/webpack/bootstrap","webpack://SellerBaseService/external \"seller-base\"","webpack://SellerBaseService/./src/modules/common/interceptors.ts","webpack://SellerBaseService/./src/modules/common/service.ts","webpack://SellerBaseService/./src/modules/common/index.ts"],"names":[],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;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tC,gCAAO,CAAC,SAAR,CAAkB,sBAHoB,EAGI;AAC3C,YAAM,EAAE;AACN,iBAAS,EAAE,gCAAO,CAAC,SAAR,CAAkB,kBAAlB,CAAqC;AAD1C;AADmC,KAHJ,CAApB,CAArB;AAQA,SAAK,GAAL,CAAS,SAAT,CAAmB,YAAnB,CAAgC,OAAhC,CAAwC,GAAxC,CAA4C,YAA5C;AAEA,SAAK,GAAL,CAAS,UAAT,GAAsB,KAAK,OAAL,CAAa,MAAb,CAAoB,MAAM,CAAC,MAAP,CAAc;AACtD,UAAI,EAAE,SADgD;AAEtD,mBAAa,EAAE;AAFuC,KAAd,EAGvC,gCAAO,CAAC,SAAR,CAAkB,sBAHqB,EAGG;AAC3C,YAAM,EAAE;AACN,iBAAS,EAAE,4BAAoB,CAAC,SAArB,CAA+B;AADpC;AADmC,KAHH,CAApB,CAAtB;AAQD;;AAnD4D;AAI/C,yCAAY;AACxB,iBAAe,EAAE;AADO,CAAZ,C;;;;;ACXhB;AAAA;AAAA;AAAA;AAAA;AAAA","file":"common/index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"pmiW\");\n","module.exports = require(\"seller-base\");","import { APIRequestConfig, Service } from 'seller-base';\n\n/**\n * 根据 URL 参数设置 Sip 请求参数\n */\nexport function addSipParams(config: APIRequestConfig): APIRequestConfig {\n if ((config.extra && config.extra.ignoreSip) || (config.params && config.params.sip_region)) {\n return config;\n }\n const { sipRegion, sipShopid } = Service.Utility.camelCaseKeys(Service.Utility.parseQueryString(window.location.search.substr(1)));\n if (sipRegion && sipShopid) {\n const sipParams = Service.Utility.snakeCaseKeys({ sipRegion, sipShopid });\n config.params = config.params ? Object.assign({}, sipParams, config.params) : sipParams;\n }\n return config;\n}\n","import { Service, ServiceModule } from 'seller-base';\nimport { addSipParams } from './interceptors';\nimport { CommonWithSipRequestContainer } from './types';\n\n/**\n * CommonServiceWithSip 类不应该直接被实例化,应该被继承,用法和 ServiceModule 一致\n */\nexport default class CommonServiceWithSip extends ServiceModule {\n public static $instance: CommonServiceWithSip;\n public api: CommonWithSipRequestContainer;\n\n public static Constants = {\n APISipNamespace: 'sipRequest'\n };\n\n constructor(service: Service) {\n super(service);\n\n this.api = {} as CommonWithSipRequestContainer;\n\n this.api.v1Request = this.request.create(Object.assign({\n path: 'api/v1',\n useUnpackData: false\n }, Service.Constants.APICommonCreatorConfig, {\n config: Object.assign({\n namespace: Service.Constants.APICommonNamespace.v2Request\n }, Service.Constants.APICommonRequestConfig)\n }));\n this.api.v1Request.interceptors.request.use(addSipParams);\n\n this.api.v2Request = this.request.create(Object.assign({\n path: 'api/v2',\n useUnpackData: false\n }, Service.Constants.APICommonCreatorConfig, {\n config: Object.assign({\n namespace: Service.Constants.APICommonNamespace.v2Request\n }, Service.Constants.APICommonRequestConfig)\n }));\n this.api.v2Request.interceptors.request.use(addSipParams);\n\n this.api.v3Request = this.request.create(Object.assign({\n path: 'api/v3',\n useUnpackData: true\n }, Service.Constants.APICommonCreatorConfig, {\n config: {\n namespace: Service.Constants.APICommonNamespace.v3Request\n }\n }));\n this.api.v3Request.interceptors.request.use(addSipParams);\n\n this.api.sipRequest = this.request.create(Object.assign({\n path: 'api/sip',\n useUnpackData: false\n }, Service.Constants.APICommonCreatorConfig, {\n config: {\n namespace: CommonServiceWithSip.Constants.APISipNamespace\n }\n }));\n }\n}\n","export { default as CommonServiceWithSip } from './service';\nexport {\n CommonWithSipRequestContainer,\n CommonListResponse,\n ErrorResponse,\n BatchI\n} from './types';\n"],"sourceRoot":""}