seller-listing-service 0.0.1-security → 0.3.7-uat.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of seller-listing-service might be problematic. Click here for more details.
- package/LICENSE +21 -0
- package/README.md +79 -3
- package/dist/attribute/index.js +2693 -0
- package/dist/attribute/index.js.map +1 -0
- package/dist/babel-config-for-main-project.js +252 -0
- package/dist/cacheService/index.js +223 -0
- package/dist/cacheService/index.js.map +1 -0
- package/dist/category/index.js +661 -0
- package/dist/category/index.js.map +1 -0
- package/dist/common/index.js +1648 -0
- package/dist/common/index.js.map +1 -0
- package/dist/currency/index.js +233 -0
- package/dist/currency/index.js.map +1 -0
- package/dist/featureData/index.js +200 -0
- package/dist/featureData/index.js.map +1 -0
- package/dist/featureToggle/index.js +1497 -0
- package/dist/featureToggle/index.js.map +1 -0
- package/dist/index.d.ts +3643 -0
- package/dist/index.js +8488 -0
- package/dist/index.js.map +1 -0
- package/dist/logistics/index.js +443 -0
- package/dist/logistics/index.js.map +1 -0
- package/dist/merchant/index.js +374 -0
- package/dist/merchant/index.js.map +1 -0
- package/dist/product/index.js +3535 -0
- package/dist/product/index.js.map +1 -0
- package/dist/productSetting/index.js +268 -0
- package/dist/productSetting/index.js.map +1 -0
- package/dist/redteam.js +64 -0
- package/dist/upload/index.js +235 -0
- package/dist/upload/index.js.map +1 -0
- package/package.json +45 -3
- package/src/development/index.ts +21 -0
- package/src/index.ts +7 -0
- package/src/modules/attribute/index.ts +35 -0
- package/src/modules/attribute/lib/constants.ts +132 -0
- package/src/modules/attribute/lib/service.ts +1065 -0
- package/src/modules/attribute/lib/types.ts +225 -0
- package/src/modules/cacheService/index.ts +1 -0
- package/src/modules/cacheService/lib/service.ts +109 -0
- package/src/modules/category/index.ts +11 -0
- package/src/modules/category/lib/constants.ts +12 -0
- package/src/modules/category/lib/service.ts +411 -0
- package/src/modules/category/lib/types.ts +46 -0
- package/src/modules/common/downgrade/constants.ts +613 -0
- package/src/modules/common/downgrade/directives.ts +16 -0
- package/src/modules/common/downgrade/index.ts +9 -0
- package/src/modules/common/downgrade/service.ts +34 -0
- package/src/modules/common/downgrade/store.ts +102 -0
- package/src/modules/common/downgrade/types.ts +22 -0
- package/src/modules/common/downgrade/utils.ts +129 -0
- package/src/modules/common/index.ts +19 -0
- package/src/modules/common/listingService/index.ts +1 -0
- package/src/modules/common/listingService/lib/service.ts +228 -0
- package/src/modules/currency/index.ts +5 -0
- package/src/modules/currency/lib/service.ts +106 -0
- package/src/modules/currency/lib/types.ts +7 -0
- package/src/modules/featureData/index.ts +7 -0
- package/src/modules/featureData/lib/service.ts +62 -0
- package/src/modules/featureToggle/index.ts +15 -0
- package/src/modules/featureToggle/lib/mtskuProduct/service.ts +95 -0
- package/src/modules/featureToggle/lib/product/service.ts +67 -0
- package/src/modules/index.ts +12 -0
- package/src/modules/logistics/index.ts +8 -0
- package/src/modules/logistics/lib/constants.ts +12 -0
- package/src/modules/logistics/lib/service.ts +227 -0
- package/src/modules/logistics/lib/types.ts +85 -0
- package/src/modules/merchant/index.ts +18 -0
- package/src/modules/merchant/lib/constants.ts +31 -0
- package/src/modules/merchant/lib/service.ts +139 -0
- package/src/modules/merchant/lib/types.ts +57 -0
- package/src/modules/product/index.ts +132 -0
- package/src/modules/product/lib/constants.ts +236 -0
- package/src/modules/product/lib/detail/index.ts +530 -0
- package/src/modules/product/lib/detail/types.ts +469 -0
- package/src/modules/product/lib/list/index.ts +603 -0
- package/src/modules/product/lib/list/types.ts +488 -0
- package/src/modules/product/lib/service.ts +396 -0
- package/src/modules/product/lib/types.ts +291 -0
- package/src/modules/product/utils/hiddenFee.ts +14 -0
- package/src/modules/product/utils/index.ts +21 -0
- package/src/modules/product/utils/process.ts +57 -0
- package/src/modules/product/utils/productCache.ts +37 -0
- package/src/modules/product/utils/productFieldLock.ts +15 -0
- package/src/modules/product/utils/productStock.ts +45 -0
- package/src/modules/productSetting/constants.ts +6 -0
- package/src/modules/productSetting/index.ts +19 -0
- package/src/modules/productSetting/lib/service.ts +127 -0
- package/src/modules/productSetting/lib/types.ts +118 -0
- package/src/modules/upload/index.ts +9 -0
- package/src/modules/upload/lib/service.ts +106 -0
- package/src/modules/upload/lib/types.ts +45 -0
- package/src/utils/index.ts +127 -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,81 @@
|
|
1
|
-
#
|
1
|
+
# seller-listing-service
|
2
2
|
|
3
|
-
|
3
|
+
## dependences
|
4
|
+
- { Service } from 'seller-base'
|
4
5
|
|
5
|
-
|
6
|
+
## 安装
|
7
|
+
|
8
|
+
```bash
|
9
|
+
yarn add seller-listing-service
|
10
|
+
```
|
11
|
+
|
12
|
+
## 使用
|
13
|
+
Example:
|
14
|
+
```typescript
|
15
|
+
import { Service } from 'seller-base';
|
16
|
+
import { CategoryService } from 'seller-listing-service';
|
17
|
+
|
18
|
+
Service.$instance.createServiceModule<CategoryService>(CategoryService, 'module-name');
|
19
|
+
```
|
20
|
+
更多示例请参考 `src/development/index.ts`
|
21
|
+
|
22
|
+
### 按需引入
|
23
|
+
|
24
|
+
安装`babel-plugin-import`,在babel的plugin中加入这段配置
|
25
|
+
```js
|
26
|
+
[require('seller-listing-service/dist/babel-config-for-main-project')]
|
27
|
+
```
|
28
|
+
|
29
|
+
### Seller Center 按需引入
|
30
|
+
|
31
|
+
Seller Center 由于是多模块模式,因此需要使用的模块需要修改构建配置
|
32
|
+
|
33
|
+
```js
|
34
|
+
{
|
35
|
+
externals: [Object.assign(config.getExternalsConfig(), {
|
36
|
+
'seller-base': config.getExternalsConfig(['@/framework'])['@/framework']
|
37
|
+
})],
|
38
|
+
babelPlugin: config.mode === 'production' ? [require('seller-listing-service/dist/babel-config-for-main-project')] : []
|
39
|
+
}
|
40
|
+
```
|
41
|
+
|
42
|
+
## 注意
|
43
|
+
|
44
|
+
1. 不要修改删除.gitignore中已有部分
|
45
|
+
2. 不要在本项目`local.config.js`加入个人定制的开发环境代码
|
46
|
+
3. 开发一个模块MyService需要创建`src/modules/my-service/index.ts` 和 `src/modules/my-service/lib/service.ts`至少两个文件,`src/modules/my-service/index.ts`不能有默认导出。
|
47
|
+
4. 跨模块引入只能从其他模块入口`index.ts`,不能从其他模块的其他文件引入。
|
48
|
+
5. Constants 作为 MyService 的静态属性,不要额外导出。
|
49
|
+
6. `src/modules/index.ts`代码不能重命名导入。
|
50
|
+
|
51
|
+
## 开发
|
52
|
+
|
53
|
+
### 开发执行
|
54
|
+
|
55
|
+
1. CLI准备,参考CLI文档安装部分
|
56
|
+
2. 初始化项目(scc init -d)
|
57
|
+
3. yarn start
|
58
|
+
|
59
|
+
## 构建
|
60
|
+
|
61
|
+
### 构建执行
|
62
|
+
|
63
|
+
1. CLI准备,参考CLI文档安装部分
|
64
|
+
2. 初始化项目(scc init -b)
|
65
|
+
3. yarn build
|
66
|
+
|
67
|
+
## Change Logs
|
68
|
+
|
69
|
+
从`0.0.xx`升级到从`0.1.xx`版本,主要的变更如下:
|
70
|
+
|
71
|
+
- product/list
|
72
|
+
1. 重新定义`OriginListProduct`、`ListProduct`对象字段,具体可以参考新版本的字段定义(0.0.xx版本的部分字段已去掉)。
|
73
|
+
2. 去除`OriginProductItemModel`、`ProductItemModel`类型定义,使用`OriginListProductItemModel`、`ListProductItemModel`替代。
|
74
|
+
|
75
|
+
- product/detail
|
76
|
+
1. `getProductById`接口将返回`OriginProductDetail`对象(0.0.xx版本是`OriginProduct`),`computedProduct`接口将返回`ProductDetail`对象(0.0.xx版本是`Product`),返回的对象字段有变更,具体可以参考新版本的字段定义(0.0.xx版本的部分字段已去掉)。
|
77
|
+
2. `updateProducts`接口参数变更为`Array<Partial<ProductDetail>>`(0.0.xx版本是`Array<ProductUpdateData>`)。
|
78
|
+
|
79
|
+
- 其他
|
80
|
+
1. 去除`ProductHelpers`类型定义,使用`ProductHelpers`的接口参数均有变更,seller-listing-service不再支持外部传入user、shop字段。
|
81
|
+
2. 新增`ListingConfig`、`ProductConstraints`接口及类型定义。
|