warrior 8 часов назад
Родитель
Сommit
a9d1fa8d2f
42 измененных файлов с 668 добавлено и 7100 удалено
  1. 37 1
      api/routes.ts
  2. 1 0
      docs/task/20260226959.md
  3. 133 0
      modules/fmode-brightdata-server/build.sh
  4. 6 4
      modules/fmode-brightdata-server/package.json
  5. 1 0
      modules/fmode-brightdata-server/src/mod.ts
  6. 161 0
      modules/fmode-brightdata-server/upload.sh
  7. 4 0
      modules/fmode-tikhub-server/.gitignore
  8. 133 0
      modules/fmode-tikhub-server/build.sh
  9. 0 87
      modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/README.md
  10. 0 55
      modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/build.sh
  11. 0 11
      modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/deno.json
  12. 0 23
      modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/docs/202602005-task.md
  13. 0 25
      modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/docs/config.md
  14. 0 63
      modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/docs/local-debug.md
  15. 0 178
      modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/docs/task.md
  16. 0 3922
      modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/docs/亚马逊需要对接的接口.md
  17. 0 36
      modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/package.json
  18. 0 43
      modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/api/catalogItems.ts
  19. 0 97
      modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/api/customerFeedback.ts
  20. 0 31
      modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/api/externalFulfillment.ts
  21. 0 18
      modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/api/inventory.ts
  22. 0 57
      modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/api/listings.ts
  23. 0 40
      modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/api/notifications.ts
  24. 0 41
      modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/api/orders.ts
  25. 0 30
      modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/api/pricing.ts
  26. 0 40
      modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/api/reports.ts
  27. 0 18
      modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/api/sales.ts
  28. 0 27
      modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/api/sellers.ts
  29. 0 204
      modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/client.ts
  30. 0 33
      modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/dev-server.ts
  31. 0 79
      modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/marketplace-helper.ts
  32. 0 53
      modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/middleware/auth.ts
  33. 0 17
      modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/mod.ts
  34. 0 29
      modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/parse-init.ts
  35. 0 282
      modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/routes.ts
  36. 0 406
      modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/types.ts
  37. 0 67
      modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/test_auth.ts
  38. 19 1070
      modules/fmode-tikhub-server/package-lock.json
  39. 7 12
      modules/fmode-tikhub-server/package.json
  40. 3 0
      modules/fmode-tikhub-server/src/mod.ts
  41. 2 1
      modules/fmode-tikhub-server/src/routes.ts
  42. 161 0
      modules/fmode-tikhub-server/upload.sh

+ 37 - 1
api/routes.ts

@@ -66,6 +66,40 @@ router.use(
     apiKey: 'tKIbAsEM8X+GmE2vHqGW7D/ICwK1Q5V4viKFrWiPB6HholGdLFqZJmmyNw=='
   })
 );
+
+
+/* 已清洗的社媒接口 */
+let createTikHubCustomizeRoutes;
+try {
+  ({ createTikHubCustomizeRoutes } = await globalThis.loadModule(
+    'https://repos.fmode.cn/x/fmode-tikhub-api/0.0.2/fmode-tikhub-api-customize.min.js?code=xxxxxxx'
+  ));
+} catch (e) {
+  console.warn("[API Routes] CDN 加载失败, 使用本地模块回退", e);
+  ({ createTikHubCustomizeRoutes } = await import('../modules/fmode-tikhub-server/src/mod.ts'));
+}
+
+router.use(
+  '/tikhub/customize',
+  createTikHubCustomizeRoutes({
+    serverURL: 'https://api.tikhub.io/api/v1',
+    apiKey: 'tKIbAsEM8X+GmE2vHqGW7D/ICwK1Q5V4viKFrWiPB6HholGdLFqZJmmyNw=='
+  })
+);
+
+
+let createPinterestRouter;
+try {
+  ({ createPinterestRouter } = await globalThis.loadModule(
+    'https://repos.fmode.cn/x/fmode-brightdata-api/1.0.0/fmode-brightdata-api.min.js?code=xxxxxxx'
+  ));
+} catch (e) {
+  console.warn("[API Routes] CDN 加载失败, 使用本地模块回退", e);
+  ({ createPinterestRouter } = await import('../modules/fmode-brightdata-server/src/mod.ts'));
+}
+
+router.use('/pinterest', createPinterestRouter());
+
 router.get('/', (req, res) => {
   res.json({
     message: 'API Routes Loaded Successfully',
@@ -77,7 +111,9 @@ router.get('/', (req, res) => {
       '/api/sorftime',
       '/api/sorftime/test',
       '/api/tikhub',
-      '/api/tikhub/health'
+      '/api/tikhub/health',
+      '/api/pinterest',
+      '/api/pinterest/search'
     ]
   });
 });

+ 1 - 0
docs/task/20260226959.md

@@ -0,0 +1 @@
+- 请您参考modules\fmode-sorftime-api的模式,完成对modules\fmode-tikhub-server及fmode-brightdata-server的封装,最终需要通过build.sh打包,通过upload.sh发布上传,最终使用方法参考api\routes.ts

+ 133 - 0
modules/fmode-brightdata-server/build.sh

@@ -0,0 +1,133 @@
+#!/bin/bash
+
+###############################################################################
+# fmode-brightdata-api 构建脚本
+#
+# 功能:
+# 1. 使用esbuild打包所有ESM模块
+# 2. 使用terser进行代码混淆和压缩
+# 3. 生成可发布到npm或CDN的dist文件
+# 4. 支持Deno和Node.js环境
+#
+# 使用方法:
+#   chmod +x build.sh
+#   ./build.sh
+#
+# 输出:
+#   ./dist/{version}/fmode-brightdata-api.js      - 打包后的文件
+#   ./dist/{version}/fmode-brightdata-api.min.js  - 混淆压缩后的文件
+###############################################################################
+
+# 设置错误时退出
+set -e
+
+# 颜色输出
+GREEN='\033[0;32m'
+YELLOW='\033[1;33m'
+RED='\033[0;31m'
+NC='\033[0m' # No Color
+
+echo -e "${GREEN}==================================================${NC}"
+echo -e "${GREEN}   fmode-brightdata-api 构建脚本${NC}"
+echo -e "${GREEN}==================================================${NC}"
+
+# 检查是否在正确的目录
+if [ ! -f "package.json" ]; then
+    echo -e "${RED}错误: package.json 不存在${NC}"
+    echo -e "${YELLOW}请确保在 fmode-brightdata-api 目录下运行此脚本${NC}"
+    exit 1
+fi
+
+# 读取版本号
+VERSION=$(node -p "require('./package.json').version" 2>/dev/null || echo "1.0.0")
+if [ -z "$VERSION" ]; then
+    echo -e "${RED}错误: 无法从 package.json 读取版本号${NC}"
+    exit 1
+fi
+
+echo -e "${GREEN}版本号: ${VERSION}${NC}"
+
+# 创建dist/{version}目录
+DIST_DIR="dist/${VERSION}"
+echo -e "${YELLOW}[1/5] 创建 ${DIST_DIR} 目录...${NC}"
+rm -rf "${DIST_DIR}"
+mkdir -p "${DIST_DIR}"
+
+# 检查是否安装了依赖
+if [ ! -d "node_modules" ]; then
+    echo -e "${YELLOW}[2/5] 安装依赖...${NC}"
+    npm install
+else
+    echo -e "${GREEN}[2/5] 依赖已安装,跳过...${NC}"
+fi
+
+# 使用esbuild打包 esm
+echo -e "${YELLOW}[3/5] 使用esbuild打包 ESM 格式...${NC}"
+npx esbuild src/mod.ts \
+    --bundle \
+    --format=esm \
+    --platform=node \
+    --target=node16 \
+    --outfile="${DIST_DIR}/fmode-brightdata-api.js" \
+    --sourcemap \
+    --external:express
+
+if [ $? -eq 0 ]; then
+    echo -e "${GREEN}✓ ESM 打包成功${NC}"
+else
+    echo -e "${RED}✗ ESM 打包失败${NC}"
+    exit 1
+fi
+
+# 使用esbuild打包 cjs
+echo -e "${YELLOW}[3/5] 使用esbuild打包 CJS 格式...${NC}"
+npx esbuild src/mod.ts \
+    --bundle \
+    --format=cjs \
+    --platform=node \
+    --target=node16 \
+    --outfile="${DIST_DIR}/fmode-brightdata-api.cjs" \
+    --sourcemap \
+    --external:express
+
+if [ $? -eq 0 ]; then
+    echo -e "${GREEN}✓ CJS 打包成功${NC}"
+else
+    echo -e "${RED}✗ CJS 打包失败${NC}"
+    exit 1
+fi
+
+# 使用terser压缩和混淆 ESM
+if command -v terser &> /dev/null; then
+    echo -e "${YELLOW}[4/5] 使用terser压缩 ESM...${NC}"
+    terser "${DIST_DIR}/fmode-brightdata-api.js" \
+        --compress \
+        --mangle \
+        --output "${DIST_DIR}/fmode-brightdata-api.min.js" \
+        --source-map "content='${DIST_DIR}/fmode-brightdata-api.js.map',url='fmode-brightdata-api.min.js.map'"
+else
+    echo -e "${YELLOW}[4/5] terser 未安装,使用 esbuild --minify 代替...${NC}"
+    npx esbuild "${DIST_DIR}/fmode-brightdata-api.js" \
+        --minify \
+        --outfile="${DIST_DIR}/fmode-brightdata-api.min.js" \
+        --sourcemap
+fi
+
+# 使用terser压缩和混淆 CJS
+if command -v terser &> /dev/null; then
+    echo -e "${YELLOW}[4/5] 使用terser压缩 CJS...${NC}"
+    terser "${DIST_DIR}/fmode-brightdata-api.cjs" \
+        --compress \
+        --mangle \
+        --output "${DIST_DIR}/fmode-brightdata-api.min.cjs" \
+        --source-map "content='${DIST_DIR}/fmode-brightdata-api.cjs.map',url='fmode-brightdata-api.min.cjs.map'"
+else
+    echo -e "${YELLOW}[4/5] terser 未安装,使用 esbuild --minify 代替...${NC}"
+    npx esbuild "${DIST_DIR}/fmode-brightdata-api.cjs" \
+        --minify \
+        --outfile="${DIST_DIR}/fmode-brightdata-api.min.cjs" \
+        --sourcemap
+fi
+
+echo -e "${GREEN}[5/5] 构建完成!${NC}"
+echo -e "${GREEN}输出目录: ${DIST_DIR}${NC}"

+ 6 - 4
modules/fmode-brightdata-server/package.json

@@ -1,10 +1,12 @@
 {
-  "name": "@fmode/brightdata-server",
+  "name": "fmode-brightdata-api",
   "version": "1.0.0",
-  "description": "Pinterest API Server using Bright Data Web Scraper API",
-  "main": "src/index.ts",
-  "type": "module",
+  "description": "Pinterest API Module using Bright Data Web Scraper API for Node.js",
+  "main": "dist/mod.js",
+  "types": "dist/mod.d.ts",
   "scripts": {
+    "build": "bash build.sh",
+    "upload": "bash upload.sh",
     "test": "echo \"Error: no test specified\" && exit 1"
   },
   "dependencies": {

+ 1 - 0
modules/fmode-brightdata-server/src/mod.ts

@@ -0,0 +1 @@
+export * from './routes.ts';

+ 161 - 0
modules/fmode-brightdata-server/upload.sh

@@ -0,0 +1,161 @@
+#!/bin/bash
+
+###############################################################################
+# fmode-brightdata-api CDN上传脚本
+#
+# 功能:
+# 1. 上传打包后的文件到七牛云CDN
+# 2. 支持上传指定版本或最新版本
+#
+# 使用方法:
+#   chmod +x upload.sh
+#   ./upload.sh              # 上传最新版本
+#   ./upload.sh 1.0.0        # 上传指定版本
+#
+# 前置条件:
+#   需要安装并配置 qshell 工具
+#   参考: https://developer.qiniu.com/kodo/tools/1302/qshell
+###############################################################################
+
+# 设置错误时退出
+set -e
+
+# 颜色输出
+GREEN='\033[0;32m'
+YELLOW='\033[1;33m'
+RED='\033[0;31m'
+BLUE='\033[0;34m'
+NC='\033[0m' # No Color
+
+echo -e "${GREEN}==================================================${NC}"
+echo -e "${GREEN}   fmode-brightdata-api CDN上传脚本${NC}"
+echo -e "${GREEN}==================================================${NC}"
+
+# 检查qshell是否安装
+if ! command -v qshell &> /dev/null; then
+    echo -e "${RED}错误: qshell 未安装${NC}"
+    echo -e "${YELLOW}请先安装 qshell: https://developer.qiniu.com/kodo/tools/1302/qshell${NC}"
+    exit 1
+fi
+
+# 检查是否在正确的目录
+if [ ! -f "package.json" ]; then
+    echo -e "${RED}错误: package.json 不存在${NC}"
+    echo -e "${YELLOW}请确保在 fmode-brightdata-api 目录下运行此脚本${NC}"
+    exit 1
+fi
+
+# 获取版本号(从参数或package.json)
+if [ -n "$1" ]; then
+    VERSION="$1"
+    echo -e "${YELLOW}使用指定版本: ${VERSION}${NC}"
+else
+    VERSION=$(node -p "require('./package.json').version" 2>/dev/null || echo "1.0.0")
+    echo -e "${YELLOW}使用package.json版本: ${VERSION}${NC}"
+fi
+
+# 检查dist目录是否存在
+DIST_DIR="dist/${VERSION}"
+if [ ! -d "${DIST_DIR}" ]; then
+    echo -e "${RED}错误: ${DIST_DIR} 目录不存在${NC}"
+    echo -e "${YELLOW}请先运行 ./build.sh 构建项目${NC}"
+    exit 1
+fi
+
+# CDN配置
+BUCKET="nova-repos"
+CDN_PREFIX="x/fmode-brightdata-api/${VERSION}"
+
+echo ""
+echo -e "${BLUE}上传配置:${NC}"
+echo -e "  Bucket: ${BUCKET}"
+echo -e "  CDN路径: ${CDN_PREFIX}"
+echo -e "  本地目录: ${DIST_DIR}"
+echo ""
+
+# 确认上传
+read -p "确认上传到CDN?(y/N) " -n 1 -r
+echo
+if [[ ! $REPLY =~ ^[Yy]$ ]]; then
+    echo -e "${YELLOW}取消上传${NC}"
+    exit 0
+fi
+
+echo ""
+echo -e "${YELLOW}开始上传文件...${NC}"
+
+# 上传文件列表
+FILES=(
+    "fmode-brightdata-api.js"
+    "fmode-brightdata-api.js.map"
+    "fmode-brightdata-api.min.js"
+    "fmode-brightdata-api.min.js.map"
+    "fmode-brightdata-api.cjs"
+    "fmode-brightdata-api.cjs.map"
+    "fmode-brightdata-api.min.cjs"
+    "fmode-brightdata-api.min.cjs.map"
+)
+
+UPLOAD_COUNT=0
+FAILED_COUNT=0
+
+# 上传每个文件
+for FILE in "${FILES[@]}"; do
+    LOCAL_FILE="${DIST_DIR}/${FILE}"
+
+    if [ ! -f "${LOCAL_FILE}" ]; then
+        echo -e "${YELLOW}⊘ 跳过: ${FILE} (文件不存在)${NC}"
+        continue
+    fi
+
+    CDN_KEY="${CDN_PREFIX}/${FILE}"
+
+    echo -e "${BLUE}↑ 上传: ${FILE}${NC}"
+
+    if qshell rput "${BUCKET}" "${CDN_KEY}" "${LOCAL_FILE}" --overwrite; then
+        echo -e "${GREEN}✓ 成功: ${FILE}${NC}"
+        UPLOAD_COUNT=$((UPLOAD_COUNT + 1))
+    else
+        echo -e "${RED}✗ 失败: ${FILE}${NC}"
+        FAILED_COUNT=$((FAILED_COUNT + 1))
+    fi
+
+    echo ""
+done
+
+# 显示结果
+echo -e "${GREEN}==================================================${NC}"
+if [ $FAILED_COUNT -eq 0 ]; then
+    echo -e "${GREEN}   上传完成!${NC}"
+else
+    echo -e "${YELLOW}   上传完成(有${FAILED_COUNT}个文件失败)${NC}"
+fi
+echo -e "${GREEN}==================================================${NC}"
+echo ""
+echo -e "${BLUE}上传统计:${NC}"
+echo -e "  成功: ${UPLOAD_COUNT} 个文件"
+echo -e "  失败: ${FAILED_COUNT} 个文件"
+echo ""
+echo -e "${YELLOW}CDN访问地址:${NC}"
+echo -e "  ${GREEN}# ESM (生产环境)${NC}"
+echo -e "  https://repos.fmode.cn/${CDN_PREFIX}/fmode-brightdata-api.min.js"
+echo ""
+echo -e "  ${GREEN}# ESM (开发环境)${NC}"
+echo -e "  https://repos.fmode.cn/${CDN_PREFIX}/fmode-brightdata-api.js"
+echo ""
+echo -e "  ${GREEN}# CJS (生产环境)${NC}"
+echo -e "  https://repos.fmode.cn/${CDN_PREFIX}/fmode-brightdata-api.min.cjs"
+echo ""
+echo -e "${YELLOW}使用示例:${NC}"
+echo -e "  ${GREEN}# Deno / Node.js ESM${NC}"
+echo -e "  import { createPinterestRouter } from 'https://repos.fmode.cn/${CDN_PREFIX}/fmode-brightdata-api.min.js?code=xxxxxxx';"
+echo ""
+echo -e "  ${GREEN}# Node.js CJS${NC}"
+echo -e "  const { createPinterestRouter } = require('https://repos.fmode.cn/${CDN_PREFIX}/fmode-brightdata-api.min.cjs?code=xxxxxxx');"
+echo ""
+
+if [ $FAILED_COUNT -eq 0 ]; then
+    exit 0
+else
+    exit 1
+fi

+ 4 - 0
modules/fmode-tikhub-server/.gitignore

@@ -0,0 +1,4 @@
+.qshell_home/
+bin/
+dist/
+node_modules/

+ 133 - 0
modules/fmode-tikhub-server/build.sh

@@ -0,0 +1,133 @@
+#!/bin/bash
+
+###############################################################################
+# fmode-tikhub-api-customize 构建脚本
+#
+# 功能:
+# 1. 使用esbuild打包所有ESM模块
+# 2. 使用terser进行代码混淆和压缩
+# 3. 生成可发布到npm或CDN的dist文件
+# 4. 支持Deno和Node.js环境
+#
+# 使用方法:
+#   chmod +x build.sh
+#   ./build.sh
+#
+# 输出:
+#   ./dist/{version}/fmode-tikhub-api-customize.js      - 打包后的文件
+#   ./dist/{version}/fmode-tikhub-api-customize.min.js  - 混淆压缩后的文件
+###############################################################################
+
+# 设置错误时退出
+set -e
+
+# 颜色输出
+GREEN='\033[0;32m'
+YELLOW='\033[1;33m'
+RED='\033[0;31m'
+NC='\033[0m' # No Color
+
+echo -e "${GREEN}==================================================${NC}"
+echo -e "${GREEN}   fmode-tikhub-api-customize 构建脚本${NC}"
+echo -e "${GREEN}==================================================${NC}"
+
+# 检查是否在正确的目录
+if [ ! -f "package.json" ]; then
+    echo -e "${RED}错误: package.json 不存在${NC}"
+    echo -e "${YELLOW}请确保在 fmode-tikhub-api-customize 目录下运行此脚本${NC}"
+    exit 1
+fi
+
+# 读取版本号
+VERSION=$(node -p "require('./package.json').version" 2>/dev/null || echo "1.0.0")
+if [ -z "$VERSION" ]; then
+    echo -e "${RED}错误: 无法从 package.json 读取版本号${NC}"
+    exit 1
+fi
+
+echo -e "${GREEN}版本号: ${VERSION}${NC}"
+
+# 创建dist/{version}目录
+DIST_DIR="dist/${VERSION}"
+echo -e "${YELLOW}[1/5] 创建 ${DIST_DIR} 目录...${NC}"
+rm -rf "${DIST_DIR}"
+mkdir -p "${DIST_DIR}"
+
+# 检查是否安装了依赖
+if [ ! -d "node_modules" ]; then
+    echo -e "${YELLOW}[2/5] 安装依赖...${NC}"
+    npm install
+else
+    echo -e "${GREEN}[2/5] 依赖已安装,跳过...${NC}"
+fi
+
+# 使用esbuild打包 esm
+echo -e "${YELLOW}[3/5] 使用esbuild打包 ESM 格式...${NC}"
+npx esbuild src/mod.ts \
+    --bundle \
+    --format=esm \
+    --platform=node \
+    --target=node16 \
+    --outfile="${DIST_DIR}/fmode-tikhub-api-customize.js" \
+    --sourcemap \
+    --external:express
+
+if [ $? -eq 0 ]; then
+    echo -e "${GREEN}✓ ESM 打包成功${NC}"
+else
+    echo -e "${RED}✗ ESM 打包失败${NC}"
+    exit 1
+fi
+
+# 使用esbuild打包 cjs
+echo -e "${YELLOW}[3/5] 使用esbuild打包 CJS 格式...${NC}"
+npx esbuild src/mod.ts \
+    --bundle \
+    --format=cjs \
+    --platform=node \
+    --target=node16 \
+    --outfile="${DIST_DIR}/fmode-tikhub-api-customize.cjs" \
+    --sourcemap \
+    --external:express
+
+if [ $? -eq 0 ]; then
+    echo -e "${GREEN}✓ CJS 打包成功${NC}"
+else
+    echo -e "${RED}✗ CJS 打包失败${NC}"
+    exit 1
+fi
+
+# 使用terser压缩和混淆 ESM
+if command -v terser &> /dev/null; then
+    echo -e "${YELLOW}[4/5] 使用terser压缩 ESM...${NC}"
+    terser "${DIST_DIR}/fmode-tikhub-api-customize.js" \
+        --compress \
+        --mangle \
+        --output "${DIST_DIR}/fmode-tikhub-api-customize.min.js" \
+        --source-map "content='${DIST_DIR}/fmode-tikhub-api-customize.js.map',url='fmode-tikhub-api-customize.min.js.map'"
+else
+    echo -e "${YELLOW}[4/5] terser 未安装,使用 esbuild --minify 代替...${NC}"
+    npx esbuild "${DIST_DIR}/fmode-tikhub-api-customize.js" \
+        --minify \
+        --outfile="${DIST_DIR}/fmode-tikhub-api-customize.min.js" \
+        --sourcemap
+fi
+
+# 使用terser压缩和混淆 CJS
+if command -v terser &> /dev/null; then
+    echo -e "${YELLOW}[4/5] 使用terser压缩 CJS...${NC}"
+    terser "${DIST_DIR}/fmode-tikhub-api-customize.cjs" \
+        --compress \
+        --mangle \
+        --output "${DIST_DIR}/fmode-tikhub-api-customize.min.cjs" \
+        --source-map "content='${DIST_DIR}/fmode-tikhub-api-customize.cjs.map',url='fmode-tikhub-api-customize.min.cjs.map'"
+else
+    echo -e "${YELLOW}[4/5] terser 未安装,使用 esbuild --minify 代替...${NC}"
+    npx esbuild "${DIST_DIR}/fmode-tikhub-api-customize.cjs" \
+        --minify \
+        --outfile="${DIST_DIR}/fmode-tikhub-api-customize.min.cjs" \
+        --sourcemap
+fi
+
+echo -e "${GREEN}[5/5] 构建完成!${NC}"
+echo -e "${GREEN}输出目录: ${DIST_DIR}${NC}"

+ 0 - 87
modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/README.md

@@ -1,87 +0,0 @@
-# @fmode/amazon-sp-api
-
-Amazon Selling Partner API (SP-API) 集成模块,支持多店铺动态配置(基于 Parse Server)。
-
-## 功能特性
-
-- **多店铺支持**:基于 `Shop` 表(Parse Server)动态获取 SP-API 配置。
-- **动态路由**:请求头携带 `shopId` 和 `marketplaceId`,自动路由到正确的 API 端点和店铺配置。
-- **Token 管理**:自动处理 LWA Token 的获取、缓存(数据库持久化)和刷新。
-- **完整接口覆盖**:包括 Orders, Listings, Reports, Notifications, Catalog, Sales, Inventory, Pricing, ExternalFulfillment, CustomerFeedback。
-- **企业级特性**:请求重试(429 处理)、日志记录、类型安全。
-
-## 安装
-
-```bash
-npm install @fmode/amazon-sp-api
-```
-
-## 初始化
-
-在应用启动时,初始化 Parse 配置:
-
-```typescript
-import express from 'express';
-import { createSpApiRouter, initParse } from '@fmode/amazon-sp-api';
-
-const app = express();
-
-// 1. 初始化 Parse (连接到配置中心)
-initParse({
-  appId: 'msq-voc', // 或从环境变量读取
-  serverURL: 'https://server-msq.fmode.cn/parse',
-  // masterKey: 'YOUR_MASTER_KEY' // 如果需要 Server-to-Server 权限
-});
-
-// 2. 挂载 SP-API 路由
-// 注意:不再需要传入静态 client,模块会自动处理动态配置
-app.use('/api/amazon', createSpApiRouter());
-
-app.listen(3000, () => {
-  console.log('Server started on port 3000');
-});
-```
-
-## 请求示例
-
-前端或调用方需要在 Header 中携带 `shopId` 和 `marketplaceId`。
-
-### 获取订单列表
-
-```http
-GET /api/amazon/orders?CreatedAfter=2023-10-01T00:00:00Z
-Headers:
-  shopId: <PARSE_SHOP_OBJECT_ID>
-  marketplaceId: ATVPDKIKX0DER
-```
-
-### 响应格式
-
-```json
-{
-  "success": true,
-  "data": {
-    "payload": {
-      "Orders": [...]
-    }
-  },
-  "timestamp": "2023-10-27T10:00:00.000Z"
-}
-```
-
-## 数据库配置 (Parse Shop 表)
-
-在 Parse Dashboard 中,`Shop` 表需要包含以下字段:
-
-| Field | Type | Description |
-|Data Type| Field Name | Description |
-|---|---|---|
-| Object | `config` | 包含 SP-API 凭证: `{ "clientId": "...", "clientSecret": "...", "refreshToken": "..." }` |
-| String | `sp_api_access_token` | (自动维护) 当前有效的 Access Token |
-| Date | `sp_api_token_expires_at` | (自动维护) Token 过期时间 |
-
-## 错误处理
-
-- **400 Bad Request**: 缺少 `shopId` 头,或 `shopId` 无效,或 Shop 配置不完整。
-- **429 Too Many Requests**: 模块会自动重试(指数退避),如果重试多次仍失败,返回错误。
-- **500 Internal Server Error**: 服务器内部错误或 SP-API 异常。

+ 0 - 55
modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/build.sh

@@ -1,55 +0,0 @@
-#!/bin/bash
-
-###############################################################################
-# fmode-amazon-sp-api 构建脚本
-###############################################################################
-
-set -e
-
-GREEN='\033[0;32m'
-YELLOW='\033[1;33m'
-RED='\033[0;31m'
-NC='\033[0m'
-
-echo -e "${GREEN}Building fmode-amazon-sp-api...${NC}"
-
-if [ ! -f "package.json" ]; then
-    echo -e "${RED}Error: package.json not found${NC}"
-    exit 1
-fi
-
-VERSION=$(node -p "require('./package.json').version" 2>/dev/null || echo "1.0.0")
-DIST_DIR="dist/${VERSION}"
-
-echo -e "${YELLOW}Creating ${DIST_DIR}...${NC}"
-rm -rf "${DIST_DIR}"
-mkdir -p "${DIST_DIR}"
-
-if [ ! -d "node_modules" ]; then
-    echo -e "${YELLOW}Installing dependencies...${NC}"
-    npm install
-fi
-
-echo -e "${YELLOW}Bundling ESM...${NC}"
-npx esbuild src/mod.ts \
-    --bundle \
-    --format=esm \
-    --platform=node \
-    --target=node16 \
-    --outfile="${DIST_DIR}/fmode-amazon-sp-api.js" \
-    --sourcemap \
-    --external:express \
-    --external:axios
-
-echo -e "${YELLOW}Bundling CJS...${NC}"
-npx esbuild src/mod.ts \
-    --bundle \
-    --format=cjs \
-    --platform=node \
-    --target=node16 \
-    --outfile="${DIST_DIR}/fmode-amazon-sp-api.cjs" \
-    --sourcemap \
-    --external:express \
-    --external:axios
-
-echo -e "${GREEN}Build complete!${NC}"

+ 0 - 11
modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/deno.json

@@ -1,11 +0,0 @@
-{
-  "imports": {
-    "axios": "npm:axios@^1.6.0",
-    "express": "npm:express@4.21.2"
-  },
-  "compilerOptions": {
-    "allowJs": true,
-    "lib": ["deno.window"],
-    "strict": false
-  }
-}

+ 0 - 23
modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/docs/202602005-task.md

@@ -1,23 +0,0 @@
-## 任务 202602005
-#### 角色
-- 资深的node.js+ express.js + typescript + postgresql 开发人员,
-
-
-#### 任务描述
-- 我需要完成一个亚马逊多店铺的接口对接模块,每个店铺需要对接的接口的配置信息在数据库的shop 表的config字段中,目前fmode-amazon-sp-api 完成了接对接和鉴权相关功能,但是目前需要将配置信息通过parse查询配置信息,然后使用配置信息进行请求。
-- 1、现在fmode-amazon-sp-api模块完成了亚马逊官方文档的相关接口的对接,但是配置信息是写在代码中的,现在需要将配置信息通过Parse查询配置信息,
-- 2、在每个请求中,需要根据店铺的ID查询对应的配置信息,然后使用配置信息进行请求。所以请求头上需要添加一个shopId字段,用于标识当前请求的店铺ID,然后在路由中根据shopId查询对应的配置信息。
-- 3、如果请求头中没有添加shopId字段,或者添加了错误的shopId字段,需要返回400错误。
-- 4、需要在模块中加入parse 的初始化,对应配置信息放在config.json文件中,然后使用parse.initialize()方法进行初始化。appId: 'msq-voc',serverURL: 'https://server-msq.fmode.cn/parse',
-- 5、在通过请求亚马逊的接口时获取的临时token 需要保存在数据库中,需要添加一个字段,用于保存临时token,并添加一个字段,用于保存临时token的过期时间,需要和shopId关联起来,然后根据shopId查询对应的临时token和过期时间,如果过期了,需要重新获取。
-- 6、在client.ts 文件中baseUrl 是写在代码里面的现在需要从Marketplace获取endpoint字段,前端所有请求中都需要携带marketplaceId字段放在请求头中,然后根据marketplaceId查询对应的endpoint字段,然后替换baseUrl字段的值。
-
-
-#### 完成要求
-- 1、模块时一个拔插式的模块,它可以复用在其他的VOC系统,只是在启动时更换对应parse的appId和serverURL
-- 2、在modules\fmode-amazon-sp-api 目录下输出一个REDME.md文件,描述模块的功能和实现方式,并给出使用示例。
-
-
-
-
-

+ 0 - 25
modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/docs/config.md

@@ -1,25 +0,0 @@
-### 亚马逊配置信息
-- LWA凭证:amzn1.application-oa2-client.afc01e883d4143bcae466247ac5fe692
-
-- AK:AKIA6PQCIWKZRY53YSWS,SK:6pu3F5XX5tS9panWwiRhjTHsDFm1LFwLdVmQkpFv
-
-- arn: aws:iam::995363435187:user/moshengqi
-
-- Client ID:amzn1.application-oa2-client.afc01e883d4143bcae466247ac5fe692
-
-- Client Secret :amzn1.oa2-cs.v1.eb3330dce4b5c835b0d22e855c8db1082632b99ed7226db7114557b3c562d038
-
-
-- 墨西哥, 加拿大, 美国, 巴西 Refresh Token
-  - Refresh Token: Atzr|IwEBIC8ubYHG1E9Li2-_madN1smv4tKNgv9-SZTkW-OxlyeiXVQMbRon_7-ON9s2spa-fBsi6G1KXdk8eSO2SlyM-5BxMUufTTclXDCmDZWHg6wmi6HPwRceGDbWhqjIuPWseNj4uyBBjUcd9F6O_RYzEsu1yss67RcZikPI7t_i-tUhF5W8l2Ufj2Sl9JXGycxNoJKbZzApPVVLwja_JaiAlqhZX4JYM1gfK9dgynJNgcPhnVZRJ0vNOkurQPtSp6_Yix6itvMhN5QeXZwJdd5xW1T7C6TJXsHJLiEPfTeJIEj7m7UwgdDS7YvdryIL8cMl5Gc
-
-- 阿联酋, 德国, 沙特阿拉伯, 英国
-  - Refresh Token: Atzr|IwEBINGdC2C2UYyvQX2pCx_JwxmTFt8E2cB6-kaxktvIeVc5A2R34uQWFfbAKu-1oTD3LFeUAIaqOSG4H8843_5sDQLMO4Zw6T5a7Cbcbt9iALPOIl6McOyHWhr1aDxYZ4W1AcxOrLXoIhbOwSBijCm_IqRGdzHrhS6iyZV_RDDBdE5-wEDL3n7v8VrDcyQ1PWMktxe0VP6AR1UMCa2L1Bgw17iOE5jX0gW67BelEbAUbolwZbKavO-IfK-OlElR3WUL9FNDSTdpIXmy5DDLwgMHUuGjLE0n2FNnINn-1xOuQwSdMVEhSsPhjfL2JMvWjVTQRW0
-
-
-### 问题清单
-
-1、在gongzuo-server中完成了开发如何应用到 实际的应用中
-2、比如现在开发的fmode-amazon-sp-api模块,他是如何读取parse的配置的 
-3、不同应用之间可能数据清洗需要的结果不一致如何解决
-4、fmode/studio 中

+ 0 - 63
modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/docs/local-debug.md

@@ -1,63 +0,0 @@
-# 本地调试指南
-
-## 启动调试服务器
-
-我们提供了一个本地开发服务器 `src/dev-server.ts`,它会连接到 Parse Server 并使用真实的店铺认证流程。
-
-### 1. 启动 Parse Server (先决条件)
-
-确保你有一个正在运行的 Parse Server 实例,并且其中包含了有效的 `Shop` 数据。
-
-### 2. 启动 SP-API 开发服务器
-
-使用以下命令启动本地服务器,并配置 Parse 连接信息:
-
-**PowerShell:**
-
-```powershell
-$env:PARSE_APP_ID="你的AppId"
-$env:PARSE_SERVER_URL="http://localhost:1337/parse"
-$env:PARSE_MASTER_KEY="你的MasterKey"
-npm run dev
-```
-
-**Bash:**
-
-```bash
-PARSE_APP_ID="你的AppId" \
-PARSE_SERVER_URL="http://localhost:1337/parse" \
-PARSE_MASTER_KEY="你的MasterKey" \
-npm run dev
-```
-
-服务器默认运行在 `http://localhost:3333`。
-
-### 3. 测试接口
-
-由于使用了真实的认证中间件,你在请求时必须携带 `shop-objectid` 头部。
-
-**Curl 示例:**
-
-```bash
-curl -H "shop-objectid: YOUR_SHOP_OBJECT_ID" "http://localhost:3333/sp-api/orders?CreatedAfter=2023-10-01&marketplaceIds=ATVPDKIKX0DER"
-```
-
-**Postman 配置:**
-
-1.  Method: GET
-2.  URL: `http://localhost:3333/sp-api/orders`
-3.  Headers:
-    *   Key: `shop-objectid`
-    *   Value: `你的店铺在Parse中的ObjectId`
-4.  Query Params:
-    *   `marketplaceIds`: `ATVPDKIKX0DER`
-    *   `CreatedAfter`: `2023-10-01`
-
-## 原理说明
-
-`src/dev-server.ts` 现在会初始化 Parse SDK,并使用默认的 `shopAuthMiddleware`。
-当收到请求时,中间件会:
-1.  读取 `shop-objectid` 头部。
-2.  查询 Parse 数据库获取对应的 Shop 对象。
-3.  读取 Shop 对象中的配置 (ClientId, ClientSecret 等)。
-4.  如果配置有效,则发起 SP-API 请求。

+ 0 - 178
modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/docs/task.md

@@ -1,178 +0,0 @@
-# 任务:亚马逊 SP-API 模块开发
-
-## 任务概述
-
-开发 `fmode-amazon-sp-api` 模块,集成亚马逊 Selling Partner API (SP-API),首期对接客户反馈 (Customer Feedback) 相关接口。
-**注意:本模块采用 2023 年 10 月 2 日后的简化授权流程,无需 AWS IAM 配置,仅需 LWA Access Token。**
-
-## API 规格
-
-### Customer Feedback (客户反馈)
-
-- **API 名称**: `getItemReviewTopics`
-- **功能**: 检索某件商品的十个最正面和十个最负面的评论主题。
-- **API 地址**: `https://sellingpartnerapi-na.amazon.com/customerFeedback/2024-06-01/items/{asin}/reviews/topics`
-- **请求方法**: `GET`
-- **认证方式**: LWA (Login with Amazon) Access Token (无需 AWS Signature V4)
-- **参考文档**: `docs/亚马逊需要对接的接口.md`
-
-## 模块结构
-
-```
-modules/fmode-amazon-sp-api/
-├── src/
-│   ├── mod.ts           # 主模块导出
-│   ├── client.ts        # SP-API 基础客户端(处理 LWA 认证)
-│   ├── api/
-│   │   └── customerFeedback.ts # Customer Feedback API 实现
-│   ├── types.ts         # 类型定义
-│   └── routes.ts        # Express 路由定义
-├── docs/
-│   ├── task.md          # 任务文档
-│   ├── config.md        # 配置说明
-│   └── 亚马逊需要对接的接口.md # 需求文档
-├── deno.json            # Deno 配置
-├── package.json         # 包元数据
-└── README.md            # 项目文档
-```
-
-## 实现方案
-
-### 文件 1: src/types.ts - 类型定义
-
-定义 SP-API 配置接口、请求参数接口和响应数据接口。
-
-```typescript
-export interface SpApiConfig {
-  clientId: string;
-  clientSecret: string;
-  refreshToken: string;
-  region: string; // e.g., 'us-east-1'
-  sandbox?: boolean; // 可选:是否使用沙箱
-}
-
-export interface GetItemReviewTopicsParams {
-  asin: string;
-  itemName?: string;
-  marketplaceId: string;
-  countryCode?: string;
-  dateRange?: {
-    startDate: string;
-    endDate: string;
-  };
-}
-```
-
-### 文件 2: src/client.ts - 基础客户端
-
-实现 `SpApiClient` 类,封装 SP-API 通用逻辑:
-
-- **认证**: 实现 LWA (Login with Amazon) Token 获取与自动刷新机制。
-- **签名**: **无需 AWS Signature V4 签名**。
-- **请求**: 封装统一的 HTTP 请求方法,自动在 Header 中添加 `x-amz-access-token`。
-
-### 文件 3: src/api/customerFeedback.ts - 业务 API
-
-实现 `CustomerFeedbackApi` 类,继承或使用 `SpApiClient`:
-
-- `async getItemReviewTopics(params: GetItemReviewTopicsParams)`: 调用 `getItemReviewTopics` 接口。
-
-### 文件 4: src/routes.ts - Express 路由
-
-实现以下端点:
-
-| 方法 | 路径 | 描述 |
-|------|------|------|
-| GET | /customerFeedback/reviews/topics | 获取商品评论主题 |
-| GET | /health | 健康状态检查 |
-
-### 文件 5: src/mod.ts - 模块导出
-
-导出所有公共接口:
-- `SpApiClient` 类
-- `CustomerFeedbackApi` 类
-- `createSpApiRoutes` 函数
-- 类型定义
-
-## 配置文件
-
-- `package.json`: 依赖管理 (axios)
-- `deno.json`: Deno 兼容性配置
-
-## 集成步骤
-
-在 `api/routes.ts` 中添加:
-
-```typescript
-import { createSpApiRoutes } from "../modules/fmode-amazon-sp-api/src/mod.ts";
-
-const spApiConfig = {
-  clientId: process.env.SP_API_CLIENT_ID,
-  clientSecret: process.env.SP_API_CLIENT_SECRET,
-  refreshToken: process.env.SP_API_REFRESH_TOKEN,
-  region: "us-east-1"
-};
-
-router.use("/amazon-sp-api", createSpApiRoutes(spApiConfig));
-```
-
-## 测试方案
-
-### 1. 测试端点可用性
-
-```bash
-curl http://localhost:10003/api/amazon-sp-api/health
-```
-
-### 2. 测试获取评论主题
-
-```bash
-curl "http://localhost:10003/api/amazon-sp-api/customerFeedback/reviews/topics?asin=B0BT5K9B2T&marketplaceId=ATVPDKIKX0DER"
-```
-
-## 错误处理
-
-- **参数验证**: 验证 `asin` 和 `marketplaceId` 等必填参数。
-- **API 错误**: 捕获 SP-API 返回的错误 (如 403, 429),并转换为标准化错误响应。
-- **认证错误**: 处理 Token 过期情况。
-
-## 日志格式
-
-```
-[SP-API] Request: GET /customerFeedback/2024-06-01/items/B0BT5K9B2T/reviews/topics
-[SP-API] Params: {"marketplaceId": "ATVPDKIKX0DER"}
-[SP-API] Response: 200 OK
-```
-
-## 安全考虑
-
-- 敏感信息 (Client Secret) 必须通过环境变量或安全配置传递,禁止硬编码。
-- 确保 Access Token 不被泄露。
-- 遵循 Amazon 的数据保护政策 (DPP)。
-
-## 响应格式
-
-**成功响应**:
-```json
-{
-  "success": true,
-  "data": {
-    "asin": "B0BT5K9B2T",
-    "topics": {
-      "positiveTopics": [...],
-      "negativeTopics": [...]
-    }
-  }
-}
-```
-
-**错误响应**:
-```json
-{
-  "success": false,
-  "error": {
-    "code": "InvalidInput",
-    "message": "The ASIN is invalid."
-  }
-}
-```

+ 0 - 3922
modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/docs/亚马逊需要对接的接口.md

@@ -1,3922 +0,0 @@
-# 接口文档地址
-- https://developer-docs.amazon.com/sp-api/lang-zh_CN/reference/welcome-to-api-references
-
-## Customer Feedback【客户反馈】
-- 1. getItemReviewTopics【检索某件商品的十个最正面和十个最负面的评论主题。】
-  - 接口地址:https://sellingpartnerapi-na.amazon.com/customerFeedback/2024-06-01/items/{asin}/reviews/topics
-  - 请求方法:GET
-  ```json
-  {
-    "asin": "B0BT5K9B2T",
-    "itemName": "LANTEFUL 10 Tiers Tall Shoe Rack 20-25 Pairs Boots Organizer Storage Sturdy Narrow Shoe Shelf for Entryway Closets with Hooks Black",
-    "marketplaceId": "ATVPDKIKX0DER",
-    "countryCode": "US",
-    "dateRange": {
-      "startDate": "2024-03-22T08:35:43.717Z",
-      "endDate": "2024-09-22T08:35:43.717Z"
-    },
-    "topics": {
-      "positiveTopics": [
-        {
-          "topic": "Assembly/Installation",
-          "asinMetrics": {
-            "numberOfMentions": 36,
-            "occurrencePercentage": 17.31,
-            "starRatingImpact": 4
-          },
-          "parentAsinMetrics": {
-            "numberOfMentions": 107,
-            "occurrencePercentage": 18.01,
-            "starRatingImpact": 3
-          },
-          "browseNodeMetrics": {
-            "occurrencePercentage": {
-              "allProducts": 16.41
-            },
-            "starRatingImpact": {
-              "allProducts": 1.5
-            }
-          },
-          "childAsinMetrics": {
-            "mostMentions": {
-              "asin": "B08576RCY4",
-              "numberOfMentions": 36
-            },
-            "leastMentions": {
-              "asin": "B08576DCY4",
-              "numberOfMentions": 4
-            }
-          },
-          "reviewSnippets": [
-            "Easy installation!",
-            "Easy to install.",
-            "Easy to assemble"
-          ],
-          "subtopics": [
-            {
-              "subtopic": "Simple and easy to assemble",
-              "metrics": {
-                "numberOfMentions": 9,
-                "occurrencePercentage": 25.01
-              },
-              "reviewSnippets": [
-                "Easy installation!",
-                "Not difficult to assemble.",
-                "Easy to assemble"
-              ]
-            },
-            {
-              "subtopic": "easy to put together and quick",
-              "metrics": {
-                "numberOfMentions": 5,
-                "occurrencePercentage": 13.01
-              },
-              "reviewSnippets": [
-                "Easy to put together!!.",
-                "Putting the product togetherwas alot however this saved so much room in my closet",
-                "love that it came with the one little tool you needed to putit all together!"
-              ]
-            },
-            {
-              "subtopic": "quick and easy to install",
-              "metrics": {
-                "numberOfMentions": 3,
-                "occurrencePercentage": 9.01
-              },
-              "reviewSnippets": [
-                "Easy installation!",
-                "Easy to install.",
-                "install was straight forward."
-              ]
-            }
-          ]
-        },
-        {
-          "topic": "Strong",
-          "asinMetrics": {
-            "numberOfMentions": 36,
-            "occurrencePercentage": 17.31,
-            "starRatingImpact": 4.7
-          },
-          "parentAsinMetrics": {
-            "numberOfMentions": 107,
-            "occurrencePercentage": 18.01,
-            "starRatingImpact": 3.8
-          },
-          "browseNodeMetrics": {
-            "occurrencePercentage": {
-              "allProducts": 16.41
-            },
-            "starRatingImpact": {
-              "allProducts": 1.5
-            }
-          },
-          "childAsinMetrics": {
-            "mostMentions": {
-              "asin": "B08576RCY4",
-              "numberOfMentions": 36
-            },
-            "leastMentions": {
-              "asin": "B08576DCY4",
-              "numberOfMentions": 4
-            }
-          },
-          "reviewSnippets": [
-            "Sturdy and strong.",
-            "Fairly sturdy.",
-            "very sturdy"
-          ],
-          "subtopics": [
-            {
-              "subtopic": "sturdy and well built",
-              "metrics": {
-                "numberOfMentions": 9,
-                "occurrencePercentage": 25.01
-              },
-              "reviewSnippets": [
-                "very sturdy",
-                "Sturdiness is ok.",
-                "Sturdier than expected."
-              ]
-            },
-            {
-              "subtopic": "durable and sturdy",
-              "metrics": {
-                "numberOfMentions": 4,
-                "occurrencePercentage": 12.01
-              },
-              "reviewSnippets": [
-                "This IS sturdy.",
-                "Sturdiness construction.",
-                "it much sturdier than the other two brands that I have purchased."
-              ]
-            },
-            {
-              "subtopic": "strong and durable",
-              "metrics": {
-                "numberOfMentions": 2,
-                "occurrencePercentage": 6.01
-              },
-              "reviewSnippets": [
-                "This IS sturdy.",
-                "Sturdiness construction.",
-                "it much sturdier than the other two brands that I have purchased."
-              ]
-            }
-          ]
-        }
-      ],
-      "negativeTopics": [
-        {
-          "topic": "Assembly/Installation",
-          "asinMetrics": {
-            "numberOfMentions": 36,
-            "occurrencePercentage": 17.31,
-            "starRatingImpact": -2.3
-          },
-          "parentAsinMetrics": {
-            "numberOfMentions": 107,
-            "occurrencePercentage": 18.01,
-            "starRatingImpact": -2.6
-          },
-          "browseNodeMetrics": {
-            "occurrencePercentage": {
-              "allProducts": 16.41
-            },
-            "starRatingImpact": {
-              "allProducts": -1.5
-            }
-          },
-          "childAsinMetrics": {
-            "mostMentions": {
-              "asin": "B08576RCY4",
-              "numberOfMentions": 36
-            },
-            "leastMentions": {
-              "asin": "B08576DCY4",
-              "numberOfMentions": 4
-            }
-          },
-          "reviewSnippets": [
-            "Difficult to assemble",
-            "Difficult to assemble",
-            "impossible to put together"
-          ],
-          "subtopics": [
-            {
-              "subtopic": "difficult to put together",
-              "metrics": {
-                "numberOfMentions": 9,
-                "occurrencePercentage": 25.01
-              },
-              "reviewSnippets": [
-                "impossible to put together",
-                "Had a little hard time putting together either."
-              ]
-            },
-            {
-              "subtopic": "hard to assemble",
-              "metrics": {
-                "numberOfMentions": 6,
-                "occurrencePercentage": 18.01
-              },
-              "reviewSnippets": [
-                "impossible to put together",
-                "Had a little hard time putting together either."
-              ]
-            }
-          ]
-        }
-      ]
-    }
-  }
-  ```
-
-- 2. getItemBrowseNode 【该API返回请求ASIN的关联浏览节点。浏览节点是浏览树中的一个位置,用于亚马逊零售网站上的导航、产品分类和网站内容。】
-  - 接口地址:https://sellingpartnerapi-na.amazon.com/customerFeedback/2024-06-01/items/{asin}/browseNode
-  - 请求方法:GET
-  ```json
-  {
-    "browseNodeId": "37584319",
-    "displayName": "Shoes & Jewelry"
-  }
-  ```
-
-- 3. getBrowseNodeReviewTopics 【检索浏览节点中十个最正面和十个最负面的评论主题。】
-  - 接口地址:https://sellingpartnerapi-na.amazon.com/customerFeedback/2024-06-01/browseNodes/{browseNodeId}/reviews/topics
-  - 请求方法:GET
-  ```json
-  {
-    "browseNodeId": "123456789",
-    "displayName": "Shoe rack",
-    "marketplaceId": "US",
-    "countryCode": "US",
-    "dateRange": {
-      "startDate": "2024-03-22T08:35:43.717Z",
-      "endDate": "2024-03-22T08:35:43.717Z"
-    },
-    "topics": {
-      "positiveTopics": [
-        {
-          "topic": "Assembly/Installation",
-          "browseNodeMetrics": {
-            "occurrencePercentage": {
-              "allProducts": 27.5,
-              "topTwentyFivePercentProducts": 13.5
-            },
-            "starRatingImpact": {
-              "topTwentyFivePercentProducts": 1.85,
-              "allProducts": 1.1
-            }
-          },
-          "reviewSnippets": [
-            "Easy installation!",
-            "Easy to install.",
-            "Easy to assemble"
-          ],
-          "subtopics": [
-            {
-              "subtopic": "Simple and easy to assemble",
-              "metrics": {
-                "occurrencePercentage": 45.47
-              },
-              "reviewSnippets": [
-                "Easy installation!",
-                "Not difficult to assemble.",
-                "Easy to assemble"
-              ]
-            },
-            {
-              "subtopic": "easy to put together and quick",
-              "metrics": {
-                "occurrencePercentage": 24.47
-              },
-              "reviewSnippets": [
-                "Easy to put together!!.",
-                "Putting the product togetherwas alot however this saved so much room in my closet",
-                "love that it came with the one little tool you needed to putit all together!"
-              ]
-            },
-            {
-              "subtopic": "quick and easy to install",
-              "metrics": {
-                "occurrencePercentage": 14.47
-              },
-              "reviewSnippets": [
-                "Easy installation!",
-                "Easy to install.",
-                "install was straight forward."
-              ]
-            }
-          ]
-        },
-        {
-          "topic": "Strong",
-          "browseNodeMetrics": {
-            "occurrencePercentage": {
-              "allProducts": 27.3,
-              "topTwentyFivePercentProducts": 13.5
-            },
-            "starRatingImpact": {
-              "topTwentyFivePercentProducts": 1.85,
-              "allProducts": 1.1
-            }
-          },
-          "reviewSnippets": [
-            "Sturdy and strong.",
-            "Fairly sturdy.",
-            "very sturdy"
-          ],
-          "subtopics": [
-            {
-              "subtopic": "sturdy and well built",
-              "metrics": {
-                "occurrencePercentage": 24.47
-              },
-              "reviewSnippets": [
-                "very sturdy",
-                "Sturdiness is ok.",
-                "Sturdier than expected."
-              ]
-            },
-            {
-              "subtopic": "durable and sturdy",
-              "metrics": {
-                "occurrencePercentage": 18.47
-              },
-              "reviewSnippets": [
-                "This IS sturdy.",
-                "Sturdiness construction.",
-                "it much sturdier than the other two brands that I have purchased."
-              ]
-            },
-            {
-              "subtopic": "strong and durable",
-              "metrics": {
-                "occurrencePercentage": 11.47
-              },
-              "reviewSnippets": [
-                "This IS sturdy.",
-                "Sturdiness construction.",
-                "it much sturdier than the other two brands that I have purchased."
-              ]
-            }
-          ]
-        }
-      ],
-      "negativeTopics": [
-        {
-          "topic": "Assembly/Installation",
-          "browseNodeMetrics": {
-            "occurrencePercentage": {
-              "allProducts": 22,
-              "topTwentyFivePercentProducts": 13.5
-            },
-            "starRatingImpact": {
-              "topTwentyFivePercentProducts": -1.85,
-              "allProducts": -1.1
-            }
-          },
-          "reviewSnippets": [
-            "Difficult to assemble",
-            "Difficult to assemble",
-            "impossible to put together"
-          ],
-          "subtopics": [
-            {
-              "subtopic": "difficult to put together",
-              "metrics": {
-                "occurrencePercentage": 24.47
-              },
-              "reviewSnippets": [
-                "impossible to put together",
-                "Had a little hard time putting together either."
-              ]
-            },
-            {
-              "subtopic": "hard to assemble",
-              "metrics": {
-                "occurrencePercentage": 21.47
-              },
-              "reviewSnippets": [
-                "impossible to put together",
-                "Had a little hard time putting together either."
-              ]
-            }
-          ]
-        }
-      ]
-    }
-  }
-  ```
-- 4. getItemReviewTrends 【检索过去六个月商品的正面和负面评价趋势。】
-  - 接口地址:https://sellingpartnerapi-na.amazon.com/customerFeedback/2024-06-01/items/{asin}/reviews/trends
-  - 请求方法:GET
-  ```json
-  {
-    "asin": "B0BN5K9B2T",
-    "itemName": "LANTEFUL 10 Tiers Tall Shoe Rack 20-25 Pairs Boots Organizer Storage Sturdy Narrow Shoe Shelf for Entryway Closets with Hooks Black",
-    "marketplaceId": "ATVPDKIKX0DER",
-    "countryCode": "US",
-    "dateRange": {
-      "startDate": "2024-03-22T08:35:43.717Z",
-      "endDate": "2024-03-22T08:35:43.717Z"
-    },
-    "reviewTrends": {
-      "positiveTopics": [
-        {
-          "topic": "Quality-Overall ",
-          "trendMetrics": [
-            {
-              "dateRange": {
-                "startDate": "2024-06-01T00:00:00.000Z",
-                "endDate": "2024-06-30T00:00:00.000Z"
-              },
-              "asinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "parentAsinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "allProducts": 13.6
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-05-01T00:00:00.000Z",
-                "endDate": "2024-05-30T00:00:00.000Z"
-              },
-              "asinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "parentAsinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "allProducts": 13.6
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-04-01T00:00:00.000Z",
-                "endDate": "2024-04-30T00:00:00.000Z"
-              },
-              "asinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "parentAsinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "allProducts": 13.6
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-03-01T00:00:00.000Z",
-                "endDate": "2024-03-30T00:00:00.000Z"
-              },
-              "asinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "parentAsinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "allProducts": 13.6
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-02-01T00:00:00.000Z",
-                "endDate": "2024-02-30T00:00:00.000Z"
-              },
-              "asinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "parentAsinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "allProducts": 13.6
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-01-01T00:00:00.000Z",
-                "endDate": "2024-01-30T00:00:00.000Z"
-              },
-              "asinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "parentAsinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "allProducts": 13.6
-                }
-              }
-            }
-          ]
-        },
-        {
-          "topic": "Assembly/Installation ",
-          "trendMetrics": [
-            {
-              "dateRange": {
-                "startDate": "2024-06-01T00:00:00.000Z",
-                "endDate": "2024-06-30T00:00:00.000Z"
-              },
-              "asinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "parentAsinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "allProducts": 13.6
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-05-01T00:00:00.000Z",
-                "endDate": "2024-05-30T00:00:00.000Z"
-              },
-              "asinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "parentAsinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "allProducts": 13.6
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-04-01T00:00:00.000Z",
-                "endDate": "2024-04-30T00:00:00.000Z"
-              },
-              "asinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "parentAsinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "allProducts": 13.6
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-03-01T00:00:00.000Z",
-                "endDate": "2024-03-30T00:00:00.000Z"
-              },
-              "asinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "parentAsinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "allProducts": 13.6
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-02-01T00:00:00.000Z",
-                "endDate": "2024-02-30T00:00:00.000Z"
-              },
-              "asinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "parentAsinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "allProducts": 13.6
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-01-01T00:00:00.000Z",
-                "endDate": "2024-01-30T00:00:00.000Z"
-              },
-              "asinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "parentAsinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "allProducts": 13.6
-                }
-              }
-            }
-          ]
-        }
-      ],
-      "negativeTopics": [
-        {
-          "topic": "Weak and fragile",
-          "trendMetrics": [
-            {
-              "dateRange": {
-                "startDate": "2024-06-01T00:00:00.000Z",
-                "endDate": "2024-06-30T00:00:00.000Z"
-              },
-              "asinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "parentAsinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "allProducts": 13.6
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-05-01T00:00:00.000Z",
-                "endDate": "2024-05-30T00:00:00.000Z"
-              },
-              "asinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "parentAsinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "allProducts": 13.6
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-04-01T00:00:00.000Z",
-                "endDate": "2024-04-30T00:00:00.000Z"
-              },
-              "asinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "parentAsinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "allProducts": 13.6
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-03-01T00:00:00.000Z",
-                "endDate": "2024-03-30T00:00:00.000Z"
-              },
-              "asinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "parentAsinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "allProducts": 13.6
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-02-01T00:00:00.000Z",
-                "endDate": "2024-02-30T00:00:00.000Z"
-              },
-              "asinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "parentAsinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "allProducts": 13.6
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-01-01T00:00:00.000Z",
-                "endDate": "2024-01-30T00:00:00.000Z"
-              },
-              "asinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "parentAsinMetrics": {
-                "occurrencePercentage": 27.58
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "allProducts": 13.6
-                }
-              }
-            }
-          ]
-        }
-      ]
-    }
-  }
-  ```
-
-- 5. getBrowseNodeReviewTrends 【检索过去六个月浏览节点的正面和负面评价趋势。】
-  - 接口地址:https://sellingpartnerapi-na.amazon.com/customerFeedback/2024-06-01/browseNodes/{browseNodeId}/reviews/trends
-  - 请求方法:GET
-  ```json
-  {
-    "browseNodeId": "123456789",
-    "displayName": "Shoe rack",
-    "marketplaceId": "ATVPDKIKX0DER",
-    "countryCode": "US",
-    "dateRange": {
-      "startDate": "2024-03-22T08:35:43.717Z",
-      "endDate": "2024-03-22T08:35:43.717Z"
-    },
-    "reviewTrends": {
-      "positiveTopics": [
-        {
-          "topic": "Quality-Overall ",
-          "trendMetrics": [
-            {
-              "dateRange": {
-                "startDate": "2024-06-01T00:00:00.000Z",
-                "endDate": "2024-06-30T00:00:00.000Z"
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "topTwentyFivePercentProducts": 27.58,
-                  "allProducts": 15.78
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-07-01T00:00:00.000Z",
-                "endDate": "2024-07-30T00:00:00.000Z"
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "topTwentyFivePercentProducts": 27.58,
-                  "allProducts": 15.78
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-08-01T00:00:00.000Z",
-                "endDate": "2024-08-30T00:00:00.000Z"
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "topTwentyFivePercentProducts": 27.58,
-                  "allProducts": 15.78
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-09-01T00:00:00.000Z",
-                "endDate": "2024-09-30T00:00:00.000Z"
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "topTwentyFivePercentProducts": 27.58,
-                  "allProducts": 15.78
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-10-01T00:00:00.000Z",
-                "endDate": "2024-10-30T00:00:00.000Z"
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "topTwentyFivePercentProducts": 27.58,
-                  "allProducts": 15.78
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-10-01T00:00:00.000Z",
-                "endDate": "2024-10-30T00:00:00.000Z"
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "topTwentyFivePercentProducts": 27.58,
-                  "allProducts": 15.78
-                }
-              }
-            }
-          ]
-        },
-        {
-          "topic": "Assembly/Installation ",
-          "trendMetrics": [
-            {
-              "dateRange": {
-                "startDate": "2024-06-01T00:00:00.000Z",
-                "endDate": "2024-06-30T00:00:00.000Z"
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "topTwentyFivePercentProducts": 27.58,
-                  "allProducts": 15.78
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-07-01T00:00:00.000Z",
-                "endDate": "2024-07-30T00:00:00.000Z"
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "topTwentyFivePercentProducts": 27.58,
-                  "allProducts": 15.78
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-08-01T00:00:00.000Z",
-                "endDate": "2024-08-30T00:00:00.000Z"
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "topTwentyFivePercentProducts": 27.58,
-                  "allProducts": 15.78
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-09-01T00:00:00.000Z",
-                "endDate": "2024-09-30T00:00:00.000Z"
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "topTwentyFivePercentProducts": 27.58,
-                  "allProducts": 15.78
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-10-01T00:00:00.000Z",
-                "endDate": "2024-10-30T00:00:00.000Z"
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "topTwentyFivePercentProducts": 27.58,
-                  "allProducts": 15.78
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-10-01T00:00:00.000Z",
-                "endDate": "2024-10-30T00:00:00.000Z"
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "topTwentyFivePercentProducts": 27.58,
-                  "allProducts": 15.78
-                }
-              }
-            }
-          ]
-        }
-      ],
-      "negativeTopics": [
-        {
-          "topic": "Weak fragile ",
-          "trendMetrics": [
-            {
-              "dateRange": {
-                "startDate": "2024-06-01T00:00:00.000Z",
-                "endDate": "2024-06-30T00:00:00.000Z"
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "topTwentyFivePercentProducts": 27.58,
-                  "allProducts": 15.78
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-07-01T00:00:00.000Z",
-                "endDate": "2024-07-30T00:00:00.000Z"
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "topTwentyFivePercentProducts": 27.58,
-                  "allProducts": 15.78
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-08-01T00:00:00.000Z",
-                "endDate": "2024-08-30T00:00:00.000Z"
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "topTwentyFivePercentProducts": 27.58,
-                  "allProducts": 15.78
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-09-01T00:00:00.000Z",
-                "endDate": "2024-09-30T00:00:00.000Z"
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "topTwentyFivePercentProducts": 27.58,
-                  "allProducts": 15.78
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-10-01T00:00:00.000Z",
-                "endDate": "2024-10-30T00:00:00.000Z"
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "topTwentyFivePercentProducts": 27.58,
-                  "allProducts": 15.78
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-10-01T00:00:00.000Z",
-                "endDate": "2024-10-30T00:00:00.000Z"
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "topTwentyFivePercentProducts": 27.58,
-                  "allProducts": 15.78
-                }
-              }
-            }
-          ]
-        },
-        {
-          "topic": "Value for Money ",
-          "trendMetrics": [
-            {
-              "dateRange": {
-                "startDate": "2024-06-01T00:00:00.000Z",
-                "endDate": "2024-06-30T00:00:00.000Z"
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "topTwentyFivePercentProducts": 27.58,
-                  "allProducts": 15.78
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-07-01T00:00:00.000Z",
-                "endDate": "2024-07-30T00:00:00.000Z"
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "topTwentyFivePercentProducts": 27.58,
-                  "allProducts": 15.78
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-08-01T00:00:00.000Z",
-                "endDate": "2024-08-30T00:00:00.000Z"
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "topTwentyFivePercentProducts": 27.58,
-                  "allProducts": 15.78
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-09-01T00:00:00.000Z",
-                "endDate": "2024-09-30T00:00:00.000Z"
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "topTwentyFivePercentProducts": 27.58,
-                  "allProducts": 15.78
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-10-01T00:00:00.000Z",
-                "endDate": "2024-10-30T00:00:00.000Z"
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "topTwentyFivePercentProducts": 27.58,
-                  "allProducts": 15.78
-                }
-              }
-            },
-            {
-              "dateRange": {
-                "startDate": "2024-10-01T00:00:00.000Z",
-                "endDate": "2024-10-30T00:00:00.000Z"
-              },
-              "browseNodeMetrics": {
-                "occurrencePercentage": {
-                  "topTwentyFivePercentProducts": 27.58,
-                  "allProducts": 15.78
-                }
-              }
-            }
-          ]
-        }
-      ]
-    }
-  }
-  ```
-
-- 6. getBrowseNodeReturnTopics 【检索客户在浏览节点退货时提到的主题。】
-  - 接口地址:https://sellingpartnerapi-na.amazon.com/customerFeedback/2024-06-01/browseNodes/{browseNodeId}/returns/topics
-  - 请求方法:GET
-  ```json
-  {
-    "browseNodeId": "123456789",
-    "displayName": "Shoe rack",
-    "marketplaceId": "ATVPDKIKX0DER",
-    "countryCode": "US",
-    "dateRange": {
-      "startDate": "2024-03-22T08:35:43.717Z",
-      "endDate": "2024-03-22T08:35:43.717Z"
-    },
-    "topics": [
-      {
-        "topic": "Weak fragile ",
-        "browseNodeMetrics": {
-          "occurrencePercentage": {
-            "allProducts": 27.5
-          }
-        }
-      },
-      {
-        "topic": "Assembly/Installation ",
-        "browseNodeMetrics": {
-          "occurrencePercentage": {
-            "allProducts": 23.5
-          }
-        }
-      },
-      {
-        "topic": "Quality-Overall ",
-        "browseNodeMetrics": {
-          "occurrencePercentage": {
-            "allProducts": 17.5
-          }
-        }
-      },
-      {
-        "topic": "Value for Money ",
-        "browseNodeMetrics": {
-          "occurrencePercentage": {
-            "allProducts": 10.5
-          }
-        }
-      },
-      {
-        "topic": "Storage Capacity ",
-        "browseNodeMetrics": {
-          "occurrencePercentage": {
-            "allProducts": 7.5
-          }
-        }
-      }
-    ]
-  }
-  ```
-
-- 7. getBrowseNodeReturnTrends 【检索客户在浏览节点退货时提到的话题趋势。】
-  - 接口地址:https://sellingpartnerapi-na.amazon.com/customerFeedback/2024-06-01/browseNodes/{browseNodeId}/returns/trends
-  - 请求方法:GET
-  ```json
-  {
-    "browseNodeId": "123456789",
-    "displayName": "Shoe rack",
-    "marketplaceId": "ATVPDKIKX0DER",
-    "countryCode": "US",
-    "dateRange": {
-      "startDate": "2024-03-22T08:35:43.717Z",
-      "endDate": "2024-03-22T08:35:43.717Z"
-    },
-    "returnTrends": [
-      {
-        "topic": "Weak fragile ",
-        "trendMetrics": [
-          {
-            "dateRange": {
-              "startDate": "2024-06-01T00:00:00.000Z",
-              "endDate": "2024-06-30T00:00:00.000Z"
-            },
-            "browseNodeMetrics": {
-              "occurrencePercentage": {
-                "allProducts": 27.54
-              }
-            }
-          },
-          {
-            "dateRange": {
-              "startDate": "2024-07-01T00:00:00.000Z",
-              "endDate": "2024-07-30T00:00:00.000Z"
-            },
-            "browseNodeMetrics": {
-              "occurrencePercentage": {
-                "allProducts": 27.54
-              }
-            }
-          },
-          {
-            "dateRange": {
-              "startDate": "2024-08-01T00:00:00.000Z",
-              "endDate": "2024-08-30T00:00:00.000Z"
-            },
-            "browseNodeMetrics": {
-              "occurrencePercentage": {
-                "allProducts": 27.54
-              }
-            }
-          },
-          {
-            "dateRange": {
-              "startDate": "2024-09-01T00:00:00.000Z",
-              "endDate": "2024-09-30T00:00:00.000Z"
-            },
-            "browseNodeMetrics": {
-              "occurrencePercentage": {
-                "allProducts": 27.54
-              }
-            }
-          },
-          {
-            "dateRange": {
-              "startDate": "2024-10-01T00:00:00.000Z",
-              "endDate": "2024-10-30T00:00:00.000Z"
-            },
-            "browseNodeMetrics": {
-              "occurrencePercentage": {
-                "allProducts": 27.54
-              }
-            }
-          },
-          {
-            "dateRange": {
-              "startDate": "2024-10-01T00:00:00.000Z",
-              "endDate": "2024-10-30T00:00:00.000Z"
-            },
-            "browseNodeMetrics": {
-              "occurrencePercentage": {
-                "allProducts": 27.54
-              }
-            }
-          }
-        ]
-      },
-      {
-        "topic": "Value for Money ",
-        "trendMetrics": [
-          {
-            "dateRange": {
-              "startDate": "2024-06-01T00:00:00.000Z",
-              "endDate": "2024-06-30T00:00:00.000Z"
-            },
-            "browseNodeMetrics": {
-              "occurrencePercentage": {
-                "allProducts": 27.54
-              }
-            }
-          },
-          {
-            "dateRange": {
-              "startDate": "2024-07-01T00:00:00.000Z",
-              "endDate": "2024-07-30T00:00:00.000Z"
-            },
-            "browseNodeMetrics": {
-              "occurrencePercentage": {
-                "allProducts": 27.54
-              }
-            }
-          },
-          {
-            "dateRange": {
-              "startDate": "2024-08-01T00:00:00.000Z",
-              "endDate": "2024-08-30T00:00:00.000Z"
-            },
-            "browseNodeMetrics": {
-              "occurrencePercentage": {
-                "allProducts": 27.54
-              }
-            }
-          },
-          {
-            "dateRange": {
-              "startDate": "2024-09-01T00:00:00.000Z",
-              "endDate": "2024-09-30T00:00:00.000Z"
-            },
-            "browseNodeMetrics": {
-              "occurrencePercentage": {
-                "allProducts": 27.54
-              }
-            }
-          },
-          {
-            "dateRange": {
-              "startDate": "2024-10-01T00:00:00.000Z",
-              "endDate": "2024-10-30T00:00:00.000Z"
-            },
-            "browseNodeMetrics": {
-              "occurrencePercentage": {
-                "allProducts": 27.54
-              }
-            }
-          },
-          {
-            "dateRange": {
-              "startDate": "2024-10-01T00:00:00.000Z",
-              "endDate": "2024-10-30T00:00:00.000Z"
-            },
-            "browseNodeMetrics": {
-              "occurrencePercentage": {
-                "allProducts": 27.54
-              }
-            }
-          }
-        ]
-      }
-    ]
-  }
-  ```
-
-
-## Order 【订单】
-- 1. getOrders 【获取订单列表】
-  - 接口地址:https://sellingpartnerapi-na.amazon.com/orders/v0/orders
-  - 请求方法:GET
-  ```json
-    {
-      "payload": {
-        "NextToken": "2YgYW55IGNhcm5hbCBwbGVhc3VyZS4",
-        "Orders": [
-          {
-            "AmazonOrderId": "902-3159896-1390916",
-            "PurchaseDate": "2017-01-20T19:49:35Z",
-            "LastUpdateDate": "2017-01-20T19:49:35Z",
-            "OrderStatus": "Pending",
-            "FulfillmentChannel": "MFN",
-            "NumberOfItemsShipped": 0,
-            "NumberOfItemsUnshipped": 0,
-            "PaymentMethod": "Other",
-            "PaymentMethodDetails": [
-              "CreditCard",
-              "GiftCertificate"
-            ],
-            "MarketplaceId": "ATVPDKIKX0DER",
-            "ShipmentServiceLevelCategory": "Standard",
-            "OrderType": "StandardOrder",
-            "EarliestShipDate": "2017-01-20T19:51:16Z",
-            "LatestShipDate": "2017-01-25T19:49:35Z",
-            "IsBusinessOrder": false,
-            "IsPrime": false,
-            "IsAccessPointOrder": false,
-            "IsGlobalExpressEnabled": false,
-            "IsPremiumOrder": false,
-            "IsSoldByAB": false,
-            "IsIBA": false,
-            "ShippingAddress": {
-              "Name": "Michigan address",
-              "AddressLine1": "1 Cross St.",
-              "City": "Canton",
-              "StateOrRegion": "MI",
-              "PostalCode": "48817",
-              "CountryCode": "US"
-            },
-            "BuyerInfo": {
-              "BuyerName": "John Doe",
-              "BuyerTaxInfo": {
-                "CompanyLegalName": "A Company Name"
-              },
-              "PurchaseOrderNumber": "1234567890123"
-            }
-          }
-        ]
-      }
-    }
-  ```
-
-
-  ## 销售
-  - 1. getOrderMetrics 【回报给定买方类型的给定区间内汇总订单指标】
-    - 接口地址:https://sellingpartnerapi-na.amazon.com/sales/v1/orderMetrics
-    - 请求方法:GET
-    ```json
-    {
-      "payload": [
-        {
-          "interval": "string",
-          "unitCount": 0,
-          "orderItemCount": 0,
-          "orderCount": 0,
-          "averageUnitPrice": {
-            "currencyCode": "string",
-            "amount": "string"
-          },
-          "totalSales": {
-            "currencyCode": "string",
-            "amount": "string"
-          }
-        }
-      ],
-      "errors": [
-        {
-          "code": "string",
-          "message": "string",
-          "details": "string"
-        }
-      ]
-    }
-    ```
-## Listings 【列表,搜索并返回卖方合作伙伴商品及其相关详情列表。】
-- 2. searchListingsItems 【列出所有列表项】
-  - 接口地址:https://sellingpartnerapi-na.amazon.com/listings/2021-08-01/items/{sellerId}
-  - 请求方法:GET
-  ```json
-  {
-    "numberOfResults": 3,
-    "pagination": {
-      "nextToken": "xsdflkj324lkjsdlkj3423klkjsdfkljlk2j34klj2l3k4jlksdjl234",
-      "previousToken": "ilkjsdflkj234lkjds234234lkjl234lksjdflkj234234lkjsfsdflkj333d"
-    },
-    "items": [
-      {
-        "sku": "GM-ZDPI-9B4E",
-        "summaries": [
-          {
-            "marketplaceId": "ATVPDKIKX0DER",
-            "asin": "B071VG5N9D",
-            "productType": "LUGGAGE",
-            "conditionType": "new_new",
-            "status": [
-              "BUYABLE"
-            ],
-            "itemName": "Hardside Carry-On Spinner Suitcase Luggage",
-            "createdDate": "2021-02-01T00:00:00Z",
-            "lastUpdatedDate": "2021-03-01T00:00:00Z",
-            "mainImage": {
-              "link": "https://www.example.com/luggage.png",
-              "height": 500,
-              "width": 500
-            }
-          }
-        ],
-        "attributes": {
-          "total_hdmi_ports": [
-            {
-              "value": 4,
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "resolution": [
-            {
-              "language_tag": "en_US",
-              "value": "4K",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "item_weight": [
-            {
-              "unit": "pounds",
-              "value": 107.6,
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "product_subcategory": [
-            {
-              "value": "50400120",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "bullet_point": [
-            {
-              "language_tag": "en_US",
-              "value": "SMART TV WITH UNIVERSAL GUIDE: Simple On-screen Guide is an easy way to find streaming content and live TV shows",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "100% COLOR VOLUME WITH QUANTUM DOTS: Powered by Quantum dots, Samsung’s 4K QLED TV offers over a billion shades of brilliant color and 100% color volume for exceptional depth of detail that can draw you in to the picture for the best 4K TV experience",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "QUANTUM PROCESSOR 4K: Intelligently powered processor instantly upscales content to 4K for sharp detail and refined color",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "QUANTUM HDR 4X: 4K depth of detail with high dynamic range powered by HDR10+ delivers the lightest to darkest colors, scene by scene, for amazing picture realism",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "AMBIENT MODE: Customizes and complements your living space by turning a blank screen of this big screen TV into enticing visuals including décor, info, photos and artwork",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "SMART TV FEATURES: OneRemote to control all compatible devices, Bixby voice command, on-screen universal guide, SmartThings to control compatible home appliances and devices, smart speaker expandability with Alexa and Google Assistant compatibility, and more",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "item_dimensions": [
-            {
-              "width": {
-                "unit": "inches",
-                "value": 72.4
-              },
-              "length": {
-                "unit": "inches",
-                "value": 2.4
-              },
-              "height": {
-                "unit": "inches",
-                "value": 41.4
-              },
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "brand": [
-            {
-              "language_tag": "en_US",
-              "value": "SAMSUNG",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "generic_keyword": [
-            {
-              "language_tag": "en_US",
-              "value": "oled 65 inch smart tv qled 75 inch tv 85 inch 4k tv smart tv 4k tv 65 inch qled 82 inch tv 8k tv oled 65 smart tv qled 65 inch 80 inch tv 4k 4k tv shield tv 2018",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "q9fn qled 2018 oled 4k 4k oled toshiba antenna dvd player outdoor tv kitchen tv fire tv firetv hdtv hd tv android shield tv gaming deals tv ears dvr speakers digital tv antenna tv android tv frame mount",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "4k hdr tv 70 tv shield tv 90 inch tv gaming tv 75 tv 65 inch 4k tv tv 65 inch smart tv 4k 65 inch 4k tv 65 inch 4k tv 4k tv uhd tv uhd tv 4k",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "smart tv 4k tv tv tv oled tv 65 inch smart tv 4k tv 65 inch smart tv shield tv 2018 tv 4k oled tv 65 4k tv 4k smart tv 4k hdr tv shield tv gaming tv 65 inch 4k tv tv 65 inch smart tv 4k 65 inch 4k tv 65 inch 4k tv 4k tv uhd tv uhd tv 4k",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "control_method": [
-            {
-              "value": "voice",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "item_package_dimensions": [
-            {
-              "length": {
-                "unit": "centimeters",
-                "value": 26.67
-              },
-              "width": {
-                "unit": "centimeters",
-                "value": 121.92
-              },
-              "height": {
-                "unit": "centimeters",
-                "value": 203.2
-              },
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "image_aspect_ratio": [
-            {
-              "language_tag": "en_US",
-              "value": "16:9",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "part_number": [
-            {
-              "value": "QN82Q60RAFXZA",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "includes_remote": [
-            {
-              "value": true,
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "style": [
-            {
-              "language_tag": "en_US",
-              "value": "TV only",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "item_type_name": [
-            {
-              "language_tag": "en_US",
-              "value": "TV",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "battery": [
-            {
-              "cell_composition": [
-                {
-                  "value": "alkaline"
-                }
-              ],
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "image_contrast_ratio": [
-            {
-              "language_tag": "en_US",
-              "value": "QLED 4K",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "manufacturer": [
-            {
-              "language_tag": "en_US",
-              "value": "Samsung",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "number_of_boxes": [
-            {
-              "value": 1,
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "total_usb_ports": [
-            {
-              "value": 2,
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "model_number": [
-            {
-              "value": "QN82Q60RAFXZA",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "supplier_declared_dg_hz_regulation": [
-            {
-              "value": "not_applicable",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "num_batteries": [
-            {
-              "quantity": 2,
-              "type": "aaa",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "california_proposition_65": [
-            {
-              "compliance_type": "on_product_combined_cancer_reproductive",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "compliance_type": "chemical",
-              "chemical_names": [
-                "di_2_ethylhexyl_phthalate_dehp"
-              ],
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "display": [
-            {
-              "resolution_maximum": [
-                {
-                  "unit": "pixels",
-                  "language_tag": "en_US",
-                  "value": "3840 x 2160"
-                }
-              ],
-              "size": [
-                {
-                  "unit": "inches",
-                  "value": 82
-                }
-              ],
-              "type": [
-                {
-                  "language_tag": "en_US",
-                  "value": "QLED"
-                }
-              ],
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "item_name": [
-            {
-              "language_tag": "en_US",
-              "value": "Samsung QN82Q60RAFXZA Flat 82-Inch QLED 4K Q60 Series (2019) Ultra HD Smart TV with HDR and Alexa Compatibility",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "list_price": [
-            {
-              "currency": "USD",
-              "value": 3799.99,
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "batteries_required": [
-            {
-              "value": false,
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "includes_rechargable_battery": [
-            {
-              "value": false,
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "product_site_launch_date": [
-            {
-              "value": "2019-03-11T08:00:01.000Z",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "product_category": [
-            {
-              "value": "50400100",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "batteries_included": [
-            {
-              "value": false,
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "connectivity_technology": [
-            {
-              "language_tag": "en_US",
-              "value": "Bluetooth",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "USB",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "Wireless",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "HDMI",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "included_components": [
-            {
-              "language_tag": "en_US",
-              "value": "QLED Standard Smart Remote",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "Power Cable",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "Stand",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "Samsung Smart Control",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "specification_met": [
-            {
-              "language_tag": "en_US",
-              "value": "",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "parental_control_technology": [
-            {
-              "value": "V-Chip",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "power_consumption": [
-            {
-              "unit": "watts",
-              "value": 120,
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "cpsia_cautionary_statement": [
-            {
-              "value": "no_warning_applicable",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "item_type_keyword": [
-            {
-              "value": "qled-televisions",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "number_of_items": [
-            {
-              "value": 1,
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "warranty_description": [
-            {
-              "language_tag": "en_US",
-              "value": "1 year manufacturer",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "max_resolution": [
-            {
-              "unit": "pixels",
-              "value": 8.3,
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "color": [
-            {
-              "language_tag": "en_US",
-              "value": "Black",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "screen_surface_description": [
-            {
-              "language_tag": "en_US",
-              "value": "Flat",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "item_package_weight": [
-            {
-              "unit": "kilograms",
-              "value": 62.142,
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "speaker_type": [
-            {
-              "language_tag": "en_US",
-              "value": "2CH",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "supported_internet_services": [
-            {
-              "language_tag": "en_US",
-              "value": "Amazon Instant Video",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "YouTube",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "Netflix",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "Hulu",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "Browser",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "tuner_technology": [
-            {
-              "language_tag": "en_US",
-              "value": "Analog Tuner",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "controller_type": [
-            {
-              "language_tag": "en_US",
-              "value": "SmartThings",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "Voice Control",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "special_feature": [
-            {
-              "language_tag": "en_US",
-              "value": "100% Color Volume with Quantum Dot; Quantum Processor 4K; Ambient Mode; Quantum HDR 4X; Real Game Enhancer",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "wireless_communication_technology": [
-            {
-              "language_tag": "en_US",
-              "value": "Wi-Fi::Wi-Fi Direct::Bluetooth",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "model_year": [
-            {
-              "value": 2019,
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "power_source_type": [
-            {
-              "language_tag": "en_US",
-              "value": "Corded Electric",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "street_date": [
-            {
-              "value": "2019-03-21T00:00:01Z",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "mounting_type": [
-            {
-              "language_tag": "en_US",
-              "value": "Table Mount",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "Wall Mount",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "refresh_rate": [
-            {
-              "unit": "hertz",
-              "language_tag": "en_US",
-              "value": "120",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ]
-        },
-        "offers": [
-          {
-            "marketplaceId": "ATVPDKIKX0DER",
-            "offerType": "B2C",
-            "price": {
-              "currencyCode": "USD",
-              "amount": "100.00"
-            }
-          }
-        ],
-        "fulfillmentAvailability": [
-          {
-            "fulfillmentChannelCode": "DEFAULT",
-            "quantity": 100
-          }
-        ],
-        "issues": [
-          {
-            "code": "90220",
-            "message": "'size' is required but not supplied.",
-            "severity": "ERROR",
-            "attributeNames": [
-              "size"
-            ],
-            "categories": [
-              "MISSING_ATTRIBUTE"
-            ]
-          },
-          {
-            "code": "18027",
-            "message": "We believe the main image has text, logo, graphic or watermark which is not permitted for this product type. Submit a compliant image to lift the suppression. Also refer to Product image requirements.",
-            "severity": "ERROR",
-            "categories": [
-              "INVALID_IMAGE"
-            ],
-            "enforcements": {
-              "actions": [
-                {
-                  "action": "SEARCH_SUPPRESSED"
-                }
-              ],
-              "exemption": {
-                "status": "EXEMPT_UNTIL_EXPIRY_DATE",
-                "expiryDate": "2025-05-28T00:36:48.914Z"
-              }
-            }
-          },
-          {
-            "code": "99300",
-            "message": "Product Detail Page Rules Violation (Inaccurate information on product detail page)",
-            "severity": "ERROR",
-            "categories": [],
-            "enforcements": {
-              "actions": [
-                {
-                  "action": "ATTRIBUTE_SUPPRESSED"
-                }
-              ],
-              "exemption": {
-                "status": "EXEMPT"
-              }
-            }
-          },
-          {
-            "code": "18155",
-            "message": "The 'minimum price' is greater than the selling price (excluding shipping) for the listing. Review and update your price and/or minimum price.",
-            "severity": "ERROR",
-            "categories": [
-              "INVALID_PRICE"
-            ],
-            "enforcements": {
-              "actions": [
-                {
-                  "action": "LISTING_SUPPRESSED"
-                }
-              ],
-              "exemption": {
-                "status": "NOT_EXEMPT"
-              }
-            }
-          },
-          {
-            "code": "18742",
-            "message": "Restricted Products Policy Violation",
-            "severity": "ERROR",
-            "categories": [],
-            "enforcements": {
-              "actions": [
-                {
-                  "action": "CATALOG_ITEM_REMOVED"
-                }
-              ],
-              "exemption": {
-                "status": "NOT_EXEMPT"
-              }
-            }
-          }
-        ]
-      }
-    ]
-  }
-  ```
-- 3. getListingsItem 【获取列表项详情】
-  - 接口地址: https://sellingpartnerapi-na.amazon.com/externalFulfillment/2024-09-11/returns
-  - 请求方法:get
-  ```json
-    {
-    "sku": "GM-ZDPI-9B4E",
-    "summaries": [
-      {
-        "marketplaceId": "ATVPDKIKX0DER",
-        "asin": "B071VG5N9D",
-        "productType": "LUGGAGE",
-        "conditionType": "new_new",
-        "status": [
-          "BUYABLE"
-        ],
-        "itemName": "Hardside Carry-On Spinner Suitcase Luggage",
-        "createdDate": "2021-02-01T00:00:00Z",
-        "lastUpdatedDate": "2021-03-01T00:00:00Z",
-        "mainImage": {
-          "link": "https://www.example.com/luggage.png",
-          "height": 500,
-          "width": 500
-        }
-      }
-    ],
-    "offers": [
-      {
-        "marketplaceId": "ATVPDKIKX0DER",
-        "offerType": "B2C",
-        "price": {
-          "currencyCode": "USD",
-          "amount": "100.00"
-        },
-        "audience": {
-          "value": "ALL",
-          "displayName": "Sell on Amazon"
-        }
-      }
-    ],
-    "fulfillmentAvailability": [
-      {
-        "fulfillmentChannelCode": "DEFAULT",
-        "quantity": 100
-      }
-    ],
-    "issues": [
-      {
-        "code": "90220",
-        "message": "'size' is required but not supplied.",
-        "severity": "ERROR",
-        "attributeNames": [
-          "size"
-        ],
-        "categories": [
-          "MISSING_ATTRIBUTE"
-        ]
-      },
-      {
-        "code": "18027",
-        "message": "We believe the main image has text, logo, graphic, or watermark that is not permitted for this product type. Submit a compliant image to lift the suppression. Also refer to Product image requirements.",
-        "severity": "ERROR",
-        "categories": [
-          "INVALID_IMAGE"
-        ],
-        "enforcements": {
-          "actions": [
-            {
-              "action": "SEARCH_SUPPRESSED"
-            }
-          ],
-          "exemption": {
-            "status": "EXEMPT_UNTIL_EXPIRY_DATE",
-            "expiryDate": "2025-05-28T00:36:48.914Z"
-          }
-        }
-      },
-      {
-        "code": "99300",
-        "message": "Product Detail Page Rules Violation (Inaccurate information on product detail page)",
-        "severity": "ERROR",
-        "categories": [],
-        "enforcements": {
-          "actions": [
-            {
-              "action": "ATTRIBUTE_SUPPRESSED"
-            }
-          ],
-          "exemption": {
-            "status": "EXEMPT"
-          }
-        }
-      },
-      {
-        "code": "18155",
-        "message": "The 'minimum price' is greater than the selling price (excluding shipping) for the listing. Review and update your price and/or minimum price.",
-        "severity": "ERROR",
-        "categories": [
-          "INVALID_PRICE"
-        ],
-        "enforcements": {
-          "actions": [
-            {
-              "action": "LISTING_SUPPRESSED"
-            }
-          ],
-          "exemption": {
-            "status": "NOT_EXEMPT"
-          }
-        }
-      },
-      {
-        "code": "18742",
-        "message": "Restricted Products Policy Violation",
-        "severity": "ERROR",
-        "categories": [],
-        "enforcements": {
-          "actions": [
-            {
-              "action": "CATALOG_ITEM_REMOVED"
-            }
-          ],
-          "exemption": {
-            "status": "NOT_EXEMPT"
-          }
-        }
-      }
-    ]
-  }
-  ```
-
-## External Fulfillment 【外部履行】
-- 1. listReturns 【退货列表】
-  - 接口地址:https://sellingpartnerapi-na.amazon.com/externalFulfillment/2024-09-11/returns
-  - 请求方法:GET
-  ```json
-  {
-    "nextToken": "eyJsYXN0VXBkYXRlZFRpbWVzdGFtcCI6eyJzIjpu",
-    "returns": [
-      {
-        "marketplaceChannelDetails": {
-          "channelSku": "SerialYT1",
-          "customerOrderId": "107-7727827-8514700",
-          "returnLocationId": "EDD5",
-          "shipmentId": "D39CwZpdj",
-          "marketplaceChannel": {
-            "marketplaceName": "AMAZON_IN",
-            "channelName": "FBA"
-          }
-        },
-        "otpDetails": {
-          "otp": "703669",
-          "validTill": 1612933142
-        },
-        "packageDeliveryMode": "WITH_OTP",
-        "creationDateTime": "2021-03-18T15:23:58Z",
-        "fulfillmentLocationId": "450a6661-1a97-4abd-99e4-45714bcf4439",
-        "id": "ee39cdd9-9caa-47b6-a5b1-7b6a1c6d43d1",
-        "lastUpdatedDateTime": "2021-03-18T20:13:08Z",
-        "merchantSku": "SerialYT1",
-        "numberOfUnits": 1,
-        "returnMetadata": {
-          "invoiceInformation": {
-            "id": "EDD5-101"
-          },
-          "returnReason": "Missed",
-          "rmaId": "Test",
-          "fulfillmentOrderId": "10d1db2e-a546-4d64-a5da-577d5bf9420d"
-        },
-        "returnShippingInfo": {
-          "forwardTrackingInfo": {
-            "carrierName": "ATS",
-            "trackingId": "156121269663"
-          }
-        },
-        "returnType": "CUSTOMER",
-        "status": "CARRIER_NOTIFIED_TO_PICK_UP_FROM_CUSTOMER"
-      },
-      {
-        "marketplaceChannelDetails": {
-          "channelSku": "FBA_PERF_BOOK",
-          "customerOrderId": "107-7727827-8514701",
-          "returnLocationId": "EDD5",
-          "shipmentId": "DXPQ1wCCZ",
-          "marketplaceChannel": {
-            "marketplaceName": "AMAZON_IN$",
-            "channelName": "FBA"
-          }
-        },
-        "otpDetails": {
-          "otp": "703669",
-          "validTill": 1612933142
-        },
-        "packageDeliveryMode": "WITH_OTP",
-        "creationDateTime": "2021-04-02T10:13:50Z",
-        "fulfillmentLocationId": "450a6661-1a97-4abd-99e4-45714bcf4439",
-        "id": "add6bfb3-8d15-4c79-8bcf-810fe12b163c",
-        "lastUpdatedDateTime": "2021-04-02T15:23:58Z",
-        "merchantSku": "FBA_PERF_BOOK",
-        "numberOfUnits": 1,
-        "returnMetadata": {
-          "invoiceInformation": {
-            "id": "EDD5-92"
-          },
-          "returnReason": "Missed",
-          "rmaId": "Test"
-        },
-        "returnShippingInfo": {
-          "forwardTrackingInfo": {
-            "carrierName": "ATS",
-            "trackingId": "151987126617"
-          },
-          "reverseTrackingInfo": {
-            "carrierName": "ATS",
-            "trackingId": "19124773658"
-          }
-        },
-        "returnType": "CUSTOMER",
-        "status": "CREATED"
-      }
-    ]
-  }
-  ```
-
-- 2. getReturn 【获取退货详情】
-  - 接口地址:https://sellingpartnerapi-na.amazon.com/externalFulfillment/2024-09-11/returns/{returnId}
-  - 请求方法:GET
-  ```json
-  {
-    "marketplaceChannelDetails": {
-      "channelSku": "SerialYT1",
-      "customerOrderId": "107-7727827-8514700",
-      "returnLocationId": "EDD5",
-      "shipmentId": "D39CwZpdj",
-      "marketplaceChannel": {
-        "marketplaceName": "AMAZON_IN$",
-        "channelName": "FBA"
-      }
-    },
-    "otpDetails": {
-      "otp": "703669",
-      "validTill": 1612933142
-    },
-    "packageDeliveryMode": "WITH_OTP",
-    "creationDateTime": "2021-05-08T01:23:33Z",
-    "fulfillmentLocationId": "450a6661-1a97-4abd-99e4-45714bcf4439",
-    "id": "ee39cdd9-9caa-47b6-a5b1-7b6a1c6d43d1",
-    "lastUpdatedDateTime": "2021-05-08T10:23:38Z",
-    "merchantSku": "SerialYT1",
-    "numberOfUnits": 1,
-    "returnMetadata": {
-      "invoiceInformation": {
-        "id": "EDD5-101"
-      },
-      "returnReason": "Missed",
-      "rmaId": "Test"
-    },
-    "returnShippingInfo": {
-      "forwardTrackingInfo": {
-        "carrierName": "ATS",
-        "trackingId": "156121269663"
-      },
-      "reverseTrackingInfo": {
-        "carrierName": "ATS",
-        "trackingId": "19124773658"
-      }
-    },
-    "returnType": "CUSTOMER",
-    "status": "CARRIER_NOTIFIED_TO_PICK_UP_FROM_CUSTOMER"
-  }
-  ```
-
-## Catalog Items 【类目】
-- 1. listCatalogCategories 【列表目录分类- 返回商品所属的父类别,基于指定的ASIN或SellerSKU。】
-  - 接口地址:https://sellingpartnerapi-na.amazon.com/catalog/v0/categories
-  - 请求方法:GET
-  ```json
-  {
-    "payload": [
-      {
-        "ProductCategoryId": "string",
-        "ProductCategoryName": "string",
-        "parent": {}
-      }
-    ],
-    "errors": [
-      {
-        "code": "string",
-        "message": "string",
-        "details": "string"
-      }
-    ]
-  }
-  ```
-- 2. searchCatalogItems 【搜索亚马逊目录商品及相关信息列表。您可以按标识符或关键词搜索。】
-  - 接口地址:https://sellingpartnerapi-na.amazon.com/catalog/2022-04-01/items
-  - 请求方法:GET
-  ```json
-  {
-    "numberOfResults": 1,
-    "pagination": {
-      "nextToken": "xsdflkj324lkjsdlkj3423klkjsdfkljlk2j34klj2l3k4jlksdjl234",
-      "previousToken": "ilkjsdflkj234lkjds234234lkjl234lksjdflkj234234lkjsfsdflkj333d"
-    },
-    "refinements": {
-      "brands": [
-        {
-          "numberOfResults": 1,
-          "brandName": "SAMSUNG"
-        }
-      ],
-      "classifications": [
-        {
-          "numberOfResults": 1,
-          "displayName": "Electronics",
-          "classificationId": "493964"
-        }
-      ]
-    },
-    "items": [
-      {
-        "asin": "B07N4M94X4",
-        "attributes": {
-          "total_hdmi_ports": [
-            {
-              "value": 4,
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "resolution": [
-            {
-              "language_tag": "en_US",
-              "value": "4K",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "item_weight": [
-            {
-              "unit": "pounds",
-              "value": 107.6,
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "product_subcategory": [
-            {
-              "value": "50400120",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "bullet_point": [
-            {
-              "language_tag": "en_US",
-              "value": "SMART TV WITH UNIVERSAL GUIDE: Simple on-screen Guide is an easy way to find streaming content and live TV shows",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "100% COLOR VOLUME WITH QUANTUM DOTS: Powered by Quantum dots, Samsung’s 4K QLED TV offers over a billion shades of brilliant color and 100% color volume for exceptional depth of detail that will draw you in to the picture for the best 4K TV experience",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "QUANTUM PROCESSOR 4K: Intelligently powered processor instantly upscales content to 4K for sharp detail and refined color",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "QUANTUM HDR 4X: 4K depth of detail with high dynamic range powered by HDR10+ delivers the lightest to darkest colors, scene by scene, for amazing picture realism",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "AMBIENT MODE: Customizes and complements your living space by turning a blank screen of this big screen TV into enticing visuals including décor, info, photos and artwork",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "SMART TV FEATURES: OneRemote to control all compatible devices, Bixby voice command, on-screen universal guide, SmartThings to control compatible home appliances and devices, smart speaker expandability with Alexa and Google Assistant compatibility, and more",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "item_dimensions": [
-            {
-              "width": {
-                "unit": "inches",
-                "value": 72.4
-              },
-              "length": {
-                "unit": "inches",
-                "value": 2.4
-              },
-              "height": {
-                "unit": "inches",
-                "value": 41.4
-              },
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "brand": [
-            {
-              "language_tag": "en_US",
-              "value": "SAMSUNG",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "control_method": [
-            {
-              "value": "voice",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "item_package_dimensions": [
-            {
-              "length": {
-                "unit": "centimeters",
-                "value": 26.67
-              },
-              "width": {
-                "unit": "centimeters",
-                "value": 121.92
-              },
-              "height": {
-                "unit": "centimeters",
-                "value": 203.2
-              },
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "image_aspect_ratio": [
-            {
-              "language_tag": "en_US",
-              "value": "16:9",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "part_number": [
-            {
-              "value": "QN82Q60RAFXZA",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "includes_remote": [
-            {
-              "value": true,
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "style": [
-            {
-              "language_tag": "en_US",
-              "value": "TV only",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "item_type_name": [
-            {
-              "language_tag": "en_US",
-              "value": "TV",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "battery": [
-            {
-              "cell_composition": [
-                {
-                  "value": "alkaline"
-                }
-              ],
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "image_contrast_ratio": [
-            {
-              "language_tag": "en_US",
-              "value": "QLED 4K",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "manufacturer": [
-            {
-              "language_tag": "en_US",
-              "value": "Samsung",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "number_of_boxes": [
-            {
-              "value": 1,
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "total_usb_ports": [
-            {
-              "value": 2,
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "model_number": [
-            {
-              "value": "QN82Q60RAFXZA",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "supplier_declared_dg_hz_regulation": [
-            {
-              "value": "not_applicable",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "num_batteries": [
-            {
-              "quantity": 2,
-              "type": "aaa",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "california_proposition_65": [
-            {
-              "compliance_type": "on_product_combined_cancer_reproductive",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "compliance_type": "chemical",
-              "chemical_names": [
-                "di_2_ethylhexyl_phthalate_dehp"
-              ],
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "display": [
-            {
-              "resolution_maximum": [
-                {
-                  "unit": "pixels",
-                  "language_tag": "en_US",
-                  "value": "3840 x 2160"
-                }
-              ],
-              "size": [
-                {
-                  "unit": "inches",
-                  "value": 82
-                }
-              ],
-              "type": [
-                {
-                  "language_tag": "en_US",
-                  "value": "QLED"
-                }
-              ],
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "item_name": [
-            {
-              "language_tag": "en_US",
-              "value": "Samsung QN82Q60RAFXZA Flat 82-Inch QLED 4K Q60 Series (2019) Ultra HD Smart TV with HDR and Alexa Compatibility",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "list_price": [
-            {
-              "currency": "USD",
-              "value": 3799.99,
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "batteries_required": [
-            {
-              "value": false,
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "includes_rechargable_battery": [
-            {
-              "value": false,
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "product_site_launch_date": [
-            {
-              "value": "2019-03-11T08:00:01.000Z",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "product_category": [
-            {
-              "value": "50400100",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "batteries_included": [
-            {
-              "value": false,
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "connectivity_technology": [
-            {
-              "language_tag": "en_US",
-              "value": "Bluetooth",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "USB",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "Wireless",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "HDMI",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "included_components": [
-            {
-              "language_tag": "en_US",
-              "value": "QLED Standard Smart Remote",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "Power Cable",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "Stand",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "Samsung Smart Control",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "specification_met": [
-            {
-              "language_tag": "en_US",
-              "value": "",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "parental_control_technology": [
-            {
-              "value": "V-Chip",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "power_consumption": [
-            {
-              "unit": "watts",
-              "value": 120,
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "cpsia_cautionary_statement": [
-            {
-              "value": "no_warning_applicable",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "item_type_keyword": [
-            {
-              "value": "qled-televisions",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "number_of_items": [
-            {
-              "value": 1,
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "warranty_description": [
-            {
-              "language_tag": "en_US",
-              "value": "1 year manufacturer",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "max_resolution": [
-            {
-              "unit": "pixels",
-              "value": 8.3,
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "color": [
-            {
-              "language_tag": "en_US",
-              "value": "Black",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "screen_surface_description": [
-            {
-              "language_tag": "en_US",
-              "value": "Flat",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "item_package_weight": [
-            {
-              "unit": "kilograms",
-              "value": 62.142,
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "speaker_type": [
-            {
-              "language_tag": "en_US",
-              "value": "2CH",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "supported_internet_services": [
-            {
-              "language_tag": "en_US",
-              "value": "Amazon Instant Video",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "YouTube",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "Netflix",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "Hulu",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "Browser",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "tuner_technology": [
-            {
-              "language_tag": "en_US",
-              "value": "Analog Tuner",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "controller_type": [
-            {
-              "language_tag": "en_US",
-              "value": "SmartThings",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "Voice Control",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "special_feature": [
-            {
-              "language_tag": "en_US",
-              "value": "100% Color Volume with Quantum Dot; Quantum Processor 4K; Ambient Mode; Quantum HDR 4X; Real Game Enhancer",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "wireless_communication_technology": [
-            {
-              "language_tag": "en_US",
-              "value": "Wi-Fi::Wi-Fi Direct::Bluetooth",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "model_year": [
-            {
-              "value": 2019,
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "power_source_type": [
-            {
-              "language_tag": "en_US",
-              "value": "Corded Electric",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "street_date": [
-            {
-              "value": "2019-03-21T00:00:01Z",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "mounting_type": [
-            {
-              "language_tag": "en_US",
-              "value": "Table Mount",
-              "marketplace_id": "ATVPDKIKX0DER"
-            },
-            {
-              "language_tag": "en_US",
-              "value": "Wall Mount",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ],
-          "refresh_rate": [
-            {
-              "unit": "hertz",
-              "language_tag": "en_US",
-              "value": "120",
-              "marketplace_id": "ATVPDKIKX0DER"
-            }
-          ]
-        },
-        "classifications": [
-          {
-            "marketplaceId": "ATVPDKIKX0DER",
-            "classifications": [
-              {
-                "displayName": "QLED TVs",
-                "classificationId": "21489946011",
-                "parent": {
-                  "displayName": "Televisions",
-                  "classificationId": "172659",
-                  "parent": {
-                    "displayName": "Television & Video",
-                    "classificationId": "1266092011",
-                    "parent": {
-                      "displayName": "Electronics",
-                      "classificationId": "172282"
-                    }
-                  }
-                }
-              }
-            ]
-          }
-        ],
-        "dimensions": [
-          {
-            "marketplaceId": "ATVPDKIKX0DER",
-            "item": {
-              "height": {
-                "unit": "inches",
-                "value": 41.4
-              },
-              "length": {
-                "unit": "inches",
-                "value": 2.4
-              },
-              "weight": {
-                "unit": "pounds",
-                "value": 107.6
-              },
-              "width": {
-                "unit": "inches",
-                "value": 72.4
-              }
-            },
-            "package": {
-              "height": {
-                "unit": "inches",
-                "value": 10.49999998929
-              },
-              "length": {
-                "unit": "inches",
-                "value": 79.9999999184
-              },
-              "weight": {
-                "unit": "kilograms",
-                "value": 62.142
-              },
-              "width": {
-                "unit": "inches",
-                "value": 47.99999995104
-              }
-            }
-          }
-        ],
-        "identifiers": [
-          {
-            "marketplaceId": "ATVPDKIKX0DER",
-            "identifiers": [
-              {
-                "identifier": "0887276302195",
-                "identifierType": "EAN"
-              },
-              {
-                "identifier": "00887276302195",
-                "identifierType": "GTIN"
-              },
-              {
-                "identifier": "887276302195",
-                "identifierType": "UPC"
-              }
-            ]
-          }
-        ],
-        "images": [
-          {
-            "marketplaceId": "ATVPDKIKX0DER",
-            "images": [
-              {
-                "variant": "MAIN",
-                "link": "https://m.media-amazon.com/images/I/91uohwV+k3L.jpg",
-                "height": 1707,
-                "width": 2560
-              },
-              {
-                "variant": "MAIN",
-                "link": "https://m.media-amazon.com/images/I/51DZzp3w3vL.jpg",
-                "height": 333,
-                "width": 500
-              },
-              {
-                "variant": "PT01",
-                "link": "https://m.media-amazon.com/images/I/81w2rTVShlL.jpg",
-                "height": 2560,
-                "width": 2560
-              },
-              {
-                "variant": "PT01",
-                "link": "https://m.media-amazon.com/images/I/41Px9eq9tkL.jpg",
-                "height": 500,
-                "width": 500
-              },
-              {
-                "variant": "PT02",
-                "link": "https://m.media-amazon.com/images/I/51NTNhdhPyL.jpg",
-                "height": 375,
-                "width": 500
-              },
-              {
-                "variant": "PT03",
-                "link": "https://m.media-amazon.com/images/I/51o4zpL+A3L.jpg",
-                "height": 375,
-                "width": 500
-              },
-              {
-                "variant": "PT04",
-                "link": "https://m.media-amazon.com/images/I/71ux2k9GAZL.jpg",
-                "height": 1000,
-                "width": 1000
-              },
-              {
-                "variant": "PT04",
-                "link": "https://m.media-amazon.com/images/I/61UUX63yw1L.jpg",
-                "height": 500,
-                "width": 500
-              },
-              {
-                "variant": "PT05",
-                "link": "https://m.media-amazon.com/images/I/61LwHkljX-L.jpg",
-                "height": 1000,
-                "width": 1000
-              },
-              {
-                "variant": "PT05",
-                "link": "https://m.media-amazon.com/images/I/51wJTQty3PL.jpg",
-                "height": 500,
-                "width": 500
-              },
-              {
-                "variant": "PT06",
-                "link": "https://m.media-amazon.com/images/I/61uvoB4VvoL.jpg",
-                "height": 1000,
-                "width": 1000
-              },
-              {
-                "variant": "PT06",
-                "link": "https://m.media-amazon.com/images/I/51ZexIO628L.jpg",
-                "height": 500,
-                "width": 500
-              },
-              {
-                "variant": "PT07",
-                "link": "https://m.media-amazon.com/images/I/7121MGd2ncL.jpg",
-                "height": 1000,
-                "width": 1000
-              },
-              {
-                "variant": "PT07",
-                "link": "https://m.media-amazon.com/images/I/61QK+JBMrGL.jpg",
-                "height": 500,
-                "width": 500
-              },
-              {
-                "variant": "PT08",
-                "link": "https://m.media-amazon.com/images/I/61ECcGlG4IL.jpg",
-                "height": 1080,
-                "width": 1920
-              },
-              {
-                "variant": "PT08",
-                "link": "https://m.media-amazon.com/images/I/31TxwfqvB5L.jpg",
-                "height": 281,
-                "width": 500
-              }
-            ]
-          }
-        ],
-        "productTypes": [
-          {
-            "marketplaceId": "ATVPDKIKX0DER",
-            "productType": "TELEVISION"
-          }
-        ],
-        "salesRanks": [
-          {
-            "marketplaceId": "ATVPDKIKX0DER",
-            "classificationRanks": [
-              {
-                "classificationId": "21489946011",
-                "title": "QLED TVs",
-                "link": "http://www.amazon.com/gp/bestsellers/electronics/21489946011",
-                "rank": 113
-              }
-            ],
-            "displayGroupRanks": [
-              {
-                "websiteDisplayGroup": "ce_display_on_website",
-                "title": "Electronics",
-                "link": "http://www.amazon.com/gp/bestsellers/electronics",
-                "rank": 72855
-              }
-            ]
-          }
-        ],
-        "summaries": [
-          {
-            "marketplaceId": "ATVPDKIKX0DER",
-            "brand": "SAMSUNG",
-            "browseClassification": {
-              "displayName": "QLED TVs",
-              "classificationId": "21489946011"
-            },
-            "color": "Black",
-            "itemClassification": "BASE_PRODUCT",
-            "itemName": "Samsung QN82Q60RAFXZA Flat 82-Inch QLED 4K Q60 Series (2019) Ultra HD Smart TV with HDR and Alexa Compatibility",
-            "manufacturer": "Samsung",
-            "modelNumber": "QN82Q60RAFXZA",
-            "packageQuantity": 1,
-            "partNumber": "QN82Q60RAFXZA",
-            "size": "82-Inch",
-            "style": "TV only",
-            "websiteDisplayGroup": "home_theater_display_on_website",
-            "websiteDisplayGroupName": "Home Theater"
-          }
-        ],
-        "relationships": [
-          {
-            "marketplaceId": "ATVPDKIKX0DER",
-            "relationships": [
-              {
-                "type": "VARIATION",
-                "parentAsins": [
-                  "B08J7TQ9FL"
-                ],
-                "variationTheme": {
-                  "attributes": [
-                    "color",
-                    "size"
-                  ],
-                  "theme": "SIZE_NAME/COLOR_NAME"
-                }
-              }
-            ]
-          }
-        ],
-        "vendorDetails": [
-          {
-            "marketplaceId": "ATVPDKIKX0DER",
-            "brandCode": "SAMF9",
-            "manufacturerCode": "SAMF9",
-            "manufacturerCodeParent": "SAMF9",
-            "productCategory": {
-              "displayName": "Televisions",
-              "value": "50400100"
-            },
-            "productGroup": "Home Entertainment",
-            "productSubcategory": {
-              "displayName": "Plasma TVs",
-              "value": "50400120"
-            },
-            "replenishmentCategory": "OBSOLETE"
-          }
-        ]
-      }
-    ]
-  }
-  ```
-- 3. getCatalogItem 【获取类目信息】
-  - 接口地址:https://sellingpartnerapi-na.amazon.com/catalog/2022-04-01/items/{asin}
-  - 请求方法:GET
-```json
-  {
-  "asin": "B07N4M94X4",
-  "attributes": {
-    "total_hdmi_ports": [
-      {
-        "value": 4,
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "resolution": [
-      {
-        "language_tag": "en_US",
-        "value": "4K",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "item_weight": [
-      {
-        "unit": "pounds",
-        "value": 107.6,
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "product_subcategory": [
-      {
-        "value": "50400120",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "bullet_point": [
-      {
-        "language_tag": "en_US",
-        "value": "SMART TV WITH UNIVERSAL GUIDE: Simple on-screen Guide is an easy way to find streaming content and live TV shows",
-        "marketplace_id": "ATVPDKIKX0DER"
-      },
-      {
-        "language_tag": "en_US",
-        "value": "100% COLOR VOLUME WITH QUANTUM DOTS: Powered by Quantum dots, Samsung’s 4K QLED TV offers over a billion shades of brilliant color and 100% color volume for exceptional depth of detail that will draw you in to the picture for the best 4K TV experience",
-        "marketplace_id": "ATVPDKIKX0DER"
-      },
-      {
-        "language_tag": "en_US",
-        "value": "QUANTUM PROCESSOR 4K: Intelligently powered processor instantly upscales content to 4K for sharp detail and refined color",
-        "marketplace_id": "ATVPDKIKX0DER"
-      },
-      {
-        "language_tag": "en_US",
-        "value": "QUANTUM HDR 4X: 4K depth of detail with high dynamic range powered by HDR10+ delivers the lightest to darkest colors, scene by scene, for amazing picture realism",
-        "marketplace_id": "ATVPDKIKX0DER"
-      },
-      {
-        "language_tag": "en_US",
-        "value": "AMBIENT MODE: Customizes and complements your living space by turning a blank screen of this big screen TV into enticing visuals including décor, info, photos and artwork",
-        "marketplace_id": "ATVPDKIKX0DER"
-      },
-      {
-        "language_tag": "en_US",
-        "value": "SMART TV FEATURES: OneRemote to control all compatible devices, Bixby voice command, on-screen universal guide, SmartThings to control compatible home appliances and devices, smart speaker expandability with Alexa and Google Assistant compatibility, and more",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "item_dimensions": [
-      {
-        "width": {
-          "unit": "inches",
-          "value": 72.4
-        },
-        "length": {
-          "unit": "inches",
-          "value": 2.4
-        },
-        "height": {
-          "unit": "inches",
-          "value": 41.4
-        },
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "brand": [
-      {
-        "language_tag": "en_US",
-        "value": "SAMSUNG",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "control_method": [
-      {
-        "value": "voice",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "item_package_dimensions": [
-      {
-        "length": {
-          "unit": "centimeters",
-          "value": 26.67
-        },
-        "width": {
-          "unit": "centimeters",
-          "value": 121.92
-        },
-        "height": {
-          "unit": "centimeters",
-          "value": 203.2
-        },
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "image_aspect_ratio": [
-      {
-        "language_tag": "en_US",
-        "value": "16:9",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "part_number": [
-      {
-        "value": "QN82Q60RAFXZA",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "includes_remote": [
-      {
-        "value": true,
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "style": [
-      {
-        "language_tag": "en_US",
-        "value": "TV only",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "item_type_name": [
-      {
-        "language_tag": "en_US",
-        "value": "TV",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "battery": [
-      {
-        "cell_composition": [
-          {
-            "value": "alkaline"
-          }
-        ],
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "image_contrast_ratio": [
-      {
-        "language_tag": "en_US",
-        "value": "QLED 4K",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "manufacturer": [
-      {
-        "language_tag": "en_US",
-        "value": "Samsung",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "number_of_boxes": [
-      {
-        "value": 1,
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "total_usb_ports": [
-      {
-        "value": 2,
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "model_number": [
-      {
-        "value": "QN82Q60RAFXZA",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "supplier_declared_dg_hz_regulation": [
-      {
-        "value": "not_applicable",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "num_batteries": [
-      {
-        "quantity": 2,
-        "type": "aaa",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "california_proposition_65": [
-      {
-        "compliance_type": "on_product_combined_cancer_reproductive",
-        "marketplace_id": "ATVPDKIKX0DER"
-      },
-      {
-        "compliance_type": "chemical",
-        "chemical_names": [
-          "di_2_ethylhexyl_phthalate_dehp"
-        ],
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "display": [
-      {
-        "resolution_maximum": [
-          {
-            "unit": "pixels",
-            "language_tag": "en_US",
-            "value": "3840 x 2160"
-          }
-        ],
-        "size": [
-          {
-            "unit": "inches",
-            "value": 82
-          }
-        ],
-        "type": [
-          {
-            "language_tag": "en_US",
-            "value": "QLED"
-          }
-        ],
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "item_name": [
-      {
-        "language_tag": "en_US",
-        "value": "Samsung QN82Q60RAFXZA Flat 82-Inch QLED 4K Q60 Series (2019) Ultra HD Smart TV with HDR and Alexa Compatibility",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "list_price": [
-      {
-        "currency": "USD",
-        "value": 3799.99,
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "batteries_required": [
-      {
-        "value": false,
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "includes_rechargable_battery": [
-      {
-        "value": false,
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "product_site_launch_date": [
-      {
-        "value": "2019-03-11T08:00:01.000Z",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "product_category": [
-      {
-        "value": "50400100",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "batteries_included": [
-      {
-        "value": false,
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "connectivity_technology": [
-      {
-        "language_tag": "en_US",
-        "value": "Bluetooth",
-        "marketplace_id": "ATVPDKIKX0DER"
-      },
-      {
-        "language_tag": "en_US",
-        "value": "USB",
-        "marketplace_id": "ATVPDKIKX0DER"
-      },
-      {
-        "language_tag": "en_US",
-        "value": "Wireless",
-        "marketplace_id": "ATVPDKIKX0DER"
-      },
-      {
-        "language_tag": "en_US",
-        "value": "HDMI",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "included_components": [
-      {
-        "language_tag": "en_US",
-        "value": "QLED Standard Smart Remote",
-        "marketplace_id": "ATVPDKIKX0DER"
-      },
-      {
-        "language_tag": "en_US",
-        "value": "Power Cable",
-        "marketplace_id": "ATVPDKIKX0DER"
-      },
-      {
-        "language_tag": "en_US",
-        "value": "Stand",
-        "marketplace_id": "ATVPDKIKX0DER"
-      },
-      {
-        "language_tag": "en_US",
-        "value": "Samsung Smart Control",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "specification_met": [
-      {
-        "language_tag": "en_US",
-        "value": "",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "parental_control_technology": [
-      {
-        "value": "V-Chip",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "power_consumption": [
-      {
-        "unit": "watts",
-        "value": 120,
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "cpsia_cautionary_statement": [
-      {
-        "value": "no_warning_applicable",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "item_type_keyword": [
-      {
-        "value": "qled-televisions",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "number_of_items": [
-      {
-        "value": 1,
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "warranty_description": [
-      {
-        "language_tag": "en_US",
-        "value": "1 year manufacturer",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "max_resolution": [
-      {
-        "unit": "pixels",
-        "value": 8.3,
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "color": [
-      {
-        "language_tag": "en_US",
-        "value": "Black",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "screen_surface_description": [
-      {
-        "language_tag": "en_US",
-        "value": "Flat",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "item_package_weight": [
-      {
-        "unit": "kilograms",
-        "value": 62.142,
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "speaker_type": [
-      {
-        "language_tag": "en_US",
-        "value": "2CH",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "supported_internet_services": [
-      {
-        "language_tag": "en_US",
-        "value": "Amazon Instant Video",
-        "marketplace_id": "ATVPDKIKX0DER"
-      },
-      {
-        "language_tag": "en_US",
-        "value": "YouTube",
-        "marketplace_id": "ATVPDKIKX0DER"
-      },
-      {
-        "language_tag": "en_US",
-        "value": "Netflix",
-        "marketplace_id": "ATVPDKIKX0DER"
-      },
-      {
-        "language_tag": "en_US",
-        "value": "Hulu",
-        "marketplace_id": "ATVPDKIKX0DER"
-      },
-      {
-        "language_tag": "en_US",
-        "value": "Browser",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "tuner_technology": [
-      {
-        "language_tag": "en_US",
-        "value": "Analog Tuner",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "controller_type": [
-      {
-        "language_tag": "en_US",
-        "value": "SmartThings",
-        "marketplace_id": "ATVPDKIKX0DER"
-      },
-      {
-        "language_tag": "en_US",
-        "value": "Voice Control",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "special_feature": [
-      {
-        "language_tag": "en_US",
-        "value": "100% Color Volume with Quantum Dot; Quantum Processor 4K; Ambient Mode; Quantum HDR 4X; Real Game Enhancer",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "wireless_communication_technology": [
-      {
-        "language_tag": "en_US",
-        "value": "Wi-Fi::Wi-Fi Direct::Bluetooth",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "model_year": [
-      {
-        "value": 2019,
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "power_source_type": [
-      {
-        "language_tag": "en_US",
-        "value": "Corded Electric",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "street_date": [
-      {
-        "value": "2019-03-21T00:00:01Z",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "mounting_type": [
-      {
-        "language_tag": "en_US",
-        "value": "Table Mount",
-        "marketplace_id": "ATVPDKIKX0DER"
-      },
-      {
-        "language_tag": "en_US",
-        "value": "Wall Mount",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ],
-    "refresh_rate": [
-      {
-        "unit": "hertz",
-        "language_tag": "en_US",
-        "value": "120",
-        "marketplace_id": "ATVPDKIKX0DER"
-      }
-    ]
-  },
-  "classifications": [
-    {
-      "marketplaceId": "ATVPDKIKX0DER",
-      "classifications": [
-        {
-          "displayName": "QLED TVs",
-          "classificationId": "21489946011",
-          "parent": {
-            "displayName": "Televisions",
-            "classificationId": "172659",
-            "parent": {
-              "displayName": "Television & Video",
-              "classificationId": "1266092011",
-              "parent": {
-                "displayName": "Electronics",
-                "classificationId": "172282"
-              }
-            }
-          }
-        }
-      ]
-    }
-  ],
-  "dimensions": [
-    {
-      "marketplaceId": "ATVPDKIKX0DER",
-      "item": {
-        "height": {
-          "unit": "inches",
-          "value": 41.4
-        },
-        "length": {
-          "unit": "inches",
-          "value": 2.4
-        },
-        "weight": {
-          "unit": "pounds",
-          "value": 107.6
-        },
-        "width": {
-          "unit": "inches",
-          "value": 72.4
-        }
-      },
-      "package": {
-        "height": {
-          "unit": "inches",
-          "value": 10.49999998929
-        },
-        "length": {
-          "unit": "inches",
-          "value": 79.9999999184
-        },
-        "weight": {
-          "unit": "kilograms",
-          "value": 62.142
-        },
-        "width": {
-          "unit": "inches",
-          "value": 47.99999995104
-        }
-      }
-    }
-  ],
-  "identifiers": [
-    {
-      "marketplaceId": "ATVPDKIKX0DER",
-      "identifiers": [
-        {
-          "identifier": "0887276302195",
-          "identifierType": "EAN"
-        },
-        {
-          "identifier": "00887276302195",
-          "identifierType": "GTIN"
-        },
-        {
-          "identifier": "887276302195",
-          "identifierType": "UPC"
-        }
-      ]
-    }
-  ],
-  "images": [
-    {
-      "marketplaceId": "ATVPDKIKX0DER",
-      "images": [
-        {
-          "variant": "MAIN",
-          "link": "https://m.media-amazon.com/images/I/91uohwV+k3L.jpg",
-          "height": 1707,
-          "width": 2560
-        },
-        {
-          "variant": "MAIN",
-          "link": "https://m.media-amazon.com/images/I/51DZzp3w3vL.jpg",
-          "height": 333,
-          "width": 500
-        },
-        {
-          "variant": "PT01",
-          "link": "https://m.media-amazon.com/images/I/81w2rTVShlL.jpg",
-          "height": 2560,
-          "width": 2560
-        },
-        {
-          "variant": "PT01",
-          "link": "https://m.media-amazon.com/images/I/41Px9eq9tkL.jpg",
-          "height": 500,
-          "width": 500
-        },
-        {
-          "variant": "PT02",
-          "link": "https://m.media-amazon.com/images/I/51NTNhdhPyL.jpg",
-          "height": 375,
-          "width": 500
-        },
-        {
-          "variant": "PT03",
-          "link": "https://m.media-amazon.com/images/I/51o4zpL+A3L.jpg",
-          "height": 375,
-          "width": 500
-        },
-        {
-          "variant": "PT04",
-          "link": "https://m.media-amazon.com/images/I/71ux2k9GAZL.jpg",
-          "height": 1000,
-          "width": 1000
-        },
-        {
-          "variant": "PT04",
-          "link": "https://m.media-amazon.com/images/I/61UUX63yw1L.jpg",
-          "height": 500,
-          "width": 500
-        },
-        {
-          "variant": "PT05",
-          "link": "https://m.media-amazon.com/images/I/61LwHkljX-L.jpg",
-          "height": 1000,
-          "width": 1000
-        },
-        {
-          "variant": "PT05",
-          "link": "https://m.media-amazon.com/images/I/51wJTQty3PL.jpg",
-          "height": 500,
-          "width": 500
-        },
-        {
-          "variant": "PT06",
-          "link": "https://m.media-amazon.com/images/I/61uvoB4VvoL.jpg",
-          "height": 1000,
-          "width": 1000
-        },
-        {
-          "variant": "PT06",
-          "link": "https://m.media-amazon.com/images/I/51ZexIO628L.jpg",
-          "height": 500,
-          "width": 500
-        },
-        {
-          "variant": "PT07",
-          "link": "https://m.media-amazon.com/images/I/7121MGd2ncL.jpg",
-          "height": 1000,
-          "width": 1000
-        },
-        {
-          "variant": "PT07",
-          "link": "https://m.media-amazon.com/images/I/61QK+JBMrGL.jpg",
-          "height": 500,
-          "width": 500
-        },
-        {
-          "variant": "PT08",
-          "link": "https://m.media-amazon.com/images/I/61ECcGlG4IL.jpg",
-          "height": 1080,
-          "width": 1920
-        },
-        {
-          "variant": "PT08",
-          "link": "https://m.media-amazon.com/images/I/31TxwfqvB5L.jpg",
-          "height": 281,
-          "width": 500
-        }
-      ]
-    }
-  ],
-  "productTypes": [
-    {
-      "marketplaceId": "ATVPDKIKX0DER",
-      "productType": "TELEVISION"
-    }
-  ],
-  "salesRanks": [
-    {
-      "marketplaceId": "ATVPDKIKX0DER",
-      "classificationRanks": [
-        {
-          "classificationId": "21489946011",
-          "title": "QLED TVs",
-          "link": "http://www.amazon.com/gp/bestsellers/electronics/21489946011",
-          "rank": 113
-        }
-      ],
-      "displayGroupRanks": [
-        {
-          "websiteDisplayGroup": "ce_display_on_website",
-          "title": "Electronics",
-          "link": "http://www.amazon.com/gp/bestsellers/electronics",
-          "rank": 72855
-        }
-      ]
-    }
-  ],
-  "summaries": [
-    {
-      "marketplaceId": "ATVPDKIKX0DER",
-      "brand": "SAMSUNG",
-      "browseClassification": {
-        "displayName": "QLED TVs",
-        "classificationId": "21489946011"
-      },
-      "color": "Black",
-      "itemClassification": "BASE_PRODUCT",
-      "itemName": "Samsung QN82Q60RAFXZA Flat 82-Inch QLED 4K Q60 Series (2019) Ultra HD Smart TV with HDR and Alexa Compatibility",
-      "manufacturer": "Samsung",
-      "modelNumber": "QN82Q60RAFXZA",
-      "packageQuantity": 1,
-      "partNumber": "QN82Q60RAFXZA",
-      "size": "82-Inch",
-      "style": "TV only",
-      "websiteDisplayGroup": "home_theater_display_on_website",
-      "websiteDisplayGroupName": "Home Theater"
-    }
-  ],
-  "relationships": [
-    {
-      "marketplaceId": "ATVPDKIKX0DER",
-      "relationships": [
-        {
-          "type": "VARIATION",
-          "parentAsins": [
-            "B08J7TQ9FL"
-          ],
-          "variationTheme": {
-            "attributes": [
-              "color",
-              "size"
-            ],
-            "theme": "SIZE_NAME/COLOR_NAME"
-          }
-        }
-      ]
-    }
-  ],
-  "vendorDetails": [
-    {
-      "marketplaceId": "ATVPDKIKX0DER",
-      "brandCode": "SAMF9",
-      "manufacturerCode": "SAMF9",
-      "manufacturerCodeParent": "SAMF9",
-      "productCategory": {
-        "displayName": "Televisions",
-        "value": "50400100"
-      },
-      "productGroup": "Home Entertainment",
-      "productSubcategory": {
-        "displayName": "Plasma TVs",
-        "value": "50400120"
-      },
-      "replenishmentCategory": "OBSOLETE"
-    }
-  ]
-}
-```
-

+ 0 - 36
modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/package.json

@@ -1,36 +0,0 @@
-{
-  "name": "@fmode/amazon-sp-api",
-  "version": "1.0.0",
-  "description": "Amazon Selling Partner API 模块",
-  "type": "module",
-  "main": "src/mod.ts",
-  "exports": {
-    ".": "./src/mod.ts",
-    "./client": "./src/client.ts",
-    "./types": "./src/types.ts",
-    "./api/customerFeedback": "./src/api/customerFeedback.ts"
-  },
-  "scripts": {
-    "test": "echo \"No tests yet\"",
-    "dev": "tsx src/dev-server.ts"
-  },
-  "keywords": [
-    "amazon",
-    "sp-api",
-    "fmode"
-  ],
-  "author": "fmode team",
-  "license": "MIT",
-  "dependencies": {
-    "@types/parse": "^3.0.9",
-    "axios": "^1.6.0",
-    "express": "^4.18.2",
-    "parse": "^8.1.0"
-  },
-  "devDependencies": {
-    "@types/express": "^5.0.6",
-    "@types/node": "^20.0.0",
-    "esbuild": "^0.19.0",
-    "tsx": "^4.21.0"
-  }
-}

+ 0 - 43
modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/api/catalogItems.ts

@@ -1,43 +0,0 @@
-import { SpApiClient } from '../client.ts';
-import { ListCatalogCategoriesParams, SearchCatalogItemsParams, GetCatalogItemParams } from '../types.ts';
-
-export class CatalogItemsApi {
-  constructor(private client: SpApiClient) {}
-
-  /**
-   * 列表目录分类
-   * GET /catalog/v0/categories
-   */
-  async listCatalogCategories(params: ListCatalogCategoriesParams) {
-    return this.client.request({
-      method: 'GET',
-      path: '/catalog/v0/categories',
-      query: params as any
-    });
-  }
-
-  /**
-   * 搜索亚马逊目录商品
-   * GET /catalog/2022-04-01/items
-   */
-  async searchCatalogItems(params: SearchCatalogItemsParams) {
-    return this.client.request({
-      method: 'GET',
-      path: '/catalog/2022-04-01/items',
-      query: params as any
-    });
-  }
-
-  /**
-   * 获取类目信息
-   * GET /catalog/2022-04-01/items/{asin}
-   */
-  async getCatalogItem(params: GetCatalogItemParams) {
-    const { asin, ...queryParams } = params;
-    return this.client.request({
-      method: 'GET',
-      path: `/catalog/2022-04-01/items/${asin}`,
-      query: queryParams as any
-    });
-  }
-}

+ 0 - 97
modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/api/customerFeedback.ts

@@ -1,97 +0,0 @@
-import { SpApiClient } from '../client.ts';
-import { GetItemReviewTopicsParams } from '../types.ts';
-
-export class CustomerFeedbackApi {
-  constructor(private client: SpApiClient) {}
-
-  /**
-   * 检索某件商品的十个最正面和十个最负面的评论主题。
-   * GET /customerFeedback/2024-06-01/items/{asin}/reviews/topics
-   */
-  async getItemReviewTopics(params: GetItemReviewTopicsParams) {
-    const { asin, ...queryParams } = params;
-    return this.client.request({
-      method: 'GET',
-      path: `/customerFeedback/2024-06-01/items/${asin}/reviews/topics`,
-      query: queryParams
-    });
-  }
-
-  /**
-   * 该API返回请求ASIN的关联浏览节点。
-   * GET /customerFeedback/2024-06-01/items/{asin}/browseNode
-   */
-  async getItemBrowseNode(params: { asin: string } & import('../types.ts').BaseRequestParams) {
-    const { asin, ...queryParams } = params;
-    return this.client.request({
-      method: 'GET',
-      path: `/customerFeedback/2024-06-01/items/${asin}/browseNode`,
-      query: queryParams
-    });
-  }
-
-  /**
-   * 检索浏览节点中十个最正面和十个最负面的评论主题。
-   * GET /customerFeedback/2024-06-01/browseNodes/{browseNodeId}/reviews/topics
-   */
-  async getBrowseNodeReviewTopics(params: { browseNodeId: string } & import('../types.ts').BaseRequestParams) {
-    const { browseNodeId, ...queryParams } = params;
-    return this.client.request({
-      method: 'GET',
-      path: `/customerFeedback/2024-06-01/browseNodes/${browseNodeId}/reviews/topics`,
-      query: queryParams
-    });
-  }
-
-  /**
-   * 检索过去六个月商品的正面和负面评价趋势。
-   * GET /customerFeedback/2024-06-01/items/{asin}/reviews/trends
-   */
-  async getItemReviewTrends(params: { asin: string } & import('../types.ts').BaseRequestParams) {
-    const { asin, ...queryParams } = params;
-    return this.client.request({
-      method: 'GET',
-      path: `/customerFeedback/2024-06-01/items/${asin}/reviews/trends`,
-      query: queryParams
-    });
-  }
-
-  /**
-   * 检索过去六个月浏览节点的正面和负面评价趋势。
-   * GET /customerFeedback/2024-06-01/browseNodes/{browseNodeId}/reviews/trends
-   */
-  async getBrowseNodeReviewTrends(params: { browseNodeId: string } & import('../types.ts').BaseRequestParams) {
-    const { browseNodeId, ...queryParams } = params;
-    return this.client.request({
-      method: 'GET',
-      path: `/customerFeedback/2024-06-01/browseNodes/${browseNodeId}/reviews/trends`,
-      query: queryParams
-    });
-  }
-
-  /**
-   * 检索客户在浏览节点退货时提到的主题。
-   * GET /customerFeedback/2024-06-01/browseNodes/{browseNodeId}/returns/topics
-   */
-  async getBrowseNodeReturnTopics(params: { browseNodeId: string } & import('../types.ts').BaseRequestParams) {
-    const { browseNodeId, ...queryParams } = params;
-    return this.client.request({
-      method: 'GET',
-      path: `/customerFeedback/2024-06-01/browseNodes/${browseNodeId}/returns/topics`,
-      query: queryParams
-    });
-  }
-
-  /**
-   * 检索客户在浏览节点退货时提到的话题趋势。
-   * GET /customerFeedback/2024-06-01/browseNodes/{browseNodeId}/returns/trends
-   */
-  async getBrowseNodeReturnTrends(params: { browseNodeId: string } & import('../types.ts').BaseRequestParams) {
-    const { browseNodeId, ...queryParams } = params;
-    return this.client.request({
-      method: 'GET',
-      path: `/customerFeedback/2024-06-01/browseNodes/${browseNodeId}/returns/trends`,
-      query: queryParams
-    });
-  }
-}

+ 0 - 31
modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/api/externalFulfillment.ts

@@ -1,31 +0,0 @@
-import { SpApiClient } from '../client.ts';
-import { ListReturnsParams } from '../types.ts';
-
-export class ExternalFulfillmentApi {
-  constructor(private client: SpApiClient) {}
-
-  /**
-   * 退货列表
-   * GET /externalFulfillment/2024-09-11/returns
-   */
-  async listReturns(params: ListReturnsParams) {
-    // 注意: 如果 sellerId 在某些版本中是路径的一部分,请查看文档。
-    // 这里文档说是 /returns,所以它可能使用查询参数。
-    return this.client.request({
-      method: 'GET',
-      path: '/externalFulfillment/2024-09-11/returns',
-      query: params as any
-    });
-  }
-
-  /**
-   * 获取退货详情
-   * GET /externalFulfillment/2024-09-11/returns/{returnId}
-   */
-  async getReturn(returnId: string) {
-    return this.client.request({
-      method: 'GET',
-      path: `/externalFulfillment/2024-09-11/returns/${returnId}`
-    });
-  }
-}

+ 0 - 18
modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/api/inventory.ts

@@ -1,18 +0,0 @@
-import { SpApiClient } from '../client.ts';
-import { GetInventorySummariesParams } from '../types.ts';
-
-export class InventoryApi {
-  constructor(private client: SpApiClient) {}
-
-  /**
-   * 获取库存摘要
-   * GET /fba/inventory/v1/summaries
-   */
-  async getInventorySummaries(params: GetInventorySummariesParams) {
-    return this.client.request({
-      method: 'GET',
-      path: '/fba/inventory/v1/summaries',
-      query: params as any
-    });
-  }
-}

+ 0 - 57
modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/api/listings.ts

@@ -1,57 +0,0 @@
-import { SpApiClient } from '../client.ts';
-import { SearchListingsItemsParams, GetListingsItemParams } from '../types.ts';
-
-export class ListingsApi {
-  constructor(private client: SpApiClient) {}
-
-  /**
-   * 列出所有列表项
-   * GET /listings/2021-08-01/items/{sellerId}
-   */
-  async searchListingsItems(params: SearchListingsItemsParams) {
-    const { sellerId, ...queryParams } = params;
-    return this.client.request({
-      method: 'GET',
-      path: `/listings/2021-08-01/items/${sellerId}`,
-      query: queryParams as any
-    });
-  }
-
-  /**
-   * 获取列表项详情
-   * GET /listings/2021-08-01/items/{sellerId}/{sku}
-   */
-  async getListingsItem(params: GetListingsItemParams) {
-    const { sellerId, sku, ...queryParams } = params;
-    return this.client.request({
-      method: 'GET',
-      path: `/listings/2021-08-01/items/${sellerId}/${sku}`,
-      query: queryParams as any
-    });
-  }
-
-  /**
-   * Put (创建/更新) 列表项
-   * PUT /listings/2021-08-01/items/{sellerId}/{sku}
-   */
-  async putListingsItem(sellerId: string, sku: string, marketplaceIds: string[], body: any) {
-    return this.client.request({
-      method: 'PUT',
-      path: `/listings/2021-08-01/items/${sellerId}/${sku}`,
-      query: { marketplaceIds: marketplaceIds.join(',') },
-      body
-    });
-  }
-
-  /**
-   * 删除列表项
-   * DELETE /listings/2021-08-01/items/{sellerId}/{sku}
-   */
-  async deleteListingsItem(sellerId: string, sku: string, marketplaceIds: string[]) {
-    return this.client.request({
-      method: 'DELETE',
-      path: `/listings/2021-08-01/items/${sellerId}/${sku}`,
-      query: { marketplaceIds: marketplaceIds.join(',') }
-    });
-  }
-}

+ 0 - 40
modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/api/notifications.ts

@@ -1,40 +0,0 @@
-import { SpApiClient } from '../client.ts';
-import { CreateSubscriptionParams } from '../types.ts';
-
-export class NotificationsApi {
-  constructor(private client: SpApiClient) {}
-
-  /**
-   * 创建订阅
-   * POST /notifications/v1/subscriptions/{notificationType}
-   */
-  async createSubscription(notificationType: string, params: Omit<CreateSubscriptionParams, 'notificationType'>) {
-    return this.client.request({
-      method: 'POST',
-      path: `/notifications/v1/subscriptions/${notificationType}`,
-      body: params
-    });
-  }
-
-  /**
-   * 获取订阅
-   * GET /notifications/v1/subscriptions/{notificationType}/{subscriptionId}
-   */
-  async getSubscription(notificationType: string, subscriptionId: string) {
-    return this.client.request({
-      method: 'GET',
-      path: `/notifications/v1/subscriptions/${notificationType}/${subscriptionId}`
-    });
-  }
-
-  /**
-   * 删除订阅
-   * DELETE /notifications/v1/subscriptions/{notificationType}/{subscriptionId}
-   */
-  async deleteSubscription(notificationType: string, subscriptionId: string) {
-    return this.client.request({
-      method: 'DELETE',
-      path: `/notifications/v1/subscriptions/${notificationType}/${subscriptionId}`
-    });
-  }
-}

+ 0 - 41
modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/api/orders.ts

@@ -1,41 +0,0 @@
-import { SpApiClient } from '../client.ts';
-import { GetOrdersParams } from '../types.ts';
-
-export class OrdersApi {
-  constructor(private client: SpApiClient) {}
-
-  /**
-   * 获取订单列表
-   * GET /orders/v0/orders
-   */
-  async getOrders(params: GetOrdersParams) {
-    return this.client.request({
-      method: 'GET',
-      path: '/orders/v0/orders',
-      query: params as any
-    });
-  }
-
-  /**
-   * 获取订单详情
-   * GET /orders/v0/orders/{orderId}
-   */
-  async getOrder(orderId: string) {
-    return this.client.request({
-      method: 'GET',
-      path: `/orders/v0/orders/${orderId}`
-    });
-  }
-
-  /**
-   * 获取订单商品
-   * GET /orders/v0/orders/{orderId}/orderItems
-   */
-  async getOrderItems(orderId: string, nextToken?: string) {
-    return this.client.request({
-      method: 'GET',
-      path: `/orders/v0/orders/${orderId}/orderItems`,
-      query: nextToken ? { NextToken: nextToken } : undefined
-    });
-  }
-}

+ 0 - 30
modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/api/pricing.ts

@@ -1,30 +0,0 @@
-import { SpApiClient } from '../client.ts';
-import { GetPricingParams } from '../types.ts';
-
-export class PricingApi {
-  constructor(private client: SpApiClient) {}
-
-  /**
-   * 获取定价信息
-   * GET /products/pricing/v0/price
-   */
-  async getPricing(params: GetPricingParams) {
-    return this.client.request({
-      method: 'GET',
-      path: '/products/pricing/v0/price',
-      query: params as any
-    });
-  }
-
-  /**
-   * 获取竞争性定价
-   * GET /products/pricing/v0/competitivePrice
-   */
-  async getCompetitivePricing(params: GetPricingParams) {
-    return this.client.request({
-      method: 'GET',
-      path: '/products/pricing/v0/competitivePrice',
-      query: params as any
-    });
-  }
-}

+ 0 - 40
modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/api/reports.ts

@@ -1,40 +0,0 @@
-import { SpApiClient } from '../client.ts';
-import { CreateReportParams } from '../types.ts';
-
-export class ReportsApi {
-  constructor(private client: SpApiClient) {}
-
-  /**
-   * 创建报告
-   * POST /reports/2021-06-30/reports
-   */
-  async createReport(params: CreateReportParams) {
-    return this.client.request({
-      method: 'POST',
-      path: '/reports/2021-06-30/reports',
-      body: params
-    });
-  }
-
-  /**
-   * 获取报告
-   * GET /reports/2021-06-30/reports/{reportId}
-   */
-  async getReport(reportId: string) {
-    return this.client.request({
-      method: 'GET',
-      path: `/reports/2021-06-30/reports/${reportId}`
-    });
-  }
-
-  /**
-   * 获取报告文档
-   * GET /reports/2021-06-30/documents/{reportDocumentId}
-   */
-  async getReportDocument(reportDocumentId: string) {
-    return this.client.request({
-      method: 'GET',
-      path: `/reports/2021-06-30/documents/${reportDocumentId}`
-    });
-  }
-}

+ 0 - 18
modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/api/sales.ts

@@ -1,18 +0,0 @@
-import { SpApiClient } from '../client.ts';
-import { GetOrderMetricsParams } from '../types.ts';
-
-export class SalesApi {
-  constructor(private client: SpApiClient) {}
-
-  /**
-   * 回报给定买方类型的给定区间内汇总订单指标
-   * GET /sales/v1/orderMetrics
-   */
-  async getOrderMetrics(params: GetOrderMetricsParams) {
-    return this.client.request({
-      method: 'GET',
-      path: '/sales/v1/orderMetrics',
-      query: params as any
-    });
-  }
-}

+ 0 - 27
modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/api/sellers.ts

@@ -1,27 +0,0 @@
-import { SpApiClient } from '../client.ts';
-
-export class SellersApi {
-  constructor(private client: SpApiClient) {}
-
-  /**
-   * 返回卖家账户及其市场的信息
-   * GET /sellers/v1/account
-   */
-  async getAccount() {
-    return this.client.request({
-      method: 'GET',
-      path: '/sellers/v1/account'
-    });
-  }
-
-  /**
-   * 返回卖家可以列出商品的市场列表以及卖家在这些市场的参与信息
-   * GET /sellers/v1/marketplaceParticipations
-   */
-  async getMarketplaceParticipations() {
-    return this.client.request({
-      method: 'GET',
-      path: '/sellers/v1/marketplaceParticipations'
-    });
-  }
-}

+ 0 - 204
modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/client.ts

@@ -1,204 +0,0 @@
-
-import axios from 'axios';
-import { SpApiConfig, LwaTokenResponse, ShopConfig } from './types.ts';
-import { getEndpointByMarketplaceId, getEndpointByRegion } from './marketplace-helper.ts';
-
-/**
- * Amazon Selling Partner API 基础客户端
- * 处理 LWA 认证 (简化模式,无需 AWS V4 签名)
- */
-export class SpApiClient {
-  // 配置在构造函数中现在是可选的,但可以传递用于遗留/静态用法
-  // 然而,对于基于 Parse 的多租户用法,我们依赖于方法参数。
-  // 为了保持向后兼容性并支持新的动态模式,我们可以使用混合方法。
-  
-  // 对于动态用法,我们将主要不使用 this.config。
-  private staticConfig?: SpApiConfig;
-
-  constructor(config?: SpApiConfig) {
-    this.staticConfig = config;
-  }
-
-  /**
-   * 获取基础 URL
-   */
-  private getBaseUrl(marketplaceId?: string, isSandbox?: boolean, region?: string): string {
-    if (marketplaceId) {
-      return getEndpointByMarketplaceId(marketplaceId, isSandbox);
-    }
-    
-    // 如果提供了区域配置,则使用区域
-    if (region) {
-      return getEndpointByRegion(region, isSandbox);
-    }
-
-    // 回退到静态配置 (遗留模式)
-    if (this.staticConfig) {
-       const REGION_ENDPOINTS: Record<string, string> = {
-        'us-east-1': 'https://sellingpartnerapi-na.amazon.com',
-        'eu-west-1': 'https://sellingpartnerapi-eu.amazon.com',
-        'us-west-2': 'https://sellingpartnerapi-fe.amazon.com'
-      };
-      const SANDBOX_ENDPOINTS: Record<string, string> = {
-        'us-east-1': 'https://sandbox.sellingpartnerapi-na.amazon.com',
-        'eu-west-1': 'https://sandbox.sellingpartnerapi-eu.amazon.com',
-        'us-west-2': 'https://sandbox.sellingpartnerapi-fe.amazon.com'
-      };
-      const endpoints = this.staticConfig.sandbox ? SANDBOX_ENDPOINTS : REGION_ENDPOINTS;
-      return endpoints[this.staticConfig.region] || endpoints['us-east-1'];
-    }
-
-    throw new Error('无法确定 SP-API 端点,MarketplaceId 为必填项。');
-  }
-
-  /**
-   * 获取 LWA Access Token
-   * 仅使用 config 获取 token
-   */
-  private async getAccessToken(context?: { config: ShopConfig }): Promise<string> {
-    // 1. 动态上下文模式
-    if (context) {
-      const { config } = context;
-      // 刷新 Token
-      return this.refreshAccessToken(config.clientId, config.clientSecret, config.refreshToken);
-    }
-    // 2. 静态配置模式 (遗留/内存)
-    if (this.staticConfig) {
-      return this.refreshAccessToken(this.staticConfig.clientId, this.staticConfig.clientSecret, this.staticConfig.refreshToken);
-    }
-
-    throw new Error('缺少 SpApiClient 配置。');
-  }
-
-  /**
-   * 刷新 Token 逻辑
-   */
-  private async refreshAccessToken(clientId: string, clientSecret: string, refreshToken: string): Promise<string> {
-    try {
-      console.log('[SP-API] 正在刷新 Access Token...');
-      const response = await axios.post<LwaTokenResponse>(
-        'https://api.amazon.com/auth/o2/token',
-        new URLSearchParams({
-          grant_type: 'refresh_token',
-          refresh_token: refreshToken,
-          client_id: clientId,
-          client_secret: clientSecret
-        }),
-        {
-          headers: {
-            'Content-Type': 'application/x-www-form-urlencoded'
-          }
-        }
-      );
-
-      const { access_token } = response.data;
-      
-      // 注意:这里不再将 token 保存回数据库,因为我们不再传递 parseShop 对象。
-      // 如果需要缓存,应在上层或使用内存缓存实现。
-      
-      return access_token;
-    } catch (error) {
-      console.error('[SP-API] 刷新 token 失败:', error);
-      throw error;
-    }
-  }
-
-  /**
-   * 发送 SP-API 请求
-   */
-  async request<T>(options: {
-    method: 'GET' | 'POST' | 'PUT' | 'DELETE';
-    path: string;
-    query?: Record<string, any>;
-    body?: any;
-    headers?: Record<string, string>;
-    context?: { // 动态模式的可选上下文
-        shopId: string;
-        marketplaceId?: string;
-        config: ShopConfig;
-    }
-  }): Promise<T> {
-    const accessToken = await this.getAccessToken(options.context);
-    // 确定用于端点选择的 MarketplaceId
-    // 优先级: 上下文中显式指定 -> 查询参数中显式指定 -> 配置默认值 (如果是静态的)
-    let marketplaceId = options.context?.marketplaceId;
-    if (!marketplaceId && options.query) {
-        // 尝试在查询参数中查找 marketplaceId (不区分大小写)
-        const key = Object.keys(options.query).find(k => k.toLowerCase() === 'marketplaceids' || k.toLowerCase() === 'marketplaceid');
-        if (key) {
-            const val = options.query[key];
-            marketplaceId = Array.isArray(val) ? val[0] : (val as string)?.split(',')[0];
-        }
-    }
-
-    const isSandbox = options.context?.config.sandbox || this.staticConfig?.sandbox;
-    // 尝试从配置中获取 Region
-    const region = options.context?.config.region || this.staticConfig?.region;
-    
-    const baseUrl = this.getBaseUrl(marketplaceId, isSandbox, region);
-    const url = new URL(options.path, baseUrl);
-    if (options.query) {
-      Object.entries(options.query).forEach(([key, value]) => {
-        if (value !== undefined && value !== null) {
-          url.searchParams.append(key, String(value));
-        }
-      });
-    }
-    const headers = {
-      'x-amz-access-token': accessToken,
-      'Content-Type': 'application/json',
-      'User-Agent': 'fmode-amazon-sp-api/1.0',
-    };
-
-    let retries = 0;
-    const maxRetries = 3;
-
-    while (retries < maxRetries) {
-      try {
-        console.log(`[SP-API] 请求: ${options.method} ${url}`, { query: options.query, shopId: options.context?.shopId });
-        const response = await axios({
-          method: options.method,
-          url: url.toString(),
-          data: options.body,
-          headers
-        });
-        return response.data;
-      } catch (error: any) {
-        if (axios.isAxiosError(error)) {
-          console.log(error.response?.data);
-          console.error(`[SP-API] 错误: ${options.method} ${url}`, {
-            status: error.response?.status,
-            data: error.response?.data,
-            message: error.message
-          });
-
-          // 处理 429 Too Many Requests
-          if (error.response?.status === 429) {
-            retries++;
-            if (retries >= maxRetries) throw error;
-            
-            // 等待 Retry-After 或指数退避
-            const retryAfter = parseInt(error.response.headers['retry-after'] || '0', 10);
-            const delay = retryAfter ? retryAfter * 1000 : Math.pow(2, retries) * 1000;
-            
-            console.log(`[SP-API] 速率限制。${delay}ms 后重试... (尝试 ${retries}/${maxRetries})`);
-            await new Promise(resolve => setTimeout(resolve, delay));
-            continue;
-          }
-          
-          // 处理 5xx 服务器错误 (可选,但有利于稳定性)
-          if (error.response?.status && error.response.status >= 500) {
-             retries++;
-             if (retries >= maxRetries) throw error;
-             const delay = Math.pow(2, retries) * 1000;
-             console.log(`[SP-API] 服务器错误。${delay}ms 后重试... (尝试 ${retries}/${maxRetries})`);
-             await new Promise(resolve => setTimeout(resolve, delay));
-             continue;
-          }
-        }
-        throw error;
-      }
-    }
-    throw new Error('超过最大重试次数');
-  }
-}

+ 0 - 33
modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/dev-server.ts

@@ -1,33 +0,0 @@
-
-import express from 'express';
-import { createSpApiRouter } from './routes.ts';
-import { initParse } from './parse-init.ts';
-
-const app = express();
-app.use(express.json());
-
-// Initialize Parse SDK
-// Ensure these environment variables are set when running the dev server
-initParse({
-  appId: 'msq-voc',
-  serverURL: 'https://server-msq.fmode.cn/parse'
-});
-
-const port = process.env.PORT || 3000;
-
-// Mount the SP-API router
-// Uses the default shopAuthMiddleware which checks for 'shop-objectid' header and queries Parse
-app.use('/sp-api', createSpApiRouter());
-
-app.get('/', (req, res) => {
-    res.send('SP-API Dev Server Running. Try /sp-api/orders');
-});
-
-app.listen(port, () => {
-  console.log(`Dev server running at http://localhost:${port}`);
-  console.log(`Ensure you have a running Parse Server and valid Shop ObjectId.`);
-  console.log(`Test URL: http://localhost:${port}/sp-api/orders?CreatedAfter=2023-01-01&marketplaceIds=ATVPDKIKX0DER`);
-  console.log(`Required Header: shop-objectid: <YOUR_SHOP_OBJECT_ID>`);
-});
-
-// curl -H "shop-objectid: mdHNWzZmcA" "http://localhost:3000/sp-api/sellers/account"

+ 0 - 79
modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/marketplace-helper.ts

@@ -1,79 +0,0 @@
-/**
- * 亚马逊 Marketplace ID 到区域端点的映射
- * 参考: https://developer-docs.amazon.com/sp-api/docs/sp-api-endpoints
- */
-
-const ENDPOINTS = {
-  NA: 'https://sellingpartnerapi-na.amazon.com',
-  EU: 'https://sellingpartnerapi-eu.amazon.com',
-  FE: 'https://sellingpartnerapi-fe.amazon.com'
-};
-
-const SANDBOX_ENDPOINTS = {
-  NA: 'https://sandbox.sellingpartnerapi-na.amazon.com',
-  EU: 'https://sandbox.sellingpartnerapi-eu.amazon.com',
-  FE: 'https://sandbox.sellingpartnerapi-fe.amazon.com'
-};
-
-const MARKETPLACE_REGION_MAP: Record<string, keyof typeof ENDPOINTS> = {
-  // 北美
-  'A2EUQ1WTGCTBG2': 'NA', // 加拿大
-  'ATVPDKIKX0DER': 'NA', // 美国
-  'A1AM78C64UM0Y8': 'NA', // 墨西哥
-  'A2Q3Y263D00KWC': 'NA', // 巴西
-
-  // 欧洲
-  'A1RKKUPIHCS9HS': 'EU', // 西班牙
-  'A1F83G8C2ARO7P': 'EU', // 英国
-  'A13V1IB3VIYZZH': 'EU', // 法国
-  'A1805IZSGTT6HS': 'EU', // 比利时
-  'A1PA6795UKMFR9': 'EU', // 德国
-  'APJ6JRA9NG5V4': 'EU', // 意大利
-  'A2NODRKZP88ZB9': 'EU', // 瑞典
-  'AE08WJ6EMKS27': 'EU', // 埃及
-  'A1C3SOZRARQ6R3': 'EU', // 波兰
-  'AMEN7PMS3EDWL': 'EU', // 比利时 (重复? 检查中...) - 实际上 BE 是 A1805IZSGTT6HS.
-  'A33AVAJ2PDY3EV': 'EU', // 土耳其
-  'A17E79C6D8DWNP': 'EU', // 沙特阿拉伯
-  'A2VIGQ35RCS4UG': 'EU', // 阿联酋
-  'ARBP9OOSHTCHU': 'EU', // 埃及 (重复?)
-  'A21TJRUUN4KGV': 'EU', // 印度
-
-  // 远东
-  'A1VC38T7YXB528': 'FE', // 日本
-  'A39IBJ37TRP1C6': 'FE', // 澳大利亚
-  'A19VAU5U5O7RUS': 'FE', // 新加坡
-};
-
-/**
- * 根据 Marketplace ID 获取 SP-API 端点
- */
-export const getEndpointByMarketplaceId = (marketplaceId: string, isSandbox = false): string => {
-  const region = MARKETPLACE_REGION_MAP[marketplaceId] || 'NA'; // 如果未知则默认为 NA
-  const endpoints = isSandbox ? SANDBOX_ENDPOINTS : ENDPOINTS;
-  return endpoints[region];
-};
-
-/**
- * 根据区域代码获取 SP-API 端点
- * @param regionCode e.g., 'us-east-1', 'eu-west-1', 'us-west-2' or 'NA', 'EU', 'FE'
- */
-export const getEndpointByRegion = (regionCode: string, isSandbox = false): string => {
-  const endpoints = isSandbox ? SANDBOX_ENDPOINTS : ENDPOINTS;
-  
-  // Map AWS regions to SP-API regions
-  const awsRegionMap: Record<string, keyof typeof ENDPOINTS> = {
-    'us-east-1': 'NA',
-    'eu-west-1': 'EU',
-    'us-west-2': 'FE'
-  };
-
-  const regionKey = awsRegionMap[regionCode] || (regionCode as keyof typeof ENDPOINTS);
-  
-  if (endpoints[regionKey]) {
-    return endpoints[regionKey];
-  }
-  
-  // Default to NA if unknown
-  return endpoints.NA;
-};

+ 0 - 53
modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/middleware/auth.ts

@@ -1,53 +0,0 @@
-import { Request, Response, NextFunction } from 'express';
-import { getParse } from '../parse-init.ts';
-import { ShopConfig } from '../types.ts';
-
-export const shopAuthMiddleware = async (req: Request, res: Response, next: NextFunction) => {
-  try {
-    const shopId = req.headers['shop-objectid'] as string || req.headers['x-shop-objectid'] as string;
-    if (!shopId) {
-      return res.status(400).json({
-        success: false,
-        message: '缺少必需的 header: shop-objectId'
-      });
-    }
-
-    const Parse = getParse();
-    const query = new Parse.Query('Shop');
-    let shop: Parse.Object;
-    
-    try {
-      shop = await query.get(shopId);
-      console.log('[SP-API] 认证中间件:', shop.get('name'));
-    } catch (error) {
-      return res.status(400).json({
-        success: false,
-        message: `无效的 shopId: ${shopId}`
-      });
-    }
-
-    const config = shop.get('config').SpApiConfig as ShopConfig;
-    console.log('[SP-API] 认证中间件:', config);
-    if (!config || !config.clientId || !config.clientSecret || !config.refreshToken) {
-      return res.status(400).json({
-        success: false,
-        message: '缺少亚马逊配置信息'
-      });
-    }
-
-    req.spApiContext = {
-      shopId,
-      marketplaceId: shop.get('marketplaceId'),
-      config
-    };
-
-    next();
-  } catch (error: any) {
-    console.error('[SP-API] 认证中间件错误:', error);
-    res.status(500).json({
-      success: false,
-      message: '店铺认证期间发生内部服务器错误',
-      error: error.message
-    });
-  }
-};

+ 0 - 17
modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/mod.ts

@@ -1,17 +0,0 @@
-export * from './client.ts';
-export * from './types.ts';
-export * from './routes.ts';
-export * from './parse-init.ts';
-
-export * from './api/customerFeedback.ts';
-export * from './api/orders.ts';
-export * from './api/sales.ts';
-export * from './api/listings.ts';
-export * from './api/externalFulfillment.ts';
-export * from './api/catalogItems.ts';
-export * from './api/inventory.ts';
-export * from './api/pricing.ts';
-export * from './api/reports.ts';
-export * from './api/notifications.ts';
-export * from './api/sellers.ts';
-

+ 0 - 29
modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/parse-init.ts

@@ -1,29 +0,0 @@
-import Parse from 'parse/node';
-import { ParseInitConfig } from './types.ts';
-
-let isInitialized = false;
-
-/**
- * 初始化 Parse SDK
- */
-export const initParse = (config: ParseInitConfig) => {
-  if (isInitialized) {
-    console.warn('[SP-API] Parse already initialized, skipping...');
-    return;
-  }
-
-  Parse.initialize(config.appId, config.javascriptKey, config.masterKey);
-  Parse.serverURL = config.serverURL;
-  isInitialized = true;
-  console.log(`[SP-API] Parse initialized with appId: ${config.appId} at ${config.serverURL}`);
-};
-
-/**
- * 获取 Parse 实例 (确保已初始化)
- */
-export const getParse = () => {
-  if (!isInitialized) {
-    throw new Error('[SP-API] Parse not initialized! Call initParse() first.');
-  }
-  return Parse;
-};

+ 0 - 282
modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/routes.ts

@@ -1,282 +0,0 @@
-import { Router, Request, Response, NextFunction } from 'express';
-import { SpApiClient } from './client.ts';
-import { shopAuthMiddleware } from './middleware/auth.ts';
-import { CustomerFeedbackApi } from './api/customerFeedback.ts';
-import { OrdersApi } from './api/orders.ts';
-import { SalesApi } from './api/sales.ts';
-import { ListingsApi } from './api/listings.ts';
-import { ExternalFulfillmentApi } from './api/externalFulfillment.ts';
-import { CatalogItemsApi } from './api/catalogItems.ts';
-// import { InventoryApi } from './api/inventory.ts';
-// import { PricingApi } from './api/pricing.ts';
-// import { ReportsApi } from './api/reports.ts';
-// import { NotificationsApi } from './api/notifications.ts';
-import { SellersApi } from './api/sellers.ts';
-
-// Unified Response Format
-const sendResponse = (res: Response, data: any) => {
-  res.json({
-    success: true,
-    data,
-    timestamp: new Date().toISOString()
-  });
-};
-
-const asyncHandler = (fn: (req: Request, res: Response, next: NextFunction) => Promise<any>) => 
-  (req: Request, res: Response, next: NextFunction) => {
-    Promise.resolve(fn(req, res, next)).catch(next);
-  };
-
-/**
- * 创建 SP-API 路由 (动态配置版)
- * 不需要传入静态 client,而是使用中间件动态配置
- */
-export const createSpApiRouter = (staticClient?: SpApiClient) => {
-  const router = Router();
-  
-  // Apply Shop Authentication Middleware to all routes
-  router.use(shopAuthMiddleware);
-
-  // Helper to inject client with context
-  const getClient = (req: Request): SpApiClient => {
-    // We reuse a singleton instance or static methods if possible, 
-    // but since SpApiClient is now stateless-ish (config via method params), 
-    // we can use a single instance.
-    // However, to keep it clean, let's use the passed staticClient or create a new one.
-    // The important part is passing the context to the API methods.
-    return staticClient || new SpApiClient();
-  };
-
-  // Helper to wrap API calls with context injection
-  // Since we modified SpApiClient.request to take context, 
-  // but the individual API classes (e.g. OrdersApi) wraps the client.request call,
-  // we need to pass the context down.
-  // OPTION: We can modify the individual API classes to accept context in their methods?
-  // OR: We can use a Proxy or Factory to inject context into the client before passing to API.
-  
-  // Better approach for minimal refactor of API classes:
-  // Create a "Scoped Client" that pre-fills the context.
-  
-  const createScopedApi = <T>(ApiClass: new (client: SpApiClient) => T, req: Request): T => {
-    const baseClient = getClient(req);
-    
-    // Create a proxy client that injects context into request()
-    const scopedClient = {
-      request: async (options: any) => {
-        return baseClient.request({
-          ...options,
-          context: {
-            shopId: req.spApiContext?.shopId,
-            marketplaceId: req.spApiContext?.marketplaceId,
-            config: req.spApiContext?.config
-          }
-        });
-      }
-    } as SpApiClient;
-
-    return new ApiClass(scopedClient);
-  };
-
-  // --- Customer Feedback ---
-  router.get('/customerFeedback/items/:asin/reviews/topics', asyncHandler(async (req, res) => {
-    const api = createScopedApi(CustomerFeedbackApi, req);
-    const result = await api.getItemReviewTopics({ ...req.query, asin: req.params.asin } as any);
-    sendResponse(res, result);
-  }));
-  
-  router.get('/customerFeedback/items/:asin/browseNode', asyncHandler(async (req, res) => {
-    const api = createScopedApi(CustomerFeedbackApi, req);
-    const result = await api.getItemBrowseNode({ ...req.query, asin: req.params.asin } as any);
-    sendResponse(res, result);
-  }));
-
-  router.get('/customerFeedback/browseNodes/:browseNodeId/reviews/topics', asyncHandler(async (req, res) => {
-    const api = createScopedApi(CustomerFeedbackApi, req);
-    const result = await api.getBrowseNodeReviewTopics({ ...req.query, browseNodeId: req.params.browseNodeId } as any);
-    sendResponse(res, result);
-  }));
-
-  router.get('/customerFeedback/items/:asin/reviews/trends', asyncHandler(async (req, res) => {
-    const api = createScopedApi(CustomerFeedbackApi, req);
-    const result = await api.getItemReviewTrends({ ...req.query, asin: req.params.asin } as any);
-    sendResponse(res, result);
-  }));
-
-  router.get('/customerFeedback/browseNodes/:browseNodeId/reviews/trends', asyncHandler(async (req, res) => {
-    const api = createScopedApi(CustomerFeedbackApi, req);
-    const result = await api.getBrowseNodeReviewTrends({ ...req.query, browseNodeId: req.params.browseNodeId } as any);
-    sendResponse(res, result);
-  }));
-
-  router.get('/customerFeedback/browseNodes/:browseNodeId/returns/topics', asyncHandler(async (req, res) => {
-    const api = createScopedApi(CustomerFeedbackApi, req);
-    const result = await api.getBrowseNodeReturnTopics({ ...req.query, browseNodeId: req.params.browseNodeId } as any);
-    sendResponse(res, result);
-  }));
-
-  router.get('/customerFeedback/browseNodes/:browseNodeId/returns/trends', asyncHandler(async (req, res) => {
-    const api = createScopedApi(CustomerFeedbackApi, req);
-    const result = await api.getBrowseNodeReturnTrends({ ...req.query, browseNodeId: req.params.browseNodeId } as any);
-    sendResponse(res, result);
-  }));
-  
-  // --- Orders ---
-  router.get('/orders', asyncHandler(async (req, res) => {
-    const api = createScopedApi(OrdersApi, req);
-    const result = await api.getOrders(req.query as any);
-    console.log('result', result);
-    sendResponse(res, result);
-  }));
-  
-  router.get('/orders/:orderId', asyncHandler(async (req:any, res) => {
-    const api = createScopedApi(OrdersApi, req);
-    const result = await api.getOrder(req.params.orderId);
-    sendResponse(res, result);
-  }));
-  
-  router.get('/orders/:orderId/items', asyncHandler(async (req:any, res) => {
-    const api = createScopedApi(OrdersApi, req);
-    const result = await api.getOrderItems(req.params.orderId, req.query.NextToken as string);
-    sendResponse(res, result);
-  }));
-
-  // --- Sales ---
-  router.get('/sales/orderMetrics', asyncHandler(async (req:any, res) => {
-    const api = createScopedApi(SalesApi, req);
-    const result = await api.getOrderMetrics(req.query as any);
-    sendResponse(res, result);
-  }));
-
-  // --- Listings ---
-  router.get('/listings/items/:sellerId', asyncHandler(async (req:any, res) => {
-    const api = createScopedApi(ListingsApi, req);
-    const result = await api.searchListingsItems({ ...req.query, sellerId: req.params.sellerId } as any);
-    sendResponse(res, result);
-  }));
-  
-  router.get('/listings/items/:sellerId/:sku', asyncHandler(async (req:any, res) => {
-    const api = createScopedApi(ListingsApi, req);
-    const result = await api.getListingsItem({ ...req.query, sellerId: req.params.sellerId, sku: req.params.sku } as any);
-    sendResponse(res, result);
-  }));
-  
-  router.put('/listings/items/:sellerId/:sku', asyncHandler(async (req:any, res) => {
-    const api = createScopedApi(ListingsApi, req);
-    const marketplaceIds = (req.query.marketplaceIds as string)?.split(',') || [];
-    const result = await api.putListingsItem(req.params.sellerId, req.params.sku, marketplaceIds, req.body);
-    sendResponse(res, result);
-  }));
-  
-  router.delete('/listings/items/:sellerId/:sku', asyncHandler(async (req:any, res) => {
-    const api = createScopedApi(ListingsApi, req);
-    const marketplaceIds = (req.query.marketplaceIds as string)?.split(',') || [];
-    const result = await api.deleteListingsItem(req.params.sellerId, req.params.sku, marketplaceIds);
-    sendResponse(res, result);
-  }));
-
-  // --- External Fulfillment ---
-  router.get('/externalFulfillment/returns', asyncHandler(async (req, res) => {
-    const api = createScopedApi(ExternalFulfillmentApi, req);
-    const result = await api.listReturns(req.query as any);
-    sendResponse(res, result);
-  }));
-  
-  router.get('/externalFulfillment/returns/:returnId', asyncHandler(async (req:any, res) => {
-    const api = createScopedApi(ExternalFulfillmentApi, req);
-    const result = await api.getReturn(req.params.returnId);
-    sendResponse(res, result);
-  }));
-
-  // --- Catalog Items ---
-  router.get('/catalog/categories', asyncHandler(async (req, res) => {
-    const api = createScopedApi(CatalogItemsApi, req);
-    const result = await api.listCatalogCategories(req.query as any);
-    sendResponse(res, result);
-  }));
-
-  router.get('/catalog/items', asyncHandler(async (req, res) => {
-    const api = createScopedApi(CatalogItemsApi, req);
-    const result = await api.searchCatalogItems(req.query as any);
-    sendResponse(res, result);
-  }));
-
-  router.get('/catalog/items/:asin', asyncHandler(async (req, res) => {
-    const api = createScopedApi(CatalogItemsApi, req);
-    const result = await api.getCatalogItem({ ...req.query, asin: req.params.asin } as any);
-    sendResponse(res, result);
-  }));
-
-  // // --- Inventory ---
-  // router.get('/inventory/summaries', asyncHandler(async (req, res) => {
-  //   const api = createScopedApi(InventoryApi, req);
-  //   const result = await api.getInventorySummaries(req.query as any);
-  //   sendResponse(res, result);
-  // }));
-
-  // // --- Pricing ---
-  // router.get('/pricing/price', asyncHandler(async (req, res) => {
-  //   const api = createScopedApi(PricingApi, req);
-  //   const result = await api.getPricing(req.query as any);
-  //   sendResponse(res, result);
-  // }));
-
-  // router.get('/pricing/competitivePrice', asyncHandler(async (req, res) => {
-  //   const api = createScopedApi(PricingApi, req);
-  //   const result = await api.getCompetitivePricing(req.query as any);
-  //   sendResponse(res, result);
-  // }));
-
-  // // --- Reports ---
-  // router.post('/reports', asyncHandler(async (req, res) => {
-  //   const api = createScopedApi(ReportsApi, req);
-  //   const result = await api.createReport(req.body);
-  //   sendResponse(res, result);
-  // }));
-
-  // router.get('/reports/:reportId', asyncHandler(async (req, res) => {
-  //   const api = createScopedApi(ReportsApi, req);
-  //   const result = await api.getReport(req.params.reportId);
-  //   sendResponse(res, result);
-  // }));
-
-  // router.get('/reports/documents/:reportDocumentId', asyncHandler(async (req, res) => {
-  //   const api = createScopedApi(ReportsApi, req);
-  //   const result = await api.getReportDocument(req.params.reportDocumentId);
-  //   sendResponse(res, result);
-  // }));
-
-  // // --- Notifications ---
-  // router.post('/notifications/subscriptions/:notificationType', asyncHandler(async (req, res) => {
-  //   const api = createScopedApi(NotificationsApi, req);
-  //   const result = await api.createSubscription(req.params.notificationType, req.body);
-  //   sendResponse(res, result);
-  // }));
-
-  // router.get('/notifications/subscriptions/:notificationType/:subscriptionId', asyncHandler(async (req, res) => {
-  //   const api = createScopedApi(NotificationsApi, req);
-  //   const result = await api.getSubscription(req.params.notificationType, req.params.subscriptionId);
-  //   sendResponse(res, result);
-  // }));
-
-  // router.delete('/notifications/subscriptions/:notificationType/:subscriptionId', asyncHandler(async (req, res) => {
-  //   const api = createScopedApi(NotificationsApi, req);
-  //   const result = await api.deleteSubscription(req.params.notificationType, req.params.subscriptionId);
-  //   sendResponse(res, result);
-  // }));
-
-  // --- Sellers ---
-  router.get('/sellers/account', asyncHandler(async (req, res) => {
-    const api = createScopedApi(SellersApi, req);
-    const result: any = await api.getAccount();
-    console.log(result.data.errors);
-    sendResponse(res, result);
-  }));
-
-  router.get('/sellers/marketplaceParticipations', asyncHandler(async (req, res) => {
-    const api = createScopedApi(SellersApi, req);
-    const result = await api.getMarketplaceParticipations();
-    sendResponse(res, result);
-  }));
-
-  return router;
-};

+ 0 - 406
modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/src/types.ts

@@ -1,406 +0,0 @@
-import Parse from 'parse/node'; // 引入 Parse SDK
-/**
- * Parse Server 初始化配置
- */
-export interface ParseInitConfig {
-  appId: string;
-  serverURL: string;
-  masterKey?: string;
-  javascriptKey?: string;
-}
-
-/**
- * 数据库中的 Shop 配置对象结构 (存储在 config 字段中)
- */
-export interface ShopConfig {
-  clientId: string;
-  clientSecret: string;
-  refreshToken: string;
-  sandbox?: boolean;
-  region?: string; // e.g., 'us-east-1', 'eu-west-1', 'us-west-2'
-}
-
-/**
- * 扩展 Express Request 接口
- */
-declare global {
-  namespace Express {
-    interface Request {
-      spApiContext?: {
-        shopId: string;
-        marketplaceId?: string;
-        config: ShopConfig;
-        // parseShop: Parse.Object; // Removed as per requirement
-      };
-    }
-  }
-}
-
-/**
- * SP-API 配置 (Legacy - for direct usage without Parse)
- */
-export interface SpApiConfig {
-  clientId: string;
-  clientSecret: string;
-  refreshToken: string;
-  region: string; // e.g., 'us-east-1', 'eu-west-1'
-  sandbox?: boolean; // 是否使用沙箱环境
-}
-
-/**
- * LWA Token 响应
- */
-export interface LwaTokenResponse {
-  access_token: string;
-  refresh_token: string;
-  token_type: string;
-  expires_in: number;
-}
-
-/**
- * 基础请求参数
- */
-export interface BaseRequestParams {
-  marketplaceId?: string;
-  marketplaceIds?: string[];
-}
-
-/**
- * Customer Feedback: GetItemReviewTopics 请求参数
- */
-export interface GetItemReviewTopicsParams extends BaseRequestParams {
-  asin: string;
-  itemName?: string;
-  countryCode?: string;
-  dateRange?: {
-    startDate: string;
-    endDate: string;
-  };
-}
-
-/**
- * Orders: GetOrders 请求参数
- */
-export interface GetOrdersParams {
-  MarketplaceIds: string[];
-  CreatedAfter?: string;
-  CreatedBefore?: string;
-  LastUpdatedAfter?: string;
-  LastUpdatedBefore?: string;
-  OrderStatuses?: string[];
-  FulfillmentChannels?: string[];
-  PaymentMethods?: string[];
-  BuyerEmail?: string;
-  SellerOrderId?: string;
-  MaxResultsPerPage?: number;
-  EasyShipShipmentStatuses?: string[];
-  ElectronicInvoiceStatuses?: string[];
-  NextToken?: string;
-  AmazonOrderIds?: string[];
-  ActualFulfillmentSupplySourceId?: string;
-  IsISPU?: boolean;
-  StoreChainStoreId?: string;
-}
-
-/**
- * Sales: GetOrderMetrics 请求参数
- */
-export interface GetOrderMetricsParams {
-  marketplaceIds: string[];
-  interval: string; // e.g., "2018-09-01T00:00:00-07:00--2018-09-04T00:00:00-07:00"
-  granularity: 'Hour' | 'Day' | 'Week' | 'Month' | 'Year' | 'Total';
-  granularityTimeZone?: string;
-  buyerType?: 'B2B' | 'B2C' | 'All';
-  fulfillmentNetwork?: string;
-  firstDayOfWeek?: 'Monday' | 'Sunday';
-  asin?: string;
-  sku?: string;
-}
-
-/**
- * Listings: SearchListingsItems 请求参数
- */
-export interface SearchListingsItemsParams {
-  sellerId: string;
-  marketplaceIds: string[];
-  issueLocale?: string;
-  includedData?: string[]; // e.g., ["summaries", "attributes", "issues", "offers", "fulfillmentAvailability", "procurement"]
-  identifiers?: string[];
-  identifiersType?: 'ASIN' | 'SKU';
-  asin?: string[]; // 文档示例似乎有 asin, 但 searchListingsItems 通常用 identifiers
-  pageToken?: string;
-  pageSize?: number;
-  keywords?: string[]; // 搜索关键词
-}
-
-/**
- * Listings: GetListingsItem 请求参数
- */
-export interface GetListingsItemParams {
-  sellerId: string;
-  sku: string;
-  marketplaceIds: string[];
-  issueLocale?: string;
-  includedData?: string[];
-}
-
-/**
- * External Fulfillment: ListReturns 请求参数
- */
-export interface ListReturnsParams {
-  sellerId?: string; // 客户端封装有时需要
-  marketplaceIds?: string[]; // 通常可选或可推断
-  creationDate?: string;
-  lastUpdatedDate?: string;
-  nextToken?: string;
-}
-
-/**
- * Catalog Items: ListCatalogCategories 请求参数
- */
-export interface ListCatalogCategoriesParams {
-  MarketplaceId: string;
-  ASIN?: string;
-  SellerSKU?: string;
-}
-
-/**
- * Catalog Items: SearchCatalogItems 请求参数
- */
-export interface SearchCatalogItemsParams {
-  marketplaceIds: string[];
-  identifiers?: string[];
-  identifiersType?: 'ASIN' | 'EAN' | 'GTIN' | 'ISBN' | 'JAN' | 'MINSAN' | 'SKU' | 'UPC';
-  keywords?: string[];
-  brandNames?: string[];
-  classificationIds?: string[];
-  pageSize?: number;
-  pageToken?: string;
-  keywordsLocale?: string;
-}
-
-/**
- * Catalog Items: GetCatalogItem 请求参数
- */
-export interface GetCatalogItemParams {
-  asin: string;
-  marketplaceIds: string[];
-  includedData?: string[];
-  locale?: string;
-}
-
-/**
- * Inventory: GetInventorySummaries 请求参数 (Standard SP-API)
- */
-export interface GetInventorySummariesParams {
-  granularityType: 'Marketplace';
-  granularityId: string;
-  marketplaceIds: string[];
-  details?: boolean;
-  startDateTime?: string;
-  sellerSkus?: string[];
-  nextToken?: string;
-}
-
-/**
- * Pricing: GetPricing 请求参数 (Standard SP-API)
- */
-export interface GetPricingParams {
-  MarketplaceId: string;
-  Asins?: string[];
-  Skus?: string[];
-  ItemType: 'Asin' | 'Sku';
-  ItemCondition?: 'New' | 'Used' | 'Collectible' | 'Refurbished' | 'Club';
-  OfferType?: 'B2C' | 'B2B';
-}
-
-/**
- * Reports: CreateReport 请求参数 (Standard SP-API)
- */
-export interface CreateReportParams {
-  reportType: string;
-  dataStartTime?: string;
-  dataEndTime?: string;
-  marketplaceIds: string[];
-  reportOptions?: Record<string, string>;
-}
-
-/**
- * Notifications: CreateSubscription 请求参数 (Standard SP-API)
- */
-export interface CreateSubscriptionParams {
-  payloadVersion: string;
-  destinationId: string;
-  notificationType: string; // 例如:'ORDER_CHANGE'
-}
-
-// --- 响应类型定义 (简化版,根据需要扩展) ---
-
-export interface SpApiResponse<T> {
-  payload?: T;
-  errors?: SpApiError[];
-}
-
-export interface SpApiError {
-  code: string;
-  message: string;
-  details?: string;
-}
-
-// Customer Feedback 响应
-export interface ReviewTopic {
-  topic: string;
-  asinMetrics?: any;
-  reviewSnippets?: string[];
-  subtopics?: any[];
-}
-
-export interface GetItemReviewTopicsResponse {
-  asin: string;
-  topics: {
-    positiveTopics: ReviewTopic[];
-    negativeTopics: ReviewTopic[];
-  };
-}
-
-// Orders 响应
-export interface Order {
-  AmazonOrderId: string;
-  PurchaseDate: string;
-  LastUpdateDate: string;
-  OrderStatus: string;
-  FulfillmentChannel?: string;
-  SalesChannel?: string;
-  OrderTotal?: {
-    CurrencyCode: string;
-    Amount: string;
-  };
-  NumberOfItemsShipped?: number;
-  NumberOfItemsUnshipped?: number;
-  PaymentMethod?: string;
-  MarketplaceId?: string;
-  BuyerInfo?: {
-    BuyerEmail?: string;
-    BuyerName?: string;
-  };
-  // ... 其他字段
-}
-
-export interface GetOrdersResponse {
-  Orders: Order[];
-  NextToken?: string;
-  LastUpdatedBefore?: string;
-  CreatedBefore?: string;
-}
-
-// Sales 响应
-export interface OrderMetricsInterval {
-  interval: string;
-  unitCount: number;
-  orderItemCount: number;
-  orderCount: number;
-  averageUnitPrice: {
-    currencyCode: string;
-    amount: string;
-  };
-  totalSales: {
-    currencyCode: string;
-    amount: string;
-  };
-}
-
-export type GetOrderMetricsResponse = OrderMetricsInterval[];
-
-// Listings 响应
-export interface ItemSummary {
-  marketplaceId: string;
-  asin: string;
-  productType: string;
-  conditionType?: string;
-  status: string[];
-  itemName: string;
-  createdDate: string;
-  lastUpdatedDate: string;
-  mainImage?: {
-    link: string;
-    height: number;
-    width: number;
-  };
-}
-
-export interface ListingsItem {
-  sku: string;
-  summaries?: ItemSummary[];
-  attributes?: any;
-  issues?: any[];
-  offers?: any[];
-}
-
-export interface SearchListingsItemsResponse {
-  numberOfResults: number;
-  pagination?: {
-    nextToken?: string;
-    previousToken?: string;
-  };
-  items: ListingsItem[];
-}
-
-// --- Sellers 响应 ---
-
-export interface Marketplace {
-  id: string;
-  name: string;
-  countryCode: string;
-  defaultCurrencyCode: string;
-  defaultLanguageCode: string;
-  domainName: string;
-}
-
-export interface Participation {
-  isParticipating: boolean;
-  hasSuspendedListings: boolean;
-}
-
-export interface MarketplaceParticipation {
-  marketplace: Marketplace;
-  participation: Participation;
-}
-
-export type GetMarketplaceParticipationsResponse = MarketplaceParticipation[];
-
-export interface Business {
-  name: string;
-  registeredBusinessAddress: {
-    addressLine1: string;
-    addressLine2?: string;
-    city?: string;
-    stateOrProvinceCode?: string;
-    countryCode: string;
-    postalCode?: string;
-  };
-  companyRegistrationNumber?: string;
-  companyTaxIdentificationNumber?: string;
-  nonLatinName?: string;
-}
-
-export interface PrimaryContact {
-  name: string;
-  address: {
-    addressLine1: string;
-    addressLine2?: string;
-    city?: string;
-    stateOrProvinceCode?: string;
-    countryCode: string;
-    postalCode?: string;
-  };
-  nonLatinName?: string;
-}
-
-export interface GetAccountResponse {
-  marketplaceParticipationList: MarketplaceParticipation[];
-  businessType: 'CHARITY' | 'CRAFTSMAN' | 'NATURAL_PERSON_COMPANY' | 'PUBLIC_LISTED' | 'PRIVATE_LIMITED' | 'SOLE_PROPRIETORSHIP' | 'STATE_OWNED' | 'INDIVIDUAL';
-  buyingRole: 'BUYING_PROFESSIONAL' | 'BUYING_RESELLER';
-  sellingPlan: 'PROFESSIONAL' | 'INDIVIDUAL';
-  business?: Business;
-  primaryContact?: PrimaryContact;
-}

+ 0 - 67
modules/fmode-tikhub-server/docs/fmode-amazon-sp-api/test_auth.ts

@@ -1,67 +0,0 @@
-
-import { SpApiClient } from './src/client.ts';
-import { SpApiConfig } from './src/types.ts';
-
-// 从环境变量读取配置,或者使用占位符
-const config: SpApiConfig = {
-  clientId:'amzn1.application-oa2-client.afc01e883d4143bcae466247ac5fe692',
-  clientSecret:'amzn1.oa2-cs.v1.eb3330dce4b5c835b0d22e855c8db1082632b99ed7226db7114557b3c562d038',
-  refreshToken:'Atzr|IwEBIC8ubYHG1E9Li2-_madN1smv4tKNgv9-SZTkW-OxlyeiXVQMbRon_7-ON9s2spa-fBsi6G1KXdk8eSO2SlyM-5BxMUufTTclXDCmDZWHg6wmi6HPwRceGDbWhqjIuPWseNj4uyBBjUcd9F6O_RYzEsu1yss67RcZikPI7t_i-tUhF5W8l2Ufj2Sl9JXGycxNoJKbZzApPVVLwja_JaiAlqhZX4JYM1gfK9dgynJNgcPhnVZRJ0vNOkurQPtSp6_Yix6itvMhN5QeXZwJdd5xW1T7C6TJXsHJLiEPfTeJIEj7m7UwgdDS7YvdryIL8cMl5Gc',
-  region: 'us-east-1'
-};
-
-
-
-console.log('Initializing SP-API Client with config:', {
-  ...config
-});
-
-const client = new SpApiClient(config);
-
-async function testAuth() {
-  try {
-    console.log('Attempting to fetch Access Token...');
-    // 通过访问私有方法或者触发请求来测试
-    // 由于 getAccessToken 是私有的,我们通过 request 方法触发它
-    // 我们故意请求一个不存在的端点,如果能走到 404,说明 Auth 成功了
-    // 如果是 400/401 且来自 Amazon Auth Server,说明 Auth 失败
-    await client.request({
-      method: 'GET',
-      path: '/orders/v0/orders',
-      query: {
-        MarketplaceIds: ['ATVPDKIKX0DER'], // getOrders expects MarketplaceIds as a list
-        CreatedAfter: '2023-10-01T00:00:00Z'
-      }
-    });
-    console.log('Request executed successfully.');
-  } catch (error: any) {
-    console.log('Test finished with error.');
-    
-    if (error.response) {
-      console.log('HTTP Status:', error.response.status);
-      console.log('Response Data:', JSON.stringify(error.response.data, null, 2));
-      
-      // 分析错误来源
-      if (error.config && error.config.url && error.config.url.includes('api.amazon.com/auth/o2/token')) {
-         console.error('❌ LWA Authentication Failed: Unable to get Access Token.');
-      } else if (error.response.status === 403) {
-         console.log('✅ Access Token acquired successfully! (But API request forbidden/invalid as expected with dummy creds)');
-      } else if (error.response.status === 404) {
-         console.log('✅ Access Token acquired successfully! (API endpoint not found)');
-      } else if (error.response.status === 401) {
-          console.log('❌ API Unauthorized: Access Token might be invalid or expired immediately.');
-      } else {
-          // 如果是我们预期的 token 请求错误
-          if (error.message.includes('refresh_token')) {
-              console.error('❌ LWA Token Error:', error.message);
-          }
-      }
-    } else {
-      console.error('Error Message:', error.message);
-    }
-  }
-}
-
-testAuth();
-
-

Разница между файлами не показана из-за своего большого размера
+ 19 - 1070
modules/fmode-tikhub-server/package-lock.json


+ 7 - 12
modules/fmode-tikhub-server/package.json

@@ -1,17 +1,12 @@
-
 {
-  "name": "@fmode/tikhub-server",
-  "version": "1.0.0",
-  "description": "TikHub API 集成模块",
-  "type": "module",
-  "main": "src/mod.ts",
-  "exports": {
-    ".": "./src/mod.ts",
-    "./client": "./src/client.ts",
-    "./types": "./src/types.ts",
-    "./api/users": "./src/api/users.ts"
-  },
+  "name": "fmode-tikhub-api-customize",
+  "version": "0.0.2",
+  "description": "TikHub API Module for Node.js",
+  "main": "dist/mod.js",
+  "types": "dist/mod.d.ts",
   "scripts": {
+    "build": "bash build.sh",
+    "upload": "bash upload.sh",
     "test": "echo \"No tests yet\""
   },
   "keywords": [

+ 3 - 0
modules/fmode-tikhub-server/src/mod.ts

@@ -4,3 +4,6 @@ export * from './client.ts';
 export * from './api/users.ts';
 export * from './api/instagram.ts';
 export * from './routes.ts';
+
+// Alias export for compatibility with api/routes.ts
+export { createTikHubRouter as createTikHubCustomizeRoutes } from './routes.ts';

+ 2 - 1
modules/fmode-tikhub-server/src/routes.ts

@@ -3,6 +3,7 @@ import { Router, Request, Response, NextFunction } from 'express';
 import { TikHubClient } from './client.ts';
 import { TikHubUsersApi } from './api/users.ts';
 import { InstagramApi } from './api/instagram.ts';
+import { TikHubConfig } from './types.ts';
 
 // 统一响应格式
 const sendResponse = (res: Response, data: any) => {
@@ -22,7 +23,7 @@ const asyncHandler = (fn: (req: Request, res: Response, next: NextFunction) => P
  * 创建 TikHub 路由
  * @param config 可选配置,用于初始化 TikHubClient
  */
-export const createTikHubRouter = (config?: any) => {
+export const createTikHubRouter = (config?: TikHubConfig) => {
   const router = Router();
   
   // 单例 Client (或者根据请求创建,如果需要动态配置)

+ 161 - 0
modules/fmode-tikhub-server/upload.sh

@@ -0,0 +1,161 @@
+#!/bin/bash
+
+###############################################################################
+# fmode-tikhub-api-customize CDN上传脚本
+#
+# 功能:
+# 1. 上传打包后的文件到七牛云CDN
+# 2. 支持上传指定版本或最新版本
+#
+# 使用方法:
+#   chmod +x upload.sh
+#   ./upload.sh              # 上传最新版本
+#   ./upload.sh 1.0.0        # 上传指定版本
+#
+# 前置条件:
+#   需要安装并配置 qshell 工具
+#   参考: https://developer.qiniu.com/kodo/tools/1302/qshell
+###############################################################################
+
+# 设置错误时退出
+set -e
+
+# 颜色输出
+GREEN='\033[0;32m'
+YELLOW='\033[1;33m'
+RED='\033[0;31m'
+BLUE='\033[0;34m'
+NC='\033[0m' # No Color
+
+echo -e "${GREEN}==================================================${NC}"
+echo -e "${GREEN}   fmode-tikhub-api-customize CDN上传脚本${NC}"
+echo -e "${GREEN}==================================================${NC}"
+
+# 检查qshell是否安装
+if ! command -v qshell &> /dev/null; then
+    echo -e "${RED}错误: qshell 未安装${NC}"
+    echo -e "${YELLOW}请先安装 qshell: https://developer.qiniu.com/kodo/tools/1302/qshell${NC}"
+    exit 1
+fi
+
+# 检查是否在正确的目录
+if [ ! -f "package.json" ]; then
+    echo -e "${RED}错误: package.json 不存在${NC}"
+    echo -e "${YELLOW}请确保在 fmode-tikhub-api-customize 目录下运行此脚本${NC}"
+    exit 1
+fi
+
+# 获取版本号(从参数或package.json)
+if [ -n "$1" ]; then
+    VERSION="$1"
+    echo -e "${YELLOW}使用指定版本: ${VERSION}${NC}"
+else
+    VERSION=$(node -p "require('./package.json').version" 2>/dev/null || echo "1.0.0")
+    echo -e "${YELLOW}使用package.json版本: ${VERSION}${NC}"
+fi
+
+# 检查dist目录是否存在
+DIST_DIR="dist/${VERSION}"
+if [ ! -d "${DIST_DIR}" ]; then
+    echo -e "${RED}错误: ${DIST_DIR} 目录不存在${NC}"
+    echo -e "${YELLOW}请先运行 ./build.sh 构建项目${NC}"
+    exit 1
+fi
+
+# CDN配置
+BUCKET="nova-repos"
+CDN_PREFIX="x/fmode-tikhub-api-customize/${VERSION}"
+
+echo ""
+echo -e "${BLUE}上传配置:${NC}"
+echo -e "  Bucket: ${BUCKET}"
+echo -e "  CDN路径: ${CDN_PREFIX}"
+echo -e "  本地目录: ${DIST_DIR}"
+echo ""
+
+# 确认上传
+read -p "确认上传到CDN?(y/N) " -n 1 -r
+echo
+if [[ ! $REPLY =~ ^[Yy]$ ]]; then
+    echo -e "${YELLOW}取消上传${NC}"
+    exit 0
+fi
+
+echo ""
+echo -e "${YELLOW}开始上传文件...${NC}"
+
+# 上传文件列表
+FILES=(
+    "fmode-tikhub-api-customize.js"
+    "fmode-tikhub-api-customize.js.map"
+    "fmode-tikhub-api-customize.min.js"
+    "fmode-tikhub-api-customize.min.js.map"
+    "fmode-tikhub-api-customize.cjs"
+    "fmode-tikhub-api-customize.cjs.map"
+    "fmode-tikhub-api-customize.min.cjs"
+    "fmode-tikhub-api-customize.min.cjs.map"
+)
+
+UPLOAD_COUNT=0
+FAILED_COUNT=0
+
+# 上传每个文件
+for FILE in "${FILES[@]}"; do
+    LOCAL_FILE="${DIST_DIR}/${FILE}"
+
+    if [ ! -f "${LOCAL_FILE}" ]; then
+        echo -e "${YELLOW}⊘ 跳过: ${FILE} (文件不存在)${NC}"
+        continue
+    fi
+
+    CDN_KEY="${CDN_PREFIX}/${FILE}"
+
+    echo -e "${BLUE}↑ 上传: ${FILE}${NC}"
+
+    if qshell rput "${BUCKET}" "${CDN_KEY}" "${LOCAL_FILE}" --overwrite; then
+        echo -e "${GREEN}✓ 成功: ${FILE}${NC}"
+        UPLOAD_COUNT=$((UPLOAD_COUNT + 1))
+    else
+        echo -e "${RED}✗ 失败: ${FILE}${NC}"
+        FAILED_COUNT=$((FAILED_COUNT + 1))
+    fi
+
+    echo ""
+done
+
+# 显示结果
+echo -e "${GREEN}==================================================${NC}"
+if [ $FAILED_COUNT -eq 0 ]; then
+    echo -e "${GREEN}   上传完成!${NC}"
+else
+    echo -e "${YELLOW}   上传完成(有${FAILED_COUNT}个文件失败)${NC}"
+fi
+echo -e "${GREEN}==================================================${NC}"
+echo ""
+echo -e "${BLUE}上传统计:${NC}"
+echo -e "  成功: ${UPLOAD_COUNT} 个文件"
+echo -e "  失败: ${FAILED_COUNT} 个文件"
+echo ""
+echo -e "${YELLOW}CDN访问地址:${NC}"
+echo -e "  ${GREEN}# ESM (生产环境)${NC}"
+echo -e "  https://repos.fmode.cn/${CDN_PREFIX}/fmode-tikhub-api-customize.min.js"
+echo ""
+echo -e "  ${GREEN}# ESM (开发环境)${NC}"
+echo -e "  https://repos.fmode.cn/${CDN_PREFIX}/fmode-tikhub-api-customize.js"
+echo ""
+echo -e "  ${GREEN}# CJS (生产环境)${NC}"
+echo -e "  https://repos.fmode.cn/${CDN_PREFIX}/fmode-tikhub-api-customize.min.cjs"
+echo ""
+echo -e "${YELLOW}使用示例:${NC}"
+echo -e "  ${GREEN}# Deno / Node.js ESM${NC}"
+echo -e "  import { createTikHubRouter } from 'https://repos.fmode.cn/${CDN_PREFIX}/fmode-tikhub-api-customize.min.js?code=xxxxxxx';"
+echo ""
+echo -e "  ${GREEN}# Node.js CJS${NC}"
+echo -e "  const { createTikHubRouter } = require('https://repos.fmode.cn/${CDN_PREFIX}/fmode-tikhub-api-customize.min.cjs?code=xxxxxxx');"
+echo ""
+
+if [ $FAILED_COUNT -eq 0 ]; then
+    exit 0
+else
+    exit 1
+fi

Некоторые файлы не были показаны из-за большого количества измененных файлов