From 63b453676697da2656c4eba388d127efed74c430 Mon Sep 17 00:00:00 2001 From: liufumingren <821298006@qq.com> Date: Mon, 16 Mar 2026 14:01:22 +0800 Subject: [PATCH] chore: initialize wms project --- .eslintignore | 1 + .eslintrc | 4 + .gitattributes | 17 + .gitignore | 25 + .htaccess | 1 + .sequelizerc | 10 + Apifox/print.json | 143 + Apifox/test.json | 107 + README.md | 31 + app.js | 82 + app/controller/api_v2.js | 169 + app/controller/auth.js | 118 + app/controller/home.js | 587 + app/controller/template.js | 12 + app/dict/businessDict.js | 190 + app/extend/application.js | 63 + app/model/account.js | 189 + app/model/account_platform_active.js | 91 + app/model/account_store_employee.js | 111 + app/model/api_app.js | 309 + app/model/employee_role.js | 60 + app/model/entry_items.js | 298 + app/model/entry_order.js | 511 + app/model/fast_where.js | 94 + app/model/file.js | 165 + app/model/file_reference.js | 102 + app/model/i18n_key.js | 49 + app/model/i18n_translation.js | 182 + app/model/interface_type.js | 143 + app/model/location_space.js | 253 + app/model/location_type.js | 80 + app/model/location_zone.js | 245 + app/model/operation_log.js | 109 + app/model/order_delivery.js | 461 + app/model/order_delivery_factory.js | 420 + app/model/order_items.js | 145 + app/model/order_items_factory.js | 301 + app/model/permission.js | 276 + app/model/platform.js | 35 + app/model/platform_setting.js | 66 + app/model/print_computer.js | 39 + app/model/print_item.js | 273 + app/model/print_record.js | 86 + app/model/print_station_express.js | 86 + app/model/print_stations.js | 103 + app/model/print_template.js | 90 + app/model/prohibited_type.js | 91 + app/model/qimen_app.js | 70 + app/model/qimen_log.js | 81 + app/model/receiving.js | 179 + app/model/receiving_detail.js | 173 + app/model/role.js | 269 + app/model/role_permission.js | 145 + app/model/stock_barcode.js | 86 + app/model/stock_store.js | 426 + app/model/stock_unit.js | 49 + app/model/stock_warehouse.js | 255 + app/model/storage.js | 468 + app/model/store.js | 325 + app/model/store_join.js | 101 + app/model/store_warehouse.js | 264 + app/router.js | 17 + app/service/api.js | 48 + app/service/apiMethods/test.js | 150 + app/service/dispatcher.js | 82 + app/service/main.js | 380 + app/service/pda.js | 104 + app/service/qimen.js | 283 + app/service/qimenMethods/deliveryorder.js | 47 + app/service/qimenMethods/entryorder.js | 23 + app/service/qimenMethods/inventory.js | 30 + app/service/qimenMethods/order.js | 153 + app/service/qimenMethods/returnorder.js | 19 + app/service/qimenMethods/singleitem.js | 36 + app/service/qimenMethods/stockout.js | 72 + .../qimenMethods/taobao/qimen/service.js | 15 + app/service/system.js | 108 + app/service/systemMethods/config.js | 25 + app/service/systemMethods/dashboard.js | 340 + app/service/systemMethods/index.js | 426 + app/service/systemMethods/print.js | 432 + app/service/systemMethods/printer/station.js | 20 + .../systemMethods/setting/printTemplate.js | 36 + app/service/systemMethods/stock.js | 361 + .../systemMethods/storage/receiving.js | 75 + app/service/systemMethods/store.js | 50 + app/service/systemMethods/user.js | 45 + app/service/systemMethods/warehouse.js | 463 + app/service/systems/account_platform.js | 383 + app/service/systems/auth/user.js | 930 + app/service/systems/delivery_order.js | 534 + app/service/systems/entry_order.js | 751 + app/service/systems/fast_where.js | 264 + app/service/systems/file.js | 121 + app/service/systems/location.js | 420 + app/service/systems/location_space.js | 700 + app/service/systems/location_zone.js | 1070 ++ app/service/systems/notification.js | 49 + app/service/systems/operation_log.js | 130 + app/service/systems/platform.js | 276 + app/service/systems/print/index.js | 75 + app/service/systems/qimen_query.js | 156 + app/service/systems/setting/print_template.js | 507 + app/service/systems/sign.js | 198 + app/service/systems/space.js | 60 + app/service/systems/stock_store.js | 2841 +++ app/service/systems/storage/index.js | 9 + app/service/systems/storage/receiving.js | 1883 ++ app/service/systems/store.js | 794 + app/service/systems/upload.js | 596 + app/view/printer_setting.html | 78 + config/config.default.js | 172 + config/plugin.js | 30 + .../20251109160640-init-wms_account.js | 108 + ...1110081122-create-wms-account-login-log.js | 113 + .../20251110081641-create-wms-qimen-apps.js | 87 + .../20251110082013-create-wms-store.js | 195 + ...251110084033-create-wms-store-warehouse.js | 198 + ...0251110090742-create-wms-interface-type.js | 121 + .../20251110091013-create-wms-api-app.js | 220 + .../20251111083733-create-wms-stock-store.js | 298 + .../20251112085825-create-wms-entry-order.js | 249 + .../20251112085844-create-wms-entry-items.js | 151 + jsconfig.json | 5 + package-lock.json | 14945 ++++++++++++++++ package.json | 56 + test/app/controller/api_v2.test.js | 43 + test/app/controller/home.test.js | 23 + wms.code-workspace | 9 + 129 files changed, 43602 insertions(+) create mode 100644 .eslintignore create mode 100644 .eslintrc create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 .htaccess create mode 100644 .sequelizerc create mode 100644 Apifox/print.json create mode 100644 Apifox/test.json create mode 100644 README.md create mode 100644 app.js create mode 100644 app/controller/api_v2.js create mode 100644 app/controller/auth.js create mode 100644 app/controller/home.js create mode 100644 app/controller/template.js create mode 100644 app/dict/businessDict.js create mode 100644 app/extend/application.js create mode 100644 app/model/account.js create mode 100644 app/model/account_platform_active.js create mode 100644 app/model/account_store_employee.js create mode 100644 app/model/api_app.js create mode 100644 app/model/employee_role.js create mode 100644 app/model/entry_items.js create mode 100644 app/model/entry_order.js create mode 100644 app/model/fast_where.js create mode 100644 app/model/file.js create mode 100644 app/model/file_reference.js create mode 100644 app/model/i18n_key.js create mode 100644 app/model/i18n_translation.js create mode 100644 app/model/interface_type.js create mode 100644 app/model/location_space.js create mode 100644 app/model/location_type.js create mode 100644 app/model/location_zone.js create mode 100644 app/model/operation_log.js create mode 100644 app/model/order_delivery.js create mode 100644 app/model/order_delivery_factory.js create mode 100644 app/model/order_items.js create mode 100644 app/model/order_items_factory.js create mode 100644 app/model/permission.js create mode 100644 app/model/platform.js create mode 100644 app/model/platform_setting.js create mode 100644 app/model/print_computer.js create mode 100644 app/model/print_item.js create mode 100644 app/model/print_record.js create mode 100644 app/model/print_station_express.js create mode 100644 app/model/print_stations.js create mode 100644 app/model/print_template.js create mode 100644 app/model/prohibited_type.js create mode 100644 app/model/qimen_app.js create mode 100644 app/model/qimen_log.js create mode 100644 app/model/receiving.js create mode 100644 app/model/receiving_detail.js create mode 100644 app/model/role.js create mode 100644 app/model/role_permission.js create mode 100644 app/model/stock_barcode.js create mode 100644 app/model/stock_store.js create mode 100644 app/model/stock_unit.js create mode 100644 app/model/stock_warehouse.js create mode 100644 app/model/storage.js create mode 100644 app/model/store.js create mode 100644 app/model/store_join.js create mode 100644 app/model/store_warehouse.js create mode 100644 app/router.js create mode 100644 app/service/api.js create mode 100644 app/service/apiMethods/test.js create mode 100644 app/service/dispatcher.js create mode 100644 app/service/main.js create mode 100644 app/service/pda.js create mode 100644 app/service/qimen.js create mode 100644 app/service/qimenMethods/deliveryorder.js create mode 100644 app/service/qimenMethods/entryorder.js create mode 100644 app/service/qimenMethods/inventory.js create mode 100644 app/service/qimenMethods/order.js create mode 100644 app/service/qimenMethods/returnorder.js create mode 100644 app/service/qimenMethods/singleitem.js create mode 100644 app/service/qimenMethods/stockout.js create mode 100644 app/service/qimenMethods/taobao/qimen/service.js create mode 100644 app/service/system.js create mode 100644 app/service/systemMethods/config.js create mode 100644 app/service/systemMethods/dashboard.js create mode 100644 app/service/systemMethods/index.js create mode 100644 app/service/systemMethods/print.js create mode 100644 app/service/systemMethods/printer/station.js create mode 100644 app/service/systemMethods/setting/printTemplate.js create mode 100644 app/service/systemMethods/stock.js create mode 100644 app/service/systemMethods/storage/receiving.js create mode 100644 app/service/systemMethods/store.js create mode 100644 app/service/systemMethods/user.js create mode 100644 app/service/systemMethods/warehouse.js create mode 100644 app/service/systems/account_platform.js create mode 100644 app/service/systems/auth/user.js create mode 100644 app/service/systems/delivery_order.js create mode 100644 app/service/systems/entry_order.js create mode 100644 app/service/systems/fast_where.js create mode 100644 app/service/systems/file.js create mode 100644 app/service/systems/location.js create mode 100644 app/service/systems/location_space.js create mode 100644 app/service/systems/location_zone.js create mode 100644 app/service/systems/notification.js create mode 100644 app/service/systems/operation_log.js create mode 100644 app/service/systems/platform.js create mode 100644 app/service/systems/print/index.js create mode 100644 app/service/systems/qimen_query.js create mode 100644 app/service/systems/setting/print_template.js create mode 100644 app/service/systems/sign.js create mode 100644 app/service/systems/space.js create mode 100644 app/service/systems/stock_store.js create mode 100644 app/service/systems/storage/index.js create mode 100644 app/service/systems/storage/receiving.js create mode 100644 app/service/systems/store.js create mode 100644 app/service/systems/upload.js create mode 100644 app/view/printer_setting.html create mode 100644 config/config.default.js create mode 100644 config/plugin.js create mode 100644 database/migrations/20251109160640-init-wms_account.js create mode 100644 database/migrations/20251110081122-create-wms-account-login-log.js create mode 100644 database/migrations/20251110081641-create-wms-qimen-apps.js create mode 100644 database/migrations/20251110082013-create-wms-store.js create mode 100644 database/migrations/20251110084033-create-wms-store-warehouse.js create mode 100644 database/migrations/20251110090742-create-wms-interface-type.js create mode 100644 database/migrations/20251110091013-create-wms-api-app.js create mode 100644 database/migrations/20251111083733-create-wms-stock-store.js create mode 100644 database/migrations/20251112085825-create-wms-entry-order.js create mode 100644 database/migrations/20251112085844-create-wms-entry-items.js create mode 100644 jsconfig.json create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 test/app/controller/api_v2.test.js create mode 100644 test/app/controller/home.test.js create mode 100644 wms.code-workspace diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..4ebc8ae --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +coverage diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..f304bdd --- /dev/null +++ b/.eslintrc @@ -0,0 +1,4 @@ +{ + "extends": "eslint-config-egg", + "root": true +} diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..05e3aef --- /dev/null +++ b/.gitattributes @@ -0,0 +1,17 @@ +* text=auto eol=lf + +*.bat text eol=crlf +*.cmd text eol=crlf +*.ps1 text eol=crlf + +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.bmp binary +*.ico binary +*.pdf binary +*.zip binary +*.rar binary +*.7z binary +*.node binary \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..29f5dab --- /dev/null +++ b/.gitignore @@ -0,0 +1,25 @@ +logs/ +run/ +node_modules/ +coverage/ +.nyc_output/ +typings/ + +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + +.env +.env.* +config/config.local.js +database/config.json + +native/addons/*.node + +.idea/ +.vscode/ +.DS_Store +Thumbs.db +*.sw* +*.un~ diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..0c54fb9 --- /dev/null +++ b/.htaccess @@ -0,0 +1 @@ +# 请将伪静态规则或自定义Apache配置填写到此处 diff --git a/.sequelizerc b/.sequelizerc new file mode 100644 index 0000000..4dbbd8d --- /dev/null +++ b/.sequelizerc @@ -0,0 +1,10 @@ +'use strict'; + +const path = require('path'); + +module.exports = { + "config": path.join(__dirname, 'database/config.json'), + "migrations-path": path.join(__dirname, 'database/migrations'), + "seeders-path": path.join(__dirname, 'database/seeders'), + "models-path": path.join(__dirname, 'app/model'), +}; \ No newline at end of file diff --git a/Apifox/print.json b/Apifox/print.json new file mode 100644 index 0000000..3081377 --- /dev/null +++ b/Apifox/print.json @@ -0,0 +1,143 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "打印相关接口", + "description": "print service methods", + "version": "1.0.0" + }, + "paths": { + "/system": { + "post": { + "summary": "打印台相关接口", + "operationId": "printStationOperations", + "description": "根据method参数执行不同的打印台操作", + "parameters": [ + { + "name": "method", + "in": "query", + "description": "调用方法名,如print.getList、print.getItem、print.updateItem、print.del、print.getComputer、print.getComputerPrinter、print.savePrinters", + "required": true, + "schema": { + "type": "string", + "enum": [ + "print.getList", + "print.getItem", + "print.updateItem", + "print.del", + "print.getComputer", + "print.getComputerPrinter", + "print.savePrinters" + ] + } + }, + { + "name": "v", + "in": "query", + "description": "版本号", + "required": false, + "schema": { + "type": "string", + "example": "2.0" + } + }, + { + "name": "timestamp", + "in": "query", + "description": "时间戳", + "required": false, + "schema": { + "type": "string", + "example": "1646908800000" + } + } + ], + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "page": { "type": "integer", "example": 1 }, + "pageSize": { "type": "integer", "example": 20 }, + "where": { + "type": "object", + "example": { "name": "A台" } + }, + "id": { "type": "integer", "example": 1 }, + "name": { "type": "string", "example": "A台" }, + "computer_id": { "type": "integer", "example": 2 }, + "custom_barcode": { "type": "string", "example": "123456" }, + "ids": { + "type": "array", + "items": { "type": "integer" }, + "example": [1,2] + }, + "default": { "type": "string", "example": "打印机名称" }, + "express": { + "type": "array", + "items": { + "type": "object", + "properties": { + "express_id": { "type": "integer" }, + "name": { "type": "string" } + } + }, + "example": [{ "express_id": 1, "name": "顺丰" }] + }, + "print_station_id": { "type": "integer", "example": 1 } + } + } + } + } + }, + "responses": { + "200": { + "description": "成功响应", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { "type": "integer", "description": "状态码" }, + "message": { "type": "string", "description": "返回信息" }, + "data": { "type": "object", "description": "返回数据" } + } + } + } + } + }, + "400": { + "description": "错误请求", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { "type": "integer" }, + "message": { "type": "string" } + } + } + } + } + }, + "401": { + "description": "未授权" + } + }, + "security": [ + { "bearer": [] } + ] + } + } + }, + "components": { + "securitySchemes": { + "bearer": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + } + } + } +} \ No newline at end of file diff --git a/Apifox/test.json b/Apifox/test.json new file mode 100644 index 0000000..48134e5 --- /dev/null +++ b/Apifox/test.json @@ -0,0 +1,107 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "默认模块", + "description": "", + "version": "1.0.0" + }, + "tags": [], + "paths": { + "/system": { + "post": { + "summary": "未命名接口", + "deprecated": false, + "description": "", + "tags": [], + "parameters": [ + { + "name": "method", + "in": "query", + "description": "", + "required": false, + "example": "user.login", + "schema": { + "type": "string" + } + }, + { + "name": "v", + "in": "query", + "description": "", + "required": false, + "example": "2.0", + "schema": { + "type": "string" + } + }, + { + "name": "timestamp", + "in": "query", + "description": "", + "required": false, + "example": "{{$date.now}}", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "userName": { + "type": "string" + }, + "passWord": { + "type": "string" + } + }, + "required": [ + "userName", + "passWord" + ] + }, + "example": { + "userName": "夫立伟", + "passWord": "Ut cillum veniam" + } + } + } + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": {} + } + } + }, + "headers": {} + } + }, + "security": [ + { + "bearer": [] + } + ] + } + } + }, + "components": { + "schemas": {}, + "responses": {}, + "securitySchemes": { + "bearer": { + "type": "http", + "scheme": "bearer" + } + } + }, + "servers": [], + "security": [] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..f28ea49 --- /dev/null +++ b/README.md @@ -0,0 +1,31 @@ +# qimen + +奇门wms + +## QuickStart + + + +see [egg docs][egg] for more detail. + +### Development + +```bash +npm i +npm run dev +open http://localhost:7001/ +``` + +### Deploy + +```bash +npm start +npm stop +``` + +### npm scripts + +- Use `npm run lint` to check code style. +- Use `npm test` to run unit test. + +[egg]: https://eggjs.org diff --git a/app.js b/app.js new file mode 100644 index 0000000..b48fb1a --- /dev/null +++ b/app.js @@ -0,0 +1,82 @@ +// app.js +const path = require('path'); + +const businessDict = require('./app/dict/businessDict.js'); + +// 直接导出函数,而不是类 +module.exports = app => { + // 设置全局应用根目录 + global.APP_ROOT = path.resolve(__dirname, './'); + app.appRoot = APP_ROOT; + // ========== 挂载字典到 app ========== + app.businessDict = businessDict; + + // 添加字典工具方法 + app.getBusinessTypeName = code => { + const dict = app.businessDict.BUSINESS_TYPE || {}; + for (const key in dict) { + if (dict[key].code === code) { + return dict[key].name; + } + } + return code; + }; + + app.getOperationCodeName = code => { + return app.businessDict.OPERATION_CODE?.[code] || code; + }; + app.getPlatformName = code => { + return app.businessDict.PLATFORM_CODE?.[code] || code; + }; + + app.getExternalLogTypeName = type => { + return app.businessDict.EXTERNAL_LOG_TYPE?.[type] || type; + }; + + app.logger.info('✅ 业务字典已挂载到 app'); + // 初始化工厂 + app.beforeStart(async () => { + // skip factory init when model layer is absent (e.g. during tests) + if (!app.model) { + app.logger.info('⚠️ skipping factory init: app.model not available'); + return; + } + try { + const OrderDeliveryFactory = require('./app/model/order_delivery_factory'); + const OrderItemsFactory = require('./app/model/order_items_factory'); + app.OrderDeliveryFactory = OrderDeliveryFactory(app); + app.model.OrderDeliveryFactory = app.OrderDeliveryFactory; + app.OrderItemsFactory = OrderItemsFactory(app); + app.model.OrderItemsFactory = app.OrderItemsFactory; + app.logger.info('✅ 工厂类初始化完成'); + } catch (error) { + + app.logger.error('❌ 工厂类初始化失败:', error); + } + // 验证缓存方法 + if (typeof app.setCacheAsync === 'function') { + app.setCacheAsync('system', 'eggjs'); + const system = await app.getCacheAsync('system'); + app.logger.info('✅ 缓存方法验证通过' + system); + } + app.logger.info('✅ l类型' + typeof app.Message); + }); + + // 扩展 Date 原型 + Date.prototype.format = function(formatStr = 'YYYY-MM-DD HH:mm:ss') { + const year = this.getFullYear(); + const month = String(this.getMonth() + 1).padStart(2, '0'); + const day = String(this.getDate()).padStart(2, '0'); + const hours = String(this.getHours()).padStart(2, '0'); + const minutes = String(this.getMinutes()).padStart(2, '0'); + const seconds = String(this.getSeconds()).padStart(2, '0'); + + return formatStr + .replace('YYYY', year) + .replace('MM', month) + .replace('DD', day) + .replace('HH', hours) + .replace('mm', minutes) + .replace('ss', seconds); + }; +}; diff --git a/app/controller/api_v2.js b/app/controller/api_v2.js new file mode 100644 index 0000000..3f7a33e --- /dev/null +++ b/app/controller/api_v2.js @@ -0,0 +1,169 @@ +const { Controller } = require('egg'); + +class ApiV2Controller extends Controller { + async index() { + const { ctx, service } = this; + ctx.query_count = 1; + const startTime = Date.now(); + const logData = { + method: '', + v: '', + url: ctx.request.href, + created_at: new Date(), + body: '', + headers: JSON.stringify(ctx.headers), + result: '', + use_time: 0, + auth: '', + store_id: null, + }; + + try { + const getParams = ctx.query; + logData.method = getParams.method || ''; + logData.v = getParams.v || ''; + // 验证必要参数 + if (!service.system.validateParams(getParams)) { + const errorMsg = '参数缺失或错误'; + const response = this.errorResponse(errorMsg, 'json'); + logData.result = response; + service.system.saveLog(logData, startTime); + ctx.body = response; + ctx.type = 'application/json'; + return; + } + const authHeader = ctx.headers.authorization; + ctx.device = ctx.headers.device; + ctx.project = ctx.headers.project; + + // 处理method参数 + const method = getParams.method; + const methods = method.split('.'); + const actionName = methods.pop(); + const className = methods + .map((item, index) => + (index === methods.length - 1 ? item : item) + ) + .join('.'); + + // 获取JSON数据 + let jsonData = ''; + if (ctx.request.rawBody) { + jsonData = ctx.request.rawBody; + } else { + jsonData = await new Promise((resolve, reject) => { + let data = ''; + ctx.req.on('data', chunk => { + data += chunk; + }); + ctx.req.on('end', () => { + resolve(data); + }); + ctx.req.on('error', reject); + }); + } + + jsonData = jsonData ? String(jsonData) : ''; + logData.body = jsonData; + if (!jsonData || jsonData.trim() === '') { + throw new Error('json数据为空'); + } + try { + jsonData = JSON.parse(jsonData); + } catch (e) { + throw new Error('json数据解析错误'); + } + + // 调用扁平 dispatcher 服务 + const { isLog, result } = await service.dispatcher.invoke( + getParams.method, + jsonData, + authHeader, + ctx + ); + logData.result = typeof result === 'string' ? result : JSON.stringify(result); + if (ctx.user) { + logData.auth = JSON.stringify(ctx.user); + logData.store_id = ctx.user.store_id; + } + // 保存原来的日志逻辑仍然通过 system.saveLog + if (isLog) { + service.system.saveLog(logData, startTime); + } + if (result.status && result.status !== 200) { + // propagate failure message + ctx.body = result.message ? { message: result.message } : result.data; + } else { + ctx.body = result.data; + } + ctx.type = 'application/json'; + ctx.status = result.status || 200; + } catch (error) { + ctx.status = 500; + console.log(error); + const response = this.errorResponse('接口错误: ' + error.message, 'json'); + logData.result = typeof response === 'string' ? response : JSON.stringify(response); + service.system.saveLog(logData, startTime); + ctx.body = response; + ctx.type = 'application/json'; + } + } + + validateParams(params) { + const required = [ 'method', 'v', 'format', 'timestamp' ]; + + for (const field of required) { + if (!params[field]) { + return false; + } + } + + if (typeof params.method !== 'string' || !params.method.includes('.')) { + return false; + } + + return true; + } + + errorResponse(message, format = 'json') { + const timestamp = Math.floor(Date.now() / 1000); + + if (format.toLowerCase() === 'xml') { + return ` + + failure + 0 + ${this.escapeXml(message)} +`; + } + + return { + flag: false, + message, + code: 0, + timestamp, + }; + } + + escapeXml(unsafe) { + if (!unsafe) return ''; + return unsafe.replace(/[<>&'\"]/g, c => { + switch (c) { + case '<': + return '<'; + case '>': + return '>'; + case '&': + return '&'; + case "'": + return '''; + case '"': + return '"'; + default: + return c; + } + }); + } +} + +module.exports = ApiV2Controller; diff --git a/app/controller/auth.js b/app/controller/auth.js new file mode 100644 index 0000000..a7c51ab --- /dev/null +++ b/app/controller/auth.js @@ -0,0 +1,118 @@ +const Controller = require('egg').Controller; + +'use strict'; + + +class AuthController extends Controller { + async printerSetting() { + const { ctx } = this; + const redis = this.app.redis; + if (ctx.method === 'GET') { + const code = ctx.params.code || ''; + if (!code) { + ctx.body = { error: '缺少code参数' }; + return; + } + const bindValue = await redis.get('printer').get(`bind:${code}`); + if (!bindValue) { + ctx.body = { error: '无效code或未绑定' }; + return; + } + await redis.get('printer').setex(`binding:${code}`, 300, bindValue); + await ctx.render('printer_setting.html', { + title: '打印台设置', + code, + bindValue, + }); + } else if (ctx.method === 'POST') { + const { code, printer, warehouse } = ctx.request.body; + if (!code || !printer || !warehouse) { + ctx.body = { success: false, error: '参数缺失' }; + return; + } + // 获取临时binding:code + const bindingValue = await redis.get('printer').get(`binding:${code}`); + if (!bindingValue) { + ctx.body = { success: false, error: '超时或未绑定' }; + return; + } + // 反序列化bindingValue + let bindingValueObj = bindingValue; + try { + bindingValueObj = JSON.parse(bindingValue); + } catch (e) { + bindingValueObj = bindingValue; + } + // 使用 Store model 校验仓库id + const Store = ctx.model.Store; + const warehouseInfo = await Store.findOne({ where: { id: warehouse } }); + console.log('warehouseInfo:', warehouseInfo); + if (!warehouseInfo || warehouseInfo.project !== 'warehouse') { + ctx.body = { success: false, error: '仓库id校验失败' }; + return; + } + // 查找仓库id下是否有重名的电脑 + const PrintComputer = ctx.model.PrintComputer; + let computerId = null; + const existComputer = await PrintComputer.findOne({ where: { warehouse_id: warehouse, name: printer } }); + if (existComputer) { + if (existComputer.status === 1) { + ctx.body = { success: false, error: '该仓库下打印台名称已存在且可用' }; + return; + } else { + computerId = existComputer.id; + } + } else { + // 创建新打印电脑 + console.log('创建新打印电脑:', { warehouse_id: warehouse, name: printer, status: 0 }); + const newComputer = await PrintComputer.create({ warehouse_id: warehouse, name: printer, status: 0 }); + console.log('newComputer:', newComputer); + computerId = newComputer.id; + } + // 调用打印服务 /auth/bind,使用egg内置curl + const printServiceUrl = ctx.app.config.printService.url; + let printServiceResult = null; + try { + const res = await ctx.curl(`${printServiceUrl}/auth/bind`, { + method: 'POST', + contentType: 'json', + data: { code, printer, warehouse, roomId: bindingValueObj.uniqueId, computerId }, + dataType: 'json', + }); + printServiceResult = res.data; + } catch (err) { + console.log('调用打印服务失败:', err); + printServiceResult = { success: false, error: '打印服务通讯失败' }; + } + console.log('printServiceResult:', printServiceResult); + // 判断打印服务返回结果 + if (printServiceResult && printServiceResult.status === 'fail') { + ctx.body = { + success: false, + msg: printServiceResult.message || '打印服务失败', + code, + printer, + warehouse, + bindingValue: bindingValueObj, + printServiceResult + }; + return; + } + console.log('printServiceResult:', printServiceResult); + ctx.body = { + success: true, + msg: '参数已接收', + code, + printer, + warehouse, + bindingValue: bindingValueObj, + computerId, + printServiceResult + }; + } else { + ctx.body = { msg: '不支持的请求方法' }; + } + } +} + +module.exports = AuthController; \ No newline at end of file diff --git a/app/controller/home.js b/app/controller/home.js new file mode 100644 index 0000000..03786b0 --- /dev/null +++ b/app/controller/home.js @@ -0,0 +1,587 @@ +const { + Controller, +} = require('egg'); + +class HomeController extends Controller { + async testSendData(){ + await this.ctx.service.systems.print.index.test(); + this.ctx.body = 'ok'; + } + async index() { + const { + ctx, + } = this; + ctx.body = 'pong'; + } + async v1() { + const { + ctx, + service, + } = this; + const startTime = Date.now(); + // 初始化日志数据 + const logData = { + app_key: '', + method: '', + sign: '', + costomer_id: '', + v: '', + url: ctx.request.href, + created_at: new Date(), + body: '', + result: '', + use_time: 0, + }; + try { + const getParams = ctx.query; + logData.method = getParams.method || ''; + logData.v = getParams.v || ''; + // 验证必要参数 + if (!this.validateParams(getParams)) { + const errorMsg = '参数缺失或错误'; + const response = this.errorResponse(errorMsg, 'json'); + logData.result = response; + await this.saveLog(logData, startTime); + + ctx.body = response; + ctx.type = 'application/json'; + return; + } + + // 处理method参数 + const method = getParams.method; + const methods = method.split('.'); + const actionName = methods.pop(); + const className = methods.map((item, index) => + (index === methods.length - 1 ? item : item) + ).join('.'); + + // 获取XML数据 + let jsonData = ''; + if (ctx.request.rawBody) { + // 使用 rawBody 获取原始请求体 + jsonData = ctx.request.rawBody; + } else { + // 如果没有 rawBody,尝试从流中读取 + jsonData = await new Promise((resolve, reject) => { + let data = ''; + ctx.req.on('data', chunk => { + data += chunk; + }); + ctx.req.on('end', () => { + resolve(data); + }); + ctx.req.on('error', reject); + }); + } + + // 确保 xmlData 是字符串 + jsonData = jsonData ? String(jsonData) : ''; + logData.body = jsonData; + if (!jsonData || jsonData.trim() === '') { + throw new Error('json数据为空'); + } + try { + jsonData = JSON.parse(jsonData); + } catch (e) { + throw new Error('json数据解析错误'); + } + // 调用业务方法 + const result = await service.api.callMethod(className, actionName, jsonData, getParams.format); + + // 记录成功响应 + logData.result = typeof result === 'string' ? result : JSON.stringify(result); + await this.saveLog(logData, startTime); + + ctx.body = result; + ctx.type = getParams.format === 'xml' ? 'application/xml' : 'application/json'; + } catch (error) { + ctx.logger.error('调用接口失败返回数据', error); + const response = this.errorResponse('接口错误: ' + error.message, ctx.query.format || 'json'); + logData.result = typeof response === 'string' ? response : JSON.stringify(response); + await this.saveLog(logData, startTime); + ctx.body = response; + ctx.type = ctx.query.format === 'xml' ? 'application/xml' : 'application/json'; + } + } + async qimen() { + const { + ctx, + service, + } = this; + const startTime = Date.now(); + + // 初始化日志数据 + const logData = { + from_key: '', + to_key: this.app.config.qimen.appKey, + method: '', + sign: '', + costomer_id: '', + v: '', + url: ctx.request.href, + created_at: new Date(), + body: '', + result: '', + use_time: 0, + }; + const getParams = ctx.query; + // 记录基础日志信息 + logData.from_key = getParams.app_key || ''; + logData.method = getParams.method || ''; + logData.sign = getParams.sign || ''; + logData.costomer_id = getParams.customerId || getParams.customer_id || ''; + logData.v = getParams.v || ''; + ctx.qimenLogId = await service.qimen.saveQimenLog(logData, startTime); + try { + + // 验证必要参数 + if (!this.validateQimenParams(getParams)) { + const errorMsg = '参数缺失或错误'; + const response = this.errorResponse(errorMsg, 'xml'); + await service.qimen.saveQimenLogResult(response); + ctx.body = response; + ctx.type = 'application/xml'; + return; + } + + // 处理method参数 + const method = getParams.method; + const methods = method.split('.'); + const actionName = methods.pop(); + const className = methods.map((item, index) => + (index === methods.length - 1 ? item : item) + ).join('.'); + + const appkey = getParams.app_key; + const customerId = getParams.customerId; + + // 获取XML数据 + let xmlData = ''; + if (ctx.request.rawBody) { + // 使用 rawBody 获取原始请求体 + xmlData = ctx.request.rawBody; + } else { + // 如果没有 rawBody,尝试从流中读取 + xmlData = await new Promise((resolve, reject) => { + let data = ''; + ctx.req.on('data', chunk => { + data += chunk; + }); + ctx.req.on('end', () => { + resolve(data); + }); + ctx.req.on('error', reject); + }); + } + + // 确保 xmlData 是字符串 + xmlData = xmlData ? String(xmlData) : ''; + + if (!xmlData || xmlData.trim() === '') { + throw new Error('XML数据为空'); + } + + // 解析XML数据 + const xmlArray = await service.qimen.parseXmlToArray(xmlData); + xmlArray.app_key = appkey; + let warehouseCode = xmlArray.request.warehouseCode || ''; + const ownerCode = customerId; + + await service.qimen.saveQimenLogBody(xmlData); + const erpName = await service.qimen.getErpName(appkey); + let api_info = { + warehouseCode: '', + ownerCode: '', + }; + if (!warehouseCode || !customerId) { + // 入库单提取 + try { + warehouseCode = xmlArray.request?.entryOrder?.warehouseCode || + xmlArray.request?.deliveryOrder?.warehouseCode || + ''; + } catch (e) {} + } + if (warehouseCode && customerId) { + // 验证接口是否存在且启用 + api_info = await service.qimen.validateApi(appkey, customerId, warehouseCode); + if (!api_info) { + const errorMsg = `奇门${erpName}客户编码${customerId}仓库编码${warehouseCode}未绑定到你的货主或未启用,请联系仓库绑定`; + const response = this.errorResponse(errorMsg, 'xml'); + await service.qimen.saveQimenLogResult(response); + + ctx.body = response; + ctx.type = 'application/xml'; + return; + } + if (api_info.contract_auth_status != 2) { + const errorMsg = `货主与仓库签约状态异常,请到WMS核实签约状态${api_info.contract_auth_status}`; + const response = this.errorResponse(errorMsg, 'xml'); + await service.qimen.saveQimenLogResult(response); + + ctx.body = response; + ctx.type = 'application/xml'; + return; + } + if (api_info.warehouse_status == 0) { + const errorMsg = '仓库状态异常,请联系仓库核实WMS状态'; + const response = this.errorResponse(errorMsg, 'xml'); + await service.qimen.saveQimenLogResult(response); + + ctx.body = response; + ctx.type = 'application/xml'; + return; + } + const currentTime = new Date(); + const authEndTime = new Date(api_info.warehouse_auth_end); + const authEndTime2 = new Date(api_info.auth_end); + if (authEndTime2 < currentTime) { + const errorMsg = '与仓库合约过期,请到WMS重新发起仓库续约'; + const response = this.errorResponse(errorMsg, 'xml'); + await service.qimen.saveQimenLogResult(response); + + ctx.body = response; + ctx.type = 'application/xml'; + return; + } + if (authEndTime < currentTime) { + const errorMsg = '仓库订阅过期,请联系仓库核实状态'; + const response = this.errorResponse(errorMsg, 'xml'); + await service.qimen.saveQimenLogResult(response); + + ctx.body = response; + ctx.type = 'application/xml'; + return; + } + } + + // 调用业务方法 + const result = await service.qimen.callMethod(className, actionName, xmlArray, api_info.store_id, + api_info.warehouse_id, appkey, customerId, warehouseCode, getParams.format); + // 记录成功响应 + const logData_result = typeof result === 'string' ? result : JSON.stringify(result); + await service.qimen.saveQimenLogResult(logData_result); + + ctx.body = result; + ctx.type = getParams.format === 'xml' ? 'application/xml' : 'application/json'; + } catch (error) { + const response = this.errorResponse('奇门接口错误: ' + error.message, ctx.query.format || 'xml'); + await service.qimen.saveQimenLogResult(response); + ctx.body = response; + ctx.type = ctx.query.format === 'xml' ? 'application/xml' : 'application/json'; + } + } + + validateParams(params) { + const required = [ 'method', 'v', 'format', 'timestamp' ]; + + for (const field of required) { + if (!params[field]) { + return false; + } + } + + // 验证method格式 + if (typeof params.method !== 'string' || !params.method.includes('.')) { + return false; + } + + return true; + } + validateQimenParams(params) { + const required = [ 'app_key', 'method', 'v', 'format', 'sign_method', 'sign', 'timestamp' ]; + + for (const field of required) { + if (!params[field]) { + return false; + } + } + + // 验证method格式 + if (typeof params.method !== 'string' || !params.method.includes('.')) { + return false; + } + + return true; + } + errorResponse(message, format = 'json') { + const timestamp = Math.floor(Date.now() / 1000); + + if (format.toLowerCase() === 'xml') { + return ` + + failure + 0 + ${this.escapeXml(message)} +`; + } + + return { + flag: false, + message, + code: 0, + timestamp, + }; + } + + escapeXml(unsafe) { + if (!unsafe) return ''; + return unsafe.replace(/[<>&'"]/g, c => { + switch (c) { + case '<': + return '<'; + case '>': + return '>'; + case '&': + return '&'; + case '\'': + return '''; + case '"': + return '"'; + default: + return c; + } + }); + } + + async saveLog(logData, startTime) { + const { + ctx, + } = this; + + try { + // 限制日志内容长度 + if (logData.body && logData.body.length > 65535) { + logData.body = logData.body.substring(0, 65535); + } + + if (logData.result && logData.result.length > 65535) { + logData.result = logData.result.substring(0, 65535); + } + + logData.use_time = Date.now() - startTime; + + // 使用 egg-mysql 保存日志到数据库 + const result = await ctx.app.mysql.get('wms').insert('wms_api_log', { + method: logData.method || '', + v: logData.v || '', + url: logData.url || '', + created_at: ctx.app.mysql.get('wms').literals.now, + body: logData.body || '', + result: logData.result || '', + use_time: logData.use_time || 0, + }); + + return result; + + } catch (error) { + ctx.logger.error('保存奇门接口日志失败: ' + error.message); + // 可以选择记录到文件日志作为备用 + ctx.logger.info('奇门接口日志数据: ', JSON.stringify(logData)); + } + } + async pda() { + const { + ctx, + service, + } = this; + ctx.query_count = 1; + const startTime = Date.now(); + const logData = { + method: '', + v: '', + url: ctx.request.href, + created_at: new Date(), + body: '', + headers: JSON.stringify(ctx.headers), + result: '', + use_time: 0, + auth: '', + store_id: null, + }; + try { + const getParams = ctx.query; + logData.method = getParams.method || ''; + logData.v = getParams.v || ''; + // 验证必要参数 + if (!service.system.validateParams(getParams)) { + const errorMsg = '参数缺失或错误'; + const response = this.errorResponse(errorMsg, 'json'); + logData.result = response; + service.system.saveLog(logData, startTime); + ctx.body = response; + ctx.type = 'application/json'; + return; + } + const authHeader = ctx.headers.authorization; + + // 处理method参数 + const method = getParams.method; + const methods = method.split('.'); + const actionName = methods.pop(); + const className = methods.map((item, index) => + (index === methods.length - 1 ? item : item) + ).join('.'); + + // 获取JSON数据 + let jsonData = ''; + if (ctx.request.rawBody) { + // 使用 rawBody 获取原始请求体 + jsonData = ctx.request.rawBody; + } else { + // 如果没有 rawBody,尝试从流中读取 + jsonData = await new Promise((resolve, reject) => { + let data = ''; + ctx.req.on('data', chunk => { + data += chunk; + }); + ctx.req.on('end', () => { + resolve(data); + }); + ctx.req.on('error', reject); + }); + } + + // 确保 jsonData 是字符串 + jsonData = jsonData ? String(jsonData) : ''; + logData.body = jsonData; + if (!jsonData || jsonData.trim() === '') { + throw new Error('json数据为空'); + } + try { + jsonData = JSON.parse(jsonData); + } catch (e) { + throw new Error('json数据解析错误'); + } + // 调用业务方法 + const { isLog, result } = await service.system.callMethod(className, actionName, jsonData, authHeader); + // 记录成功响应 + logData.result = typeof result === 'string' ? result : JSON.stringify(result); + if (ctx.user) { + logData.auth = JSON.stringify(ctx.user); + logData.store_id = ctx.user.store_id; + } + if (isLog) { + service.system.saveLog(logData, startTime); + } + ctx.body = result.data; + ctx.type = 'application/json'; + ctx.status = result.status || 200; + } catch (error) { + ctx.status = 500; + console.log(error); + const response = this.errorResponse('接口错误: ' + error.message, 'json'); + logData.result = typeof response === 'string' ? response : JSON.stringify(response); + service.system.saveLog(logData, startTime); + ctx.body = response; + ctx.type = 'application/json'; + } + } + async store() { + + } + async warehouse() { + + } + async system() { + const { + ctx, + service, + } = this; + ctx.query_count = 1; + const startTime = Date.now(); + const logData = { + method: '', + v: '', + url: ctx.request.href, + created_at: new Date(), + body: '', + headers: JSON.stringify(ctx.headers), + result: '', + use_time: 0, + auth: '', + store_id: null, + }; + try { + const getParams = ctx.query; + logData.method = getParams.method || ''; + logData.v = getParams.v || ''; + // 验证必要参数 + if (!service.system.validateParams(getParams)) { + const errorMsg = '参数缺失或错误'; + const response = this.errorResponse(errorMsg, 'json'); + logData.result = response; + service.system.saveLog(logData, startTime); + ctx.body = response; + ctx.type = 'application/json'; + return; + } + const authHeader = ctx.headers.authorization; + ctx.device = ctx.headers.device; + ctx.project = ctx.headers.project; + + // 处理method参数 + const method = getParams.method; + const methods = method.split('.'); + const actionName = methods.pop(); + const className = methods.map((item, index) => + (index === methods.length - 1 ? item : item) + ).join('.'); + + // 获取JSON数据 + let jsonData = ''; + if (ctx.request.rawBody) { + // 使用 rawBody 获取原始请求体 + jsonData = ctx.request.rawBody; + } else { + // 如果没有 rawBody,尝试从流中读取 + jsonData = await new Promise((resolve, reject) => { + let data = ''; + ctx.req.on('data', chunk => { + data += chunk; + }); + ctx.req.on('end', () => { + resolve(data); + }); + ctx.req.on('error', reject); + }); + } + + // 确保 jsonData 是字符串 + jsonData = jsonData ? String(jsonData) : ''; + logData.body = jsonData; + if (!jsonData || jsonData.trim() === '') { + throw new Error('json数据为空'); + } + try { + jsonData = JSON.parse(jsonData); + } catch (e) { + throw new Error('json数据解析错误'); + } + // 调用业务方法 + const { isLog, result } = await service.system.callMethod(className, actionName, jsonData, authHeader); + // 记录成功响应 + logData.result = typeof result === 'string' ? result : JSON.stringify(result); + if (ctx.user) { + logData.auth = JSON.stringify(ctx.user); + logData.store_id = ctx.user.store_id; + } + if (isLog) { + service.system.saveLog(logData, startTime); + } + ctx.body = result.data; + ctx.type = 'application/json'; + ctx.status = result.status || 200; + } catch (error) { + ctx.status = 500; + console.log(error); + const response = this.errorResponse('接口错误: ' + error.message, 'json'); + logData.result = typeof response === 'string' ? response : JSON.stringify(response); + service.system.saveLog(logData, startTime); + ctx.body = response; + ctx.type = 'application/json'; + } + } +} + +module.exports = HomeController; diff --git a/app/controller/template.js b/app/controller/template.js new file mode 100644 index 0000000..33c5868 --- /dev/null +++ b/app/controller/template.js @@ -0,0 +1,12 @@ +const { + Controller, +} = require('egg'); + +class TemplateController extends Controller { + async xml() { + const { service, ctx } = this; + const result = await service.systems.setting.printTemplate.getXmlByTemplate(ctx.params.id); + ctx.body = result; + } +} +module.exports = TemplateController; diff --git a/app/dict/businessDict.js b/app/dict/businessDict.js new file mode 100644 index 0000000..38e3fab --- /dev/null +++ b/app/dict/businessDict.js @@ -0,0 +1,190 @@ +// app/dict/businessDict.js +'use strict'; + +module.exports = { + + PLATFORM_CODE: { + web: '网页后台', + SYSTEM: '系统', + pda: 'PDA', + }, + /** + * 业务类型字典 + */ + BUSINESS_TYPE: { + PRODUCT: { code: 'product', name: '商品管理' }, + ORDER: { code: 'order', name: '订单管理' }, + STOCK: { code: 'stock', name: '库存管理' }, + WAVE: { code: 'wave', name: '波次管理' }, + EXPRESS: { code: 'express', name: '快递管理' }, + STORAGE: { code: 'storage', name: '仓储管理' }, + LOCATION: { code: 'location', name: '库位管理' }, + USER: { code: 'user', name: '用户管理' }, + SYSTEM: { code: 'system', name: '系统管理' }, + }, + + /** + * 操作动作字典 + */ + OPERATION_ACTION: { + CREATE: '创建', + UPDATE: '更新', + DELETE: '删除', + OTHER: '其他', + }, + + /** + * 操作编码字典 + */ + OPERATION_CODE: { + // 商品管理 + CREATE: '创建', + UPDATE: '更新', + DELETE: '删除', + ENABLE: '启用', + DISABLE: '禁用', + IMPORT: '导入', + EXPORT: '导出', + + // 订单管理 + ORDER_CREATE: '创建订单', + ORDER_UPDATE: '更新订单', + ORDER_CANCEL: '取消订单', + ORDER_CONFIRM: '确认订单', + ORDER_PRINT: '打印订单', + ORDER_PICKING: '开始拣货', + ORDER_PACKED: '订单打包', + ORDER_SHIPPED: '订单发货', + ORDER_COMPLETE: '订单完成', + + // 库存管理 + STOCK_IN: '商品入库', + STOCK_OUT: '商品出库', + STOCK_ADJUST: '库存调整', + STOCK_TRANSFER: '库存调拨', + STOCK_CHECK: '库存盘点', + STOCK_LOCK: '锁定库存', + STOCK_UNLOCK: '解锁库存', + STOCK_QUERY: '库存查询', + + // 波次管理 + WAVE_CREATE: '创建波次', + WAVE_CONFIRM: '确认波次', + WAVE_START: '开始波次', + WAVE_COMPLETE: '完成波次', + WAVE_CANCEL: '取消波次', + + // 快递管理 + EXPRESS_CREATE: '创建快递单', + EXPRESS_UPDATE: '更新快递信息', + EXPRESS_CANCEL: '取消快递单', + EXPRESS_QUERY: '查询快递', + + // 库位管理 + LOCATION_CREATE: '创建库位', + LOCATION_UPDATE: '更新库位', + LOCATION_DELETE: '删除库位', + LOCATION_ENABLE: '启用库位', + LOCATION_DISABLE: '禁用库位', + + // 用户管理 + USER_LOGIN: '用户登录', + USER_LOGOUT: '用户退出', + USER_CREATE: '创建用户', + USER_UPDATE: '更新用户', + USER_DELETE: '删除用户', + + // 系统管理 + CONFIG_UPDATE: '更新配置', + ROLE_CREATE: '创建角色', + ROLE_UPDATE: '更新角色', + ROLE_DELETE: '删除角色', + PERMISSION_UPDATE: '更新权限', + UPDATE_IMAGES: '更新图片', + UPDATE_BARCODE: '更新条码', + BIND: '绑定', + }, + + /** + * 外部日志类型 + */ + EXTERNAL_LOG_TYPE: { + REQUEST: 'HTTP请求', + API: 'API调用', + QIMEN: '奇门接口', + ERP: 'ERP接口', + WMS: 'WMS接口', + TMS: 'TMS接口', + NONE: '无', + }, + + /** + * 操作状态 + */ + OPERATION_STATUS: { + SUCCESS: '成功', + FAILED: '失败', + PROCESSING: '处理中', + }, + + /** + * 仓库状态 + */ + WAREHOUSE_STATUS: { + ACTIVE: '启用', + INACTIVE: '停用', + MAINTENANCE: '维护中', + }, + + /** + * 订单状态 + */ + ORDER_STATUS: { + PENDING: '待处理', + CONFIRMED: '已确认', + PICKING: '拣货中', + PACKED: '已打包', + SHIPPED: '已发货', + COMPLETED: '已完成', + CANCELLED: '已取消', + }, + + /** + * 获取所有业务类型选项 + */ + getBusinessTypeOptions() { + return Object.values(this.BUSINESS_TYPE).map(item => ({ + label: item.name, + value: item.code, + })); + }, + + /** + * 获取指定业务类型的操作编码 + * @param businessType + */ + getOperationCodesByBusinessType(businessType) { + const prefix = businessType.toUpperCase() + '_'; + const result = {}; + + for (const [ key, value ] of Object.entries(this.OPERATION_CODE)) { + if (key.startsWith(prefix)) { + result[key] = value; + } + } + + return result; + }, + + /** + * 验证操作编码是否属于指定业务类型 + * @param code + * @param businessType + */ + validateOperationCode(code, businessType) { + if (!businessType) return true; + + const prefix = businessType.toUpperCase() + '_'; + return code.startsWith(prefix); + }, +}; diff --git a/app/extend/application.js b/app/extend/application.js new file mode 100644 index 0000000..04e6d89 --- /dev/null +++ b/app/extend/application.js @@ -0,0 +1,63 @@ +class MessageClass { + async action() { + + } +} +const soap = require('soap'); +const MESSAGE_CLASS = Symbol('Application#Message'); +module.exports = { + async wsdl(methodName, args) { + try { + const wsdlUrl = "http://ye4s.com/webservice/ws?wsdl"; + const obj = {}; + args.forEach((value, index) => { + obj['arg' + index] = value; + }); + const client = await soap.createClientAsync(wsdlUrl); + const result = await client[methodName + 'Async'](obj); + return result[0]; + } catch (error) { + console.error('Error calling SOAP service:', error); + throw error; + } + }, + async setCacheAsync(cacheKey, data, expireSeconds = 300) { + const cacheRedis = this.redis && this.redis.get ? this.redis.get('cache') : null; + if (!cacheRedis) { + this.logger.warn('[RedisNotAvailable] Cannot set cache, Redis client is not available'); + return; + } + + try { + await cacheRedis.setex(cacheKey, expireSeconds, JSON.stringify(data)); + this.logger.debug('[CacheSet] Successfully set cache', cacheKey); + } catch (error) { + this.logger.error('[CacheSetError] Failed to set cache', error.message, cacheKey); + } + }, + async getCacheAsync(cacheKey) { + const cacheRedis = this.redis && this.redis.get ? this.redis.get('cache') : null; + if (!cacheRedis) { + this.logger.warn('[RedisNotAvailable] Cannot get cache, Redis client is not available'); + return null; + } + + try { + const data = await cacheRedis.get(cacheKey); + if (data) { + return JSON.parse(data); + } + return null; + } catch (error) { + this.logger.error('[CacheGetError] Failed to get cache', error.message, cacheKey); + return null; + } + }, + get Message() { + if (!this[MESSAGE_CLASS]) { + // 返回类本身,不是实例 + this[MESSAGE_CLASS] = MessageClass; + } + return this[MESSAGE_CLASS]; + }, +}; diff --git a/app/model/account.js b/app/model/account.js new file mode 100644 index 0000000..184c5c5 --- /dev/null +++ b/app/model/account.js @@ -0,0 +1,189 @@ +'use strict'; + +module.exports = app => { + const { BIGINT, STRING, INTEGER, DATE, TINYINT, fn } = app.Sequelize; + + const Account = app.model.define('account', { + id: { + type: BIGINT.UNSIGNED, + primaryKey: true, + autoIncrement: true, + allowNull: false, + comment: '账号ID', + }, + username: { + type: STRING(50), + allowNull: false, + unique: 'idx_username', + validate: { + notEmpty: { + msg: '用户名不能为空', + }, + len: { + args: [ 3, 50 ], + msg: '用户名长度应在3-50个字符之间', + }, + is: { + args: /^[a-zA-Z0-9_]+$/, + msg: '用户名只能包含字母、数字和下划线', + }, + }, + comment: '用户名', + }, + email: { + type: STRING(100), + allowNull: false, + validate: { + notEmpty: { + msg: '邮箱不能为空', + }, + isEmail: { + msg: '请输入有效的邮箱地址', + }, + }, + comment: '邮箱', + }, + password_hash: { + type: STRING(255), + allowNull: false, + comment: '密码哈希', + }, + real_name: { + type: STRING(50), + allowNull: false, + validate: { + notEmpty: { + msg: '真实姓名不能为空', + }, + len: { + args: [ 2, 50 ], + msg: '真实姓名长度应在2-50个字符之间', + }, + }, + comment: '真实姓名', + }, + status: { + type: TINYINT(1), + allowNull: false, + defaultValue: 1, + validate: { + isIn: { + args: [[ 0, 1 ]], + msg: '状态值不合法,0-封号,1-启用', + }, + }, + comment: '状态:0-封号,1-启用', + }, + last_login_at: { + type: DATE, + allowNull: true, + comment: '最后登录时间', + }, + created_at: { + type: DATE, + allowNull: false, + defaultValue: fn('NOW'), + comment: '创建时间', + }, + updated_at: { + type: DATE, + allowNull: false, + defaultValue: fn('NOW'), + comment: '更新时间', + }, + salt: { + type: STRING(20), + allowNull: true, + comment: '密码盐', + }, + last_login_ip: { + type: STRING(15), + allowNull: true, + comment: '最后登录ip', + }, + }, { + tableName: 'wms_account', + freezeTableName: true, + underscored: true, + timestamps: true, + createdAt: 'created_at', + updatedAt: 'updated_at', + comment: '平台账号表', + indexes: [ + { + name: 'idx_username', + fields: [ 'username' ], + unique: true, + }, + { + name: 'idx_phone', + fields: [ 'phone' ], + }, + { + name: 'idx_email', + fields: [ 'email' ], + }, + { + name: 'idx_status', + fields: [ 'status' ], + }, + ], + }); + + // 关联关系 + Account.associate = function(models) { + const { AccountStoreEmployee, AccountPlatformActive } = app.model; + /* if (models.AccountStoreRole) { + + }*/ + Account.hasMany(AccountStoreEmployee, { + foreignKey: 'account_id', + as: 'accountStoreRoles', + }); + Account.hasMany(AccountPlatformActive, { + foreignKey: 'account_id', + as: 'platformActives', + }); + }; + + // 实例方法 + Account.prototype.toJSON = function() { + const values = { ...this.get() }; + // 只有在需要返回给客户端时才删除敏感字段 + if (this._hideSensitive !== false) { + delete values.password_hash; + delete values.salt; + } + return values; + }; + + // 验证密码 + Account.prototype.verifyPassword = async function(password) { + const crypto = require('crypto'); + + // 检查 password_hash 是否存在 + if (!this.password_hash) { + console.error('password_hash is undefined for user:', this.id); + return false; + } + + // 检查 salt 是否存在 + if (!this.salt) { + console.error('salt is undefined for user:', this.id); + return false; + } + + const hash = crypto + .createHash('sha256') + .update(password + (this.salt || '')) + .digest('hex'); + + console.log(`计算后的hash: ${hash}`); + console.log(`数据库中的password_hash: ${this.password_hash}`); + console.log(`是否匹配: ${hash === this.password_hash}`); + + return hash === this.password_hash; + }; + + return Account; +}; diff --git a/app/model/account_platform_active.js b/app/model/account_platform_active.js new file mode 100644 index 0000000..c5b72e9 --- /dev/null +++ b/app/model/account_platform_active.js @@ -0,0 +1,91 @@ +'use strict'; + +module.exports = app => { + const { BIGINT, STRING, DATE } = app.Sequelize; + + const AccountPlatformActive = app.model.define('account_platform_active', { + account_id: { + type: BIGINT.UNSIGNED, + allowNull: false, + comment: '账号ID', + }, + employee_id: { + type: BIGINT.UNSIGNED, + allowNull: false, + comment: '账号仓库角色关联ID', + }, + platform_code: { + type: STRING(50), + allowNull: false, + validate: { + notEmpty: true, + len: [ 1, 50 ], + }, + comment: '平台编码(web、pda、mini、app等)', + }, + created_at: { + type: DATE, + allowNull: false, + defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP'), + comment: '创建时间', + }, + updated_at: { + type: DATE, + allowNull: false, + defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP'), + comment: '更新时间', + }, + }, { + tableName: 'wms_account_platform_active', + freezeTableName: true, + underscored: true, + timestamps: true, + createdAt: 'created_at', + updatedAt: 'updated_at', + paranoid: false, // 明确禁用软删除 + comment: '账号平台激活状态表', + // 无主键ID,使用组合主键 + id: false, + // 指定组合主键 + primaryKey: [ 'account_id', 'platform_code' ], + indexes: [ + { + name: 'uk_account_platform', + fields: [ 'account_id', 'platform_code' ], + unique: true, + }, + { + name: 'uk_account_store_role_platform', + fields: [ 'employee_id', 'platform_code' ], + unique: true, + }, + { + name: 'idx_account_id', + fields: [ 'account_id' ], + }, + { + name: 'idx_platform_code', + fields: [ 'platform_code' ], + }, + { + name: 'idx_employee_id', + fields: [ 'employee_id' ], + }, + ], + }); + + // 关联关系 - 注释掉或删除,统一在 app.js 中处理 + AccountPlatformActive.associate = function(models) { + const { Account, AccountStoreEmployee } = app.model; + AccountPlatformActive.belongsTo(Account, { + foreignKey: 'account_id', + as: 'account', + }); + AccountPlatformActive.belongsTo(AccountStoreEmployee, { + foreignKey: 'employee_id', + as: 'accountStoreEmployee', + }); + }; + + return AccountPlatformActive; +}; diff --git a/app/model/account_store_employee.js b/app/model/account_store_employee.js new file mode 100644 index 0000000..b8c96e2 --- /dev/null +++ b/app/model/account_store_employee.js @@ -0,0 +1,111 @@ +'use strict'; + +module.exports = app => { + const { BIGINT, STRING, DATE, TINYINT } = app.Sequelize; + + const AccountStoreEmployee = app.model.define('wms_account_store_employee', { + id: { + type: BIGINT.UNSIGNED, + primaryKey: true, + autoIncrement: true, + allowNull: false, + comment: '关联ID', + }, + account_id: { + type: BIGINT.UNSIGNED, + allowNull: false, + comment: '账号ID', + }, + store_id: { + type: BIGINT.UNSIGNED, + allowNull: false, + comment: '仓库ID', + }, + status: { + type: TINYINT(4), + allowNull: false, + defaultValue: 1, + validate: { + isIn: { + args: [[ 0, 1 ]], + msg: '状态值不合法,0-已解除,1-有效', + }, + }, + comment: '状态:0-已解除,1-有效', + }, + created_at: { + type: DATE, + allowNull: false, + comment: '创建时间', + }, + updated_at: { + type: DATE, + allowNull: false, + comment: '更新时间', + }, + real_name: { + type: STRING(50), + allowNull: true, + comment: '工号的真实姓名', + }, + }, { + tableName: 'wms_account_store_employee', + freezeTableName: true, + underscored: true, + timestamps: true, + createdAt: 'created_at', + updatedAt: 'updated_at', + comment: '账号仓库角色关联表', + indexes: [ + { + name: 'uk_account_store_role', + fields: [ 'account_id', 'store_id' ], + unique: true, + }, + { + name: 'idx_account_id', + fields: [ 'account_id' ], + }, + { + name: 'idx_store_id', + fields: [ 'store_id' ], + }, + { + name: 'idx_status', + fields: [ 'status' ], + }, + ], + }); + + // 关联关系 + AccountStoreEmployee.associate = function(models) { + const { Account, Store, Role, AccountPlatformActive, EmployeeRole, Receiving } = app.model; + AccountStoreEmployee.belongsTo(Account, { + foreignKey: 'account_id', + as: 'account', + }); + AccountStoreEmployee.belongsTo(Store, { + foreignKey: 'store_id', + as: 'store', + }); + AccountStoreEmployee.hasMany(AccountPlatformActive, { + foreignKey: 'employee_id', + as: 'platformActives', + }); + AccountStoreEmployee.hasMany(EmployeeRole, { + foreignKey: 'employee_id', + as: 'employeeRole', + }); + AccountStoreEmployee.hasMany(Receiving, { + foreignKey: 'creator_id', + as: 'Receiving', + }); + }; + + // 实例方法:检查是否有效 + AccountStoreEmployee.prototype.isValid = function() { + return this.status === 1; + }; + + return AccountStoreEmployee; +}; diff --git a/app/model/api_app.js b/app/model/api_app.js new file mode 100644 index 0000000..2273d52 --- /dev/null +++ b/app/model/api_app.js @@ -0,0 +1,309 @@ +'use strict'; + +module.exports = app => { + const { BIGINT, STRING, INTEGER, JSON, TINYINT, DATE } = app.Sequelize; + + const ApiApp = app.model.define('api_app', { + id: { + type: BIGINT(20), + primaryKey: true, + autoIncrement: true, + allowNull: false, + comment: '应用ID', + }, + app_name: { + type: STRING(200), + allowNull: false, + validate: { + notEmpty: true, + len: [ 1, 200 ], + }, + comment: '应用名称', + }, + interface_type_id: { + type: INTEGER(10), + allowNull: false, + comment: '接口类型ID', + references: { + model: 'interface_type', + key: 'id', + }, + }, + contract_id: { + type: BIGINT(20), + allowNull: true, + comment: '合约ID,关联wms_store_warehouse.id(货主接口使用)', + references: { + model: 'store_warehouse', + key: 'id', + }, + }, + warehouse_id: { + type: BIGINT(20), + allowNull: true, + comment: '仓库ID(仓库接口使用)', + }, + self_app_key: { + type: STRING(100), + allowNull: true, + unique: 'uk_self_app_key', + validate: { + len: [ 0, 100 ], + }, + comment: '自身AppKey(开放接口使用,系统生成)', + }, + self_app_secret: { + type: STRING(500), + allowNull: true, + validate: { + len: [ 0, 500 ], + }, + comment: '自身AppSecret(开放接口使用,系统生成)', + }, + self_ip_whitelist: { + type: JSON, + allowNull: true, + comment: '自身IP白名单', + }, + qimen_app_key: { + type: STRING(100), + allowNull: true, + validate: { + len: [ 0, 100 ], + }, + comment: '奇门对方AppKey', + }, + qimen_customer_id: { + type: STRING(100), + allowNull: true, + validate: { + len: [ 0, 100 ], + }, + comment: '奇门客户ID', + }, + qimen_warehouse_code: { + type: STRING(100), + allowNull: true, + validate: { + len: [ 0, 100 ], + }, + comment: '奇门仓库编码', + }, + api_version: { + type: STRING(50), + allowNull: true, + defaultValue: '1.0', + validate: { + len: [ 0, 50 ], + }, + comment: 'API版本', + }, + sign_method: { + type: STRING(50), + allowNull: true, + defaultValue: 'md5', + validate: { + isIn: [[ 'md5', 'hmac', 'sha256' ]], + len: [ 0, 50 ], + }, + comment: '签名方法', + }, + rate_limit: { + type: INTEGER(11), + allowNull: true, + defaultValue: 1000, + validate: { + min: 1, + max: 100000, + }, + comment: '速率限制(次/分钟)', + }, + timeout_seconds: { + type: INTEGER(11), + allowNull: true, + defaultValue: 30, + validate: { + min: 1, + max: 300, + }, + comment: '超时时间(秒)', + }, + contact_person: { + type: STRING(100), + allowNull: true, + validate: { + len: [ 0, 100 ], + }, + comment: '联系人', + }, + contact_phone: { + type: STRING(20), + allowNull: true, + validate: { + len: [ 0, 20 ], + }, + comment: '联系电话', + }, + email: { + type: STRING(100), + allowNull: true, + validate: { + isEmail: true, + len: [ 0, 100 ], + }, + comment: '邮箱', + }, + is_enabled: { + type: TINYINT(1), + allowNull: false, + defaultValue: 1, + validate: { + isIn: [[ 0, 1 ]], + }, + comment: '是否启用', + }, + created_at: { + type: DATE, + allowNull: false, + comment: '创建时间', + }, + updated_at: { + type: DATE, + allowNull: false, + comment: '更新时间', + }, + }, { + tableName: 'wms_api_app', + freezeTableName: true, + underscored: true, + timestamps: true, + createdAt: 'created_at', + updatedAt: 'updated_at', + comment: 'API应用配置表', + indexes: [ + { + name: 'uk_app_name_interface', + unique: true, + fields: [ 'app_name', 'interface_type_id' ], + }, + { + name: 'uk_self_app_key', + unique: true, + fields: [ 'self_app_key' ], + }, + { + name: 'uk_interface_warehouse', + unique: true, + fields: [ 'qimen_app_key', 'qimen_customer_id' ], + }, + { + name: 'uk_interface_contract', + unique: true, + fields: [ 'interface_type_id', 'contract_id' ], + }, + { + name: 'idx_interface_type_id', + fields: [ 'interface_type_id' ], + }, + { + name: 'idx_warehouse_id', + fields: [ 'warehouse_id' ], + }, + { + name: 'idx_is_enabled', + fields: [ 'is_enabled' ], + }, + { + name: 'idx_created_at', + fields: [ 'created_at' ], + }, + { + name: 'idx_interface_enabled', + fields: [ 'interface_type_id', 'is_enabled' ], + }, + ], + }); + + // 定义关联关系 + ApiApp.associate = function() { + const { InterfaceType, StoreWarehouse, Store, InterfaceLog } = app.model; + + // 关联接口类型 + ApiApp.belongsTo(InterfaceType, { + foreignKey: 'interface_type_id', + targetKey: 'id', + as: 'interface_type', + }); + + // 关联合约(商家仓库授权关系) + ApiApp.belongsTo(StoreWarehouse, { + foreignKey: 'contract_id', + targetKey: 'id', + as: 'contract', + }); + + // 关联仓库 + ApiApp.belongsTo(Store, { + foreignKey: 'warehouse_id', + targetKey: 'id', + as: 'warehouse', + }); + }; + + // 实例方法 - 检查应用是否可用 + ApiApp.prototype.isAvailable = function() { + return this.is_enabled === 1; + }; + + // 实例方法 - 检查IP是否在白名单中 + ApiApp.prototype.isIpAllowed = function(ip) { + if (!this.self_ip_whitelist || !Array.isArray(this.self_ip_whitelist)) { + return true; // 如果没有设置白名单,允许所有IP + } + + return this.self_ip_whitelist.includes(ip); + }; + + // 实例方法 - 生成签名(示例) + ApiApp.prototype.generateSignature = function(params) { + const crypto = require('crypto'); + const sortedParams = Object.keys(params).sort().map(key => `${key}${params[key]}`) + .join(''); + + switch (this.sign_method) { + case 'md5': + return crypto.createHash('md5').update(sortedParams + this.self_app_secret).digest('hex'); + case 'hmac': + return crypto.createHmac('sha256', this.self_app_secret).update(sortedParams).digest('hex'); + case 'sha256': + return crypto.createHash('sha256').update(sortedParams + this.self_app_secret).digest('hex'); + default: + return crypto.createHash('md5').update(sortedParams + this.self_app_secret).digest('hex'); + } + }; + + // 实例方法 - 验证签名 + ApiApp.prototype.verifySignature = function(params, signature) { + const generatedSignature = this.generateSignature(params); + return generatedSignature === signature; + }; + + // 类方法 - 根据AppKey查找 + ApiApp.findByAppKey = async function(appKey) { + return await this.findOne({ + where: { self_app_key: appKey }, + }); + }; + + // 类方法 - 根据奇门配置查找 + ApiApp.findByQimenConfig = async function(appKey, customerId) { + return await this.findOne({ + where: { + qimen_app_key: appKey, + qimen_customer_id: customerId, + }, + }); + }; + + return ApiApp; +}; diff --git a/app/model/employee_role.js b/app/model/employee_role.js new file mode 100644 index 0000000..4c61f47 --- /dev/null +++ b/app/model/employee_role.js @@ -0,0 +1,60 @@ +'use strict'; + +module.exports = app => { + const { BIGINT } = app.Sequelize; + + const EmployeeRole = app.model.define('employee_role', { + id: { + type: BIGINT.UNSIGNED, + primaryKey: true, + autoIncrement: true, + comment: '主键ID', + }, + employee_id: { + type: BIGINT.UNSIGNED, + allowNull: false, + comment: '员工ID', + }, + role_id: { + type: BIGINT.UNSIGNED, + allowNull: false, + comment: '角色ID', + }, + }, { + tableName: 'wms_employee_role', // 指定实际表名 + timestamps: false, // 不自动添加 createdAt 和 updatedAt + comment: '员工角色关联表', + indexes: [ + { + name: 'uk_employee_role', + unique: true, + fields: [ 'employee_id', 'role_id' ], + }, + { + name: 'idx_employee_id', + fields: [ 'employee_id' ], + }, + ], + }); + + // 关联关系 + EmployeeRole.associate = function() { + const { AccountStoreEmployee, Role } = app.model; + + // 关联员工表 + EmployeeRole.belongsTo(AccountStoreEmployee, { + foreignKey: 'employee_id', + targetKey: 'id', + as: 'employee', + }); + + // 关联角色表 + EmployeeRole.belongsTo(Role, { + foreignKey: 'role_id', + targetKey: 'id', + as: 'role', + }); + }; + + return EmployeeRole; +}; diff --git a/app/model/entry_items.js b/app/model/entry_items.js new file mode 100644 index 0000000..5eb9cb1 --- /dev/null +++ b/app/model/entry_items.js @@ -0,0 +1,298 @@ +'use strict'; + +module.exports = app => { + const { STRING, INTEGER, BIGINT } = app.Sequelize; + + const EntryItems = app.model.define('wms_entry_items', { + id: { + type: BIGINT(20).UNSIGNED, + primaryKey: true, + autoIncrement: true, + comment: '入库明细ID', + }, + order_id: { + type: BIGINT(20).UNSIGNED, + allowNull: false, + comment: '入库单ID', + references: { + model: 'wms_entry_order', + key: 'id', + }, + }, + out_biz_code: { + type: STRING(255), + allowNull: true, + comment: '外部业务编码', + }, + order_line_no: { + type: BIGINT(20).UNSIGNED, + allowNull: true, + comment: '订单行号', + }, + owner_code: { + type: STRING(50), + allowNull: true, + comment: '货主编码', + }, + item_code: { + type: STRING(50), + allowNull: true, + comment: '商品编码', + }, + item_id: { + type: BIGINT(20).UNSIGNED, + allowNull: true, + comment: '商品ID', + }, + count: { + type: INTEGER(12), + allowNull: true, + comment: '计划入库数量', + validate: { + min: 0, + }, + }, + inventory_type: { + type: STRING(255), + allowNull: true, + comment: '库存类型', + }, + stock_id: { + type: BIGINT(20), + allowNull: true, + comment: '商品SKU ID', + references: { + model: 'wms_stock_warehouse', + key: 'id', + }, + }, + received_quantity: { + type: INTEGER(12), + allowNull: false, + defaultValue: 0, + comment: '已收货数量', + validate: { + min: 0, + }, + }, + confirm_quantity: { + type: INTEGER(12), + allowNull: false, + defaultValue: 0, + comment: '已通知数量', + validate: { + min: 0, + }, + }, + }, { + tableName: 'wms_entry_items', + comment: '入库明细表', + timestamps: false, + indexes: [ + { + name: 'order_id', + unique: true, + fields: [ 'order_id', 'order_line_no' ], + }, + { + name: 'idx_stock_id', + fields: [ 'stock_id' ], + }, + { + name: 'idx_item_code', + fields: [ 'item_code' ], + }, + { + name: 'idx_order_id', + fields: [ 'order_id' ], + }, + { + name: 'idx_received_quantity', + fields: [ 'received_quantity' ], + }, + ], + }); + + // 关联关系 + EntryItems.associate = function() { + const { EntryItems, EntryOrder, StockWarehouse } = app.model; + + // 关联入库单 + EntryItems.belongsTo(EntryOrder, { + foreignKey: 'order_id', + as: 'order', + }); + + // 关联商品SKU + EntryItems.belongsTo(StockWarehouse, { + foreignKey: 'stock_id', + as: 'stock', + }); + }; + + // 实例方法 - 验证收货数量 + EntryItems.prototype.validateReceiveQuantity = function(quantity) { + if (quantity <= 0) { + throw new Error('收货数量必须大于0'); + } + + const currentReceived = this.received_quantity || 0; + const planQuantity = this.count || 0; + const newReceived = currentReceived + quantity; + + if (newReceived > planQuantity) { + throw new Error(`收货数量超过计划数量:计划${planQuantity},已收${currentReceived},本次${quantity},合计${newReceived}`); + } + + return true; + }; + + // 实例方法 - 更新收货数量(带验证) + EntryItems.prototype.updateReceivedQuantity = async function(quantity, options = {}) { + // 验证数量 + this.validateReceiveQuantity(quantity); + + // 更新数量 + const newReceived = (this.received_quantity || 0) + quantity; + + await this.update({ + received_quantity: newReceived, + }, options); + + return this; + }; + + // 实例方法 - 获取剩余可收货数量 + EntryItems.prototype.getRemainingQuantity = function() { + const planQuantity = this.count || 0; + const receivedQuantity = this.received_quantity || 0; + return Math.max(0, planQuantity - receivedQuantity); + }; + + // 实例方法 - 是否已完成收货 + EntryItems.prototype.isCompleted = function() { + const planQuantity = this.count || 0; + const receivedQuantity = this.received_quantity || 0; + return receivedQuantity >= planQuantity; + }; + + // 实例方法 - 获取收货进度 + EntryItems.prototype.getProgress = function() { + const planQuantity = this.count || 0; + const receivedQuantity = this.received_quantity || 0; + + if (planQuantity === 0) return 0; + + return { + received: receivedQuantity, + plan: planQuantity, + remaining: Math.max(0, planQuantity - receivedQuantity), + percent: Math.min(100, Math.round((receivedQuantity / planQuantity) * 100)), + }; + }; + + // 静态方法 - 批量更新收货数量(带验证) + EntryItems.batchUpdateReceived = async function(app, updates, options = {}) { + const transaction = options.transaction || await app.model.transaction(); + + try { + // 先检查所有更新是否合法 + for (const update of updates) { + const { id, quantity } = update; + const item = await app.model.EntryItems.findByPk(id, { transaction }); + + if (!item) { + throw new Error(`入库明细 ${id} 不存在`); + } + + // 验证数量 + item.validateReceiveQuantity(quantity); + } + + // 执行更新 + for (const update of updates) { + const { id, quantity } = update; + const item = await app.model.EntryItems.findByPk(id, { transaction }); + + const newReceived = (item.received_quantity || 0) + quantity; + await item.update({ + received_quantity: newReceived, + }, { transaction }); + } + + if (!options.transaction) { + await transaction.commit(); + } + + return { success: true }; + } catch (error) { + if (!options.transaction) { + await transaction.rollback(); + } + throw error; + } + }; + + // 静态方法 - 获取入库单总进度 + EntryItems.getOrderProgress = async function(app, orderId) { + const items = await app.model.EntryItems.findAll({ + where: { order_id: orderId }, + attributes: [ + [ app.Sequelize.fn('SUM', app.Sequelize.col('count')), 'total_plan' ], + [ app.Sequelize.fn('SUM', app.Sequelize.col('received_quantity')), 'total_received' ], + [ app.Sequelize.fn('COUNT', app.Sequelize.col('id')), 'item_count' ], + ], + raw: true, + }); + + const result = items[0] || {}; + const totalPlan = parseInt(result.total_plan) || 0; + const totalReceived = parseInt(result.total_received) || 0; + + return { + total_plan: totalPlan, + total_received: totalReceived, + total_remaining: Math.max(0, totalPlan - totalReceived), + item_count: parseInt(result.item_count) || 0, + progress_percent: totalPlan > 0 ? Math.min(100, Math.round((totalReceived / totalPlan) * 100)) : 0, + is_completed: totalReceived >= totalPlan, + }; + }; + + // 钩子函数 - 保存前验证 + EntryItems.beforeSave(async (instance, options) => { + const received = instance.received_quantity || 0; + const plan = instance.count || 0; + + if (received > plan) { + throw new Error(`已收货数量(${received})不能超过计划数量(${plan})`); + } + + if (received < 0) { + throw new Error('已收货数量不能为负数'); + } + + if (plan < 0) { + throw new Error('计划数量不能为负数'); + } + }); + + // 钩子函数 - 更新前验证 + EntryItems.beforeUpdate(async (instance, options) => { + // 如果更新了received_quantity,进行验证 + if (instance.changed('received_quantity')) { + const received = instance.received_quantity || 0; + const plan = instance.count || 0; + + if (received > plan) { + throw new Error(`已收货数量(${received})不能超过计划数量(${plan})`); + } + + if (received < 0) { + throw new Error('已收货数量不能为负数'); + } + } + }); + + return EntryItems; +}; diff --git a/app/model/entry_order.js b/app/model/entry_order.js new file mode 100644 index 0000000..6de6b95 --- /dev/null +++ b/app/model/entry_order.js @@ -0,0 +1,511 @@ +'use strict'; + +module.exports = app => { + const { STRING, INTEGER, BIGINT, ENUM, TEXT, TINYINT, DATE } = app.Sequelize; + + const EntryOrder = app.model.define('wms_entry_order', { + id: { + type: BIGINT(20).UNSIGNED, + primaryKey: true, + autoIncrement: true, + comment: '入库单ID', + }, + entry_order_code: { + type: STRING(50), + allowNull: false, + comment: '入库单号', + validate: { + notEmpty: true, + }, + }, + order_type: { + type: ENUM('SCRK', 'LYRK', 'CCRK', 'CGRK', 'DBRK', 'QTRK', 'B2BRK', 'XNRK'), + allowNull: false, + comment: '业务类型', + }, + purchase_order_code: { + type: STRING(50), + allowNull: true, + comment: '采购单号', + }, + total_order_lines: { + type: INTEGER(11), + allowNull: false, + defaultValue: 0, + comment: '单据总行数', + }, + order_create_time: { + type: DATE, + allowNull: true, + comment: '订单创建时间', + }, + expect_start_time: { + type: DATE, + allowNull: true, + comment: '预期到货时间', + }, + expect_end_time: { + type: DATE, + allowNull: true, + comment: '最迟预期到货时间', + }, + logistics_code: { + type: STRING(50), + allowNull: true, + comment: '物流公司编码', + }, + logistics_name: { + type: STRING(200), + allowNull: true, + comment: '物流公司名称', + }, + express_code: { + type: STRING(50), + allowNull: true, + comment: '运单号', + }, + supplier_code: { + type: STRING(50), + allowNull: true, + comment: '供应商编码', + }, + supplier_name: { + type: STRING(200), + allowNull: true, + comment: '供应商名称', + }, + source_type: { + type: ENUM('WMS', 'API', 'QM'), + allowNull: false, + defaultValue: 'API', + comment: '来源类型', + }, + order_status: { + type: ENUM('PENDING', 'CONFIRMED', 'PARTIAL_RECEIVED', 'COMPLETED', 'CANCELLED', 'CREATED', 'CREATING'), + allowNull: false, + defaultValue: 'PENDING', + comment: '订单状态', + }, + sync_status: { + type: ENUM('PENDING', 'SUCCESS', 'FAILED'), + allowNull: false, + defaultValue: 'PENDING', + comment: '同步状态', + }, + sync_message: { + type: TEXT, + allowNull: true, + comment: '同步返回信息', + }, + is_enabled: { + type: TINYINT(1), + allowNull: false, + defaultValue: 1, + comment: '是否启用', + }, + created_at: { + type: DATE, + allowNull: true, + defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP'), + comment: '创建时间', + }, + updated_at: { + type: DATE, + allowNull: true, + comment: '更新时间', + }, + warehouse_id: { + type: BIGINT(20).UNSIGNED, + allowNull: false, + comment: '仓库ID', + references: { + model: 'wms_store', + key: 'id', + }, + }, + store_id: { + type: BIGINT(20).UNSIGNED, + allowNull: false, + comment: '货主ID', + references: { + model: 'wms_store', + key: 'id', + }, + }, + remark: { + type: STRING(500), + allowNull: true, + comment: 'ERP备注', + }, + store_name: { + type: STRING(200), + allowNull: true, + comment: '货主名称快照', + }, + warehouse_name: { + type: STRING(200), + allowNull: true, + comment: '仓库名称快照', + }, + deleted_at: { + type: DATE, + allowNull: true, + comment: '删除时间', + }, + qimen_owner_code: { + type: STRING(100), + allowNull: true, + comment: '奇门货主code', + }, + qimen_warehouse_code: { + type: STRING(100), + allowNull: true, + comment: '奇门仓库code', + }, + }, { + tableName: 'wms_entry_order', + comment: '入库单主表', + timestamps: false, + indexes: [ + { + name: 'uk_entry_order_code', + unique: true, + fields: [ 'entry_order_code', 'warehouse_id', 'store_id' ], + }, + { + name: 'idx_order_type', + fields: [ 'order_type' ], + }, + { + name: 'idx_order_status', + fields: [ 'order_status' ], + }, + { + name: 'idx_sync_status', + fields: [ 'sync_status' ], + }, + { + name: 'idx_source', + fields: [ 'source_type' ], + }, + { + name: 'idx_create_time', + fields: [ 'order_create_time' ], + }, + { + name: 'idx_warehouse_store', + fields: [ 'warehouse_id', 'store_id' ], + }, + { + name: 'idx_is_enabled', + fields: [ 'is_enabled' ], + }, + { + name: 'idx_deleted_at', + fields: [ 'deleted_at' ], + }, + ], + }); + + // 关联关系 + EntryOrder.associate = function() { + const { EntryOrder, Store, EntryItems } = app.model; + + // 关联仓库 + EntryOrder.belongsTo(Store, { + foreignKey: 'warehouse_id', + as: 'warehouse', + }); + + // 关联货主 + EntryOrder.belongsTo(Store, { + foreignKey: 'store_id', + as: 'store', + }); + + // 关联入库明细 + EntryOrder.hasMany(EntryItems, { + foreignKey: 'order_id', + as: 'items', + }); + }; + + // 实例方法 + EntryOrder.prototype.isPending = function() { + return this.order_status === 'PENDING'; + }; + + EntryOrder.prototype.isConfirmed = function() { + return this.order_status === 'CONFIRMED'; + }; + + EntryOrder.prototype.isCompleted = function() { + return this.order_status === 'COMPLETED'; + }; + + EntryOrder.prototype.isCancelled = function() { + return this.order_status === 'CANCELLED'; + }; + + EntryOrder.prototype.isPartialReceived = function() { + return this.order_status === 'PARTIAL_RECEIVED'; + }; + + EntryOrder.prototype.canConfirm = function() { + return [ 'PENDING', 'CREATED' ].includes(this.order_status); + }; + + EntryOrder.prototype.canCancel = function() { + return [ 'PENDING', 'CONFIRMED', 'CREATED' ].includes(this.order_status); + }; + + EntryOrder.prototype.canComplete = function() { + return [ 'CONFIRMED', 'PARTIAL_RECEIVED' ].includes(this.order_status); + }; + + EntryOrder.prototype.isSyncSuccess = function() { + return this.sync_status === 'SUCCESS'; + }; + + EntryOrder.prototype.isSyncFailed = function() { + return this.sync_status === 'FAILED'; + }; + + EntryOrder.prototype.isEnabled = function() { + return this.is_enabled === 1 && !this.deleted_at; + }; + + // 静态方法 + EntryOrder.findByOrderCode = async function(app, entryOrderCode, warehouseId, storeId) { + return await app.model.EntryOrder.findOne({ + where: { + entry_order_code: entryOrderCode, + warehouse_id: warehouseId, + store_id: storeId, + is_enabled: 1, + deleted_at: null, + }, + include: [ + { + model: app.model.Store, + as: 'warehouse', + attributes: [ 'store_name', 'store_code' ], + }, + { + model: app.model.Store, + as: 'store', + attributes: [ 'store_name' ], + }, + { + model: app.model.EntryItems, + as: 'items', + include: [{ + model: app.model.StockWarehouse, + as: 'stock', + attributes: [ 'product_code', 'product_name' ], + }], + }, + ], + }); + }; + + EntryOrder.findByStatus = async function(app, status, params = {}) { + const { warehouse_id, store_id, start_date, end_date, page = 1, pageSize = 20 } = params; + + const where = { + order_status: status, + is_enabled: 1, + deleted_at: null, + }; + + if (warehouse_id) { + where.warehouse_id = warehouse_id; + } + + if (store_id) { + where.store_id = store_id; + } + + if (start_date || end_date) { + where.created_at = {}; + if (start_date) { + where.created_at[app.Sequelize.Op.gte] = start_date; + } + if (end_date) { + where.created_at[app.Sequelize.Op.lte] = end_date; + } + } + + const { count, rows } = await app.model.EntryOrder.findAndCountAll({ + where, + include: [ + { + model: app.model.Store, + as: 'warehouse', + attributes: [ 'store_name' ], + }, + { + model: app.model.Store, + as: 'store', + attributes: [ 'store_name' ], + }, + ], + order: [[ 'created_at', 'DESC' ]], + offset: (page - 1) * pageSize, + limit: parseInt(pageSize), + distinct: true, + }); + + return { + list: rows, + pagination: { + page: parseInt(page), + pageSize: parseInt(pageSize), + total: count, + totalPages: Math.ceil(count / pageSize), + }, + }; + }; + + EntryOrder.getStatsByWarehouse = async function(app, warehouseId, startDate, endDate) { + const where = { + warehouse_id: warehouseId, + is_enabled: 1, + deleted_at: null, + }; + + if (startDate || endDate) { + where.created_at = {}; + if (startDate) { + where.created_at[app.Sequelize.Op.gte] = startDate; + } + if (endDate) { + where.created_at[app.Sequelize.Op.lte] = endDate; + } + } + + const result = await app.model.EntryOrder.findAll({ + attributes: [ + 'order_status', + [ app.Sequelize.fn('COUNT', app.Sequelize.col('id')), 'count' ], + [ app.Sequelize.fn('SUM', app.Sequelize.col('total_order_lines')), 'total_lines' ], + ], + where, + group: [ 'order_status' ], + raw: true, + }); + + const stats = { + pending: 0, + confirmed: 0, + partial_received: 0, + completed: 0, + cancelled: 0, + total: 0, + total_lines: 0, + }; + + result.forEach(item => { + const status = item.order_status.toLowerCase(); + if (stats[status] !== undefined) { + stats[status] = parseInt(item.count) || 0; + } + stats.total += parseInt(item.count) || 0; + stats.total_lines += parseInt(item.total_lines) || 0; + }); + + return stats; + }; + + EntryOrder.updateSyncStatus = async function(app, orderId, status, message = null) { + const order = await app.model.EntryOrder.findByPk(orderId); + + if (!order) { + throw new Error('入库单不存在'); + } + + const updateData = { + sync_status: status, + }; + + if (message !== null) { + updateData.sync_message = message; + } + + return await order.update(updateData); + }; + + EntryOrder.updateOrderStatus = async function(app, orderId, status) { + const order = await app.model.EntryOrder.findByPk(orderId); + + if (!order) { + throw new Error('入库单不存在'); + } + + const validTransitions = { + PENDING: [ 'CONFIRMED', 'CANCELLED' ], + CONFIRMED: [ 'PARTIAL_RECEIVED', 'COMPLETED', 'CANCELLED' ], + PARTIAL_RECEIVED: [ 'COMPLETED', 'CANCELLED' ], + CREATED: [ 'PENDING', 'CANCELLED' ], + CREATING: [ 'PENDING', 'CANCELLED' ], + }; + + const allowedTransitions = validTransitions[order.order_status]; + if (!allowedTransitions || !allowedTransitions.includes(status)) { + throw new Error(`状态从${order.order_status}转换到${status}不被允许`); + } + + return await order.update({ order_status: status }); + }; + + EntryOrder.calculateReceivedQuantities = async function(app, orderId) { + // 这里需要根据实际业务逻辑计算已收货数量 + // 通常需要查询入库明细和实际收货记录 + + // 示例:查询入库明细 + const items = await app.model.EntryItems.findAll({ + where: { order_id: orderId }, + attributes: [ + 'id', + 'count', + [ app.Sequelize.literal('(SELECT SUM(quantity) FROM wms_storage WHERE inbound_order_no = wms_entry_order.entry_order_code AND item_id = wms_entry_items.item_id)'), 'received' ], + ], + include: [{ + model: app.model.EntryOrder, + as: 'order', + attributes: [ 'entry_order_code' ], + }], + }); + + let totalExpected = 0; + let totalReceived = 0; + let allReceived = true; + let anyReceived = false; + + items.forEach(item => { + const expected = item.count || 0; + const received = item.received || 0; + + totalExpected += expected; + totalReceived += received; + + if (expected > 0 && received < expected) { + allReceived = false; + } + + if (received > 0) { + anyReceived = true; + } + }); + + return { + total_expected: totalExpected, + total_received: totalReceived, + all_received: allReceived, + any_received: anyReceived, + percentage: totalExpected > 0 ? Math.round((totalReceived / totalExpected) * 100) : 0, + }; + }; + + return EntryOrder; +}; diff --git a/app/model/fast_where.js b/app/model/fast_where.js new file mode 100644 index 0000000..83fcf0c --- /dev/null +++ b/app/model/fast_where.js @@ -0,0 +1,94 @@ +'use strict'; + +module.exports = app => { + const { STRING, INTEGER, TEXT, DATE } = app.Sequelize; + + const FastWhere = app.model.define('fast_where', { + id: { + type: INTEGER.UNSIGNED, + primaryKey: true, + autoIncrement: true, + allowNull: false, + comment: '主键ID', + }, + label: { + type: STRING(50), + allowNull: true, + comment: '条件/组名称', + }, + value: { + type: TEXT, + allowNull: true, + comment: '查询条件,json需要序列化', + get() { + const rawValue = this.getDataValue('value'); + if (!rawValue) return null; + try { + return JSON.parse(rawValue); + } catch (error) { + app.logger.error('[FastWhere] JSON parse error:', error); + return null; + } + }, + set(value) { + if (value) { + this.setDataValue('value', JSON.stringify(value)); + } else { + this.setDataValue('value', null); + } + }, + }, + pid: { + type: INTEGER, + allowNull: true, + defaultValue: 0, + comment: '父级id,方便树结构', + }, + icon: { + type: STRING(50), + allowNull: true, + comment: 'icon编码', + }, + type: { + type: STRING(50), + allowNull: true, + comment: '查询类别', + }, + createdAt: { + type: DATE, + allowNull: true, + field: 'created_at', + comment: '创建时间', + }, + updatedAt: { + type: DATE, + allowNull: true, + field: 'updated_at', + comment: '更新时间', + }, + }, { + // 模型配置 + tableName: 'wms_fast_where', // 数据库表名 + timestamps: true, // 自动维护时间戳 + freezeTableName: true, // 禁用表名复数化 + underscored: true, // 字段使用下划线命名 + comment: '快速查询条件表', + }); + + // 定义模型关联关系(如果需要) + FastWhere.associate = function() { + // 自关联:父级关系 + app.model.FastWhere.belongsTo(app.model.FastWhere, { + foreignKey: 'pid', + as: 'parent', + }); + + // 自关联:子级关系 + app.model.FastWhere.hasMany(app.model.FastWhere, { + foreignKey: 'pid', + as: 'children', + }); + }; + + return FastWhere; +}; diff --git a/app/model/file.js b/app/model/file.js new file mode 100644 index 0000000..ab10e36 --- /dev/null +++ b/app/model/file.js @@ -0,0 +1,165 @@ +// app/model/file.js +'use strict'; + +module.exports = app => { + const { BIGINT, INTEGER, STRING, TEXT, DATE, BOOLEAN } = app.Sequelize; + + const File = app.model.define('wms_file', { + id: { + type: BIGINT.UNSIGNED, + primaryKey: true, + autoIncrement: true, + comment: '文件唯一ID', + }, + warehouse_id: { + type: BIGINT.UNSIGNED, + allowNull: false, + comment: '仓库ID(核心统计维度)', + references: { + model: 'wms_store', + key: 'id', + }, + }, + file_key: { + type: STRING(500), + allowNull: false, + unique: true, + comment: '存储路径/对象键(如cos/2024/03/file.jpg)', + }, + file_url: { + type: STRING(500), + allowNull: false, + comment: '完整访问URL', + }, + file_name: { + type: STRING(255), + allowNull: false, + comment: '原始文件名', + }, + file_size: { + type: INTEGER.UNSIGNED, + allowNull: false, + defaultValue: 0, + comment: '文件大小(字节)', + }, + file_type: { + type: STRING(50), + defaultValue: '', + comment: '文件类型:inventory_image, delivery_note, inspection_video', + }, + mime_type: { + type: STRING(100), + defaultValue: '', + comment: 'MIME类型', + }, + md5_hash: { + type: STRING(32), + allowNull: false, + defaultValue: '', + unique: true, + comment: '文件MD5(去重依据)', + }, + sha1_hash: { + type: STRING(40), + allowNull: false, + defaultValue: '', + comment: '文件SHA1(二次校验)', + }, + storage_mode: { + type: STRING(20), + allowNull: false, + defaultValue: 'cos', + comment: '存储方式:cos/oss/local', + }, + storage_class: { + type: STRING(20), + defaultValue: 'standard', + comment: '存储级别:standard/ia/archive', + }, + uploader_id: { + type: STRING(64), + allowNull: false, + comment: '上传者ID(用户ID/员工工号)', + }, + uploader_name: { + type: STRING(100), + allowNull: false, + comment: '上传者姓名(快照)', + }, + uploader_dept: { + type: STRING(100), + defaultValue: '', + comment: '上传者部门(快照)', + }, + created_at: { + type: DATE, + allowNull: false, + defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP'), + comment: '创建时间', + }, + updated_at: { + type: DATE, + defaultValue: null, + comment: '更新时间', + }, + is_deleted: { + type: BOOLEAN, + allowNull: false, + defaultValue: false, + field: 'is_deleted', + comment: '软删除标记', + }, + deleted_at: { + type: DATE, + defaultValue: null, + comment: '删除时间', + }, + deleted_by: { + type: STRING(64), + defaultValue: null, + comment: '删除操作人', + }, + }, { + tableName: 'wms_file', + comment: 'WMS文件资源中枢表', + timestamps: false, // 使用自定义的created_at/updated_at + paranoid: false, // 使用自定义的软删除字段 + indexes: [ + { + name: 'idx_warehouse', + fields: [ 'warehouse_id' ], + }, + { + name: 'idx_uploader', + fields: [ 'uploader_type', 'uploader_id' ], + }, + { + name: 'idx_created', + fields: [ 'created_at' ], + }, + { + name: 'idx_type_warehouse', + fields: [ 'file_type', 'warehouse_id' ], + }, + ], + }); + + // 关联定义(如果需要) + File.associate = function() { + const { Store, FileReference } = app.model; + + // 属于一个仓库 + File.belongsTo(Store, { + foreignKey: 'warehouse_id', + as: 'warehouse', + }); + + // 有多个业务引用 + File.hasMany(FileReference, { + foreignKey: 'file_id', + as: 'references', + }); + }; + + return File; +}; diff --git a/app/model/file_reference.js b/app/model/file_reference.js new file mode 100644 index 0000000..b90a8db --- /dev/null +++ b/app/model/file_reference.js @@ -0,0 +1,102 @@ +// app/model/file_reference.js +'use strict'; + +module.exports = app => { + const { BIGINT, INTEGER, STRING, TEXT, DATE, BOOLEAN, JSON: JSON_TYPE } = app.Sequelize; + + const FileReference = app.model.define('wms_file_reference', { + id: { + type: BIGINT.UNSIGNED, + primaryKey: true, + autoIncrement: true, + comment: '主键ID', + }, + file_id: { + type: BIGINT.UNSIGNED, + allowNull: false, + comment: '文件ID', + references: { + model: 'wms_file', + key: 'id', + }, + }, + warehouse_id: { + type: BIGINT.UNSIGNED, + allowNull: false, + comment: '仓库ID(冗余,优化查询)', + references: { + model: 'wms_store', + key: 'id', + }, + }, + business_type: { + type: STRING(50), + allowNull: false, + comment: '业务类型:sku_image/packing_list/inspection_report', + }, + business_id: { + type: STRING(64), + allowNull: false, + comment: '业务ID(如SKU编码、出库单号)', + }, + display_order: { + type: INTEGER.UNSIGNED, + defaultValue: 0, + comment: '显示顺序', + }, + created_by: { + type: STRING(64), + allowNull: false, + comment: '关联创建者', + }, + created_at: { + type: DATE, + allowNull: false, + defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP'), + comment: '创建时间', + }, + }, { + tableName: 'wms_file_reference', + comment: 'WMS文件业务关联表', + timestamps: false, // 使用自定义的created_at + indexes: [ + { + name: 'uk_business_file', + unique: true, + fields: [ 'business_module', 'business_type', 'business_id', 'file_id' ], + }, + { + name: 'idx_file_id', + fields: [ 'file_id' ], + }, + { + name: 'idx_warehouse_business', + fields: [ 'warehouse_id', 'business_module', 'business_type' ], + }, + { + name: 'idx_business', + fields: [ 'business_module', 'business_id' ], + }, + ], + }); + + // 关联定义 + FileReference.associate = function() { + const { File, Store } = app.model; + + // 属于一个文件 + FileReference.belongsTo(File, { + foreignKey: 'file_id', + as: 'file', + }); + + // 属于一个仓库 + FileReference.belongsTo(Store, { + foreignKey: 'warehouse_id', + as: 'warehouse', + }); + + }; + + return FileReference; +}; diff --git a/app/model/i18n_key.js b/app/model/i18n_key.js new file mode 100644 index 0000000..eb96cbc --- /dev/null +++ b/app/model/i18n_key.js @@ -0,0 +1,49 @@ +// app/model/i18n_key.js +'use strict'; + +module.exports = app => { + const { STRING, INTEGER, DATE } = app.Sequelize; + + const I18nKey = app.model.define('wms_i18n_key', { + id: { + type: INTEGER.UNSIGNED, + primaryKey: true, + autoIncrement: true, + }, + key_name: { + type: STRING(255), + allowNull: false, + comment: '国际化键名', + }, + project: { + type: STRING(50), + allowNull: false, + defaultValue: 'wms', + comment: '项目标识', + }, + module: { + type: STRING(100), + defaultValue: 'common', + comment: '业务模块', + }, + description: { + type: STRING(500), + comment: '键值描述', + }, + status: { + type: INTEGER, + allowNull: false, + defaultValue: 1, + comment: '键值状态', + }, + }, { + tableName: 'wms_i18n_keys', + timestamps: true, + createdAt: 'created_at', + updatedAt: 'updated_at', + underscored: true, + paranoid: false, + }); + + return I18nKey; +}; diff --git a/app/model/i18n_translation.js b/app/model/i18n_translation.js new file mode 100644 index 0000000..0e20141 --- /dev/null +++ b/app/model/i18n_translation.js @@ -0,0 +1,182 @@ +// app/model/i18n_translation.js +'use strict'; + +module.exports = app => { + const { STRING, INTEGER, DATE, Op } = app.Sequelize; + + // 直接在文件中定义常量 + const CONSTANTS = { + TRANSLATION_STATUS: { + UNTRANSLATED: 0, + PENDING_REVIEW: 1, + APPROVED: 2, + }, + LANGUAGES: [ 'zh-CN', 'en-US', 'ja-JP' ], + }; + + const I18nTranslation = app.model.define('wms_i18n_translation', { + id: { + type: INTEGER.UNSIGNED, + primaryKey: true, + autoIncrement: true, + }, + key_id: { + type: INTEGER.UNSIGNED, + allowNull: false, + comment: '键ID', + }, + language: { + type: STRING(10), + allowNull: false, + comment: '语言代码', + }, + translation: { + type: STRING(500), + comment: '翻译内容', + }, + translation_status: { + type: INTEGER, + allowNull: false, + defaultValue: CONSTANTS.TRANSLATION_STATUS.UNTRANSLATED, + comment: '翻译状态', + }, + }, { + tableName: 'wms_i18n_translations', + timestamps: true, + createdAt: 'created_at', + updatedAt: 'updated_at', + underscored: true, + paranoid: false, + }); + + // 关联关系 + I18nTranslation.associate = function() { + app.model.I18nTranslation.belongsTo(app.model.I18nKey, { + foreignKey: 'key_id', + as: 'key', + }); + }; + + // 挂载常量到模型(可选) + I18nTranslation.CONSTANTS = CONSTANTS; + + /** + * 获取翻译 + * @param keyId + * @param language + */ + I18nTranslation.getTranslation = async function(keyId, language) { + return await this.findOne({ + where: { key_id: keyId, language }, + include: [{ + model: app.model.I18nKey, + as: 'key', + }], + }); + }; + + /** + * 批量获取翻译 + * @param keyIds + * @param language + */ + I18nTranslation.batchGetTranslations = async function(keyIds, language) { + const records = await this.findAll({ + where: { + key_id: keyIds, + language, + }, + include: [{ + model: app.model.I18nKey, + as: 'key', + attributes: [ 'key_name' ], + }], + }); + + // 返回键值对 + const result = {}; + records.forEach(record => { + if (record.key) { + result[record.key.key_name] = record.translation || record.key.key_name; + } + }); + + return result; + }; + + /** + * 获取项目翻译 + * @param project + * @param language + */ + I18nTranslation.getProjectTranslations = async function(project, language) { + const records = await this.findAll({ + include: [{ + model: app.model.I18nKey, + as: 'key', + where: { project }, + attributes: [ 'key_name' ], + }], + where: { language }, + }); + + const result = {}; + records.forEach(record => { + if (record.key && record.key.key_name) { + result[record.key.key_name] = record.translation || record.key.key_name; + } + }); + + return result; + }; + + /** + * 创建或更新翻译 + * @param keyId + * @param language + * @param translation + */ + I18nTranslation.upsertTranslation = async function(keyId, language, translation) { + const [ record, created ] = await this.findOrCreate({ + where: { key_id: keyId, language }, + defaults: { + key_id: keyId, + language, + translation: translation || null, + translation_status: translation ? CONSTANTS.TRANSLATION_STATUS.PENDING_REVIEW : CONSTANTS.TRANSLATION_STATUS.UNTRANSLATED, + }, + }); + + if (!created) { + record.translation = translation || null; + record.translation_status = translation ? CONSTANTS.TRANSLATION_STATUS.PENDING_REVIEW : CONSTANTS.TRANSLATION_STATUS.UNTRANSLATED; + await record.save(); + } + + return record; + }; + + /** + * 获取未翻译列表 + * @param language + * @param project + */ + I18nTranslation.getUntranslated = async function(language, project) { + return await this.findAll({ + include: [{ + model: app.model.I18nKey, + as: 'key', + where: { project }, + }], + where: { + language, + [Op.or]: [ + { translation: null }, + { translation: '' }, + ], + }, + }); + }; + + return I18nTranslation; +}; diff --git a/app/model/interface_type.js b/app/model/interface_type.js new file mode 100644 index 0000000..fc63789 --- /dev/null +++ b/app/model/interface_type.js @@ -0,0 +1,143 @@ +'use strict'; + +module.exports = app => { + const { INTEGER, STRING, TEXT, ENUM, TINYINT, DATE } = app.Sequelize; + + const InterfaceType = app.model.define('interface_type', { + id: { + type: INTEGER(10), + primaryKey: true, + autoIncrement: true, + allowNull: false, + comment: '接口类型ID', + }, + interface_code: { + type: STRING(100), + allowNull: false, + unique: 'uk_interface_code', + validate: { + notEmpty: true, + len: [ 1, 100 ], + }, + comment: '接口编码,唯一标识', + }, + interface_name: { + type: STRING(200), + allowNull: false, + validate: { + notEmpty: true, + len: [ 1, 200 ], + }, + comment: '接口名称', + }, + interface_category: { + type: ENUM('QM_WMS', 'OPEN_API'), + allowNull: false, + validate: { + isIn: [[ 'QM_WMS', 'OPEN_API' ]], + }, + comment: '接口类别:QM_WMS-奇门仓储, OPEN_API-开放接口', + }, + entry_url: { + type: STRING(500), + allowNull: false, + validate: { + notEmpty: true, + len: [ 1, 500 ], + }, + comment: '入口链接', + }, + description: { + type: TEXT, + allowNull: true, + comment: '接口描述', + }, + is_enabled: { + type: TINYINT(1), + allowNull: false, + defaultValue: 1, + validate: { + isIn: [[ 0, 1 ]], + }, + comment: '是否启用', + }, + created_at: { + type: DATE, + allowNull: false, + comment: '创建时间', + }, + updated_at: { + type: DATE, + allowNull: false, + comment: '更新时间', + }, + }, { + tableName: 'wms_interface_type', + freezeTableName: true, + underscored: true, + timestamps: true, + createdAt: 'created_at', + updatedAt: 'updated_at', + comment: '接口类型配置表', + indexes: [ + { + name: 'uk_interface_code', + unique: true, + fields: [ 'interface_code' ], + }, + { + name: 'idx_interface_category', + fields: [ 'interface_category' ], + }, + { + name: 'idx_is_enabled', + fields: [ 'is_enabled' ], + }, + { + name: 'idx_interface_name', + fields: [ 'interface_name' ], + }, + { + name: 'idx_category_enabled', + fields: [ 'interface_category', 'is_enabled' ], + }, + ], + }); + + + // 类方法 - 根据接口编码查找 + InterfaceType.findByCode = async function(interfaceCode) { + return await this.findOne({ + where: { interface_code: interfaceCode }, + }); + }; + + // 类方法 - 获取启用的接口列表 + InterfaceType.findEnabled = async function(category = null) { + const where = { is_enabled: 1 }; + if (category) { + where.interface_category = category; + } + + return await this.findAll({ + where, + order: [[ 'interface_name', 'ASC' ]], + }); + }; + + // 实例方法 - 检查接口是否可用 + InterfaceType.prototype.isAvailable = function() { + return this.is_enabled === 1; + }; + + // 实例方法 - 获取接口分类名称 + InterfaceType.prototype.getCategoryName = function() { + const categoryMap = { + QM_WMS: '奇门仓储', + OPEN_API: '开放接口', + }; + return categoryMap[this.interface_category] || this.interface_category; + }; + + return InterfaceType; +}; diff --git a/app/model/location_space.js b/app/model/location_space.js new file mode 100644 index 0000000..875299a --- /dev/null +++ b/app/model/location_space.js @@ -0,0 +1,253 @@ +'use strict'; + +module.exports = app => { + const { STRING, INTEGER, DATE, BOOLEAN, ENUM, DECIMAL, BIGINT } = app.Sequelize; + + const LocationSpace = app.model.define('wms_location_space', { + id: { + type: BIGINT(20).UNSIGNED, + primaryKey: true, + autoIncrement: true, + comment: '仓位ID', + }, + warehouse_id: { + type: BIGINT(20).UNSIGNED, + allowNull: false, + comment: '仓库ID', + }, + zone_id: { + type: INTEGER(10).UNSIGNED, + allowNull: false, + comment: '所属分区ID', + }, + location_type_id: { + type: INTEGER(10).UNSIGNED, + allowNull: false, + comment: '仓位类型ID', + }, + space_code: { + type: STRING(50), + allowNull: false, + comment: '仓位编码', + }, + custom_name: { + type: STRING(100), + allowNull: true, + comment: '自定义名称', + }, + custom_barcode: { + type: STRING(100), + allowNull: true, + comment: '自定义条码', + }, + row_no: { + type: STRING(10), + allowNull: true, + comment: '排号', + }, + column_no: { + type: STRING(10), + allowNull: true, + comment: '列号', + }, + level_no: { + type: STRING(10), + allowNull: true, + comment: '层号', + }, + cell_no: { + type: STRING(10), + allowNull: true, + comment: '格号', + }, + length: { + type: DECIMAL(8, 2), + allowNull: true, + comment: '长度(cm)', + }, + width: { + type: DECIMAL(8, 2), + allowNull: true, + comment: '宽度(cm)', + }, + height: { + type: DECIMAL(8, 2), + allowNull: true, + comment: '高度(cm)', + }, + volume: { + type: DECIMAL(10, 2), + allowNull: true, + comment: '体积(m³)', + }, + max_weight: { + type: DECIMAL(10, 2), + allowNull: true, + comment: '最大承重(kg)', + }, + space_status: { + type: ENUM('AVAILABLE', 'OCCUPIED', 'RESERVED', 'MAINTENANCE', 'DISABLED'), + allowNull: false, + defaultValue: 'AVAILABLE', + comment: '仓位状态', + }, + is_enabled: { + type: BOOLEAN, + allowNull: false, + defaultValue: true, + comment: '是否启用', + }, + current_sku_count: { + type: INTEGER(11), + allowNull: true, + defaultValue: 0, + comment: '当前SKU种类数', + }, + current_quantity: { + type: INTEGER(11), + allowNull: true, + defaultValue: 0, + comment: '当前库存数量', + }, + current_weight: { + type: DECIMAL(10, 2), + allowNull: true, + defaultValue: 0, + comment: '当前重量(kg)', + }, + current_volume: { + type: DECIMAL(10, 2), + allowNull: true, + defaultValue: 0, + comment: '当前体积(m³)', + }, + pick_sequence: { + type: INTEGER(10), + allowNull: true, + comment: '拣货顺序', + }, + pick_zone_id: { + type: INTEGER(10), + allowNull: true, + comment: '所属拣货分区ID', + }, + is_preferred_pick: { + type: BOOLEAN, + allowNull: true, + defaultValue: false, + comment: '是否优先拣货位', + }, + distance_from_start: { + type: INTEGER(11), + allowNull: true, + comment: '距起始点距离(mm)', + }, + pick_time_estimate: { + type: INTEGER(11), + allowNull: true, + defaultValue: 0, + comment: '预估拣货时间(秒)', + }, + pick_priority: { + type: INTEGER(3), + allowNull: true, + defaultValue: 50, + comment: '拣货优先级(1-100)', + }, + last_picked_at: { + type: DATE, + allowNull: true, + comment: '最后拣货时间', + }, + pick_count: { + type: INTEGER(11), + allowNull: true, + defaultValue: 0, + comment: '拣货次数', + }, + relative_x: { + type: DECIMAL(8, 2), + allowNull: true, + comment: '在货架内的X坐标(cm)', + }, + relative_y: { + type: DECIMAL(8, 2), + allowNull: true, + comment: '在货架内的Y坐标(cm)', + }, + relative_z: { + type: DECIMAL(8, 2), + allowNull: true, + comment: '在货架内的Z坐标(cm)', + }, + created_by: { + type: BIGINT(20), + allowNull: true, + comment: '创建人', + }, + updated_by: { + type: BIGINT(20), + allowNull: true, + comment: '更新人', + }, + deleted_at: { + type: DATE, + allowNull: true, + comment: '软删除时间', + }, + }, { + tableName: 'wms_location_space', + timestamps: true, + createdAt: 'created_at', + updatedAt: 'updated_at', + paranoid: true, + deletedAt: 'deleted_at', + comment: '仓位格子表', + indexes: [ + { + name: 'uk_warehouse_space_code', + unique: true, + fields: [ 'warehouse_id', 'space_code', 'deleted_at' ], + }, + { name: 'uk_custom_barcode', unique: true, fields: [ 'custom_barcode' ] }, + { fields: [ 'warehouse_id', 'zone_id' ] }, + { fields: [ 'location_type_id' ] }, + { fields: [ 'space_status' ] }, + { fields: [ 'is_enabled' ] }, + { fields: [ 'row_no', 'column_no', 'level_no' ] }, + { fields: [ 'zone_id' ] }, + { fields: [ 'warehouse_id', 'pick_sequence', 'space_status' ] }, + { fields: [ 'pick_priority', 'space_status' ] }, + { fields: [ 'last_picked_at' ] }, + { fields: [ 'pick_zone_id' ] }, + ], + }); + + // 关联关系 + LocationSpace.associate = function() { + const { LocationSpace, LocationZone, Store, LocationType, ReceivingDetail } = app.model; + LocationSpace.belongsTo(LocationZone, { + as: 'zone', + foreignKey: 'zone_id', + }); + + LocationSpace.belongsTo(Store, { + as: 'warehouse', + foreignKey: 'warehouse_id', + }); + + LocationSpace.belongsTo(LocationType, { + as: 'locationType', + foreignKey: 'location_type_id', + }); + + // 关联系统商品 + LocationSpace.hasMany(ReceivingDetail, { + as: 'receiving', + foreignKey: 'space_id', + }); + + }; + + return LocationSpace; +}; diff --git a/app/model/location_type.js b/app/model/location_type.js new file mode 100644 index 0000000..de15abf --- /dev/null +++ b/app/model/location_type.js @@ -0,0 +1,80 @@ +// app/model/wms_location_type.js + +module.exports = app => { + const { STRING, INTEGER, BOOLEAN, DATE, ENUM, BIGINT } = app.Sequelize; + + const LocationType = app.model.define('location_type', { + id: { + type: INTEGER(10).UNSIGNED, + primaryKey: true, + autoIncrement: true, + comment: '类型ID', + }, + type_code: { + type: STRING(50), + allowNull: false, + unique: 'uk_type_code', + comment: '类型编码', + }, + type_name: { + type: STRING(100), + allowNull: false, + comment: '类型名称', + }, + temperature_zone: { + type: ENUM('NORMAL', 'COLD', 'FROZEN', 'DANGEROUS'), + defaultValue: 'NORMAL', + comment: '温区', + }, + is_active: { + type: BOOLEAN, + allowNull: false, + defaultValue: true, + }, + description: { + type: STRING(500), + comment: '描述', + }, + created_at: { + type: DATE, + defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP'), + }, + allow_allocation: { + type: BOOLEAN, + comment: '是否允许分配储位', + }, + allow_transfer_out: { + type: BOOLEAN, + comment: '是否允许移出', + }, + warehouse_id: { + type: BIGINT(20).UNSIGNED, + comment: '仓库ID', + references: { + model: 'wms_store', + key: 'id', + }, + }, + }, { + tableName: 'wms_location_type', + timestamps: false, // 不使用 Sequelize 的默认时间戳 + comment: '库位类型表', + indexes: [ + { + name: 'warehouse_id', + fields: [ 'warehouse_id' ], + }, + ], + }); + + // 定义关联关系 + LocationType.associate = function() { + app.model.LocationType.belongsTo(app.model.Store, { + foreignKey: 'warehouse_id', + targetKey: 'id', + constraints: false, // 如果 wms_store 表不存在,设置为 false + }); + }; + + return LocationType; +}; diff --git a/app/model/location_zone.js b/app/model/location_zone.js new file mode 100644 index 0000000..a93ea3c --- /dev/null +++ b/app/model/location_zone.js @@ -0,0 +1,245 @@ +'use strict'; + +module.exports = app => { + const { STRING, INTEGER, DATE, BOOLEAN, ENUM, TEXT, BIGINT } = app.Sequelize; + + const LocationZone = app.model.define('wms_location_zone', { + id: { + type: INTEGER(10).UNSIGNED, + primaryKey: true, + autoIncrement: true, + comment: '分区ID', + }, + warehouse_id: { + type: BIGINT(20).UNSIGNED, + allowNull: true, + comment: '仓库ID', + }, + zone_code: { + type: STRING(5), + allowNull: true, + comment: '分区编码(最多5位字母或数字)', + }, + zone_name: { + type: STRING(100), + allowNull: false, + comment: '分区名称', + }, + zone_type: { + type: ENUM('warehouse', 'area', 'rack', 'pick_start'), + allowNull: false, + comment: '分区类型', + }, + parent_id: { + type: INTEGER(10).UNSIGNED, + allowNull: true, + comment: '父分区ID', + }, + is_active: { + type: BOOLEAN, + allowNull: false, + defaultValue: true, + comment: '是否启用', + }, + x: { + type: INTEGER(11), + allowNull: false, + comment: '左下角x坐标(mm)', + }, + y: { + type: INTEGER(11), + allowNull: false, + comment: '左下角y坐标(mm)', + }, + z: { + type: INTEGER(11), + allowNull: false, + comment: '左下角z坐标(mm)', + }, + length: { + type: INTEGER(11), + allowNull: false, + comment: '长度(mm)', + }, + width: { + type: INTEGER(11), + allowNull: false, + comment: '宽度(mm)', + }, + height: { + type: INTEGER(11), + allowNull: false, + comment: '高度(mm)', + }, + rack_columns: { + type: INTEGER(3).UNSIGNED, + allowNull: true, + defaultValue: 1, + comment: '货架列数', + }, + rack_rows: { + type: INTEGER(3).UNSIGNED, + allowNull: true, + comment: '货架层数', + }, + rack_levels: { + type: INTEGER(3).UNSIGNED, + allowNull: true, + comment: '货架分格数', + }, + cell_width: { + type: INTEGER(11).UNSIGNED, + allowNull: true, + comment: '货架长度', + }, + cell_height: { + type: INTEGER(11).UNSIGNED, + allowNull: true, + comment: '货架高度', + }, + cell_length: { + type: INTEGER(11).UNSIGNED, + allowNull: true, + comment: '货架深度', + }, + direction: { + type: ENUM('north', 'south', 'east', 'west'), + allowNull: true, + comment: '货架朝向', + }, + color: { + type: STRING(20), + allowNull: true, + defaultValue: '#3B82F6', + comment: '显示颜色', + }, + path_sequence: { + type: INTEGER(10).UNSIGNED, + allowNull: true, + comment: '拣货路径排序序号', + }, + pick_distance: { + type: INTEGER(11), + allowNull: true, + comment: '距离起始点的拣货距离(mm)', + }, + aisles: { + type: STRING(255), + allowNull: true, + comment: '通道在货架的列的位置', + get() { + const rawValue = this.getDataValue('aisles'); + try { + return rawValue ? rawValue.split(',') : []; + } catch { + return []; + } + }, + set(value) { + const normalized = value + ? value.join(',') + : null; + + this.setDataValue('aisles', normalized); + }, + }, + neighbor_zone_ids: { + type: TEXT, + allowNull: true, + comment: '相邻分区ID列表(JSON数组)', + get() { + const rawValue = this.getDataValue('neighbor_zone_ids'); + try { + return rawValue ? JSON.parse(rawValue) : []; + } catch { + return []; + } + }, + set(value) { + this.setDataValue('neighbor_zone_ids', + value ? JSON.stringify(value) : null + ); + }, + }, + is_passable: { + type: BOOLEAN, + allowNull: true, + defaultValue: true, + comment: '是否可通行', + }, + zone_category: { + type: ENUM('storage', 'operational', 'obstacle'), + allowNull: true, + defaultValue: 'storage', + comment: '区域分类', + }, + deleted_at: { + type: DATE, + allowNull: true, + comment: '软删除时间', + }, + }, { + tableName: 'wms_location_zone', + timestamps: true, + createdAt: 'created_at', + updatedAt: 'updated_at', + paranoid: true, // 软删除 + deletedAt: 'deleted_at', + comment: '库位分区表', + indexes: [ + { + name: 'uk_warehouse_zone_code', + unique: true, + fields: [ 'warehouse_id', 'zone_code', 'deleted_at' ], + }, + { fields: [ 'warehouse_id', 'parent_id' ] }, + { fields: [ 'deleted_at' ] }, + { fields: [ 'zone_type' ] }, + { fields: [ 'is_active' ] }, + { fields: [ 'parent_id' ] }, + { fields: [ 'warehouse_id', 'path_sequence', 'is_active' ] }, + { fields: [ 'zone_category' ] }, + { fields: [ 'warehouse_id', 'pick_distance' ] }, + ], + }); + + // 关联关系 + LocationZone.associate = function() { + // 自关联 - 父分区 + app.model.LocationZone.belongsTo(app.model.LocationZone, { + as: 'parent', + foreignKey: 'parent_id', + }); + + // 自关联 - 子分区 + app.model.LocationZone.hasMany(app.model.LocationZone, { + as: 'children', + foreignKey: 'parent_id', + }); + + // 关联仓库 + app.model.LocationZone.belongsTo(app.model.Store, { + as: 'warehouse', + foreignKey: 'warehouse_id', + }); + + // 关联仓位 + app.model.LocationZone.hasMany(app.model.LocationSpace, { + as: 'spaces', + foreignKey: 'zone_id', + }); + + // 关联起始拣货点 + app.model.LocationZone.belongsTo(app.model.LocationZone, { + as: 'pickStartPoint', + foreignKey: 'warehouse_id', + targetKey: 'warehouse_id', + scope: { + zone_type: 'pick_start', + is_active: true, + }, + }); + }; + + return LocationZone; +}; diff --git a/app/model/operation_log.js b/app/model/operation_log.js new file mode 100644 index 0000000..850b44d --- /dev/null +++ b/app/model/operation_log.js @@ -0,0 +1,109 @@ +// app/model/operation_log.js + +'use strict'; + +module.exports = app => { + const { STRING, INTEGER, BIGINT, DATE, ENUM, JSON } = app.Sequelize; + + const OperationLog = app.model.define('operation_log', { + id: { + type: BIGINT(20), + primaryKey: true, + autoIncrement: true, + comment: '主键ID', + }, + business_type: { + type: STRING(50), + allowNull: false, + comment: '业务类型: product, order, stock, wave, express, storage', + }, + business_id: { + type: STRING(100), + allowNull: false, + comment: '业务ID', + }, + operation_code: { + type: STRING(50), + allowNull: false, + comment: '操作编码', + }, + operator_id: { + type: STRING(100), + allowNull: true, + comment: '操作人ID(用户ID/系统ID)', + }, + operator_name: { + type: STRING(100), + allowNull: true, + comment: '操作人名称', + }, + external_log_type: { + type: ENUM('REQUEST', 'API', 'QIMEN', 'NONE'), + allowNull: false, + defaultValue: 'NONE', + comment: '外部日志类型', + }, + external_log_id: { + type: BIGINT(20), + allowNull: true, + comment: '外部日志ID', + }, + warehouse_id: { + type: INTEGER(11), + allowNull: true, + comment: '仓库ID', + }, + before_changes: { + type: JSON, + allowNull: true, + comment: '变更前数据', + }, + platform_code: { + type: STRING(20), + allowNull: true, + comment: '操作端', + }, + created_at: { + type: DATE, + allowNull: false, + defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP'), + comment: '创建时间', + }, + }, { + tableName: 'wms_operation_log', // 数据库中的实际表名 + timestamps: false, // 不使用默认的 createdAt 和 updatedAt + comment: 'WMS业务操作日志表', + indexes: [ + { + unique: true, + name: 'uk_business_operation', + fields: [ 'business_type', 'business_id', 'id' ], + }, + { + name: 'idx_business_type_id_time', + fields: [ 'business_type', 'business_id', 'created_at' ], + }, + { + name: 'idx_operation_code_time', + fields: [ 'operation_code', 'created_at' ], + }, + { + name: 'idx_operator_time', + fields: [ 'operator_id', 'created_at' ], + }, + { + name: 'idx_warehouse_time', + fields: [ 'warehouse_id', 'created_at' ], + }, + { + name: 'idx_external_log', + fields: [ 'external_log_type', 'external_log_id' ], + }, + { + name: 'idx_created_at', + fields: [ 'created_at' ], + }, + ], + }); + return OperationLog; +}; diff --git a/app/model/order_delivery.js b/app/model/order_delivery.js new file mode 100644 index 0000000..3b654ae --- /dev/null +++ b/app/model/order_delivery.js @@ -0,0 +1,461 @@ +'use strict'; + +module.exports = app => { + const { Sequelize, model } = app; + const { STRING, BIGINT, DECIMAL, TEXT, ENUM, DATE, INTEGER, CHAR, SMALLINT } = Sequelize; + + // 状态机枚举定义 + const StatusEnum = { + STATUS: [ 'pedding', 'created', 'cancel', 'error' ], + SYNC_STATUS: [ 'padding', 'fin', 'error' ], + POST_STATUS: [ 'padding', 'fin', 'timeout', 'error', 'none' ], + STORAGE_STATUS: [ 'padding', 'fin', 'error', 'none' ], + PICK_STATUS: [ 'padding', 'fin', 'error', 'none' ], + PACK_STATUS: [ 'none', 'padding', 'fin', 'error' ], + INSPECTION_STATUS: [ 'none', 'padding', 'running', 'fin', 'error' ], + PRINT_STATUS: [ 'none', 'padding', 'fin', 'error' ], + CLAIM_STATUS: [ 'none', 'padding', 'fin', 'error' ], + OUTBOUND_STATUS: [ 'none', 'padding', 'fin', 'error' ], + LOCK_STATUS: [ 'none', 'warehouse', 'store' ], + INTERCEPT_STATUS: [ + 'none', 'requesting', 'requested', 'intercepting', + 'intercepted_in_transit', 'intercepted_at_warehouse', + 'returning', 'returned', 'delivered_by_mistake', + 'timeout', 'cancelled', 'failed', 'exception', + ], + URGENCY: [ 'Y', 'N' ], + INVOICE: [ 'Y', 'N' ], + }; + + // 基础模型定义 + const baseModel = { + id: { + type: BIGINT(20).UNSIGNED, + primaryKey: true, + autoIncrement: true, + }, + delivery_order_code: { + type: STRING(50), + allowNull: true, + comment: '发货单号', + }, + pre_delivery_order_code: { + type: STRING(50), + allowNull: true, + comment: '预发货单号', + }, + pre_delivery_order_id: { + type: STRING(50), + allowNull: true, + comment: '预发货单ID', + }, + order_type: { + type: STRING(50), + allowNull: true, + comment: '订单类型', + }, + warehouse_code: { + type: STRING(50), + allowNull: true, + comment: '仓库编码', + }, + order_flag: { + type: STRING(200), + allowNull: true, + comment: '订单标记', + }, + source_platform_code: { + type: STRING(50), + allowNull: true, + comment: '来源平台编码', + }, + source_platform_name: { + type: STRING(200), + allowNull: true, + comment: '来源平台名称', + }, + create_at: { + type: DATE, + allowNull: true, + comment: '创建时间', + }, + delete_at: { + type: DATE, + allowNull: true, + comment: '删除时间', + }, + updated_at: { + type: DATE, + allowNull: true, + comment: '更新时间', + }, + place_order_time: { + type: DATE, + allowNull: true, + comment: '店铺创建订单时间', + }, + pay_time: { + type: DATE, + allowNull: true, + comment: '支付时间', + }, + pay_no: { + type: STRING(50), + allowNull: true, + comment: '支付单号', + }, + service_code: { + type: STRING(50), + allowNull: true, + comment: '集包服务编码', + }, + operator_name: { + type: STRING(50), + allowNull: true, + comment: 'ERP审核人', + }, + operate_time: { + type: DATE, + allowNull: true, + comment: 'ERP审核时间', + }, + shop_nick: { + type: STRING(200), + allowNull: true, + comment: '店铺名称', + }, + seller_nick: { + type: STRING(200), + allowNull: true, + comment: '卖家名称', + }, + buyer_nick: { + type: STRING(200), + allowNull: true, + comment: '买家名称', + }, + total_amount: { + type: DECIMAL(18, 2), + allowNull: true, + comment: '订单总金额', + }, + item_amount: { + type: DECIMAL(18, 2), + allowNull: true, + comment: '商品总金额', + }, + discount_amount: { + type: DECIMAL(18, 2), + allowNull: true, + comment: '订单折扣金额', + }, + freight: { + type: DECIMAL(18, 2), + allowNull: true, + comment: '快递费用', + }, + ar_amount: { + type: DECIMAL(18, 2), + allowNull: true, + comment: '应收金额', + }, + got_amount: { + type: DECIMAL(18, 2), + allowNull: true, + comment: '已收金额', + }, + service_fee: { + type: DECIMAL(18, 2), + allowNull: true, + comment: 'COD服务费', + }, + logistics_code: { + type: STRING(50), + allowNull: true, + comment: '物流公司编码', + }, + logistics_name: { + type: STRING(200), + allowNull: true, + comment: '物流公司名称', + }, + express_code: { + type: STRING(50), + allowNull: true, + comment: '面单号前置', + }, + logistics_area_code: { + type: STRING(50), + allowNull: true, + comment: '快递区域编码, 大头笔信息', + }, + delivery_type: { + type: STRING(255), + allowNull: true, + comment: '发货服务类型', + }, + is_urgency: { + type: ENUM(...StatusEnum.URGENCY), + allowNull: true, + defaultValue: 'N', + comment: '是否紧急', + }, + invoice_flag: { + type: ENUM(...StatusEnum.INVOICE), + allowNull: true, + defaultValue: 'N', + comment: '是否需要发票', + }, + status: { + type: ENUM(...StatusEnum.STATUS), + allowNull: true, + defaultValue: 'created', + comment: '订单状态', + }, + name: { + type: TEXT, + allowNull: true, + comment: '收件人姓名', + }, + zip_code: { + type: STRING(50), + allowNull: true, + comment: '收件人邮编', + }, + tel: { + type: TEXT, + allowNull: true, + comment: '收件人电话', + }, + mobile: { + type: TEXT, + allowNull: true, + comment: '收件人移动电话', + }, + email: { + type: TEXT, + allowNull: true, + comment: '收件人邮箱', + }, + country_code: { + type: STRING(255), + allowNull: true, + comment: '国家编码', + }, + province: { + type: STRING(255), + allowNull: true, + comment: '省份', + }, + city: { + type: STRING(255), + allowNull: true, + comment: '城市', + }, + area: { + type: STRING(255), + allowNull: true, + comment: '区', + }, + town: { + type: STRING(255), + allowNull: true, + comment: '镇', + }, + detail_address: { + type: STRING(255), + allowNull: true, + comment: '详细地址', + }, + id_type: { + type: STRING(255), + allowNull: true, + comment: '证件类型', + }, + id_number: { + type: INTEGER(11), + allowNull: true, + comment: '证件号码', + }, + oaid: { + type: TEXT, + allowNull: true, + comment: 'OAID', + }, + sync_status: { + type: ENUM(...StatusEnum.SYNC_STATUS), + allowNull: true, + defaultValue: 'padding', + comment: '同步状态', + }, + store_id: { + type: BIGINT(20).UNSIGNED, + allowNull: true, + comment: '货主ID', + }, + warehouse_id: { + type: BIGINT(20).UNSIGNED, + allowNull: true, + comment: '仓库ID', + }, + from_key: { + type: INTEGER(11), + allowNull: true, + comment: '来源键', + }, + items: { + type: TEXT, + allowNull: true, + comment: '商品JSON字符串', + }, + items_count: { + type: SMALLINT(5).UNSIGNED, + allowNull: false, + defaultValue: 0, + comment: '商品种类数', + }, + items_total: { + type: INTEGER(10).UNSIGNED, + allowNull: false, + defaultValue: 0, + comment: '商品总数', + }, + items_weight: { + type: DECIMAL(10, 2), + allowNull: false, + defaultValue: 0.00, + comment: '总重量(kg)', + }, + items_hash: { + type: CHAR(32), + allowNull: false, + defaultValue: '', + comment: 'MD5哈希值(32位)', + }, + items_crc: { + type: INTEGER(10).UNSIGNED, + allowNull: false, + defaultValue: 0, + comment: 'CRC32校验码', + }, + wave_id: { + type: BIGINT(20), + allowNull: false, + defaultValue: 0, + comment: '波次ID,0表示未分配', + }, + // 状态机字段 + post_status: { + type: ENUM(...StatusEnum.POST_STATUS), + allowNull: true, + defaultValue: 'none', + comment: '分配快递号状态机', + }, + storage_status: { + type: ENUM(...StatusEnum.STORAGE_STATUS), + allowNull: true, + defaultValue: 'none', + comment: '分配储位状态机', + }, + pick_status: { + type: ENUM(...StatusEnum.PICK_STATUS), + allowNull: true, + defaultValue: 'none', + comment: '拣货状态机', + }, + pack_status: { + type: ENUM(...StatusEnum.PACK_STATUS), + allowNull: true, + defaultValue: 'none', + comment: '打包状态机', + }, + inspection_status: { + type: ENUM(...StatusEnum.INSPECTION_STATUS), + allowNull: true, + defaultValue: 'none', + comment: '检验状态机', + }, + print_status: { + type: ENUM(...StatusEnum.PRINT_STATUS), + allowNull: true, + defaultValue: null, + comment: '打印状态机', + }, + claim_status: { + type: ENUM(...StatusEnum.CLAIM_STATUS), + allowNull: true, + defaultValue: 'none', + comment: '领取状态机', + }, + outbound_status: { + type: ENUM(...StatusEnum.OUTBOUND_STATUS), + allowNull: true, + defaultValue: 'none', + comment: '出库状态机', + }, + lock_status: { + type: ENUM(...StatusEnum.LOCK_STATUS), + allowNull: true, + defaultValue: null, + comment: '锁定状态机', + }, + intercept_status: { + type: ENUM(...StatusEnum.INTERCEPT_STATUS), + allowNull: true, + defaultValue: null, + comment: '拦截状态机', + }, + }; + + // 主表模型 + const OrderDelivery = model.define('order_delivery', baseModel, { + tableName: 'wms_order_delivery', + timestamps: false, + comment: '仓库发货单常用表', + indexes: [ + { + name: 'idx_current_store_id', + fields: [ 'store_id' ], + }, + { + name: 'idx_current_warehouse_id', + fields: [ 'warehouse_id' ], + }, + { + name: 'idx_current_delivery_code', + unique: true, + fields: [ 'delivery_order_code', 'store_id', 'warehouse_id' ], + }, + { + name: 'idx_items', + fields: [ 'items' ], + length: 50, + }, + { + name: 'idx_items_hash', + fields: [ 'items_hash' ], + }, + { + name: 'idx_hash_crc', + fields: [ 'items_hash', 'items_crc', 'warehouse_id' ], + }, + { + name: 'wave_id', + fields: [ 'status', 'wave_id' ], + }, + // 状态机索引 + { + name: 'idx_statuses_composite', + fields: [ + 'status', + 'post_status', + 'pick_status', + 'pack_status', + 'outbound_status', + ], + }, + ], + }); + + return OrderDelivery; +}; diff --git a/app/model/order_delivery_factory.js b/app/model/order_delivery_factory.js new file mode 100644 index 0000000..27a217d --- /dev/null +++ b/app/model/order_delivery_factory.js @@ -0,0 +1,420 @@ +// app/model/wms_order_delivery_factory.js +'use strict'; + +module.exports = app => { + const { Sequelize, model } = app; + + class OrderDeliveryFactory { + constructor() { + this.modelCache = new Map(); + this.app = app; + } + + /** + * 获取当前表模型 + * @param warehouseId + */ + async getCurrentModel(warehouseId) { + return await this.getOrCreateModel(warehouseId, 'current'); + } + + /** + * 获取历史表模型 + * @param warehouseId + */ + async getHistoryModel(warehouseId) { + return await this.getOrCreateModel(warehouseId, 'history'); + } + + /** + * 根据表名直接获取模型 + * @param tableName + */ + async getModelByTableName(tableName) { + const cacheKey = `table_${tableName}`; + + if (this.modelCache.has(cacheKey)) { + return this.modelCache.get(cacheKey); + } + + try { + const tableExists = await this.checkTableExists(tableName); + if (!tableExists) { + throw new Error(`表 ${tableName} 不存在`); + } + + const baseAttributes = this.app.model.OrderDelivery.rawAttributes; + const DynamicModel = this.app.model.define(tableName, baseAttributes, { + tableName, + timestamps: false, + comment: tableName.includes('_history') ? '仓库发货单历史表' : '仓库发货单常用表', + }); + + this.modelCache.set(cacheKey, DynamicModel); + return DynamicModel; + + } catch (error) { + this.app.logger.error(`获取模型失败 ${tableName}:`, error); + throw error; + } + } + + /** + * 获取或创建模型 + * @param warehouseId + * @param type + */ + async getOrCreateModel(warehouseId, type = 'current') { + const tableName = this.generateTableName(warehouseId, type); + const cacheKey = `${warehouseId}_${type}`; + + // 检查缓存 + if (this.modelCache.has(cacheKey)) { + return this.modelCache.get(cacheKey); + } + + try { + // 检查表是否存在,不存在则创建 + const tableExists = await this.checkTableExists(tableName); + if (!tableExists) { + await this.createPhysicalTable(warehouseId, type); + } + + // 创建模型实例 + const baseAttributes = this.app.model.OrderDelivery.rawAttributes; + const modelOptions = this.getModelOptions(tableName, warehouseId, type); + + const DynamicModel = this.app.model.define(tableName, baseAttributes, modelOptions); + + // 设置关联关系 + this.setupAssociations(DynamicModel, warehouseId, type); + + // 缓存模型 + this.modelCache.set(cacheKey, DynamicModel); + this.app.logger.info(`创建动态模型成功: ${tableName}`); + + return DynamicModel; + + } catch (error) { + this.app.logger.error(`创建动态模型失败 ${tableName}:`, error); + throw error; + } + } + + /** + * 获取模型配置选项 + * @param tableName + * @param warehouseId + * @param type + */ + getModelOptions(tableName, warehouseId, type) { + const options = { + tableName, + timestamps: false, + comment: type === 'history' + ? `仓库${warehouseId}发货单历史表` + : `仓库${warehouseId}发货单常用表`, + indexes: this.getIndexes(warehouseId, type), + }; + + // 历史表添加归档时间字段 + if (type === 'history') { + options.fields = Object.keys(this.app.model.OrderDelivery.rawAttributes); + options.fields.push('archive_time'); + } + + return options; + } + + /** + * 获取索引配置 + * @param warehouseId + * @param type + */ + getIndexes(warehouseId, type) { + const prefix = `${warehouseId}_${type}`; + + return [ + { + name: `idx_${prefix}_store_id`, + fields: [ 'store_id' ], + }, + { + name: `idx_${prefix}_warehouse_id`, + fields: [ 'warehouse_id' ], + }, + { + name: `idx_${prefix}_delivery_code`, + unique: true, + fields: [ 'delivery_order_code', 'store_id', 'warehouse_id' ], + }, + { + name: `idx_${prefix}_items`, + fields: [ 'items' ], + length: 50, + }, + { + name: `idx_${prefix}_items_hash`, + fields: [ 'items_hash' ], + }, + { + name: `idx_${prefix}_hash_crc`, + fields: [ 'items_hash', 'items_crc', 'warehouse_id' ], + }, + { + name: `idx_${prefix}_wave`, + fields: [ 'status', 'wave_id' ], + }, + { + name: `idx_${prefix}_statuses`, + fields: [ + 'status', + 'post_status', + 'pick_status', + 'pack_status', + 'outbound_status', + ], + }, + ]; + } + + /** + * 设置关联关系 + * @param DynamicModel + * @param warehouseId + * @param type + */ + async setupAssociations(DynamicModel, warehouseId, type) { + try { + // 如果存在商品模型工厂,建立关联 + if (this.app.model.OrderItemsFactory) { + const ItemsModel = await this.app.model.OrderItemsFactory.getOrCreateModel(warehouseId, type); + + // 发货单 -> 商品 (1:N) + DynamicModel.hasMany(ItemsModel, { + foreignKey: 'order_id', + sourceKey: 'id', + as: 'orderItems', + constraints: false, + }); + + // 商品 -> 发货单 (N:1) + ItemsModel.belongsTo(DynamicModel, { + foreignKey: 'order_id', + targetKey: 'id', + as: 'delivery', + constraints: false, + }); + } + + // 关联店铺表 + if (this.app.model.Store) { + DynamicModel.belongsTo(this.app.model.Store, { + foreignKey: 'store_id', + targetKey: 'id', + as: 'store', + constraints: false, + }); + + DynamicModel.belongsTo(this.app.model.Store, { + foreignKey: 'warehouse_id', + targetKey: 'id', + as: 'warehouse', + constraints: false, + }); + } + + } catch (error) { + this.app.logger.warn('设置关联关系失败:', error.message); + } + } + + /** + * 检查表是否存在 + * @param tableName + */ + async checkTableExists(tableName) { + const sequelize = this.app.model; + const queryInterface = sequelize.getQueryInterface(); + + try { + const tables = await queryInterface.showAllTables(); + return tables.includes(tableName); + } catch (error) { + // 备用方案:使用原始查询 + const checkSQL = ` + SELECT TABLE_NAME + FROM INFORMATION_SCHEMA.TABLES + WHERE TABLE_SCHEMA = DATABASE() + AND TABLE_NAME = ? + `; + + const [ results ] = await sequelize.query(checkSQL, { + replacements: [ tableName ], + }); + return results.length > 0; + } + } + + /** + * 创建物理表 + * @param warehouseId + * @param type + */ + async createPhysicalTable(warehouseId, type = 'current') { + const tableName = this.generateTableName(warehouseId, type); + const tableComment = type === 'history' + ? `仓库${warehouseId}发货单历史表` + : `仓库${warehouseId}发货单常用表`; + + // 添加历史表特有的字段 + const historyFields = type === 'history' ? + ',\n`archive_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT \'归档时间\'' : ''; + + // 状态机枚举值 + const statusEnums = this.getStatusEnumValues(); + + const createTableSQL = ` + CREATE TABLE \`${tableName}\` ( + \`id\` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, + \`delivery_order_code\` varchar(50) DEFAULT NULL COMMENT '发货单号', + \`pre_delivery_order_code\` varchar(50) DEFAULT NULL COMMENT '预发货单号', + \`pre_delivery_order_id\` varchar(50) DEFAULT NULL COMMENT '预发货单ID', + \`order_type\` varchar(50) DEFAULT NULL COMMENT '订单类型', + \`warehouse_code\` varchar(50) DEFAULT NULL COMMENT '仓库编码', + \`order_flag\` varchar(200) DEFAULT NULL COMMENT '订单标记', + \`source_platform_code\` varchar(50) DEFAULT NULL COMMENT '来源平台编码', + \`source_platform_name\` varchar(200) DEFAULT NULL COMMENT '来源平台名称', + \`create_at\` datetime DEFAULT NULL COMMENT '创建时间', + \`delete_at\` datetime DEFAULT NULL COMMENT '删除时间', + \`updated_at\` datetime DEFAULT NULL COMMENT '更新时间', + \`place_order_time\` datetime DEFAULT NULL COMMENT '店铺创建订单时间', + \`pay_time\` datetime DEFAULT NULL COMMENT '支付时间', + \`pay_no\` varchar(50) DEFAULT NULL COMMENT '支付单号', + \`service_code\` varchar(50) DEFAULT NULL COMMENT '集包服务编码', + \`operator_name\` varchar(50) DEFAULT NULL COMMENT 'ERP审核人', + \`operate_time\` datetime DEFAULT NULL COMMENT 'ERP审核时间', + \`shop_nick\` varchar(200) DEFAULT NULL COMMENT '店铺名称', + \`seller_nick\` varchar(200) DEFAULT NULL COMMENT '卖家名称', + \`buyer_nick\` varchar(200) DEFAULT NULL COMMENT '买家名称', + \`total_amount\` decimal(18,2) DEFAULT NULL COMMENT '订单总金额', + \`item_amount\` decimal(18,2) DEFAULT NULL COMMENT '商品总金额', + \`discount_amount\` decimal(18,2) DEFAULT NULL COMMENT '订单折扣金额', + \`freight\` decimal(18,2) DEFAULT NULL COMMENT '快递费用', + \`ar_amount\` decimal(18,2) DEFAULT NULL COMMENT '应收金额', + \`got_amount\` decimal(18,2) DEFAULT NULL COMMENT '已收金额', + \`service_fee\` decimal(18,2) DEFAULT NULL COMMENT 'COD服务费', + \`logistics_code\` varchar(50) DEFAULT NULL COMMENT '物流公司编码', + \`logistics_name\` varchar(200) DEFAULT NULL COMMENT '物流公司名称', + \`express_code\` varchar(50) DEFAULT NULL COMMENT '面单号前置', + \`logistics_area_code\` varchar(50) DEFAULT NULL COMMENT '快递区域编码, 大头笔信息', + \`delivery_type\` varchar(255) DEFAULT NULL COMMENT '发货服务类型', + \`is_urgency\` enum('Y','N') DEFAULT 'N' COMMENT '是否紧急', + \`invoice_flag\` enum('Y','N') DEFAULT 'N' COMMENT '是否需要发票', + \`status\` enum('pedding','created','cancel','error') DEFAULT 'created' COMMENT '状态', + \`name\` text COMMENT '收件人姓名', + \`zip_code\` varchar(50) DEFAULT NULL COMMENT '收件人邮编', + \`tel\` text COMMENT '收件人电话', + \`mobile\` text COMMENT '收件人移动电话', + \`email\` text COMMENT '收件人邮箱', + \`country_code\` varchar(255) DEFAULT NULL COMMENT '国家编码', + \`province\` varchar(255) DEFAULT NULL COMMENT '省份', + \`city\` varchar(255) DEFAULT NULL COMMENT '城市', + \`area\` varchar(255) DEFAULT NULL COMMENT '区', + \`town\` varchar(255) DEFAULT NULL COMMENT '镇', + \`detail_address\` varchar(255) DEFAULT NULL COMMENT '详细地址', + \`id_type\` varchar(255) DEFAULT NULL COMMENT '证件类型', + \`id_number\` int(11) DEFAULT NULL COMMENT '证件号码', + \`oaid\` text COMMENT 'OAID', + \`sync_status\` enum('padding','fin','error') DEFAULT 'padding' COMMENT '同步状态', + \`store_id\` bigint(20) UNSIGNED DEFAULT NULL COMMENT '货主id', + \`warehouse_id\` bigint(20) UNSIGNED DEFAULT NULL COMMENT '仓库id', + \`from_key\` int(11) DEFAULT NULL COMMENT '来源键', + \`items\` text COMMENT '商品结构字符串', + \`items_count\` smallint(5) UNSIGNED NOT NULL DEFAULT '0' COMMENT '商品种类数', + \`items_total\` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '商品总数', + \`items_weight\` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '总重量', + \`items_hash\` char(32) NOT NULL DEFAULT '' COMMENT '哈希值', + \`items_crc\` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '校验码', + \`wave_id\` bigint(20) NOT NULL DEFAULT '0' COMMENT '波次ID,0表示未分配', + \`post_status\` enum('padding','fin','timeout','error','none') DEFAULT 'none' COMMENT '分配快递号状态机', + \`storage_status\` enum('padding','fin','error','none') DEFAULT 'none' COMMENT '分配储位状态机', + \`pick_status\` enum('padding','fin','error','none') DEFAULT 'none' COMMENT '拣货状态机', + \`pack_status\` enum('none','padding','fin','error') DEFAULT 'none' COMMENT '打包状态机', + \`inspection_status\` enum('none','padding','running','fin','error') DEFAULT 'none' COMMENT '检验状态机', + \`print_status\` enum('none','padding','fin','error') DEFAULT NULL COMMENT '打印状态机', + \`claim_status\` enum('none','padding','fin','error') DEFAULT 'none' COMMENT '领取状态机', + \`outbound_status\` enum('none','padding','fin','error') DEFAULT 'none' COMMENT '出库状态机', + \`lock_status\` enum('none','warehouse','store') DEFAULT NULL COMMENT '锁定状态机', + \`intercept_status\` enum('none','requesting','requested','intercepting','intercepted_in_transit','intercepted_at_warehouse','returning','returned','delivered_by_mistake','timeout','cancelled','failed','exception') DEFAULT NULL COMMENT '拦截状态机' + ${historyFields}, + PRIMARY KEY (\`id\`), + UNIQUE KEY \`idx_${warehouseId}_${type}_delivery_code\` (\`delivery_order_code\`,\`store_id\`,\`warehouse_id\`), + KEY \`idx_${warehouseId}_${type}_store_id\` (\`store_id\`), + KEY \`idx_${warehouseId}_${type}_warehouse_id\` (\`warehouse_id\`), + KEY \`idx_${warehouseId}_${type}_items\` (\`items\`(50)), + KEY \`idx_${warehouseId}_${type}_items_hash\` (\`items_hash\`), + KEY \`idx_${warehouseId}_${type}_hash_crc\` (\`items_hash\`,\`items_crc\`,\`warehouse_id\`), + KEY \`idx_${warehouseId}_${type}_wave\` (\`status\`,\`wave_id\`), + KEY \`idx_${warehouseId}_${type}_statuses\` (\`status\`,\`post_status\`,\`pick_status\`,\`pack_status\`,\`outbound_status\`) + ${type === 'history' ? `,KEY \`idx_${warehouseId}_history_archive_time\` (\`archive_time\`)` : ''} + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='${tableComment}'; + `; + + await this.app.model.query(createTableSQL); + this.app.logger.info(`创建物理表成功: ${tableName}`); + } + + /** + * 获取状态枚举值 + */ + getStatusEnumValues() { + return { + status: [ 'created', 'cancel', 'error' ], + sync_status: [ 'padding', 'fin', 'error' ], + post_status: [ 'padding', 'fin', 'timeout', 'error', 'none' ], + storage_status: [ 'padding', 'fin', 'error', 'none' ], + pick_status: [ 'padding', 'fin', 'error', 'none' ], + pack_status: [ 'none', 'padding', 'fin', 'error' ], + inspection_status: [ 'none', 'padding', 'running', 'fin', 'error' ], + print_status: [ 'none', 'padding', 'fin', 'error' ], + claim_status: [ 'none', 'padding', 'fin', 'error' ], + outbound_status: [ 'none', 'padding', 'fin', 'error' ], + lock_status: [ 'none', 'warehouse', 'store' ], + intercept_status: [ + 'none', 'requesting', 'requested', 'intercepting', + 'intercepted_in_transit', 'intercepted_at_warehouse', + 'returning', 'returned', 'delivered_by_mistake', + 'timeout', 'cancelled', 'failed', 'exception', + ], + }; + } + + /** + * 生成表名 + * @param warehouseId + * @param type + */ + generateTableName(warehouseId, type) { + const suffix = type === 'history' ? '_history' : ''; + return `wms_order_delivery_${warehouseId}${suffix}`; + } + + /** + * 清理模型缓存 + */ + clearCache() { + this.modelCache.clear(); + this.app.logger.info('模型缓存已清理'); + } + + /** + * 获取所有缓存的模型 + */ + getCachedModels() { + return Array.from(this.modelCache.entries()); + } + } + + return new OrderDeliveryFactory(); +}; diff --git a/app/model/order_items.js b/app/model/order_items.js new file mode 100644 index 0000000..a1a971a --- /dev/null +++ b/app/model/order_items.js @@ -0,0 +1,145 @@ +// model/order_items.js +'use strict'; + +module.exports = app => { + const { Sequelize, model } = app; + const { STRING, BIGINT, DECIMAL, TEXT, INTEGER, JSON } = Sequelize; + + const OrderItems = model.define('wms_order_items', { + id: { + type: BIGINT(20).UNSIGNED, + primaryKey: true, + autoIncrement: true, + }, + order_id: { + type: BIGINT(20).UNSIGNED, + allowNull: true, + comment: '订单ID', + }, + actual_price: { + type: DECIMAL(18, 2), + allowNull: false, + defaultValue: 0.00, + comment: '实际价格', + }, + retail_price: { + type: DECIMAL(18, 2), + allowNull: true, + comment: '零售价格', + }, + ext_code: { + type: STRING(50), + allowNull: true, + comment: '外部编码', + }, + inventory_type: { + type: STRING(50), + allowNull: true, + comment: '库存类型', + }, + item_code: { + type: STRING(50), + allowNull: true, + comment: '商品编码', + }, + item_id: { + type: BIGINT(20), + allowNull: true, + comment: '商品ID', + }, + item_name: { + type: STRING(200), + allowNull: true, + comment: '商品名称', + }, + order_line_no: { + type: STRING(50), + allowNull: true, + comment: '订单行号', + }, + owner_code: { + type: STRING(50), + allowNull: true, + comment: '货主编码', + }, + plan_qty: { + type: INTEGER(11), + allowNull: true, + comment: '计划数量', + }, + source_order_code: { + type: STRING(50), + allowNull: true, + comment: '源订单编码', + }, + sub_source_order_code: { + type: STRING(50), + allowNull: true, + comment: '子源订单编码', + }, + extend_props: { + type: JSON, // 改为JSON类型,便于查询 + allowNull: true, + comment: '扩展属性(JSON格式)', + }, + stock_id: { + type: BIGINT(20), + allowNull: true, + comment: '库存ID', + }, + created_at: { + type: Sequelize.DATE, + allowNull: false, + defaultValue: Sequelize.NOW, + comment: '创建时间', + }, + updated_at: { + type: Sequelize.DATE, + allowNull: false, + defaultValue: Sequelize.NOW, + comment: '更新时间', + }, + }, { + tableName: 'wms_order_items', + timestamps: true, // 启用时间戳 + underscored: true, // 使用下划线命名 + paranoid: false, // 不启用软删除 + indexes: [ + { + name: 'idx_order_id', + fields: [ 'order_id' ], + }, + { + name: 'idx_item_id', + fields: [ 'item_id' ], + }, + { + name: 'idx_item_code', + fields: [ 'item_code' ], + }, + { + name: 'idx_source_order_code', + fields: [ 'source_order_code' ], + }, + { + name: 'idx_stock_id', + fields: [ 'stock_id' ], + }, + { + name: 'idx_owner_code', + fields: [ 'owner_code' ], + }, + { + name: 'idx_order_item', + fields: [ 'order_id', 'item_id' ], + }, + { + name: 'idx_created_at', + fields: [ 'created_at' ], + }, + ], + comment: '订单商品明细表', + }); + + return OrderItems; +}; diff --git a/app/model/order_items_factory.js b/app/model/order_items_factory.js new file mode 100644 index 0000000..61d41d4 --- /dev/null +++ b/app/model/order_items_factory.js @@ -0,0 +1,301 @@ +// order_items_factory.js +'use strict'; + +module.exports = app => { + const { Sequelize, model } = app; + + class OrderItemsFactory { + constructor() { + this.modelCache = new Map(); + this.app = app; + this.creatingTables = new Map(); // 防止并发创建表 + } + + /** + * 获取当前表模型 + * @param warehouseId + */ + async getCurrentModel(warehouseId) { + return await this.getOrCreateModel(warehouseId, 'current'); + } + + /** + * 获取历史表模型 + * @param warehouseId + */ + async getHistoryModel(warehouseId) { + return await this.getOrCreateModel(warehouseId, 'history'); + } + + /** + * 获取或创建模型 + * @param warehouseId + * @param type + */ + async getOrCreateModel(warehouseId, type = 'current') { + const cacheKey = `${warehouseId}_${type}`; + + // 检查缓存 + if (this.modelCache.has(cacheKey)) { + return this.modelCache.get(cacheKey); + } + + const tableName = this.generateTableName(warehouseId, type); + + try { + // 防止并发创建表 + if (this.creatingTables.has(cacheKey)) { + await this.creatingTables.get(cacheKey); + return this.modelCache.get(cacheKey); + } + + const createPromise = this.createModelWithRetry(warehouseId, type, tableName, cacheKey); + this.creatingTables.set(cacheKey, createPromise); + + const dynamicModel = await createPromise; + this.creatingTables.delete(cacheKey); + + return dynamicModel; + } catch (error) { + this.creatingTables.delete(cacheKey); + this.app.logger.error(`获取订单商品模型失败 ${tableName}:`, error); + throw error; + } + } + + /** + * 带重试的模型创建 + * @param warehouseId + * @param type + * @param tableName + * @param cacheKey + * @param retryCount + */ + async createModelWithRetry(warehouseId, type, tableName, cacheKey, retryCount = 3) { + for (let i = 0; i < retryCount; i++) { + try { + // 检查表是否存在 + const tableExists = await this.checkTableExists(tableName); + if (!tableExists) { + await this.createPhysicalTable(warehouseId, type); + } + + // 创建模型实例 + const mainModel = this.app.model.OrderItems; + const attributes = { ...mainModel.rawAttributes }; + + // 移除主键的autoIncrement属性,避免动态表冲突 + if (attributes.id) { + delete attributes.id.autoIncrement; + } + + const DynamicModel = this.app.model.define(tableName, attributes, { + tableName, + timestamps: true, + underscored: true, + paranoid: false, + indexes: this.generateIndexes(warehouseId), + comment: type === 'history' + ? `仓库${warehouseId}订单商品历史表` + : `仓库${warehouseId}订单商品常用表`, + }); + + // 复制关联关系 + this.copyAssociations(mainModel, DynamicModel); + + // 缓存模型 + this.modelCache.set(cacheKey, DynamicModel); + this.app.logger.info(`创建订单商品动态模型成功: ${tableName}`); + + return DynamicModel; + } catch (error) { + if (i === retryCount - 1) { + throw error; + } + this.app.logger.warn(`创建模型失败,第${i + 1}次重试:`, error.message); + await this.sleep(500); // 等待500ms后重试 + } + } + } + + /** + * 复制关联关系 + * @param sourceModel + * @param targetModel + */ + copyAssociations(sourceModel, targetModel) { + if (sourceModel.associations) { + Object.keys(sourceModel.associations).forEach(key => { + const association = sourceModel.associations[key]; + const options = { ...association.options }; + + // 避免动态表的外键约束问题 + options.constraints = false; + + if (association.associationType === 'BelongsTo') { + targetModel.belongsTo( + association.target, + { + ...options, + foreignKey: association.foreignKey, + as: association.as, + } + ); + } + }); + } + } + + /** + * 生成索引配置 + * @param warehouseId + */ + generateIndexes(warehouseId) { + return [ + { + name: `idx_${warehouseId}_order_id`, + fields: [ 'order_id' ], + }, + { + name: `idx_${warehouseId}_item_id`, + fields: [ 'item_id' ], + }, + { + name: `idx_${warehouseId}_item_code`, + fields: [ 'item_code' ], + }, + { + name: `idx_${warehouseId}_source_order_code`, + fields: [ 'source_order_code' ], + }, + { + name: `idx_${warehouseId}_stock_id`, + fields: [ 'stock_id' ], + }, + { + name: `idx_${warehouseId}_owner_code`, + fields: [ 'owner_code' ], + }, + { + name: `idx_${warehouseId}_order_item`, + fields: [ 'order_id', 'item_id' ], + }, + { + name: `idx_${warehouseId}_created_at`, + fields: [ 'created_at' ], + }, + ]; + } + + /** + * 检查表是否存在 + * @param tableName + */ + async checkTableExists(tableName) { + try { + const [ results ] = await this.app.model.query( + `SELECT 1 FROM information_schema.tables + WHERE table_schema = DATABASE() + AND table_name = :tableName`, + { + replacements: { tableName }, + type: Sequelize.QueryTypes.SELECT, + } + ); + return !!results; + } catch (error) { + this.app.logger.error('检查表是否存在失败:', error); + return false; + } + } + + /** + * 创建物理表 + * @param warehouseId + * @param type + */ + async createPhysicalTable(warehouseId, type = 'current') { + const tableName = this.generateTableName(warehouseId, type); + const tableComment = type === 'history' + ? `仓库${warehouseId}订单商品历史表` + : `仓库${warehouseId}订单商品常用表`; + + // 历史表特有字段 + const historyFields = type === 'history' ? + ',`archive_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT \'归档时间\'' : ''; + + const createTableSQL = ` + CREATE TABLE IF NOT EXISTS \`${tableName}\` ( + \`id\` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + \`order_id\` bigint(20) unsigned DEFAULT NULL COMMENT '订单ID', + \`actual_price\` decimal(18,2) NOT NULL DEFAULT '0.00' COMMENT '实际价格', + \`retail_price\` decimal(18,2) DEFAULT NULL COMMENT '零售价格', + \`ext_code\` varchar(50) DEFAULT NULL COMMENT '外部编码', + \`inventory_type\` varchar(50) DEFAULT NULL COMMENT '库存类型', + \`item_code\` varchar(50) DEFAULT NULL COMMENT '商品编码', + \`item_id\` bigint(20) DEFAULT NULL COMMENT '商品ID', + \`item_name\` varchar(200) DEFAULT NULL COMMENT '商品名称', + \`order_line_no\` varchar(50) DEFAULT NULL COMMENT '订单行号', + \`owner_code\` varchar(50) DEFAULT NULL COMMENT '货主编码', + \`plan_qty\` int(11) DEFAULT NULL COMMENT '计划数量', + \`source_order_code\` varchar(50) DEFAULT NULL COMMENT '源订单编码', + \`sub_source_order_code\` varchar(50) DEFAULT NULL COMMENT '子源订单编码', + \`extend_props\` json DEFAULT NULL COMMENT '扩展属性(JSON格式)', + \`stock_id\` bigint(20) DEFAULT NULL COMMENT '库存ID', + \`created_at\` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + \`updated_at\` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间' + ${historyFields}, + PRIMARY KEY (\`id\`), + KEY \`idx_${warehouseId}_order_id\` (\`order_id\`), + KEY \`idx_${warehouseId}_item_id\` (\`item_id\`), + KEY \`idx_${warehouseId}_item_code\` (\`item_code\`), + KEY \`idx_${warehouseId}_source_order_code\` (\`source_order_code\`), + KEY \`idx_${warehouseId}_stock_id\` (\`stock_id\`), + KEY \`idx_${warehouseId}_owner_code\` (\`owner_code\`), + KEY \`idx_${warehouseId}_order_item\` (\`order_id\`, \`item_id\`), + KEY \`idx_${warehouseId}_created_at\` (\`created_at\`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='${tableComment}'; + `; + + await this.app.model.query(createTableSQL); + this.app.logger.info(`创建订单商品物理表成功: ${tableName}`); + } + + /** + * 生成表名 + * @param warehouseId + * @param type + */ + generateTableName(warehouseId, type) { + const suffix = type === 'history' ? '_history' : ''; + return `wms_order_items_${warehouseId}${suffix}`; + } + + /** + * 清除缓存 + * @param warehouseId + * @param type + */ + clearCache(warehouseId, type) { + const cacheKey = `${warehouseId}_${type}`; + this.modelCache.delete(cacheKey); + } + + /** + * 清除所有缓存 + */ + clearAllCache() { + this.modelCache.clear(); + } + + /** + * 休眠函数 + * @param ms + */ + sleep(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); + } + } + + return new OrderItemsFactory(); +}; diff --git a/app/model/permission.js b/app/model/permission.js new file mode 100644 index 0000000..ead44a8 --- /dev/null +++ b/app/model/permission.js @@ -0,0 +1,276 @@ +'use strict'; + +module.exports = app => { + const { INTEGER, STRING, DATE, TINYINT, ENUM } = app.Sequelize; + + const Permission = app.model.define('permission', { + id: { + type: INTEGER, + primaryKey: true, + autoIncrement: true, + allowNull: false, + comment: '权限ID', + }, + path: { + type: STRING(255), + allowNull: false, + validate: { + notEmpty: { + msg: '路由路径不能为空', + }, + }, + comment: '路由路径', + }, + component: { + type: STRING(255), + allowNull: true, + comment: '组件路径', + }, + name: { + type: STRING(100), + allowNull: true, + comment: '路由名称', + }, + redirect: { + type: STRING(255), + allowNull: true, + comment: '重定向路径', + }, + meta_title: { + type: STRING(100), + allowNull: true, + comment: '页面标题', + }, + meta_icon: { + type: STRING(50), + allowNull: true, + comment: '图标', + }, + hidden: { + type: TINYINT(1), + allowNull: false, + defaultValue: 0, + validate: { + isIn: { + args: [[ 0, 1 ]], + msg: '隐藏字段只能是0或1', + }, + }, + comment: '是否隐藏(0:显示,1:隐藏)', + }, + always_show: { + type: TINYINT(1), + allowNull: false, + defaultValue: 0, + validate: { + isIn: { + args: [[ 0, 1 ]], + msg: '始终显示字段只能是0或1', + }, + }, + comment: '是否始终显示', + }, + parent_id: { + type: INTEGER, + allowNull: false, + defaultValue: 0, + comment: '父级ID', + }, + sort: { + type: INTEGER, + allowNull: false, + defaultValue: 0, + comment: '排序', + }, + status: { + type: TINYINT(1), + allowNull: false, + defaultValue: 1, + validate: { + isIn: { + args: [[ 0, 1 ]], + msg: '状态只能是0或1', + }, + }, + comment: '状态(0:禁用,1:启用)', + }, + created_at: { + type: DATE, + allowNull: false, + comment: '创建时间', + }, + update_at: { + type: DATE, + allowNull: false, + comment: '更新时间', + }, + type: { + type: ENUM('web_pages', 'pda_pages', 'btns', 'api', 'miniprogram_pages', 'block'), + allowNull: false, + defaultValue: 'web_pages', + comment: '权限类型(web_pages:电脑端页面,pda_pages:PDA页面,btns:按钮权限,api:接口权限,miniprogram_pages:小程序页面,block:功能模块)', + }, + }, { + tableName: 'wms_permission', + freezeTableName: true, + underscored: true, + timestamps: true, + paranoid: false, // 明确禁用软删除 + createdAt: 'created_at', + updatedAt: 'update_at', + comment: '权限路由表', + indexes: [ + { + name: 'idx_parent_id', + fields: [ 'parent_id' ], + }, + { + name: 'idx_status', + fields: [ 'status' ], + }, + ], + }); + + // 关联关系 - 自关联,构建树形结构 + Permission.associate = function(models) { + const { Role, Permission, RolePermission } = app.model; + // 子权限 + Permission.hasMany(Permission, { + foreignKey: 'parent_id', + as: 'children', + scope: { + status: 1, + }, + }); + + // 父权限 + Permission.belongsTo(Permission, { + foreignKey: 'parent_id', + as: 'parent', + }); + + // 角色权限关联 + Permission.belongsToMany(Role, { + through: RolePermission, + foreignKey: 'permission_id', + otherKey: 'role_id', + as: 'roles', + }); + }; + + // 实例方法:获取类型对应的中文名称 + Permission.prototype.getTypeName = function() { + const typeMap = { + web_pages: '电脑端页面', + pda_pages: 'PDA页面', + btns: '按钮权限', + api: '接口权限', + miniprogram_pages: '小程序页面', + block: '功能模块', + }; + return typeMap[this.type] || this.type; + }; + + // 实例方法:检查是否启用 + Permission.prototype.isEnabled = function() { + return this.status === 1; + }; + + // 实例方法:检查是否隐藏 + Permission.prototype.isHidden = function() { + return this.hidden === 1; + }; + + // 类方法:根据类型获取权限列表 + Permission.findByType = async function(type, includeChildren = false) { + const where = { status: 1 }; + + if (type) { + where.type = type; + } + + const options = { + where, + order: [[ 'sort', 'ASC' ], [ 'id', 'ASC' ]], + }; + + if (includeChildren) { + options.include = [{ + model: this.associations.children.target, + as: 'children', + where: { status: 1 }, + required: false, + order: [[ 'sort', 'ASC' ], [ 'id', 'ASC' ]], + }]; + } + + return await this.findAll(options); + }; + + // 类方法:构建树形结构的权限列表 + Permission.getTreeByType = async function(type) { + const permissions = await this.findByType(type); + return this.buildPermissionTree(permissions); + }; + + // 静态方法:构建权限树 + Permission.buildPermissionTree = function(permissions) { + const permissionMap = new Map(); + const rootPermissions = []; + + // 创建映射 + permissions.forEach(permission => { + permissionMap.set(permission.id, { + id: permission.id, + path: permission.path, + component: permission.component, + name: permission.name, + redirect: permission.redirect, + meta: { + title: permission.meta_title, + icon: permission.meta_icon, + }, + hidden: permission.hidden === 1, + alwaysShow: permission.always_show === 1, + sort: permission.sort, + type: permission.type, + children: [], + }); + }); + + // 构建树形结构 + permissions.forEach(permission => { + const node = permissionMap.get(permission.id); + + if (permission.parent_id === 0) { + rootPermissions.push(node); + } else { + const parent = permissionMap.get(permission.parent_id); + if (parent) { + parent.children.push(node); + } + } + }); + + // 排序 + const sortTree = nodes => { + if (!nodes || nodes.length === 0) return; + + nodes.sort((a, b) => { + return a.sort - b.sort || a.id - b.id; + }); + + nodes.forEach(node => { + if (node.children && node.children.length > 0) { + sortTree(node.children); + } + }); + }; + + sortTree(rootPermissions); + + return rootPermissions; + }; + + return Permission; +}; diff --git a/app/model/platform.js b/app/model/platform.js new file mode 100644 index 0000000..4ca97b4 --- /dev/null +++ b/app/model/platform.js @@ -0,0 +1,35 @@ +'use strict'; + +module.exports = app => { + const { STRING } = app.Sequelize; + + const Platform = app.model.define('platform', { + code: { + type: STRING(50), + primaryKey: true, + allowNull: false, + comment: '平台代码', + }, + name: { + type: STRING(255), + allowNull: false, + comment: '平台名称', + }, + default_express_interface: { + type: STRING(50), + allowNull: false, + comment: '默认快递接口', + }, + }, { + tableName: 'wms_platform', + freezeTableName: true, + timestamps: false, + underscored: true, + comment: '平台表', + }); + + // 移除 associate 方法,稍后在单独的初始化文件中定义关联 + // 或者在控制器中动态定义关联 + + return Platform; +}; diff --git a/app/model/platform_setting.js b/app/model/platform_setting.js new file mode 100644 index 0000000..7ad3dc1 --- /dev/null +++ b/app/model/platform_setting.js @@ -0,0 +1,66 @@ +'use strict'; + +module.exports = app => { + const { STRING, BIGINT, INTEGER } = app.Sequelize; + + // 修改这里的变量名,与文件名一致 + const PlatformSetting = app.model.define('platform_setting', { + id: { + type: INTEGER(11), + primaryKey: true, + autoIncrement: true, + allowNull: false, + comment: '主键ID', + }, + platform_code: { + type: STRING(50), + allowNull: false, + comment: '平台代码', + }, + code: { + type: STRING(50), + allowNull: false, + comment: '设置代码', + }, + warehouse_id: { + type: BIGINT(20), + allowNull: false, + comment: '仓库ID', + }, + }, { + tableName: 'wms_platfrom_setting', + freezeTableName: true, + timestamps: false, + comment: '平台设置表', + indexes: [ + { + name: 'platform_code', + unique: true, + fields: [ 'platform_code', 'warehouse_id' ], + }, + { + name: 'warehouse_id', + fields: [ 'warehouse_id' ], + }, + ], + }); + // 定义关联关系 + PlatformSetting.associate = function() { + const { Store, Platform } = app.model; + + // 关联仓库 + PlatformSetting.belongsTo(Platform, { + foreignKey: 'platform_code', + targetKey: 'code', + as: 'platform', + }); + // 关联仓库 + PlatformSetting.belongsTo(Store, { + foreignKey: 'warehouse_id', + targetKey: 'id', + as: 'warehouse', + }); + }; + // 返回正确的变量名 + return PlatformSetting; +}; diff --git a/app/model/print_computer.js b/app/model/print_computer.js new file mode 100644 index 0000000..c7a1e5f --- /dev/null +++ b/app/model/print_computer.js @@ -0,0 +1,39 @@ +'use strict'; + +module.exports = app => { + const { INTEGER, BIGINT, STRING } = app.Sequelize; + + const PrintComputer = app.model.define('print_computer', { + id: { + type: INTEGER, + primaryKey: true, + autoIncrement: true, + allowNull: false, + comment: '主键ID', + }, + warehouse_id: { + type: BIGINT.UNSIGNED, + allowNull: true, + comment: '仓库ID', + }, + name: { + type: STRING(255), + allowNull: true, + comment: '打印台名称', + }, + status: { + type: INTEGER(1), + allowNull: false, + defaultValue: 1, + comment: '状态,1-已激活,0-未激活', + }, + }, { + tableName: 'wms_print_computer', + freezeTableName: true, + underscored: false, + timestamps: false, + comment: '打印台电脑表', + }); + + return PrintComputer; +}; diff --git a/app/model/print_item.js b/app/model/print_item.js new file mode 100644 index 0000000..4f15350 --- /dev/null +++ b/app/model/print_item.js @@ -0,0 +1,273 @@ +// app/model/print_item.js +module.exports = app => { + const { STRING, INTEGER, BOOLEAN, TEXT, JSON, DATE } = app.Sequelize; + + const PrintItem = app.model.define('print_item', { + id: { + type: INTEGER, + primaryKey: true, + autoIncrement: true, + comment: '主键ID', + }, + business_type: { + type: STRING(50), + allowNull: false, + comment: '业务类型', + validate: { + notEmpty: true, + }, + }, + platform: { + type: STRING(30), + allowNull: false, + comment: '平台', + validate: { + notEmpty: true, + }, + }, + field_name: { + type: STRING(100), + allowNull: false, + comment: '字段名(显示名称)', + validate: { + notEmpty: true, + }, + }, + field_code: { + type: STRING(100), + allowNull: false, + comment: '字段代码(英文标识)', + validate: { + notEmpty: true, + is: /^[a-zA-Z_][a-zA-Z0-9_]*$/, // 验证字段代码格式 + }, + }, + field_type: { + type: STRING(30), + allowNull: false, + comment: '字段类型', + validate: { + isIn: [[ 'text', 'number', 'date', 'datetime', 'select', 'checkbox', 'textarea', 'image', 'barcode', 'qrcode' ]], + }, + }, + // 新增:是否渲染为表格 + is_table: { + type: BOOLEAN, + defaultValue: false, + comment: '是否渲染为表格:0-否,1-是', + field: 'is_table', + }, + // 新增:表格配置 + table_config: { + type: JSON, + comment: '表格配置', + }, + // 新增:分组字段 + group_field: { + type: STRING(100), + comment: '分组字段', + validate: { + is: /^[a-zA-Z_][a-zA-Z0-9_]*$/, + }, + }, + // 新增:分组标题(国际化key) + group_label: { + type: STRING(100), + comment: '分组标题', + }, + // 新增:分组排序 + group_sort: { + type: INTEGER, + defaultValue: 0, + comment: '分组排序', + }, + required: { + type: BOOLEAN, + defaultValue: false, + comment: '是否必填:0-否,1-是', + field: 'required', + }, + default_value: { + type: STRING(500), + comment: '默认值', + }, + sort_order: { + type: INTEGER, + defaultValue: 0, + comment: '排序序号', + }, + regex_pattern: { + type: STRING(200), + comment: '正则验证规则', + }, + max_length: { + type: INTEGER, + comment: '最大长度', + }, + min_length: { + type: INTEGER, + comment: '最小长度', + }, + options: { + type: JSON, + comment: '选项(用于下拉框等)', + }, + description: { + type: STRING(500), + comment: '字段描述', + }, + status: { + type: INTEGER, + defaultValue: 1, + comment: '状态:0-禁用,1-启用', + validate: { + isIn: [[ 0, 1 ]], + }, + }, + created_by: { + type: STRING(50), + comment: '创建人', + }, + updated_by: { + type: STRING(50), + comment: '更新人', + }, + created_at: { + type: DATE, + comment: '创建时间', + get() { + const rawValue = this.getDataValue('created_at'); + return rawValue ? rawValue : null; + }, + }, + updated_at: { + type: DATE, + comment: '更新时间', + get() { + const rawValue = this.getDataValue('updated_at'); + return rawValue ? rawValue : null; + }, + }, + }, { + tableName: 'wms_print_items', + timestamps: false, // 因为表里已经有 created_at 和 updated_at 字段,但我们手动管理 + createdAt: 'created_at', + updatedAt: 'updated_at', + paranoid: false, + deletedAt: false, + comment: '打印项配置表', + indexes: [ + { + unique: true, + fields: [ 'business_type', 'platform', 'field_code' ], + name: 'uk_business_platform_field', + }, + { + fields: [ 'business_type' ], + name: 'idx_business_type', + }, + { + fields: [ 'platform' ], + name: 'idx_platform', + }, + { + fields: [ 'status' ], + name: 'idx_status', + }, + ], + // 添加作用域 + scopes: { + // 表格字段 + tableFields: { + where: { + is_table: true, + }, + }, + // 分组字段 + groupFields: { + where: { + group_field: { + [app.Sequelize.Op.ne]: null, + }, + }, + }, + // 有效字段 + active: { + where: { + status: 1, + }, + }, + // 按业务类型 + byBusiness(businessType) { + return { + where: { + business_type: businessType, + }, + }; + }, + // 按平台 + byPlatform(platform) { + return { + where: { + platform, + }, + }; + }, + }, + }); + + // 实例方法:获取分组配置 + PrintItem.prototype.getGroupConfig = function() { + if (!this.group_field) return null; + return { + field: this.group_field, + label: this.group_label, + sort: this.group_sort, + }; + }; + + // 实例方法:获取表格配置 + PrintItem.prototype.getTableConfig = function() { + if (!this.is_table || !this.table_config) return null; + return this.table_config; + }; + + // 类方法:获取指定业务类型的分组字段 + PrintItem.getGroupFields = async function(businessType, platform) { + return await this.findAll({ + where: { + business_type: businessType, + platform: platform || 'default', + group_field: { + [app.Sequelize.Op.ne]: null, + }, + status: 1, + }, + order: [ + [ 'group_sort', 'ASC' ], + [ 'sort_order', 'ASC' ], + ], + }); + }; + + // 类方法:获取指定业务类型的表格配置 + PrintItem.getTableConfigs = async function(businessType, platform) { + return await this.findAll({ + where: { + business_type: businessType, + platform: platform || 'default', + is_table: true, + status: 1, + }, + order: [[ 'sort_order', 'ASC' ]], + }); + }; + + // 关联方法 + PrintItem.associate = function() { + // 如果需要关联其他表,在这里添加 + // 例如:PrintItem.belongsTo(app.model.OtherModel, { foreignKey: 'xxx' }); + }; + + return PrintItem; +}; diff --git a/app/model/print_record.js b/app/model/print_record.js new file mode 100644 index 0000000..3a33609 --- /dev/null +++ b/app/model/print_record.js @@ -0,0 +1,86 @@ +"use strict"; + +module.exports = app => { + const { BIGINT, STRING, JSON, ENUM, TEXT, DATE } = app.Sequelize; + const PrintRecord = app.model.define("PrintRecord", { + id: { + type: BIGINT.UNSIGNED, + autoIncrement: true, + primaryKey: true, + comment: "主键ID", + }, + warehouse_id: { + type: BIGINT.UNSIGNED, + allowNull: false, + comment: "仓库ID", + }, + computer_id: { + type: BIGINT.UNSIGNED, + allowNull: false, + comment: "电脑ID", + }, + printer: { + type: STRING(100), + allowNull: false, + comment: "打印机名称/标识", + }, + type: { + type: STRING(50), + allowNull: false, + comment: "打印类型", + }, + data: { + type: JSON, + allowNull: true, + comment: "打印数据(JSON格式)", + }, + status: { + type: ENUM("pending", "sent", "success", "failed"), + allowNull: false, + defaultValue: "pending", + comment: "打印状态:pending-待发送,sent-已发送,success-打印成功,failed-打印失败", + }, + error_message: { + type: TEXT, + allowNull: true, + comment: "错误信息", + }, + sent_time: { + type: DATE, + allowNull: true, + comment: "发送时间", + }, + print_time: { + type: DATE, + allowNull: true, + comment: "打印完成时间", + }, + created_at: { + type: DATE, + allowNull: false, + defaultValue: app.Sequelize.literal("CURRENT_TIMESTAMP"), + comment: "创建时间", + }, + updated_at: { + type: DATE, + allowNull: false, + defaultValue: app.Sequelize.literal("CURRENT_TIMESTAMP"), + comment: "更新时间", + }, + }, { + tableName: "wms_print_record", + freezeTableName: true, + underscored: false, + timestamps: false, + indexes: [ + { name: "idx_warehouse_id", fields: ["warehouse_id"] }, + { name: "idx_computer_id", fields: ["computer_id"] }, + { name: "idx_status", fields: ["status"] }, + { name: "idx_created_at", fields: ["created_at"] }, + { name: "idx_sent_time", fields: ["sent_time"] }, + ], + comment: "打印记录表", + }); + + return PrintRecord; +}; diff --git a/app/model/print_station_express.js b/app/model/print_station_express.js new file mode 100644 index 0000000..eb6457a --- /dev/null +++ b/app/model/print_station_express.js @@ -0,0 +1,86 @@ +"use strict"; + +module.exports = app => { + const { INTEGER, BIGINT, STRING, DATE, TINYINT } = app.Sequelize; + const PrintStationExpress = app.model.define('print_station_express', { + id: { + type: INTEGER.UNSIGNED, + autoIncrement: true, + primaryKey: true, + comment: '自增主键ID', + }, + print_station_id: { + type: STRING(32), + allowNull: false, + comment: '打印台ID,关联wms_print_stations表的print_station_id', + }, + express_id: { + type: STRING(32), + allowNull: false, + comment: '快递ID', + }, + express_name: { + type: STRING(50), + allowNull: false, + comment: '快递名称,冗余字段,便于查询', + }, + printer_name: { + type: STRING(100), + allowNull: false, + comment: '绑定的打印机名称', + }, + creator_id: { + type: BIGINT.UNSIGNED, + allowNull: false, + comment: '创建人工号ID', + }, + creator_name: { + type: STRING(50), + allowNull: false, + comment: '创建人名称', + }, + create_at: { + type: DATE, + allowNull: false, + comment: '创建时间', + }, + update_at: { + type: DATE, + allowNull: false, + comment: '更新时间', + }, + deleted: { + type: TINYINT, + allowNull: false, + defaultValue: 0, + comment: '软删除标记:0-未删除,1-已删除', + }, + }, { + tableName: 'wms_print_station_express', + freezeTableName: true, + underscored: false, + timestamps: false, + indexes: [ + { + unique: true, + name: 'uk_print_station_express', + fields: ['print_station_id', 'express_id', 'deleted'], + }, + { + name: 'idx_print_station_id', + fields: ['print_station_id'], + }, + { + name: 'idx_express_id', + fields: ['express_id'], + }, + { + name: 'idx_creator_id', + fields: ['creator_id'], + }, + ], + comment: '打印台快递-打印机绑定关系表', + }); + + return PrintStationExpress; +}; diff --git a/app/model/print_stations.js b/app/model/print_stations.js new file mode 100644 index 0000000..877d5ce --- /dev/null +++ b/app/model/print_stations.js @@ -0,0 +1,103 @@ +"use strict"; + +module.exports = app => { + const { INTEGER, BIGINT, STRING, DATE, TINYINT } = app.Sequelize; + const PrintStations = app.model.define('print_stations', { + id: { + type: INTEGER.UNSIGNED, + autoIncrement: true, + primaryKey: true, + comment: '自增主键ID', + }, + warehouse_id: { + type: BIGINT.UNSIGNED, + allowNull: false, + comment: '仓库ID', + }, + default_printer_name:{ + type: STRING(50), + allowNull: true, + comment: '默认打印机名称', + }, + name: { + type: STRING(100), + allowNull: false, + comment: '打印台名称', + }, + computer_id: { + type: INTEGER, + allowNull: false, + comment: '打印电脑ID', + }, + custom_barcode: { + type: STRING(100), + allowNull: true, + comment: '自定义编码', + }, + creator_id: { + type: BIGINT.UNSIGNED, + allowNull: false, + comment: '创建人工号ID', + }, + creator_name: { + type: STRING(50), + allowNull: false, + comment: '创建人名称', + }, + create_at: { + type: DATE, + allowNull: false, + comment: '创建时间', + }, + update_at: { + type: DATE, + allowNull: false, + comment: '更新时间', + }, + deleted: { + type: TINYINT, + allowNull: false, + defaultValue: 0, + comment: '软删除标记:0-未删除,1-已删除', + }, + }, { + tableName: 'wms_print_stations', + freezeTableName: true, + underscored: false, + timestamps: false, + indexes: [ + { + unique: true, + name: 'uk_print_station_id', + fields: ['print_station_id'], + }, + { + name: 'idx_warehouse_id', + fields: ['warehouse_id'], + }, + { + name: 'idx_computer_id', + fields: ['computer_id'], + }, + { + name: 'idx_name', + fields: ['name'], + }, + { + name: 'idx_custom_barcode', + fields: ['custom_barcode'], + }, + { + name: 'idx_creator_id', + fields: ['creator_id'], + }, + { + name: 'idx_create_at', + fields: ['create_at'], + }, + ], + comment: '打印台信息表', + }); + + return PrintStations; +}; diff --git a/app/model/print_template.js b/app/model/print_template.js new file mode 100644 index 0000000..fa08f22 --- /dev/null +++ b/app/model/print_template.js @@ -0,0 +1,90 @@ +// app/model/print_template.js +'use strict'; + +module.exports = app => { + const { BIGINT, STRING, INTEGER, BOOLEAN, JSON, DATE, DATEONLY } = app.Sequelize; + + const PrintTemplate = app.model.define('print_template', { + id: { + type: BIGINT(20), + primaryKey: true, + autoIncrement: true, + comment: '主键ID', + }, + template_name: { + type: STRING(100), + allowNull: false, + comment: '模板名称', + }, + platform: { + type: STRING(50), + allowNull: false, + comment: '所属平台(抖音、拼多多、快手等)', + }, + template_type: { + type: STRING(50), + allowNull: false, + comment: '模板类型:STANDARD-标准模板,CUSTOM-自定义模板', + }, + template_url: { + type: STRING(500), + allowNull: false, + comment: '模板URL地址', + }, + template_content: { + type: JSON, + comment: '模板内容(JSON格式)', + }, + page_width: { + type: INTEGER(11), + defaultValue: 76, + comment: '页面宽度(mm)', + }, + page_height: { + type: INTEGER(11), + defaultValue: 130, + comment: '页面高度(mm)', + }, + warehouse_id: { + type: BIGINT(20), + comment: '关联仓库ID', + }, + is_default: { + type: BOOLEAN, + defaultValue: false, + comment: '是否默认模板:0-否,1-是', + }, + status: { + type: STRING(20), + defaultValue: 'ACTIVE', + comment: '状态:ACTIVE-启用,DISABLED-禁用', + }, + create_at: { + type: DATE, + allowNull: false, + defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP'), + comment: '创建时间', + }, + update_at: { + type: DATE, + allowNull: false, + defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), + comment: '更新时间', + }, + business_type: { + type: STRING(10), + allowNull: false, + comment: '类型', + }, + delete_at: { + type: DATEONLY, + comment: '删除时间', + }, + }, { + timestamps: false, + tableName: 'wms_print_template', + comment: '打印模板配置表', + }); + + return PrintTemplate; +}; diff --git a/app/model/prohibited_type.js b/app/model/prohibited_type.js new file mode 100644 index 0000000..e5f5d32 --- /dev/null +++ b/app/model/prohibited_type.js @@ -0,0 +1,91 @@ +'use strict'; + +module.exports = app => { + const { STRING, INTEGER, BOOLEAN, DATE, BIGINT } = app.Sequelize; + + const ProhibitedType = app.model.define('prohibitedType', { + id: { + type: INTEGER.UNSIGNED, + primaryKey: true, + autoIncrement: true, + comment: '主键ID', + }, + type_name: { + type: STRING(100), + allowNull: false, + comment: '类型名称', + }, + warehouse_id: { + type: BIGINT.UNSIGNED, + allowNull: true, + comment: '仓库ID(关联wms_store.id,NULL表示系统预设)', + }, + is_system_preset: { + type: BOOLEAN, + allowNull: false, + defaultValue: false, + comment: '是否系统预设', + }, + sort_order: { + type: INTEGER, + defaultValue: 0, + comment: '排序', + }, + created_by: { + type: INTEGER.UNSIGNED, + comment: '创建人', + }, + updated_by: { + type: INTEGER.UNSIGNED, + comment: '更新人', + }, + created_at: { + type: DATE, + comment: '创建时间', + }, + updated_at: { + type: DATE, + comment: '更新时间', + }, + }, { + tableName: 'wms_prohibited_type', + underscored: true, + timestamps: true, + createdAt: 'created_at', + updatedAt: 'updated_at', + paranoid: false, + comment: '违禁品类型表', + indexes: [ + { + unique: true, + fields: [ 'type_name', 'warehouse_id' ], + name: 'uk_type_warehouse', + }, + { + fields: [ 'warehouse_id' ], + name: 'idx_warehouse_id', + }, + { + fields: [ 'is_system_preset' ], + name: 'idx_is_system', + }, + ], + }); + + // 定义关联关系 + ProhibitedType.associate = function() { + // 关联仓库表 + app.model.ProhibitedType.belongsTo(app.model.Store, { + foreignKey: 'warehouse_id', + targetKey: 'id', + as: 'warehouse', + }); + app.model.ProhibitedType.hasMany(app.model.StockWarehouse, { + foreignKey: 'prohibited_id', + targetKey: 'id', + as: 'stocks', + }); + }; + + return ProhibitedType; +}; diff --git a/app/model/qimen_app.js b/app/model/qimen_app.js new file mode 100644 index 0000000..70164fb --- /dev/null +++ b/app/model/qimen_app.js @@ -0,0 +1,70 @@ +'use strict'; + +module.exports = app => { + const { INTEGER, STRING, DATE } = app.Sequelize; + + const QimenApp = app.model.define('qimen_app', { + id: { + type: INTEGER(11), + primaryKey: true, + autoIncrement: true, + allowNull: false, + comment: '应用ID', + }, + name: { + type: STRING(100), + allowNull: true, + validate: { + len: [ 0, 100 ], + }, + comment: '应用名称', + }, + app_key: { + type: STRING(50), + allowNull: true, + unique: 'uk_app_key', + validate: { + len: [ 0, 50 ], + }, + comment: '应用密钥', + }, + created_at: { + type: DATE, + allowNull: false, + comment: '创建时间', + }, + updated_at: { + type: DATE, + allowNull: false, + comment: '更新时间', + }, + }, { + tableName: 'wms_qimen_apps', + freezeTableName: true, + underscored: true, + timestamps: true, + createdAt: 'created_at', + updatedAt: 'updated_at', + comment: '奇门应用配置表', + indexes: [ + { + name: 'uk_app_key', + unique: true, + fields: [ 'app_key' ], + }, + { + name: 'idx_name', + fields: [ 'name' ], + }, + ], + }); + + // 定义实例方法 + QimenApp.prototype.toJSON = function() { + const values = { ...this.get() }; + return values; + }; + + + return QimenApp; +}; diff --git a/app/model/qimen_log.js b/app/model/qimen_log.js new file mode 100644 index 0000000..7f9ed9e --- /dev/null +++ b/app/model/qimen_log.js @@ -0,0 +1,81 @@ +// app/model/qimen_log.js + +'use strict'; + +module.exports = app => { + const { STRING, INTEGER, BIGINT, TEXT, DATE, BOOLEAN } = app.Sequelize; + + const QimenLog = app.model.define('qimen_log', { + id: { + type: BIGINT(20).UNSIGNED, + primaryKey: true, + autoIncrement: true, + }, + from_key: { + type: INTEGER(10), + allowNull: true, + field: 'from_key', + }, + method: { + type: STRING(100), + allowNull: true, + }, + sign: { + type: STRING(100), + allowNull: true, + }, + costomer_id: { + type: STRING(50), + allowNull: true, + field: 'costomer_id', + }, + v: { + type: STRING(50), + allowNull: true, + }, + url: { + type: TEXT, + allowNull: true, + }, + created_at: { + type: DATE, + allowNull: true, + }, + body: { + type: TEXT('long'), + allowNull: true, + }, + result: { + type: TEXT('long'), + allowNull: true, + }, + use_time: { + type: INTEGER(12), + allowNull: true, + field: 'use_time', + }, + updated_at: { + type: DATE, + allowNull: true, + }, + deleted_at: { + type: DATE, + allowNull: true, + }, + to_key: { + type: INTEGER(10), + allowNull: true, + defaultValue: 23535631, + field: 'to_key', + }, + }, { + // 模型配置 + timestamps: false, // 禁用Sequelize的自动时间戳 + freezeTableName: true, // 强制表名等于模型名 + tableName: 'wms_qimen_log', // 数据库中的实际表名 + underscored: false, // 保持字段名原样(不转换为下划线格式) + paranoid: false, // 不使用软删除 + }); + + return QimenLog; +}; diff --git a/app/model/receiving.js b/app/model/receiving.js new file mode 100644 index 0000000..f659bf7 --- /dev/null +++ b/app/model/receiving.js @@ -0,0 +1,179 @@ +// app/model/receiving.js +module.exports = app => { + const { STRING, INTEGER, DATE, DECIMAL, TEXT, BOOLEAN, ENUM } = app.Sequelize; + + const Receiving = app.model.define('wms_receiving', { + id: { + type: INTEGER, + primaryKey: true, + autoIncrement: true, + comment: '收货单ID', + }, + receiving_number: { + type: STRING(50), + unique: true, + allowNull: false, + comment: '收货单号,如: RCV202312150001', + }, + creator_id: { + type: INTEGER, + allowNull: false, + comment: '创建人工号ID', + }, + creator_snapshot: { + type: TEXT, + allowNull: false, + comment: '创建人信息快照(JSON格式)', + }, + status: { + type: ENUM('receiving', 'completed', 'cancelled'), + defaultValue: 'receiving', + allowNull: false, + comment: '收货状态:receiving-收货中, completed-收货完成, cancelled-作废', + }, + detail_status: { + type: ENUM('all_matched', 'partial_matched', 'unmatched'), + defaultValue: 'unmatched', + allowNull: false, + comment: '明细匹配状态:all_matched-全部匹配, partial_matched-部分匹配, unmatched-未匹配', + }, + storage_status: { + type: ENUM('none', 'partial', 'all'), + defaultValue: 'none', + allowNull: false, + comment: '入库状态:none-未入库, partial-部分入库, all-全部入库', + }, + delivery_method: { + type: ENUM('truck', 'express', 'air_freight', 'sea_freight', 'other'), + allowNull: false, + comment: '来货方式:truck-货车, express-快递, air_freight-空运, sea_freight-海运, other-其他', + }, + license_plate: { + type: STRING(20), + comment: '车牌号(货车运输时需要)', + }, + tracking_number: { + type: STRING(100), + comment: '快递单号/物流单号', + }, + loading_method: { + type: ENUM('with_pallet', 'without_pallet'), + allowNull: false, + comment: '装卸方式:with_pallet-带托盘, without_pallet-不带托盘', + }, + video_device_id: { + type: STRING(50), + comment: '录像设备ID(可选)', + }, + total_items: { + type: INTEGER, + defaultValue: 0, + comment: '总商品种类数', + }, + total_quantity: { + type: INTEGER, + defaultValue: 0, + comment: '商品总数量', + }, + total_boxes: { + type: INTEGER, + defaultValue: 0, + comment: '总箱数', + }, + total_pallets: { + type: INTEGER, + defaultValue: 0, + comment: '总托盘数', + }, + warehouse_id: { + type: INTEGER, + allowNull: false, + comment: '收货仓库ID', + }, + remark: { + type: TEXT, + comment: '备注信息', + }, + store_name: { + type: STRING(50), + }, + store_id: { + type: INTEGER, + }, + receiving_start_time: { + type: DATE, + comment: '收货开始时间', + }, + receiving_end_time: { + type: DATE, + comment: '收货结束时间', + }, + is_deleted: { + type: BOOLEAN, + defaultValue: false, + comment: '是否删除', + }, + }, { + tableName: 'wms_receiving', + timestamps: true, + createdAt: 'created_at', + updatedAt: 'updated_at', + paranoid: false, + indexes: [ + { + unique: true, + fields: [ 'receiving_number' ], + }, + { + fields: [ 'creator_id' ], + }, + { + fields: [ 'status' ], + }, + { + fields: [ 'delivery_method' ], + }, + { + fields: [ 'warehouse_id' ], + }, + { + fields: [ 'created_at' ], + }, + ], + }); + + // 关联定义 + Receiving.associate = function() { + const { ReceivingDetail, Store, AccountStoreEmployee, Storage, StoreWarehouse } = app.model; + // 关联收货明细 + Receiving.hasMany(ReceivingDetail, { + foreignKey: 'receiving_id', + as: 'details', + }); + + // 关联仓库 + Receiving.belongsTo(Store, { + foreignKey: 'warehouse_id', + as: 'warehouse', + }); + + // 关联创建人(用户表) + Receiving.belongsTo(AccountStoreEmployee, { + foreignKey: 'creator_id', + as: 'creator', + }); + + // 关联入库记录 + Receiving.hasMany(Storage, { + foreignKey: 'receiving_id', + as: 'storage_records', + }); + Receiving.belongsTo(StoreWarehouse, { + foreignKey: 'store_id', // 当前表的外键字段 + targetKey: 'store_id', // 关联表的主键字段 + as: 'store', + }); + }; + + return Receiving; +}; diff --git a/app/model/receiving_detail.js b/app/model/receiving_detail.js new file mode 100644 index 0000000..d13d902 --- /dev/null +++ b/app/model/receiving_detail.js @@ -0,0 +1,173 @@ +// app/model/receiving_detail.js +module.exports = app => { + const { STRING, INTEGER, DATE, DECIMAL, TEXT, ENUM, BOOLEAN, BIGINT } = app.Sequelize; + + const ReceivingDetail = app.model.define('wms_receiving_detail', { + id: { + type: INTEGER, + primaryKey: true, + autoIncrement: true, + comment: '明细ID', + }, + receiving_id: { + type: INTEGER, + allowNull: false, + comment: '收货单ID', + }, + product_name: { + type: STRING(200), + allowNull: false, + comment: '商品名称', + }, + barcode: { + type: STRING(100), + comment: '商品条码', + }, + product_snapshot: { + type: TEXT, + comment: '商品信息快照(JSON格式)', + }, + system_product_id: { + type: INTEGER, + comment: '关联的系统商品ID(可以为空)', + }, + actual_quantity: { + type: INTEGER, + allowNull: false, + comment: '实际收货数量', + }, + box_quantity: { + type: INTEGER, + defaultValue: 0, + comment: '箱数', + }, + boxes_per_pallet: { + type: INTEGER, + defaultValue: 1, + comment: '每托盘箱数(箱规)', + }, + pallet_quantity: { + type: INTEGER, + defaultValue: 0, + comment: '托盘数', + }, + receiving_time: { + type: DATE, + comment: '收货时间(该商品的收货时间)', + }, + receiving_status: { + type: ENUM('pending', 'receiving', 'completed', 'cancelled'), + defaultValue: 'pending', + comment: '收货状态', + }, + storage_status: { + type: ENUM('none', 'partial', 'all'), + defaultValue: 'none', + comment: '入库状态:none-未入库, partial-部分入库, all-全部入库', + }, + stored_quantity: { + type: INTEGER, + defaultValue: 0, + comment: '已入库数量', + }, + batch_number: { + type: STRING(100), + comment: '批次号', + }, + production_date: { + type: DATE, + comment: '生产日期', + }, + expiry_date: { + type: DATE, + comment: '保质期/到期日期', + }, + remark: { + type: TEXT, + comment: '备注', + }, + space_id: { + type: BIGINT.UNSIGNED, + defaultValue: 1, + comment: '存放库位', + }, + creator_id: { + type: BIGINT.UNSIGNED, + allowNull: false, + }, + box_width: { + type: DECIMAL(10, 2), + }, + box_length: { + type: DECIMAL(10, 2), + }, + box_height: { + type: DECIMAL(10, 2), + }, + weight: { + type: INTEGER, + }, + }, { + tableName: 'wms_receiving_detail', + timestamps: true, + createdAt: 'created_at', + updatedAt: 'updated_at', + + paranoid: false, + indexes: [ + { + fields: [ 'receiving_id' ], + }, + { + fields: [ 'barcode' ], + }, + { + fields: [ 'system_product_id' ], + }, + { + fields: [ 'receiving_status' ], + }, + { + fields: [ 'storage_status' ], + }, + { + fields: [ 'matched_status' ], + }, + { + fields: [ 'batch_number' ], + }, + { + fields: [ 'receiving_id', 'barcode' ], // 添加这个复合索引 + }, + ], + }); + + ReceivingDetail.associate = function() { + const { Receiving, StockWarehouse, Storage, LocationSpace } = app.model; + // 关联主表 + ReceivingDetail.belongsTo(Receiving, { + foreignKey: 'receiving_id', + as: 'receiving', + }); + + // 关联系统商品 + ReceivingDetail.belongsTo(StockWarehouse, { + foreignKey: 'system_product_id', + as: 'system_product', + }); + + // 关联入库记录 + ReceivingDetail.hasMany(Storage, { + foreignKey: 'receiving_detail_id', + as: 'storage_details', + }); + + // 关联系统商品 + ReceivingDetail.belongsTo(LocationSpace, { + foreignKey: 'space_id', + as: 'receiving_space', + }); + }; + + return ReceivingDetail; +}; diff --git a/app/model/role.js b/app/model/role.js new file mode 100644 index 0000000..cb94c33 --- /dev/null +++ b/app/model/role.js @@ -0,0 +1,269 @@ +'use strict'; + +module.exports = app => { + const { BIGINT, STRING, DATE, TINYINT, TEXT } = app.Sequelize; + + const Role = app.model.define('role', { + id: { + type: BIGINT.UNSIGNED, + primaryKey: true, + autoIncrement: true, + allowNull: false, + comment: '角色ID', + }, + role_code: { + type: STRING(50), + allowNull: false, + unique: true, + validate: { + notEmpty: { + msg: '角色代码不能为空', + }, + len: { + args: [ 1, 50 ], + msg: '角色代码长度应在1-50个字符之间', + }, + is: { + args: /^[a-zA-Z0-9_]+$/, + msg: '角色代码只能包含字母、数字和下划线', + }, + }, + comment: '角色代码', + }, + role_name: { + type: STRING(100), + allowNull: false, + validate: { + notEmpty: { + msg: '角色名称不能为空', + }, + len: { + args: [ 1, 100 ], + msg: '角色名称长度应在1-100个字符之间', + }, + }, + comment: '角色名称', + }, + description: { + type: STRING(500), + allowNull: true, + comment: '角色描述', + }, + role_type: { + type: TINYINT(4), + allowNull: false, + defaultValue: 1, + validate: { + isIn: { + args: [[ 1, 2 ]], + msg: '角色类型只能是1或2', + }, + }, + comment: '角色类型:1-系统角色,2-自定义角色', + }, + scope: { + type: TINYINT(4), + allowNull: false, + defaultValue: 1, + validate: { + isIn: { + args: [[ 1, 2 ]], + msg: '作用范围只能是1或2', + }, + }, + comment: '作用范围:1-全局,2-指定仓库', + }, + is_system: { + type: TINYINT(4), + allowNull: false, + defaultValue: 0, + validate: { + isIn: { + args: [[ 0, 1 ]], + msg: '是否系统预设只能是0或1', + }, + }, + comment: '是否系统预设:0-否,1-是', + }, + status: { + type: TINYINT(4), + allowNull: false, + defaultValue: 1, + validate: { + isIn: { + args: [[ 0, 1 ]], + msg: '状态只能是0或1', + }, + }, + comment: '状态:0-禁用,1-启用', + }, + created_by: { + type: BIGINT.UNSIGNED, + allowNull: false, + comment: '创建人', + }, + created_at: { + type: DATE, + allowNull: false, + comment: '创建时间', + }, + updated_at: { + type: DATE, + allowNull: false, + comment: '更新时间', + }, + store_id: { + type: BIGINT.UNSIGNED, + allowNull: true, + comment: '所属仓库ID', + }, + }, { + tableName: 'wms_role', + freezeTableName: true, + underscored: true, + timestamps: true, + createdAt: 'created_at', + updatedAt: 'updated_at', + comment: '平台角色表', + indexes: [ + { + name: 'uk_role_code', + fields: [ 'role_code' ], + unique: true, + }, + { + name: 'idx_role_type', + fields: [ 'role_type' ], + }, + { + name: 'idx_scope', + fields: [ 'scope' ], + }, + { + name: 'idx_status', + fields: [ 'status' ], + }, + ], + }); + + // 关联关系 + Role.associate = function(models) { + const { Account, Store, Permission, AccountStoreRole, RolePermission, EmployeeRole } = app.model; + // 创建人 + Role.belongsTo(Account, { + foreignKey: 'created_by', + as: 'creator', + }); + + // 所属仓库 + Role.belongsTo(Store, { + foreignKey: 'store_id', + as: 'store', + }); + + // 权限关联 + Role.belongsToMany(Permission, { + through: RolePermission, + foreignKey: 'role_id', + otherKey: 'permission_id', + as: 'permissions', + }); + Role.hasMany(EmployeeRole, { + foreignKey: 'role_id', + sourceKey: 'id', + as: 'employeeRole', + }); + }; + + // 实例方法:检查角色是否启用 + Role.prototype.isEnabled = function() { + return this.status === 1; + }; + + // 实例方法:检查是否是系统预设角色 + Role.prototype.isSystemRole = function() { + return this.is_system === 1; + }; + + // 实例方法:获取角色类型名称 + Role.prototype.getRoleTypeName = function() { + return this.role_type === 1 ? '系统角色' : '自定义角色'; + }; + + // 实例方法:获取作用范围名称 + Role.prototype.getScopeName = function() { + return this.scope === 1 ? '全局' : '指定仓库'; + }; + + // 实例方法:为角色分配权限 + Role.prototype.assignPermissions = async function(permissionIds) { + const { ctx } = this; + + // 先清除现有权限 + await ctx.model.RolePermission.destroy({ + where: { role_id: this.id }, + }); + + // 批量添加新权限 + if (permissionIds && permissionIds.length > 0) { + const rolePermissions = permissionIds.map(permissionId => ({ + role_id: this.id, + permission_id: permissionId, + })); + + await ctx.model.RolePermission.bulkCreate(rolePermissions); + } + + return true; + }; + + // 实例方法:获取角色的所有权限(树形结构) + Role.prototype.getPermissionTree = async function(permissionType = null) { + const { ctx } = this; + + const rolePermissions = await ctx.model.RolePermission.findAll({ + where: { role_id: this.id }, + include: [{ + model: ctx.model.Permission, + as: 'permission', + where: { status: 1 }, + required: true, + }], + }); + + // 提取权限ID + const permissionIds = rolePermissions.map(rp => rp.permission.id); + + // 获取权限详情 + const where = { + id: permissionIds, + status: 1, + }; + + if (permissionType) { + where.type = permissionType; + } + + const permissions = await ctx.model.Permission.findAll({ + where, + order: [[ 'sort', 'ASC' ], [ 'id', 'ASC' ]], + }); + + // 构建树形结构 + return ctx.model.Permission.buildPermissionTree(permissions); + }; + + // 实例方法:获取角色的权限ID列表 + Role.prototype.getPermissionIds = async function() { + const { ctx } = this; + + const rolePermissions = await ctx.model.RolePermission.findAll({ + where: { role_id: this.id }, + attributes: [ 'permission_id' ], + }); + + return rolePermissions.map(rp => rp.permission_id); + }; + + return Role; +}; diff --git a/app/model/role_permission.js b/app/model/role_permission.js new file mode 100644 index 0000000..2b0a4bc --- /dev/null +++ b/app/model/role_permission.js @@ -0,0 +1,145 @@ +'use strict'; + +module.exports = app => { + const { BIGINT, DATE } = app.Sequelize; + + const RolePermission = app.model.define('role_permission', { + id: { + type: BIGINT.UNSIGNED, + primaryKey: true, + autoIncrement: true, + allowNull: false, + comment: '关联ID', + }, + role_id: { + type: BIGINT.UNSIGNED, + allowNull: false, + comment: '角色ID', + }, + permission_id: { + type: BIGINT.UNSIGNED, + allowNull: false, + comment: '权限ID', + }, + created_at: { + type: DATE, + allowNull: false, + comment: '创建时间', + }, + }, { + tableName: 'wms_role_permission', + freezeTableName: true, + underscored: true, + timestamps: true, + paranoid: false, // 明确禁用软删除 + createdAt: 'created_at', + updatedAt: false, + comment: '角色权限关联表', + indexes: [ + { + name: 'uk_role_permission', + fields: [ 'role_id', 'permission_id' ], + unique: true, + }, + { + name: 'idx_role_id', + fields: [ 'role_id' ], + }, + { + name: 'idx_permission_id', + fields: [ 'permission_id' ], + }, + ], + }); + + // 关联关系 + RolePermission.associate = function(models) { + const { Role, Permission } = app.model; + // 关联角色 + RolePermission.belongsTo(Role, { + foreignKey: 'role_id', + as: 'role', + }); + + // 关联权限 + RolePermission.belongsTo(Permission, { + foreignKey: 'permission_id', + as: 'permission', + }); + }; + + // 实例方法:检查关联是否有效 + RolePermission.prototype.isValid = function() { + // 这里可以添加更多的有效性检查 + return this.role_id && this.permission_id; + }; + + // 类方法:批量创建角色权限关联 + RolePermission.bulkAssign = async function(roleId, permissionIds) { + const { ctx } = this; + + if (!permissionIds || permissionIds.length === 0) { + return []; + } + + const rolePermissions = permissionIds.map(permissionId => ({ + role_id: roleId, + permission_id: permissionId, + })); + + try { + return await ctx.model.RolePermission.bulkCreate(rolePermissions, { + ignoreDuplicates: true, // 忽略重复项 + }); + } catch (error) { + // 处理批量创建中的错误 + console.error('批量创建角色权限关联失败:', error); + throw error; + } + }; + + // 类方法:删除角色的所有权限 + RolePermission.clearRolePermissions = async function(roleId) { + const { ctx } = this; + + return await ctx.model.RolePermission.destroy({ + where: { role_id: roleId }, + }); + }; + + // 类方法:获取角色的权限列表 + RolePermission.getRolePermissions = async function(roleId, includePermissionDetails = false) { + const { ctx } = this; + + const options = { + where: { role_id: roleId }, + }; + + if (includePermissionDetails) { + options.include = [{ + model: ctx.model.Permission, + as: 'permission', + where: { status: 1 }, + required: false, + }]; + } + + return await ctx.model.RolePermission.findAll(options); + }; + + // 类方法:检查角色是否拥有某个权限 + RolePermission.hasPermission = async function(roleId, permissionId) { + const { ctx } = this; + + const rolePermission = await ctx.model.RolePermission.findOne({ + where: { + role_id: roleId, + permission_id: permissionId, + }, + }); + + return !!rolePermission; + }; + + return RolePermission; +}; diff --git a/app/model/stock_barcode.js b/app/model/stock_barcode.js new file mode 100644 index 0000000..21e7b86 --- /dev/null +++ b/app/model/stock_barcode.js @@ -0,0 +1,86 @@ +'use strict'; + +module.exports = app => { + const { STRING, BIGINT, DATE, TEXT } = app.Sequelize; + + const StockBarcode = app.model.define('stock_barcodes', { + id: { + type: BIGINT(20), + primaryKey: true, + autoIncrement: true, + comment: '主键ID', + }, + stock_id: { + type: BIGINT(20), + allowNull: false, + comment: '主表ID', + references: { + model: 'wms_stock_warehouse', + key: 'id', + }, + onDelete: 'CASCADE', + onUpdate: 'NO ACTION', + }, + warehouse_id: { + type: BIGINT.UNSIGNED, + allowNull: false, + comment: '仓库id', + }, + barcode: { + type: STRING(100), + allowNull: false, + comment: '条码', + charset: 'utf8mb4', + collate: 'utf8mb4_unicode_ci', + }, + description: { + type: STRING(255), + allowNull: true, + comment: '条码描述', + charset: 'utf8mb4', + collate: 'utf8mb4_unicode_ci', + }, + create_time: { + type: DATE, + allowNull: true, + defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP'), + comment: '创建时间', + }, + }, { + tableName: 'wms_stock_barcodes', + timestamps: false, // 不使用Sequelize的自动时间戳 + charset: 'utf8mb4', + collate: 'utf8mb4_unicode_ci', + paranoid: false, + // 明确指定不使用 deletedAt 字段 + deletedAt: false, + comment: 'WMS商品条码表', + indexes: [ + { + name: 'idx_stock_id', + fields: [ 'stock_id' ], + }, + { + name: 'uk_barcode', + unique: true, + fields: [ 'barcode' ], + }, + ], + }); + + // 定义关联关系 + StockBarcode.associate = function() { + const { StockWarehouse } = app.model; + console.log('StockWarehouse', StockWarehouse, StockBarcode); + StockBarcode.belongsTo( + app.model.StockWarehouse, + { + foreignKey: 'stock_id', + targetKey: 'id', + as: 'stock', + } + ); + }; + + return StockBarcode; +}; diff --git a/app/model/stock_store.js b/app/model/stock_store.js new file mode 100644 index 0000000..9cbc91e --- /dev/null +++ b/app/model/stock_store.js @@ -0,0 +1,426 @@ +// app/model/stock_store.js +'use strict'; + +module.exports = app => { + const { BIGINT, STRING, DECIMAL, INTEGER, DATE, ENUM, CHAR } = app.Sequelize; + + const StockStore = app.model.define('stock_store', { + id: { + type: BIGINT(20), + primaryKey: true, + autoIncrement: true, + allowNull: false, + comment: '库存商品ID', + }, + warehouse_code: { + type: STRING(50), + allowNull: false, + validate: { + notEmpty: true, + len: [ 1, 50 ], + }, + comment: '仓库编码', + }, + owner_code: { + type: STRING(50), + allowNull: false, + validate: { + notEmpty: true, + len: [ 1, 50 ], + }, + comment: '货主编码', + }, + app_key: { + type: STRING(50), + allowNull: true, + validate: { + len: [ 0, 50 ], + }, + comment: '应用', + }, + is_area_sale: { + type: CHAR(1), + allowNull: false, + defaultValue: 'N', + validate: { + isIn: [[ 'Y', 'N' ]], + }, + comment: '是否区域销售', + }, + brand_name: { + type: STRING(100), + allowNull: true, + validate: { + len: [ 0, 50 ], + }, + }, + item_code: { + type: STRING(50), + allowNull: false, + validate: { + notEmpty: true, + len: [ 1, 50 ], + }, + comment: '商品编码', + }, + goods_code: { + type: STRING(50), + allowNull: true, + comment: '货物编码', + }, + item_name: { + type: STRING(255), + allowNull: false, + validate: { + notEmpty: true, + len: [ 1, 255 ], + }, + comment: '商品名称', + }, + sku_property: { + type: STRING(100), + allowNull: true, + validate: { + len: [ 0, 100 ], + }, + comment: 'SKU规格', + }, + stock_unit: { + type: STRING(20), + allowNull: true, + validate: { + len: [ 0, 20 ], + }, + comment: '库存单位', + }, + length: { + type: DECIMAL(10, 2), + allowNull: true, + defaultValue: 0.00, + validate: { + min: 0, + }, + comment: '长度', + }, + width: { + type: DECIMAL(10, 2), + allowNull: true, + defaultValue: 0.00, + validate: { + min: 0, + }, + comment: '宽度', + }, + height: { + type: DECIMAL(10, 2), + allowNull: true, + defaultValue: 0.00, + validate: { + min: 0, + }, + comment: '高度', + }, + volume: { + type: DECIMAL(10, 2), + allowNull: true, + defaultValue: 0.00, + validate: { + min: 0, + }, + comment: '体积', + }, + gross_weight: { + type: DECIMAL(10, 2), + allowNull: true, + defaultValue: 0.00, + validate: { + min: 0, + }, + comment: '毛重', + }, + net_weight: { + type: DECIMAL(10, 2), + allowNull: true, + defaultValue: 0.00, + validate: { + min: 0, + }, + comment: '净重', + }, + category_id: { + type: INTEGER(11), + allowNull: true, + comment: '分类ID', + }, + category_name: { + type: STRING(100), + allowNull: true, + validate: { + len: [ 0, 100 ], + }, + comment: '分类名称', + }, + item_type: { + type: STRING(10), + allowNull: false, + validate: { + notEmpty: true, + len: [ 1, 10 ], + }, + comment: '商品类型', + }, + tag_price: { + type: DECIMAL(10, 2), + allowNull: true, + defaultValue: 0.00, + validate: { + min: 0, + }, + comment: '标价', + }, + retail_price: { + type: DECIMAL(10, 2), + allowNull: true, + defaultValue: 0.00, + validate: { + min: 0, + }, + comment: '零售价', + }, + is_sn_mgmt: { + type: CHAR(1), + allowNull: false, + defaultValue: 'N', + validate: { + isIn: [[ 'Y', 'N' ]], + }, + comment: '是否序列号管理', + }, + is_shelf_life_mgmt: { + type: CHAR(1), + allowNull: false, + defaultValue: 'N', + validate: { + isIn: [[ 'Y', 'N' ]], + }, + comment: '是否保质期管理', + }, + is_batch_mgmt: { + type: CHAR(1), + allowNull: false, + defaultValue: 'N', + validate: { + isIn: [[ 'Y', 'N' ]], + }, + comment: '是否批次管理', + }, + create_time: { + type: DATE, + allowNull: false, + comment: '创建时间', + }, + update_time: { + type: DATE, + allowNull: false, + comment: '更新时间', + }, + is_valid: { + type: CHAR(1), + allowNull: false, + defaultValue: 'Y', + validate: { + isIn: [[ 'Y', 'N' ]], + }, + comment: '是否有效', + }, + barcode: { + type: STRING(255), + allowNull: true, + validate: { + len: [ 0, 255 ], + }, + comment: '条形码', + }, + stock_id: { + type: BIGINT(20), + allowNull: true, + comment: '库存ID', + }, + warehouse_id: { + type: BIGINT(20), + allowNull: false, + comment: '仓库ID', + references: { + model: 'store', + key: 'id', + }, + }, + store_id: { + type: BIGINT(20), + allowNull: false, + comment: '商家ID', + references: { + model: 'store', + key: 'id', + }, + }, + create_from: { + type: ENUM('qimen', 'api'), + allowNull: true, + comment: '创建来源', + }, + delete_at: { + type: DATE, + allowNull: true, + comment: '删除时间', + }, + }, { + tableName: 'wms_stock_store', + freezeTableName: true, + underscored: true, + timestamps: false, // 使用自定义时间字段 + comment: '库存商品信息表', + indexes: [ + { + name: 'uk_warehouse_owner_item', + unique: true, + fields: [ 'warehouse_code', 'owner_code', 'item_code', 'app_key', 'warehouse_id', 'store_id' ], + }, + { + name: 'idx_owner_code', + fields: [ 'owner_code' ], + }, + { + name: 'idx_goods_code', + fields: [ 'goods_code' ], + }, + { + name: 'idx_category_id', + fields: [ 'category_id' ], + }, + { + name: 'idx_create_time', + fields: [ 'create_time' ], + }, + { + name: 'idx_is_valid', + fields: [ 'is_valid' ], + }, + { + name: 'uk_item_code', + fields: [ 'item_code' ], + }, + { + name: 'idx_warehouse_id', + fields: [ 'warehouse_id' ], + }, + { + name: 'idx_store_id', + fields: [ 'store_id' ], + }, + { + name: 'idx_barcode', + fields: [ 'barcode' ], + }, + { + name: 'idx_warehouse_valid', + fields: [ 'warehouse_id', 'is_valid' ], + }, + { + name: 'idx_store_valid', + fields: [ 'store_id', 'is_valid' ], + }, + { + name: 'idx_item_valid', + fields: [ 'item_code', 'is_valid' ], + }, + ], + }); + + // 定义关联关系 + StockStore.associate = function() { + const { Store, StockWarehouse } = app.model; + + // 关联仓库 + StockStore.belongsTo(Store, { + foreignKey: 'warehouse_id', + targetKey: 'id', + as: 'warehouse', + }); + + // 关联商家 + StockStore.belongsTo(Store, { + foreignKey: 'store_id', + targetKey: 'id', + as: 'store', + }); + + StockStore.belongsTo(StockWarehouse, { + foreignKey: 'stock_id', // 当前表的外键字段 + targetKey: 'id', // 关联表的主键字段 + as: 'warehouse_stock', + }); + }; + + // 类方法 - 根据商品编码查找 + StockStore.findByItemCode = async function(itemCode, options = {}) { + const where = { item_code: itemCode, is_valid: 'Y' }; + + if (options.warehouse_id) { + where.warehouse_id = options.warehouse_id; + } + + if (options.store_id) { + where.store_id = options.store_id; + } + + return await this.findOne({ + where, + include: options.include || [], + }); + }; + + // 类方法 - 获取商家的商品列表 + StockStore.findByStore = async function(storeId, options = {}) { + const where = { store_id: storeId, is_valid: 'Y' }; + + if (options.warehouse_id) { + where.warehouse_id = options.warehouse_id; + } + + if (options.owner_code) { + where.owner_code = options.owner_code; + } + + return await this.findAll({ + where, + include: options.include || [], + order: options.order || [[ 'create_time', 'DESC' ]], + limit: options.limit, + offset: options.offset, + }); + }; + + // 实例方法 - 检查商品是否有效 + StockStore.prototype.isValid = function() { + return this.is_valid === 'Y' && !this.delete_at; + }; + + // 实例方法 - 软删除 + StockStore.prototype.softDelete = function() { + return this.update({ + is_valid: 'N', + delete_at: new Date(), + }); + }; + + // 实例方法 - 计算体积 + StockStore.prototype.calculateVolume = function() { + if (this.length && this.width && this.height) { + return (this.length * this.width * this.height).toFixed(2); + } + return this.volume; + }; + + return StockStore; +}; diff --git a/app/model/stock_unit.js b/app/model/stock_unit.js new file mode 100644 index 0000000..44b0d1c --- /dev/null +++ b/app/model/stock_unit.js @@ -0,0 +1,49 @@ +// app/model/stock_unit.js +'use strict'; + +module.exports = app => { + const { STRING, INTEGER, DATE } = app.Sequelize; + + const StockUnit = app.model.define('wms_stock_unit', { + id: { + type: INTEGER, + primaryKey: true, + autoIncrement: true, + comment: '主键ID', + }, + warehouse_id: { + type: INTEGER, + allowNull: true, + defaultValue: null, + comment: '仓库ID,NULL表示系统默认', + }, + name: { + type: STRING(50), + allowNull: false, + comment: '单位名称', + }, + created_at: { + type: DATE, + allowNull: false, + defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP'), + comment: '创建时间', + }, + }, { + tableName: 'wms_stock_unit', + timestamps: false, + comment: '库存单位表', + indexes: [ + { + name: 'idx_warehouse_id', + fields: [ 'warehouse_id' ], + }, + { + name: 'uk_name_warehouse', + unique: true, + fields: [ 'name', 'warehouse_id' ], + }, + ], + }); + + return StockUnit; +}; diff --git a/app/model/stock_warehouse.js b/app/model/stock_warehouse.js new file mode 100644 index 0000000..048b61f --- /dev/null +++ b/app/model/stock_warehouse.js @@ -0,0 +1,255 @@ +'use strict'; + +module.exports = app => { + const { STRING, BIGINT, DECIMAL, TEXT, DATE, CHAR, INTEGER, ENUM, TINYINT } = app.Sequelize; + + const StockWarehouse = app.model.define('stock_warehouse', { + id: { + type: BIGINT(20).UNSIGNED, + primaryKey: true, + autoIncrement: true, + comment: '主键ID', + }, + item_code: { + type: STRING(50), + allowNull: false, + comment: '商品编码', + }, + goods_code: { + type: STRING(50), + allowNull: true, + comment: '货物编码', + }, + store_id: { + type: BIGINT(20).UNSIGNED, + allowNull: false, + comment: '货主ID', + }, + item_name: { + type: STRING(255), + allowNull: false, + comment: '商品名称', + }, + sku_property: { + type: STRING(100), + comment: 'SKU规格', + }, + stock_unit: { + type: STRING(20), + allowNull: false, + comment: '库存单位', + }, + packing_requirements: { + type: TEXT, + comment: '打包要求', + }, + + brand_name: { + type: STRING(100), + allowNull: true, + validate: { + len: [ 0, 50 ], + }, + }, + length: { + type: DECIMAL(10, 2), + defaultValue: 0.00, + comment: '长度', + }, + width: { + type: DECIMAL(10, 2), + defaultValue: 0.00, + comment: '宽度', + }, + height: { + type: DECIMAL(10, 2), + defaultValue: 0.00, + comment: '高度', + }, + volume: { + type: INTEGER(11).UNSIGNED, + defaultValue: 0, + comment: '体积', + }, + gross_weight: { + type: DECIMAL(10, 2), + defaultValue: 0.00, + comment: '毛重', + }, + net_weight: { + type: DECIMAL(10, 2), + defaultValue: 0.00, + comment: '净重', + }, + item_type: { + type: STRING(10), + allowNull: false, + comment: '商品类型', + }, + tag_price: { + type: DECIMAL(10, 2), + defaultValue: 0.00, + comment: '标价', + }, + retail_price: { + type: DECIMAL(10, 2), + defaultValue: 0.00, + comment: '零售价', + }, + is_sn_mgmt: { + type: CHAR(1), + defaultValue: 'N', + comment: '是否序列号管理', + }, + is_shelf_life_mgmt: { + type: CHAR(1), + defaultValue: 'N', + comment: '是否保质期管理', + }, + is_batch_mgmt: { + type: CHAR(1), + defaultValue: 'N', + comment: '是否批次管理', + }, + create_at: { + type: DATE, + allowNull: false, + comment: '创建时间', + }, + level: { + type: ENUM('A', 'B', 'C'), + allowNull: true, + defaultValue: 'N', + comment: '是否需要发票', + }, + update_at: { + type: DATE, + defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP'), + comment: '更新时间', + }, + is_valid: { + type: CHAR(1), + defaultValue: 'Y', + comment: '是否有效', + }, + is_images: { + type: CHAR(1), + defaultValue: 'Y', + comment: '是否有照片', + }, + warehouse_id: { + type: BIGINT(20).UNSIGNED, + comment: '仓库ID', + }, + delete_at: { + type: DATE, + comment: '删除时间', + }, + quantity: { + type: INTEGER(11).UNSIGNED, + defaultValue: 0, + comment: '库存数量', + }, + locked_quantity: { + type: INTEGER(11).UNSIGNED, + defaultValue: 0, + comment: '锁定数量', + }, + prohibited_id: { + type: INTEGER.UNSIGNED, + comment: '违禁品类型id', + }, + enable_box_spec: { + type: TINYINT(1), + defaultValue: 0, + }, + quantity_per_box: { + type: INTEGER(11), + defaultValue: 0, + }, + box_gross_weight: { + type: INTEGER(11), + defaultValue: 0, + }, + box_net_weight: { + type: INTEGER(11), + defaultValue: 0, + }, + box_height: { + type: DECIMAL(10, 2), + defaultValue: 0.00, + }, + box_length: { + type: DECIMAL(10, 2), + defaultValue: 0.00, + }, + box_width: { + type: DECIMAL(10, 2), + defaultValue: 0.00, + }, + box_volume: { + type: INTEGER(11).UNSIGNED, + defaultValue: 0, + }, + deleted_at: { + type: DATE, + defaultValue: null, + }, + }, { + tableName: 'wms_stock_warehouse', + freezeTableName: true, + timestamps: false, + paranoid: true, + comment: '仓库商品库存主表', + indexes: [ + { + name: 'uk_item_code', + unique: true, + fields: [ 'item_code', 'warehouse_id', 'store_id', 'deleted_at' ], + }, + { + name: 'idx_create_time', + fields: [ 'create_at' ], + }, + { + name: 'idx_is_valid', + fields: [ 'is_valid' ], + }, + { + name: 'warehouse_id', + fields: [ 'warehouse_id' ], + }, + ], + }); + + StockWarehouse.associate = function(models) { + const { StoreWarehouse, StockBarcode, ProhibitedType, StockImage, StockStore, Storage } = app.model; + // 授权关系属于商家 - 修正:需要确认StoreWarehouse模型是否有store_id字段 + StockWarehouse.belongsTo(StoreWarehouse, { + foreignKey: 'store_id', // 当前表的外键字段 + targetKey: 'store_id', // 关联表的主键字段 + as: 'store_stock', + }); + StockWarehouse.hasMany(StockBarcode, { + foreignKey: 'stock_id', // StockBarcodes表中的外键字段 + as: 'barcodes', + }); + StockWarehouse.belongsTo(ProhibitedType, { + foreignKey: 'prohibited_id', // 当前表的外键字段 + targetKey: 'id', // 关联表的主键字段 + as: 'prohibited', + }); + StockWarehouse.hasMany(StockStore, { + foreignKey: 'stock_id', // 当前表的外键字段 + as: 'store_out_stock', + }); + + StockWarehouse.hasMany(Storage, { + foreignKey: 'stock_id', // 当前表的外键字段 + as: 'storage', + }); + + }; + + return StockWarehouse; +}; diff --git a/app/model/storage.js b/app/model/storage.js new file mode 100644 index 0000000..98bd61a --- /dev/null +++ b/app/model/storage.js @@ -0,0 +1,468 @@ +'use strict'; + +module.exports = app => { + const { STRING, INTEGER, BIGINT, ENUM, DATE, TINYINT } = app.Sequelize; + + const Storage = app.model.define('wms_storage', { + id: { + type: BIGINT(20).UNSIGNED, + primaryKey: true, + autoIncrement: true, + comment: '库存ID', + }, + warehouse_id: { + type: BIGINT(20).UNSIGNED, + allowNull: false, + comment: '仓库ID', + references: { + model: 'wms_store', + key: 'id', + }, + }, + store_id: { + type: BIGINT(20).UNSIGNED, + allowNull: false, + comment: '货主ID', + references: { + model: 'wms_store', + key: 'id', + }, + }, + space_id: { + type: BIGINT(20).UNSIGNED, + allowNull: false, + comment: '库位ID', + references: { + model: 'wms_location_space', + key: 'id', + }, + }, + stock_id: { + type: BIGINT(20), + allowNull: false, + comment: '商品SKU ID', + references: { + model: 'wms_stock_warehouse', + key: 'id', + }, + }, + batch_no: { + type: STRING(100), + allowNull: false, + comment: '批次号', + validate: { + notEmpty: true, + }, + }, + inventory_type: { + type: ENUM('ZP', 'CC', 'JS', 'XS', 'ZT', 'DJ', 'FP'), + allowNull: false, + defaultValue: 'ZP', + comment: '库存类型:ZP=正品, CC=残次, JS=机损, XS=箱损, ZT=在途库存, DJ=冻结, FP=废品', + }, + quantity: { + type: INTEGER(12), + allowNull: false, + defaultValue: 0, + comment: '库存数量', + }, + locked_quantity: { + type: INTEGER(12), + allowNull: false, + defaultValue: 0, + comment: '锁定数量', + }, + available_quantity: { + type: INTEGER(12), + allowNull: false, + defaultValue: 0, + comment: '可用数量', + }, + production_date: { + type: DATE, + allowNull: true, + comment: '生产日期', + }, + expiry_date: { + type: DATE, + allowNull: true, + comment: '过期日期', + }, + inbound_time: { + type: DATE, + allowNull: false, + comment: '入库时间', + }, + inbound_order_no: { + type: STRING(100), + allowNull: false, + comment: '入库单号', + validate: { + notEmpty: true, + }, + }, + supplier_id: { + type: BIGINT(20).UNSIGNED, + allowNull: true, + comment: '供应商ID', + }, + supplier_batch_no: { + type: STRING(100), + allowNull: true, + comment: '供应商批次号', + }, + is_enabled: { + type: TINYINT(1), + allowNull: false, + defaultValue: 1, + comment: '是否启用', + }, + created_at: { + type: DATE, + allowNull: true, + defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP'), + comment: '创建时间', + }, + updated_at: { + type: DATE, + allowNull: true, + defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), + comment: '更新时间', + }, + delete_at: { + type: DATE, + allowNull: true, + comment: '删除时间', + }, + }, { + tableName: 'wms_storage', + comment: '库存表', + timestamps: false, + indexes: [ + { + name: 'uk_location_sku_batch_type', + unique: true, + fields: [ 'space_id', 'stock_id', 'batch_no', 'inventory_type' ], + }, + { + name: 'idx_warehouse_location', + fields: [ 'warehouse_id', 'space_id' ], + }, + { + name: 'idx_sku_batch', + fields: [ 'stock_id', 'batch_no' ], + }, + { + name: 'idx_inventory_type', + fields: [ 'inventory_type' ], + }, + { + name: 'idx_expiry_date', + fields: [ 'expiry_date' ], + }, + { + name: 'idx_inbound_order', + fields: [ 'inbound_order_no' ], + }, + { + name: 'idx_store_id', + fields: [ 'store_id' ], + }, + { + name: 'idx_is_enabled', + fields: [ 'is_enabled' ], + }, + { + name: 'idx_delete_at', + fields: [ 'delete_at' ], + }, + { + name: 'idx_warehouse_stock', + fields: [ 'warehouse_id', 'stock_id' ], + }, + { + name: 'idx_available_quantity', + fields: [ 'available_quantity' ], + }, + ], + }); + + // 关联关系 + Storage.associate = function() { + const { Storage, Store, LocationSpace, StockWarehouse } = app.model; + + // 关联仓库 + Storage.belongsTo(Store, { + foreignKey: 'warehouse_id', + as: 'warehouse', + }); + + // 关联货主 + Storage.belongsTo(Store, { + foreignKey: 'store_id', + as: 'store', + }); + + // 关联库位 + Storage.belongsTo(LocationSpace, { + foreignKey: 'space_id', + as: 'space', + }); + + // 关联商品SKU + Storage.belongsTo(StockWarehouse, { + foreignKey: 'stock_id', + as: 'stock', + }); + + }; + + // 实例方法 + Storage.prototype.getAvailableQuantity = function() { + return this.quantity - this.locked_quantity; + }; + + Storage.prototype.isAvailable = function() { + return this.is_enabled === 1 && this.available_quantity > 0; + }; + + Storage.prototype.isLocked = function() { + return this.locked_quantity > 0; + }; + + Storage.prototype.canAllocate = function(quantity) { + return this.is_enabled === 1 && this.available_quantity >= quantity; + }; + + Storage.prototype.isNormalProduct = function() { + return this.inventory_type === 'ZP'; + }; + + Storage.prototype.isDefective = function() { + return this.inventory_type === 'CC'; + }; + + Storage.prototype.isExpired = function() { + if (!this.expiry_date) return false; + return new Date(this.expiry_date) < new Date(); + }; + + // 静态方法 + Storage.findByStockAndBatch = async function(app, stockId, batchNo, inventoryType = 'ZP') { + return await app.model.Storage.findOne({ + where: { + stock_id: stockId, + batch_no: batchNo, + inventory_type: inventoryType, + is_enabled: 1, + delete_at: null, + }, + include: [ + { + model: app.model.LocationSpace, + as: 'space', + attributes: [ 'space_code', 'custom_name' ], + }, + { + model: app.model.Store, + as: 'warehouse', + attributes: [ 'store_name' ], + }, + ], + }); + }; + + Storage.findBySpace = async function(app, spaceId) { + return await app.model.Storage.findAll({ + where: { + space_id: spaceId, + is_enabled: 1, + delete_at: null, + }, + include: [ + { + model: app.model.StockWarehouse, + as: 'stock', + attributes: [ 'product_code', 'product_name' ], + }, + ], + order: [[ 'inbound_time', 'ASC' ]], + }); + }; + + Storage.findAvailableByWarehouse = async function(app, warehouseId, stockId = null) { + const where = { + warehouse_id: warehouseId, + is_enabled: 1, + delete_at: null, + available_quantity: { [app.Sequelize.Op.gt]: 0 }, + }; + + if (stockId) { + where.stock_id = stockId; + } + + return await app.model.Storage.findAll({ + where, + include: [ + { + model: app.model.LocationSpace, + as: 'space', + attributes: [ 'space_code', 'custom_name' ], + }, + { + model: app.model.StockWarehouse, + as: 'stock', + attributes: [ 'product_code', 'product_name' ], + }, + ], + order: [ + [ 'expiry_date', 'ASC' ], + [ 'inbound_time', 'ASC' ], + ], + }); + }; + + Storage.findExpiringSoon = async function(app, days = 30) { + const expiryDate = new Date(); + expiryDate.setDate(expiryDate.getDate() + days); + + return await app.model.Storage.findAll({ + where: { + expiry_date: { + [app.Sequelize.Op.between]: [ new Date(), expiryDate ], + }, + is_enabled: 1, + delete_at: null, + quantity: { [app.Sequelize.Op.gt]: 0 }, + }, + include: [ + { + model: app.model.Store, + as: 'warehouse', + attributes: [ 'store_name' ], + }, + { + model: app.model.StockWarehouse, + as: 'stock', + attributes: [ 'product_code', 'product_name' ], + }, + ], + order: [[ 'expiry_date', 'ASC' ]], + }); + }; + + Storage.updateQuantity = async function(app, id, quantityChange, lockedChange = 0) { + const storage = await app.model.Storage.findByPk(id); + + if (!storage) { + throw new Error('库存记录不存在'); + } + + const newQuantity = storage.quantity + quantityChange; + const newLocked = storage.locked_quantity + lockedChange; + + if (newQuantity < 0) { + throw new Error('库存数量不能为负数'); + } + + if (newLocked < 0 || newLocked > newQuantity) { + throw new Error('锁定数量无效'); + } + + const updateData = { + quantity: newQuantity, + locked_quantity: newLocked, + available_quantity: newQuantity - newLocked, + updated_at: new Date(), + }; + + await storage.update(updateData); + return storage; + }; + + Storage.lockQuantity = async function(app, id, quantity) { + return await Storage.updateQuantity(app, id, 0, quantity); + }; + + Storage.unlockQuantity = async function(app, id, quantity) { + return await Storage.updateQuantity(app, id, 0, -quantity); + }; + + Storage.allocateQuantity = async function(app, id, quantity) { + const storage = await app.model.Storage.findByPk(id); + + if (!storage) { + throw new Error('库存记录不存在'); + } + + if (storage.available_quantity < quantity) { + throw new Error('可用数量不足'); + } + + return await Storage.updateQuantity(app, id, 0, quantity); + }; + + Storage.getStockSummary = async function(app, warehouseId) { + return await app.model.Storage.findAll({ + attributes: [ + 'stock_id', + 'inventory_type', + [ app.Sequelize.fn('SUM', app.Sequelize.col('quantity')), 'total_quantity' ], + [ app.Sequelize.fn('SUM', app.Sequelize.col('locked_quantity')), 'total_locked' ], + [ app.Sequelize.fn('SUM', app.Sequelize.col('available_quantity')), 'total_available' ], + ], + where: { + warehouse_id: warehouseId, + is_enabled: 1, + delete_at: null, + }, + group: [ 'stock_id', 'inventory_type' ], + raw: true, + }); + }; + + Storage.getSpaceUsage = async function(app, spaceId) { + const result = await app.model.Storage.findAll({ + attributes: [ + 'inventory_type', + [ app.Sequelize.fn('COUNT', app.Sequelize.col('id')), 'record_count' ], + [ app.Sequelize.fn('SUM', app.Sequelize.col('quantity')), 'total_quantity' ], + ], + where: { + space_id: spaceId, + is_enabled: 1, + delete_at: null, + }, + group: [ 'inventory_type' ], + raw: true, + }); + + const usage = { + normal: 0, + defective: 0, + damaged: 0, + frozen: 0, + total: 0, + }; + + result.forEach(item => { + let type; + switch (item.inventory_type) { + case 'ZP': type = 'normal'; break; + case 'CC': type = 'defective'; break; + case 'JS': + case 'XS': type = 'damaged'; break; + case 'DJ': type = 'frozen'; break; + default: return; + } + + usage[type] = parseInt(item.total_quantity) || 0; + usage.total += usage[type]; + }); + + return usage; + }; + + return Storage; +}; diff --git a/app/model/store.js b/app/model/store.js new file mode 100644 index 0000000..89bafc9 --- /dev/null +++ b/app/model/store.js @@ -0,0 +1,325 @@ +'use strict'; + +module.exports = app => { + const { BIGINT, STRING, DATE, TINYINT, INTEGER } = app.Sequelize; + + const Store = app.model.define('store', { + id: { + type: BIGINT.UNSIGNED, + primaryKey: true, + autoIncrement: true, + allowNull: false, + comment: '商家ID', + }, + company_name: { + type: STRING(200), + allowNull: false, + unique: true, + validate: { + notEmpty: { + msg: '公司全称不能为空', + }, + len: { + args: [ 1, 200 ], + msg: '公司全称长度应在1-200个字符之间', + }, + }, + comment: '公司全称', + }, + business_license: { + type: STRING(100), + allowNull: true, + unique: true, + comment: '营业执照号', + }, + legal_person: { + type: STRING(50), + allowNull: true, + comment: '法人代表', + }, + contact_phone: { + type: STRING(20), + allowNull: false, + validate: { + notEmpty: { + msg: '联系电话不能为空', + }, + is: { + args: /^[0-9+\-()\s]+$/, + msg: '请输入有效的联系电话', + }, + }, + comment: '联系电话', + }, + contact_email: { + type: STRING(100), + allowNull: true, + comment: '联系邮箱', + }, + contact_person: { + type: STRING(50), + allowNull: false, + validate: { + notEmpty: { + msg: '联系人不能为空', + }, + len: { + args: [ 1, 50 ], + msg: '联系人姓名长度应在1-50个字符之间', + }, + }, + comment: '联系人', + }, + address: { + type: STRING(500), + allowNull: true, + comment: '公司地址', + }, + industry: { + type: STRING(100), + allowNull: true, + comment: '所属行业', + }, + account_id: { + type: BIGINT.UNSIGNED, + allowNull: false, + comment: '关联账号ID(商家管理员)', + }, + status: { + type: TINYINT(4), + allowNull: false, + defaultValue: 1, + validate: { + isIn: { + args: [[ 0, 1, 2 ]], + msg: '状态值不合法,0-禁用,1-启用,2-审核中', + }, + }, + comment: '状态:0-禁用,1-启用,2-审核中', + }, + created_by: { + type: BIGINT.UNSIGNED, + allowNull: false, + comment: '创建人', + }, + created_at: { + type: DATE, + allowNull: false, + defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP'), + comment: '创建时间', + }, + updated_at: { + type: DATE, + allowNull: false, + defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP'), + comment: '更新时间', + }, + logo_url: { + type: STRING(255), + allowNull: true, + comment: 'logo链接', + }, + project: { + type: STRING(20), + allowNull: true, + comment: '应用', + }, + domain: { + type: STRING(100), + allowNull: true, + comment: '绑定域名', + }, + auth_end: { + type: DATE, + allowNull: true, + comment: '授权结束时间', + }, + deleted_at: { + type: DATE, + allowNull: true, + comment: '删除时间', + }, + quota_bytes: { + type: BIGINT.UNSIGNED, + allowNull: false, + defaultValue: 107374182400, + comment: '仓库文件存储配额', + }, + }, { + tableName: 'wms_store', + freezeTableName: true, + underscored: true, + timestamps: true, + createdAt: 'created_at', + updatedAt: 'updated_at', + paranoid: true, + deletedAt: 'deleted_at', + comment: '商家表', + indexes: [ + { + name: 'uk_company_name', + fields: [ 'company_name' ], + unique: true, + }, + { + name: 'uk_business_license', + fields: [ 'business_license' ], + unique: true, + }, + { + name: 'idx_status', + fields: [ 'status' ], + }, + { + name: 'idx_account_id', + fields: [ 'account_id' ], + }, + ], + }); + + // 关联关系 - 使用您推荐的方式 + Store.associate = function() { + const { Account, Role, AccountStoreEmployee, ProhibitedType } = app.model; + + // 关联创建人 + Store.belongsTo(Account, { + foreignKey: 'created_by', + as: 'creator', + }); + + // 关联商家管理员账号 + Store.belongsTo(Account, { + foreignKey: 'account_id', + as: 'adminAccount', + }); + + // 关联商家拥有的角色 + Store.hasMany(Role, { + foreignKey: 'store_id', + as: 'roles', + }); + + // 关联商家拥有的账号角色关联 + Store.hasMany(AccountStoreEmployee, { + foreignKey: 'store_id', + as: 'accountStoreEmployee', + }); + + Store.hasMany(ProhibitedType, { + foreignKey: 'warehouse_id', + as: 'prohibitedTypes', + }); + }; + + // 实例方法:检查商家是否启用 + Store.prototype.isEnabled = function() { + return this.status === 1; + }; + + // 实例方法:检查商家是否审核中 + Store.prototype.isReviewing = function() { + return this.status === 2; + }; + + // 实例方法:检查是否是仓库 + Store.prototype.isWarehouse = function() { + return this.project === 'warehouse'; + }; + + // 实例方法:检查授权是否有效 + Store.prototype.isAuthValid = function() { + if (!this.auth_start || !this.auth_end) { + return true; // 如果没有设置授权时间,默认有效 + } + + const now = new Date(); + return now >= new Date(this.auth_start) && now <= new Date(this.auth_end); + }; + + // 实例方法:检查邮箱是否有效 + Store.prototype.hasValidEmail = function() { + if (!this.contact_email) { + return false; + } + + const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; + return emailRegex.test(this.contact_email); + }; + + // 类方法:根据账号ID查找商家 + Store.findByAccountId = async function(accountId) { + return await this.findOne({ + where: { + account_id: accountId, + status: 1, + }, + }); + }; + + // 类方法:获取所有启用的商家 + Store.findAllEnabled = async function() { + return await this.findAll({ + where: { + status: 1, + }, + order: [[ 'company_name', 'ASC' ]], + }); + }; + + // 类方法:获取所有仓库类型的商家 + Store.findAllWarehouses = async function() { + return await this.findAll({ + where: { + status: 1, + project: 'warehouse', + }, + order: [[ 'company_name', 'ASC' ]], + }); + }; + + // 类方法:检查公司名称是否存在 + Store.checkCompanyNameExists = async function(companyName, excludeId = null) { + const where = { + company_name: companyName, + }; + + if (excludeId) { + where.id = { + [app.Sequelize.Op.ne]: excludeId, + }; + } + + const store = await this.findOne({ where }); + return !!store; + }; + + // 类方法:创建商家时的数据验证 + Store.validateStoreData = function(data) { + const errors = []; + + // 必填字段检查 + const requiredFields = [ 'company_name', 'contact_person', 'contact_phone' ]; + for (const field of requiredFields) { + if (!data[field]) { + errors.push(`${field} 不能为空`); + } + } + + // 公司名称长度检查 + if (data.company_name && (data.company_name.length < 1 || data.company_name.length > 200)) { + errors.push('公司名称长度应在1-200个字符之间'); + } + + // 邮箱格式检查(如果提供了邮箱) + if (data.contact_email && data.contact_email.trim() !== '') { + const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; + if (!emailRegex.test(data.contact_email)) { + errors.push('联系邮箱格式不正确'); + } + } + + return errors; + }; + + return Store; +}; diff --git a/app/model/store_join.js b/app/model/store_join.js new file mode 100644 index 0000000..a0c3011 --- /dev/null +++ b/app/model/store_join.js @@ -0,0 +1,101 @@ +// models/store_join.js + +module.exports = app => { + const { BIGINT, STRING, DATE, TINYINT, INTEGER, ENUM } = app.Sequelize; + const StoreJoin = app.model.define('StoreJoin', { + id: { + type: INTEGER(11), + primaryKey: true, + autoIncrement: true, + comment: '申请ID', + }, + account_id: { + type: BIGINT(20).UNSIGNED, + allowNull: false, + comment: '用户账户ID', + }, + warehouse: { + type: TINYINT(1), + allowNull: true, + comment: '是否为仓库', + }, + real_name: { + type: STRING(50), + allowNull: false, + comment: '真实姓名', + }, + store_id: { + type: BIGINT(20).UNSIGNED, + allowNull: true, + comment: '审批的门店/店铺ID', + }, + apply_time: { + type: DATE, + allowNull: false, + comment: '申请时间', + }, + apply_username: { + type: STRING(50), + allowNull: false, + comment: '申请人用户名', + }, + audit_status: { + type: ENUM('pending', 'approved', 'rejected', 'processing'), + defaultValue: 'pending', + comment: '审核状态', + }, + remark: { + type: STRING(500), + defaultValue: '', + comment: '备注', + }, + join_token: { + type: STRING(100), + allowNull: false, + unique: true, + comment: '加入令牌/验证码', + }, + token_expiry_time: { + type: DATE, + allowNull: true, + comment: '令牌过期时间', + }, + audit_real_name: { + type: STRING(50), + allowNull: true, + comment: '审核人工号名字', + }, + }, { + tableName: 'wms_store_join', + comment: '加入申请记录表', + paranoid: false, // 明确禁用软删除 + timestamps: true, + createdAt: 'created_at', + updatedAt: 'updated_at', + indexes: [ + { + name: 'idx_account_id', + fields: [ 'account_id' ], + }, + { + name: 'idx_audit_status', + fields: [ 'audit_status' ], + }, + { + name: 'idx_apply_time', + fields: [ 'apply_time' ], + }, + { + name: 'idx_store_id', + fields: [ 'store_id' ], + }, + { + name: 'uk_account_warehouse_store', + fields: [ 'account_id', 'store_id' ], + unique: true, + }, + ], + }); + + return StoreJoin; +}; diff --git a/app/model/store_warehouse.js b/app/model/store_warehouse.js new file mode 100644 index 0000000..01df60f --- /dev/null +++ b/app/model/store_warehouse.js @@ -0,0 +1,264 @@ +'use strict'; + +module.exports = app => { + const { BIGINT, TEXT, STRING, DATE, TINYINT, INTEGER } = app.Sequelize; + + const StoreWarehouse = app.model.define('store_warehouse', { + id: { + type: BIGINT(20), + primaryKey: true, + autoIncrement: true, + allowNull: false, + comment: '授权ID', + }, + store_id: { + type: BIGINT(20), + allowNull: false, + comment: '商家ID', + references: { + model: 'store', + key: 'id', + }, + }, + warehouse_id: { + type: BIGINT(20), + allowNull: false, + comment: '仓库ID', + references: { + model: 'store', + key: 'id', + }, + }, + auth_status: { + type: TINYINT(4), + allowNull: false, + defaultValue: 1, + validate: { + isIn: [[ 1, 2, 3, 4, 5 ]], // 1-申请中,2-已通过,3-已拒绝,4-已解除,5-已过期 + }, + comment: '授权状态:1-申请中,2-已通过,3-已拒绝,4-已解除,5-已过期', + }, + apply_reason: { + type: TEXT, + allowNull: true, + comment: '申请理由', + }, + review_comment: { + type: TEXT, + allowNull: true, + comment: '审核意见', + }, + apply_time: { + type: DATE, + allowNull: false, + comment: '申请时间', + }, + print_quantity: { + type: BIGINT(12), + allowNull: false, + comment: '面单余额', + }, + review_time: { + type: DATE, + allowNull: true, + comment: '审核时间', + }, + auth_start: { + type: DATE, + allowNull: true, + comment: '授权开始日期', + }, + auth_end: { + type: DATE, + allowNull: true, + comment: '授权结束日期', + }, + actual_end: { + type: DATE, + allowNull: true, + comment: '实际结束时间', + }, + applied_by: { + type: BIGINT(20), + allowNull: false, + comment: '申请人', + }, + reviewed_by: { + type: BIGINT(20), + allowNull: true, + comment: '审核人', + }, + ended_by: { + type: BIGINT(20), + allowNull: true, + comment: '解除人', + }, + created_at: { + type: DATE, + allowNull: false, + comment: '创建时间', + }, + updated_at: { + type: DATE, + allowNull: false, + comment: '更新时间', + }, + store_remask: { + type: STRING(50), + allowNull: true, + validate: { + len: [ 0, 50 ], + }, + comment: '商家备注', + }, + warehouse_remask: { + type: STRING(50), + allowNull: true, + validate: { + len: [ 0, 50 ], + }, + comment: '仓库备注', + }, + use_status: { + type: INTEGER(1), + allowNull: false, + comment: '使用状态,0-不可用,1-可用(SKU可见,货主可见,即使解约了)', + }, + }, { + tableName: 'wms_store_warehouse', + freezeTableName: true, + underscored: true, + timestamps: true, + createdAt: 'created_at', + updatedAt: 'updated_at', + comment: '商家仓库授权关系表', + indexes: [ + { + name: 'uk_store_warehouse', + unique: true, + fields: [ 'store_id', 'warehouse_id' ], + }, + { + name: 'idx_store_id', + fields: [ 'store_id' ], + }, + { + name: 'idx_warehouse_id', + fields: [ 'warehouse_id' ], + }, + { + name: 'idx_auth_status', + fields: [ 'auth_status' ], + }, + { + name: 'idx_apply_time', + fields: [ 'apply_time' ], + }, + { + name: 'idx_auth_period', + fields: [ 'auth_start', 'auth_end' ], + }, + { + name: 'idx_applied_by', + fields: [ 'applied_by' ], + }, + { + name: 'idx_reviewed_by', + fields: [ 'reviewed_by' ], + }, + { + name: 'idx_auth_end', + fields: [ 'auth_end' ], + }, + { + name: 'idx_status_apply_time', + fields: [ 'auth_status', 'apply_time' ], + }, + ], + }); + + // 定义关联关系 + StoreWarehouse.associate = function() { + const { Store, Account, StockWarehouse, Receiving } = app.model; + + // 授权关系属于商家 + StoreWarehouse.belongsTo(Store, { + foreignKey: 'store_id', + targetKey: 'id', + as: 'store', + }); + + // 授权关系属于仓库 + StoreWarehouse.belongsTo(Store, { + foreignKey: 'warehouse_id', + targetKey: 'id', + as: 'warehouse', + }); + + // 申请人 + StoreWarehouse.belongsTo(Account, { + foreignKey: 'applied_by', + targetKey: 'id', + as: 'applicant', + }); + + // 审核人 + StoreWarehouse.belongsTo(Account, { + foreignKey: 'reviewed_by', + targetKey: 'id', + as: 'reviewer', + }); + + StoreWarehouse.hasMany(StockWarehouse, { + foreignKey: 'store_id', + targetKey: 'store_id', + as: 'store_stock', + }); + + // 解除人 + StoreWarehouse.belongsTo(Account, { + foreignKey: 'ended_by', + targetKey: 'id', + as: 'end_user', + }); + StoreWarehouse.hasMany(Receiving, { + foreignKey: 'store_id', + as: 'receiving', + }); + }; + + // 实例方法 - 检查授权是否有效 + StoreWarehouse.prototype.isAuthValid = function() { + if (this.auth_status !== 2) return false; // 只有已通过状态才有效 + if (!this.auth_start || !this.auth_end) return false; + + const now = new Date(); + const start = new Date(this.auth_start); + const end = new Date(this.auth_end); + + return now >= start && now <= end; + }; + + // 实例方法 - 检查授权是否即将过期(30天内) + StoreWarehouse.prototype.isExpiringSoon = function() { + if (this.auth_status !== 2 || !this.auth_end) return false; + + const now = new Date(); + const end = new Date(this.auth_end); + const daysUntilExpire = Math.ceil((end - now) / (1000 * 60 * 60 * 24)); + + return daysUntilExpire <= 30 && daysUntilExpire > 0; + }; + + // 实例方法 - 获取授权剩余天数 + StoreWarehouse.prototype.getRemainingDays = function() { + if (!this.isAuthValid()) return 0; + + const now = new Date(); + const end = new Date(this.auth_end); + const diffTime = end - now; + return Math.ceil(diffTime / (1000 * 60 * 60 * 24)); + }; + + return StoreWarehouse; +}; diff --git a/app/router.js b/app/router.js new file mode 100644 index 0000000..ec0efb8 --- /dev/null +++ b/app/router.js @@ -0,0 +1,17 @@ +/** + * @param {Egg.Application} app - egg application + */ +module.exports = app => { + const { router, controller } = app; + router.get('/', controller.home.index); + router.post('/qimen', controller.home.qimen); + router.post('/api/warehouse', controller.home.warehouse); + router.post('/api/store', controller.home.store); + router.post('/api/v1', controller.home.v1); + router.post('/system', controller.home.system); + router.post('/api/v2', controller.apiV2.index); + router.get('/template/xml/:id', controller.template.xml); + router.get('/auth/printSetting/:code', controller.auth.printerSetting); + router.get('/testSendData', controller.home.testSendData); + router.post('/auth/printSetting/', controller.auth.printerSetting); +}; diff --git a/app/service/api.js b/app/service/api.js new file mode 100644 index 0000000..544067c --- /dev/null +++ b/app/service/api.js @@ -0,0 +1,48 @@ +'use strict'; + +const Service = require('egg').Service; +const { XMLParser } = require('fast-xml-parser'); + +class ApiService extends Service { + /** + * 调用业务方法 + * @param className + * @param actionName + * @param jsonData + * @param format + */ + async callMethod(className, actionName, jsonData, format = 'json') { + try { + // 构建服务类路径 + const servicePath = `${className}`; + const classs = servicePath.split('.'); + let apiMethods = this.ctx.service.apiMethods; + for (let i = 0; i < classs.length; i++) { + const className = classs[i]; + apiMethods = apiMethods[className]; + } + // 检查服务是否存在 + if (!apiMethods) { + throw new Error(`服务 ${servicePath} 不存在`); + } + + const serviceInstance = apiMethods; + + // 检查方法是否存在 + if (typeof serviceInstance[actionName] !== 'function') { + throw new Error(`方法 ${actionName} 不存在`); + } + + // 调用方法 + const result = await serviceInstance[actionName](jsonData); + // 根据format参数返回相应格式 + return result; + + } catch (error) { + throw error; + } + } + +} + +module.exports = ApiService; diff --git a/app/service/apiMethods/test.js b/app/service/apiMethods/test.js new file mode 100644 index 0000000..7630273 --- /dev/null +++ b/app/service/apiMethods/test.js @@ -0,0 +1,150 @@ +'use strict'; + +const Service = require('egg').Service; + +class testServer extends Service { + + constructor(ctx) { + super(ctx); + const { app } = this; + try { + this.addon = require(app.appRoot + '/native/addons/subset_selector.node'); + this.addonLoaded = true; + this.ctx.logger.info('[FibonacciService] C++插件加载成功'); + console.log(this.addon); + } catch (error) { + + + this.addonLoaded = false; + this.ctx.logger.error('[FibonacciService] C++插件加载失败:', error); + } + } + + async entryorderConfirm(data) { + const { app, ctx } = this; + return await ctx.service.systems.entryOrder.entryorderConfirm(data.id, data.isCompleted); + } + async playbackRequest(data) { + const { app } = this; + try { + const entryOrder = await app.model.QimenLog.findOne({ + where: { + id: data.id, + }, + }); + if (entryOrder) { + console.log('entryOrder', entryOrder.body); + const body = await this.ctx.service.systems.qimenQuery.sendRequest(entryOrder.url, entryOrder.body); + return { body }; + } + throw new Error('无历史请求数据'); + + } catch (error) { + throw error; + } + } + async fibonacci(data) { + const { ctx } = this; + const { n, type = 'dynamic' } = data; + + const DeliveryModel = await ctx.model.WmsOrderDeliveryFactory.getCurrentModel(100000); + const WmsOrderItemsModel = await ctx.model.WmsOrderItemsFactory.getCurrentModel(100000); + + const order = [[ 'id', 'DESC' ]]; + const pageSize = 20000; + const page = 1; + + try { + // 1. 先查询订单ID + const deliveryResult = await DeliveryModel.findAll({ + attributes: [ 'id' ], + where: {}, + order, + limit: parseInt(pageSize), + offset: (parseInt(page) - 1) * parseInt(pageSize), + raw: true, + }); + + console.log('查询到的订单ID数量:', deliveryResult.length); + + if (deliveryResult.length === 0) { + return { + orderIds: [], + skus: [], + orderCount: 0, + skuCount: 0, + message: '没有找到订单数据', + }; + } + + // 2. 提取订单ID数组 + const deliveryIds = deliveryResult.map(row => row.id); + + // 3. 使用正确的语法查询去重的商品数据 + const itemsResult = await WmsOrderItemsModel.findAll({ + attributes: [ + 'order_id', + 'item_id', + ], + where: { + order_id: deliveryIds, + }, + group: [ 'order_id', 'item_id' ], // ✅ 使用 GROUP BY 去重 + raw: true, + }); + + console.log('查询到的商品记录数量:', itemsResult.length); + + // 4. 按订单分组商品 + const itemsByOrder = {}; + itemsResult.forEach(item => { + if (!itemsByOrder[item.order_id]) { + itemsByOrder[item.order_id] = new Set(); // 使用 Set 自动去重 + } + itemsByOrder[item.order_id].add(parseInt(item.item_id)); + }); + + // 5. 构建订单数据结构 + const orders = deliveryResult.map(row => { + const orderId = row.id.toString(); + const skus = itemsByOrder[row.id] ? Array.from(itemsByOrder[row.id]) : []; + + return { + id: orderId, + skus, + size: skus.length, + }; + }).filter(order => order.skus.length > 0); // 过滤掉没有商品的订单 + + console.log('有效订单数量:', orders.length); + + if (orders.length === 0) { + return { + orderIds: [], + skus: [], + orderCount: 0, + skuCount: 0, + message: '没有找到包含商品的订单', + }; + } + + // 6. 调用插件算法 + const algorithmResult = this.addon.selectOrders(orders, n || 20, type); + + return { + ...algorithmResult, + totalOrders: orders.length, + queryTime: new Date().toISOString(), + }; + + } catch (error) { + console.error('执行订单选择算法失败:', error); + throw error; + } + } + fibonacciRecursive(n) { + if (n <= 1) return n; + return this.fibonacciRecursive(n - 1) + this.fibonacciRecursive(n - 2); // 大量重复计算 + } +} +module.exports = testServer; diff --git a/app/service/dispatcher.js b/app/service/dispatcher.js new file mode 100644 index 0000000..c68462f --- /dev/null +++ b/app/service/dispatcher.js @@ -0,0 +1,82 @@ +'use strict'; + +const Service = require('egg').Service; + +class DispatcherService extends Service { + constructor(ctx) { + super(ctx); + // postpone building map until needed + this.methodMap = null; + } + + // recursively walk through object to collect functions + buildMap(obj, prefix = '') { + // avoid expensive or dangerous walk when running tests + if (process.env.NODE_ENV === 'test') return {}; + const map = {}; + Object.keys(obj).forEach(key => { + let value; + try { + value = obj[key]; + } catch (err) { + // skip getters that throw + return; + } + const path = prefix ? `${prefix}.${key}` : key; + if (typeof value === 'function') { + map[path] = value.bind(obj); + } else if (value && typeof value === 'object') { + Object.assign(map, this.buildMap(value, path)); + } + }); + return map; + } + + getMethodMap() { + if (!this.methodMap) { + this.methodMap = this.buildMap(this.ctx.service.systemMethods || {}); + } + return this.methodMap; + } + + async invoke(method, data, authHeader, ctx) { + // debug output: show incoming request method and payload size + console.debug('[dispatcher] invoke method', method, 'data size', + data ? JSON.stringify(data).length : 0); + + const fn = this.getMethodMap()[method]; + if (!fn) { + console.error('[dispatcher] method not found in map:', method); + throw new Error(`方法 ${method} 不存在 (检查 systemMethods 目录或拼写)`); + } + // perform global auth/log check using original service API + // we rely on the service instance to provide checkAuth, so find owning service + const parts = method.split('.'); + const action = parts.pop(); + const servicePath = parts.join('.'); + + // resolve the service instance again (should be same as that bound earlier) + let svc = ctx.service.systemMethods; + parts.forEach(p => { + svc = svc && svc[p]; + }); + + if (!svc) { + console.error('[dispatcher] service instance not found for path', servicePath); + throw new Error(`服务 ${servicePath} 不存在`); + } + + const authPass = await svc.checkAuth(servicePath, action, authHeader); + const isLog = authPass.isLog; + if (authPass.status !== 200) { + console.debug('[dispatcher] auth failed', authPass); + return { isLog, result: { status: authPass.status, message: authPass.message } }; + } + + const resultData = await fn(data); + console.debug('[dispatcher] method executed successfully', method); + return { isLog, result: { status: 200, data: resultData } }; + } +} + +module.exports = DispatcherService; diff --git a/app/service/main.js b/app/service/main.js new file mode 100644 index 0000000..1dc4fab --- /dev/null +++ b/app/service/main.js @@ -0,0 +1,380 @@ +'use strict'; + +const Service = require('egg').Service; + +class MainService extends Service { + constructor(ctx) { + super(ctx); + // 初始化公共变量 + this.storeId = null; + this.warehouseId = null; + this.appKey = null; + this.customerId = null; + this.warehouseCode = null; + this.commonData = {}; // 额外的公共数据存储 + this._noNeedLogin = null; + this._noNeedRight = null; + this._noNeedAuth = null; + this.user = null; + this.userId = null; + } + + success(message, data, code = 1) { + const result = { + flag: 'success', + code, + message, + ...data, + }; + return result; + } + + fail(message, data, code = 0) { + console.log('fail', message, data); + const result = { + flag: 'failure', + code, + message, + ...data, + }; + return result; + } + normalizeDate(date, isEnd = false) { + if (!date) return null; + + let d; + + if (date instanceof Date) { + d = date; + } else { + // 尝试解析日期字符串 + d = new Date(date); + if (isNaN(d.getTime())) { + return date; + } + } + + // 获取本地时间的年月日 + const year = d.getFullYear(); + const month = String(d.getMonth() + 1).padStart(2, '0'); + const day = String(d.getDate()).padStart(2, '0'); + + // 根据 isEnd 参数添加时间部分 + // 使用本地时间格式,避免时区转换 + if (isEnd) { + return `${year}-${month}-${day} 23:59:59`; + } + return `${year}-${month}-${day} 00:00:00`; + + } + setInfo(storeId, warehouseId, appKey, customerId, warehouseCode) { + this.storeId = storeId; + this.warehouseId = warehouseId; + this.appKey = appKey; + this.warehouseCode = warehouseCode; + this.customerId = customerId; + } + + getInfo() { + return { + storeId: this.storeId, + warehouseId: this.warehouseId, + appKey: this.appKey, + warehouseCode: this.warehouseCode, + customerId: this.customerId, + }; + } + + async findQimenAppWithContract(appkey, customerId, warehouseCode) { + const { app } = this; + const cacheKey = `contract:${appkey}:${customerId}:${warehouseCode}`; + try { + let cacheResult = null; + try { + cacheResult = await Promise.race([ + this.app.getCacheAsync(cacheKey), + new Promise(resolve => setTimeout(() => { + app.logger.warn('[RedisTimeout] Redis get operation timeout'); + resolve(null); + }, 100)), + ]); + } catch (cacheError) { + app.logger.warn('[RedisGetError]', cacheError.message); + // Redis 错误时继续数据库查询 + } + + if (cacheResult) { + try { + const parsedResult = cacheResult; + if (parsedResult) { + app.logger.info('[CacheHit] Found in cache', cacheKey); + return parsedResult; + } + } catch (parseError) { + app.logger.error('[RedisParseError]', parseError.message, cacheKey); + } + } + + // 3. 数据库查询 + app.logger.info('[CacheMiss] Querying from database', { appkey, customerId, warehouseCode }); + const dbResult = await this.queryFromDatabase(appkey, customerId, warehouseCode); + + // 4. 异步设置缓存(添加安全检查) + this.app.setCacheAsync(cacheKey, dbResult).catch(error => { + app.logger.error('[AsyncCacheError]', error.message); + }); + + return dbResult; + } catch (error) { + app.logger.error('[findQimenAppWithContract] Query failed', error.message, { appkey, customerId, warehouseCode }); + throw error; + } + } + + // 提取数据库查询逻辑 + async queryFromDatabase(appkey, customerId, warehouseCode) { + const { app } = this; + + // 检查模型是否存在 + if (!app.model || !app.model.ApiApp) { + throw new Error('ApiApp model is not available'); + } + + return await app.model.ApiApp.findOne({ + attributes: [ + 'id', + 'app_name', + 'qimen_app_key', + 'qimen_customer_id', + 'qimen_warehouse_code', + 'api_version', + 'sign_method', + 'rate_limit', + 'timeout_seconds', + [ app.Sequelize.col('contract.store_id'), 'store_id' ], + [ app.Sequelize.col('contract.warehouse_id'), 'warehouse_id' ], + [ app.Sequelize.col('contract.auth_end'), 'contract_auth_end' ], + [ app.Sequelize.col('contract.auth_status'), 'contract_auth_status' ], + [ app.Sequelize.col('contract.apply_reason'), 'apply_reason' ], + [ app.Sequelize.col('contract.review_comment'), 'review_comment' ], + [ app.Sequelize.col('contract.warehouse.status'), 'warehouse_status' ], + [ app.Sequelize.col('contract.warehouse.auth_end'), 'warehouse_auth_end' ], + ], + where: { + qimen_app_key: appkey, + qimen_customer_id: customerId, + qimen_warehouse_code: warehouseCode, + is_enabled: 1, + }, + include: [ + { + model: app.model.StoreWarehouse, + as: 'contract', + attributes: [], + required: false, + include: [ + { + model: app.model.Store, + as: 'warehouse', + attributes: [], + required: false, + }, + ], + }, + ], + raw: true, + timeout: 10000, // 10秒超时 + }); + } + async checkAuth(servicePath, actionName, authHeader) { + const { ctx, app } = this; + + // 配置免登录和免鉴权的接口 + const _noNeedLogin = (this._noNeedLogin || '').split(','); + const _noNeedRight = (this._noNeedRight || '').split(','); + const _noNeedAuth = (this._noNeedAuth || '').split(','); + const _noNeedLog = (this._noNeedLog || '').split(','); + const api_path = `${servicePath}.${actionName}`; + console.log(api_path, '_noNeedLog', _noNeedLog); + const result = { + status: 401, + message: '', + user: null, + isLog: true, + }; + if (_noNeedLog.indexOf('*') > -1 || _noNeedLog.indexOf(actionName) > -1) { + result.isLog = false; + } + // 1. 检查是否在免登录列表 + if (_noNeedLogin.indexOf('*') > -1 || _noNeedLogin.indexOf(actionName) > -1) { + result.status = 200; + result.message = 'ok'; + return result; + } + + // 2. 检查是否有认证令牌 + if (!authHeader || !authHeader.startsWith('Bearer ')) { + result.status = 401; + result.message = '未提供有效的认证令牌'; + return result; + } + + const token = authHeader.substring(7); + + try { + // 3. 验证JWT令牌 + const NewauthHeader = ''; + const decoded = app.jwt.verify(token, app.config.jwt.secret); + const now = Math.floor(Date.now() / 1000); + const expiresIn = decoded.exp - now; + if (expiresIn < 1800 && expiresIn > 0) { + // 移除过期时间(exp)和签发时间(iat),保留其他payload + const { exp, iat, ...payload } = decoded; + + // 生成新的 token,使用原来的有效时间配置 + const newToken = app.jwt.sign( + payload, + app.config.jwt.secret, + { + expiresIn: app.config.jwt.expiresIn || '3600', + } + ); + + // 设置新的 token 到响应头 + ctx.set('Authorization', `Bearer ${newToken}`); + console.log('Token 已刷新,新 token:', newToken.substring(0, 50) + '...'); + } + // 4. 获取用户信息 + const user = await ctx.service.systems.auth.user.findById(decoded.id || decoded.userId); + + if (!user) { + result.status = 401; + result.message = '用户不存在或已被删除'; + return result; + } + + if (user.status !== 1) { + result.status = 403; + result.message = '账号已被禁用'; + return result; + } + + if (_noNeedAuth.indexOf('*') > -1 || _noNeedAuth.indexOf(actionName) > -1) { + } else { + if (user.auth_end && new Date(user.auth_end) < new Date()) { + result.status = 406; + result.message = '仓库有效期已过期'; + return result; + } + } + + // 5. 检查是否在免权限列表 + if (_noNeedRight.indexOf('*') > -1 || _noNeedRight.indexOf(actionName) > -1) { + // 免权限验证,只验证登录状态 + this.setUserContext(ctx, user, decoded); + result.status = 200; + result.message = 'ok'; + result.user = user; + return result; + } + + // 6. 验证API权限(只检查类型为api的权限) + console.log('检查权限开始'); + + const hasPermission = await this.checkApiPermission(user, api_path); + console.log('检查权限结束', hasPermission); + + + if (!hasPermission) { + result.status = 403; + result.message = '无权访问该接口'; + return result; + } + + // 7. 验证通过,设置用户上下文 + this.setUserContext(ctx, user, decoded); + + result.status = 200; + result.message = 'ok'; + result.user = user; + return result; + + } catch (error) { + console.error('鉴权错误:', error); + + if (error.name === 'TokenExpiredError') { + result.status = 401; + result.message = '令牌已过期'; + } else if (error.name === 'JsonWebTokenError') { + result.status = 401; + result.message = '无效的令牌'; + } else if (error.name === 'SequelizeDatabaseError') { + result.status = 500; + result.message = '数据库错误'; + } else { + result.status = 500; + result.message = '服务器内部错误'; + } + return result; + } + } + + /** + * 检查用户是否有API访问权限(只检查类型为api的权限) + * @param {Object} user - 用户信息 + * @param {string} apiPath - API路径 + * @return {Promise} + */ + async checkApiPermission(user, apiPath) { + const { ctx } = this; + + console.log(user); + try { + // 方法1: 从用户的权限列表中检查(如果已经加载了权限) + if (user.permissions && Array.isArray(user.permissions)) { + // 用户权限列表中可能包含所有权限,需要过滤出api权限 + console.log('user.permissions', user.permissions); + return user.permissions.includes(apiPath); + } + return false; + } catch (error) { + console.error('检查API权限失败:', error); + return false; + } + } + /** + * 设置用户上下文信息 + * @param {Object} ctx - 上下文对象 + * @param {Object} user - 用户信息 + * @param {Object} decoded - JWT解码信息 + */ + setUserContext(ctx, user, decoded) { + // 设置用户基本信息 + ctx.user = user; + ctx.userId = user.id; + ctx.username = user.username; + ctx.realName = user.real_name; + + + if (user.store_id) { + ctx.currentStoreId = user.store_id; + } + + // 设置平台信息 + if (decoded.platform_code) { + ctx.platformCode = decoded.platform_code; + } + + // 设置JWT原始信息 + ctx.jwtPayload = decoded; + } + + systemInit(_noNeedLogin, _noNeedRight, _noNeedLog = '*', _noNeedAuth = '*') { + this._noNeedLogin = _noNeedLogin; + this._noNeedRight = _noNeedRight; + this._noNeedLog = _noNeedLog; + this._noNeedAuth = _noNeedAuth; + } +} + +module.exports = MainService; diff --git a/app/service/pda.js b/app/service/pda.js new file mode 100644 index 0000000..de8f355 --- /dev/null +++ b/app/service/pda.js @@ -0,0 +1,104 @@ +'use strict'; + +const Service = require('egg').Service; +const { XMLParser } = require('fast-xml-parser'); + +class pdaService extends Service { + async callMethod(className, actionName, requestData, authHeader) { + try { + // 构建服务类路径 + const servicePath = `${className}`; + const classs = servicePath.split('.'); + let systemMethods = this.ctx.service.systemMethods; + for (let i = 0; i < classs.length; i++) { + const className = classs[i]; + systemMethods = systemMethods[className]; + } + // 检查服务是否存在 + if (!systemMethods) { + throw new Error(`服务 ${servicePath} 不存在`); + } + const serviceInstance = systemMethods; + + // 检查方法是否存在 + if (typeof serviceInstance[actionName] !== 'function') { + throw new Error(`方法 ${actionName} 不存在`); + } + const result = { + message: '', + status: 401, + }; + // 调用方法 + const authPass = await serviceInstance.checkAuth(servicePath, actionName, authHeader); + const isLog = authPass.isLog; + if (authPass.status == 200) { + result.data = await serviceInstance[actionName](requestData); + console.log(result.data); + result.status = 200; + + } else { + result.message = authPass.message; + result.status = authPass.status; + } + return { isLog, result }; + + } catch (error) { + throw error; + } + } + validateParams(params) { + const required = [ 'method', 'v', 'timestamp' ]; + + for (const field of required) { + if (!params[field]) { + return false; + } + } + + // 验证method格式 + if (typeof params.method !== 'string' || !params.method.includes('.')) { + return false; + } + + return true; + } + async saveLog(logData, startTime) { + const { + ctx, + } = this; + + try { + // 限制日志内容长度 + if (logData.body && logData.body.length > 65535) { + logData.body = logData.body.substring(0, 65535); + } + + if (logData.result && logData.result.length > 65535) { + logData.result = logData.result.substring(0, 65535); + } + + logData.use_time = Date.now() - startTime; + + // 使用 egg-mysql 保存日志到数据库 + const result = await ctx.app.mysql.get('wms').insert('wms_system_log', { + method: logData.method || '', + v: logData.v || '', + url: logData.url || '', + headers: logData.headers || '', + auth: logData.auth || '', + created_at: ctx.app.mysql.get('wms').literals.now, + body: logData.body || '', + result: logData.result || '', + use_time: logData.use_time || 0, + store_id: logData.store_id || null, + device: 'pda', + }); + return result; + } catch (error) { + ctx.logger.error('保存日志失败: ' + error.message); + // 可以选择记录到文件日志作为备用 + ctx.logger.info('日志数据: ', JSON.stringify(logData)); + } + } +} +module.exports = pdaService; diff --git a/app/service/qimen.js b/app/service/qimen.js new file mode 100644 index 0000000..33bff3d --- /dev/null +++ b/app/service/qimen.js @@ -0,0 +1,283 @@ +'use strict'; + +const Service = require('egg').Service; +const { XMLParser } = require('fast-xml-parser'); + +class QimenService extends Service { + /** + * 验证接口是否存在且启用 + * @param appkey + * @param customerId + * @param warehouseCode + */ + async validateApi(appkey, customerId, warehouseCode) { + + try { + const { ctx } = this; + const result = await this.ctx.service.main.findQimenAppWithContract(appkey, customerId, warehouseCode); + return result; + } catch (error) { + this.ctx.logger.error('验证接口配置失败: ' + error.message); + return false; + } + } + async getErpName(appkey) { + const { app } = this; + const result = await app.model.QimenApp.findOne({ + attributes: [ + 'id', + 'name', + ], + where: { + app_key: appkey, + }, + raw: true, + }); + if (result) { + return result.name; + } + return '未知ERP'; + + } + /** + * 解析XML到数组 + * @param xmlString + */ + async parseXmlToArray(xmlString) { + const cleanedXml = this.cleanXmlString(xmlString); + + if (!cleanedXml || cleanedXml.trim() === '') { + throw new Error('XML数据为空'); + } + + const parser = new XMLParser({ + ignoreAttributes: false, + attributeNamePrefix: '@_', + allowBooleanAttributes: true, + // 关闭值解析,保持原始字符串 + parseTagValue: false, + parseAttributeValue: false, + trimValues: false, // 也关闭trim,保持原始格式 + ignoreDeclaration: true, + // 添加标签值处理器,手动控制转换 + tagValueProcessor: (tagName, tagValue, jPath, hasAttributes, isLeafNode) => { + // 如果是叶子节点且需要保持字符串格式的标签,可以在这里特殊处理 + // 默认返回原始值 + return tagValue; + }, + }); + + try { + const result = parser.parse(cleanedXml); + return result; + } catch (error) { + throw new Error('XML解析错误: ' + error.message); + } + } + + /** + * 清理XML字符串 + * @param xmlString + */ + cleanXmlString(xmlString) { + if (!xmlString) return ''; + + // 移除UTF-8 BOM + let cleaned = xmlString.replace(/^\uFEFF/, ''); + + // 移除XML声明前面的空白字符 + cleaned = cleaned.trim(); + + // 如果XML声明不在开头,尝试找到并移动到开头 + const xmlDeclarationMatch = cleaned.match(/<\?xml[^?>]+\?>/); + if (xmlDeclarationMatch && cleaned.indexOf(xmlDeclarationMatch[0]) > 0) { + const xmlDeclaration = xmlDeclarationMatch[0]; + // 移除原有的XML声明 + cleaned = cleaned.replace(/<\?xml[^?>]+\?>/, ''); + // 将XML声明放到开头 + cleaned = xmlDeclaration + '\n' + cleaned.trim(); + } + + return cleaned.trim(); + } + + /** + * 调用业务方法 + * @param className + * @param actionName + * @param xmlData + * @param storeId + * @param warehouseId + * @param appKey + * @param customerId + * @param warehouseCode + * @param format + */ + async callMethod(className, actionName, xmlData, storeId, warehouseId, appKey, customerId, warehouseCode, format = 'xml') { + try { + // 构建服务类路径 + const servicePath = `${className}`; + const classs = servicePath.split('.'); + let qimenMethods = this.ctx.service.qimenMethods; + for (let i = 0; i < classs.length; i++) { + const className = classs[i]; + qimenMethods = qimenMethods[className]; + } + // 检查服务是否存在 + if (!qimenMethods) { + throw new Error(`服务 ${servicePath} 不存在`); + } + + const serviceInstance = qimenMethods; + + // 检查方法是否存在 + if (typeof serviceInstance[actionName] !== 'function') { + throw new Error(`方法 ${actionName} 不存在`); + } + + // 调用方法 + await serviceInstance.setInfo(storeId, warehouseId, appKey, customerId, warehouseCode); + const result = await serviceInstance[actionName](xmlData); + // 根据format参数返回相应格式 + return this.formatResponse(result); + + } catch (error) { + throw error; + } + } + + /** + * 格式化响应 + * @param data + */ + formatResponse(data) { + return this.xmlResponse(data); + } + + /** + * XML响应 + * @param data + */ + xmlResponse(data) { + let xml = '\n'; + xml += '\n'; + + // 处理固定字段 + xml += ` ${data.flag || 'failure'}\n`; + xml += ` ${data.code || '0'}\n`; + xml += ` ${this.escapeXml(data.message || '操作成功')}\n`; + + // 添加其他数据字段 + for (const [ key, value ] of Object.entries(data)) { + if (![ 'flag', 'code', 'message' ].includes(key)) { + xml += this.buildXmlNode(key, value, 1); + } + } + + xml += ''; + return xml; + } + + /** + * 构建XML节点 - 支持多层级 + * @param key + * @param value + * @param level + */ + buildXmlNode(key, value, level = 0) { + const indent = ' '.repeat(level); + let xml = ''; + + if (Array.isArray(value)) { + // 数字索引数组 + if (value.every((_, index) => index in value)) { + xml += `${indent}<${key}>\n`; + value.forEach(item => { + if (Array.isArray(item) || typeof item === 'object') { + xml += this.buildXmlNode('item', item, level + 1); + } else { + xml += `${indent} ${this.escapeXml(item)}\n`; + } + }); + xml += `${indent}\n`; + } + } else if (typeof value === 'object' && value !== null) { + // 对象 + xml += `${indent}<${key}>\n`; + for (const [ subKey, subValue ] of Object.entries(value)) { + xml += this.buildXmlNode(subKey, subValue, level + 1); + } + xml += `${indent}\n`; + } else { + // 简单值 + xml += `${indent}<${key}>${this.escapeXml(value)}\n`; + } + + return xml; + } + + /** + * XML转义 + * @param unsafe + */ + escapeXml(unsafe) { + if (unsafe === null || unsafe === undefined) return ''; + const str = String(unsafe); + return str.replace(/[<>&'"]/g, c => { + switch (c) { + case '<': return '<'; + case '>': return '>'; + case '&': return '&'; + case '\'': return '''; + case '"': return '"'; + default: return c; + } + }); + } + async saveQimenLog(logData, startTime) { + const { + ctx, + } = this; + + try { + // 限制日志内容长度 + if (logData.body && logData.body.length > 65535) { + logData.body = logData.body.substring(0, 65535); + } + + if (logData.result && logData.result.length > 65535) { + logData.result = logData.result.substring(0, 65535); + } + + logData.use_time = Date.now() - startTime; + + // 使用 egg-mysql 保存日志到数据库 + const result = await ctx.app.mysql.get('wms').insert('wms_qimen_log', { + from_key: logData.from_key || '', + to_key: logData.to_key || '', + method: logData.method || '', + sign: logData.sign || '', + costomer_id: logData.costomer_id || '', + v: logData.v || '', + url: logData.url || '', + created_at: ctx.app.mysql.get('wms').literals.now, + body: logData.body || '', + result: logData.result || '', + use_time: logData.use_time || 0, + }); + return result.insertId; + } catch (error) { + ctx.logger.error('保存奇门接口日志失败: ' + error.message); + // 可以选择记录到文件日志作为备用 + ctx.logger.info('奇门接口日志数据: ', JSON.stringify(logData)); + } + } + async saveQimenLogResult(result) { + await this.ctx.app.mysql.get('wms').update('wms_qimen_log', { result, id: this.ctx.qimenLogId }); + } + async saveQimenLogBody(body) { + await this.ctx.app.mysql.get('wms').update('wms_qimen_log', { body, id: this.ctx.qimenLogId }); + } +} + +module.exports = QimenService; diff --git a/app/service/qimenMethods/deliveryorder.js b/app/service/qimenMethods/deliveryorder.js new file mode 100644 index 0000000..635c0ae --- /dev/null +++ b/app/service/qimenMethods/deliveryorder.js @@ -0,0 +1,47 @@ +'use strict'; + +const MainService = require('../main'); + +class deliveryorderServer extends MainService { + async query(data) { + const DeliveryModel = await this.ctx.model.OrderDeliveryFactory.getCurrentModel(this.warehouseId); + const hisDeliveryModel = await this.ctx.model.OrderDeliveryFactory.getHistoryModel(this.warehouseId); + const order = await DeliveryModel.findOne({ where: { delivery_order_code: data.request.orderCode } }); + const totalLines = 0; + if (order) { + return this.success('成功', { + totalLines, + deliveryOrder: { + deliveryOrderCode: order.delivery_order_code, + deliveryOrderId: order.delivery_order_code, + warehouseCode: order.warehouse_code, + orderType: order.order_type, + status: order.status, + orderConfirmTime: order.order_confirm_time, + operatorCode: 0, + operatorName: '', + operateTime: order.update_at, + }, + packages: { + package: {}, + }, + orderLines: [], + }); + } + return this.fail('未找到订单'); + + } + async create(data) { + const info = this.getInfo; + const res = await this.ctx.service.systems.deliveryOrder.addOrder(data, this.getInfo(), 'QM'); + if (res.success) { + return this.success(res.message, { createTime: new Date().format(), deliveryOrderId: res.data.deliveryOrderId, warehouseCode: info.warehouseCode, logisticsCode: res.data.logisticsCode }); + } + return this.fail(res.message, { createTime: new Date().format() }); + + } + async batchcreate() { + return this.fail('批量创建接口未完善'); + } +} +module.exports = deliveryorderServer; diff --git a/app/service/qimenMethods/entryorder.js b/app/service/qimenMethods/entryorder.js new file mode 100644 index 0000000..67b941d --- /dev/null +++ b/app/service/qimenMethods/entryorder.js @@ -0,0 +1,23 @@ +'use strict'; + +const MainService = require('../main'); + +class entryorderServer extends MainService { + async create(data) { + const info = this.getInfo; + const res = await this.ctx.service.systems.entryOrder.addOrder(data, this.getInfo(), 'QM'); + + console.log('创建入库单返回', res); + if (res.success) { + return this.success(res.message, { createTime: new Date().format(), entryOrderId: res.data.entryOrderId }); + } + return this.fail(res.message, { createTime: new Date().format() }); + + } + async query(data) { + console.log(data); + return this.fail('接口未完善'); + } + +} +module.exports = entryorderServer; diff --git a/app/service/qimenMethods/inventory.js b/app/service/qimenMethods/inventory.js new file mode 100644 index 0000000..3d09f09 --- /dev/null +++ b/app/service/qimenMethods/inventory.js @@ -0,0 +1,30 @@ +'use strict'; + +const MainService = require('../main'); + +class inventoryServer extends MainService { + + constructor(ctx) { + super(ctx); + } + async query(data) { + const criteria = data.request.criteriaList.criteria; + const list = criteria.warehouseCode ? [ criteria ] : criteria; + const list2 = []; + for (let i = 0; i < list.length; i++) { + const info = await this.ctx.service.systems.stockStore.getItemStorages(list[i].itemId); + if (info.success) { + list2.push({ + warehouseCode: info.data.stock.warehouse_code, + itemCode: info.data.stock.item_code, + itemId: info.data.stock.id, + quantity: info.data.storage.quantity - info.data.storage.lockedQuantity, + lockQuantity: info.data.storage.lockedQuantity, + inventoryType: 'ZP', + }); + } + } + return this.success('库存信息抓取成功', { items: list2 }); + } +} +module.exports = inventoryServer; diff --git a/app/service/qimenMethods/order.js b/app/service/qimenMethods/order.js new file mode 100644 index 0000000..02f2287 --- /dev/null +++ b/app/service/qimenMethods/order.js @@ -0,0 +1,153 @@ +'use strict'; + +const MainService = require('../main'); + +class orderServer extends MainService { + + constructor(ctx) { + super(ctx); + // 初始化公共变量 + this.orderType = { + JYCK: { + method: 'ORDER', + name: '一般交易出库单', + }, + HHCK: { + method: 'ORDER', + name: '换货出库', + }, + BFCK: { + method: 'ORDER', + name: '补发出库', + }, + PTCK: { + method: 'CK', + name: '普通出库单', + }, + DBCK: { + method: 'CK', + name: '调拨出库', + }, + B2BCK: { + method: 'CK', + name: 'B2B出库', + }, + QTCK: { + method: 'CK', + name: '其他出库', + }, + CGTH: { + method: 'CK', + name: '采购退货出库单', + }, + B2BRK: { + method: 'RK', + name: 'B2B入库', + }, + SCRK: { + method: 'RK', + name: '生产入库', + }, + LYRK: { + method: 'RK', + name: '领用入库', + }, + CCRK: { + method: 'RK', + name: '残次品入库', + }, + CGRK: { + method: 'RK', + name: '采购入库', + }, + DBRK: { + method: 'RK', + name: '调拨入库', + }, + QTRK: { + method: 'RK', + name: '其他入库', + }, + XTRK: { + method: 'BACKORDER', + name: '销退入库', + }, + THRK: { + method: 'BACKORDER', + name: '退货入库', + }, + HHRK: { + method: 'BACKORDER', + name: '换货入库', + }, + CNJG: { + method: 'JG', + name: '仓内加工单', + }, + }; + } + + async cancel(data) { + const { ctx } = this; + const info = this.getInfo(); + const orderType = this.orderType[data.request.orderType]; + switch (orderType.method) { + case 'ORDER': + return this.success('取消订单成功'); + break; + case 'RK' : + console.log(data, info); + const existingOrder = await ctx.model.EntryOrder.findOne({ + where: { + entry_order_code: data.request.orderCode, + warehouse_id: info.warehouseId, + store_id: info.storeId, + }, + }); + if (existingOrder) { + await existingOrder.update({ + order_status: 'CANCELLED', + updated_at: new Date(), + }); + return this.success('取消入库单成功'); + } + return this.fail('未找到对应的入库单'); + break; + case 'CK' : + return this.fail('取消出库单未开发完成'); + break; + case 'JG' : + return this.fail('取消加工单未开发完成'); + break; + case 'BACKORDER': + return this.fail('取消退货单未开发完成'); + break; + default: + return this.fail(`未识别的作业类型${orderType.method}`, {}); + } + } + async pending(data) { + console.log(data); + const orderType = this.orderType[data.request.orderType]; + switch (orderType.method) { + case 'ORDER': + return this.fail('锁定订单未开发完成'); + break; + case 'RK' : + return this.fail('锁定入库单未开发完成'); + break; + case 'CK' : + return this.fail('锁定出库单未开发完成'); + break; + case 'JG' : + return this.fail('锁定加工单未开发完成'); + break; + case 'BACKORDER': + return this.fail('锁定退货单未开发完成'); + break; + default: + return this.fail(`未识别的作业类型${orderType.method}`, {}); + } + } +} +module.exports = orderServer; diff --git a/app/service/qimenMethods/returnorder.js b/app/service/qimenMethods/returnorder.js new file mode 100644 index 0000000..af8d247 --- /dev/null +++ b/app/service/qimenMethods/returnorder.js @@ -0,0 +1,19 @@ +'use strict'; + +const MainService = require('../main'); + +class returnorderServer extends MainService { + /* + 退货入库创建接口 + */ + async create(data) { + return this.fail('接口未完善', { result: 'singleitemServer', storeId: this.storeId }); + } + /* + 退货入库查询接口 + */ + async query(data) { + return this.fail('接口未完善', { result: 'singleitemServer', storeId: this.storeId }); + } +} +module.exports = returnorderServer; diff --git a/app/service/qimenMethods/singleitem.js b/app/service/qimenMethods/singleitem.js new file mode 100644 index 0000000..f14c2f9 --- /dev/null +++ b/app/service/qimenMethods/singleitem.js @@ -0,0 +1,36 @@ +'use strict'; + +const MainService = require('../main'); + +class singleitemServer extends MainService { + async synchronize(data) { + const { app } = this; + try { + console.log('data', data); + const stockData = await this.ctx.service.systems.stockStore.initQimenStockData(data.request, this.appKey, this.storeId, this.warehouseId); + console.log('stockData', stockData); + const result = await await this.ctx.service.systems.stockStore.create(stockData); + return this.success('同步完成', { itemId: result.id }); + } catch (error) { + return this.fail('同步失败', { error: error.message }); + } + } + async query(data) { + const { app } = this; + try { + if (!data.request.itemId) { + return this.fail('获取失败', { error: '参数错误itemId不存在' }); + } + const Row = await app.model.StockStore.findByPk(data.request.itemId); + if (!Row) { + return this.fail('获取失败', { error: `wms的SKUID为${data.request.itemId}未找到` }); + } + const result = await this.ctx.service.systems.stockStore.convertToQimenFormat(Row); + return this.success('获取成功', result); + } catch (error) { + console.error('获取失败:', error); + return this.fail('获取失败', { error: error.message }); + } + } +} +module.exports = singleitemServer; diff --git a/app/service/qimenMethods/stockout.js b/app/service/qimenMethods/stockout.js new file mode 100644 index 0000000..9eb0827 --- /dev/null +++ b/app/service/qimenMethods/stockout.js @@ -0,0 +1,72 @@ +'use strict'; + +const MainService = require('../main'); + +class stockoutServer extends MainService { + + async create(data) { + const { app } = this; + + let totalOrderLines = data.request.deliveryOrder.totalOrderLines || 0; + + let orderLine = data.request.orderLines.orderLine; + if (orderLine.orderLineNo) { + orderLine = [ orderLine ]; + } + const isSingle = totalOrderLines ? 0 : 1; + totalOrderLines = totalOrderLines || orderLine.length; + const errors = []; + const items = []; + for (let i = 0; i < orderLine.length; i++) { + const wms_stock = await app.model.StockStore.findByPk(orderLine[i].itemId); + if (!wms_stock) { + errors.push(`SKU${orderLine[i].itemId}商品《${orderLine[i].itemName}》编码《${orderLine[i].itemCode}》\n未同步推送到仓库`); + continue; + } + if (!wms_stock.stock_id) { + errors.push(`SKU${orderLine[i].itemId}商品《${orderLine[i].itemName}》编码《${orderLine[i].itemCode}》wms无对应关系\n请联系仓库关联创建商品`); + continue; + } + wms_stock.inventory_type = orderLine[i].inventoryType; + wms_stock.order_line_no = orderLine[i].orderLineNo; + wms_stock.count = orderLine[i].planQty; + wms_stock.item_id = orderLine[i].itemId; + items.push(wms_stock); + } + console.log('出库单参数:', data.request.deliveryOrder, this.appKey, this.storeId, this.warehouseId, totalOrderLines, 'QM', this.customerId, this.warehouseCode); + console.log('出库单明细:', items); + if (errors.length > 0) { + return this.fail('创建入库单失败,失败原因:\n' + errors.join('\n')); + } + /* const order = await this.ctx.service.systems.deliveryOrder.tryCreatedeliveryOrder(data.request.deliveryOrder,this.appKey, this.storeId, this.warehouseId,totalOrderLines,"QM",this.customerId,this.warehouseCode); + console.log("入库单参数",order); + if(!order.success){ + return this.fail("创建入库单失败,失败原因:\n"+order.error); + } + const orderId = order.deliveryOrderId; + for (var i = 0; i < items.length; i++) { + const item = items[i]; + let res = await this.ctx.service.systems.deliveryOrder.addItems(item,orderId); + console.log("“添加商品返回信息",res); + if(!res.success){ + errors.push(`SKU${item.itemId}商品《${item.itemName}》编码《${item.itemCode}》入库失败,错误信息:${res.error}`); + } + } + if(errors.length>0){ + await app.model.deliveryOrder.delete(orderId);//失败删除; + return this.fail("创建入库单失败,失败原因:\n"+errors.join("\n")); + } + const lineCount = await this.ctx.service.systems.deliveryOrder.getLineCount(orderId);//获取接收行数 + if(lineCount==totalOrderLines){//所有行数接收完成 + await this.ctx.service.systems.deliveryOrder.received(orderId,this.warehouseId,this.storeId);//接收完成 + return this.success("入库单接收完毕",{deliveryOrderId:orderId}); + }*/ + return this.success('入库单接收中'); + } + async query(data) { + console.log(data); + return this.fail('接口未完善'); + } + +} +module.exports = stockoutServer; diff --git a/app/service/qimenMethods/taobao/qimen/service.js b/app/service/qimenMethods/taobao/qimen/service.js new file mode 100644 index 0000000..5721bec --- /dev/null +++ b/app/service/qimenMethods/taobao/qimen/service.js @@ -0,0 +1,15 @@ +'use strict'; + +const MainService = require(`${APP_ROOT}/app/service/main`); + +class serviceServer extends MainService { + async heartbeat(data) { + console.log(data); + if (data?.request?.serialNumber) { + return this.success(new Date().format(), { code: data.request.serialNumber }); + } + return this.fail(new Date().format(), { code: 0 }); + + } +} +module.exports = serviceServer; diff --git a/app/service/system.js b/app/service/system.js new file mode 100644 index 0000000..830f5b7 --- /dev/null +++ b/app/service/system.js @@ -0,0 +1,108 @@ +'use strict'; + +const Service = require('egg').Service; +const { XMLParser } = require('fast-xml-parser'); + +class systemService extends Service { + async callMethod(className, actionName, requestData, authHeader) { + try { + + + // 构建服务类路径 + const servicePath = `${className}`; + const classs = servicePath.split('.'); + let systemMethods = this.ctx.service.systemMethods; + for (let i = 0; i < classs.length; i++) { + const className = classs[i]; + systemMethods = systemMethods[className]; + } + // 检查服务是否存在 + if (!systemMethods) { + throw new Error(`服务 ${servicePath} 不存在`); + }else{ + console.log(`调用服务: ${servicePath}, 方法: ${actionName}`); + } + const serviceInstance = systemMethods; + + // 检查方法是否存在 + if (typeof serviceInstance[actionName] !== 'function') { + throw new Error(`方法 ${actionName} 不存在`); + } + const result = { + message: '', + status: 401, + }; + // 调用方法 + const authPass = await serviceInstance.checkAuth(servicePath, actionName, authHeader); + const isLog = authPass.isLog; + if (authPass.status == 200) { + result.data = await serviceInstance[actionName](requestData); + console.log(result.data); + result.status = 200; + + } else { + result.message = authPass.message; + result.status = authPass.status; + } + return { isLog, result }; + + } catch (error) { + throw error; + } + } + validateParams(params) { + const required = [ 'method', 'v', 'timestamp' ]; + + for (const field of required) { + if (!params[field]) { + return false; + } + } + + // 验证method格式 + if (typeof params.method !== 'string' || !params.method.includes('.')) { + return false; + } + + return true; + } + async saveLog(logData, startTime) { + const { + ctx, + } = this; + + try { + // 限制日志内容长度 + if (logData.body && logData.body.length > 65535) { + logData.body = logData.body.substring(0, 65535); + } + + if (logData.result && logData.result.length > 65535) { + logData.result = logData.result.substring(0, 65535); + } + + logData.use_time = Date.now() - startTime; + + // 使用 egg-mysql 保存日志到数据库 + const result = await ctx.app.mysql.get('wms').insert('wms_system_log', { + method: logData.method || '', + v: logData.v || '', + url: logData.url || '', + headers: logData.headers || '', + auth: logData.auth || '', + created_at: ctx.app.mysql.get('wms').literals.now, + body: logData.body || '', + result: logData.result || '', + use_time: logData.use_time || 0, + store_id: logData.store_id || null, + device: ctx.header.platform, + }); + return result; + } catch (error) { + ctx.logger.error('保存奇门接口日志失败: ' + error.message); + // 可以选择记录到文件日志作为备用 + ctx.logger.info('奇门接口日志数据: ', JSON.stringify(logData)); + } + } +} +module.exports = systemService; diff --git a/app/service/systemMethods/config.js b/app/service/systemMethods/config.js new file mode 100644 index 0000000..fd57921 --- /dev/null +++ b/app/service/systemMethods/config.js @@ -0,0 +1,25 @@ +'use strict'; + +const MainService = require('../main'); + +class configService extends MainService { + constructor(ctx) { + super(ctx); + const _noNeedLogin = ''; + const _noNeedRight = '*'; + this.systemInit(_noNeedLogin, _noNeedRight); + } + async list() { + const { + ctx, + app, + } = this; + const user = ctx.user; + const result = { + data: user, + code: 200, + }; + return result; + } +} +module.exports = configService; diff --git a/app/service/systemMethods/dashboard.js b/app/service/systemMethods/dashboard.js new file mode 100644 index 0000000..ddd612e --- /dev/null +++ b/app/service/systemMethods/dashboard.js @@ -0,0 +1,340 @@ +'use strict'; + +const MainService = require('../main'); + +class dashboardService extends MainService { + constructor(ctx) { + super(ctx); + const _noNeedLogin = ''; + const _noNeedRight = '*'; + const _noNeedLog = '*'; + this.systemInit(_noNeedLogin, _noNeedRight, _noNeedLog); + } + async storeStats() { + const data = { + code: 200, + message: '成功', + data: { + todayOrders: 13023, + orderTrend: 2, + + // 处理状态 + unassignedOrders: 15, // 未分配快递号 + unprintedOrders: 32, // 未打印 + unpickedOrders: 28, // 未拣货 + + // 发货相关 + pendingShipments: 6542, // 待发货 + shipmentProgress: 0, // 发货进度 + + // 出库相关 + todayOutbound: 6480, // 今日出库 + outboundRate: 49.77, // 出库完成率 + + // 异常订单 + interceptedOrders: 8, // 拦截订单 + exceptionOrders: 10, // 异常订单 + }, + }; + return this.success('ok', data); + } + async warehouseStats() { + const data = { + code: 200, + message: '成功', + data: { + todayOrders: 153023, // 今日订单数(基准) + orderTrend: 3, // 较昨日增长3% + + // 处理状态(按百分比计算) + unassignedOrders: 3060, // 未分配快递号(占2%) + unprintedOrders: 4591, // 未打印(占3%) + unpickedOrders: 7651, // 未拣货(占5%) + + // 发货相关 + pendingShipments: 45907, // 待发货(占30%) + shipmentProgress: 70, // 发货进度70% + + // 出库相关 + todayOutbound: 107116, // 今日出库(占70%) + outboundRate: 70, // 出库完成率70% + + // 异常订单(按比例) + interceptedOrders: 306, // 拦截订单(占0.2%) + exceptionOrders: 1530, // 异常订单(占1%) + }, + }; + return this.success('ok', data); + } + async hot_order_rank() { + const data = { + code: 200, + message: '成功', + data: [{ + id: 1, + name: '新***盒1', + sku: 'SKU202510081', + value: 51516, + trend: 18.5, + }, + { + id: 2, + name: '天***g', + sku: 'SKU202401002', + value: 43132, + trend: 12.3, + }, + { + id: 3, + name: '定****l', + sku: 'SKU202401003', + value: 39098, + trend: -2.5, + }, + { + id: 4, + name: '奥*****膜', + sku: 'SKU202401004', + value: 39087, + trend: 8.7, + }, + { + id: 5, + name: '美*****液', + sku: 'SKU202401005', + value: 25776, + trend: 15.2, + }, + { + id: 6, + name: '荣耀Magic6 Pro 1TB', + sku: 'SKU202401006', + value: 65, + trend: 5.4, + }, + { + id: 7, + name: '三星Galaxy S24 Ultra 512GB', + sku: 'SKU202401007', + value: 54, + trend: -3.8, + }, + { + id: 8, + name: '一加12 512GB', + sku: 'SKU202401008', + value: 43, + trend: 22.1, + }, + { + id: 9, + name: '真我GT5 Pro 1TB', + sku: 'SKU202401009', + value: 38, + trend: 9.6, + }, + { + id: 10, + name: '魅族21 Pro 512GB', + sku: 'SKU202401010', + value: 29, + trend: 4.2, + }, + ], + }; + return this.success('ok', data); + } + async express_ratio() { + const data = { + code: 200, + message: '成功', + data: [{ + name: '顺丰速运', + value: 50250, + itemStyle: { + color: '#409EFF', + }, + }, + { + name: '中通快递', + value: 34089, + itemStyle: { + color: '#67C23A', + }, + }, + { + name: '圆通速递', + value: 10567, + itemStyle: { + color: '#E6A23C', + }, + }, + { + name: '韵达快递', + value: 9023, + itemStyle: { + color: '#909399', + }, + }, + { + name: '申通快递', + value: 8089, + itemStyle: { + color: '#67023A', + }, + }, + { + name: '邮政EMS', + value: 4089, + itemStyle: { + color: '#97293A', + }, + }, + { + name: '京东物流', + value: 3023, + itemStyle: { + color: '#F56C6C', + }, + }, + { + name: '极兔速递', + value: 1089, + itemStyle: { + color: '#67913A', + }, + }, + { + name: '德邦快递', + value: 357, + itemStyle: { + color: '#9370DB', + }, + }, + { + name: '其他快递', + value: 5, + itemStyle: { + color: '#67313A', + }, + }, + ], + }; + + return this.success('ok', data); + } + async platform_distribution() { + const data = { + code: 200, + message: '成功', + data: [{ + name: '抖音', + value: 50250, + itemStyle: { + color: '#409EFF', + }, + }, + { + name: '拼多多', + value: 34089, + itemStyle: { + color: '#67C23A', + }, + }, + { + name: '小红书', + value: 8089, + itemStyle: { + color: '#67023A', + }, + }, + { + name: '淘宝', + value: 10567, + itemStyle: { + color: '#E6A23C', + }, + }, + { + name: '快手', + value: 9023, + itemStyle: { + color: '#909399', + }, + }, + { + name: '天猫', + value: 4089, + itemStyle: { + color: '#97293A', + }, + }, + { + name: '视频号', + value: 3023, + itemStyle: { + color: '#606399', + }, + }, + { + name: '阿里巴巴', + value: 1089, + itemStyle: { + color: '#67913A', + }, + }, + { + name: '其他', + value: 357, + itemStyle: { + color: '#9370DB', + }, + }, + { + name: 'TITOK', + value: 55, + itemStyle: { + color: '#17313A', + }, + }, + { + name: '京东', + value: 45, + itemStyle: { + color: '#F56C6C', + }, + }, + { + name: '德物', + value: 5, + itemStyle: { + color: '#67313A', + }, + }, + ], + }; + return this.success('ok', data); + } + async order_trend() { + const data = { + code: 200, + message: '成功', + data: { + range: 'day', + date: '2024-01-15', + summary: { + total_orders: 1256, + total_shipments: 892, + shipment_rate: 71.0, + peak_hour: '15:00', + peak_orders: 178, + }, + categories: [ '08:00', '09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00' ], + orders: [ 138, 84378, 102120, 129156, 153020, 153020, 153020, 153020, 153020, 153020 ], + shipments: [ 0, 30000, 60000, 70000, 86479, 86479, 86479, 86479, 86479, 86479 ], + }, + }; + return this.success('ok', data); + } +} +module.exports = dashboardService; diff --git a/app/service/systemMethods/index.js b/app/service/systemMethods/index.js new file mode 100644 index 0000000..50557c4 --- /dev/null +++ b/app/service/systemMethods/index.js @@ -0,0 +1,426 @@ +'use strict'; + +const MainService = require('../main'); + +class indexService extends MainService { + constructor(ctx) { + super(ctx); + const _noNeedLogin = 'getI18nMessage,putI18nCollect'; + const _noNeedRight = 'getI18nMessage,putI18nCollect,fastWhereTree,loadStores,getImages,getCOSUploadConfig,uploadSuccessNotify,getMessageDetail,searchSpace'; + const _noNeedLog = '*'; + const _noNeedAuth = 'getI18nMessage,putI18nCollect,fastWhereTree,loadStores,getImages,getMessageDetail,searchSpace'; + this.systemInit(_noNeedLogin, _noNeedRight, _noNeedLog, _noNeedAuth); + } + async fastWhereTree(data) { + const { service } = this; + const { type } = data; + const result = await service.systems.fastWhere.getTreeByType(type); + return this.success('ok', { presetTree: result, code: 200 }); + } + async loadStores(data) { + const { service } = this; + const result = await service.systems.store.loadStores(); + return this.success('ok', { stores: result, code: 200 }); + } + async getCOSUploadConfig(datas) { + const { service } = this; + const { data } = datas; + const result = await service.systems.upload.getUploadParams(data); + return this.success('ok', { data: result, code: 200 }); + } + async getImages(data) { + const { service } = this; + const result = await service.systems.file.getImages(data); + return this.success('ok', { data: result, code: 200 }); + } + async uploadSuccessNotify(data) { + const { service } = this; + const result = await service.systems.upload.uploadSuccessNotify(data); + return this.success('ok', { data: result, code: 200 }); + } + async ReferenceFile(data) { + const { service } = this; + const result = await service.systems.file.ReferenceFile(data); + return this.success('ok', { data: result, code: 200 }); + } + async getMessageDetail(data) { + const { service } = this; + const result = await service.systems.operationLog.getMessageDetail(data); + return this.success('ok', { data: result, code: 200 }); + } + + // app/controller/i18n.js 中 + async getI18nMessage(data) { + const { ctx } = this; + const { language = 'zh-CN' } = data || ctx.query; + + try { + // 1. 直接查询表数据看看 + const allTranslations = await ctx.model.I18nTranslation.findAll({ + limit: 5, + raw: true, + }); + console.log('📊 数据库翻译表数据(前5条):', allTranslations); + + const allKeys = await ctx.model.I18nKey.findAll({ + limit: 5, + raw: true, + }); + console.log('📊 数据库键值表数据(前5条):', allKeys); + + // 2. 检查关联查询 + const testQuery = await ctx.model.I18nTranslation.findAll({ + include: [{ + model: ctx.model.I18nKey, + as: 'key', + required: false, // LEFT JOIN + }], + limit: 5, + raw: false, + }); + + console.log('🔍 关联查询结果:', testQuery.length); + testQuery.forEach((item, index) => { + console.log(`结果${index + 1}:`, { + id: item.id, + language: item.language, + translation: item.translation, + hasKey: !!item.key, + keyName: item.key?.key_name, + }); + }); + + // 3. 按语言查询 + const languageQuery = await ctx.model.I18nTranslation.findAll({ + where: { language }, + include: [{ + model: ctx.model.I18nKey, + as: 'key', + }], + raw: false, + }); + + console.log(`🌍 语言 ${language} 的翻译数量:`, languageQuery.length); + + } catch (error) { + console.error('❌ 数据库查询错误:', error); + ctx.logger.error('数据库查询错误:', error); + } + try { + // 1. 查询当前项目的所有翻译(默认项目为 'wms') + const translations = await ctx.model.I18nTranslation.findAll({ + include: [{ + model: ctx.model.I18nKey, + as: 'key', + where: { + project: 'wms', + }, + attributes: [ 'key_name' ], + }], + where: { + language, + }, + }); + + // 2. 构建嵌套结构的翻译对象 + const result = {}; + translations.forEach(item => { + if (item.key && item.key.key_name) { + const keys = item.key.key_name.split('.'); + let current = result; + + // 构建嵌套路径 + for (let i = 0; i < keys.length - 1; i++) { + const key = keys[i]; + if (!current[key]) { + current[key] = {}; + } + current = current[key]; + } + + // 设置翻译值 + const lastKey = keys[keys.length - 1]; + current[lastKey] = item.translation || item.key.key_name; + } + }); + + // 3. 获取统计信息 + const totalKeys = await ctx.model.I18nKey.count({ + where: { project: 'wms' }, + }); + + const translatedCount = await ctx.model.I18nTranslation.count({ + include: [{ + model: ctx.model.I18nKey, + as: 'key', + where: { project: 'wms' }, + }], + where: { + language, + translation: { [ctx.app.Sequelize.Op.ne]: null }, // 非空 + }, + }); + + return this.success('ok', { + data: { + success: true, + messages: result, + stats: { + language, + total: totalKeys, + translated: translatedCount, + untranslated: totalKeys - translatedCount, + progress: totalKeys > 0 ? Math.round((translatedCount / totalKeys) * 100) : 0, + timestamp: new Date().toISOString(), + }, + }, + code: 200, + }); + + } catch (error) { + ctx.logger.error('获取翻译失败:', error); + // 失败时返回空结果 + return this.success('ok', { + data: { + success: true, + messages: {}, + stats: { + language, + total: 0, + translated: 0, + untranslated: 0, + progress: 0, + timestamp: new Date().toISOString(), + }, + }, + code: 200, + }); + } + } + async putI18nCollect(data) { + const { ctx } = this; + const { keys = [], locale = 'zh-CN', project = 'wms', source = 'frontend-auto' } = data || ctx.request.body; + + try { + const result = { + processed: 0, + createdKeys: 0, + createdTranslations: 0, + updatedKeys: 0, + details: [], + }; + + for (const keyData of keys) { + const { key, value, context, timestamp } = keyData; + + try { + // 1. 查找或创建键值记录 + let keyRecord = await ctx.model.I18nKey.findOne({ + where: { key_name: key, project }, + }); + + let keyAction = 'exists'; + + if (!keyRecord) { + // 创建新键值 + keyRecord = await ctx.model.I18nKey.create({ + key_name: key, + project, + module: this.extractModule(key), + description: context ? JSON.stringify(context) : null, + status: 1, + created_by: source, + }); + keyAction = 'created'; + result.createdKeys++; + } else { + // 更新使用次数(可以添加一个 usage_count 字段) + keyRecord.updated_at = new Date(); + await keyRecord.save(); + keyAction = 'updated'; + result.updatedKeys++; + } + + // 2. 创建或更新翻译记录 + let translation = await ctx.model.I18nTranslation.findOne({ + where: { key_id: keyRecord.id, language: locale }, + }); + + if (!translation) { + // 创建翻译记录(默认未翻译) + translation = await ctx.model.I18nTranslation.create({ + key_id: keyRecord.id, + language: locale, + translation: value || null, // 如果有值就保存,否则null + translation_status: value ? 1 : 0, // 有值设为待审核,没有就是未翻译 + auto_generated: source.includes('auto') ? 1 : 0, + translator: source, + created_at: new Date(timestamp || Date.now()), + }); + result.createdTranslations++; + } else if (value && !translation.translation) { + // 如果已有记录但没有翻译,现在有值了就更新 + translation.translation = value; + translation.translation_status = 1; // 设为待审核 + translation.updated_at = new Date(); + await translation.save(); + } + + result.details.push({ + key, + keyId: keyRecord.id, + keyAction, + translationExists: !!translation, + translationValue: translation?.translation || null, + }); + + } catch (error) { + ctx.logger.error(`处理键值 ${key} 失败:`, error); + result.details.push({ + key, + error: error.message, + success: false, + }); + } + } + + result.processed = keys.length; + + // 3. 尝试自动翻译(可选) + if (result.createdTranslations > 0) { + await this.tryAutoTranslateNewKeys(project, locale); + } + + return this.success('ok', { + data: { + success: true, + processed: result.processed, + stats: { + totalKeys: await ctx.model.I18nKey.count({ where: { project } }), + totalTranslations: await ctx.model.I18nTranslation.count({ + include: [{ + model: ctx.model.I18nKey, + as: 'key', + where: { project }, + }], + where: { language: locale }, + }), + newKeys: result.createdKeys, + newTranslations: result.createdTranslations, + }, + details: result.details, + }, + code: 200, + }); + + } catch (error) { + ctx.logger.error('批量处理键值失败:', error); + return this.success('ok', { + data: { + success: false, + error: error.message, + processed: 0, + }, + code: 500, + }); + } + } + + /** + * 从键名提取模块 + * @param keyName + */ + extractModule(keyName) { + if (!keyName) return 'common'; + + const parts = keyName.split('.'); + if (parts.length > 1) { + const possibleModules = [ 'warehouse', 'inventory', 'order', 'shipment', 'user', 'system', 'common' ]; + if (possibleModules.includes(parts[0])) { + return parts[0]; + } + } + + return 'common'; + } + + /** + * 尝试自动翻译新键值(可选功能) + * @param project + * @param targetLanguage + */ + async tryAutoTranslateNewKeys(project, targetLanguage) { + const { ctx } = this; + + // 只有目标语言不是中文时才需要翻译 + if (targetLanguage === 'zh-CN') return; + + try { + // 查找需要翻译的记录(中文有翻译,但目标语言没有) + const needTranslate = await ctx.model.I18nTranslation.findAll({ + include: [{ + model: ctx.model.I18nKey, + as: 'key', + where: { project }, + }], + where: { + language: 'zh-CN', + translation: { [ctx.app.Sequelize.Op.ne]: null }, + }, + }); + + const chineseTranslations = {}; + needTranslate.forEach(item => { + if (item.key) { + chineseTranslations[item.key.id] = item.translation; + } + }); + + // 检查目标语言是否已有翻译 + const existingTranslations = await ctx.model.I18nTranslation.findAll({ + where: { + key_id: Object.keys(chineseTranslations).map(id => parseInt(id)), + language: targetLanguage, + translation: { [ctx.app.Sequelize.Op.ne]: null }, + }, + }); + + const existingKeyIds = new Set(existingTranslations.map(t => t.key_id)); + + // 批量创建未翻译的记录 + const createPromises = []; + for (const [ keyId, chineseText ] of Object.entries(chineseTranslations)) { + if (!existingKeyIds.has(parseInt(keyId))) { + createPromises.push( + ctx.model.I18nTranslation.create({ + key_id: parseInt(keyId), + language: targetLanguage, + translation: null, // 这里可以调用翻译API自动填充 + translation_status: 0, + auto_generated: 1, + translator: 'auto-translate', + }) + ); + } + } + + if (createPromises.length > 0) { + await Promise.all(createPromises); + ctx.logger.info(`为 ${createPromises.length} 个键值创建了 ${targetLanguage} 的翻译占位`); + } + + } catch (error) { + ctx.logger.error('自动翻译处理失败:', error); + } + } + async searchSpace(data) { + const { service } = this; + const result = await service.systems.space.searchSpace(data); + return this.success('ok', result); + } + async getExpressList(data){ + + return this.success('ok', { data: this.app.config.expressList, code: 200 }); + } +} +module.exports = indexService; diff --git a/app/service/systemMethods/print.js b/app/service/systemMethods/print.js new file mode 100644 index 0000000..f7d7f3e --- /dev/null +++ b/app/service/systemMethods/print.js @@ -0,0 +1,432 @@ +'use strict'; + +const { up } = require('../../../database/migrations/20251109160640-init-wms_account'); +// 打印相关 Service +const MainService = require('../main'); + +/** + * 打印 Service + * 参考 indexService 初始化方式,后续可扩展具体业务函数 + */ +class PrintService extends MainService { + constructor(ctx) { + super(ctx); + // 初始化免登录、免权限、免日志、免认证等配置 + const _noNeedLogin = ''; + const _noNeedRight = '*'; + const _noNeedLog = ''; + const _noNeedAuth = '*'; + this.systemInit(_noNeedLogin, _noNeedRight, _noNeedLog, _noNeedAuth); + this.defaultComponents = [ + { name: '抖音', port: '13888' }, + { name: '拼多多', port: '5000' }, + { name: '快手', port: '16888/ks/printer' }, + { name: '京东', port: '9113' }, + { name: '菜鸟', port: '13528' }, + { name: '视频号', port: '12705' }, + { name: '小红书', port: '10818' }, + { name: 'LODOP', port: '8000' } + ]; + + } + async send(_data) { + const { ctx } = this; + const warehouseId = ctx.user.store_id; + const { printer, type, template, data, computerId, timestamp, count } = _data; + console.log('send to computer', warehouseId, printer, type, template, data, computerId, timestamp, count); + //生成打印编号并记录到数据库 + const printRecord = await ctx.model.PrintRecord.create({ + warehouse_id: warehouseId, + computer_id: computerId, + printer, + type, + data: { template, data }, + status: 'pending' + }); + //处理后的数据 + let processedData = {}; + switch (type) { + case "customize": + const { page_width, page_height, template_content } = template; + let htm = ``; + for (const item of template_content) { + let content = item.content; + + for(const key in data) { + console.log("正在匹配字段:", key, "与", item.field_code); + if(item.field_code == key) { + content = data[key]; + } + } + console.log("转后的内容:", content); + switch (item.type) { + case "text": + htm += `
${content}
`; + break; + case "image": + htm += ``; + break; + case "barcode": + htm += `
`; + break; + case "qrcode": + let toUrl = `https://ye4s.wms.gztbyc.com/to/${content}`; + //转换成urlencode + toUrl = encodeURIComponent(toUrl); + let url = `https://ye4s.wms.gztbyc.com/qrcode/build?text=${toUrl}`; + + + htm += `
`; + break; + case "line": + htm += `
`; + break; + case "rectangle": + htm += `
`; + break; + case "table": + let tableHtml = ``; + for (let i = 0; i < item.rows; i++) { + tableHtml += ``; + for (let j = 0; j < item.columns; j++) { + let content = item.content[i] && item.content[i][j] ? item.content[i][j] : ''; + tableHtml += ``; + } tableHtml += ``; + } tableHtml += `
${content}
`; + htm += tableHtml; + break; + } + } + htm += ``; + processedData = { + pageWidth: page_width, + pageHeight: page_height, + htm: htm, + lodopkey:["","13528A153BAEE3A0254B9507DCDE2839","EDE92F75B6A3D917F65910","D60BC84D7CF2DE18156A6F88987304CB6D8"] + } + break; + case "express": + break; + default: + return this.fail('不支持的打印类型', 1001); + } + + const printData = { + printer, + type, + template, + data: processedData, + timestamp, + count, + printId: printRecord.id + }; + const res = await this.service.systems.print.index.sendToComputer({warehouse:warehouseId, computerId: computerId, data:printData}); + console.log('sendToComputer response', res); + //发送成功后更新打印记录状态 + if (res.status=="success") { + await printRecord.update({ status: 'sent' }); + return this.success('发送打印任务成功', { code: 200, printId: printRecord.id }); + } else { + await printRecord.update({ status: 'failed', error_message: res.error }); + return this.fail(res.error, { code: 504, printId: printRecord.id }); + } + } + async getPrintResult(data) { + const { ctx } = this; + const warehouseId = ctx.user.store_id; + const { printId } = data; + if (!printId) return this.fail('参数错误', 1001); + const record = await ctx.model.PrintRecord.findOne({ where: { id: printId, warehouse_id: warehouseId }, raw: true }); + if (!record) return this.fail('打印记录不存在', 1002); + return this.success('success', { ...record, code: 0 }); + } + async getPrintRecordItem(data) { + const { ctx } = this; + const warehouseId = ctx.user.store_id; + const { id } = data; + if (!id) return this.fail('参数错误', 1001); + const item = await ctx.model.PrintRecord.findOne({ where: { id, warehouse_id: warehouseId }, raw: true }); + if (!item) return this.fail('打印记录不存在', 1002); + return this.success('success', { ...item, code: 0 }); + } + /** + * 1. 查询打印台列表 + * @param {Object} data { page, pageSize, where } + */ + async getList(data) { + const { ctx } = this; + console.log("ctx.user in PrintService constructor", ctx.user); + const warehouse_id = ctx.user.store_id; + // TODO: 需根据实际分页和条件查询调整 + const { page = 1, pageSize = 20, where = {} } = data; + // 字段过滤 + const filter = {}; + ['id', 'name', 'computer_id', 'custom_barcode'].forEach(key => { + if (where[key]) filter[key] = where[key]; + }); + filter.warehouse_id = warehouse_id; + filter.deleted = 0; + // 查询总数 + console.log("ctx.model.PrintStations", ctx.model.PrintStations); + const total = await ctx.model.PrintStations.count({ where: filter }); + // 查询分页数据 + const list = await ctx.model.PrintStations.findAll({ + where: filter, + offset: (page - 1) * pageSize, + limit: pageSize, + order: [['create_at', 'DESC']], + raw: true, + }); + let computers = list.map(item => { + const computer = { + id: item.computer_id, + is_online: 0, + components: this.defaultComponents.map(component => ({ + name: component.name, + is_online: 0, + })) + }; + return computer; + }); + // 动态属性处理(如 is_online、components) + for (let i = 0; i < computers.length; i++) { + let key = `warehouse:${warehouse_id}:printer:${computers[i].id}`; + const computerInfo = await this.app.redis.get("printer").get(key); + console.log("key and computerInfo", key, computerInfo); + if (computerInfo) { + computers[i].is_online = 1; + computers[i].components = await Promise.all(computers[i].components.map(async component => { + const componentKey = `printer:${computers[i].id}:name:${component.name}:status`; + const componentInfo = await this.app.redis.get("printer").get(componentKey); + console.log("componentKey and componentInfo", componentKey, componentInfo); + if (componentInfo && componentInfo == "connected") { + component.is_online = 1; + } + return component; + })); + } + } + + for (const item of list) { + const computer = computers.find(c => c.id === item.computer_id); + item.is_online = computer ? computer.is_online : 0; + item.components = computer ? computer.components : this.defaultComponents.map(component => ({ + name: component.name, + is_online: 0, + })); + } + const result = { + code: 200, + data: { + list: list, + pagination: { + hasNext: page * pageSize < total, + hasPrevious: page > 1, + page: page, + pageSize: pageSize, + total: total, + totalPages: Math.ceil(total / pageSize), + }, + queryInfo: { + conditions: where, + hasBarcodeSearch: false, + sortField: 'id', + sortOrder: "DESC" + }, + summary: { + total_available: total, + total_items: pageSize, + total_locked: 0, + total_quantity: 0 + } + } + } + return this.success('success', result); + } + + /** + * 2. 获取单个打印台 + * @param {Object} data { id } + */ + async getItem(data) { + const { ctx } = this; + const { id } = data; + if (!id) return this.fail('参数错误', 1001); + const item = await ctx.model.PrintStations.findOne({ where: { id }, raw: true }); + if (!item) return this.fail('打印台不存在', 1002); + return this.success('success', { ...item, code: 0 }); + } + /** + * 3. 添加打印台 + * @param {Object} data { id, name, computer_id, custom_barcode } + */ + async add(data) { + const { ctx } = this; + const warehouse_id = ctx.user.store_id; + const { name, computer_id, custom_barcode } = data; + if (!name || !computer_id) return this.fail('参数错误', 1001); + const newItem = await ctx.model.PrintStations.create({ + warehouse_id, + name, + computer_id, + custom_barcode, + creator_id: ctx.user?.employees_id || '', + creator_name: ctx.user?.employees_name || '', + default_printer_name: data.default_printer_name || '', + create_at: new Date(), + update_at: new Date(), + deleted: 0, + }); + return this.success('添加打印台成功', { data: newItem, code: 0 }); + } + async hasName(data) { + const { ctx } = this; + const warehouse_id = ctx.user.store_id; + const { name, id } = data; + if (!name) return this.fail('参数错误', 1001); + const item = await ctx.model.PrintStations.findOne({ where: { name, warehouse_id, id: { [ctx.model.Sequelize.Op.ne]: id } }, raw: true }); + return this.success('success', { exists: !!item, code: 0 }); + } + /** + * 3. 修改打印台 + * @param {Object} data { id, name, computer_id, custom_barcode } + */ + async updateItem(data) { + const { ctx } = this; + const { id, name, computer_id, custom_barcode } = data; + if (!id) return this.fail('参数错误', 1001); + const item = await ctx.model.PrintStations.findOne({ where: { id } }); + if (!item) return this.fail('打印台不存在', 1002); + // 只更新允许字段 + if (name !== undefined) item.name = name; + if (computer_id !== undefined) item.computer_id = computer_id; + if (custom_barcode !== undefined) item.custom_barcode = custom_barcode; + await item.save(); + return this.success('success', { data: null, code: 0 }); + } + + /** + * 4. 删除打印台 + * @param {Object} data { ids } + */ + async del(data) { + const { ctx } = this; + const { ids } = data; + if (!Array.isArray(ids) || ids.length === 0) return this.fail('参数错误', 1001); + // 软删除 + const result = await ctx.model.PrintStations.update({ deleted: 1 }, { where: { id: ids } }); + // TODO: 检查 result 是否成功 + return this.success('success', { data: null, code: 0 }); + } + + /** + * 5. 获取打印电脑列表 + * @param {Object} data {} + */ + async getComputer() { + const { ctx } = this; + // TODO: 打印电脑状态需根据实际业务实现 + const warehouseId = ctx.user.store_id; + const list = await ctx.model.PrintComputer.findAll({ raw: true, where: { status: 1, warehouse_id: warehouseId } }); + + return this.success('success', { data: list, code: 0 }); + } + + /** + * 7. 获取打印电脑的所有打印机 + * @param {Object} data { id } + */ + async getComputerPrinter(data) { + const { ctx } = this; + const { id } = data; + if (!id) return this.fail('参数错误', 1001); + const printerListResult = await this.app.redis.get("printer").get(`printer:${id}:printerList`); + console.log("getComputerPrinter printerListResult", printerListResult); + const printerList = JSON.parse(printerListResult); + let printers = []; + if(!printerList ||!printerList.data || printerList.data.length === 0){ + printers = []; + } else { + printers = printerList.data; + } + return this.success('success', { data: printers, code: 0 }); + } + + /** + * 8. 保存打印台的快递-打印机绑定 + * @param {Object} data { default, express } + */ + async savePrinters(data) { + const { ctx } = this; + const { defaultPrinter, express } = data; + // express: [{ express_id, name }] + if (!defaultPrinter || !Array.isArray(express)) return this.fail('参数错误', 1001); + // TODO: 需根据打印台ID、快递ID等实际业务调整 + // 这里只做示例保存,实际应覆盖原有绑定 + // 1. 保存默认打印机 + // 2. 保存 express 打印机绑定 + // 3. 需用 PrintStationExpress model + // 示例:批量保存 + for (const item of express) { + await ctx.model.PrintStationExpress.upsert({ + print_station_id: data.print_station_id, // 需传入 + express_id: item.express_id, + express_name: item.name, + printer_name: item.name, + is_default: item.name === defaultPrinter ? 1 : 0, + creator_id: ctx.user?.id || '', + creator_name: ctx.user?.name || '', + create_at: new Date(), + update_at: new Date(), + deleted: 0, + }); + } + return this.success('success', { data: null, code: 0 }); + } +} + +module.exports = PrintService; diff --git a/app/service/systemMethods/printer/station.js b/app/service/systemMethods/printer/station.js new file mode 100644 index 0000000..04aaca9 --- /dev/null +++ b/app/service/systemMethods/printer/station.js @@ -0,0 +1,20 @@ +const MainService = require('../../main'); + +class StationService extends MainService { + constructor(ctx) { + super(ctx); + const _noNeedLogin = ''; + const _noNeedRight = 'list'; + const _noNeedLog = '*'; + const _noNeedAuth = 'list'; + this.systemInit(_noNeedLogin, _noNeedRight, _noNeedLog, _noNeedAuth); + } + + async list() { + // 返回结构与printTemplateService一致 + const result = []; + return this.success('ok', { presetTree: result, code: 200 }); + } +} + +module.exports = StationService; diff --git a/app/service/systemMethods/setting/printTemplate.js b/app/service/systemMethods/setting/printTemplate.js new file mode 100644 index 0000000..fa99777 --- /dev/null +++ b/app/service/systemMethods/setting/printTemplate.js @@ -0,0 +1,36 @@ +'use strict'; + +const MainService = require('../../main'); + +class printTemplateService extends MainService { + constructor(ctx) { + super(ctx); + const _noNeedLogin = ''; + const _noNeedRight = 'list,save,listTemplatesByType'; + const _noNeedLog = '*'; + const _noNeedAuth = 'list,save,listTemplatesByType'; + this.systemInit(_noNeedLogin, _noNeedRight, _noNeedLog, _noNeedAuth); + } + async list(data) { + const { service } = this; + const result = await service.systems.setting.printTemplate.getTree(); + return this.success('ok', { presetTree: result, code: 200 }); + } + async save(data) { + console.log('接收到保存请求:', data); + const { service } = this; + const result = await service.systems.setting.printTemplate.save(data); + return this.success('ok', result); + } + async listTemplatesByType(data) { + const { service } = this; + console.log('接收到根据业务类型查询模板请求:', data); + const { businessType } = data; + if(!businessType){ + throw new Error('缺少业务类型参数'); + } + const list = await service.systems.setting.printTemplate.listTemplatesByType(businessType); + return this.success('ok', { data: list, code: 200 }); + } +} +module.exports = printTemplateService; diff --git a/app/service/systemMethods/stock.js b/app/service/systemMethods/stock.js new file mode 100644 index 0000000..6473789 --- /dev/null +++ b/app/service/systemMethods/stock.js @@ -0,0 +1,361 @@ +'use strict'; + +const MainService = require('../main'); + +class indexService extends MainService { + constructor(ctx) { + super(ctx); + const _noNeedLogin = ''; + const _noNeedRight = 'fastWhereTree,stockWarehouse,getProhibitedType,getInfo,getBarcodes,getStoreStocks,queryStockLogs,getStockUnits,getUnitList,createUnit,checkItemCodeUnique,deleteUnit,createProhibited,deleteProhibited,search'; + const _noNeedLog = 'fastWhereTree,stockWarehouse,getProhibitedType,getInfo,getBarcodes,getStoreStocks,queryStockLogs,getStockUnits,checkItemCodeUnique,getUnitList,search'; + const _noNeedAuth = 'fastWhereTree,stockWarehouse,getProhibitedType,getInfo,getBarcodes,getStoreStocks,queryStockLogs,getStockUnits,checkItemCodeUnique,getUnitList,search'; + this.systemInit(_noNeedLogin, _noNeedRight, _noNeedLog, _noNeedAuth); + } + async stockWarehouse(data) { + const { service } = this; + const { pagination, where } = data; + console.log('where', where); + const result = await service.systems.stockStore.getWarehouseStock(where, pagination); + return this.success('ok', result); + } + async getProhibitedType() { + const { service } = this; + const result = await service.systems.stockStore.getProhibitedType(); + return this.success('ok', { data: result, code: 200 }); + } + async getInfo(data) { + const { service } = this; + const result = await service.systems.stockStore.getInfo(data); + return this.success('ok', { data: result, code: 200 }); + } + async saveWarehouseStock(data) { + const { service } = this; + const result = await service.systems.stockStore.saveWarehouseStock(data); + return this.success('ok', { data: result, code: 200 }); + } + + async createWarehouseStock(data) { + const { service } = this; + const result = await service.systems.stockStore.createWarehouseStock(data); + return this.success('ok', { data: result, code: 200 }); + } + async getBarcodes(data) { + const { service } = this; + const result = await service.systems.stockStore.getBarcodes(data); + return this.success('ok', { data: result, code: 200 }); + } + async saveWarehouseStockBarcode(data) { + const { service } = this; + const result = await service.systems.stockStore.saveWarehouseStockBarcode(data); + return this.success('ok', { data: result, code: 200 }); + } + async getStoreStocks(data) { + const { service } = this; + const result = await service.systems.stockStore.getStoreStocks(data); + return this.success('ok', { data: result, code: 200 }); + } + async bindItem(data) { + const { service } = this; + try { + const result = await service.systems.stockStore.bindItem(data); + return this.success('绑定成功', { data: result, code: 200 }); + } catch (e) { + return this.success(e.message, { code: 200 }); + } + } + async unbindItem(data) { + const { service } = this; + try { + const result = await service.systems.stockStore.unbindItem(data); + return this.success('解绑成功', { data: result, code: 200 }); + } catch (e) { + return this.success(e.message, { code: 200 }); + } + } + async checkItemCodeUnique(data) { + const { ctx, service } = this; + const { id, item_code, store_id } = data; + console.log(data); + try { + if (!item_code || !store_id) { + return this.fail('参数错误'); + } + const data = await service.systems.stockStore.checkItemCodeUnique(id, item_code, store_id, ctx.user.store_id); + return this.success('获取成功', { data, code: 200 }); + } catch (error) { + return this.fail(error.message); + } + } + async queryStockLogs(data) { + console.log('请求'); + const { ctx } = this; + try { + const { service } = this; + data.warehouseId = ctx.user.store_id; + const result = await service.systems.operationLog.queryStockLogs(data); + return this.success('ok', { data: result, code: 200 }); + } catch (e) { + console.log(e); + return this.success(e.message, { code: 200 }); + } + } + + async handleBatchDelete(data) { + const { service } = this; + try { + const result = await service.systems.stockStore.handleBatchDelete(data); + return this.success(result.message, { data: result.data, code: result.code }); + } catch (e) { + console.log(e); + return this.success(e.message, { code: 200 }); + } + } + + async deleteUnit(data) { + const { service } = this; + try { + const result = await service.systems.stockStore.deleteUnit(data); + return this.success(result.message, { data: result.data, code: result.code }); + } catch (e) { + console.log(e); + return this.success(e.message, { code: 200 }); + } + } + + async deleteProhibited(data) { + const { service } = this; + try { + const result = await service.systems.stockStore.deleteProhibited(data); + return this.success(result.message, { data: result.data, code: result.code }); + } catch (e) { + console.log(e); + return this.success(e.message, { code: 200 }); + } + } + async handleBatchChange(data) { + const { service } = this; + try { + const result = await service.systems.stockStore.handleBatchChange(data); + return this.success(result.message, { data: result.data, code: result.code }); + } catch (e) { + console.log(e); + return this.success(e.message, { code: 405 }); + } + } + async getStockUnits() { + console.log('query_getStockUnits'); + const { ctx } = this; + const warehouse_id = ctx.user.store_id; + + try { + // 构建查询条件 + const where = { + [ctx.app.Sequelize.Op.or]: [ + { warehouse_id: null }, // 系统预设单位 + { warehouse_id }, // 本仓库的单位 + ], + }; + + const units = await ctx.model.StockUnit.findAll({ + where, + order: [ + [ 'warehouse_id', 'ASC' ], // 先显示系统预设单位(warehouse_id为null) + [ 'created_at', 'DESC' ], // 按创建时间倒序 + ], + }); + return this.success('ok', { data: units, code: 200 }); + } catch (error) { + console.log(error); + return this.fail(error.message); + } + } + async getUnitList() { + console.log('query_getUnitList'); + const { ctx } = this; + const warehouse_id = ctx.user.store_id; + + try { + // 构建查询条件 + const where = { + warehouse_id, + }; + + const units = await ctx.model.StockUnit.findAll({ + where, + order: [ + [ 'warehouse_id', 'ASC' ], // 先显示系统预设单位(warehouse_id为null) + [ 'created_at', 'DESC' ], // 按创建时间倒序 + ], + }); + return this.success('ok', { data: units, code: 200 }); + } catch (error) { + console.log(error); + return this.fail(error.message); + } + } + async createProhibited(data) { + console.log('createProhibited', data); + const { ctx } = this; + const warehouse_id = ctx.user.store_id || null; + const { name } = data; + + // 参数验证 + if (!name || name.trim() === '') { + ctx.body = { + code: 400, + message: '违禁品类型名称不能为空', + }; + return; + } + + const trimmedName = name.trim(); + + try { + // 1. 检查是否是系统预设单位(warehouse_id为null) + const systemUnit = await ctx.model.ProhibitedType.findOne({ + where: { + type_name: trimmedName, + warehouse_id: null, + }, + }); + + if (systemUnit) { + ctx.body = { + code: 400, + message: '该违禁品类型是系统预设,不允许添加', + }; + return; + } + + // 2. 检查当前仓库是否已存在相同名称的单位 + const existUnit = await ctx.model.ProhibitedType.findOne({ + where: { + type_name: trimmedName, + warehouse_id, + }, + }); + + if (existUnit) { + ctx.body = { + code: 400, + message: '该违禁品类型名称已存在', + }; + return; + } + + // 3. 创建单位 + const unit = await ctx.model.ProhibitedType.create({ + type_name: trimmedName, + warehouse_id, + }); + + // 4. 获取更新后的单位列表 + const where = {}; + if (warehouse_id) { + where[ctx.app.Sequelize.Op.or] = [ + { warehouse_id: null }, // 系统预设单位 + { warehouse_id }, // 当前仓库的单位 + ]; + } else { + where.warehouse_id = null; // 只显示系统预设单位 + } + + const units = await ctx.model.ProhibitedType.findAll({ + where, + order: [ + [ 'warehouse_id', 'ASC' ], // 先显示系统预设单位(warehouse_id为null) + [ 'created_at', 'DESC' ], // 按创建时间倒序 + ], + }); + return this.success('添加成功', { code: 200 }); + } catch (error) { + console.log(error); + return this.success('创建违禁品类型失败', { code: 405 }); + } + } + async createUnit() { + const { ctx } = this; + const warehouse_id = ctx.user.store_id || null; + const { name } = ctx.request.body; + + // 参数验证 + if (!name || name.trim() === '') { + ctx.body = { + code: 400, + message: '单位名称不能为空', + }; + return; + } + + const trimmedName = name.trim(); + + try { + // 1. 检查是否是系统预设单位(warehouse_id为null) + const systemUnit = await ctx.model.StockUnit.findOne({ + where: { + name: trimmedName, + warehouse_id: null, + }, + }); + + if (systemUnit) { + ctx.body = { + code: 400, + message: '该单位是系统预设单位,不允许添加', + }; + return; + } + + // 2. 检查当前仓库是否已存在相同名称的单位 + const existUnit = await ctx.model.StockUnit.findOne({ + where: { + name: trimmedName, + warehouse_id, + }, + }); + + if (existUnit) { + ctx.body = { + code: 400, + message: '该单位名称已存在', + }; + return; + } + + // 3. 创建单位 + const unit = await ctx.model.StockUnit.create({ + name: trimmedName, + warehouse_id, + }); + + // 4. 获取更新后的单位列表 + const where = {}; + if (warehouse_id) { + where[ctx.app.Sequelize.Op.or] = [ + { warehouse_id: null }, // 系统预设单位 + { warehouse_id }, // 当前仓库的单位 + ]; + } else { + where.warehouse_id = null; // 只显示系统预设单位 + } + + const units = await ctx.model.StockUnit.findAll({ + where, + order: [ + [ 'warehouse_id', 'ASC' ], // 先显示系统预设单位(warehouse_id为null) + [ 'created_at', 'DESC' ], // 按创建时间倒序 + ], + }); + return this.success('添加成功', { code: 200 }); + } catch (error) { + return this.success('创建库存单位失败', { code: 200 }); + } + } + + async search(data) { + const { service } = this; + const result = await service.systems.stockStore.search(data); + return this.success('ok', result); + } +} +module.exports = indexService; diff --git a/app/service/systemMethods/storage/receiving.js b/app/service/systemMethods/storage/receiving.js new file mode 100644 index 0000000..08ba957 --- /dev/null +++ b/app/service/systemMethods/storage/receiving.js @@ -0,0 +1,75 @@ +'use strict'; + +const MainService = require('../../main'); + +class configService extends MainService { + constructor(ctx) { + super(ctx); + const _noNeedLogin = ''; + const _noNeedRight = 'getReceivingList,get,addDetail,deleteDetail,detailChange,cancel,completeReceiving'; + const _noNeedLog = 'getReceivingList,get,addDetail,deleteDetail,detailChange'; + const _noNeedAuth = 'getReceivingList,get,addDetail,deleteDetail,detailChange,cancel,completeReceiving'; + this.systemInit(_noNeedLogin, _noNeedRight, _noNeedLog, _noNeedAuth); + } + async getReceivingList(data) { + const { service } = this; + const { pagination, where } = data; + console.log('where', where); + console.log('service.systems.storage.receiving', service.systems.storage.index.index); + const result = await service.systems.storage.receiving.getReceivingList(where, pagination); + return this.success('ok', result); + } + async create(data) { + const { service } = this; + const result = await service.systems.storage.receiving.create(data); + return this.success('创建失败', result); + } + async addItem(data) { + const { service } = this; + const { id, item } = data; + const result = await service.systems.storage.receiving.addItem(id, item); + return this.success('ok', result); + } + async removeItem(data) { + const { service } = this; + const { id, item_id } = data; + const result = await service.systems.storage.receiving.removeItem(id, item_id); + return this.success('ok', result); + } + async saveReceiving(data) { + const { service } = this; + const result = await service.systems.storage.receiving.saveReceiving(data); + return this.success('ok', result); + } + async get(data) { + const { service } = this; + const result = await service.systems.storage.receiving.get(data); + return this.success('ok', result); + } + async addDetail(data) { + const { service } = this; + const result = await service.systems.storage.receiving.addDetail(data); + return this.success('ok', result); + } + async deleteDetail(data) { + const { service } = this; + const result = await service.systems.storage.receiving.deleteDetail(data); + return this.success('ok', result); + } + async detailChange(data) { + const { service } = this; + const result = await service.systems.storage.receiving.detailChange(data); + return this.success('ok', result); + } + async cancel(data) { + const { service } = this; + const result = await service.systems.storage.receiving.invalid(data); + return this.success('ok', result); + } + async completeReceiving(data) { + const { service } = this; + const result = await service.systems.storage.receiving.completeReceiving(data); + return this.success('ok', result); + } +} +module.exports = configService; diff --git a/app/service/systemMethods/store.js b/app/service/systemMethods/store.js new file mode 100644 index 0000000..25b66ff --- /dev/null +++ b/app/service/systemMethods/store.js @@ -0,0 +1,50 @@ +'use strict'; + +const MainService = require('../main'); + +class storeService extends MainService { + constructor(ctx) { + super(ctx); + const _noNeedLogin = ''; + const _noNeedRight = 'createStore,createWarehouse,joinStore,joinWarehouse'; + const _noNeedAuth = '*'; + this.systemInit(_noNeedLogin, _noNeedRight, '', _noNeedAuth); + } + async createStore(data) { + const { service } = this; + const result = await service.systems.store.createStore(data); + return this.success('ok', result); + } + async createWarehouse(data) { + const { service } = this; + const result = await service.systems.store.createWarehouse(data); + return this.success('ok', result); + } + async joinStore(data) { + const { service } = this; + const result = await service.systems.store.joinStore(data); + return this.success('ok', result); + } + async joinWarehouse(data) { + const { service } = this; + const result = await service.systems.store.joinWarehouse(data); + return this.success('ok', result); + } + async getStoreRoles(data) { + const { service } = this; + const result = await service.systems.store.getStoreRoles(data); + return this.success('ok', result); + } + async getStoreRoles(data) { + const { service } = this; + const result = await service.systems.store.getStoreRoles(data); + return this.success('ok', result); + } + async auditApply(data) { + const { service } = this; + const result = await service.systems.store.auditApply(data); + return this.success('ok', result); + } + +} +module.exports = storeService; diff --git a/app/service/systemMethods/user.js b/app/service/systemMethods/user.js new file mode 100644 index 0000000..1a83b5d --- /dev/null +++ b/app/service/systemMethods/user.js @@ -0,0 +1,45 @@ +'use strict'; + +const MainService = require('../main'); + +class userService extends MainService { + constructor(ctx) { + super(ctx); + const _noNeedLogin = 'login,register'; + const _noNeedRight = '*'; + const _noNeedLog = 'info'; + const _noNeedAuth = '*'; + this.systemInit(_noNeedLogin, _noNeedRight, _noNeedLog, _noNeedAuth); + } + async login(data) { + const { service } = this; + const { username, password } = data; + const result = await service.systems.auth.user.login(username, password); + console.log('result', result); + if (result.code) { + return this.success('登录成功', result); + } + return this.fail('登录失败:' + result.message, result); + + } + async logout() { + return this.success('登出成功'); + } + async info(data) { + const { service } = this; + const result = await service.systems.auth.user.info(data); + return this.success('获取成功' + JSON.stringify(data), result); + } + async changeRole(data) { + const { service } = this; + const result = await service.systems.auth.user.changeRole(data); + return this.success('获取成功', result, 200); + } + //注册 + async register(data) { + const { service } = this; + const result = await service.systems.auth.user.register(data); + return this.success(result); + } +} +module.exports = userService; diff --git a/app/service/systemMethods/warehouse.js b/app/service/systemMethods/warehouse.js new file mode 100644 index 0000000..e053bb1 --- /dev/null +++ b/app/service/systemMethods/warehouse.js @@ -0,0 +1,463 @@ +'use strict'; + +const MainService = require('../main'); + +class warehouseService extends MainService { + constructor(ctx) { + super(ctx); + const _noNeedLogin = ''; + const _noNeedRight = 'detail,getSpacesByRack,createRackWithSpaces,getSpaceInfo,checkBarcodeUnique'; + const _noNeedLog = '*'; + const _noNeedAuth = 'detail,getSpacesByRack,getSpaceInfo,checkBarcodeUnique,getWarehouseZones,getWarehouseTree,getChildren,toggleActive,getPath,getPickPath,getAreaRacks'; + this.systemInit(_noNeedLogin, _noNeedRight, _noNeedLog, _noNeedAuth); + } + async getWarehouseZones() { + const { ctx, service } = this; + console.log('获取仓库主体下所有实体仓库'); + try { + const zones = await service.systems.locationZone.getWarehouseLevelZones(ctx.user.store_id); + return this.success('获取成功', { zones, code: 200 }); + } catch (error) { + console.log(error); + return this.fail('获取失败' + error.message, { code: 0 }); + } + } + + /** + * 获取仓库树状结构 + * @param data + */ + async getWarehouseTree(data) { + const { ctx, service } = this; + const { warehouseId } = data; + + try { + if (!warehouseId) { + return this.fail('仓库ID不能为空'); + } + + const tree = await service.systems.locationZone.getZoneTreeByWarehouse(parseInt(warehouseId)); + return this.success('获取成功', tree); + } catch (error) { + return this.fail(error.message); + } + } + + /** + * 获取子节点(懒加载) + * @param data + */ + async getChildren(data) { + const { ctx, service } = this; + const { zoneId } = data; + + try { + if (!zoneId) { + throw new Error('分区ID不能为空'); + } + + const children = await service.systems.locationZone.getChildrenByZoneId(parseInt(zoneId)); + ctx.success(children); + } catch (error) { + this.fail(error.message); + } + } + + /** + * 创建分区 + * @param data + */ + async create(data) { + const { ctx, service } = this; + + try { + const result = await service.systems.locationZone.createZone(data); + return this.success(result.message, { data: result.data, code: 200 }); + } catch (error) { + return this.fail(error.message); + } + } + + /** + * 更新分区 + * @param datas + */ + async update(datas) { + const { ctx, service } = this; + console.log('接收的数据', datas); + const { id } = datas; + const { length, width, height, zone_code, zone_name, x, y, z, direction, rack_columns, rack_levels, rack_rows, cell_width, cell_length, cell_height, aisles } = datas; + try { + if (!id) { + return this.fail('分区ID不能为空'); + } + + const result = await service.systems.locationZone.updateZone(parseInt(id), { length, width, height, zone_code, zone_name, x, y, z, direction, rack_columns, rack_levels, rack_rows, cell_width, cell_length, cell_height, aisles }); + return this.success(result.message, { data: result.data, code: 200 }); + } catch (error) { + return this.fail(error.message); + } + } + + /** + * 删除分区 + * @param data + */ + async delete(data) { + const { ctx, service } = this; + const { id } = data; + + try { + if (!id) { + return this.fail('分区ID不能为空'); + } + + const result = await service.systems.locationZone.deleteZone(parseInt(id)); + console.log('删除返回', result); + return this.success(result.message, { code: 200 }); + } catch (error) { + console.log('error', error); + return this.fail(error.message); + } + } + + /** + * 获取分区详情 + * @param data + */ + async detail(data) { + const { ctx, service } = this; + const { id } = data; + + try { + if (!id) { + return this.fail('分区ID不能为空'); + } + const zone = await service.systems.locationZone.getZoneDetail(parseInt(id)); + return this.success('获取成功', zone); + } catch (error) { + return this.fail(error.message); + } + } + async checkBarcodeUnique(data) { + const { ctx, service } = this; + const { id, barcode } = data; + console.log(data); + try { + if (!id) { + return this.fail('库位ID不能为空'); + } + if (!barcode) { + return this.fail('条码不能为空'); + } + const data = await service.systems.locationZone.checkBarcodeUnique(parseInt(id), barcode); + return this.success('获取成功', { data, code: 200 }); + } catch (error) { + return this.fail(error.message); + } + } + /** + * 切换分区状态 + * @param data + */ + async toggleActive(data) { + const { ctx, service } = this; + const { id, isActive } = data; + + try { + if (!id) { + throw new Error('分区ID不能为空'); + } + + const result = await service.systems.locationZone.toggleZoneActive( + parseInt(id), + isActive + ); + ctx.success(null, result.message); + } catch (error) { + this.fail(error.message); + } + } + + /** + * 获取分区路径 + * @param data + */ + async getPath(data) { + const { ctx, service } = this; + const { id } = data; + + try { + if (!id) { + throw new Error('分区ID不能为空'); + } + + const path = await service.systems.locationZone.getZonePath(parseInt(id)); + ctx.success(path); + } catch (error) { + this.fail(error.message); + } + } + async createRack() { + const { ctx } = this; + const params = ctx.request.body; + + // 验证参数 + ctx.validate({ + warehouse_id: { type: 'int', required: true }, + zone_code: { type: 'string', required: true }, + zone_name: { type: 'string', required: true }, + parent_id: { type: 'int', required: false }, + x: { type: 'int', required: true }, + y: { type: 'int', required: true }, + z: { type: 'int', required: false, default: 0 }, + length: { type: 'int', required: true }, + width: { type: 'int', required: true }, + height: { type: 'int', required: true }, + rack_columns: { type: 'int', required: true }, + rack_rows: { type: 'int', required: true }, + rack_levels: { type: 'int', required: true }, + direction: { type: 'enum', values: [ 'north', 'south', 'east', 'west' ], required: false }, + color: { type: 'string', required: false }, + }); + + try { + const rack = await ctx.service.location.createRackWithSpaces(params); + ctx.success(rack, '货架创建成功'); + } catch (error) { + this.fail(error.message, 400); + } + } + + /** + * 获取拣货路径 + */ + async getPickPath() { + const { ctx } = this; + const { warehouse_id } = ctx.query; + + if (!warehouse_id) { + this.fail('仓库ID不能为空', 400); + return; + } + + try { + const options = { + includeSpaces: ctx.query.include_spaces === 'true', + limit: parseInt(ctx.query.limit) || 50, + sortBy: ctx.query.sort_by || 'path_sequence', + }; + + const result = await ctx.service.location.getPickPath(warehouse_id, options); + ctx.success(result); + } catch (error) { + this.fail(error.message, 500); + } + } + + /** + * 更新货架位置 + */ + async updateRackPosition() { + const { ctx } = this; + const { rack_id } = ctx.params; + const { x, y, z } = ctx.request.body; + + ctx.validate({ + x: { type: 'int', required: true }, + y: { type: 'int', required: true }, + z: { type: 'int', required: false }, + }); + + try { + const rack = await ctx.service.location.updateRackPosition(rack_id, { x, y, z }); + ctx.success(rack, '货架位置更新成功'); + } catch (error) { + this.fail(error.message, error.status || 400); + } + } + + /** + * 重新计算拣货路径 + */ + async recalculatePickPath() { + const { ctx } = this; + const { warehouse_id } = ctx.request.body; + + if (!warehouse_id) { + this.fail('仓库ID不能为空', 400); + return; + } + + try { + await ctx.service.location._calculatePickPathForWarehouse(warehouse_id); + ctx.success(null, '拣货路径重新计算成功'); + } catch (error) { + this.fail(error.message, 500); + } + } + + /** + * 更新邻居关系 + */ + async updateNeighbors() { + const { ctx } = this; + const { warehouse_id } = ctx.request.body; + + if (!warehouse_id) { + this.fail('仓库ID不能为空', 400); + return; + } + + try { + await ctx.service.location.updateNeighborRelations(warehouse_id); + ctx.success(null, '邻居关系更新成功'); + } catch (error) { + this.fail(error.message, 500); + } + } + + /** + * 获取库区内的货架列表(按排序) + */ + async getAreaRacks() { + const { ctx } = this; + const { area_id } = ctx.query; + + if (!area_id) { + this.fail('库区ID不能为空', 400); + return; + } + + try { + const racks = await ctx.model.LocationZone.findAll({ + where: { + parent_id: area_id, + zone_type: 'rack', + is_active: true, + deleted_at: null, + }, + order: [[ 'path_sequence', 'ASC' ]], + include: [{ + model: ctx.model.LocationSpace, + as: 'spaces', + where: { + is_enabled: true, + deleted_at: null, + }, + required: false, + }], + }); + ctx.success(racks); + } catch (error) { + this.fail(error.message, 500); + } + } + async getSpacesByRack(data) { + const { ctx } = this; + const { id } = data; + if (!id) { + return this.fail('货架ID不能为空'); + } + try { + + const spaces = await ctx.model.LocationSpace.findAll({ + where: { + zone_id: id, + deleted_at: null, + }, + order: [[ 'pick_sequence', 'ASC' ]], + }); + return this.success('获取成功', { spaces, code: 200 }); + } catch (e) { + return this.fail(e.message, 500); + } + } + async createRackWithSpaces(data) { + const { ctx, app, service } = this; + const { id } = data; + if (!id) { + return this.fail('货架ID不能为空'); + } + const transaction = await ctx.model.transaction(); + try { + const rack = await ctx.model.LocationZone.findOne({ + where: { + id, + deleted_at: null, + }, + transaction, + }); + if (!rack) { + throw new Error('货架不存在'); + } + if (rack.zone_type != 'rack') { + throw new Error('仓库元素不为货架,拒绝生成仓位'); + } + const message = await service.systems.locationZone.generateSpacesForRack(id, rack, transaction); + await transaction.commit(); + return this.success(message, { code: 200 }); + } catch (e) { + console.log('创建错误', e); + await transaction.rollback(); + return this.fail(e.message, 500); + } + } + + async getSpaceInfo(data) { + const { ctx, service } = this; + const { id } = data; + try { + const data = await service.systems.locationZone.getSpaceInfo(id); + return this.success('获取成功', { data, code: 200 }); + } catch (error) { + console.log(error); + return this.fail('获取失败' + error.message, { code: 0 }); + } + } + + async updateSpaceInfo(data) { + const { ctx, app, service } = this; + console.log('修改的数据', data); + const { id } = data; + if (!id) { + return this.fail('仓位ID不能为空'); + } + const transaction = await ctx.model.transaction(); + try { + const space = await ctx.model.LocationSpace.findOne({ + where: { + id, + warehouse_id: ctx.user.store_id, + deleted_at: null, + }, + transaction, + }); + if (!space) { + throw new Error('仓位不存在'); + } + if (data.custom_barcode) { + const { isUnique } = await service.systems.locationZone.checkBarcodeUnique(parseInt(id), data.custom_barcode); + if (!isUnique) { + throw new Error('自定义条码已存在'); + } + } + const update_data = { + location_type_id: data.location_type_id || space.location_type_id, + custom_name: data.custom_name || null, + custom_barcode: data.custom_barcode || null, + space_status: data.space_status || space.space_status, + pick_sequence: data.pick_sequence || 0, + }; + + await space.update(update_data); + await transaction.commit(); + return this.success('保存成功', { code: 200 }); + } catch (e) { + await transaction.rollback(); + return this.fail('保存失败:' + e.message, { code: 500 }); + } + + } +} +module.exports = warehouseService; diff --git a/app/service/systems/account_platform.js b/app/service/systems/account_platform.js new file mode 100644 index 0000000..7f1af72 --- /dev/null +++ b/app/service/systems/account_platform.js @@ -0,0 +1,383 @@ +'use strict'; + +const Service = require('egg').Service; + +class AccountPlatformService extends Service { + /** + * 切换平台激活角色 + * @param {number} accountId - 账号ID + * @param {number} accountStoreRoleId - 账号仓库角色关联ID + * @param {string} platformCode - 平台编码 + * @return {Promise} + */ + async switchActiveRole(accountId, accountStoreRoleId, platformCode) { + const { ctx, app } = this; + + // 使用事务确保数据一致性 + const transaction = await ctx.model.transaction(); + + try { + // 1. 验证角色关联的有效性 + const accountStoreRole = await ctx.model.AccountStoreRole.findOne({ + where: { + id: accountStoreRoleId, + account_id: accountId, + status: 1, + }, + transaction, + }); + + if (!accountStoreRole) { + throw new Error('角色关联不存在或已失效'); + } + + // 2. 使用 upsert 切换激活角色 + const [ platformActive, created ] = await ctx.model.AccountPlatformActive.upsert({ + account_id: accountId, + account_store_role_id: accountStoreRoleId, + platform_code: platformCode, + }, { + transaction, + returning: true, + }); + + await transaction.commit(); + + // 3. 清理缓存 + await this.clearPlatformCache(accountId, platformCode); + + return { + success: true, + created, + data: platformActive, + }; + } catch (error) { + await transaction.rollback(); + + // 处理唯一约束冲突 + if (error.name === 'SequelizeUniqueConstraintError') { + // 如果是 account_store_role_id 和 platform_code 冲突,说明同一个平台不能关联到不同的账号 + if (error.errors && error.errors.some(e => e.path === 'uk_account_store_role_platform')) { + throw new Error('该角色已被其他账号在同一平台激活'); + } + throw new Error('平台激活状态更新失败,可能存在数据冲突'); + } + + throw error; + } + } + + /** + * 获取平台当前激活角色 + * @param {number} accountId - 账号ID + * @param {string} platformCode - 平台编码 + * @param {boolean} useCache - 是否使用缓存 + * @return {Promise} + */ + async getActiveRoleByPlatform(accountId, platformCode, useCache = true) { + const { ctx, app } = this; + + const cacheKey = `platform_active:${accountId}:${platformCode}`; + + // 尝试从缓存获取 + if (useCache) { + try { + const cached = await app.getCacheAsync(cacheKey); + if (cached) { + return cached; + } + } catch (error) { + console.warn('获取平台激活缓存失败:', error.message); + } + } + + // 查询数据库 + const platformActive = await ctx.model.AccountPlatformActive.findOne({ + where: { + account_id: accountId, + platform_code: platformCode, + }, + include: [ + { + model: ctx.model.AccountStoreRole, + as: 'accountStoreRole', + where: { status: 1 }, + required: true, + include: [ + { + model: ctx.model.Role, + as: 'role', + attributes: [ 'id', 'name', 'code', 'permissions' ], + }, + { + model: ctx.model.Store, + as: 'store', + attributes: [ 'id', 'name', 'code' ], + }, + ], + }, + ], + }); + + if (!platformActive) { + return null; + } + + // 整理返回数据 + const result = { + account_id: accountId, + platform_code: platformCode, + role_id: platformActive.accountStoreRole.role_id, + role_name: platformActive.accountStoreRole.role.name, + role_code: platformActive.accountStoreRole.role.code, + role_permissions: platformActive.accountStoreRole.role.permissions, + store_id: platformActive.accountStoreRole.store_id, + store_name: platformActive.accountStoreRole.store.name, + store_code: platformActive.accountStoreRole.store.code, + created_at: platformActive.created_at, + updated_at: platformActive.updated_at, + }; + + // 缓存结果 + if (useCache) { + try { + await app.setCacheAsync(cacheKey, result, 1800); // 缓存30分钟 + } catch (error) { + console.warn('缓存平台激活状态失败:', error.message); + } + } + + return result; + } + + /** + * 批量获取账号在多个平台的激活状态 + * @param {number} accountId - 账号ID + * @param {Array} platformCodes - 平台编码数组 + * @return {Promise} + */ + async getMultiplePlatformActiveRoles(accountId, platformCodes) { + const { ctx } = this; + + const platformActives = await ctx.model.AccountPlatformActive.findAll({ + where: { + account_id: accountId, + platform_code: platformCodes, + }, + include: [ + { + model: ctx.model.AccountStoreRole, + as: 'accountStoreRole', + where: { status: 1 }, + required: true, + include: [ + { + model: ctx.model.Role, + as: 'role', + attributes: [ 'id', 'name', 'code' ], + }, + { + model: ctx.model.Store, + as: 'store', + attributes: [ 'id', 'name', 'code' ], + }, + ], + }, + ], + }); + + // 转换为平台编码为key的对象 + const result = {}; + platformActives.forEach(active => { + result[active.platform_code] = { + role_id: active.accountStoreRole.role_id, + role_name: active.accountStoreRole.role.name, + role_code: active.accountStoreRole.role.code, + store_id: active.accountStoreRole.store_id, + store_name: active.accountStoreRole.store.name, + store_code: active.accountStoreRole.store.code, + created_at: active.created_at, + updated_at: active.updated_at, + }; + }); + + // 填充未设置的平台 + platformCodes.forEach(code => { + if (!result[code]) { + result[code] = null; + } + }); + + return result; + } + + /** + * 获取账号所有平台的激活状态 + * @param {number} accountId - 账号ID + * @return {Promise} + */ + async getAllPlatformActives(accountId) { + const { ctx } = this; + + const platformActives = await ctx.model.AccountPlatformActive.findAll({ + where: { account_id: accountId }, + include: [ + { + model: ctx.model.AccountStoreRole, + as: 'accountStoreRole', + where: { status: 1 }, + required: true, + include: [ + { + model: ctx.model.Role, + as: 'role', + attributes: [ 'id', 'name', 'code' ], + }, + { + model: ctx.model.Store, + as: 'store', + attributes: [ 'id', 'name', 'code' ], + }, + ], + }, + ], + order: [[ 'platform_code', 'ASC' ]], + }); + + return platformActives.map(active => ({ + platform_code: active.platform_code, + role_id: active.accountStoreRole.role_id, + role_name: active.accountStoreRole.role.name, + role_code: active.accountStoreRole.role.code, + store_id: active.accountStoreRole.store_id, + store_name: active.accountStoreRole.store.name, + store_code: active.accountStoreRole.store.code, + created_at: active.created_at, + updated_at: active.updated_at, + })); + } + + /** + * 清除平台激活状态 + * @param {number} accountId - 账号ID + * @param {string} platformCode - 平台编码 + * @return {Promise} + */ + async clearPlatformActive(accountId, platformCode) { + const { ctx, app } = this; + + try { + const result = await ctx.model.AccountPlatformActive.destroy({ + where: { + account_id: accountId, + platform_code: platformCode, + }, + }); + + // 清理缓存 + await this.clearPlatformCache(accountId, platformCode); + + return result > 0; + } catch (error) { + throw error; + } + } + + /** + * 清理平台缓存 + * @param accountId + * @param platformCode + * @private + */ + async clearPlatformCache(accountId, platformCode) { + const { app } = this; + const cacheKey = `platform_active:${accountId}:${platformCode}`; + + try { + await app.setCacheAsync(cacheKey, null, 0); + } catch (error) { + console.warn('清理平台缓存失败:', error.message); + } + } + + /** + * 获取账号可用的角色列表 + * @param {number} accountId - 账号ID + * @param {number} storeId - 仓库ID(可选) + * @return {Promise} + */ + async getAvailableRoles(accountId, storeId = null) { + const { ctx } = this; + + const where = { + account_id: accountId, + status: 1, + }; + + if (storeId) { + where.store_id = storeId; + } + + const accountStoreRoles = await ctx.model.AccountStoreRole.findAll({ + where, + include: [ + { + model: ctx.model.Role, + as: 'role', + attributes: [ 'id', 'name', 'code', 'description' ], + }, + { + model: ctx.model.Store, + as: 'store', + attributes: [ 'id', 'name', 'code' ], + }, + ], + order: [ + [ 'store_id', 'ASC' ], + [ 'role_id', 'ASC' ], + ], + }); + + return accountStoreRoles.map(item => ({ + id: item.id, + account_id: item.account_id, + store_id: item.store_id, + store_name: item.store.name, + store_code: item.store.code, + role_id: item.role_id, + role_name: item.role.name, + role_code: item.role.code, + role_description: item.role.description, + real_name: item.real_name, + created_at: item.created_at, + })); + } + + /** + * 根据平台获取账号的当前仓库和角色 + * @param {number} accountId - 账号ID + * @param {string} platformCode - 平台编码 + * @return {Promise} + */ + async getCurrentContext(accountId, platformCode) { + const activeRole = await this.getActiveRoleByPlatform(accountId, platformCode); + + if (!activeRole) { + return null; + } + + return { + account_id: accountId, + store_id: activeRole.store_id, + store_name: activeRole.store_name, + store_code: activeRole.store_code, + role_id: activeRole.role_id, + role_name: activeRole.role_name, + role_code: activeRole.role_code, + permissions: activeRole.role_permissions, + platform_code: platformCode, + }; + } +} + +module.exports = AccountPlatformService; diff --git a/app/service/systems/auth/user.js b/app/service/systems/auth/user.js new file mode 100644 index 0000000..0d217ac --- /dev/null +++ b/app/service/systems/auth/user.js @@ -0,0 +1,930 @@ +'use strict'; + +const Service = require('egg').Service; + +class UserService extends Service { + constructor(ctx) { + super(ctx); + } + + /** + * 用户登录(重构版) + * @param {string} username - 用户名/手机号/邮箱 + * @param {string} password - 密码 + * @param {string} loginType - 登录类型: username, phone, email, auto + * @param {string} platformCode - 平台编码(web、pda、mini等) + * @return {Object} 登录结果 + */ + async login(username, password, loginType = 'auto') { + const { ctx, app } = this; + + try { + // 统一的认证错误信息 + const authError = new Error('用户名或密码错误或账号状态异常'); + authError.code = 'AUTH_FAILED'; + + // 1. 查找用户 + const user = await this.findUserByIdentifier(username, loginType); + if (!user) { + app.coreLogger.warn(`登录失败: 用户不存在 [${username}]`); + throw authError; + } + console.log('登录获取用户信息', user); + // 2. 检查用户状态 + try { + this.checkUserStatus(user); + } catch (statusError) { + app.coreLogger.warn(`登录失败: 用户状态异常 [${user.id}] - ${statusError.message}`); + throw authError; + } + + // 3. 验证密码 + const isPasswordValid = await user.verifyPassword(password); + if (!isPasswordValid) { + app.coreLogger.warn(`登录失败: 密码错误 [${user.id}]`); + throw authError; + } + + // 4. 更新最后登录时间 + await this.updateLastLoginTime(user.id); + + // 5. 设置设备类型(用于菜单查询) + const platformCode = ctx.header.platform || 'web'; + // 6. 获取用户完整信息 + const userInfo = await this.findById(user.id); + console.log('用户信息', userInfo); + // 7. 如果用户有角色但当前平台没有激活角色,则自动设置一个 + if (userInfo.roles && userInfo.roles.length > 0 && !userInfo.role_id) { + await this.ensurePlatformActiveRole(user.id, userInfo.roles[0].id, platformCode); + } + + // 8. 生成 JWT Token + const tokenPayload = { + id: user.id, + username: user.username, + real_name: user.real_name, + platform_code: platformCode, + current_role_id: userInfo.employees_id, + current_store_id: userInfo.store_id || null, + }; + + const token = app.jwt.sign(tokenPayload, app.config.jwt.secret, { + expiresIn: app.config.jwt.expiresIn, + }); + + return { + success: true, + data: { + user: { + id: user.id, + username: user.username, + real_name: user.real_name, + phone: user.phone, + email: user.email, + status: user.status, + last_login_at: user.last_login_at, + roles: userInfo.roles, + role_id: userInfo.role_id, + menus: userInfo.menus, + permissions: userInfo.permissions, + userRole: userInfo.userRole, + realName: userInfo.realName, + }, + token, + }, + code: 200, + message: '登录成功', + }; + + } catch (error) { + app.coreLogger.error(`登录异常: ${error.message}`); + + return { + success: false, + data: null, + code: 0, + message: '用户名或密码错误或账号状态异常', + }; + } + } + + /** + * 切换角色(重构版) + * @param {Object} data - 切换角色数据 + * @param {number} data.roleId - 角色关联ID (account_store_role.id) + * @param {string} data.platformCode - 平台编码(web、pda、mini等) + * @return {Object} 切换结果 + */ + async changeRole(data) { + const { ctx, app } = this; + const user = ctx.state.user || ctx.user; + try { + // 验证角色关联是否存在且有效 + const accountStoreRole = await ctx.model.AccountStoreEmployee.findOne({ + where: { + id: data.roleId, + account_id: user.id, + status: 1, + }, + include: [ + { + model: ctx.model.EmployeeRole, + as: 'employeeRole', + }, + ], + }); + + if (!accountStoreRole) { + throw new Error('角色不存在或未授权'); + } + + const platformCode = ctx.header.platform || 'web'; + + // 更新平台激活角色 + await ctx.model.AccountPlatformActive.upsert({ + account_id: user.id, + employee_id: data.roleId, + platform_code: platformCode, + }); + + // 清理缓存 + await this.clearUserCache(user.id); + + // 获取更新后的用户信息 + const userInfo = await this.findById(user.id); + + const tokenPayload = { + id: user.id, + username: user.username, + real_name: user.real_name, + platform_code: platformCode, + current_role_id: userInfo.employees_id, + current_store_id: accountStoreRole.store_id || null, + }; + const newToken = app.jwt.sign(tokenPayload, app.config.jwt.secret, { + expiresIn: app.config.jwt.expiresIn, + }); + + return { + success: true, + data: { + user: userInfo, + token: newToken, + }, + code: 200, + message: '角色切换成功', + }; + + } catch (error) { + app.coreLogger.error(`切换角色失败: ${error.message}`); + + return { + success: false, + data: null, + code: 0, + message: error.message || '角色切换失败', + }; + } + } + + /** + * 获取用户信息(重构版) + * @param {Object} data - 请求数据 + * @return {Object} 用户信息 + */ + async info(data) { + const { ctx } = this; + try { + const userId = ctx.userId || (ctx.user && ctx.user.id); + const user = await this.findById(userId); + + return { + success: true, + data: user, + code: 200, + }; + } catch (error) { + console.log(error); + return { + success: false, + data: null, + code: 0, + }; + } + } + + /** + * 查找用户所有的角色以及对应的主体(重构版) + * @param {number} userId - 用户ID + * @param {string} platformCode - 平台编码 + * @return {Promise} + */ + async getRoles(userId) { + const { ctx } = this; + const platformCode = ctx.header.platform || 'web'; + const project = ctx.header.project; + try { + // 获取用户的所有角色关联 + const store_where = { + status: 1, + }; + if (project != 'all') { + store_where.project = project; + } + console.log('store_where', store_where, project, platformCode, ctx.header); + const accountStoreEmployees = await ctx.model.AccountStoreEmployee.findAll({ + where: { + account_id: userId, + status: 1, + }, + include: [ + { + model: ctx.model.EmployeeRole, + as: 'employeeRole', + attributes: [ 'id', 'role_id' ], + }, + { + model: ctx.model.Store, + as: 'store', + attributes: [ 'id', 'company_name', 'project', 'auth_end' ], + where: store_where, + }, + ], + order: [[ 'created_at', 'DESC' ]], + }); + if (!accountStoreEmployees) { + throw ('没有符合的角色'); + } + console.log('accountStoreEmployees>>>>>', accountStoreEmployees); + // 获取当前平台的激活角色 + let activeEmployeeId = null; + let employee_id = null; + let realName = null; + let userRole = ''; + + const platformActive = await ctx.model.AccountPlatformActive.findOne({ + where: { + account_id: userId, + platform_code: platformCode, + }, + attributes: [ 'account_id', 'employee_id', 'platform_code' ], + }); + if (platformActive) { + employee_id = platformActive.employee_id; + } + // 转换数据格式 + const Employees = accountStoreEmployees.map(item => ({ + id: item.id, + store_id: item.store_id, + store_name: item.store.company_name, + is_primary: platformActive && platformActive.employee_id === item.id ? 1 : 0, + real_name: item.real_name, + auth_end: item.store.auth_end, + role_type: item.store.project, + })); + + // 确定当前激活角色 + for (const Employee of Employees) { + if (Employee.is_primary == 1) { + activeEmployeeId = Employee.id; + realName = Employee.real_name; + userRole = Employee.role_type == 1 ? 'warehouse' : 'customer'; + break; + } + } + + // 如果没有激活角色,选择第一个 + if (!activeEmployeeId && Employees.length > 0) { + activeEmployeeId = Employees[0].id; + realName = Employees[0].real_name; + userRole = Employees[0].role_type == 1 ? 'warehouse' : 'customer'; + + // 设置为激活角色 + if (Employees[0].id) { + await this.ensurePlatformActiveRole(userId, Employees[0].id, platformCode); + } + } + + // 获取菜单和权限 + const menus = await this.getMenus(activeEmployeeId); + + console.log('获取菜单', activeEmployeeId, menus); + const permissions = await this.getPermissions(activeEmployeeId); + + return { Employees, activeEmployeeId, menus, permissions, userRole, realName }; + } catch (error) { + console.error('获取用户角色失败:', error); + return [[], null, [], [], '', null ]; + } + } + + /** + * 根据ID查找用户(重构版) + * @param {number} userId - 用户ID + * @param {string} platformCode - 平台编码 + * @param useCache + * @return {Promise} + */ + async findById(userId, useCache = true) { + const { ctx } = this; + const platformCode = ctx.header.platform || 'web'; + const project = ctx.header.project; + console.log(`调用${ctx.query_count}次,平台为${platformCode}`); + ctx.query_count++; + try { + // 生成缓存key + const cacheKey = `user:info:${userId}:${platformCode}`; + + // 1. 尝试从缓存获取 + if (useCache) { + try { + const cachedUser = await this.app.getCacheAsync(cacheKey); + if (cachedUser) { + console.log('用户信息缓存命中:', userId); + return cachedUser; + } + } catch (cacheError) { + console.warn('获取用户缓存失败:', cacheError.message); + // 缓存失败不影响主流程,继续查询数据库 + } + } + + // 2. 从数据库获取用户基本信息 + const user = await this.ctx.model.Account.findOne({ + where: { id: userId }, + attributes: [ 'id', 'real_name', 'email', 'status', 'username', 'phone', 'last_login_at', 'last_login_ip' ], + }); + + if (!user) { + // 如果用户不存在,也缓存null值避免频繁查询 + if (useCache) { + await this.setUserCache(cacheKey, null, 300); // 缓存5分钟 + } + return null; + } + + // 3. 获取角色信息(这个方法内部也有缓存逻辑) + const { Employees, activeEmployeeId, menus, permissions, userRole, realName } = await this.getRoles(userId); + console.log('activeEmployeeId>>>>>>>>', activeEmployeeId); + // 4. 获取当前角色对应的仓库ID + let storeId = null; + let storeName = null; + let storeCode = null; + let roleName = null; + let auth_end = null; + let employees_name = null; + if (activeEmployeeId && Employees.length > 0) { + const currentRole = Employees.find(Employee => Employee.id === activeEmployeeId); + if (currentRole) { + storeId = currentRole.store_id; + storeName = currentRole.store_name; + storeCode = currentRole.store_code; + roleName = currentRole.role_name; + employees_name = currentRole.real_name; + auth_end = currentRole.auth_end; + } + } + + const avatar = await this.getAvatarByEmployeeId(activeEmployeeId); + if (platformCode == 'pda' && !activeEmployeeId) { + throw ('无登录权限'); + } + // 5. 组合用户信息 + const userInfo = { + id: user.id, + status: user.status, + employees: Employees, + auth_end, + employees_id: activeEmployeeId, + employees_name: employees_name || '未命名', + loginIp: user.last_login_ip, + role_name: roleName, + store_id: storeId, + store_name: storeName, + store_code: storeCode, + menus, + permissions, + userRole, + platform_code: platformCode, + avatar, + cached_at: new Date().toISOString(), + }; + // 6. 设置缓存 + if (useCache) { + console.log('设置用户缓存', userInfo); + await this.setUserCache(cacheKey, userInfo, 300); // 缓存5分钟 + } + + console.log('用户信息数据库查询:', userId); + return userInfo; + + } catch (error) { + console.error('根据ID查找用户失败:', error); + return null; + } + } + /** + * 设置用户缓存 + * @param cacheKey + * @param userInfo + * @param ttl + * @private + */ + async setUserCache(cacheKey, userInfo, ttl = 300) { + try { + // 移除缓存标识字段 + if (userInfo) { + const { cached_at, ...cacheData } = userInfo; + await this.app.setCacheAsync(cacheKey, cacheData, ttl); + } else { + await this.app.setCacheAsync(cacheKey, null, ttl); + } + } catch (error) { + console.warn('设置用户缓存失败:', error.message); + } + } + async getAvatarByEmployeeId(employeeId) { + const { ctx, app } = this; + const { Op } = app.Sequelize; + let url = ''; + const image = await ctx.model.FileReference.findOne({ + where: { + business_type: 'avater', + business_id: employeeId, + }, + include: [{ + model: ctx.model.File, + as: 'file', + attributes: [ 'file_url' ], + required: true, + }], + }); + if (image) { + url = image.file.file_url; + } + return url; + } + /** + * 清除用户缓存 + * @param userId + * @param platformCode + */ + async clearUserCache(userId, platformCode = null) { + try { + if (platformCode) { + // 清除指定平台的缓存 + const cacheKey = `user:info:${userId}:${platformCode}`; + await this.app.setCacheAsync(cacheKey, null, 1); + } else { + // 清除用户所有平台的缓存 + const platforms = [ 'web', 'pda', 'mini', 'app' ]; + for (const platform of platforms) { + const cacheKey = `user:info:${userId}:${platform}`; + await this.app.setCacheAsync(cacheKey, null, 1); + } + } + + // 同时清除相关的缓存 + await this.clearRelatedCache(userId); + + console.log('用户缓存已清除:', userId); + return true; + } catch (error) { + console.warn('清除用户缓存失败:', error.message); + return false; + } + } + /** + * 清除用户相关缓存 + * @param userId + * @private + */ + async clearRelatedCache(userId) { + try { + // 清除用户基本信息缓存 + const basicCacheKeys = [ + `user:basic:${userId}`, + `account:username:${userId}`, + `account:phone:${userId}`, + `account:email:${userId}`, + ]; + + for (const key of basicCacheKeys) { + await this.app.setCacheAsync(key, null, 1); + } + + // 清除用户角色缓存 + const roleCacheKey = `user:roles:${userId}`; + await this.app.setCacheAsync(roleCacheKey, null, 1); + + // 清除用户权限缓存 + const permCacheKeys = [ + `user:permissions:${userId}`, + `user:menus:${userId}`, + ]; + + for (const key of permCacheKeys) { + await this.app.setCacheAsync(key, null, 1); + } + + } catch (error) { + console.warn('清除相关缓存失败:', error.message); + } + } + /** + * 获取权限列表(重构版) + * @param {number} roleId - 角色ID + * @param activeEmployeeId + * @return {Promise} + */ + async getPermissions(activeEmployeeId) { + const { ctx, app } = this; + const { Sequelize } = app; + const { Op } = Sequelize; + if (!activeEmployeeId) { + return []; + } + + try { + // 1. 获取员工的角色 + const roles = await ctx.model.EmployeeRole.findAll({ + where: { + employee_id: activeEmployeeId, + }, + raw: true, // 获取纯数据对象 + }); + console.log('员工绑定的角色', roles); + if (!roles || roles.length === 0) { + return []; + } + + const roleIds = roles.map(item => item.role_id); + + // 2. 获取角色的权限 + const rolePermissions = await ctx.model.RolePermission.findAll({ + where: { + role_id: { + [Op.in]: roleIds, + }, + }, + raw: true, + }); + if (!rolePermissions || rolePermissions.length === 0) { + return []; + } + + const permissionIds = rolePermissions.map(item => item.permission_id); + + const permissions = await ctx.model.Permission.findAll({ + where: { + id: { + [Op.in]: permissionIds, + }, + // 修正 like 查询 + type: { + [ctx.app.Sequelize.Op.notLike]: '%_pages', + }, + }, + attributes: [ 'id', 'path', 'type' ], + order: [ + [ 'sort', 'ASC' ], + ], + }); + console.log('permissions列表', permissions); + if (!permissions) { + return []; + } + + return permissions.map(item => item.path); + } catch (error) { + console.error('获取权限列表失败:', error); + return []; + } + } + + + async getMenus(activeEmployeeId) { + const { ctx, app } = this; + const { Sequelize } = app; + const { Op } = Sequelize; + console.log('获取员工菜单员工id:', activeEmployeeId); + if (!ctx.header.platform || !activeEmployeeId) { + return []; + } + + try { + // 1. 获取员工的角色 + const roles = await ctx.model.EmployeeRole.findAll({ + where: { + employee_id: activeEmployeeId, + }, + raw: true, // 获取纯数据对象 + }); + console.log('员工绑定的角色', roles); + if (!roles || roles.length === 0) { + return []; + } + + const roleIds = roles.map(item => item.role_id); + + // 2. 获取角色的权限 + const rolePermissions = await ctx.model.RolePermission.findAll({ + where: { + role_id: { + [Op.in]: roleIds, + }, + }, + raw: true, + }); + if (!rolePermissions || rolePermissions.length === 0) { + return []; + } + + const permissionIds = rolePermissions.map(item => item.permission_id); + + // 3. 获取权限对应的菜单(根据设备筛选) + const permissions = await ctx.model.Permission.findAll({ + where: { + id: { + [Op.in]: permissionIds, + }, + // 修正 like 查询 + type: { + [Op.like]: `${ctx.header.platform}_%`, + }, + }, + order: [ + [ 'sort', 'ASC' ], + ], + }); + if (!permissions || permissions.length === 0) { + return []; + } + return this.convertToRoutes(permissions); + } catch (error) { + ctx.logger.error('获取菜单列表失败:', error); + return []; + } + } + + /** + * 转换权限为路由格式(保持不变) + * @param data + */ + async convertToRoutes(data) { + const map = new Map(); + const roots = []; + + // 创建所有节点的映射 + data.forEach(item => { + map.set(item.id, { + id: item.id, + path: item.path, + component: item.component, + name: item.name, + redirect: item.redirect, + meta: { + title: item.meta_title, + icon: item.meta_icon, + }, + hidden: item.hidden === 1, + alwaysShow: item.always_show === 1, + sort: item.sort, + children: [], + }); + }); + + // 构建树形结构 + data.forEach(item => { + const node = map.get(item.id); + if (item.parent_id === 0) { + roots.push(node); + } else { + const parent = map.get(item.parent_id); + if (parent) { + parent.children.push(node); + } + } + }); + + // 递归排序函数 + const sortTree = nodes => { + if (!nodes || nodes.length === 0) return; + + nodes.sort((a, b) => { + return a.sort - b.sort || a.id - b.id; + }); + + nodes.forEach(node => { + if (node.children && node.children.length > 0) { + sortTree(node.children); + } + }); + }; + + // 从根节点开始排序 + sortTree(roots); + + // 移除辅助字段 + const cleanNode = node => { + const { id, sort, ...rest } = node; + if (rest.children && rest.children.length > 0) { + rest.children = rest.children.map(child => cleanNode(child)); + } + return rest; + }; + + return roots.map(root => cleanNode(root)); + } + + /** + * 根据标识符查找用户(已重构) + * @param identifier + * @param type + * @param useCache + */ + async findUserByIdentifier(identifier, type = 'auto', useCache = true) { + const { ctx, app } = this; + + let user; + + if (type === 'auto') { + // 自动判断类型 + const Op = app.Sequelize.Op; + + if (/^1[3-9]\d{9}$/.test(identifier)) { + // 手机号格式 + user = await ctx.model.Account.findOne({ + where: { phone: identifier }, + }); + } else if (/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(identifier)) { + // 邮箱格式 + user = await ctx.model.Account.findOne({ + where: { email: identifier }, + }); + } else { + // 默认按用户名 + user = await ctx.model.Account.findOne({ + where: { username: identifier }, + }); + } + } else { + // 指定类型 + let whereCondition = {}; + switch (type) { + case 'phone': + whereCondition = { phone: identifier }; + break; + case 'email': + whereCondition = { email: identifier }; + break; + case 'username': + default: + whereCondition = { username: identifier }; + break; + } + + user = await ctx.model.Account.findOne({ + where: whereCondition, + }); + } + + if (user) { + // 设置标志,表示不隐藏敏感字段 + user._hideSensitive = false; + } + + return user; + } + + /** + * 检查用户状态(保持不变) + * @param user + */ + checkUserStatus(user) { + if (user.status === 0) { + throw new Error('账号已被禁用,请联系管理员'); + } + if (user.status === 2) { + throw new Error('账号已离职,无法登录'); + } + if (user.status !== 1) { + throw new Error('账号状态异常'); + } + } + + /** + * 验证密码(重构版) + * @param inputPassword + * @param storedHash + * @param salt + */ + async verifyPassword(inputPassword, storedHash, salt) { + const crypto = require('crypto'); + const hash = crypto.createHash('sha256'); + hash.update(inputPassword + salt); + const encryptedPassword = hash.digest('hex'); + + if (encryptedPassword !== storedHash) { + throw new Error('密码错误'); + } + return true; + } + + /** + * 加密密码(保持不变) + * @param password + * @param salt + */ + async encryptPassword(password, salt) { + const crypto = require('crypto'); + const hash = crypto.createHash('sha256'); + hash.update(password + salt); + return hash.digest('hex'); + } + + /** + * 生成密码盐(保持不变) + */ + generateSalt() { + const crypto = require('crypto'); + return crypto.randomBytes(10).toString('hex'); + } + + /** + * 更新最后登录时间(重构版) + * @param userId + */ + async updateLastLoginTime(userId) { + const { ctx } = this; + console.log('登录上下文', ctx.request.header['x-real-ip']); + await ctx.model.Account.update({ + last_login_at: new Date(), + last_login_ip: ctx.request.header['x-real-ip'], + }, { + where: { id: userId }, + }); + await this.clearUserCache(userId); + } + + /** + * 确保平台激活角色存在 + * @param accountId + * @param accountStoreRoleId + * @param platformCode + * @private + */ + async ensurePlatformActiveRole(accountId, accountStoreRoleId, platformCode) { + const { ctx } = this; + + try { + await ctx.model.AccountPlatformActive.upsert({ + account_id: accountId, + employee_id: accountStoreRoleId, + platform_code: platformCode, + }); + } catch (error) { + console.warn('设置平台激活角色失败:', error.message); + } + } + + + /** + * 用户注册(重构版) + * @param userInfo + */ + async register(userInfo) { + const { ctx, app } = this; + + // 检查用户名是否已存在 + const existingUser = await this.findUserByIdentifier(userInfo.username, 'username'); + if (existingUser) { + throw new Error('用户名已存在'); + } + + // 生成密码盐 + const salt = this.generateSalt(); + + // 加密密码 + const passwordHash = await this.encryptPassword(userInfo.password, salt); + + // 创建用户 + const user = await ctx.model.Account.create({ + username: userInfo.username, + email: userInfo.email || '', + password_hash: passwordHash, + real_name: userInfo.real_name || '', + status: 1, + salt, + }); + + return { + userId: user.id, + username: user.username, + code: 200, + message: '注册成功', + }; + } +} + +module.exports = UserService; diff --git a/app/service/systems/delivery_order.js b/app/service/systems/delivery_order.js new file mode 100644 index 0000000..ef45491 --- /dev/null +++ b/app/service/systems/delivery_order.js @@ -0,0 +1,534 @@ +'use strict'; +const Service = require('egg').Service; + +class DeliveryOrderService extends Service { + async addOrder(data, info) { + const { ctx } = this; + if (!info.warehouseId) { + return { + success: false, + message: '订单创建失败: 非法参数', + data: null, + }; + } + const DeliveryModel = await ctx.model.OrderDeliveryFactory.getCurrentModel(info.warehouseId); + const { deliveryOrder, orderLines } = data.request; + + // 开启事务 + const transaction = await ctx.model.transaction(); + + try { + if (!info.storeId) { + throw new Error('非法参数'); + } + if (!deliveryOrder || !deliveryOrder.deliveryOrderCode) { + throw new Error('订单信息不完整'); + } + + // 检查订单是否已存在(根据唯一索引) + const existingOrder = await DeliveryModel.findOne({ + where: { + delivery_order_code: deliveryOrder.deliveryOrderCode, + store_id: info.storeId, + warehouse_id: info.warehouseId, + }, + attributes: [ 'id' ], + transaction, + }); + if (existingOrder) { + await transaction.rollback(); + return { + success: true, + message: '订单已存在', + data: { deliveryOrderId: existingOrder.id }, + }; + } + + // 准备订单数据 + const orderData = await this.prepareOrderData(deliveryOrder, info); + + // 创建订单 + const createdOrder = await DeliveryModel.create(orderData, { transaction }); + const orderId = createdOrder.id; + + let itemsInfo = null; + // 添加订单明细 + if (orderLines && (orderLines.orderLine)) { + itemsInfo = await this.addOrderLines( + orderLines.orderLine, + orderId, + info, + transaction + ); + } else { + throw new Error('[订单无明细]'); + } + + // 更新订单统计信息 - 直接使用itemsInfo中的计算结果 + if (itemsInfo) { + const stats = { + items: itemsInfo.items_str || '', // 原始结构字符串 + items_count: itemsInfo.stock_count || 0, // 商品种类数 + items_total: itemsInfo.item_total_count || 0, // 商品总数(直接使用计算结果) + items_weight: itemsInfo.total_weight || 0, // 总重量 + items_hash: this.generateItemsHash(itemsInfo), // 哈希值 + items_crc: this.calculateCRC32(itemsInfo.items_str || ''), // CRC校验 + updated_at: new Date(), + }; + + await DeliveryModel.update( + stats, + { + where: { id: orderId }, + transaction, + } + ); + + // 记录详细日志 + ctx.logger.info('[订单统计信息已更新]', { + orderId, + orderCode: deliveryOrder.deliveryOrderCode, + stats: { + items_count: stats.items_count, + items_total: stats.items_total, + items_weight: stats.items_weight, + items_hash_preview: stats.items_hash?.substring(0, 8) + '...', + items_crc: stats.items_crc, + }, + }); + } + + // 异步处理:订单入队列 + this.addOrderToQueue(orderId, info.warehouseId); + + await transaction.commit(); + + return { + success: true, + message: '订单创建成功', + data: { + orderId, + stats: itemsInfo ? { + items_count: itemsInfo.stock_count, + items_total: itemsInfo.item_total_count, + items_weight: itemsInfo.total_weight, + } : null, + }, + }; + + } catch (error) { + console.error('创建订单失败:', error); + // 回滚事务 + await transaction.rollback(); + + return { + success: false, + message: `订单创建失败: ${error.message}`, + data: null, + }; + } + } + + /** + * 生成订单结构哈希值 + * 直接使用itemsInfo中的items_str + * @param itemsInfo + */ + generateItemsHash(itemsInfo) { + const crypto = require('crypto'); + + if (!itemsInfo || !itemsInfo.items_str) { + return ''; + } + + // 生成哈希 + return crypto.createHash('md5') + .update(itemsInfo.items_str) + .digest('hex'); + } + + /** + * 计算CRC32校验码 + * @param str + */ + calculateCRC32(str) { + if (!str) return 0; + + try { + const crc32 = require('crc-32'); + return crc32.str(str) >>> 0; // 转为无符号整数 + } catch (error) { + // 降级方案:简单校验和 + let crc = 0; + for (let i = 0; i < str.length; i++) { + crc = (crc + str.charCodeAt(i)) & 0xFFFFFFFF; + } + return crc; + } + } + + // 准备订单数据 + // 准备订单数据 + async prepareOrderData(deliveryOrder, info) { + const { ctx, service } = this; + const { + deliveryOrderCode, + preDeliveryOrderCode, + preDeliveryOrderId, + orderType, + warehouseCode, + orderFlag, + sourcePlatformCode, + sourcePlatformName, + createTime, + placeOrderTime, + payTime, + payNo, + shopNick, + sellerNick, + buyerNick, + operatorName, + operateTime, + totalAmount, + itemAmount, + discountAmount, + freight, + arAmount, + gotAmount, + logisticsCode, + logisticsName, + expressCode, + logisticsAreaCode, + isUrgency, + invoiceFlag, + senderInfo, + receiverInfo, + } = deliveryOrder; + + let platformCode = sourcePlatformCode; + let platformName = sourcePlatformName; + + try { + // 验证平台代码是否存在 + const platformInfo = await service.systems.platform.checkPlatformExists( + sourcePlatformCode, + info.warehouseId + ); + + if (platformInfo) { + // 平台存在,使用数据库中的平台信息 + platformCode = platformInfo.code; + platformName = platformInfo.name; + + ctx.logger.info(`平台验证通过: ${sourcePlatformCode} -> ${platformCode} (${platformName})`); + } else { + // 平台不存在,抛出错误 + throw new Error(`平台代码 ${sourcePlatformCode} 在仓库 ${info.warehouseId} 中不存在`); + } + } catch (error) { + ctx.logger.error(`平台验证失败: ${error.message}`, { + platformCode: sourcePlatformCode, + warehouseId: info.warehouseId, + deliveryOrderCode, + }); + throw error; // 抛出错误,让上层捕获 + } + + return { + delivery_order_code: deliveryOrderCode, + pre_delivery_order_code: preDeliveryOrderCode || '', + pre_delivery_order_id: preDeliveryOrderId || '', + order_type: orderType, + warehouse_code: warehouseCode, + order_flag: orderFlag || '', + // 使用验证后的平台信息 + source_platform_code: platformCode, + source_platform_name: platformName, + create_at: createTime ? new Date(createTime) : new Date(), + place_order_time: placeOrderTime ? new Date(placeOrderTime) : null, + pay_time: payTime ? new Date(payTime) : null, + pay_no: payNo || '', + shop_nick: shopNick, + seller_nick: sellerNick, + buyer_nick: buyerNick, + operator_name: operatorName, + operate_time: operateTime ? new Date(operateTime) : null, + total_amount: totalAmount ? parseFloat(totalAmount) : 0, + item_amount: itemAmount ? parseFloat(itemAmount) : 0, + discount_amount: discountAmount ? parseFloat(discountAmount) : 0, + freight: freight ? parseFloat(freight) : 0, + ar_amount: arAmount ? parseFloat(arAmount) : 0, + got_amount: gotAmount ? parseFloat(gotAmount) : 0, + logistics_code: logisticsCode, + logistics_name: logisticsName, + express_code: expressCode || '', + logistics_area_code: logisticsAreaCode || '', + is_urgency: isUrgency || 'N', + invoice_flag: invoiceFlag || 'N', + status: 'pedding', + // 收件人信息 + name: receiverInfo?.name || '', + tel: receiverInfo?.tel || '', + mobile: receiverInfo?.mobile || '', + email: receiverInfo?.email || '', + country_code: receiverInfo?.countryCode || '', + province: receiverInfo?.province || '', + city: receiverInfo?.city || '', + area: receiverInfo?.area || '', + town: receiverInfo?.town || '', + detail_address: receiverInfo?.detailAddress || '', + zip_code: receiverInfo?.zipCode || '', + // 发件人信息(如果需要存储) + // 业务关联ID + store_id: info.storeId, + warehouse_id: info.warehouseId, + from_key: info.appKey, + }; + } + + // 添加订单明细 + async addOrderLines(orderLines, orderId, info, transaction) { + const { ctx, app } = this; + const { warehouseId, appKey, storeId } = info; + let order_items = []; + + if (orderLines && typeof orderLines === 'object') { + if (orderLines.itemCode) { + order_items = [ orderLines ]; + } else if (Array.isArray(orderLines)) { + order_items = orderLines; + } else if (orderLines.orderLine && Array.isArray(orderLines.orderLine)) { + order_items = orderLines.orderLine; + } else if (orderLines.orderLine && typeof orderLines.orderLine === 'object') { + order_items = [ orderLines.orderLine ]; + } + } + + if (!order_items || !Array.isArray(order_items) || order_items.length === 0) { + throw new Error('没有有效的订单明细数据'); + } + + const OrderItemsModel = await ctx.model.OrderItemsFactory.getCurrentModel(warehouseId); + + const lineData = []; + const errors = []; + const stockQuantityMap = new Map(); // stock_id -> 数量 + const stockWeightMap = new Map(); // stock_id -> 单件重量(grossWeight) + const processedItemIds = new Set(); + + console.log('order_items', order_items); + + for (let i = 0; i < order_items.length; i++) { + const line = order_items[i]; + console.log('line', line); + + // 跳过空值 + if (!line || typeof line !== 'object') { + errors.push(`第${i + 1}行: 数据格式无效`); + continue; + } + + + // 数量验证 + const planQty = line.planQty ? parseInt(line.planQty) : 0; + if (planQty <= 0) { + errors.push(`商品《${line.itemName}》数量必须大于0`); + continue; + } + let wms_stock = null; + if (!line.itemId) { + console.log('ERP不处理WMS的外部商品编码'); + // 查找唯一键 + wms_stock = await app.model.StockStore.findOne({ where: { + item_code: line.itemCode, + app_key: appKey, + warehouse_id: warehouseId, + store_id: storeId, + }, transaction }); + } else { + wms_stock = await app.model.StockStore.findByPk(line.itemId, { transaction }); + } + // 如果没有itemId,直接记录错误 + if (!wms_stock) { + errors.push(`商品《${line.itemName}》编码《${line.itemCode}》\n未同步推送到仓库`); + continue; + } + + const itemId = parseInt(wms_stock.id); + // ========== 核心库存检查逻辑 ========== + const stockResult = await ctx.service.systems.stockStore.getItemStorages(wms_stock.id, transaction); + if (!stockResult.success) { + errors.push(`SKU${wms_stock.id}商品《${wms_stock.item_name}》编码《${wms_stock.item_code}》\n${stockResult.error}`); + continue; + } + + const { stock, storage } = stockResult.data; + const stockId = storage.id; + + if (!stockId) { + errors.push(`第${i + 1}行: 商品《${wms_stock.item_name}》库存记录不存在`); + continue; + } + + if (processedItemIds.has(itemId)) { + errors.push(`第${i + 1}行: 商品《${wms_stock.item_name}》在同一订单中重复出现`); + continue; + } + processedItemIds.add(itemId); + + const totalQtyForStock = (stockQuantityMap.get(stockId) || 0) + planQty; + stockQuantityMap.set(stockId, totalQtyForStock); + + // 记录商品重量(如果storage中有grossWeight) + if (storage.grossWeight !== undefined && storage.grossWeight !== null) { + const weight = parseFloat(storage.grossWeight) || 0; + stockWeightMap.set(stockId, weight); + } else { + // 如果库存中没有重量信息,记录0 + stockWeightMap.set(stockId, 0); + } + + if (storage.canUse < totalQtyForStock) { + errors.push(`第${i + 1}行: 商品《${wms_stock.item_name}》库存不足,可用 ${storage.canUse},需求 ${totalQtyForStock}`); + stockQuantityMap.set(stockId, totalQtyForStock - planQty); + continue; + } + + // 锁定库存 + const lockResult = await ctx.service.systems.stockStore.lockItemStorages( + storage.id, + planQty, + transaction + ); + + if (!lockResult.success) { + errors.push(`SKU${wms_stock.id}商品《${wms_stock.item_name}》编码《${wms_stock.item_code}》\n锁定失败: ${lockResult.error}`); + stockQuantityMap.set(stockId, totalQtyForStock - planQty); + continue; + } + // ========== 库存检查逻辑结束 ========== + + // 所有检查通过,准备订单行数据 + lineData.push({ + order_id: orderId, + actual_price: this.safeParseFloat(line.actualPrice, 0), + retail_price: this.safeParseFloat(line.retailPrice, 0), + ext_code: line.extCode || '', + inventory_type: line.inventoryType || '', + item_code: line.itemCode || '', + item_id: line.itemId || null, + item_name: line.itemName || '', + order_line_no: line.orderLineNo || `${i + 1}`, + owner_code: line.ownerCode || '', + plan_qty: planQty, + source_order_code: line.sourceOrderCode || '', + sub_source_order_code: line.subSourceOrderCode || '', + extend_props: line.extendProps ? + (typeof line.extendProps === 'string' ? line.extendProps : JSON.stringify(line.extendProps)) + : null, + // 可选:记录重量信息到明细 + item_weight: stockWeightMap.get(stockId) || 0, + }); + } + + // ========== 计算订单统计信息 ========== + let items_str = ''; + let total_weight = 0; // 总重量 + let stock_count = 0; // stock种类数 + let item_total_count = 0; // 商品总数 + + if (stockQuantityMap.size > 0) { + // 生成结构字符串 + const sortedStocks = Array.from(stockQuantityMap.entries()) + .sort(([ stockIdA ], [ stockIdB ]) => stockIdA - stockIdB) + .map(([ stockId, quantity ]) => { + // 可选:在字符串中包含重量信息 + const weight = stockWeightMap.get(stockId) || 0; + return `${stockId}+${quantity}${weight > 0 ? `@${weight}` : ''}`; + }); + items_str = sortedStocks.join('|'); + + // 计算统计信息 + stock_count = stockQuantityMap.size; // stock种类数 + + // 计算商品总数 + item_total_count = Array.from(stockQuantityMap.values()) + .reduce((sum, quantity) => sum + (parseInt(quantity) || 0), 0); + + // 计算总重量:重量 × 数量 + total_weight = Array.from(stockQuantityMap.entries()) + .reduce((sum, [ stockId, quantity ]) => { + const weight = stockWeightMap.get(stockId) || 0; + const qty = parseInt(quantity) || 0; + return sum + (weight * qty); + }, 0); + + // 格式化重量(保留2位小数) + total_weight = parseFloat(total_weight.toFixed(2)); + + ctx.logger.debug('[订单统计信息]', { + orderId, + stock_count, + item_total_count, + total_weight, + items_str_length: items_str.length, + items_preview: items_str.substring(0, 100) + (items_str.length > 100 ? '...' : ''), + }); + } + + if (errors.length > 0) { + throw new Error(`创建订单错误:\n${errors.join('\n')}`); + } + + if (lineData.length === 0) { + throw new Error('没有有效的商品明细可以创建'); + } + + // 批量创建订单明细 + await OrderItemsModel.bulkCreate(lineData, { transaction }); + ctx.logger.info(`成功添加 ${lineData.length} 个订单明细项,订单ID: ${orderId}`); + + // 返回完整信息 + return { + length: lineData.length, // 商品种类数(与stock_count相同) + items_str, // 结构字符串 + stock_count, // stock种类数 + item_total_count, // 商品总数 + total_weight, // 总重量 + stock_quantity_map: Object.fromEntries(stockQuantityMap), // stock_id -> 数量 + stock_weight_map: Object.fromEntries(stockWeightMap), // stock_id -> 单件重量 + line_data: lineData, // 创建的明细数据 + stats: { // 统计信息汇总 + unique_items: stock_count, + total_items: item_total_count, + total_weight, + avg_weight_per_item: stock_count > 0 ? (total_weight / item_total_count).toFixed(2) : 0, + }, + }; + } + + // 添加工具方法 + safeParseFloat(value, defaultValue = 0) { + if (value === null || value === undefined) return defaultValue; + const num = parseFloat(value); + return isNaN(num) ? defaultValue : num; + } + + // 订单入队列(异步处理) + async addOrderToQueue(orderId, warehouseId) { + const { ctx, app } = this; + + try { + const queueData = { + orderId, + warehouseId, + timestamp: Date.now(), + action: 'order_created', + }; + + } catch (error) { + } + } +} + +module.exports = DeliveryOrderService; diff --git a/app/service/systems/entry_order.js b/app/service/systems/entry_order.js new file mode 100644 index 0000000..36a6788 --- /dev/null +++ b/app/service/systems/entry_order.js @@ -0,0 +1,751 @@ +'use strict'; +const Service = require('egg').Service; + +class entryOrderService extends Service { + async addOrder(data, info, fromCode) { + const { storeId, warehouseId, appKey, customerId, warehouseCode } = info; + const { app } = this; + const transaction = await app.model.transaction(); // 开启事务 + + try { + console.log('入库单开始接收处理'); + let totalOrderLines = data.request.entryOrder.totalOrderLines || 0; + + let orderLine = data.request.orderLines.orderLine; + if (orderLine.itemCode) { + orderLine = [ orderLine ]; + } + console.log('orderLine', orderLine); + const isSingle = totalOrderLines ? 0 : 1; + totalOrderLines = totalOrderLines || orderLine.length; + let errors = []; + const items = []; + + console.log('循环开始'); + // 验证商品 + for (var i = 0; i < orderLine.length; i++) { + let wms_stock = null; + // ERP不处理WMS的外部商品编码 + if (!orderLine[i].itemId) { + console.log('ERP不处理WMS的外部商品编码'); + // 查找唯一键 + wms_stock = await app.model.StockStore.findOne({ where: { + item_code: orderLine[i].itemCode, + app_key: appKey, + warehouse_id: warehouseId, + store_id: storeId, + }, transaction }); + } else { + wms_stock = await app.model.StockStore.findByPk(orderLine[i].itemId, { transaction }); + } + if (!wms_stock) { + errors.push(`SKU${orderLine[i].itemId}商品《${orderLine[i].itemName}》编码《${orderLine[i].itemCode}》\n未同步推送到仓库`); + continue; + } + if (!wms_stock.stock_id) { + errors.push(`SKU${orderLine[i].itemId}商品《${orderLine[i].itemName}》编码《${orderLine[i].itemCode}》wms无对应关系\n请联系仓库关联创建商品`); + continue; + } + wms_stock.inventory_type = orderLine[i].inventoryType || 'ZP'; + wms_stock.order_line_no = orderLine[i].orderLineNo || i + 1; + wms_stock.count = orderLine[i].planQty; + wms_stock.item_id = orderLine[i].itemId || wms_stock.id; + items.push(wms_stock); + } + console.log('items>>>>>', items); + if (errors.length > 0) { + await transaction.rollback(); // 验证失败,回滚事务 + return { + success: false, + message: '创建入库单失败,失败原因:\n' + errors.join('\n'), + data: { + createTime: new Date(), + }, + }; + } + + // 创建入库单(内部也使用事务) + const order = await this.tryCreateEntryOrder( + data.request.entryOrder, + appKey, + storeId, + warehouseId, + totalOrderLines, + fromCode, + customerId, + warehouseCode, + transaction // 传递事务 + ); + + console.log('入库单参数', order); + if (!order.success) { + await transaction.rollback(); + return { + success: false, + message: '创建入库单失败,失败原因:\n' + order.error, + data: { + createTime: new Date(), + }, + }; + } + + const orderId = order.entryOrderId; + const orderCode = order.entryOrderCode || data.request.entryOrder.entryOrderCode; + errors = []; // 重置错误数组 + + // 添加商品明细 + for (var i = 0; i < items.length; i++) { + const item = items[i]; + const res = await this.addItems(item, orderId, transaction); + console.log('添加商品返回信息', res); + if (!res.success) { + errors.push(`SKU${item.itemId}商品《${item.itemName}》编码《${item.itemCode}》入库失败,错误信息:${res.error}`); + } + } + + if (errors.length > 0) { + await transaction.rollback(); // 商品添加失败,回滚整个事务 + return { + success: false, + message: '创建入库单失败,失败原因:\n' + errors.join('\n'), + data: { + createTime: new Date(), + }, + }; + } + + // 获取接收行数并处理状态 + const lineCount = await this.getLineCount(orderId, transaction); + + if (lineCount == totalOrderLines) { + // 所有行数接收完成 + await this.received(orderId, warehouseId, storeId, transaction); + } + + // 提交事务 + await transaction.commit(); + + if (lineCount == totalOrderLines) { + return { + success: true, + message: '入库单接收完毕', + data: { + entryOrderId: orderId, + entryOrderCode: orderCode, + createTime: new Date(), + warehouseCode, + status: 'COMPLETED', + }, + }; + } + + // 部分接收或等待接收 + return { + success: true, + message: '入库单接收中', + data: { + entryOrderId: orderId, + entryOrderCode: orderCode, + createTime: new Date(), + warehouseCode, + status: 'PARTIAL_RECEIVED', + }, + }; + + } catch (error) { + // 发生异常,回滚事务 + await transaction.rollback().catch(e => console.error('回滚事务失败:', e)); + + console.error('addOrder 事务异常:', error); + return { + success: false, + message: `系统异常: ${error.message}`, + data: { + createTime: new Date(), + }, + }; + } + } + + // 辅助函数:获取行数(支持事务) + async getLineCount(orderId, transaction = null) { + const { app } = this; + const options = { + where: { order_id: orderId }, + }; + + if (transaction) { + options.transaction = transaction; + } + + const count = await app.model.EntryItems.count(options); + return count; + } + + // 辅助函数:标记为已接收(支持事务) + async received(orderId, warehouseId, storeId, transaction = null) { + const { app } = this; + + const updateData = { + order_status: 'COMPLETED', + updated_at: new Date(), + }; + + const where = { + id: orderId, + warehouse_id: warehouseId, + store_id: storeId, + }; + + if (transaction) { + await app.model.EntryOrder.update(updateData, { + where, + transaction, + }); + } else { + await app.model.EntryOrder.update(updateData, { where }); + } + } + + // 辅助函数:统一返回格式 + success(message, data = {}) { + return { + success: true, + message, + data: { + ...data, + createTime: new Date(), + }, + }; + } + + fail(message, data = {}) { + return { + success: false, + message, + data: { + ...data, + createTime: new Date(), + }, + }; + } + + async tryCreateEntryOrder(order, appKey, storeId, warehouseId, totalOrderLines, sourceType, qimenOwnerCode, qimenWarehouseCode, transaction = null) { + const { app } = this; + const { ctx } = this; + console.log('创建入库单信息', order, appKey, storeId, warehouseId); + + try { + const options = transaction ? { transaction } : {}; + + // 1. 检查入库单是否已存在 + const existingOrder = await ctx.model.EntryOrder.findOne({ + where: { + entry_order_code: order.entryOrderCode, + warehouse_id: warehouseId, + store_id: storeId, + }, + ...options, + }); + + // 2. 如果入库单已存在 + if (existingOrder) { + const allowedStatuses = [ 'CREATING' ]; + + if (allowedStatuses.includes(existingOrder.order_status)) { + // 状态在允许范围内,更新为接收中状态 + await existingOrder.update({ + order_status: 'CREATING', + updated_at: new Date(), + }, options); + + console.log(`入库单 ${order.entryOrderCode} 已存在,状态更新为接收中`); + + return { + success: true, + code: 1, + message: '入库单已存在,状态已更新为接收中', + entryOrderId: existingOrder.id, + entryOrderCode: existingOrder.entry_order_code, + orderStatus: 'CREATING', + items: existingOrder.items || [], + data: { + entryOrder: { + id: existingOrder.id, + entryOrderCode: existingOrder.entry_order_code, + orderType: existingOrder.order_type, + orderStatus: existingOrder.order_status, + totalOrderLines, + }, + }, + }; + } + // 其他状态返回错误 + const statusName = existingOrder.getOrderStatusName ? existingOrder.getOrderStatusName() : existingOrder.order_status; + return { + success: false, + code: 0, + message: `入库单已存在,当前状态为${statusName},无法重复创建`, + entryOrderId: existingOrder.id, + entryOrderCode: existingOrder.entry_order_code, + orderStatus: existingOrder.order_status, + error: `入库单已存在,状态: ${statusName}`, + }; + + } + + // 3. 入库单不存在,创建新的入库单 + // 如果外部传入了事务,使用外部事务;否则创建新事务 + const internalTransaction = transaction ? null : await ctx.model.transaction(); + const currentTransaction = transaction || internalTransaction; + + try { + const warehouse_data = await this.ctx.service.systems.store.getStoreName(warehouseId); + let store_name = null; + let warehouse_name = null; + if (warehouse_data.code == 200) { + warehouse_name = warehouse_data.data.company_name; + } + const store_data = await this.ctx.service.systems.store.getStoreName(storeId); + + if (store_data.code == 200) { + store_name = store_data.data.company_name; + } + + const contract_data = await this.ctx.service.systems.store.getStoreRemaskName(storeId, warehouseId); + let contract = null; + if (contract_data.code == 200) { + contract = contract_data.data; + } + // 构建入库单数据 + const entryOrderData = { + entry_order_code: order.entryOrderCode, + order_type: order.orderType, + purchase_order_code: order.relatedOrders?.relatedOrder?.orderCode || '', + total_order_lines: totalOrderLines, + order_create_time: order.orderCreateTime ? new Date(order.orderCreateTime) : new Date(), + expect_start_time: order.expectStartTime ? new Date(order.expectStartTime) : new Date(), + expect_end_time: order.expectStartTime ? new Date(order.expectStartTime) : new Date(), + logistics_code: order.logisticsCode || '', + logistics_name: order.logisticsName || '', + express_code: order.expressCode || '', + supplier_code: order.supplierCode || '', + supplier_name: order.supplierName || '', + source_type: sourceType, + order_status: 'CREATING', + sync_status: 'PENDING', + sync_message: '', + is_enabled: 1, + warehouse_id: warehouseId, + store_id: storeId, + store_name: contract.store_remask || store_name, + warehouse_name: contract.warehouse_remask || warehouse_name, + remark: order.remark || '', + qimen_owner_code: qimenOwnerCode || '', + qimen_warehouse_code: qimenWarehouseCode || '', + }; + + // 创建入库单 + const newEntryOrder = await ctx.model.EntryOrder.create(entryOrderData, { + transaction: currentTransaction, + }); + + // 如果这是内部创建的事务,提交它 + if (internalTransaction) { + await internalTransaction.commit(); + } + + console.log(`成功创建入库单: ${order.entryOrderCode}, ID: ${newEntryOrder.id}`); + + return { + success: true, + code: 1, + message: '入库单创建成功,状态设置为接收中', + entryOrderId: newEntryOrder.id, + entryOrderCode: newEntryOrder.entry_order_code, + }; + + } catch (error) { + console.log('创建入库单失败', error); + // 如果这是内部创建的事务,回滚它 + if (internalTransaction) { + await internalTransaction.rollback(); + } + throw error; + } + + } catch (error) { + console.error('创建入库单失败:', error); + + return { + success: false, + code: 0, + message: `创建入库单异常: ${error.message}`, + entryOrderId: null, + entryOrderCode: null, + orderStatus: null, + error: error.message, + }; + } + } + + async addItems(item, orderId, transaction = null) { + const { app } = this; + const { ctx } = this; + console.log('添加入库单商品'); + + try { + const options = transaction ? { transaction } : {}; + + // 检查商品是否已存在 + const existingOrderItem = await ctx.model.EntryItems.findOne({ + where: { + order_id: orderId, + order_line_no: item.order_line_no, + }, + ...options, + }); + + if (!existingOrderItem) { + try { + // 构建入库明细数据 + const entryItemsData = { + order_id: orderId, + out_biz_code: item.out_biz_code || '', + order_line_no: item.order_line_no || '', + owner_code: item.owner_code || '', + item_code: item.item_code || '', + item_id: item.item_id || 0, + count: item.count || 0, + inventory_type: item.inventory_type || '', + stock_id: item.stock_id || '', + }; + + // 创建入库明细 + await ctx.model.EntryItems.create(entryItemsData, { + transaction, + }); + + return { + success: true, + code: 1, + }; + } catch (error) { + console.log('添加商品明细出错', error); + throw error; + } + } + + return { + success: true, + code: 1, + message: '商品已存在,跳过重复添加', + }; + + } catch (error) { + console.error('添加入库单商品失败:', error); + return { + success: false, + code: 0, + message: `添加商品失败: ${error.message}`, + error: error.message, + }; + } + } + + async received(orderId, warehouseId, storeId, transaction = null) { + console.log('完结传参', orderId, warehouseId, storeId); + const { app } = this; + const { ctx } = this; + + const options = transaction ? { transaction } : {}; + + const existingOrder = await ctx.model.EntryOrder.findOne({ + where: { + warehouse_id: warehouseId, + store_id: storeId, + id: orderId, + }, + ...options, + }); + + if (!existingOrder) { + return { + success: false, + code: 0, + message: '入库单不存在', + entryOrderId: null, + orderStatus: null, + error: '入库单不存在', + }; + } + + const allowedStatuses = [ 'CREATING' ]; + if (allowedStatuses.includes(existingOrder.order_status)) { + await existingOrder.update({ + order_status: 'CREATED', + updated_at: new Date(), + }, options); + } + + return { + success: true, + code: 1, + message: '完成', + }; + } + + async qimenEntryorderConfirm(entryOrder, orderLines, isFin, outBizCode) { + if (orderLines.length < 1) { + throw new Error('行不能为空'); + } + console.log('isFin:', isFin); + const queryData = { + request: { + entryOrder: { + entryOrderCode: entryOrder.entry_order_code, + ownerCode: entryOrder.qimen_owner_code, + warehouseCode: entryOrder.qimen_warehouse_code, + entryOrderId: entryOrder.id, + entryOrderType: entryOrder.order_type, + outBizCode, + confirmType: isFin ? 0 : 1, + status: isFin ? 'FULFILLED' : 'PARTFULFILLED', + freight: 0, + operateTime: new Date().format(), + remark: entryOrder.remark, + }, + orderLines, + }, + }; + const Result = await this.ctx.service.systems.qimenQuery.send('taobao.qimen.entryorder.confirm', entryOrder.qimen_owner_code, queryData); + return Result; + } + async entryorderConfirm(orderId, isCompleted) { + const { app, ctx } = this; + const transaction = await app.model.transaction(); + + try { + // 锁定数据 + const entryOrder = await app.model.EntryOrder.findOne({ + where: { + id: orderId, + is_enabled: 1, + deleted_at: null, + }, + include: [ + { + model: app.model.EntryItems, + as: 'items', + lock: transaction.LOCK.UPDATE, + }, + ], + lock: transaction.LOCK.UPDATE, + transaction, + }); + + if (!entryOrder) { + await transaction.rollback(); + return { success: false, message: '入库单不存在' }; + } + + // 状态检查 + const allowedStatuses = [ 'CREATED', 'PARTIAL_RECEIVED', 'CONFIRMED' ]; + if (!allowedStatuses.includes(entryOrder.order_status)) { + await transaction.rollback(); + return { + success: false, + code: 'INVALID_STATUS', + message: `入库单状态[${entryOrder.order_status}]不允许确认`, + }; + } + + const orderLines = []; + let totalPlanQty = 0; + let totalReceivedQty = 0; + let totalConfirmIncrement = 0; + let hasItemsToConfirm = false; + + // 第一阶段:计算和验证,不执行更新 + const pendingUpdates = []; + + for (let i = 0; i < entryOrder.items.length; i++) { + const item = entryOrder.items[i]; + const planQty = item.count || 0; + const receivedQty = item.received_quantity || 0; + const confirmedQty = item.confirm_quantity || 0; + + // 计算本次确认的增量 + const confirmIncrement = Math.max(0, receivedQty - confirmedQty); + + if (confirmIncrement > 0) { + hasItemsToConfirm = true; + + // 奇门需要的是本次确认的数量(actualQty) + const orderLine = { + orderLineNo: i + 1, + ownerCode: item.owner_code, + itemCode: item.item_code, + itemId: item.item_id, + inventoryType: item.inventory_type, + planQty, + actualQty: confirmIncrement, // 传本次增量 + }; + orderLines.push(orderLine); + + totalConfirmIncrement += confirmIncrement; + + // 记录待更新数据(不执行) + pendingUpdates.push({ + id: item.id, + item_id: item.item_id, + new_confirm_quantity: confirmedQty + confirmIncrement, + old_confirm_quantity: confirmedQty, + received_quantity: receivedQty, + confirm_increment: confirmIncrement, + }); + } + + totalPlanQty += planQty; + totalReceivedQty += receivedQty; + } + + // 没有需要确认的数量 + if (!hasItemsToConfirm) { + await transaction.rollback(); + return { success: false, message: '没有需要确认的收货数量' }; + } + + // 判断是否最终完成 + const isFin = isCompleted ? true : (totalReceivedQty >= totalPlanQty); + let qimenResult = {}; + let queryId = null; + // 奇门入库单,数据同步到奇门 + if (entryOrder.source_type == 'QM') { + // 第二阶段:调用奇门接口 + const Result = await this.qimenEntryorderConfirm( + entryOrder, + orderLines, + isFin, + Math.round(new Date() / 1000) + ); + console.log(Result); + queryId = Result.queryId; + qimenResult = Result.xmlArray.response; + // 奇门调用失败,回滚事务 + if (!qimenResult || qimenResult.flag != 'success') { + await transaction.rollback(); + console.error('奇门接口调用失败:', qimenResult); + return { + success: false, + code: 'QIMEN_FAILED', + message: '奇门接口调用失败', + detail: qimenResult?.message || '未知错误', + }; + } + } + // 第三阶段:奇门成功,执行数据库更新 + + // 1. 更新确认数量 + for (const update of pendingUpdates) { + const result = await app.model.EntryItems.update({ + confirm_quantity: update.new_confirm_quantity, + updated_at: new Date(), + }, { + where: { + id: update.id, + confirm_quantity: update.old_confirm_quantity, // 乐观锁,防止并发 + }, + transaction, + }); + const res = await ctx.service.systems.stockStore.inbound(update.item_id, update.confirm_increment, transaction); + console.log('增加库存返回', res); + if (result[0] === 0) { + // 更新失败,可能被并发修改了 + console.warn(`更新入库明细失败,可能已被修改: id=${update.id}`); + // 可以选择重试或抛出异常 + } + } + + // 2. 更新入库单状态 + let newOrderStatus = entryOrder.order_status; + if (isFin) { + newOrderStatus = 'COMPLETED'; + } else if (totalConfirmIncrement > 0) { + if (entryOrder.order_status === 'CREATED') { + newOrderStatus = 'CONFIRMED'; + } else { + newOrderStatus = 'PARTIAL_RECEIVED'; + } + } + + const updateResult = await app.model.EntryOrder.update({ + order_status: newOrderStatus, + sync_status: 'SUCCESS', + sync_message: JSON.stringify({ + confirmTime: new Date(), + totalPlan: totalPlanQty, + totalReceived: totalReceivedQty, + totalConfirmIncrement, + isFin, + pendingUpdatesCount: pendingUpdates.length, + qimenResult: qimenResult?.data || {}, + }), + updated_at: new Date(), + }, { + where: { + id: entryOrder.id, + order_status: entryOrder.order_status, // 乐观锁 + }, + transaction, + }); + + if (updateResult[0] === 0) { + // 入库单状态已被修改,回滚 + await transaction.rollback(); + return { + success: false, + code: 'CONCURRENT_MODIFICATION', + message: '入库单已被修改,请刷新后重试', + }; + } + // 4. 提交事务 + await transaction.commit(); + + console.log(`入库单确认成功: id=${entryOrder.id}, 确认增量=${totalConfirmIncrement}, 状态=${newOrderStatus}`); + + return { + success: true, + message: isFin ? '入库单完成确认' : '入库单增量确认成功', + data: { + entryOrderId: entryOrder.id, + entryOrderCode: entryOrder.entry_order_code, + orderStatus: newOrderStatus, + totalPlan: totalPlanQty, + totalReceived: totalReceivedQty, + totalConfirmIncrement, + isFin, + updatedItemsCount: pendingUpdates.length, + orderLinesCount: orderLines.length, + }, + }; + + } catch (error) { + // 发生异常,回滚事务 + await transaction.rollback().catch(e => { + console.error('回滚事务失败:', e); + }); + + console.error('确认入库单失败:', error); + + return { + success: false, + code: 'SYSTEM_ERROR', + message: `系统异常: ${error.message}`, + stack: process.env.NODE_ENV === 'development' ? error.stack : undefined, + }; + } + } +} + +module.exports = entryOrderService; diff --git a/app/service/systems/fast_where.js b/app/service/systems/fast_where.js new file mode 100644 index 0000000..0eac37b --- /dev/null +++ b/app/service/systems/fast_where.js @@ -0,0 +1,264 @@ +'use strict'; + +const Service = require('egg').Service; + +class FastWhereService extends Service { + // 构建树形结构 + buildTree(data, pid = 0) { + const tree = []; + + data.forEach(item => { + if (item.pid === pid) { + const children = this.buildTree(data, item.id); + if (children.length > 0) { + item.children = children; + } + tree.push(item); + } + }); + + return tree; + } + + // 根据type获取父节点及其所有子节点(树形结构) + async getTreeByType(type) { + const { ctx } = this; + + try { + // 1. 首先找到所有指定type的父节点 + const parentNodes = await ctx.model.FastWhere.findAll({ + where: { type }, + order: [[ 'id', 'ASC' ]], + }); + + // 2. 获取所有数据用于构建树 + const allData = await ctx.model.FastWhere.findAll({ + order: [[ 'id', 'ASC' ]], + }); + + // 3. 转换所有数据为普通对象(触发getter) + const plainAllData = allData.map(item => item.toJSON()); + + // 4. 为每个父节点构建子树 + const result = []; + for (const parent of parentNodes) { + const parentPlain = parent.toJSON(); // 转换为普通对象 + const tree = this.buildSubTree(parentPlain, plainAllData); + result.push(tree); + } + + return result; + } catch (error) { + ctx.logger.error('[FastWhereService.getTreeByType] error:', error); + throw error; + } + } + + // 构建以某个节点为根的子树 + buildSubTree(root, allData) { + const tree = { + ...root, + children: [], + }; + + // 递归查找子节点 + const findChildren = (parentId, parentNode) => { + allData.forEach(item => { + if (item.pid === parentId) { + const childNode = { + ...item, + children: [], + }; + parentNode.children.push(childNode); + findChildren(item.id, childNode); + } + }); + }; + + findChildren(root.id, tree); + return tree; + } + + // 根据type获取父节点,并包含所有子节点(扁平结构) + async getWithChildrenByType(type) { + const { ctx } = this; + + try { + // 1. 首先找到所有指定type的父节点 + const parentNodes = await ctx.model.FastWhere.findAll({ + where: { type }, + order: [[ 'id', 'ASC' ]], + }); + + // 2. 为每个父节点获取所有子节点 + const result = []; + + for (const parent of parentNodes) { + const parentPlain = parent.toJSON(); // 转换为普通对象 + const allChildren = await this.getAllChildren(parent.id); + result.push({ + ...parentPlain, + children: allChildren, + }); + } + + return result; + } catch (error) { + ctx.logger.error('[FastWhereService.getWithChildrenByType] error:', error); + throw error; + } + } + + // 递归获取所有子节点(包括孙子节点等) + async getAllChildren(pid) { + const { ctx } = this; + + // 获取直接子节点 + const directChildren = await ctx.model.FastWhere.findAll({ + where: { pid }, + order: [[ 'id', 'ASC' ]], + }); + + // 递归获取每个子节点的子节点 + const childrenWithDescendants = []; + + for (const child of directChildren) { + const childPlain = child.toJSON(); // 转换为普通对象 + const grandchildren = await this.getAllChildren(child.id); + childrenWithDescendants.push({ + ...childPlain, + children: grandchildren, + }); + } + + return childrenWithDescendants; + } + + // 根据类型获取条件组(仅父节点) + async getByType(type) { + const { ctx } = this; + + const results = await ctx.model.FastWhere.findAll({ + where: { type }, + order: [[ 'id', 'ASC' ]], + }); + + // 转换为普通对象 + return results.map(item => item.toJSON()); + } + + // 获取所有父级组 + async getGroups() { + const { ctx } = this; + + const results = await ctx.model.FastWhere.findAll({ + where: { type: 'group' }, + order: [[ 'id', 'ASC' ]], + }); + + // 转换为普通对象 + return results.map(item => item.toJSON()); + } + + // 根据父级ID获取直接子条件(仅一层) + async getChildrenByPid(pid) { + const { ctx } = this; + + const results = await ctx.model.FastWhere.findAll({ + where: { pid }, + order: [[ 'id', 'ASC' ]], + }); + + // 转换为普通对象 + return results.map(item => item.toJSON()); + } + + // 根据父级ID获取所有层级子条件(树形) + async getTreeChildrenByPid(pid) { + const { ctx } = this; + + try { + // 获取所有数据 + const allData = await ctx.model.FastWhere.findAll({ + order: [[ 'id', 'ASC' ]], + }); + + // 转换为普通对象 + const plainAllData = allData.map(item => item.toJSON()); + + // 找到父节点 + const parentNode = plainAllData.find(item => item.id === pid); + if (!parentNode) { + return null; + } + + // 构建子树 + return this.buildSubTree(parentNode, plainAllData); + } catch (error) { + ctx.logger.error('[FastWhereService.getTreeChildrenByPid] error:', error); + throw error; + } + } + + // 添加快速查询条件 + async create(data) { + const { ctx } = this; + + const result = await ctx.model.FastWhere.create(data); + return result.toJSON(); // 转换为普通对象 + } + + // 更新快速查询条件 + async update(id, data) { + const { ctx } = this; + + const result = await ctx.model.FastWhere.update(data, { + where: { id }, + }); + + if (result[0] === 0) { + ctx.throw(404, '记录不存在'); + } + + const updated = await this.findById(id); + return updated.toJSON(); // 转换为普通对象 + } + + // 根据ID查找 + async findById(id) { + const { ctx } = this; + + const result = await ctx.model.FastWhere.findByPk(id); + if (!result) { + ctx.throw(404, '记录不存在'); + } + return result.toJSON(); // 转换为普通对象 + } + + // 删除快速查询条件 + async delete(id) { + const { ctx } = this; + + // 先检查是否有子节点 + const children = await ctx.model.FastWhere.count({ + where: { pid: id }, + }); + + if (children > 0) { + ctx.throw(400, '请先删除子节点'); + } + + const result = await ctx.model.FastWhere.destroy({ + where: { id }, + }); + + if (result === 0) { + ctx.throw(404, '记录不存在'); + } + + return result; + } + +} + +module.exports = FastWhereService; diff --git a/app/service/systems/file.js b/app/service/systems/file.js new file mode 100644 index 0000000..1946ac6 --- /dev/null +++ b/app/service/systems/file.js @@ -0,0 +1,121 @@ +'use strict'; +const Service = require('egg').Service; + +class FileService extends Service { + async getImages(data) { + const { ctx } = this; + const result = await ctx.model.FileReference.findAll({ where: { + business_type: data.type, + business_id: data.id, + }, include: [ + { + model: ctx.model.File, + as: 'file', + attributes: [ 'file_url', 'file_name' ], + required: true, + }, + ] }); + return result; + } + async ReferenceFile(data) { + const { ctx, service } = this; + const { id, type, images } = data; + const warehouseId = ctx.user.store_id; + + console.log('<<>>>', type); + switch (type) { + case 'stock': + const stock = await ctx.model.StockWarehouse.findOne({ + where: { + warehouse_id: warehouseId, + delete_at: null, + id, + }, + raw: true, + }); + if (!stock) { + throw new Error('找不到商品'); + } + console.log('<<>>>', images.length); + + if (images.length > 0) { + await ctx.model.StockWarehouse.update({ is_images: 'Y' }, { + where: { + id: stock.id, + }, + }); + } else { + await ctx.model.StockWarehouse.update({ is_images: 'N' }, { + where: { + id: stock.id, + }, + }); + } + + await service.systems.operationLog.createOperationLog({ + businessType: 'stock', + businessId: id, + operationCode: 'UPDATE_IMAGES', + operator: { + id: ctx.user.id, + name: ctx.user.employees_name, + }, + extras: { + warehouseId, + }, + beforeChanges: null, + }); + break; + + default: + // code + } + // 获取现有的file_id + const existingRefs = await ctx.model.FileReference.findAll({ + where: { business_type: type, business_id: id, warehouse_id: warehouseId }, + }); + const existingFileIds = existingRefs.map(item => item.file_id); + const newFileIds = images.map(item => item.file_id); + + // 需要删除的ID + const toDeleteIds = existingFileIds.filter(id => !newFileIds.includes(id)); + + // 需要创建的记录 + const toCreate = images.filter(item => !existingFileIds.includes(item.file_id)); + + // 批量操作 + const promises = []; + + if (toDeleteIds.length > 0) { + promises.push( + ctx.model.FileReference.destroy({ + where: { + business_type: type, + business_id: id, + file_id: toDeleteIds, + warehouse_id: warehouseId, + }, + }) + ); + } + + if (toCreate.length > 0) { + const refData = toCreate.map(item => ({ + business_type: type, + business_id: id, + warehouse_id: warehouseId, + file_id: item.file_id, + sort_order: item.sort_order || 0, + created_by: ctx.user.employees_name, + created_at: new Date(), + updated_at: new Date(), + })); + + promises.push(ctx.model.FileReference.bulkCreate(refData)); + } + await Promise.all(promises); + + return { success: true }; + } +} +module.exports = FileService; diff --git a/app/service/systems/location.js b/app/service/systems/location.js new file mode 100644 index 0000000..578e3da --- /dev/null +++ b/app/service/systems/location.js @@ -0,0 +1,420 @@ +'use strict'; + +const Service = require('egg').Service; + +class LocationService extends Service { + /** + * 创建货架并自动生成仓位 + * @param params + */ + async createRackWithSpaces(params) { + const { ctx } = this; + const { app } = ctx; + + // 开启事务 + return await app.model.transaction(async transaction => { + // 1. 创建货架 + const rack = await app.model.LocationZone.create({ + ...params, + zone_type: 'rack', + is_active: true, + }, { transaction }); + + // 2. 自动生成仓位 + await this._generateSpacesForRack(rack.id, rack, transaction); + + // 3. 计算库区内的货架排序 + if (rack.parent_id) { + await this._calculateAreaRackOrder(rack.warehouse_id, rack.parent_id, transaction); + } + + // 4. 计算拣货路径 + await this._calculatePickPathForWarehouse(rack.warehouse_id, transaction); + + return rack; + }); + } + + /** + * 为货架生成仓位 + * @param rackId + * @param rack + * @param transaction + */ + async _generateSpacesForRack(rackId, rack, transaction) { + const { app } = this; + const { rack_columns, rack_rows, rack_levels } = rack; + + const spaces = []; + + // 计算每个仓位的尺寸 + const cellLength = rack.length / rack_columns / 10; // mm转cm + const cellWidth = rack.width / rack_levels / 10; // mm转cm + const cellHeight = rack.height / rack_rows / 10; // mm转cm + + // 生成所有仓位 + for (let row = 1; row <= rack_rows; row++) { + for (let column = 1; column <= rack_columns; column++) { + for (let level = 1; level <= rack_levels; level++) { + const spaceCode = `${rack.zone_code}-${row.toString().padStart(2, '0')}-${column.toString().padStart(2, '0')}-${level.toString().padStart(2, '0')}`; + + // 计算相对坐标 + const relativeX = (column - 1) * cellLength; + const relativeY = (row - 1) * cellHeight; + const relativeZ = (level - 1) * cellWidth; + + spaces.push({ + warehouse_id: rack.warehouse_id, + zone_id: rackId, + location_type_id: 1, // 默认仓位类型 + space_code: spaceCode, + row_no: row.toString(), + column_no: column.toString(), + level_no: level.toString(), + cell_no: `${row}-${column}-${level}`, + length: cellLength, + width: cellWidth, + height: cellHeight, + volume: cellLength * cellWidth * cellHeight / 1000000, // cm³转m³ + max_weight: 100, // 默认100kg + space_status: 'AVAILABLE', + is_enabled: true, + relative_x: relativeX, + relative_y: relativeY, + relative_z: relativeZ, + }); + } + } + } + + // 批量插入仓位 + if (spaces.length > 0) { + await app.model.LocationSpace.bulkCreate(spaces, { transaction }); + } + + this.ctx.logger.info(`为货架 ${rack.zone_code} 生成了 ${spaces.length} 个仓位`); + } + + /** + * 计算库区内货架的排序(按X坐标排序) + * @param warehouseId + * @param areaId + * @param transaction + */ + async _calculateAreaRackOrder(warehouseId, areaId, transaction) { + const { app } = this; + + // 获取库区内的所有货架,按X坐标排序 + const racks = await app.model.LocationZone.findAll({ + where: { + warehouse_id: warehouseId, + parent_id: areaId, + zone_type: 'rack', + is_active: true, + deleted_at: null, + }, + order: [[ 'x', 'ASC' ]], + transaction, + }); + + // 更新排序序号 + for (let i = 0; i < racks.length; i++) { + await racks[i].update({ + path_sequence: i + 1, + }, { transaction }); + } + + this.ctx.logger.info(`更新库区 ${areaId} 内 ${racks.length} 个货架的排序`); + } + + /** + * 计算仓库的拣货路径 + * @param warehouseId + * @param transaction + */ + async _calculatePickPathForWarehouse(warehouseId, transaction) { + const { app } = this; + + // 1. 获取起始拣货点 + const pickStart = await app.model.LocationZone.findOne({ + where: { + warehouse_id: warehouseId, + zone_type: 'pick_start', + is_active: true, + deleted_at: null, + }, + transaction, + }); + + if (!pickStart) { + this.ctx.logger.warn(`仓库 ${warehouseId} 没有设置起始拣货点`); + return; + } + + // 2. 获取所有货架,按距离排序 + const racks = await app.model.LocationZone.findAll({ + where: { + warehouse_id: warehouseId, + zone_type: 'rack', + is_active: true, + deleted_at: null, + }, + transaction, + }); + + // 3. 计算距离并排序(曼哈顿距离) + const sortedRacks = racks.map(rack => { + const distance = Math.abs(rack.x - pickStart.x) + Math.abs(rack.y - pickStart.y); + return { + rack, + distance, + }; + }).sort((a, b) => a.distance - b.distance); + + // 4. 更新货架的拣货顺序和距离 + for (let i = 0; i < sortedRacks.length; i++) { + const { rack, distance } = sortedRacks[i]; + + await rack.update({ + path_sequence: i + 1, + pick_distance: distance, + }, { transaction }); + + // 5. 更新该货架下所有仓位的拣货顺序 + await this._updateSpacePickSequence(rack.id, i + 1, distance, transaction); + } + + this.ctx.logger.info(`为仓库 ${warehouseId} 计算了 ${sortedRacks.length} 个货架的拣货路径`); + } + + /** + * 更新货架下仓位的拣货顺序 + * @param rackId + * @param rackSequence + * @param rackDistance + * @param transaction + */ + async _updateSpacePickSequence(rackId, rackSequence, rackDistance, transaction) { + const { app } = this; + + // 获取货架信息 + const rack = await app.model.LocationZone.findByPk(rackId, { transaction }); + if (!rack) return; + + // 获取货架的所有仓位 + const spaces = await app.model.LocationSpace.findAll({ + where: { + zone_id: rackId, + is_enabled: true, + deleted_at: null, + }, + order: [ + [ 'row_no', 'ASC' ], // 从下层开始 + [ 'column_no', 'ASC' ], // 从左到右 + [ 'level_no', 'ASC' ], // 从外到内 + ], + transaction, + }); + + // 更新每个仓位的拣货顺序 + for (let i = 0; i < spaces.length; i++) { + const space = spaces[i]; + const spaceSequence = rackSequence * 1000 + i + 1; // 货架顺序 + 仓位顺序 + + // 计算预估拣货时间(基于层数) + const row = parseInt(space.row_no) || 1; + let pickTimeEstimate = 30; // 默认30秒 + if (row <= 2) pickTimeEstimate = 25; // 下层快 + else if (row <= 4) pickTimeEstimate = 40; // 中层需要梯子 + else pickTimeEstimate = 60; // 上层需要设备 + + await space.update({ + pick_sequence: spaceSequence, + distance_from_start: rackDistance, + pick_time_estimate: pickTimeEstimate, + pick_priority: this._calculatePickPriority(row, rackDistance), + }, { transaction }); + } + + this.ctx.logger.info(`更新货架 ${rack.zone_code} 下 ${spaces.length} 个仓位的拣货顺序`); + } + + /** + * 计算拣货优先级 + * @param row + * @param distance + */ + _calculatePickPriority(row, distance) { + // 行数越小(下层)优先级越高 + const rowPriority = Math.max(1, 10 - (row || 1)); + + // 距离越近优先级越高 + const distancePriority = Math.max(1, 10 - Math.floor(distance / 1000)); + + // 综合优先级(1-100) + return Math.min(100, Math.max(1, rowPriority * 5 + distancePriority * 5)); + } + + /** + * 更新货架位置后重新计算路径 + * @param rackId + * @param newPosition + */ + async updateRackPosition(rackId, newPosition) { + const { ctx, app } = this; + + return await app.model.transaction(async transaction => { + // 1. 检查货架是否有占用仓位 + const occupiedSpaces = await app.model.LocationSpace.count({ + where: { + zone_id: rackId, + space_status: [ 'OCCUPIED', 'RESERVED' ], + is_enabled: true, + deleted_at: null, + }, + transaction, + }); + + if (occupiedSpaces > 0) { + ctx.throw(400, `货架有 ${occupiedSpaces} 个占用或预留仓位,不能修改位置`); + } + + // 2. 更新货架位置 + const rack = await app.model.LocationZone.findByPk(rackId, { transaction }); + if (!rack) { + ctx.throw(404, '货架不存在'); + } + + await rack.update({ + x: newPosition.x, + y: newPosition.y, + z: newPosition.z || rack.z, + }, { transaction }); + + // 3. 重新计算库区内货架排序 + if (rack.parent_id) { + await this._calculateAreaRackOrder(rack.warehouse_id, rack.parent_id, transaction); + } + + // 4. 重新计算拣货路径 + await this._calculatePickPathForWarehouse(rack.warehouse_id, transaction); + + return rack; + }); + } + + /** + * 获取拣货路径 + * @param warehouseId + * @param options + */ + async getPickPath(warehouseId, options = {}) { + const { app } = this; + const { + includeSpaces = false, + limit = 50, + sortBy = 'path_sequence', + } = options; + + // 获取货架的拣货路径 + const racks = await app.model.LocationZone.findAll({ + where: { + warehouse_id: warehouseId, + zone_type: 'rack', + is_active: true, + deleted_at: null, + }, + order: [[ sortBy, 'ASC' ]], + limit, + include: includeSpaces ? [{ + model: app.model.LocationSpace, + as: 'spaces', + where: { + is_enabled: true, + deleted_at: null, + space_status: [ 'AVAILABLE', 'OCCUPIED' ], + }, + required: false, + order: [[ 'pick_sequence', 'ASC' ]], + }] : [], + }); + + // 计算总距离和时间 + let totalDistance = 0; + let totalTime = 0; + + racks.forEach(rack => { + if (rack.pick_distance) totalDistance += rack.pick_distance; + if (rack.spaces) { + rack.spaces.forEach(space => { + if (space.pick_time_estimate) totalTime += space.pick_time_estimate; + }); + } + }); + + return { + racks, + summary: { + totalRacks: racks.length, + totalDistance: `${(totalDistance / 1000).toFixed(2)}米`, + estimatedTotalTime: `${Math.ceil(totalTime / 60)}分钟`, + }, + }; + } + + /** + * 批量更新邻居关系 + * @param warehouseId + */ + async updateNeighborRelations(warehouseId) { + const { app } = this; + + // 获取所有货架 + const racks = await app.model.LocationZone.findAll({ + where: { + warehouse_id: warehouseId, + zone_type: 'rack', + is_active: true, + deleted_at: null, + }, + }); + + // 为每个货架计算邻居 + for (const rack of racks) { + const neighbors = await this._findNeighborRacks(rack, racks); + await rack.update({ + neighbor_zone_ids: neighbors.map(n => n.id), + }); + } + + this.ctx.logger.info(`为仓库 ${warehouseId} 更新了 ${racks.length} 个货架的邻居关系`); + } + + /** + * 查找相邻货架 + * @param currentRack + * @param allRacks + */ + async _findNeighborRacks(currentRack, allRacks) { + const NEIGHBOR_DISTANCE = 2000; // 2米内视为邻居 + + return allRacks.filter(rack => { + if (rack.id === currentRack.id) return false; + + // 计算两个货架中心点的距离 + const currentCenterX = currentRack.x + currentRack.length / 2; + const currentCenterY = currentRack.y + currentRack.width / 2; + const rackCenterX = rack.x + rack.length / 2; + const rackCenterY = rack.y + rack.width / 2; + + const distance = Math.sqrt( + Math.pow(currentCenterX - rackCenterX, 2) + + Math.pow(currentCenterY - rackCenterY, 2) + ); + + return distance <= NEIGHBOR_DISTANCE; + }); + } +} + +module.exports = LocationService; diff --git a/app/service/systems/location_space.js b/app/service/systems/location_space.js new file mode 100644 index 0000000..779f8b8 --- /dev/null +++ b/app/service/systems/location_space.js @@ -0,0 +1,700 @@ +'use strict'; + +const Service = require('egg').Service; + +class LocationSpaceService extends Service { + /** + * 创建仓位 + * @param data + */ + async create(data) { + const { ctx } = this; + + // 验证参数 + const rules = { + warehouse_id: { type: 'int', required: true }, + zone_id: { type: 'int', required: true }, + location_type_id: { type: 'int', required: true }, + space_code: { type: 'string', required: true, max: 50 }, + custom_name: { type: 'string', required: false, max: 100 }, + custom_barcode: { type: 'string', required: false, max: 100 }, + row_no: { type: 'string', required: false, max: 10 }, + column_no: { type: 'string', required: false, max: 10 }, + level_no: { type: 'string', required: false, max: 10 }, + cell_no: { type: 'string', required: false, max: 10 }, + length: { type: 'number', required: false }, + width: { type: 'number', required: false }, + height: { type: 'number', required: false }, + volume: { type: 'number', required: false }, + max_weight: { type: 'number', required: false }, + }; + + try { + ctx.validate(rules, data); + } catch (error) { + ctx.throw(400, error.errors[0].message); + } + + // 检查仓位编码唯一性 + const exists = await ctx.model.LocationSpace.findOne({ + where: { + warehouse_id: data.warehouse_id, + space_code: data.space_code, + }, + }); + + if (exists) { + ctx.throw(400, '仓位编码已存在'); + } + + // 检查条码唯一性 + if (data.custom_barcode) { + const barcodeExists = await ctx.model.LocationSpace.findOne({ + where: { custom_barcode: data.custom_barcode }, + }); + + if (barcodeExists) { + ctx.throw(400, '条码已存在'); + } + } + + // 检查关联数据存在性 + await this._validateReferences(data); + + // 设置创建人 + const user = ctx.state.user; + if (user && user.id) { + data.created_by = user.id; + } + + return await ctx.model.LocationSpace.create(data); + } + + /** + * 批量创建仓位 + * @param dataList + */ + async batchCreate(dataList) { + const { ctx } = this; + + if (!Array.isArray(dataList) || dataList.length === 0) { + ctx.throw(400, '仓位数据不能为空'); + } + + // 检查批量数据中的唯一性 + const warehouseId = dataList[0].warehouse_id; + const spaceCodes = dataList.map(item => item.space_code); + const barcodes = dataList.map(item => item.custom_barcode).filter(Boolean); + + // 检查编码重复 + const duplicateCodes = await ctx.model.LocationSpace.findAll({ + where: { + warehouse_id: warehouseId, + space_code: { [ctx.app.Sequelize.Op.in]: spaceCodes }, + }, + attributes: [ 'space_code' ], + raw: true, + }); + + if (duplicateCodes.length > 0) { + const codes = duplicateCodes.map(item => item.space_code).join(','); + ctx.throw(400, `以下仓位编码已存在: ${codes}`); + } + + // 检查条码重复 + if (barcodes.length > 0) { + const duplicateBarcodes = await ctx.model.LocationSpace.findAll({ + where: { + custom_barcode: { [ctx.app.Sequelize.Op.in]: barcodes }, + }, + attributes: [ 'custom_barcode' ], + raw: true, + }); + + if (duplicateBarcodes.length > 0) { + const codes = duplicateBarcodes.map(item => item.custom_barcode).join(','); + ctx.throw(400, `以下条码已存在: ${codes}`); + } + } + + // 批量创建 + const user = ctx.state.user; + const timestamp = new Date(); + + const locationSpaces = dataList.map(data => ({ + ...data, + created_by: user ? user.id : null, + created_at: timestamp, + updated_at: timestamp, + })); + + return await ctx.model.LocationSpace.bulkCreate(locationSpaces); + } + + /** + * 获取仓位列表 + * @param params + */ + async list(params = {}) { + const { ctx } = this; + const { + warehouse_id, + zone_id, + location_type_id, + space_status, + is_enabled, + space_code, + custom_name, + page = 1, + pageSize = 20, + } = params; + + const where = {}; + + if (warehouse_id) { + where.warehouse_id = warehouse_id; + } + + if (zone_id) { + where.zone_id = zone_id; + } + + if (location_type_id) { + where.location_type_id = location_type_id; + } + + if (space_status) { + where.space_status = space_status; + } + + if (is_enabled !== undefined) { + where.is_enabled = is_enabled; + } + + if (space_code) { + where.space_code = { [ctx.app.Sequelize.Op.like]: `%${space_code}%` }; + } + + if (custom_name) { + where.custom_name = { [ctx.app.Sequelize.Op.like]: `%${custom_name}%` }; + } + + const { count, rows } = await ctx.model.LocationSpace.findAndCountAll({ + where, + include: [ + { + model: ctx.model.Store, + as: 'warehouse', + attributes: [ 'store_name', 'store_code' ], + }, + { + model: ctx.model.LocationZone, + as: 'zone', + attributes: [ 'zone_code', 'zone_name' ], + }, + { + model: ctx.model.LocationType, + as: 'locationType', + attributes: [ 'type_code', 'type_name', 'category' ], + }, + ], + order: [ + [ 'warehouse_id', 'ASC' ], + [ 'zone_id', 'ASC' ], + [ 'row_no', 'ASC' ], + [ 'column_no', 'ASC' ], + [ 'level_no', 'ASC' ], + [ 'cell_no', 'ASC' ], + ], + offset: (page - 1) * pageSize, + limit: parseInt(pageSize), + distinct: true, + }); + + return { + list: rows, + pagination: { + page: parseInt(page), + pageSize: parseInt(pageSize), + total: count, + totalPages: Math.ceil(count / pageSize), + }, + }; + } + + /** + * 获取仓位详情 + * @param id + */ + async detail(id) { + const { ctx } = this; + + const locationSpace = await ctx.model.LocationSpace.findByPk(id, { + include: [ + { + model: ctx.model.Store, + as: 'warehouse', + attributes: [ 'id', 'store_name', 'store_code' ], + }, + { + model: ctx.model.LocationZone, + as: 'zone', + attributes: [ 'id', 'zone_code', 'zone_name' ], + }, + { + model: ctx.model.LocationType, + as: 'locationType', + attributes: [ 'id', 'type_code', 'type_name', 'category', + 'allow_allocation', 'allow_transfer_out' ], + }, + ], + }); + + if (!locationSpace) { + ctx.throw(404, '仓位不存在'); + } + + return locationSpace; + } + + /** + * 更新仓位 + * @param id + * @param data + */ + async update(id, data) { + const { ctx } = this; + + const locationSpace = await ctx.model.LocationSpace.findByPk(id); + if (!locationSpace) { + ctx.throw(404, '仓位不存在'); + } + + // 不能修改的字段 + const protectedFields = [ 'id', 'warehouse_id', 'created_at', 'created_by' ]; + protectedFields.forEach(field => delete data[field]); + + // 如果修改编码,检查唯一性 + if (data.space_code && data.space_code !== locationSpace.space_code) { + const exists = await ctx.model.LocationSpace.findOne({ + where: { + warehouse_id: locationSpace.warehouse_id, + space_code: data.space_code, + id: { [ctx.app.Sequelize.Op.ne]: id }, + }, + }); + + if (exists) { + ctx.throw(400, '仓位编码已存在'); + } + } + + // 如果修改条码,检查唯一性 + if (data.custom_barcode && data.custom_barcode !== locationSpace.custom_barcode) { + const exists = await ctx.model.LocationSpace.findOne({ + where: { + custom_barcode: data.custom_barcode, + id: { [ctx.app.Sequelize.Op.ne]: id }, + }, + }); + + if (exists) { + ctx.throw(400, '条码已存在'); + } + } + + // 检查关联数据存在性 + if (data.zone_id || data.location_type_id) { + await this._validateReferences({ + zone_id: data.zone_id || locationSpace.zone_id, + location_type_id: data.location_type_id || locationSpace.location_type_id, + }); + } + + // 设置更新人 + const user = ctx.state.user; + if (user && user.id) { + data.updated_by = user.id; + } + + await locationSpace.update(data); + return locationSpace; + } + + /** + * 删除仓位(软删除) + * @param id + */ + async delete(id) { + const { ctx } = this; + + const locationSpace = await ctx.model.LocationSpace.findByPk(id); + if (!locationSpace) { + ctx.throw(404, '仓位不存在'); + } + + // 检查仓位是否被使用 + if (locationSpace.space_status === 'OCCUPIED') { + ctx.throw(400, '仓位已被占用,无法删除'); + } + + if (locationSpace.current_quantity > 0) { + ctx.throw(400, '仓位内仍有库存,无法删除'); + } + + // 软删除:设置为禁用 + const user = ctx.state.user; + const updateData = { + is_enabled: 0, + space_status: 'DISABLED', + }; + + if (user && user.id) { + updateData.updated_by = user.id; + } + + await locationSpace.update(updateData); + return true; + } + + /** + * 启用/禁用仓位 + * @param id + * @param enabled + */ + async toggleStatus(id, enabled) { + const { ctx } = this; + + const locationSpace = await ctx.model.LocationSpace.findByPk(id); + if (!locationSpace) { + ctx.throw(404, '仓位不存在'); + } + + const user = ctx.state.user; + const updateData = { + is_enabled: enabled ? 1 : 0, + }; + + if (!enabled && locationSpace.space_status === 'AVAILABLE') { + updateData.space_status = 'DISABLED'; + } + + if (user && user.id) { + updateData.updated_by = user.id; + } + + await locationSpace.update(updateData); + return locationSpace; + } + + /** + * 更新仓位状态 + * @param id + * @param status + */ + async updateStatus(id, status) { + const { ctx } = this; + + const validStatuses = [ 'AVAILABLE', 'OCCUPIED', 'RESERVED', 'MAINTENANCE', 'DISABLED' ]; + if (!validStatuses.includes(status)) { + ctx.throw(400, '无效的仓位状态'); + } + + const locationSpace = await ctx.model.LocationSpace.findByPk(id); + if (!locationSpace) { + ctx.throw(404, '仓位不存在'); + } + + // 状态转换限制 + const statusRules = { + OCCUPIED: () => { + if (locationSpace.space_status !== 'AVAILABLE' && locationSpace.space_status !== 'RESERVED') { + throw new Error('只有可用或预留仓位才能设置为占用'); + } + }, + AVAILABLE: () => { + if (locationSpace.space_status === 'OCCUPIED' && locationSpace.current_quantity > 0) { + throw new Error('占用仓位有库存时不能设置为可用'); + } + }, + }; + + if (statusRules[status]) { + try { + statusRules[status](); + } catch (error) { + ctx.throw(400, error.message); + } + } + + const user = ctx.state.user; + const updateData = { space_status: status }; + + if (user && user.id) { + updateData.updated_by = user.id; + } + + await locationSpace.update(updateData); + return locationSpace; + } + + /** + * 查询可用仓位 + * @param params + */ + async findAvailableSpaces(params) { + const { ctx } = this; + const { warehouse_id, zone_id, location_type_id } = params; + + const where = { + space_status: 'AVAILABLE', + is_enabled: 1, + }; + + if (warehouse_id) { + where.warehouse_id = warehouse_id; + } + + if (zone_id) { + where.zone_id = zone_id; + } + + if (location_type_id) { + where.location_type_id = location_type_id; + } + + return await ctx.model.LocationSpace.findAll({ + where, + include: [ + { + model: ctx.model.LocationZone, + as: 'zone', + attributes: [ 'zone_code', 'zone_name' ], + }, + { + model: ctx.model.LocationType, + as: 'locationType', + where: { allow_allocation: 1, is_active: 1 }, + attributes: [ 'type_code', 'type_name' ], + }, + ], + order: [ + [ 'zone_id', 'ASC' ], + [ 'row_no', 'ASC' ], + [ 'column_no', 'ASC' ], + [ 'level_no', 'ASC' ], + [ 'cell_no', 'ASC' ], + ], + }); + } + + /** + * 根据编码查找仓位 + * @param warehouseId + * @param spaceCode + */ + async findByCode(warehouseId, spaceCode) { + const { ctx } = this; + + const locationSpace = await ctx.model.LocationSpace.findOne({ + where: { + warehouse_id: warehouseId, + space_code: spaceCode, + is_enabled: 1, + }, + include: [ + { + model: ctx.model.LocationZone, + as: 'zone', + attributes: [ 'zone_code', 'zone_name' ], + }, + { + model: ctx.model.LocationType, + as: 'locationType', + attributes: [ 'type_code', 'type_name', 'allow_allocation', 'allow_transfer_out' ], + }, + ], + }); + + if (!locationSpace) { + ctx.throw(404, '仓位不存在'); + } + + return locationSpace; + } + + /** + * 根据条码查找仓位 + * @param barcode + */ + async findByBarcode(barcode) { + const { ctx } = this; + + const locationSpace = await ctx.model.LocationSpace.findOne({ + where: { + custom_barcode: barcode, + is_enabled: 1, + }, + include: [ + { + model: ctx.model.Store, + as: 'warehouse', + attributes: [ 'store_name', 'store_code' ], + }, + { + model: ctx.model.LocationZone, + as: 'zone', + attributes: [ 'zone_code', 'zone_name' ], + }, + ], + }); + + if (!locationSpace) { + ctx.throw(404, '仓位不存在'); + } + + return locationSpace; + } + + /** + * 获取仓库仓位统计 + * @param warehouseId + */ + async getWarehouseStats(warehouseId) { + const { ctx } = this; + + const stats = await ctx.model.LocationSpace.getWarehouseStats(ctx.app, warehouseId); + + // 汇总数据 + const result = { + available: 0, + occupied: 0, + reserved: 0, + maintenance: 0, + disabled: 0, + total: 0, + }; + + stats.forEach(item => { + result[item.space_status.toLowerCase()] = parseInt(item.count); + result.total += parseInt(item.count); + }); + + return result; + } + + /** + * 获取分区的仓位统计 + * @param warehouseId + * @param zoneId + */ + async getZoneStats(warehouseId, zoneId = null) { + const { ctx } = this; + + const stats = await ctx.model.LocationSpace.getZoneStats(ctx.app, warehouseId); + + if (zoneId) { + return stats.find(item => item.zone_id === zoneId); + } + + return stats; + } + + /** + * 验证仓位是否可分配 + * @param locationSpaceId + */ + async validateAllocation(locationSpaceId) { + const { ctx } = this; + + const locationSpace = await ctx.model.LocationSpace.findByPk(locationSpaceId, { + include: [{ + model: ctx.model.LocationType, + as: 'locationType', + attributes: [ 'allow_allocation', 'is_active' ], + }], + }); + + if (!locationSpace) { + ctx.throw(404, '仓位不存在'); + } + + if (!locationSpace.isAvailable()) { + ctx.throw(400, '仓位不可用'); + } + + if (!locationSpace.locationType || + locationSpace.locationType.allow_allocation !== 1 || + locationSpace.locationType.is_active !== 1) { + ctx.throw(400, '该仓位类型不允许分配'); + } + + return locationSpace; + } + + /** + * 验证仓位是否可移出 + * @param locationSpaceId + */ + async validateTransferOut(locationSpaceId) { + const { ctx } = this; + + const locationSpace = await ctx.model.LocationSpace.findByPk(locationSpaceId, { + include: [{ + model: ctx.model.LocationType, + as: 'locationType', + attributes: [ 'allow_transfer_out', 'is_active' ], + }], + }); + + if (!locationSpace) { + ctx.throw(404, '仓位不存在'); + } + + if (locationSpace.space_status !== 'OCCUPIED') { + ctx.throw(400, '仓位未被占用'); + } + + if (!locationSpace.locationType || + locationSpace.locationType.allow_transfer_out !== 1 || + locationSpace.locationType.is_active !== 1) { + ctx.throw(400, '该仓位类型不允许移出'); + } + + return locationSpace; + } + + /** + * 内部方法:验证关联数据 + * @param data + */ + async _validateReferences(data) { + const { ctx } = this; + + // 验证仓库存在 + if (data.warehouse_id) { + const warehouse = await ctx.model.Store.findByPk(data.warehouse_id); + if (!warehouse) { + ctx.throw(400, '仓库不存在'); + } + } + + // 验证分区存在 + if (data.zone_id) { + const zone = await ctx.model.LocationZone.findByPk(data.zone_id); + if (!zone || !zone.is_active) { + ctx.throw(400, '分区不存在或已禁用'); + } + } + + // 验证仓位类型存在 + if (data.location_type_id) { + const locationType = await ctx.model.LocationType.findByPk(data.location_type_id); + if (!locationType || !locationType.is_active) { + ctx.throw(400, '仓位类型不存在或已禁用'); + } + } + } +} + +module.exports = LocationSpaceService; diff --git a/app/service/systems/location_zone.js b/app/service/systems/location_zone.js new file mode 100644 index 0000000..7a857d8 --- /dev/null +++ b/app/service/systems/location_zone.js @@ -0,0 +1,1070 @@ +'use strict'; + +const Service = require('egg').Service; + +class LocationZoneService extends Service { + /** + * 获取所有仓库级别的分区列表 + * @param warehouseId + * @return {Promise} 仓库级别分区列表 + */ + async getWarehouseLevelZones(warehouseId) { + const { ctx, app } = this; + + try { + const zones = await ctx.model.LocationZone.findAll({ + where: { + zone_type: 'warehouse', + deleted_at: null, + is_active: 1, + warehouse_id: warehouseId, + }, + order: [ + [ 'created_at', 'DESC' ], + ], + raw: false, // 保持 Sequelize 实例,方便后续操作 + }); + for (let i = 0; i < zones.length; i++) { + const warehouse_tree = await this.getZoneTreeByWarehouse(zones[i].id); + const racks = []; + let areaCount = 0; + let rackCount = 0; + let totalSpaces = 0; + for (let ii = 0; ii < warehouse_tree.warehouseRoot.children.length; ii++) { + const area = warehouse_tree.warehouseRoot.children[ii]; + console.log('area', area); + for (let iii = 0; iii < area.children.length; iii++) { + const zone = area.children[iii]; + if (zone.type == 'rack') { + console.log('货架', zone); + racks.push(zone); + rackCount++; + const sz_count = await app.model.LocationSpace.count({ where: { zone_id: zone.id } }); + console.log(sz_count); + const { rackColumns = 1, rackRows = 1, rackLevels = 1 } = zone.data; + totalSpaces += rackColumns * rackRows * rackLevels; + } + } + if (area.type == 'area') { + areaCount++; + } + } + zones[i].rackCount = rackCount; + zones[i].areaCount = areaCount; + zones[i].totalSpaces = totalSpaces; + console.log('zones[i]', i, rackCount, areaCount, zones[i].rackCount, zones[i].areaCount); + } + // 转换为前端需要的格式 + return zones.map(zone => ({ + id: zone.id, + label: zone.zone_name, + code: zone.zone_code, + length: zone.length, + width: zone.width, + height: zone.height, + areaCount: zone.areaCount, + rackCount: zone.rackCount, + totalSpaces: zone.totalSpaces, + createdAt: zone.created_at, + + })); + } catch (error) { + ctx.logger.error('获取仓库级别分区失败:', error); + throw new Error('获取仓库列表失败'); + } + } + + /** + * 根据仓库ID获取完整的树状结构(支持Element Tree格式) + * @param {number} warehouseId - 仓库ID + * @param warehouseSpaceId + * @return {Promise} 树状结构数据 + */ + async getZoneTreeByWarehouse(warehouseSpaceId) { + const { ctx } = this; + const warehouseId = ctx.user.store_id; + + try { + // 1. 获取指定仓库实体(zone_type = 'warehouse') + const warehouseEntity = await ctx.model.LocationZone.findOne({ + where: { + id: warehouseSpaceId, + zone_type: 'warehouse', + warehouse_id: warehouseId, // 属于当前主体的仓库 + deleted_at: null, + is_active: 1, + }, + }); + + if (!warehouseEntity) { + throw new Error('仓库不存在或无权访问'); + } + + // 2. 获取该仓库实体下的所有子分区 + const zones = await ctx.model.LocationZone.findAll({ + where: { + warehouse_id: warehouseId, // 所属主体 + deleted_at: null, + is_active: 1, + }, + order: [ + [ 'zone_type', 'ASC' ], + [ 'zone_code', 'ASC' ], + ], + raw: false, + }); + + // 3. 转换为树形结构 + const zoneMap = new Map(); + const treeNodes = []; + + // 首先将所有节点放入map + zones.forEach(zone => { + const node = { + id: zone.id, + label: `${zone.zone_code || ''} - ${zone.zone_name}`, + type: zone.zone_type, + code: zone.zone_code, + name: zone.zone_name, + parentId: zone.parent_id, + children: [], + // 扩展属性 + data: { + x: zone.x, + y: zone.y, + z: zone.z, + length: zone.length, + width: zone.width, + height: zone.height, + rackColumns: zone.rack_columns, + rackRows: zone.rack_rows, + rackLevels: zone.rack_levels, + direction: zone.direction, + color: zone.color, + isActive: zone.is_active, + createdAt: zone.created_at, + }, + }; + + zoneMap.set(zone.id, node); + + // 如果没有父节点(应该是直接属于仓库的子节点),直接加入根节点 + if (!zone.parent_id || zone.parent_id === warehouseSpaceId) { + treeNodes.push(node); + } + }); + + // 4. 构建父子关系(递归构建) + const buildTree = parentId => { + const children = []; + zones.forEach(zone => { + if (zone.parent_id === parentId) { + const node = zoneMap.get(zone.id); + if (node) { + node.children = buildTree(zone.id); + children.push(node); + } + } + }); + return children; + }; + + // 5. 从仓库实体的直接子节点开始构建树 + const warehouseTree = buildTree(warehouseSpaceId); + + // 6. 按类型排序子节点 + const sortChildren = children => { + if (!children || children.length === 0) return; + + // 按类型排序:area -> aisle -> rack -> obstacle/gate/pick_start + const typeOrder = { + area: 1, + aisle: 2, + rack: 3, + obstacle: 4, + gate: 5, + pick_start: 6, + }; + + children.sort((a, b) => { + const orderA = typeOrder[a.type] || 999; + const orderB = typeOrder[b.type] || 999; + if (orderA !== orderB) { + return orderA - orderB; + } + return (a.code || '').localeCompare(b.code || ''); + }); + + // 递归排序子节点 + children.forEach(child => sortChildren(child.children)); + }; + + sortChildren(warehouseTree); + + // 7. 创建完整的仓库根节点 + const warehouseRoot = { + id: warehouseEntity.id, + label: `${warehouseEntity.zone_code || ''} - ${warehouseEntity.zone_name}`, + type: 'warehouse', + code: warehouseEntity.zone_code, + name: warehouseEntity.zone_name, + children: warehouseTree, + data: { + x: warehouseEntity.x, + y: warehouseEntity.y, + z: warehouseEntity.z, + length: warehouseEntity.length, + width: warehouseEntity.width, + height: warehouseEntity.height, + color: warehouseEntity.color, + isActive: warehouseEntity.is_active, + createdAt: warehouseEntity.created_at, + // 主体信息 + storeInfo: warehouseEntity.warehouse ? { + storeName: warehouseEntity.warehouse.store_name, + storeCode: warehouseEntity.warehouse.store_code, + address: warehouseEntity.warehouse.address, + contact: warehouseEntity.warehouse.contact, + phone: warehouseEntity.warehouse.phone, + } : null, + }, + }; + return { warehouseRoot, code: 200 }; + } catch (error) { + ctx.logger.error('获取仓库树状结构失败:', error); + throw error; + } + } + + /** + * 根据分区ID获取子树(用于懒加载) + * @param {number} zoneId - 分区ID + * @return {Promise} 子节点列表 + */ + async getChildrenByZoneId(zoneId) { + const { ctx } = this; + + try { + // 验证分区是否存在 + const parentZone = await ctx.model.LocationZone.findOne({ + where: { + id: zoneId, + deleted_at: null, + }, + }); + + if (!parentZone) { + throw new Error('分区不存在'); + } + + const children = await ctx.model.LocationZone.findAll({ + where: { + parent_id: zoneId, + deleted_at: null, + is_active: 1, + }, + order: [ + [ 'zone_type', 'ASC' ], + [ 'zone_code', 'ASC' ], + ], + }); + + return children.map(async child => ({ + id: child.id, + label: `${child.zone_code} - ${child.zone_name}`, + type: child.zone_type, + code: child.zone_code, + name: child.zone_name, + parentId: child.parent_id, + children: [], // 初始为空,支持懒加载 + isLeaf: await this.isLeafNode(child.id), + data: { + x: child.x, + y: child.y, + z: child.z, + length: child.length, + width: child.width, + height: child.height, + rackColumns: child.rack_columns, + rackRows: child.rack_rows, + rackLevels: child.rack_levels, + direction: child.direction, + color: child.color, + isActive: child.is_active, + }, + })); + } catch (error) { + ctx.logger.error('获取子分区失败:', error); + throw error; + } + } + + /** + * 判断节点是否为叶子节点 + * @param {number} zoneId - 分区ID + * @return {Promise} 是否为叶子节点 + */ + async isLeafNode(zoneId) { + const { ctx } = this; + + const count = await ctx.model.LocationZone.count({ + where: { + parent_id: zoneId, + deleted_at: null, + is_active: 1, + }, + }); + + return count === 0; + } + + /** + * 创建元素 + * @param {Object} data - 元素数据 + * @return {Promise} 创建的元素 + */ + /** + * 创建元素 + * @param {Object} data - 元素数据 + * @return {Promise} 创建的元素 + */ + async createZone(data) { + const { ctx } = this; + try { + const warehouse_id = ctx.user.store_id; + + // 1. 基本字段验证 + this.validateBasicFields(data); + + // 2. 根据类型进行特定验证 + await this.validateByZoneType(data, warehouse_id); + + // 3. 验证父元素 + await this.validateParentElement(data, warehouse_id); + + + // 5. 处理编码(根据类型) + const zoneCode = this.generateZoneCodeByType(data); + + // 6. 创建分区 + const zone = await ctx.model.LocationZone.create({ + warehouse_id, + zone_code: zoneCode, + zone_name: data.zone_name, + zone_type: data.zone_type, + parent_id: data.parent_id || null, + is_active: data.is_active !== undefined ? data.is_active : 1, + x: data.x, + y: data.y, + z: data.z, + length: data.length, + width: data.width, + height: data.height, + rack_columns: data.rack_columns, + rack_rows: data.rack_rows, + rack_levels: data.rack_levels, + direction: data.direction, + color: data.color || this.getDefaultColorByType(data.zone_type), + }); + if (zone.zone_type == 'rack') { + await this.generateSpacesForRack(zone.id, zone); + } + return { + success: true, + data: zone, + message: '创建成功', + }; + } catch (error) { + ctx.logger.error('创建分区失败:', error); + throw error; + } + } + + /** + * 验证基本字段 + * @param data + */ + validateBasicFields(data) { + // 所有元素都需要这些字段 + const requiredFields = [ 'x', 'y', 'z', 'length', 'width', 'height', 'zone_type', 'zone_name' ]; + + for (const field of requiredFields) { + if (data[field] === undefined || data[field] === null || data[field] === '') { + throw new Error(`字段 ${field} 不能为空`); + } + } + + // 坐标和尺寸必须是正数 + const numberFields = [ 'x', 'y', 'z', 'length', 'width', 'height' ]; + for (const field of numberFields) { + if (typeof data[field] !== 'number' || data[field] < 0) { + throw new Error(`字段 ${field} 必须是正数`); + } + } + } + + /** + * 根据类型进行特定验证 + * @param data + * @param warehouseId + */ + async validateByZoneType(data, warehouseId) { + const { ctx } = this; + + switch (data.zone_type) { + case 'warehouse': + // 仓库必须 parent_id = 0 + if (data.parent_id !== 0 && data.parent_id !== null) { + throw new Error('仓库元素的父元素必须为0或null'); + } + break; + + case 'area': + // 库区必须有父元素且父元素必须是仓库 + if (!data.parent_id) { + throw new Error('库区必须指定父元素'); + } + const parentArea = await ctx.model.LocationZone.findOne({ + where: { + id: data.parent_id, + warehouse_id: warehouseId, + deleted_at: null, + }, + }); + if (!parentArea) { + throw new Error('父元素不存在'); + } + if (parentArea.zone_type !== 'warehouse') { + throw new Error('库区只能创建在仓库上'); + } + break; + + case 'rack': + // 货架必须有父元素且父元素必须是通道 + if (!data.parent_id) { + throw new Error('货架必须指定父元素'); + } + const parentRack = await ctx.model.LocationZone.findOne({ + where: { + id: data.parent_id, + warehouse_id: warehouseId, + deleted_at: null, + }, + }); + if (!parentRack) { + throw new Error('父元素不存在'); + } + if (parentRack.zone_type !== 'area') { + throw new Error('货架只能创建在库区上'); + } + + // 货架必须有货架属性 + if (!data.rack_columns || !data.rack_rows || !data.rack_levels) { + throw new Error('货架必须设置列数、层数和分格数'); + } + if (!data.direction) { + throw new Error('货架必须设置朝向'); + } + + // 货架属性必须是正数 + if (data.rack_columns <= 0 || data.rack_rows <= 0 || data.rack_levels <= 0) { + throw new Error('货架列数、层数、分格数必须大于0'); + } + break; + case 'pick_start': + // 这些元素必须有父元素且父元素可以是任何类型(除了自身) + if (!data.parent_id) { + throw new Error(`${this.getZoneTypeText(data.zone_type)}必须指定父元素`); + } + const parentSpecial = await ctx.model.LocationZone.findOne({ + where: { + id: data.parent_id, + warehouse_id: warehouseId, + deleted_at: null, + }, + }); + if (parentSpecial.zone_type !== 'area') { + throw new Error('拣货起点只能创建在库区上'); + } + if (!parentSpecial) { + throw new Error('父元素不存在'); + } + break; + + default: + throw new Error('不支持的分区类型'); + } + } + + /** + * 验证父元素 + * @param data + * @param warehouseId + */ + async validateParentElement(data, warehouseId) { + const { ctx } = this; + + // 仓库类型不需要父元素验证(已经在上面的switch中处理) + if (data.zone_type === 'warehouse') { + return; + } + + // 其他类型必须要有父元素 + if (!data.parent_id) { + throw new Error('必须指定父元素'); + } + + const parent = await ctx.model.LocationZone.findOne({ + where: { + id: data.parent_id, + warehouse_id: warehouseId, + deleted_at: null, + is_active: 1, + }, + }); + + if (!parent) { + throw new Error('父元素不存在或已禁用'); + } + + // 检查是否在父元素范围内 + const parentEndX = parent.x + parent.length; + const parentEndY = parent.y + parent.width; + const parentEndZ = parent.z + parent.height; + + const elementEndX = data.x + data.length; + const elementEndY = data.y + data.width; + const elementEndZ = data.z + data.height; + + } + + /** + * 验证坐标是否重叠 + * @param data + * @param warehouseId + * @param excludeId + */ + async validateZoneOverlap(data, warehouseId, excludeId = null) { + const { ctx } = this; + + const overlaps = await ctx.model.LocationZone.findAll({ + where: { + warehouse_id: warehouseId, + deleted_at: null, + parent_id: data.parent_id, + id: excludeId ? { $ne: excludeId } : undefined, + }, + }); + + for (const existingZone of overlaps) { + if (this.isOverlap(data, existingZone)) { + throw new Error(`坐标与现有元素"${existingZone.zone_name}"重叠`); + } + } + } + + /** + * 检查两个元素是否重叠 + * @param zone1 + * @param zone2 + */ + isOverlap(zone1, zone2) { + const zone1EndX = zone1.x + zone1.length; + const zone1EndY = zone1.y + zone1.width; + const zone1EndZ = zone1.z + zone1.height; + + const zone2EndX = zone2.x + zone2.length; + const zone2EndY = zone2.y + zone2.width; + const zone2EndZ = zone2.z + zone2.height; + + // AABB碰撞检测 + const overlapX = !(zone1EndX <= zone2.x || zone1.x >= zone2EndX); + const overlapY = !(zone1EndY <= zone2.y || zone1.y >= zone2EndY); + const overlapZ = !(zone1EndZ <= zone2.z || zone1.z >= zone2EndZ); + + return overlapX && overlapY && overlapZ; + } + + /** + * 根据类型生成编码 + * @param data + */ + generateZoneCodeByType(data) { + // 只有特定类型需要编码 + const zoneTypesRequireCode = [ 'warehouse', 'area', 'rack' ]; + + if (!zoneTypesRequireCode.includes(data.zone_type)) { + return null; + } + + // 如果已经提供了编码,使用提供的编码 + if (data.zone_code) { + // 验证编码格式 + if (!/^[A-Z0-9]{1,5}$/.test(data.zone_code)) { + throw new Error('编码必须是1-5位大写字母或数字'); + } + return data.zone_code; + } + + // 自动生成编码 + const prefixMap = { + warehouse: 'WH', + area: 'A', + rack: 'R', + }; + + const prefix = prefixMap[data.zone_type]; + const timestamp = Date.now().toString().slice(-3); + const random = Math.floor(Math.random() * 10); + return `${prefix}${timestamp}${random}`; + } + + /** + * 根据类型获取默认颜色 + * @param zoneType + */ + getDefaultColorByType(zoneType) { + const colorMap = { + warehouse: '#96ceb4', + area: '#c6e48b', + aisle: '#239a3b', + rack: '#7bc96f', + obstacle: '#ff6b6b', + gate: '#4ecdc4', + pick_start: '#45b7d1', + }; + return colorMap[zoneType] || '#3B82F6'; + } + + /** + * 获取类型文本 + * @param type + */ + getZoneTypeText(type) { + const typeMap = { + warehouse: '仓库', + area: '库区', + aisle: '通道', + rack: '货架', + obstacle: '障碍物', + gate: '大门', + pick_start: '拣货点', + }; + return typeMap[type] || type; + } + + /** + * 更新分区 + * @param {number} id - 分区ID + * @param {Object} data - 更新数据 + * @return {Promise} 更新结果 + */ + async updateZone(id, data) { + const { ctx } = this; + + try { + const zone = await ctx.model.LocationZone.findOne({ + where: { + id, + deleted_at: null, + }, + }); + + if (!zone) { + throw new Error('分区不存在'); + } + + console.log('修改的数据', data); + // 验证坐标是否重叠(如果修改了坐标) + if ( + (data.x !== undefined || data.y !== undefined || data.length || data.width) && + zone.warehouse_id + ) { + const x = data.x !== undefined ? data.x : zone.x; + const y = data.y !== undefined ? data.y : zone.y; + const z = data.z !== undefined ? data.z : zone.z || 0; + const length = data.length || zone.length; + const width = data.width || zone.width; + const height = data.height || zone.height || 0; + + const overlaps = await this.checkZoneOverlap( + zone.warehouse_id, + x, + y, + z, + length, + width, + height, + id // 排除当前分区 + ); + + if (overlaps.length > 0) { + throw new Error('区域坐标与其他分区重叠'); + } + } + + // 更新分区 + await zone.update(data); + + return { + success: true, + data: zone, + message: '更新成功', + code: 200, + }; + } catch (error) { + ctx.logger.error('更新分区失败:', error); + throw error; + } + } + + /** + * 软删除分区 + * @param {number} id - 分区ID + * @return {Promise} 删除结果 + */ + async deleteZone(id) { + const { ctx } = this; + console.log('需要删除的id', id); + try { + const zone = await ctx.model.LocationZone.findOne({ + where: { + id, + deleted_at: null, + }, + }); + + if (!zone) { + throw new Error('分区不存在'); + } + // 检查是否有子分区 + const childrenCount = await ctx.model.LocationZone.count({ + where: { + parent_id: id, + deleted_at: null, + }, + }); + if (zone.zone_type == 'rack') { + // 货架执行删除需要检测库位是否还有库存 + throw new Error('货架XX库位有库存,禁止删除,请先移库'); + } + if (childrenCount > 0) { + throw new Error('请先删除或转移所有子分区'); + } + // 执行软删除 + await zone.destroy(); + return { + success: true, + message: '删除成功', + }; + } catch (error) { + ctx.logger.error('删除分区失败:', error); + throw error; + } + } + + /** + * 检查区域重叠 + * @param warehouseId + * @param x + * @param y + * @param z + * @param length + * @param width + * @param height + * @param excludeId + * @private + */ + async checkZoneOverlap(warehouseId, x, y, z, length, width, height, excludeId) { + const { ctx } = this; + + if (!warehouseId || x === undefined || y === undefined || !length || !width) { + return []; + } + + const where = { + warehouse_id: warehouseId, + deleted_at: null, + x: { $ne: null }, + y: { $ne: null }, + length: { $ne: null }, + width: { $ne: null }, + }; + + if (excludeId) { + where.id = { $ne: excludeId }; + } + + const zones = await ctx.model.LocationZone.findAll({ + where, + attributes: [ 'id', 'zone_code', 'zone_name', 'x', 'y', 'z', 'length', 'width', 'height' ], + }); + + // 检查空间重叠 + return zones.filter(zone => { + const zHeight = zone.height || 0; + const currentHeight = height || 0; + + // AABB(轴对齐边界框)碰撞检测 + const overlapX = !(x + length <= zone.x || x >= zone.x + zone.length); + const overlapY = !(y + width <= zone.y || y >= zone.y + zone.width); + const overlapZ = !(z + currentHeight <= zone.z || z >= zone.z + zHeight); + + return overlapX && overlapY && overlapZ; + }); + } + + /** + * 根据分区ID获取分区详情 + * @param {number} id - 分区ID + * @return {Promise} 分区详情 + */ + async getZoneDetail(id) { + const { ctx } = this; + + try { + const zone = await ctx.model.LocationZone.findOne({ + where: { + id, + deleted_at: null, + }, + }); + + if (!zone) { + throw new Error('分区不存在'); + } + + return { zone, code: 200 }; + } catch (error) { + ctx.logger.error('获取分区详情失败:', error); + throw error; + } + } + + /** + * 启用/禁用分区 + * @param {number} id - 分区ID + * @param {boolean} isActive - 是否启用 + * @return {Promise} 操作结果 + */ + async toggleZoneActive(id, isActive) { + const { ctx } = this; + + try { + const zone = await ctx.model.LocationZone.findOne({ + where: { + id, + deleted_at: null, + }, + }); + + if (!zone) { + throw new Error('分区不存在'); + } + + // 如果禁用分区,检查是否有启用的子分区 + if (!isActive) { + const activeChildren = await ctx.model.LocationZone.count({ + where: { + parent_id: id, + deleted_at: null, + is_active: 1, + }, + }); + + if (activeChildren > 0) { + throw new Error('请先禁用所有子分区'); + } + } + + zone.is_active = isActive ? 1 : 0; + await zone.save(); + + return { + success: true, + message: isActive ? '启用成功' : '禁用成功', + }; + } catch (error) { + ctx.logger.error('切换分区状态失败:', error); + throw error; + } + } + + /** + * 获取分区路径(从根节点到当前节点的路径) + * @param {number} id - 分区ID + * @return {Promise} 路径数组 + */ + async getZonePath(id) { + const { ctx } = this; + + try { + const path = []; + let currentId = id; + + while (currentId) { + const zone = await ctx.model.LocationZone.findOne({ + where: { + id: currentId, + deleted_at: null, + }, + attributes: [ 'id', 'zone_code', 'zone_name', 'zone_type', 'parent_id' ], + }); + + if (!zone) break; + + path.unshift({ + id: zone.id, + code: zone.zone_code, + name: zone.zone_name, + type: zone.zone_type, + }); + + currentId = zone.parent_id; + } + + return path; + } catch (error) { + ctx.logger.error('获取分区路径失败:', error); + throw error; + } + } + + async generateSpacesForRack(rackId, rack, transaction = null) { + const { app } = this; + const { rack_columns, rack_rows, rack_levels, direction, x, y, z } = rack; + const spaces = []; + let rackWidth = 0; + let rackLength = 0; + const rackHeight = 0; + let cellLength = 0; + let cellWidth = 0; + let cellHeight = 0; + let prelativeX = 0; + let prelativeY = 0; + let prelativeZ = 0; + + + rackWidth = rack.width; + rackLength = rack.length; + prelativeX = x; + prelativeY = y; + prelativeZ = z; + // 计算每个仓位的尺寸 + cellLength = rackLength / rack_columns / rack_levels; + cellWidth = rackWidth; + cellHeight = rack.height / rack_rows; + + // 生成所有仓位 + for (let column = 1; column <= rack_columns; column++) { + for (let row = 1; row <= rack_rows; row++) { + for (let level = 1; level <= rack_levels; level++) { + const spaceCode = `${rack.zone_code}-${column.toString().padStart(2, '0')}-${row.toString().padStart(2, '0')}-${level.toString().padStart(2, '0')}`; + + // 计算相对坐标 + let relativeX = 0; + let relativeY = 0; + let relativeZ = (level - 1) * cellWidth + prelativeZ; + + if (direction === 'east' || direction === 'west') { + relativeY = (column - 1) * cellLength + prelativeX; + relativeX = cellWidth + prelativeY; + relativeZ = (row - 1) * cellHeight + prelativeZ; + } else { + relativeX = (column - 1) * cellLength + prelativeX; + relativeY = cellWidth + prelativeY; + relativeZ = (row - 1) * cellHeight + prelativeZ; + } + + spaces.push({ + warehouse_id: rack.warehouse_id, + zone_id: rackId, + location_type_id: row == 1 ? 1 : 2, // 默认第一层为分拣,其他层为存储 + space_code: spaceCode, + row_no: row.toString(), + column_no: column.toString(), + level_no: level.toString(), + cell_no: `${column}-${row}-${level}`, + length: cellLength, + width: cellWidth, + height: cellHeight, + volume: cellLength * cellWidth * cellHeight / 1000000, // cm³转m³ + max_weight: 100, // 默认100kg + space_status: 'AVAILABLE', + is_enabled: true, + relative_x: relativeX, + relative_y: relativeY, + relative_z: relativeZ, + pick_sequence: 0, + }); + } + } + } + + // 批量插入仓位 + if (spaces.length > 0) { + await app.model.LocationSpace.bulkCreate(spaces, { transaction }); + } + return `为货架 ${rack.zone_code} 生成了 ${spaces.length} 个仓位`; + } + async getSpaceInfo(id) { + const { ctx } = this; + + try { + const path = []; + const space = await ctx.model.LocationSpace.findOne({ + where: { + id, + warehouse_id: ctx.user.store_id, + deleted_at: null, + }, + attributes: [ 'id', 'location_type_id', 'space_code', 'custom_name', 'custom_barcode', 'space_status', 'pick_sequence' ], + }); + if (!space) { + throw new Error('仓位不存在'); + } + return space; + } catch (error) { + ctx.logger.error('获取分区路径失败:', error); + throw error; + } + } + async checkBarcodeUnique(id, barcode) { + const { ctx } = this; + const { Op } = this.app.Sequelize || app.Sequelize; + try { + // 检查条码是否被其他仓位使用(排除当前仓位) + const space = await ctx.model.LocationSpace.findOne({ + where: { + [Op.and]: [ + { + id: { + [Op.ne]: id, // 排除当前仓位ID + }, + }, + { + [Op.or]: [ + { custom_barcode: barcode }, // 检查自定义条码 + { space_code: barcode }, // 检查仓位编码 + ], + }, + { deleted_at: null }, // 未删除的记录 + ], + }, + attributes: [ 'id' ], + }); + + // 如果没有找到重复的条码,返回唯一 + if (!space) { + return { isUnique: true }; + } + return { isUnique: false, message: '条码已被使用' }; + + } catch (error) { + ctx.logger.error('检查条码唯一性失败:', error); + return { isUnique: false, message: '条码检测失败' }; + } + } +} + +module.exports = LocationZoneService; diff --git a/app/service/systems/notification.js b/app/service/systems/notification.js new file mode 100644 index 0000000..62287a3 --- /dev/null +++ b/app/service/systems/notification.js @@ -0,0 +1,49 @@ +const { Service } = require('egg'); + +class NotificationService extends Service { + constructor(ctx) { + super(ctx); + // 设置全局变量 oldAction + this.oldreceivingUrl = 'http://ye4s.wms.gztbyc.com/index/wms/wms/receiving_notic'; + + } + + /** + * 发送通知 + * @param {Object} options - 通知参数 + * @param {string} options.type - 通知类型,如 'email', 'sms', 'system' + * @param {string} options.title - 通知标题 + * @param {string} options.content - 通知内容 + * @param {string} options.bussinessType - 业务类型,如 'receiving' + * @param {string[]} [options.receivers] - 接收人列表 + * @param {string} options.bussinessId - 业务ID + * @return {Promise} 发送结果 + */ + async send(options) { + const { type, title, content, bussinessType, bussinessId, receivers = [] } = options; + switch (bussinessType) { + case 'receiving': + // 发送接收通知 + await this.ctx.curl(this.oldreceivingUrl, { + method: 'POST', + data: { + id: bussinessId, + }, + dataType: 'json', + }); + break; + } + return { + success: true, + message: '通知已发送', + data: { + type, + title, + content, + receivers, + }, + }; + } +} + +module.exports = NotificationService; diff --git a/app/service/systems/operation_log.js b/app/service/systems/operation_log.js new file mode 100644 index 0000000..976adf0 --- /dev/null +++ b/app/service/systems/operation_log.js @@ -0,0 +1,130 @@ +// app/service/operationLog.js +'use strict'; + +const Service = require('egg').Service; + +class operationLogService extends Service { + /** + * 通用操作日志记录方法 + * @param {Object} params 日志参数 + * @param {string} params.businessType 业务类型: product, order, stock, wave, express, storage + * @param {string} params.businessId 业务ID + * @param {string} params.operationCode 操作编码 + * @param {Object} params.operator 操作人信息 + * @param {string} params.operator.id 操作人ID + * @param {string} params.operator.name 操作人名称 + * @param {string} params.operationAction 操作动作: CREATE, UPDATE, DELETE, OTHER + * @param {string} params.changeSummary 变更描述 + * @param {Object} params.keyChanges 关键变更字段 + * @param {Object} params.extras 额外参数 + * @param {string} params.extras.externalLogType 外部日志类型 + * @param {number} params.extras.externalLogId 外部日志ID + * @param {number} params.extras.warehouseId 仓库ID + */ + async createOperationLog(params) { + const { ctx } = this; + const { + businessType, + businessId, + operationCode, + operator = {}, + beforeChanges = null, + extras = {}, + } = params; + try { + const logData = { + business_type: businessType, + business_id: String(businessId), + operation_code: operationCode, + operator_id: operator?.id || null, + operator_name: operator?.name || null, + external_log_type: extras.externalLogType || 'NONE', + external_log_id: extras.externalLogId || null, + warehouse_id: extras.warehouseId || null, + before_changes: beforeChanges, + platform_code: ctx.user?.platform_code || 'SYSTEM', + }; + + const result = await ctx.model.OperationLog.create(logData); + ctx.logger.info(`[OperationLog] 记录操作日志成功,ID: ${result.id}, Business: ${businessType}/${businessId}`); + return result; + } catch (error) { + ctx.logger.error(`[OperationLog] 记录操作日志失败: ${error.message}`, error); + // 生产环境建议添加降级处理,如写入文件或发送到监控系统 + return null; + } + } + + async queryStockLogs(query) { + + try { + const { ctx, app } = this; + const { + id, + warehouseId, + page = 1, + pageSize = 20, + } = query; + const where = {}; + where.business_type = 'stock'; + if (!id) { + throw new Error('id不能为空'); + } else { + where.business_id = id; + } + if (!warehouseId) { + throw new Error('仓库id不能为空'); + } else { + where.warehouse_id = warehouseId; + } + + const offset = (page - 1) * pageSize; + + const result = await ctx.model.OperationLog.findAndCountAll({ + where, + order: [[ 'created_at', 'DESC' ]], + offset, + attributes: [ 'id', 'operation_code', 'operator_name', 'created_at', 'external_log_type', 'external_log_id', 'platform_code' ], + limit: pageSize, + }); + + return { + list: result.rows.map(item => { + const item_tmp = JSON.parse(JSON.stringify(item)); + item_tmp.operation_name = app.getOperationCodeName(item.operation_code); + item_tmp.platform_name = app.getPlatformName(item.platform_code); + item_tmp.created_at = new Date(item_tmp.created_at).format(); + return item_tmp; + }), + pagination: { + page, + pageSize, + total: result.count, + totalPages: Math.ceil(result.count / pageSize), + }, + }; + } catch (e) { + console.log(e); + throw e; + } + } + async queryOrderLogs() { + + } + async getMessageDetail(data) { + const { id, type } = data; + const { ctx } = this; + const warehouseId = ctx.user.store_id; + let LogModel = null; + switch (type) { + case 'QIMEN': + // code + LogModel = ctx.model.QimenLog; + break; + } + const result = await LogModel.findOne({ where: { id } }); + return result; + } +} + +module.exports = operationLogService; diff --git a/app/service/systems/platform.js b/app/service/systems/platform.js new file mode 100644 index 0000000..fa86c81 --- /dev/null +++ b/app/service/systems/platform.js @@ -0,0 +1,276 @@ +// app/service/system/platform.js +const Service = require('egg').Service; + +class PlatformService extends Service { + /** + * 检查平台是否存在 + * 逻辑: + * 1. 先查询设置表,有对应的平台代码+仓库ID组合,返回关联的基础表的代码和名称 + * 2. 如果没有,尝试基础表中的code是否匹配,存在匹配则直接返回基础表的代码和名称 + * 3. 使用缓存优化性能 + * @param {string} platformCode 平台代码 + * @param {number} warehouseId 仓库ID + * @return {Promise} 平台信息或null + */ + async checkPlatformExists(platformCode, warehouseId) { + const { ctx, app } = this; + + // 生成缓存key + const cacheKey = `platform:${platformCode}:${warehouseId}`; + + try { + // 1. 先从缓存获取 + const cachedData = await app.getCacheAsync(cacheKey); + if (cachedData) { + ctx.logger.info(`从缓存获取平台信息: ${cacheKey}`); + // 如果缓存中存的是"不存在"的特殊标记,返回null + if (cachedData === '__NOT_EXISTS__') { + return null; + } + return cachedData; + } + ctx.logger.info(`${cacheKey}无缓存`); + + + let platformInfo = null; + // 2. 先查询平台设置表(关联基础平台表) + const platformSetting = await app.model.PlatformSetting.findOne({ + where: { + code: platformCode, + warehouse_id: warehouseId, + }, + include: [ + { + model: this.app.model.Platform, + as: 'platform', + attributes: [ 'code', 'name', 'default_express_interface' ], + }, + ], + }); + if (platformSetting && platformSetting.platform) { + // 从设置表中找到,并且有关联的平台信息 + platformInfo = { + code: platformSetting.platform.code, + name: platformSetting.platform.name, + default_express_interface: platformSetting.platform.default_express_interface, + source: 'setting', // 标记来源 + setting_id: platformSetting.id, + warehouse_id: warehouseId, + }; + } else { + // 3. 设置表中没有,直接查询基础平台表 + const basePlatform = await app.model.Platform.findOne({ + where: { + code: platformCode, + }, + attributes: [ 'code', 'name', 'default_express_interface' ], + }); + + if (basePlatform) { + platformInfo = { + code: basePlatform.code, + name: basePlatform.name, + default_express_interface: basePlatform.default_express_interface, + source: 'base', // 标记来源 + warehouse_id: warehouseId, + }; + } + } + + // 4. 设置缓存 + if (platformInfo) { + // 平台存在,缓存5分钟 + await app.setCacheAsync(cacheKey, platformInfo, 300); + ctx.logger.info(`平台信息已缓存: ${cacheKey}`); + } else { + // 平台不存在,缓存特殊标记,时间可以短一些(2分钟) + await app.setCacheAsync(cacheKey, '__NOT_EXISTS__', 120); + ctx.logger.info(`平台不存在标记已缓存: ${cacheKey}`); + } + + return platformInfo; + + } catch (error) { + ctx.logger.error(`检查平台存在性失败: ${error.message}`, { + platformCode, + warehouseId, + error: error.stack, + }); + throw error; + } + } + + /** + * 获取平台信息(带异常处理) + * @param {string} platformCode 平台代码 + * @param {number} warehouseId 仓库ID + * @return {Promise} 平台信息 + * @throws {Error} 平台不存在时抛出异常 + */ + async getPlatformInfo(platformCode, warehouseId) { + const platformInfo = await this.checkPlatformExists(platformCode, warehouseId); + + if (!platformInfo) { + throw new Error(`平台 ${platformCode} 在仓库 ${warehouseId} 中不存在`); + } + + return platformInfo; + } + + /** + * 清除平台缓存 + * @param {string} platformCode 平台代码 + * @param {number} warehouseId 仓库ID + */ + async clearPlatformCache(platformCode, warehouseId) { + const { app } = this; + const cacheKey = `platform:${platformCode}:${warehouseId}`; + await app.setCacheAsync(cacheKey, null, 0); // 立即过期 + } + + /** + * 获取平台设置详情(包括完整的设置信息) + * @param {string} platformCode 平台代码 + * @param {number} warehouseId 仓库ID + * @return {Promise} 平台设置详情 + */ + async getPlatformSettingDetail(platformCode, warehouseId) { + const { ctx } = this; + const cacheKey = `platform_setting_detail:${platformCode}:${warehouseId}`; + + try { + // 从缓存获取 + const cachedData = await this.app.getCacheAsync(cacheKey); + if (cachedData) { + return cachedData === '__NOT_EXISTS__' ? null : cachedData; + } + + const setting = await this.app.model.PlatformSetting.findOne({ + where: { + code: platformCode, + warehouse_id: warehouseId, + }, + include: [ + { + model: this.app.model.Platform, + as: 'platform', + attributes: [ 'code', 'name', 'default_express_interface' ], + }, + ], + }); + + if (setting) { + const result = { + id: setting.id, + platform_code: setting.platform_code, + code: setting.code, + warehouse_id: setting.warehouse_id, + platform: setting.platform, + warehouse: setting.warehouse, + }; + + // 缓存10分钟 + await this.app.setCacheAsync(cacheKey, result, 600); + return result; + } + // 缓存2分钟的不存在标记 + await this.app.setCacheAsync(cacheKey, '__NOT_EXISTS__', 120); + return null; + + + } catch (error) { + this.ctx.logger.error(`获取平台设置详情失败: ${error.message}`); + throw error; + } + } + + /** + * 批量检查多个平台 + * @param {Array} platformWarehouseList 平台和仓库列表 [{platformCode, warehouseId}, ...] + * @return {Promise} 存在的平台列表 + */ + async batchCheckPlatforms(platformWarehouseList) { + const results = []; + + for (const item of platformWarehouseList) { + const { platformCode, warehouseId } = item; + const exists = await this.checkPlatformExists(platformCode, warehouseId); + + if (exists) { + results.push({ + platformCode, + warehouseId, + exists: true, + info: exists, + }); + } else { + results.push({ + platformCode, + warehouseId, + exists: false, + info: null, + }); + } + } + + return results; + } + + /** + * 创建平台设置 + * @param {Object} data 平台设置数据 + * @param {string} data.platform_code 平台代码 + * @param {string} data.code 设置代码 + * @param {number} data.warehouse_id 仓库ID + * @return {Promise} 创建的设置 + */ + async createPlatformSetting(data) { + const { ctx } = this; + + try { + // 1. 验证平台是否存在 + const platform = await this.app.model.Platform.findOne({ + where: { code: data.platform_code }, + }); + + if (!platform) { + throw new Error(`平台 ${data.platform_code} 不存在`); + } + + // 2. 验证仓库是否存在 + const warehouse = await this.app.model.Store.findOne({ + where: { id: data.warehouse_id }, + }); + + if (!warehouse) { + throw new Error(`仓库 ${data.warehouse_id} 不存在`); + } + + // 3. 检查是否已存在相同的设置 + const exists = await this.app.model.PlatformSetting.findOne({ + where: { + platform_code: data.platform_code, + warehouse_id: data.warehouse_id, + }, + }); + + if (exists) { + throw new Error(`平台 ${data.platform_code} 在仓库 ${data.warehouse_id} 中已存在设置`); + } + + // 4. 创建设置 + const setting = await this.app.model.PlatformSetting.create(data); + + // 5. 清除相关缓存 + await this.clearPlatformCache(data.platform_code, data.warehouse_id); + + return setting; + + } catch (error) { + ctx.logger.error(`创建平台设置失败: ${error.message}`); + throw error; + } + } +} + +module.exports = PlatformService; diff --git a/app/service/systems/print/index.js b/app/service/systems/print/index.js new file mode 100644 index 0000000..94d43be --- /dev/null +++ b/app/service/systems/print/index.js @@ -0,0 +1,75 @@ +'use strict'; + +const Service = require('egg').Service; + +class PrintService extends Service { + // 发送信息到打印电脑 + async sendToComputer({ warehouse, computerId, data }) { + //发送指令更新打印机状态 + const printServiceUrl = this.ctx.app.config.printService.url; + //先获取redis中打印机列表 + let printerListResult = await this.app.redis.get("printer").get(`printer:${computerId}:printerList`); + let lastUpdateTime = 0; + if(printerListResult){ + //记录上次更新时间,避免频繁发送更新指令 + let printerData = JSON.parse(printerListResult); + console.log("printerData", printerData); + lastUpdateTime = printerData.updatedAt || 0; + } + //不管是否有打印机列表,都先发送指令让打印电脑更新打印机状态和列表 + const res = await this.ctx.curl(`${printServiceUrl}/sendToRoom`, { + method: 'POST', + contentType: 'json', + data: { warehouse, computerId, method: "printer.getWindowsPrinters", data: {} }, + dataType: 'json', + }); + console.log("lastUpdateTime",lastUpdateTime) + //等待异步获取打印机列表结果,最长等待5秒 + const startTime = Date.now(); + while (Date.now() - startTime < 5000) { + await new Promise(resolve => setTimeout(resolve, 10)); // 每10ms检查一次 + printerListResult = await this.app.redis.get("printer").get(`printer:${computerId}:printerList`); + let printerData = JSON.parse(printerListResult); + if(printerData.updatedAt && printerData.updatedAt > lastUpdateTime){ + console.log("打印机列表已更新", printerData.updatedAt); + //如果更新了打印机列表,跳出循环 + break; + } + } + //从redis获取打印机 + printerListResult = await this.app.redis.get("printer").get(`printer:${computerId}:printerList`); + const printerList = JSON.parse(printerListResult); + console.log("sendToComputer printerList", printerList); + if (!printerList || !printerList.data || printerList.data.length === 0) { + return { success: false, error: '未找到对应的打印机', detail: `computerId: ${computerId} 的打印机列表不存在` }; + } + const { printer } = data; + const printerInfo = printerList.data.find(p => p.name === printer); + if (!printerInfo) { + return { success: false, error: `打印台没有打印机 ${printer}`, detail: `computerId: ${computerId} 的打印机列表中不存在 printer: ${printer}` }; + } + if (printerInfo.workOffline == "TRUE") { + return { success: false, error: `打印机 ${printer} 处于脱机状态`, detail: `computerId: ${computerId} 的打印机 ${printer} 当前处于离线状态` }; + } + try { + const res = await this.ctx.curl(`${printServiceUrl}/sendToRoom`, { + method: 'POST', + contentType: 'json', + data: { warehouse, computerId, method: "printer.print", data }, + dataType: 'json', + }); + console.log(res); + return res.data; + + } catch (err) { + return { success: false, error: '打印服务通讯失败', detail: err.message }; + } + } + async test() { + const grabnum = "B1157389"; + const datas = await this.app.wsdl("print", [5400, grabnum, "caige"]) + this.sendToComputer({ warehouse: '1000028', computerId: '1', data: datas }); + } +} + +module.exports = PrintService; diff --git a/app/service/systems/qimen_query.js b/app/service/systems/qimen_query.js new file mode 100644 index 0000000..0c378be --- /dev/null +++ b/app/service/systems/qimen_query.js @@ -0,0 +1,156 @@ +const Service = require('egg').Service; +const https = require('https'); +const http = require('http'); +class QimenQueryService extends Service { + + async send(method, customerId, data) { + + try { + const wmsAppKey = this.app.config.qimen.appKey; + const baseQueryParams = this.getQueryParams(method, wmsAppKey, '2.0', customerId); + const baseUrl = 'http://qimen.api.taobao.com/router/qimen/service'; + const xmlData = await this.ctx.service.systems.sign.toXml(data); + const queryData = this.replaceXmlTagsWithString(xmlData, 'item', 'orderLine'); + const sign = await this.ctx.service.systems.sign.signTopRequest(baseQueryParams, queryData, this.app.config.qimen.security, 'md5'); + const queryParams = this.addSign(baseQueryParams, sign); + const url = this.generateUrlWithParams(baseUrl, queryParams); + const logData = { + from_key: this.app.config.qimen.appKey, + to_key: wmsAppKey, + method, + sign, + costomer_id: customerId, + v: '2.0', + url, + created_at: new Date(), + body: '', + result: '', + use_time: 0, + }; + const result = await this.sendRequest(url, queryData, logData); + const xmlArray = await this.ctx.service.qimen.parseXmlToArray(result.res); + return { queryId: result.queryId, xmlArray }; + } catch (error) { + throw error; + } + } + + replaceXmlTagsWithString(xmlString, oldTag, newTag) { + // 匹配开始标签(包括属性) + const startTagRegex = new RegExp(`<\\s*${oldTag}(\\s+[^>]*)?>`, 'gi'); + + // 匹配结束标签 + const endTagRegex = new RegExp(`<\\s*/\\s*${oldTag}\\s*>`, 'gi'); + + // 匹配自闭合标签 + const selfClosingRegex = new RegExp(`<\\s*${oldTag}(\\s+[^>]*)?\\s*/>`, 'gi'); + + return xmlString + .replace(startTagRegex, (match, attributes = '') => { + return `<${newTag}${attributes}>`; + }) + .replace(endTagRegex, ``) + .replace(selfClosingRegex, (match, attributes = '') => { + return `<${newTag}${attributes}/>`; + }); + } + addSign(baseQueryParams, sign) { + return Object.assign({}, baseQueryParams, { sign }); + } + getQueryParams(method, app_key, v, customerId) { + const param = { + method, + format: 'xml', + app_key, + v, + sign_method: 'md5', + customerId, + timestamp: new Date().format(), + }; + return param; + } + generateUrlWithParams(baseUrl, params) { + if (!params || Object.keys(params).length === 0) { + return baseUrl; + } + + const queryString = Object.keys(params) + .map(key => { + const value = params[key]; + // 对参数进行URL编码 + return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`; + }) + .join('&'); + + // 检查基础URL是否已包含查询参数 + const separator = baseUrl.includes('?') ? '&' : '?'; + return `${baseUrl}${separator}${queryString}`; + } + async sendRequest(url, requestData) { + const startTime = Date.now(); + const { service } = this; + const logData = {}; + logData.body = requestData; + let httpquery = null; + if (url.indexOf('https://') > -1) { + httpquery = https; + } else { + httpquery = http; + } + + let requestXml; + try { + // 判断 requestData 是否为字符串,如果是字符串则直接使用,否则进行转换 + if (typeof requestData === 'string') { + console.log('requestData 是字符串,直接使用'); + requestXml = requestData; + + // 可选:验证字符串是否是有效的XML + if (requestXml.trim() === '') { + throw new Error('请求数据为空字符串'); + } + } else { + console.log('requestData 不是字符串,调用 formatResponse 进行转换'); + requestXml = await this.ctx.service.qimen.formatResponse(requestData); + } + + // 最终检查XML是否为空 + if (!requestXml || requestXml.trim() === '') { + throw new Error('XML内容为空'); + } + } catch (error) { + throw error; + } + const header = { + 'Content-Type': 'application/xml', + 'Content-Length': Buffer.byteLength(requestXml, 'utf8'), + 'User-Agent': 'EggJS Client', + }; + const options = { + method: 'POST', + headers: header, + }; + const res = await new Promise((resolve, reject) => { + const req = httpquery.request(url, options, response => { + let datas = ''; + response.on('data', chunk => { + datas += chunk; + }); + response.on('end', () => { + resolve(datas); + }); + }); + + req.on('error', error => { + reject(error); + }); + + req.write(requestXml); + req.end(); + }); + logData.result = res; + const queryId = await service.qimen.saveQimenLog(logData, startTime); + return { queryId, res }; + } +} +module.exports = QimenQueryService; diff --git a/app/service/systems/setting/print_template.js b/app/service/systems/setting/print_template.js new file mode 100644 index 0000000..e64dad8 --- /dev/null +++ b/app/service/systems/setting/print_template.js @@ -0,0 +1,507 @@ +'use strict'; + +const Service = require('egg').Service; + +class PrintTemplateService extends Service { + /** + * 获取指定业务类型的模板列表 + * @param {string} businessType 业务类型 + * @return {Promise} 模板列表 + */ + async listTemplatesByType(businessType) { + console.log('获取业务类型模板列表, businessType:', businessType); + return await this.getTemplatesByType(businessType); + } + + /** + * 获取打印模板树 + * @return {Promise} 树状结构 + */ + async getTree() { + const { ctx, app } = this; + const { Op } = app.Sequelize; + // 获取当前用户仓库ID + const warehouseId = ctx.user.store_id; + try { + // 1. 获取所有业务类型及打印项 + const businessTypeItems = await this.getBusinessTypesAndItem(); + const businessTypes = Object.keys(businessTypeItems); + + // 2. 查询所有打印模板,按业务类型分组 + const templates = await ctx.model.PrintTemplate.findAll({ + where: { + status: 'ACTIVE', + warehouse_id: { + [Op.or]: [ warehouseId, null ], + }, + }, + order: [ + [ 'business_type', 'ASC' ], + [ 'is_default', 'DESC' ], + [ 'create_at', 'DESC' ], + ], + }); + const templatesByType = {}; + templates.forEach(template => { + const type = template.business_type; + if (!templatesByType[type]) templatesByType[type] = []; + templatesByType[type].push({ + ...template.toJSON(), + name: template.template_name, + key: `template_${template.id}`, + title: `${template.template_name}(${template.page_width}mmx${template.page_height}mm)`, + editable: template.warehouse_id !== null, + deletable: template.warehouse_id !== null, + isDefault: template.is_default, + isGeneral: template.warehouse_id === null, + selectable: true, + type: 'template', + }); + }); + + // 3. 构建树结构,业务类型节点下children为所有模板,printItems属性为所有打印项 + const tree = businessTypes.map(businessType => { + const children = templatesByType[businessType] || []; + return { + key: `type_${businessType}`, + title: businessType, + type: 'category', + businessType, + children, + printItems: businessTypeItems[businessType].groupList || [], + editable: false, + deletable: false, + isGeneral: false, + selectable: false, + }; + }); + return tree; + } catch (error) { + ctx.logger.error('获取打印模板树失败:', error); + throw new Error('获取打印模板失败'); + } + } + + /** + * 获取指定业务类型的模板列表 + * @param {string} businessType 业务类型 + * @return {Promise} 模板列表 + */ + async getTemplatesByType(businessType) { + const { ctx, app } = this; + const { Op } = app.Sequelize; + + const warehouseId = ctx.user.store_id; + console.log(businessType, warehouseId); + try { + const templates = await ctx.model.PrintTemplate.findAll({ + where: { + status: 'ACTIVE', + business_type: businessType, + warehouse_id: { + [Op.or]: [ warehouseId, null ], + }, + }, + order: [ + [ 'is_default', 'DESC' ], + [ 'create_at', 'DESC' ], + ], + }); + console.log(`查询到${templates.length}个模板,businessType: ${businessType}, warehouseId: ${warehouseId}`); + return templates.map(template => { + const { warehouse_id } = template; + return { + ...template.toJSON(), + editable: warehouse_id !== null, + deletable: warehouse_id !== null, + isGeneral: warehouse_id === null, + }; + }); + } catch (error) { + ctx.logger.error('获取业务类型模板失败:', error); + return []; + } + } + async save(data) { + const { ctx, app } = this; + const { Op } = app.Sequelize; + const warehouseId = ctx.user.store_id; + console.log('保存打印模板数据:', data); + const { id, template_name, business_type, page_width, page_height, template_content } = data; + try { + if (id) { + // 更新现有模板 + const template = await ctx.model.PrintTemplate.findOne({ + where: { + id, + warehouse_id: warehouseId, + }, + }); + + if (!template) { + throw new Error('模板不存在或无权限'); + } + + await template.update({ + template_name, + business_type, + page_width, + page_height, + template_content, + }); + + return { message: '模板更新成功', code: 200 }; + } + // 创建新模板 + await ctx.model.PrintTemplate.create({ + template_name, + business_type, + page_width, + page_height, + template_content, + warehouse_id: warehouseId, + status: 'ACTIVE', + }); + + return { message: '模板创建成功', code: 200 }; + + } catch (error) { + ctx.logger.error('保存打印模板失败:', error); + throw new Error('保存打印模板失败'); + } + }/** + * 获取所有业务类型(用于下拉选择)- 支持分组展示 + * @return {Object} 业务类型及打印项列表,包含分组信息 + */ + async getBusinessTypesAndItem() { + const { ctx, app } = this; + const cacheKey = 'print_item:business_types_and_items_v2'; + + try { + // 1. 先查缓存 + let result = await app.getCacheAsync(cacheKey); + if (result) { + return result; + } + + // 2. 未命中缓存则查库 + const printItems = await ctx.model.PrintItem.findAll({ + where: { + status: 1, + }, + order: [ + [ 'business_type', 'ASC' ], + [ 'group_sort', 'ASC' ], // 先按分组排序 + [ 'sort_order', 'ASC' ], // 再按字段排序 + ], + }); + + result = {}; + + // 3. 处理数据:按业务类型 + 分组字段双重分组 + printItems.forEach(item => { + const type = item.business_type; + const groupField = item.group_field || 'ungrouped'; // 无分组的归入"未分组" + const groupLabel = item.group_label || 'common.ungrouped'; // 分组标题(国际化key) + + // 初始化业务类型 + if (!result[type]) { + result[type] = { + businessType: type, + groups: {}, // 按group_field分组 + tableItems: [], // 表格类型的打印项 + ungrouped: [], // 未分组的打印项 + }; + } + + // 转换为JSON + const itemJson = { + ...item.toJSON(), + key: `item_${item.id}`, + title: item.field_name, + groupConfig: item.group_field ? { + field: item.group_field, + label: item.group_label, + sort: item.group_sort, + } : null, + }; + + if (groupField !== 'ungrouped') { + // 有分组的普通字段 + if (!result[type].groups[groupField]) { + result[type].groups[groupField] = { + groupField, + groupLabel, + groupSort: item.group_sort || 999, + fields: [], + }; + } + result[type].groups[groupField].fields.push(itemJson); + } else { + // 未分组的普通字段 + result[type].ungrouped.push(itemJson); + } + }); + + // 5. 对每个业务类型内的分组进行排序 + Object.keys(result).forEach(type => { + // 对分组进行排序 + const groups = result[type].groups; + result[type].groupList = Object.values(groups).sort((a, b) => { + return (a.groupSort || 999) - (b.groupSort || 999); + }); + + // 对分组内的字段排序 + result[type].groupList.forEach(group => { + group.fields.sort((a, b) => (a.sort_order || 0) - (b.sort_order || 0)); + }); + + // 对未分组字段排序 + result[type].ungrouped.sort((a, b) => (a.sort_order || 0) - (b.sort_order || 0)); + + // 对表格字段排序 + result[type].tableItems.sort((a, b) => (a.sort_order || 0) - (b.sort_order || 0)); + }); + + // 6. 写入缓存(5分钟) + await app.setCacheAsync(cacheKey, result, 300); + + return result; + + } catch (error) { + ctx.logger.error('获取业务类型及打印项失败:', error); + return {}; + } + } + + /** + * 获取按分组组织的打印项(用于打印预览) + * @param {string} businessType - 业务类型 + * @param {string} platform - 平台 + * @return {Object} 分组后的打印项 + */ + async getGroupedPrintItems(businessType, platform) { + const { ctx } = this; + + const items = await ctx.model.PrintItem.findAll({ + where: { + business_type: businessType, + platform: platform || 'default', + status: 1, + }, + order: [ + [ 'group_sort', 'ASC' ], + [ 'sort_order', 'ASC' ], + ], + }); + + const result = { + tableItems: [], // 表格项目 + groupItems: {}, // 分组项目 + ungrouped: [], // 未分组项目 + }; + + items.forEach(item => { + const itemJson = item.toJSON(); + + if (item.is_table) { + // 表格项目 + result.tableItems.push({ + ...itemJson, + config: item.table_config, + }); + } else if (item.group_field) { + // 分组项目 + if (!result.groupItems[item.group_field]) { + result.groupItems[item.group_field] = { + groupField: item.group_field, + groupLabel: item.group_label, + groupSort: item.group_sort, + fields: [], + }; + } + result.groupItems[item.group_field].fields.push(itemJson); + } else { + // 未分组项目 + result.ungrouped.push(itemJson); + } + }); + + // 转换分组对象为数组并排序 + result.groupList = Object.values(result.groupItems) + .sort((a, b) => (a.groupSort || 999) - (b.groupSort || 999)); + + return result; + } + + /** + * 获取表格配置(用于渲染动态表格) + * @param {string} businessType - 业务类型 + * @param {string} platform - 平台 + * @return {Array} 表格配置列表 + */ + async getTableConfigs(businessType, platform) { + const { ctx } = this; + + const tables = await ctx.model.PrintItem.findAll({ + where: { + business_type: businessType, + platform: platform || 'default', + is_table: true, + status: 1, + }, + order: [[ 'sort_order', 'ASC' ]], + }); + + return tables.map(table => ({ + id: table.id, + fieldName: table.field_name, + fieldCode: table.field_code, + config: table.table_config, + groupField: table.group_field, + groupSort: table.group_sort, + })); + } + + /** + * 清空业务类型缓存 + */ + async clearBusinessTypesCache() { + const { app } = this; + const cacheKey = 'print_item:business_types_and_items_v2'; + await app.delCacheAsync(cacheKey); + } + async getXmlByTemplate(id) { + const { ctx } = this; + try { + const template = await ctx.model.PrintTemplate.findOne({ + where: { + id, + }, + }); + if (!template) { + throw new Error('模板不存在'); + } + const xmlResult = this.buildXmlFromElements(template, template.template_content); + return xmlResult; + } catch (error) { + ctx.logger.error('根据模板生成XML失败:', error); + throw new Error('生成XML失败'); + } + } + buildXmlFromElements(template, elements) { + // XML头 + let xml = ` + + +
+`; + + // 遍历所有元素 + for (let i = 0; i < elements.length; i++) { + const el = elements[i]; + xml += this.renderElement(el, i); + } + + xml += '
'; + return xml; + } + renderElement(el, index) { + const [ styleText, textStyleText ] = this.computeItemStyle(el, index); + let widthAndHeightText = `width="${el.width || 50}" height="${el.height || 20}" `; + if (el.type === 'table') { + widthAndHeightText = ''; + } + let layout = ``; + switch (el.type) { + case 'text': + if (el.field_code) { + layout += `]]>`; + } else { + layout += ``; + } + break; + case 'image': + if (el.field_code) { + layout += `]]>`; + } else { + layout += ``; + } + break; + case 'qrcode': + if (el.field_code) { + layout += `]]>`; + } else { + layout += ``; + } + break; + case 'barcode': + if (el.field_code) { + layout += `]]>`; + } else { + layout += ``; + } + break; + case 'table': + const tableContent = this.renderTable(el, index); + layout += `${tableContent}
`; + break; + case 'shape': + } + return `${layout} +
+`; + } + computeItemStyle(item, index) { + const base = { + border: '1px dashed #999', + transform: `rotate(${(item.rotate || 0) * 90}deg)`, + zIndex: index, + }; + const textStyleBase = { + fontSize: (item.fontSize || 12), + align: item.textAlign || 'left', + lineHeight: (item.lineHeight || 6), + fontWeight: item.bold ? 'bold' : 'normal', + }; + const textStyleText = Object.entries(textStyleBase).map(([ key, value ]) => `${key}:${value}`).join(';') + ';'; + const styleText = Object.entries(base).map(([ key, value ]) => `${key}:${value}`).join(';') + ';'; + return [ styleText, textStyleText ]; + } + computeTableItemStyle(item, index) { + const base = { + border: '1px dashed #999', + fontSize: (item.fontSize || 12), + textAlign: item.textAlign || 'left', + lineHeight: (item.lineHeight || 6), + transform: `rotate(${(item.rotate || 0) * 90}deg)`, + zIndex: index, + overflow: 'hidden', + }; + + const styleText = Object.entries(base).map(([ key, value ]) => `${key}:${value}`).join(';') + ';'; + return styleText; + } + renderTable(el, index) { + const tableText = ''; + const rows = el.rows || []; + // 表头 + let headerTds = ''; + let bodyTds = '<% for(var i=0; i<(_data.items.length); i++) { %>'; + for (let i = 0; i < el.rows; i++) { + + headerTds += `${el.headers && el.headers[i] ? el.headers[i] : `列${i + 1}`}`; + bodyTds += `]]>`; + } + headerTds += ''; + bodyTds += '<%}%>'; + return headerTds + bodyTds; + } +} + +module.exports = PrintTemplateService; diff --git a/app/service/systems/sign.js b/app/service/systems/sign.js new file mode 100644 index 0000000..2fecd2d --- /dev/null +++ b/app/service/systems/sign.js @@ -0,0 +1,198 @@ +// app/service/sign.js +const Service = require('egg').Service; +const crypto = require('crypto'); + +class SignService extends Service { + get Constants() { + return { + SIGN_METHOD_MD5: 'md5', + SIGN_METHOD_HMAC: 'hmac', + SIGN_METHOD_HMAC_SHA256: 'hmac_sha256', + }; + } + toXml(data) { + let xml = '\n'; + // 添加其他数据字段 + for (const [ key, value ] of Object.entries(data)) { + if (![ 'flag', 'code', 'message' ].includes(key)) { + xml += this.ctx.service.qimen.buildXmlNode(key, value, 1); + } + } + + return xml; + } + + signTopRequest(params, body, secret, signMethod) { + // 第一步:检查参数是否已经排序 + const keys = Object.keys(params).sort(); + + // 第二步:把所有参数名和参数值串在一起 + let query = ''; + + if (signMethod === this.Constants.SIGN_METHOD_MD5) { + query += secret; + } + + for (const key of keys) { + const value = params[key]; + if (key && value) { + query += key + value; + } + } + + // 第三步:把请求主体拼接在参数后面 + if (body) { + query += body; + } + + // 第四步:使用MD5/HMAC加密 + let bytes; + if (signMethod === this.Constants.SIGN_METHOD_HMAC) { + bytes = this.encryptHMAC(query, secret); + } else if (signMethod === this.Constants.SIGN_METHOD_HMAC_SHA256) { + bytes = this.encryptHMACSHA256(query, secret); + } else { + query += secret; + bytes = this.encryptMD5(query); + } + + // 第五步:把二进制转化为大写的十六进制 + return this.byte2hex(bytes); + } + + /** + * 验证TOP请求签名 + * @param {Object} params - 所有字符型的TOP请求参数(包含sign参数) + * @param {string} body - 请求主体内容 + * @param {string} secret - 签名密钥 + * @param {string} signMethod - 签名方法 + * @return {boolean} 验证是否通过 + */ + verifyTopRequest(params, body, secret, signMethod) { + // 复制参数,避免修改原参数 + const verifyParams = { ...params }; + + // 提取签名 + const receivedSign = verifyParams.sign; + if (!receivedSign) { + this.ctx.logger.warn('[SignService] Missing sign parameter'); + return false; + } + + // 移除签名参数,不参与签名计算 + delete verifyParams.sign; + + // 计算签名 + const calculatedSign = this.signTopRequest(verifyParams, body, secret, signMethod); + + // 比较签名 + const isValid = receivedSign.toUpperCase() === calculatedSign.toUpperCase(); + + if (!isValid) { + this.ctx.logger.warn('[SignService] Signature verification failed', { + receivedSign: receivedSign.toUpperCase(), + calculatedSign: calculatedSign.toUpperCase(), + }); + } + + return isValid; + } + + /** + * 验证请求并获取参数(移除签名相关参数) + * @param {Object} params - 所有请求参数 + * @param {string} body - 请求主体内容 + * @param {string} secret - 签名密钥 + * @param {string} signMethod - 签名方法 + * @return {Object} { success: boolean, data: Object, message: string } + */ + verifyAndExtractParams(params, body, secret, signMethod) { + try { + const isValid = this.verifyTopRequest(params, body, secret, signMethod); + + if (!isValid) { + return { + success: false, + data: null, + message: 'Signature verification failed', + }; + } + + // 复制参数并移除签名相关字段 + const cleanParams = { ...params }; + delete cleanParams.sign; + delete cleanParams.sign_method; + + return { + success: true, + data: cleanParams, + message: 'Success', + }; + } catch (error) { + this.ctx.logger.error('[SignService] verifyAndExtractParams error:', error); + return { + success: false, + data: null, + message: error.message, + }; + } + } + + /** + * 生成带签名的请求参数 + * @param {Object} params - 原始参数 + * @param {string} body - 请求主体内容 + * @param {string} secret - 签名密钥 + * @param {string} signMethod - 签名方法 + * @return {Object} 带签名的参数对象 + */ + generateSignedParams(params, body, secret, signMethod) { + const sign = this.signTopRequest(params, body, secret, signMethod); + + return { + ...params, + sign, + sign_method: signMethod, + }; + } + + /** + * HMAC MD5加密 + * @param data + * @param secret + */ + encryptHMAC(data, secret) { + const hmac = crypto.createHmac('md5', secret); + hmac.update(data, 'utf8'); + return hmac.digest(); + } + + /** + * HMAC SHA256加密 + * @param data + * @param secret + */ + encryptHMACSHA256(data, secret) { + const hmac = crypto.createHmac('sha256', secret); + hmac.update(data, 'utf8'); + return hmac.digest(); + } + + /** + * MD5加密 + * @param data + */ + encryptMD5(data) { + return crypto.createHash('md5').update(data, 'utf8').digest(); + } + + /** + * 二进制转十六进制字符串(大写) + * @param bytes + */ + byte2hex(bytes) { + return Buffer.from(bytes).toString('hex').toUpperCase(); + } +} + +module.exports = SignService; diff --git a/app/service/systems/space.js b/app/service/systems/space.js new file mode 100644 index 0000000..7c20188 --- /dev/null +++ b/app/service/systems/space.js @@ -0,0 +1,60 @@ +'use strict'; +const Service = require('egg').Service; + +class spaceService extends Service { + constructor(ctx) { + super(ctx); + } + async searchSpace(data) { + const { ctx, app } = this; + const { keyword } = data; + const warehouseId = ctx.user.store_id; + + // 构建基础查询条件:warehouse_id 为当前仓库或 null + const baseWhere = { + [app.Sequelize.Op.or]: [ + { warehouse_id: warehouseId }, + { warehouse_id: null }, + ], + }; + + let whereCondition = baseWhere; + + // 如果有关键词,添加模糊查询 + if (keyword && keyword.trim()) { + const searchKeyword = `%${keyword.trim()}%`; + whereCondition = { + [app.Sequelize.Op.and]: [ + baseWhere, // 仓库条件 + { + [app.Sequelize.Op.or]: [ + { + space_code: { + [app.Sequelize.Op.like]: searchKeyword, + }, + }, + { + custom_barcode: { + [app.Sequelize.Op.like]: searchKeyword, + }, + }, + ], + }, + ], + }; + } + + const results = await app.model.LocationSpace.findAll({ + where: whereCondition, + attributes: [ + 'id', 'space_code', 'custom_barcode', 'custom_name', + ], + order: [[ 'space_code', 'DESC' ]], + limit: 50, + subQuery: false, + }); + + return { code: 200, data: results, total: results.length }; + } +} +module.exports = spaceService; diff --git a/app/service/systems/stock_store.js b/app/service/systems/stock_store.js new file mode 100644 index 0000000..ecb0e04 --- /dev/null +++ b/app/service/systems/stock_store.js @@ -0,0 +1,2841 @@ +'use strict'; +const Service = require('egg').Service; + +class stockStoreService extends Service { + constructor(ctx) { + super(ctx); + } + async create(stockData) { + const { + app, + ctx, + service, + } = this; + const warehouseId = stockData.warehouse_id; + // 设置创建时间 + if (!stockData.create_time) { + stockData.create_time = new Date(); + } + + // 检查唯一约束 + const existing = await app.model.StockStore.findOne({ + where: { + item_code: stockData.item_code, + app_key: stockData.app_key, + warehouse_id: warehouseId, + store_id: stockData.store_id, + }, + }); + + let result; + + if (existing) { + // 更新现有记录 + await app.model.StockStore.update(stockData, { + where: { + id: existing.id, + }, + }); + const updatedRow = await app.model.StockStore.findByPk(existing.id); + result = updatedRow; + } else { + // 创建新记录 + result = await app.model.StockStore.create(stockData); + } + + try { + // 创建/更新成功后,同步到库存表 + // 注意:这里需要传入warehouseId作为第二个参数 + const warehouseResult = await this.checkAndCreateWarehouseStock( + stockData, + warehouseId // 传入warehouse_id + ); + + // 如果库存表操作成功,更新 stock_id + if (warehouseResult.success) { + await app.model.StockStore.update({ + stock_id: warehouseResult.id, + }, { + where: { + id: result.id, + }, + silent: true, // 不触发钩子,避免循环 + }); + await service.systems.operationLog.createOperationLog({ + businessType: 'stock', + businessId: warehouseResult.id, + operationCode: 'BIND', + operator: { + id: null, + name: '奇门', + }, + extras: { + warehouseId, + externalLogType: 'QIMEN', + externalLogId: this.ctx.qimenLogId, + }, + beforeChanges: null, + }); + result.stock_id = warehouseResult.id; + + app.logger.debug(`[库存同步成功] StockStore ID: ${result.id}, StockWarehouse ID: ${warehouseResult.id}`); + } else { + app.logger.warn(`[库存同步失败] StockStore ID: ${result.id}, 原因: ${warehouseResult.message}`); + } + } catch (error) { + // 库存同步失败不影响主流程,但记录日志 + app.logger.error(`[库存同步异常] StockStore ID: ${result.id}`, { + error: error.message, + stack: error.stack, + }); + } + + return result; + } + + async initQimenStockData(data, appKey, storeId, warehouseId) { + const item_data = data.item ? data.item : {}; + + const result = { + warehouse_code: data.warehouseCode || '', + owner_code: data.ownerCode || '', + is_area_sale: item_data.isAreaSale || 'N', + item_code: item_data.itemCode || '', + app_key: appKey || '', + goods_code: item_data.goodsCode || '', + item_name: item_data.itemName || '', + sku_property: item_data.skuProperty || '', + stock_unit: item_data.stockUnit || '', + length: parseFloat(item_data.length) || 0, + width: parseFloat(item_data.width) || 0, + height: parseFloat(item_data.height) || 0, + volume: parseFloat(item_data.volume) || 0, + gross_weight: parseFloat(item_data.grossWeight) || 0, + net_weight: parseFloat(item_data.netWeight) || 0, + category_id: parseInt(item_data.categoryId) || 0, + category_name: item_data.categoryName || '', + item_type: item_data.itemType || '', + tag_price: parseFloat(item_data.tagPrice) || 0, + retail_price: parseFloat(item_data.retailPrice) || 0, + brand_name: item_data.brandName || null, + is_sn_mgmt: item_data.isSNMgmt || 'N', + is_shelf_life_mgmt: item_data.isShelfLifeMgmt || 'N', + is_batch_mgmt: item_data.isBatchMgmt || 'N', + create_time: item_data.createTime || new Date(), + update_time: new Date(), + is_valid: item_data.isValid || 'Y', + warehouse_id: warehouseId, + barcode: item_data.barCode || '', + store_id: storeId, + create_from: 'qimen', + }; + return result; + } + async convertToQimenFormat(stockData) { + const result = { + // 商品信息 + item: { + itemId: stockData.id, // 数据库主键作为奇门的itemId + itemCode: stockData.item_code || '', + goodsCode: stockData.goods_code || '', + itemName: stockData.item_name || '', + skuProperty: stockData.sku_property || '', + stockUnit: stockData.stock_unit || '', + + // 尺寸重量信息 + length: parseFloat(stockData.length) || 0, + width: parseFloat(stockData.width) || 0, + height: parseFloat(stockData.height) || 0, + volume: parseFloat(stockData.volume) || 0, + grossWeight: parseFloat(stockData.gross_weight) || 0, + netWeight: parseFloat(stockData.net_weight) || 0, + + // 分类信息 + categoryId: stockData.category_id || 0, + categoryName: stockData.category_name || '', + itemType: stockData.item_type || '', + + // 价格信息 + tagPrice: parseFloat(stockData.tag_price) || 0, + retailPrice: parseFloat(stockData.retail_price) || 0, + + // 管理标志 + isAreaSale: stockData.is_area_sale === 'Y' ? 'Y' : 'N', + isSNMgmt: stockData.is_sn_mgmt === 'Y' ? 'Y' : 'N', + isShelfLifeMgmt: stockData.is_shelf_life_mgmt === 'Y' ? 'Y' : 'N', + isBatchMgmt: stockData.is_batch_mgmt === 'Y' ? 'Y' : 'N', + + // 其他信息 + barCode: stockData.barcode || '', + isValid: stockData.is_valid === 'Y' ? 'Y' : 'N', + createTime: stockData.create_time ? new Date(stockData.create_time).format() : '', + }, + }; + return result; + } + async getItemInfoWithCache(itemId) { + const { + ctx, + app, + } = this; // 使用 ctx.model 而非 app.model + const cacheKey = `item:info:${itemId}`; + + try { + // 1. 尝试从缓存获取 + const cached = await app.getCacheAsync(cacheKey); + console.log('缓存》》》》', cached); + if (cached !== null && cached !== undefined) { + app.logger.debug('[ItemCacheHit]', itemId); + + // 处理空值标记 + if (cached.__isNull) { + return null; // 明确返回 null 表示商品不存在 + } + // 返回缓存的对象 + return cached; + } + + // 2. 缓存未命中,查询数据库 + app.logger.debug('[ItemCacheMiss]', itemId); + console.log('缓存》》》》', itemId); + + // ⭐ 关键修复:使用 raw: true 获取纯对象 + const itemInfo = await ctx.model.StockStore.findByPk(itemId, { + attributes: [ 'id', 'stock_id', 'warehouse_code', 'item_code' ], // 按需增加字段 + raw: true, // ⭐ 必须:转换为纯 JavaScript 对象 + }); + + // 3. 处理查询结果并缓存 + if (itemInfo) { + // 缓存有效数据,设置合理过期时间(如5分钟) + await app.setCacheAsync(cacheKey, itemInfo, 300); + return itemInfo; + } + // ⭐ 关键:缓存空值,防止缓存穿透 + // 使用特定标记,并设置较短过期时间(如1-2分钟) + const nullMarker = { + __isNull: true, + }; + await app.setCacheAsync(cacheKey, nullMarker, 120); + return null; // 明确返回 null + + + } catch (error) { + app.logger.error('[getItemInfoWithCache] 查询失败', { + itemId, + error: error.message, + stack: error.stack, + }); + + // 根据错误类型处理 + if (error.name && error.name.includes('Sequelize')) { + // 数据库错误,抛出系统异常 + throw new Error('商品信息查询服务暂时不可用'); + } + + // Redis 等缓存错误,降级直接查数据库 + // 这里简单重试一次数据库查询 + app.logger.warn('缓存服务异常,降级直接查询数据库', itemId); + try { + const itemInfo = await ctx.model.StockStore.findByPk(itemId, { + attributes: [ 'id', 'stock_id', 'warehouse_code', 'item_code' ], + raw: true, + }); + return itemInfo || null; + } catch (dbError) { + // 数据库也失败,向上抛出 + throw new Error(`查询商品信息失败: ${dbError.message}`); + } + throw error; + } + } + async getItemStorages(itemId, transaction) { + const { + ctx, + app, + } = this; + const cacheKey = `storages:${itemId}`; + + try { + // 1. 获取商品信息 + const itemInfo = await this.getItemInfoWithCache(itemId); + + // 情况A:商品不存在 + if (!itemInfo || itemInfo.__isEmpty) { + return { + success: false, + error: '已更改未同步推送到仓库', + data: null, + }; + } + + // 情况B:商品存在但未绑定库存记录 + if (!itemInfo.stock_id) { + return { + success: false, + error: '仓库已解绑,请联系仓库关联绑定', + data: null, + }; + } + + // 2. 检查缓存 + let storage = null; + let fromCache = false; + const cached = await app.getCacheAsync(cacheKey); + + if (cached) { + storage = cached; + fromCache = true; + if (storage && storage.canUse === 0) { + app.logger.debug(`[缓存快速失败] 商品 ${itemId} 可用库存为0`); + return { + success: false, + error: '库存不足', + data: null, + _fromCache: true, + }; + } + } + + // 3. 查询数据库(缓存未命中或事务场景) + if (!storage || transaction) { + const stockWarehouse = await ctx.model.StockWarehouse.findOne({ + where: { + id: itemInfo.stock_id, + is_valid: 'Y', + deleted_at: null, + }, + attributes: [ + 'id', 'quantity', 'locked_quantity', 'gross_weight', + ], + transaction, + lock: transaction?.LOCK?.UPDATE, + raw: true, + }); + + if (stockWarehouse) { + const quantity = parseInt(stockWarehouse.quantity) || 0; + const lockedQuantity = parseInt(stockWarehouse.locked_quantity) || 0; + const canUse = Math.max(0, quantity - lockedQuantity); + const grossWeight = parseInt(stockWarehouse.gross_weight) || 0; + + storage = { + id: stockWarehouse.id, + quantity, + lockedQuantity, + canUse, + grossWeight, + _updatedAt: Date.now(), + exists: true, + }; + } else { + // 库存记录不存在 + app.logger.warn(`[库存记录缺失] 商品 ${itemId} 的 stock_id ${itemInfo.stock_id} 不存在`); + storage = { + id: null, + quantity: 0, + lockedQuantity: 0, + canUse: 0, + _updatedAt: Date.now(), + exists: false, + }; + } + + // 4. 异步更新缓存(不加await,不阻塞主流程) + const ttl = this._calculateCacheTTL(storage); + if (!cached) { + app.setCacheAsync(cacheKey, storage, ttl); + } + } + + // 5. 返回结果 + return { + success: true, + data: { + stock: { + id: itemInfo.id, + stock_id: itemInfo.stock_id, + warehouse_code: itemInfo.warehouse_code, + item_code: itemInfo.item_code, + }, + storage, + }, + error: null, + _fromCache: fromCache, + }; + + } catch (error) { + app.logger.error(`[getItemStorages] 系统异常, itemId: ${itemId}`, { + error: error.message, + stack: error.stack, + }); + + return { + success: false, + error: `库存查询系统错误: ${error.message}`, + data: null, + }; + } + } + + /** + * 计算缓存时间 + * @param storage + */ + _calculateCacheTTL(storage) { + if (!storage || !storage._exists || !storage._isValid) { + return 5; // 无效库存缓存5秒 + } + + if (storage.canUse === 0) { + return 10; // 无库存缓存10秒 + } + + if (storage.canUse <= 10) { + return 15; // 低库存缓存15秒 + } + + return 60; // 正常库存缓存60秒 + } + + /** + * 清理缓存 + * @param itemId + */ + async clearItemStorageCache(itemId) { + const { + app, + } = this; + const cacheKey = `storages:${itemId}`; + try { + await app.delCacheAsync(cacheKey); + app.logger.debug(`[缓存清理] 商品 ${itemId} 库存缓存已清理`); + } catch (error) { + app.logger.warn(`[缓存清理失败] 商品 ${itemId}`, error.message); + } + } + async lockItemStorages(stockWarehouseId, quantity, transaction) { + const { + ctx, + app, + } = this; + + // 输入验证 + const lockQty = parseInt(quantity); + if (!stockWarehouseId || isNaN(lockQty) || lockQty === 0) { + return { + success: false, + error: `参数错误:库存ID无效或数量为0 (ID: ${stockWarehouseId}, Qty: ${quantity})`, + data: null, + }; + } + + const isLocking = lockQty > 0; // true=加锁,false=减锁 + const absQty = Math.abs(lockQty); + + try { + // 1. 查询并锁定记录(悲观锁) + const stockRecord = await ctx.model.StockWarehouse.findOne({ + where: { + id: stockWarehouseId, + is_valid: 'Y', + deleted_at: null, + }, + transaction, + lock: transaction.LOCK.UPDATE, // 行级锁 + raw: false, // 需要实例以使用方法 + }); + + // 检查记录是否存在 + if (!stockRecord) { + return { + success: false, + error: `库存记录不存在或已失效 (ID: ${stockWarehouseId})`, + data: null, + }; + } + + // 2. 业务规则校验 + if (isLocking) { + // 加锁操作:检查可用库存是否足够 + const availableQty = stockRecord.quantity - stockRecord.locked_quantity; + if (availableQty < absQty) { + return { + success: false, + error: `库存不足,可用 ${availableQty},需求 ${absQty}`, + data: { + available: availableQty, + required: absQty, + recordId: stockWarehouseId, + }, + }; + } + + // 检查锁定后是否会导致超卖 + const newLocked = stockRecord.locked_quantity + absQty; + if (newLocked > stockRecord.quantity) { + return { + success: false, + error: `锁定后会导致超卖,总库存 ${stockRecord.quantity},锁定后 ${newLocked}`, + data: null, + }; + } + } else { + // 减锁操作:检查已锁定库存是否足够释放 + if (stockRecord.locked_quantity < absQty) { + return { + success: false, + error: `释放数量超过已锁定库存,已锁 ${stockRecord.locked_quantity},尝试释放 ${absQty}`, + data: null, + }; + } + + // 检查释放后锁定数是否为负 + const newLocked = stockRecord.locked_quantity - absQty; + if (newLocked < 0) { + return { + success: false, + error: `释放后锁定库存为负值: ${newLocked}`, + data: null, + }; + } + } + + // 3. 执行锁定/释放操作 + let updateResult; + if (isLocking) { + // 加锁:增加 locked_quantity + updateResult = await stockRecord.increment('locked_quantity', { + by: absQty, + transaction, + silent: true, + }); + app.logger.info( + `[库存锁定] ID: ${stockWarehouseId}, 增加锁定: +${absQty}, 锁定后: ${stockRecord.locked_quantity + absQty}` + ); + } else { + // 减锁:减少 locked_quantity(确保不小于0) + updateResult = await stockRecord.decrement('locked_quantity', { + by: absQty, + transaction, + silent: true, + }); + app.logger.info( + `[库存释放] ID: ${stockWarehouseId}, 减少锁定: -${absQty}, 锁定后: ${stockRecord.locked_quantity - absQty}` + ); + } + + // 4. 获取更新后的数据(可选) + await stockRecord.reload({ + transaction, + }); + + // 5. 返回成功结果 + return { + success: true, + data: { + id: stockWarehouseId, + action: isLocking ? 'lock' : 'unlock', + quantity: absQty, + beforeLocked: isLocking ? stockRecord.locked_quantity - absQty : stockRecord.locked_quantity + + absQty, + afterLocked: stockRecord.locked_quantity, + totalQuantity: stockRecord.quantity, + available: stockRecord.quantity - stockRecord.locked_quantity, + updatedAt: stockRecord.update_at, + }, + error: null, + }; + + } catch (error) { + app.logger.error('[lockItemStorages] 系统异常', { + stockWarehouseId, + quantity, + isLocking, + error: error.message, + stack: error.stack, + }); + + // 根据错误类型返回 + if (error.name && error.name.includes('Sequelize')) { + return { + success: false, + error: `数据库操作失败: ${error.message}`, + data: null, + }; + } + + return { + success: false, + error: `系统错误: ${error.message}`, + data: null, + }; + } + } + /** + * 商品入库服务 + * @param {number} itemId 商品ID (StockStore.id) + * @param {number} quantity 入库数量(正数) + * @param {Object} transaction 数据库事务 + */ + async inbound(itemId, quantity, transaction) { + const { + ctx, + app, + } = this; + // 1. 参数验证 + const inboundQty = parseInt(quantity); + if (!itemId || inboundQty <= 0) { + return { + success: false, + error: `入库参数无效: itemId=${itemId}, quantity=${quantity}`, + data: null, + }; + } + + try { + // 2. 获取商品和库存信息(复用) + const stockResult = await this.getItemStorages(itemId, transaction); + + if (!stockResult.success) { + // 入库失败:商品不存在或未绑定 + return stockResult; + } + const { + stock, + storage, + } = stockResult.data; + + // 3. 执行库存增加 + let result; + if (storage.exists) { + // 非首次入库:更新现有记录(只增加quantity) + result = await ctx.model.StockWarehouse.increment('quantity', { + by: inboundQty, + where: { + id: storage.id, + is_valid: 'Y', + deleted_at: null, + }, + transaction, + }); + + app.logger.info('[入库] 更新现有库存', { + itemId, + stockId: storage.id, + quantity: inboundQty, + before: storage.quantity, + after: storage.quantity + inboundQty, + }); + } else { + // 首次入库:需要创建库存记录(stock_id应该已存在) + // 注意:这里需要更多信息,如warehouse_id等,实际场景可能需要额外参数 + return { + success: false, + error: '库存记录不存在,首次入库需要完整参数', + data: null, + }; + } + + // 4. 获取更新后的数据 + const updatedRecord = await ctx.model.StockWarehouse.findByPk(storage.id, { + transaction, + raw: true, + }); + + return { + success: true, + data: { + itemId, + stockId: storage.id, + action: 'inbound', + quantity: inboundQty, + beforeQuantity: storage.quantity, + afterQuantity: updatedRecord.quantity, + beforeLocked: storage.lockedQuantity, + afterLocked: updatedRecord.locked_quantity, + available: updatedRecord.quantity - updatedRecord.locked_quantity, + updatedAt: updatedRecord.update_at, + }, + error: null, + }; + + } catch (error) { + app.logger.error('[inbound] 入库失败', { + itemId, + quantity, + error: error.message, + stack: error.stack, + }); + + return { + success: false, + error: `入库系统错误: ${error.message}`, + data: null, + }; + } + } + /** + * 商品出库服务 + * @param {number} itemId 商品ID (StockStore.id) + * @param {number} quantity 出库数量(正数) + * @param {Object} transaction 数据库事务 + */ + async outbound(itemId, quantity, transaction) { + const { + ctx, + app, + } = this; + + // 1. 参数验证 + const outboundQty = parseInt(quantity); + if (!itemId || outboundQty <= 0) { + return { + success: false, + error: `出库参数无效: itemId=${itemId}, quantity=${quantity}`, + data: null, + }; + } + + try { + // 2. 获取商品和库存信息(复用) + const stockResult = await this.getItemStorages(itemId, transaction); + + if (!stockResult.success) { + return stockResult; + } + + const { + stock, + storage, + } = stockResult.data; + + // 3. 检查库存是否足够出库 + if (!storage.exists) { + return { + success: false, + error: '库存记录不存在,无法出库', + data: null, + }; + } + + // 关键检查:总库存是否足够 + if (storage.quantity < outboundQty) { + return { + success: false, + error: `总库存不足,当前 ${storage.quantity},需求 ${outboundQty}`, + data: null, + }; + } + + // 关键检查:锁定库存是否足够扣减 + if (storage.lockedQuantity < outboundQty) { + return { + success: false, + error: `锁定库存不足,已锁定 ${storage.lockedQuantity},需求 ${outboundQty}`, + data: null, + }; + } + + // 4. 执行出库扣减(同时减少quantity和locked_quantity) + const result = await ctx.model.StockWarehouse.update({ + quantity: app.Sequelize.literal(`quantity - ${outboundQty}`), + locked_quantity: app.Sequelize.literal(`locked_quantity - ${outboundQty}`), + update_at: app.Sequelize.literal('CURRENT_TIMESTAMP'), + }, { + where: { + id: storage.id, + is_valid: 'Y', + deleted_at: null, + // 乐观锁条件:确保更新时库存仍然足够 + quantity: { + [app.Sequelize.Op.gte]: outboundQty, + }, + locked_quantity: { + [app.Sequelize.Op.gte]: outboundQty, + }, + }, + transaction, + }); + + if (result[0] === 0) { + return { + success: false, + error: '出库失败:库存已被其他操作修改', + data: null, + }; + } + + // 5. 获取更新后的数据 + const updatedRecord = await ctx.model.StockWarehouse.findByPk(storage.id, { + transaction, + raw: true, + }); + + app.logger.info('[出库] 成功', { + itemId, + stockId: storage.id, + quantity: outboundQty, + beforeQuantity: storage.quantity, + afterQuantity: updatedRecord.quantity, + beforeLocked: storage.lockedQuantity, + afterLocked: updatedRecord.locked_quantity, + }); + + return { + success: true, + data: { + itemId, + stockId: storage.id, + action: 'outbound', + quantity: outboundQty, + beforeQuantity: storage.quantity, + afterQuantity: updatedRecord.quantity, + beforeLocked: storage.lockedQuantity, + afterLocked: updatedRecord.locked_quantity, + available: updatedRecord.quantity - updatedRecord.locked_quantity, + updatedAt: updatedRecord.update_at, + }, + error: null, + }; + + } catch (error) { + app.logger.error('[outbound] 出库失败', { + itemId, + quantity, + error: error.message, + stack: error.stack, + }); + + return { + success: false, + error: `出库系统错误: ${error.message}`, + data: null, + }; + } + } + async checkAndCreateWarehouseStock(sourceData, warehouseId) { + const { + ctx, + app, + service, + } = this; + + try { + // 1. 参数验证 + if (!sourceData || !sourceData.item_code) { + return { + success: false, + id: null, + message: '缺少必要参数: item_code', + }; + } + + if (!warehouseId) { + return { + success: false, + id: null, + message: '缺少必要参数: warehouseId', + }; + } + + // 2. 检查记录是否存在 + const existingRecord = await ctx.model.StockWarehouse.findOne({ + where: { + item_code: sourceData.item_code, + warehouse_id: warehouseId, + store_id: sourceData.store_id, + deleted_at: null, + }, + attributes: [ 'id' ], + raw: true, + }); + + // 3. 如果存在,直接返回ID + if (existingRecord) { + app.logger.debug( + `[库存记录已存在] item_code: ${sourceData.item_code}, warehouse_id: ${warehouseId}` + ); + return { + success: true, + id: existingRecord.id, + message: '库存记录已存在', + exists: true, + }; + } + + // 4. 准备创建数据 + const now = new Date(); + const stockData = { + // 唯一约束字段 + item_code: sourceData.item_code, + goods_code: sourceData.goods_code, + warehouse_id: warehouseId, + + // 商品基本信息 + store_id: sourceData.store_id || 0, + item_name: sourceData.item_name || '', + sku_property: sourceData.sku_property || '', + stock_unit: sourceData.stock_unit || '个', // 提供默认值 + item_type: sourceData.item_type || 'ZC', + + // 规格信息 + length: parseFloat(sourceData.length) || 0, + width: parseFloat(sourceData.width) || 0, + height: parseFloat(sourceData.height) || 0, + volume: parseFloat(sourceData.volume) || 0, + gross_weight: parseFloat(sourceData.gross_weight) || 0, + net_weight: parseFloat(sourceData.net_weight) || 0, + + // 价格信息 + tag_price: parseFloat(sourceData.tag_price) || 0, + retail_price: parseFloat(sourceData.retail_price) || 0, + + brand_name: sourceData.brand_name || null, + // 管理属性 + is_sn_mgmt: sourceData.is_sn_mgmt === 'Y' ? 'Y' : 'N', + is_shelf_life_mgmt: sourceData.is_shelf_life_mgmt === 'Y' ? 'Y' : 'N', + is_batch_mgmt: sourceData.is_batch_mgmt === 'Y' ? 'Y' : 'N', + + // 其他字段 + packing_requirements: sourceData.packing_requirements || '', + create_at: now, + update_at: now, + is_valid: 'Y', + level: 'C', + quantity: parseInt(sourceData.quantity) || 0, + locked_quantity: parseInt(sourceData.locked_quantity) || 0, + deleted_at: null, + }; + + // 5. 创建记录(处理可能的重复插入) + let createdRecord; + try { + createdRecord = await ctx.model.StockWarehouse.create(stockData); + const barcodes = sourceData.barcode.split(';'); + const existingFileIds = []; + const toCreate = barcodes.filter(item => !existingFileIds.includes(item)); + // 批量操作 + const promises = []; + + if (toCreate.length > 0) { + const refData = toCreate.map(item => ({ + stock_id: createdRecord.id, + barcode: item, + warehouse_id: warehouseId, + created_at: new Date(), + })); + promises.push(ctx.model.StockBarcode.bulkCreate(refData)); + await Promise.all(promises); + } + await service.systems.operationLog.createOperationLog({ + businessType: 'stock', + businessId: createdRecord.id, + operationCode: 'CREATE', + operator: { + id: null, + name: '奇门', + }, + extras: { + warehouseId, + externalLogType: 'QIMEN', + externalLogId: this.ctx.qimenLogId, + }, + beforeChanges: null, + }); + } catch (createError) { + // 如果是唯一约束冲突,说明在创建过程中其他请求已经创建了 + if (createError.name === 'SequelizeUniqueConstraintError') { + app.logger.warn( + `[库存记录并发创建] item_code: ${sourceData.item_code}, warehouse_id: ${warehouseId}` + ); + + // 重新查询一次 + const retryRecord = await ctx.model.StockWarehouse.findOne({ + where: { + item_code: sourceData.item_code, + goods_code: sourceData.goods_code, + warehouse_id: warehouseId, + is_valid: 'Y', + }, + attributes: [ 'id' ], + raw: true, + }); + + if (retryRecord) { + return { + success: true, + id: retryRecord.id, + message: '库存记录并发创建成功', + exists: true, + }; + } + } + throw createError; + } + + app.logger.debug(`[库存记录创建成功] id: ${createdRecord.id}, item_code: ${sourceData.item_code}`); + + return { + success: true, + id: createdRecord.id, + message: '库存记录创建成功', + exists: false, + }; + + } catch (error) { + app.logger.error('[checkAndCreateStock] 系统异常', { + sourceData, + warehouseId, + error: error.message, + stack: error.stack, + }); + + return { + success: false, + id: null, + message: `库存记录操作失败: ${error.message}`, + error, + }; + } + } + /** + * 获取仓库库存列表(支持分页和动态查询条件) + * @param {Object} where - 查询条件对象 + * @param {Object} pageParams - 分页参数 + * @param {number} pageParams.page - 当前页码,默认1 + * @param {number} pageParams.pageSize - 每页条数,默认20 + * @param {Object} sortParams - 排序参数 + * @param {string} sortParams.sortField - 排序字段,默认'create_at' + * @param {string} sortParams.sortOrder - 排序方式,默认'DESC' + * @return {Promise} 返回查询结果 + */ + async getWarehouseStock(where, pageParams = {}, sortParams = {}) { + const { + ctx, + app, + config, + } = this; + const { + Sequelize, + } = app; + const { + Op, + } = Sequelize; + + try { + // 设置默认参数 + const { + page = 1, + pageSize = 20, + } = pageParams; + + const { + sortField = 'id', + sortOrder = 'DESC', + } = sortParams; + + // 构建基础查询条件 + const queryOptions = { + where: {}, + order: [], + attributes: { + exclude: [ 'deleted_at' ], + }, + }; + const barcodeQueryOptions = { + where: {}, + }; + const prohibitedQueryOptions = { + where: {}, + }; + // 添加默认条件 + queryOptions.where[Op.and] = [{ + warehouse_id: ctx.user.store_id, + }, + { + is_valid: 'Y', + }, + { + deleted_at: null, + }, + ]; + barcodeQueryOptions.where[Op.and] = []; + prohibitedQueryOptions.where[Op.and] = []; + // 检测并处理条码查询条件 + let hasBarcodeCondition = false; + + let hasProhibitedCondition = false; + let barcodeCondition = null; + + // 处理动态查询条件 + if (where && Object.keys(where).length > 0) { + const dynamicConditions = []; + const prohibitedConditions = []; + const barcodedynamicConditions = []; + + for (const fieldKey in where) { + const condition = where[fieldKey]; + + if (this.isEmptyValue(condition.value)) { + continue; + } + + // 检查是否是条码查询 + if (fieldKey === 'barcode') { + hasBarcodeCondition = true; + barcodeCondition = this.buildSequelizeCondition(fieldKey, condition, app); + if (barcodeCondition) { + barcodedynamicConditions.push(barcodeCondition); + } + continue; // 暂不添加到动态条件中 + } + if (fieldKey === 'prohibited_type') { + condition.field = 'id'; + hasProhibitedCondition = true; + const prohibitedCondition = this.buildSequelizeCondition('id', condition, app); + if (prohibitedCondition) { + prohibitedConditions.push(prohibitedCondition); + } + continue; + } + // 其他字段的处理 + const sequelizeCondition = this.buildSequelizeCondition(fieldKey, condition, app); + if (sequelizeCondition) { + dynamicConditions.push(sequelizeCondition); + } + } + + if (dynamicConditions.length > 0) { + queryOptions.where[Op.and].push({ + [Op.and]: dynamicConditions, + }); + } + if (barcodedynamicConditions.length > 0) { + barcodeQueryOptions.where[Op.and].push({ + [Op.and]: barcodedynamicConditions, + }); + } + if (prohibitedConditions.length > 0) { + prohibitedQueryOptions.where[Op.and].push({ + [Op.and]: prohibitedConditions, + }); + } + + } + + // 如果有条码查询条件,先查询匹配的库存ID + let matchedStockIds = []; + if (hasBarcodeCondition && barcodeCondition) { + // 从条码条件中提取条码值,构建条码查询 + let barcodeValues = []; + + // 根据不同的条件格式提取条码值 + if (where.barcode.value) { + if (Array.isArray(where.barcode.value)) { + barcodeValues = where.barcode.value; + } else if (typeof where.barcode.value === 'string') { + barcodeValues = [ where.barcode.value ]; + } + } + + if (barcodeValues.length > 0) { + // 构建条码查询条件 + const barcodeWhere = {}; + + if (where.barcode.operator === 'eq') { + // 精确查询 + if (barcodeValues.length === 1) { + barcodeWhere.barcode = barcodeValues[0]; + } else { + barcodeWhere.barcode = { + [Op.in]: barcodeValues, + }; + } + } else if (where.barcode.operator === 'like') { + // 模糊查询 + if (barcodeValues.length === 1) { + barcodeWhere.barcode = { + [Op.like]: `%${barcodeValues[0]}%`, + }; + } else { + const likeConditions = barcodeValues.map(value => ({ + barcode: { + [Op.like]: `%${value}%`, + }, + })); + barcodeWhere[Op.or] = likeConditions; + } + } else { + // 默认模糊查询 + barcodeWhere.barcode = { + [Op.like]: `%${barcodeValues[0]}%`, + }; + } + // 查询匹配的条码,获取库存ID + const matchedBarcodes = await ctx.model.StockBarcode.findAll({ + ...barcodeQueryOptions, + attributes: [ 'stock_id' ], + group: [ 'stock_id' ], // 使用 GROUP BY 去重 + raw: true, + }); + + matchedStockIds = matchedBarcodes.map(b => b.stock_id); + + // 如果没有匹配的条码,直接返回空结果 + if (matchedStockIds.length === 0) { + return { + code: 200, + data: { + list: [], + pagination: { + page: parseInt(page), + pageSize: parseInt(pageSize), + total: 0, + totalPages: 0, + hasPrevious: false, + hasNext: false, + }, + summary: { + total_quantity: 0, + total_locked: 0, + total_available: 0, + total_items: 0, + }, + }, + message: '查询成功', + }; + } + + // 将库存ID条件合并到主查询条件中 + queryOptions.where[Op.and].push({ + id: { + [Op.in]: matchedStockIds, + }, + }); + } + } + + // 处理排序 + const validSortFields = [ + 'id', 'item_code', 'item_name', 'quantity', 'locked_quantity', + 'tag_price', 'retail_price', 'create_at', 'update_at', + ]; + + const actualSortField = validSortFields.includes(sortField) ? sortField : 'create_at'; + const actualSortOrder = sortOrder.toUpperCase() === 'ASC' ? 'ASC' : 'DESC'; + queryOptions.order.push([ actualSortField, actualSortOrder ]); + + // 计算分页偏移量 + const offset = (page - 1) * pageSize; + + // 执行查询:获取总数和数据 + const [ total, data ] = await Promise.all([ + // 获取总数 + ctx.model.StockWarehouse.count({ + where: queryOptions.where, + include: [{ + model: ctx.model.StoreWarehouse, + as: 'store_stock', + attributes: [ 'store_remask' ], + where: { + use_status: 1, + }, + required: true, + }, { + ...prohibitedQueryOptions, + model: ctx.model.ProhibitedType, + as: 'prohibited', + attributes: [ 'type_name' ], + required: hasProhibitedCondition, + }], + distinct: true, + }), + + // 获取分页数据 + ctx.model.StockWarehouse.findAll({ + ...queryOptions, + include: [{ + model: ctx.model.StoreWarehouse, + as: 'store_stock', + attributes: [ 'store_remask' ], + where: { + use_status: 1, + }, + required: true, + }, { + ...prohibitedQueryOptions, + model: ctx.model.ProhibitedType, + as: 'prohibited', + attributes: [ 'type_name' ], + required: hasProhibitedCondition, + }], + limit: parseInt(pageSize), + offset: parseInt(offset), + distinct: true, // 确保去重 + raw: true, + }), + ]); + + // 计算分页信息 + const totalPages = Math.ceil(total / pageSize); + const hasPrevious = page > 1; + const hasNext = page < totalPages; + + // 批量查询条码信息 + const stockIds = data.map(item => item.id); + let barcodes = []; + let images = []; + if (stockIds.length > 0) { + barcodes = await ctx.model.StockBarcode.findAll({ + where: { + stock_id: { + [Op.in]: stockIds, + }, + }, + raw: true, + }); + images = await ctx.model.FileReference.findAll({ + where: { + business_type: 'stock', + business_id: { + [Op.in]: stockIds, + }, + }, + include: [{ + model: ctx.model.File, + as: 'file', + attributes: [ 'file_url' ], + required: true, + }], + }); + } + + // 处理数据,添加一些计算字段 + const processedData = data.map(item => { + const availableQuantity = Math.max(0, item.quantity - item.locked_quantity); + const lockRate = item.quantity > 0 ? (item.locked_quantity / item.quantity * 100).toFixed( + 2) : 0; + + // 过滤该商品的条码 + const itemBarcodes = barcodes + .filter(barcode => barcode.stock_id === item.id) + .map(barcode => barcode.barcode); + const { + cos, + } = config; + const { + cdnurl, + } = cos; + const itemImages = images + .filter(images => parseInt(images.business_id) === item.id) + .map(images => images.file.file_url); + return { + ...item, + barcodes: itemBarcodes, + images: itemImages, + available_quantity: availableQuantity, + lock_rate: parseFloat(lockRate), + lock_rate_display: `${lockRate}%`, + create_at_display: item.create_at ? this.formatDate(item.create_at) : '', + update_at_display: item.update_at ? this.formatDate(item.update_at) : '', + // 标记是否通过条码查询匹配 + is_barcode_matched: hasBarcodeCondition && matchedStockIds.includes(item.id), + }; + }); + + // 添加汇总信息 + const summary = { + total_quantity: data.reduce((sum, item) => sum + item.quantity, 0), + total_locked: data.reduce((sum, item) => sum + item.locked_quantity, 0), + total_available: data.reduce((sum, item) => sum + Math.max(0, item.quantity - item + .locked_quantity), 0), + total_items: data.length, + // 如果有条码查询,添加匹配统计 + ...(hasBarcodeCondition && { + barcode_matched_count: matchedStockIds.length, + barcode_search_value: where.barcode.value, + }), + }; + + + return { + code: 200, + data: { + list: processedData, + pagination: { + page: parseInt(page), + pageSize: parseInt(pageSize), + total, + totalPages, + hasPrevious, + hasNext, + }, + summary, + queryInfo: { + conditions: where, + sortField: actualSortField, + sortOrder: actualSortOrder, + hasBarcodeSearch: hasBarcodeCondition, + }, + }, + message: '查询成功', + }; + + } catch (error) { + ctx.logger.error('[StockService.getWarehouseStock] 查询失败:', error); + return { + code: 500, + data: { + list: [], + pagination: { + page: parseInt(pageParams.page || 1), + pageSize: parseInt(pageParams.pageSize || 20), + total: 0, + totalPages: 0, + hasPrevious: false, + hasNext: false, + }, + summary: { + total_quantity: 0, + total_locked: 0, + total_available: 0, + total_items: 0, + }, + }, + message: `查询失败: ${error.message}`, + }; + } + } + + /** + * 构建Sequelize查询条件 + * @param {string} fieldKey - 字段键名 + * @param {Object} condition - 条件对象 + * @param {Object} app - Egg应用实例 + * @return {Object|null} Sequelize条件对象 + */ + buildSequelizeCondition(fieldKey, condition, app) { + const { + Sequelize, + } = app; + const { + operator = 'eq', value, type, isMultiple, + } = condition; + + // 处理字段名 + const fieldName = condition.field || fieldKey; + + // 特殊值处理 + const processedValue = this.processConditionValue(value, type); + // 根据操作符构建条件 + switch (operator.toLowerCase()) { + case 'eq': + return { + [fieldName]: processedValue, + }; + + case 'ne': + return { + [fieldName]: { + [Sequelize.Op.ne]: processedValue, + }, + }; + + case 'contains': + case 'like': + // 处理多值情况 + if (Array.isArray(processedValue) && processedValue.length > 0) { + // 多个值使用 OR 连接 + return { + [Sequelize.Op.or]: processedValue.map(val => ({ + [fieldName]: { + [Sequelize.Op.like]: `%${val}%`, + }, + })), + }; + } + // 单个值正常处理 + return { + [fieldName]: { + [Sequelize.Op.like]: `%${processedValue}%`, + }, + }; + + case 'startswith': + // 处理多值情况 + if (Array.isArray(processedValue) && processedValue.length > 0) { + return { + [Sequelize.Op.or]: processedValue.map(val => ({ + [fieldName]: { + [Sequelize.Op.like]: `${val}%`, + }, + })), + }; + } + return { + [fieldName]: { + [Sequelize.Op.like]: `${processedValue}%`, + }, + }; + + case 'endswith': + // 处理多值情况 + if (Array.isArray(processedValue) && processedValue.length > 0) { + return { + [Sequelize.Op.or]: processedValue.map(val => ({ + [fieldName]: { + [Sequelize.Op.like]: `%${val}`, + }, + })), + }; + } + return { + [fieldName]: { + [Sequelize.Op.like]: `%${processedValue}`, + }, + }; + + case 'gt': + return { + [fieldName]: { + [Sequelize.Op.gt]: processedValue, + }, + }; + + case 'lt': + return { + [fieldName]: { + [Sequelize.Op.lt]: processedValue, + }, + }; + + case 'ge': + return { + [fieldName]: { + [Sequelize.Op.gte]: processedValue, + }, + }; + + case 'le': + return { + [fieldName]: { + [Sequelize.Op.lte]: processedValue, + }, + }; + + case 'in': + return Array.isArray(processedValue) ? { + [fieldName]: { + [Sequelize.Op.in]: processedValue, + }, + } : + null; + + case 'notin': + return Array.isArray(processedValue) ? { + [fieldName]: { + [Sequelize.Op.notIn]: processedValue, + }, + } : + null; + + case 'between': + return Array.isArray(processedValue) && processedValue.length === 2 ? { + [fieldName]: { + [Sequelize.Op.between]: processedValue, + }, + } : + null; + + case 'notbetween': + return Array.isArray(processedValue) && processedValue.length === 2 ? { + [fieldName]: { + [Sequelize.Op.notBetween]: processedValue, + }, + } : + null; + + case 'isnull': + return { + [fieldName]: { + [Sequelize.Op.is]: null, + }, + }; + + case 'isnotnull': + return { + [fieldName]: { + [Sequelize.Op.not]: null, + }, + }; + + case 'regexp': + return { + [fieldName]: { + [Sequelize.Op.regexp]: processedValue, + }, + }; + + case 'notregexp': + return { + [fieldName]: { + [Sequelize.Op.notRegexp]: processedValue, + }, + }; + + default: + // 默认使用等于操作符 + return { + [fieldName]: processedValue, + }; + } + } + + /** + * 处理条件值 + * @param {any} value - 原始值 + * @param {string} type - 字段类型 + * @return {any} 处理后的值 + */ + processConditionValue(value, type) { + if (value === undefined || value === null) { + return value; + } + + switch (type) { + case 'boolean': + // 处理布尔值:true/Y -> 'Y', false/N -> 'N' + if (value === true || value === 'true' || value === 'Y' || value === 'y') { + return 'Y'; + } + if (value === false || value === 'false' || value === 'N' || value === 'n') { + return 'N'; + } + return value; + + case 'date': + case 'daterange': + // 确保日期格式正确 + if (Array.isArray(value)) { + return value.map(v => this.normalizeDate(v)); + } + return this.normalizeDate(value); + + case 'number': + // 转换为数字 + const num = parseFloat(value); + return isNaN(num) ? value : num; + case 'text': + return value.split(','); + default: + return value; + } + } + + + /** + * 格式化日期显示 + * @param {string} dateString - 日期字符串 + * @return {string} 格式化后的日期 + */ + formatDate(dateString) { + if (!dateString) return ''; + + const date = new Date(dateString); + if (isNaN(date.getTime())) return dateString; + + return date.toLocaleString('zh-CN', { + year: 'numeric', + month: '2-digit', + day: '2-digit', + hour: '2-digit', + minute: '2-digit', + }); + } + + /** + * 判断值是否为空 + * @param {any} value - 要判断的值 + * @return {boolean} 是否为空 + */ + isEmptyValue(value) { + if (value === undefined || value === null) { + return true; + } + + if (typeof value === 'string' && value.trim() === '') { + return true; + } + + if (Array.isArray(value) && value.length === 0) { + return true; + } + + return false; + } + async getProhibitedType() { + const { + ctx, + app, + } = this; + const { + Op, + } = app.Sequelize; + + // 从用户信息获取仓库ID + const warehouseId = ctx.user.store_id; + + // 查询系统预设分类和当前仓库专有分类 + const types = await ctx.model.ProhibitedType.findAll({ + where: { + [Op.or]: [{ + warehouse_id: null, + }, // 系统预设 + { + warehouse_id: warehouseId, + }, // 当前仓库专有 + ], + }, + order: [ + [ 'warehouse_id', 'ASC' ], // 系统预设在前(warehouse_id为null) + [ 'sort_order', 'ASC' ], // 按排序字段 + [ 'created_at', 'ASC' ], // 按创建时间 + ], + attributes: [ + 'id', + 'type_name', + 'warehouse_id', + 'is_system_preset', + 'sort_order', + ], + }); + + // 转换为前端需要的格式 {value: id, label: type_name} + const result = types.map(item => ({ + value: item.id, + label: item.type_name, + warehouse_id: item.warehouse_id, + is_system_preset: item.is_system_preset, + sort_order: item.sort_order, + })); + + return result; + } + + async getBarcodes(data) { + const { + ctx, + } = this; + const { + id, + } = data; + const warehouseId = ctx.user.store_id; + const barcodes = await ctx.model.StockBarcode.findAll({ + where: { + stock_id: id, + }, + attributes: [ + 'barcode', + ], + include: [{ + model: ctx.model.StockWarehouse, + as: 'stock', + attributes: [ 'id' ], + where: { + warehouse_id: warehouseId, + }, + required: true, + }], + raw: true, + }); + return barcodes; + } + async handleBatchChange() { + const { ctx, service, app } = this; + const { Op } = app.Sequelize; + + const canChangeFlide = [ 'brand_name', 'prohibited_id', 'gross_weight', 'packing_requirements', 'managementFlags', 'stock_unit' ]; + + const { ids, method, value } = ctx.request.body; + console.log('批量修改参数', ctx.request.body); + + try { + // 1. 参数验证 + if (!ids || !Array.isArray(ids) || ids.length === 0) { + return { message: '请选择要修改的商品', code: 405 }; + } + + if (!method || !canChangeFlide.includes(method)) { + return { message: `不支持修改的字段: ${method}`, code: 405 }; + } + + if (value === undefined || value === null) { + return { message: '修改值不能为空', code: 405 }; + } + + // 2. 获取仓库ID + const warehouseId = ctx.user.store_id; + if (!warehouseId) { + return { message: '缺少仓库信息', code: 405 }; + } + + // 3. 验证要修改的记录是否存在且属于当前仓库 + const existingRefs = await ctx.model.StockWarehouse.findAll({ + where: { + id: { [Op.in]: ids }, + warehouse_id: warehouseId, + delete_at: null, + }, + attributes: [ 'id' ], + }); + + if (existingRefs.length !== ids.length) { + const existingIds = existingRefs.map(item => item.id); + const notExistIds = ids.filter(id => !existingIds.includes(id)); + return { + message: `部分商品不存在或无权修改: ${notExistIds.join(',')}`, + code: 405, + }; + } + + // 4. 根据字段类型处理值 + let updateData = {}; + + if (method === 'prohibited_id') { + // 违禁品类型应该是数字 + const updateValue = parseInt(value, 10); + if (isNaN(updateValue)) { + return { message: '违禁品类型必须是数字', code: 405 }; + } + updateData = { + prohibited_id: updateValue, + update_at: new Date(), + update_by: ctx.user.id || ctx.user.username, + }; + + } else if (method === 'gross_weight') { + // 毛重应该是数字 + const updateValue = parseFloat(value); + if (isNaN(updateValue) || updateValue < 0) { + return { message: '毛重必须是有效的正数', code: 405 }; + } + updateData = { + gross_weight: updateValue, + update_at: new Date(), + update_by: ctx.user.id || ctx.user.username, + }; + + } else if (method === 'managementFlags') { + // 管理标识是对象格式,需要更新三个独立字段 + if (typeof value !== 'object') { + return { message: '管理标识必须是对象格式', code: 405 }; + } + + // 验证三个管理标识字段 + const managementFields = [ 'is_sn_mgmt', 'is_shelf_life_mgmt', 'is_batch_mgmt' ]; + updateData = { + update_at: new Date(), + update_by: ctx.user.id || ctx.user.username, + }; + + for (const field of managementFields) { + if (value[field] === undefined) { + return { message: `管理标识缺少 ${field} 字段`, code: 405 }; + } + if (![ 'Y', 'N' ].includes(value[field])) { + return { message: `管理标识 ${field} 的值必须是 Y 或 N`, code: 405 }; + } + updateData[field] = value[field]; + } + + } else { + // 品牌名称和打包要求验证 + if (typeof value !== 'string') { + return { message: `${method} 必须是字符串`, code: 405 }; + } + if (value.length > 255) { + return { message: `${method} 不能超过255个字符`, code: 405 }; + } + updateData = { + [method]: value, + update_at: new Date(), + update_by: ctx.user.id || ctx.user.username, + }; + } + + // 5. 执行批量更新 + const [ affectedRows ] = await ctx.model.StockWarehouse.update(updateData, { + where: { + id: { [Op.in]: ids }, + warehouse_id: warehouseId, + delete_at: null, + }, + }); + return { + message: `成功修改 ${affectedRows} 条记录`, + code: 200, + data: { + affectedRows, + ids, + }, + }; + + } catch (error) { + ctx.logger.error('批量修改失败:', error); + console.error('批量修改错误:', error); + + return { + message: error.message || '批量修改失败', + code: 500, + }; + } + } + async saveWarehouseStockBarcode(data) { + const { + ctx, service, + } = this; + console.log('条码修改提交', data); + const { + id, + barcodes, + } = data; + const warehouseId = ctx.user.store_id; + // 获取现有的file_id + const existingRefs = await ctx.model.StockBarcode.findAll({ + where: { + stock_id: id, + warehouse_id: warehouseId, + }, + }); + const existingFileIds = existingRefs.map(item => item.barcode); + const newFileIds = barcodes.map(item => item); + + // 需要删除的ID + const toDeleteIds = existingFileIds.filter(barcode => !newFileIds.includes(barcode)); + + // 需要创建的记录 + const toCreate = barcodes.filter(item => !existingFileIds.includes(item)); + + // 批量操作 + const promises = []; + + if (toDeleteIds.length > 0) { + promises.push( + ctx.model.StockBarcode.destroy({ + where: { + stock_id: id, + barcode: toDeleteIds, + warehouse_id: warehouseId, + }, + }) + ); + } + + if (toCreate.length > 0) { + const refData = toCreate.map(item => ({ + stock_id: id, + barcode: item, + warehouse_id: warehouseId, + created_at: new Date(), + })); + + promises.push(ctx.model.StockBarcode.bulkCreate(refData)); + } + await Promise.all(promises); + await service.systems.operationLog.createOperationLog({ + businessType: 'stock', + businessId: id, + operationCode: 'UPDATE_BARCODE', + operator: { + id: ctx.user.id, + name: ctx.user.employees_name, + }, + beforeChanges: null, + extras: { + warehouseId, + }, + }); + return { + success: true, + }; + } + async getStoreStocks(data) { + + const { + app, + } = this; + const { + Sequelize, + } = app; + const { + Op, + } = Sequelize; + const { + ctx, + } = this; + console.log(data); + const { + stock_id = null, store_id = null, page = 1, pageSize = 20, item_code = '', item_name = '', + } = data || {}; + const warehouseId = ctx.user.store_id; + let barcodes = []; + let warehouseStock = null; + console.log(stock_id); + let total = 0; + if (stock_id) { + barcodes = await ctx.model.StockStore.findAll({ + where: { + stock_id, + }, + attributes: [ + 'item_code', 'item_name', 'app_key', 'create_from', 'id', + ], + include: [{ + model: ctx.model.StockWarehouse, + as: 'warehouse_stock', + attributes: [ 'id', 'store_id' ], + where: { + warehouse_id: warehouseId, + }, + required: true, + }], + raw: true, + }); + + warehouseStock = await ctx.model.StockWarehouse.findOne({ + where: { + id: stock_id, + }, + attributes: [ + 'store_id', + ], + }); + } else { + const StockWarehouseWhere = { + warehouse_id: warehouseId, + }; + const StockStoreWhere = {}; + if (store_id) { + StockWarehouseWhere.store_id = store_id; + } + if (item_code) { + const processedValue = item_code.split(','); + const likeConditions = processedValue.map(value => ({ + item_code: { + [Op.like]: `%${value}%`, + }, + })); + StockStoreWhere[Op.or] = likeConditions; + } + if (item_name) { + const processedValue = item_name.split(','); + const likeConditions = processedValue.map(value => ({ + item_name: { + [Op.like]: `%${value}%`, + }, + })); + StockStoreWhere[Op.or] = likeConditions; + } + const offset = (page - 1) * pageSize; + [ total, barcodes ] = await Promise.all([ + ctx.model.StockStore.count({ + where: StockStoreWhere, + attributes: [ + 'item_code', 'item_name', 'app_key', 'create_from', 'id', 'stock_id', + ], + include: [{ + model: ctx.model.StockWarehouse, + as: 'warehouse_stock', + attributes: [ 'id' ], + where: StockWarehouseWhere, + required: false, + }], + limit: parseInt(pageSize), + offset: parseInt(offset), + raw: true, + }), + ctx.model.StockStore.findAll({ + where: StockStoreWhere, + attributes: [ + 'item_code', 'item_name', 'app_key', 'create_from', 'id', 'stock_id', + ], + include: [{ + model: ctx.model.StockWarehouse, + as: 'warehouse_stock', + attributes: [ 'id' ], + where: StockWarehouseWhere, + required: false, + }], + limit: parseInt(pageSize), + offset: parseInt(offset), + raw: true, + }), + ]); + } + console.log('barcodes>>>>', barcodes); + const results = barcodes.map(item => { + return { + app_key: item.app_key, + create_from: item.create_from == 'qimen' ? '奇门' : 'API', + id: item.id, + app_name: item.app_key, + item_code: item.item_code, + stock_id: item['warehouse_stock.id'], + hasBind: !!item.stock_id, + item_name: item.item_name, + }; + }); + console.log('warehouseStock>>>', warehouseStock); + const get_store_id = warehouseStock ? warehouseStock.store_id : barcodes[0]['warehouse_stock.store_id']; + console.log('get_store_id>>>', get_store_id); + return { + rows: results, + store_id: get_store_id, + total, + }; + } + async bindItem(data) { + const { + ctx, + app, + } = this; + const { + id, + warehouse_stock, + } = data; + const warehouseId = ctx.user.store_id; + try { + const storeStock = await ctx.model.StockStore.findOne({ + where: { + warehouse_id: warehouseId, + deleted_at: null, + id, + }, + attributes: [ + 'stock_id', + 'store_id', + ], + }); + if (!storeStock) { + throw new Error('外部商品不存在'); + } + const warehouseStock = await ctx.model.StockWarehouse.findOne({ + where: { + warehouse_id: warehouseId, + deleted_at: null, + id: warehouse_stock, + }, + attributes: [ + 'store_id', + ], + }); + if (!warehouseStock) { + throw new Error('仓库商品不存在'); + } + if (warehouseStock.store_id !== storeStock.store_id) { + throw new Error('仓库商品和外部商品不是同一个货主,刷新再试'); + } + await app.model.StockStore.update({ + stock_id: warehouse_stock, + }, { + where: { + id, + }, + }); + return 1; + } catch (e) { + console.log(e); + throw e; + } + } + async unbindItem(data) { + const { + ctx, + app, + } = this; + const { + id, + } = data; + const warehouseId = ctx.user.store_id; + try { + const storeStock = await ctx.model.StockStore.findOne({ + where: { + warehouse_id: warehouseId, + deleted_at: null, + id, + }, + attributes: [ + 'stock_id', + 'store_id', + ], + }); + if (!storeStock) { + throw new Error('外部商品不存在'); + } + await app.model.StockStore.update({ + stock_id: null, + }, { + where: { + id, + }, + }); + return 1; + } catch (e) { + console.log(e); + throw e; + } + } + + async getInfo(data) { + const { + ctx, + } = this; + const { + id, + } = data; + const warehouseId = ctx.user.store_id; + const stock = await ctx.model.StockWarehouse.findOne({ + where: { + warehouse_id: warehouseId, + deleted_at: null, + id, + }, + attributes: [ + 'gross_weight', + 'height', + 'id', + 'is_batch_mgmt', + 'is_shelf_life_mgmt', + 'is_sn_mgmt', + 'item_code', + 'item_name', + 'length', + 'net_weight', + 'packing_requirements', + 'prohibited_id', + 'retail_price', + 'sku_property', + 'stock_unit', + 'tag_price', + 'brand_name', + 'volume', + 'width', + 'enable_box_spec', + 'quantity_per_box', + 'box_gross_weight', + 'box_net_weight', + 'box_length', + 'box_width', + 'box_height', + 'box_volume', + 'store_id', + ], + raw: true, + }); + stock.enable_box_spec = !!stock.enable_box_spec; + return stock; + } + async saveWarehouseStock(data) { + const { ctx, service } = this; + const warehouseId = ctx.user.store_id; + const { + item_code, store_id, item_name, sku_property, stock_unit, + packing_requirements, length, width, height, volume, + gross_weight, net_weight, tag_price, retail_price, + is_sn_mgmt, is_shelf_life_mgmt, is_batch_mgmt, + prohibited_id, brand_name, managementFlags, + enable_box_spec, box_unit, quantity_per_box, + box_gross_weight, box_net_weight, box_length, + box_width, box_height, box_volume, box_remark, id, + } = data; + const prohibited_id_tmp = !prohibited_id ? null : parseInt(prohibited_id); + // 1. 参数验证 + this.validateSaveParams(data); + + let transaction; + try { + // 2. 开启事务 + transaction = await ctx.model.transaction(); + + // 3. 查询商品是否存在 + const stock_info = await ctx.model.StockWarehouse.findOne({ + where: { + id, + deleted_at: null, + warehouse_id: ctx.user.store_id, + }, + transaction, + }); + + if (!stock_info) { + throw new Error('商品不存在'); + } + + // 4. 准备更新数据 + const updateData = { + item_code, + item_name, + sku_property, + stock_unit, + packing_requirements, + length, + width, + height, + volume, + gross_weight, + net_weight, + tag_price, + retail_price, + enable_box_spec: enable_box_spec ? 1 : 0, + is_sn_mgmt: is_sn_mgmt || false, + is_shelf_life_mgmt: is_shelf_life_mgmt || false, + is_batch_mgmt: is_batch_mgmt || false, + prohibited_id: prohibited_id_tmp, + brand_name, + ...(managementFlags && { management_flags: managementFlags }), + box_unit, + quantity_per_box, + box_gross_weight, + box_net_weight, + box_length, + box_width, + box_height, + box_volume, + box_remark, + updated_at: new Date(), + }; + console.log('更新数据', updateData); + // 5. 清除空值 + Object.keys(updateData).forEach(key => { + if (key != 'prohibited_id' && (updateData[key] === undefined || updateData[key] === null)) { + delete updateData[key]; + } + }); + + // 6. 执行更新 + const [ affectedRows ] = await ctx.model.StockWarehouse.update(updateData, { + where: { + id, + warehouse_id: ctx.user.store_id, + deleted_at: null, + }, + transaction, + }); + + await service.systems.operationLog.createOperationLog({ + businessType: 'stock', + businessId: id, + operationCode: 'UPDATE', + operator: { + id: ctx.user.id, + name: ctx.user.employees_name, + }, + beforeChanges: stock_info, + extras: { + warehouseId, + }, + }); + // 7. 提交事务 + await transaction.commit(); + + // 8. 返回更新后的数据 + return await this.getInfo({ id }); + + } catch (error) { + // 9. 回滚事务 + if (transaction) { + await transaction.rollback(); + } + + ctx.logger.error('saveWarehouseStock error:', error); + + // 根据错误类型返回更友好的错误信息 + if (error.name === 'SequelizeValidationError') { + throw new Error(`数据验证失败: ${error.errors.map(e => e.message).join(', ')}`); + } + + throw error; + } + } + async createWarehouseStock(data) { + const { ctx, service } = this; + const warehouseId = ctx.user.store_id; + const { + item_code, store_id, item_name, sku_property, stock_unit, + packing_requirements, length, width, height, volume, + gross_weight, net_weight, tag_price, retail_price, + is_sn_mgmt, is_shelf_life_mgmt, is_batch_mgmt, + prohibited_id, brand_name, managementFlags, + enable_box_spec, box_unit, quantity_per_box, + box_gross_weight, box_net_weight, box_length, + box_width, box_height, box_volume, box_remark, id, barcode, + } = data; + + // 1. 参数验证 + this.validateSaveParams(data, false); + let checkItemCodeUnique = {}; + try { + checkItemCodeUnique = await this.checkItemCodeUnique(null, item_code, store_id, warehouseId); + } catch (e) { + console.log(e); + throw (e); + } + if (checkItemCodeUnique && !checkItemCodeUnique.isUnique) { + throw (new Error('创建失败,商品编码已被使用')); + } + const insertData = { + item_code, + item_name, + sku_property, + stock_unit, + packing_requirements, + length, + width, + height, + volume, + gross_weight, + net_weight, + tag_price, + retail_price, + warehouse_id: warehouseId, + enable_box_spec: enable_box_spec ? 1 : 0, + is_sn_mgmt: is_sn_mgmt || false, + is_shelf_life_mgmt: is_shelf_life_mgmt || false, + is_batch_mgmt: is_batch_mgmt || false, + prohibited_id, + brand_name, + ...(managementFlags && { management_flags: managementFlags }), + box_unit, + quantity_per_box, + box_gross_weight, + box_net_weight, + item_type: 'ZC', + level: 'C', + store_id, + box_length, + create_at: new Date(), + box_width, + box_height, + box_volume, + box_remark, + updated_at: new Date(), + }; + const transaction = await ctx.model.transaction(); + try { + // 2. 开启事务 + const createdRecord = await ctx.model.StockWarehouse.create(insertData, transaction); + const barcodes_arr = barcode.split(';'); + const existingFileIds = []; + const toCreate = barcodes_arr.filter(item => !existingFileIds.includes(item)); + // 批量操作 + const promises = []; + console.log('createdRecord', createdRecord.id); + if (toCreate.length > 0) { + const refData = toCreate.map(item => ({ + stock_id: createdRecord.id, + barcode: item, + warehouse_id: warehouseId, + created_at: new Date(), + })); + console.log('refData', refData); + promises.push(ctx.model.StockBarcode.bulkCreate(refData, { transaction })); + await Promise.all(promises); + } + await service.systems.operationLog.createOperationLog({ + businessType: 'stock', + businessId: createdRecord.id, + operationCode: 'CREATE', + operator: { + id: ctx.user.id, + name: ctx.user.employees_name, + }, + extras: { + warehouseId, + }, + }); + await transaction.commit(); + return await this.getInfo({ id: createdRecord.id }); + } catch (e) { + console.log(e); + if (transaction) { + await transaction.rollback(); + } + throw (new Error(`创建失败,${e.message}`)); + } + + } + + validateSaveParams(data, isEdit = true) { + const requiredFields = [ 'item_code', 'item_name', 'stock_unit', 'gross_weight' ]; + if (!data.id && isEdit) { + throw new Error('缺失必要参数: id'); + } + for (const field of requiredFields) { + if (!data[field]) { + throw new Error(`缺失必要参数: ${field}`); + } + } + + if (data.enable_box_spec && (!data.quantity_per_box || data.quantity_per_box <= 0)) { + throw new Error('启用箱规时,每箱数量必须大于0'); + } + + // 数值类型验证 + const numericFields = [ 'length', 'width', 'height', 'volume', 'gross_weight', 'net_weight' ]; + for (const field of numericFields) { + if (data[field] && isNaN(Number(data[field]))) { + throw new Error(`${field} 必须是有效的数字`); + } + } + } + async stockLog() { + + } + async checkItemCodeUnique(id, item_code, store_id, warehouse_id) { + const { ctx } = this; + const { Op } = this.app.Sequelize || app.Sequelize; + try { + // 检查条码是否被其他仓位使用(排除当前仓位) + let whereId = null; + if (id) { + whereId = { + id: { + [Op.ne]: id, // 排除当前仓位ID + }, + }; + } + const where = { + [Op.and]: [ + whereId, + { item_code }, + { store_id }, + { warehouse_id }, + { deleted_at: null }, // 未删除的记录 + ], + }; + const space = await ctx.model.StockWarehouse.findOne({ + where, + attributes: [ 'id' ], + }); + + // 如果没有找到重复的条码,返回唯一 + if (!space) { + return { isUnique: true }; + } + return { isUnique: false, message: '商品编码已被使用' }; + + } catch (error) { + ctx.logger.error('检查商品编码唯一性失败:', error); + return { isUnique: false, message: '商品编码检测失败' }; + } + } + async handleBatchDelete(data) { + const { ctx } = this; + const { Op } = this.app.Sequelize || app.Sequelize; + const { ids } = data; + + if (!ids || !Array.isArray(ids) || ids.length === 0) { + return { code: 405, message: '请选择要删除的商品' }; + } + + try { + const where = { + [Op.and]: [ + { id: { [Op.in]: ids } }, + { deleted_at: null }, + ], + }; + + // 1. 查询商品资料及其库存情况 + const products = await ctx.model.StockWarehouse.findAll({ + where, + include: [ + { + model: ctx.model.Storage, + as: 'storage', + attributes: [ 'id', 'quantity' ], + required: false, // 使用left join,因为可能没有库存记录 + }, + ], + attributes: [ 'id', 'item_name', 'quantity', 'return_quantity' ], + }); + + console.log('查询到的商品资料:', JSON.stringify(products, null, 2)); + + if (products.length === 0) { + return { code: 200, message: '未找到对应的商品资料或已删除', data: [] }; + } + + // 2. 分析哪些商品可以删除(没有库存或库存为0) + const deletableProducts = []; + const undeletableProducts = []; + + products.forEach(product => { + const productInfo = { + id: product.id, + name: product.item_name, + hasStock: false, + stockQuantity: 0, + }; + + // 检查库存情况 + if (product.storage) { + if (Array.isArray(product.storage)) { + // 如果有多个库存记录 + const totalStock = product.storage.reduce((sum, storage) => { + return sum + (storage.quantity || 0); + }, 0); + + productInfo.stockQuantity = totalStock; + productInfo.hasStock = totalStock > 0; + } else { + // 如果只有一个库存记录 + productInfo.stockQuantity = product.storage.quantity || 0; + productInfo.hasStock = productInfo.stockQuantity > 0; + } + } + if (product.quantity > 0 || product.return_quantity > 0) { + productInfo.hasStock = true; + } + if (productInfo.hasStock) { + undeletableProducts.push(productInfo); + } else { + deletableProducts.push(productInfo); + } + }); + + console.log('可以删除的商品:', deletableProducts); + console.log('不能删除的商品:', undeletableProducts); + + if (deletableProducts.length === 0) { + return { + code: 405, + message: '所有选中的商品都有库存,无法删除', + data: { + undeletableProducts, + message: `以下商品存在库存无法删除:${undeletableProducts.map(p => p.name).join('、')}`, + }, + }; + } + + // 3. 执行删除(软删除) + const deletableIds = deletableProducts.map(p => p.id); + + const result = await ctx.model.transaction(async t => { + // 软删除商品资料 + const [ affectedCount ] = await ctx.model.StockWarehouse.update( + { + deleted_at: new Date(), + updated_at: new Date(), + // 如果需要记录删除人 + // deleted_by: ctx.user.user_id + }, + { + where: { + id: { [Op.in]: deletableIds }, + }, + transaction: t, + // 如果要检查行锁 + // lock: t.LOCK.UPDATE + } + ); + + return { + deletedCount: affectedCount, + deletedIds: deletableIds, + }; + }); + + // 4. 如果需要同时清理关联数据 + if (deletableIds.length > 0) { + // 例如:清理商品分类关联、商品标签关联等 + // await this.cleanRelatedData(deletableIds); + } + + return { + code: 200, + message: `删除成功,共删除 ${result.deletedCount} 个商品资料`, + data: { + deletedCount: result.deletedCount, + deletedProducts: deletableProducts, + undeletableProducts, + failedIds: ids.filter(id => !deletableIds.includes(id)), + summary: { + totalSelected: ids.length, + deleted: deletableProducts.length, + failed: undeletableProducts.length, + }, + }, + }; + + } catch (error) { + console.error('批量删除商品资料失败:', error); + ctx.logger.error('批量删除商品资料失败:', error); + + // 根据错误类型返回不同的提示 + let errorMessage = '删除失败,请稍后重试'; + if (error.name === 'SequelizeForeignKeyConstraintError') { + errorMessage = '删除失败,存在关联数据,请先处理相关数据'; + } else if (error.name === 'SequelizeDatabaseError') { + errorMessage = '数据库操作失败'; + } + + return { + code: 500, + message: errorMessage, + error: process.env.NODE_ENV === 'development' ? { + message: error.message, + stack: error.stack, + } : undefined, + }; + } + } + async deleteUnit(data) { + const { id } = data; + const { ctx, app } = this; + const unitExit = await ctx.model.StockUnit.findOne({ + where: { + id, + warehouse_id: ctx.user.store_id, + }, + }); + if (!unitExit) { + throw new Error('库存单位不存在'); + } + ctx.model.StockUnit.destroy({ + where: { + id, + warehouse_id: ctx.user.store_id, + }, + }); + return { message: '删除成功', code: 200 }; + } + async deleteProhibited(data) { + const { id } = data; + const { ctx, app } = this; + const unitExit = await ctx.model.ProhibitedType.findOne({ + where: { + id, + warehouse_id: ctx.user.store_id, + }, + }); + if (!unitExit) { + throw new Error('违禁品类型不存在'); + } + ctx.model.ProhibitedType.destroy({ + where: { + id, + warehouse_id: ctx.user.store_id, + }, + }); + return { message: '删除成功', code: 200 }; + } + async search(data) { + const { keyword, store_id = null } = data; + const { ctx, app } = this; + const { Op } = app.Sequelize; + const warehouseId = ctx.user.store_id; + + try { + const whereCondition = { + warehouse_id: warehouseId, + deleted_at: null, + }; + + // 如果有传入store_id,则添加store_id条件 + if (store_id) { + whereCondition.store_id = store_id; + } + + // 准备关联查询的条件 + const includeConditions = []; + + // 如果有搜索关键词,创建搜索条件 + if (keyword && keyword.trim()) { + const searchKeyword = `%${keyword.trim()}%`; + + // 先构建主表的搜索条件 + const stockWarehouseConditions = { + [Op.or]: [ + { item_code: { [Op.like]: searchKeyword } }, + { item_name: { [Op.like]: searchKeyword } }, + { goods_code: { [Op.like]: searchKeyword } }, + ], + }; + + // 添加条形码关联查询条件 + includeConditions.push({ + model: app.model.StockBarcode, + as: 'barcodes', + attributes: [ 'barcode' ], + required: false, // 使用LEFT JOIN + where: { + barcode: { [Op.like]: searchKeyword }, + }, + }); + + // 合并搜索条件 + whereCondition[Op.or] = [ + stockWarehouseConditions, + // 如果barcodes表有匹配的记录,则也返回该商品 + { + '$barcodes.barcode$': { [Op.like]: searchKeyword }, + }, + ]; + } else { + // 如果没有关键词,也包含barcodes关联(但不需要where条件) + includeConditions.push({ + model: app.model.StockBarcode, + as: 'barcodes', + attributes: [ 'barcode' ], + required: false, + }); + } + includeConditions.push({ + model: app.model.StoreWarehouse, + as: 'store_stock', + attributes: [ 'store_id', 'store_remask' ], + }); + + // 执行查询 + console.log('查询商品===》'); + const results = await app.model.StockWarehouse.findAll({ + where: whereCondition, + attributes: [ + 'id', 'item_code', 'goods_code', 'item_name', + 'sku_property', 'stock_unit', 'quantity', + 'locked_quantity', 'brand_name', 'item_type', + ], + order: [[ 'create_at', 'DESC' ]], + limit: 50, + include: includeConditions, + subQuery: false, // 避免子查询,提高性能 + }); + + // 格式化返回数据 + const formattedResults = results.map(item => { + const result = item.toJSON(); + + // 提取所有条形码 + result.barcodes = result.barcodes?.map(b => b.barcode) || []; + + return result; + }); + + return { + code: 200, + data: formattedResults, + total: formattedResults.length, + }; + + } catch (error) { + ctx.logger.error('搜索仓库商品失败:', error); + return { + code: 0, + message: '搜索失败,请稍后重试', + }; + } + } +} +module.exports = stockStoreService; diff --git a/app/service/systems/storage/index.js b/app/service/systems/storage/index.js new file mode 100644 index 0000000..3362140 --- /dev/null +++ b/app/service/systems/storage/index.js @@ -0,0 +1,9 @@ +'use strict'; + +const Service = require('egg').Service; +class IndexService extends Service { + async index() { + + } +} +module.exports = IndexService; diff --git a/app/service/systems/storage/receiving.js b/app/service/systems/storage/receiving.js new file mode 100644 index 0000000..15e5149 --- /dev/null +++ b/app/service/systems/storage/receiving.js @@ -0,0 +1,1883 @@ +'use strict'; + +const Service = require('egg').Service; +class ReceivingService extends Service { + async getReceivingList(where, pageParams = {}, sortParams = {}) { + const { + ctx, + app, + config, + } = this; + const { + Sequelize, + } = app; + const { + Op, + } = Sequelize; + console.log(pageParams); + const { + page = 1, + pageSize = 20, + } = pageParams; + + try { + // 设置默认参数 + + + const { + sortField = 'id', + sortOrder = 'DESC', + } = sortParams; + + // 构建基础查询条件 + const queryOptions = { + where: {}, + order: [], + attributes: { + exclude: [ 'deleted_at' ], + }, + }; + const prohibitedQueryOptions = { + where: {}, + }; + // 添加默认条件 + queryOptions.where[Op.and] = [{ + warehouse_id: ctx.user.store_id, + }, + ]; + prohibitedQueryOptions.where[Op.and] = []; + // 检测并处理条码查询条件 + const hasBarcodeCondition = false; + + const barcodeCondition = null; + + // 处理动态查询条件 + if (where && Object.keys(where).length > 0) { + const dynamicConditions = []; + const prohibitedConditions = []; + const barcodedynamicConditions = []; + + for (const fieldKey in where) { + const condition = where[fieldKey]; + + if (this.isEmptyValue(condition.value)) { + continue; + } + + // 检查是否是快捷查询,快捷查询字段 + if (fieldKey === 'quickWhere') { + dynamicConditions.push({ [Op.or]: { + store_name: { + [Sequelize.Op.like]: `%${condition.value}%`, + }, + receiving_number: { + [Sequelize.Op.like]: `%${condition.value}%`, + }, + tracking_number: { + [Sequelize.Op.like]: `%${condition.value}%`, + }, + creator_snapshot: { + [Sequelize.Op.like]: `%${condition.value}%`, + }, + license_plate: { + [Sequelize.Op.like]: `%${condition.value}%`, + }, + } }); + continue; // 暂不添加到动态条件中 + } + // 其他字段的处理 + const sequelizeCondition = this.buildSequelizeCondition(fieldKey, condition, app); + console.log('sequelizeCondition', fieldKey, condition, sequelizeCondition); + if (sequelizeCondition) { + dynamicConditions.push(sequelizeCondition); + } + } + if (dynamicConditions.length > 0) { + queryOptions.where[Op.and].push({ + [Op.and]: dynamicConditions, + }); + } + } + // 处理排序 + const validSortFields = [ + 'id', 'item_code', 'quantity', 'locked_quantity', + 'tag_price', 'retail_price', 'create_at', 'update_at', + ]; + + const actualSortField = validSortFields.includes(sortField) ? sortField : 'create_at'; + const actualSortOrder = sortOrder.toUpperCase() === 'ASC' ? 'ASC' : 'DESC'; + queryOptions.order.push([ actualSortField, actualSortOrder ]); + + // 计算分页偏移量 + const offset = (page - 1) * pageSize; + + // 执行查询:获取总数和数据 + const [ total, data ] = await Promise.all([ + // 获取总数 + ctx.model.Receiving.count({ + where: queryOptions.where, + include: [{ + model: ctx.model.StoreWarehouse, + as: 'store', + attributes: [ 'store_remask' ], + where: { + use_status: 1, + }, + required: false, + }, { + model: ctx.model.AccountStoreEmployee, + as: 'creator', + attributes: [ 'real_name' ], + required: true, + }], + distinct: true, + }), + + // 获取分页数据 + ctx.model.Receiving.findAll({ + ...queryOptions, + include: [{ + model: ctx.model.StoreWarehouse, + as: 'store', + attributes: [ 'store_remask' ], + where: { + use_status: 1, + }, + required: false, + }, { + model: ctx.model.AccountStoreEmployee, + as: 'creator', + attributes: [ 'real_name' ], + required: true, + }], + limit: parseInt(pageSize), + offset: parseInt(offset), + distinct: true, // 确保去重 + raw: true, + }), + ]); + + // 计算分页信息 + const totalPages = Math.ceil(total / pageSize); + const hasPrevious = page > 1; + const hasNext = page < totalPages; + + // 批量查询条码信息 + const stockIds = data.map(item => item.id); + let images = []; + if (stockIds.length > 0) { + images = await ctx.model.FileReference.findAll({ + where: { + business_type: 'receiving', + business_id: { + [Op.in]: stockIds, + }, + }, + include: [{ + model: ctx.model.File, + as: 'file', + attributes: [ 'file_url' ], + required: true, + }], + }); + } + + // 处理数据,添加一些计算字段 + const processedData = data.map(item => { + const availableQuantity = Math.max(0, item.quantity - item.locked_quantity); + const lockRate = item.quantity > 0 ? (item.locked_quantity / item.quantity * 100).toFixed( + 2) : 0; + + const { + cos, + } = config; + const { + cdnurl, + } = cos; + const itemImages = images + .filter(images => parseInt(images.business_id) === item.id) + .map(images => images.file.file_url); + return { + ...item, + images: itemImages, + available_quantity: availableQuantity, + lock_rate: parseFloat(lockRate), + lock_rate_display: `${lockRate}%`, + create_at_display: item.create_at ? this.formatDate(item.create_at) : '', + update_at_display: item.update_at ? this.formatDate(item.update_at) : '', + // 标记是否通过条码查询匹配 + is_barcode_matched: hasBarcodeCondition && matchedStockIds.includes(item.id), + }; + }); + + // 添加汇总信息 + const summary = { + total_quantity: data.reduce((sum, item) => sum + item.quantity, 0), + total_locked: data.reduce((sum, item) => sum + item.locked_quantity, 0), + total_available: data.reduce((sum, item) => sum + Math.max(0, item.quantity - item + .locked_quantity), 0), + total_items: data.length, + // 如果有条码查询,添加匹配统计 + ...(hasBarcodeCondition && { + barcode_matched_count: matchedStockIds.length, + barcode_search_value: where.barcode.value, + }), + }; + + + return { + code: 200, + data: { + list: processedData, + pagination: { + page: parseInt(page), + pageSize: parseInt(pageSize), + total, + totalPages, + hasPrevious, + hasNext, + }, + summary, + queryInfo: { + conditions: where, + sortField: actualSortField, + sortOrder: actualSortOrder, + hasBarcodeSearch: hasBarcodeCondition, + }, + }, + message: '查询成功', + }; + + } catch (error) { + ctx.logger.error('[StockService.getWarehouseStock] 查询失败:', error); + return { + code: 500, + data: { + list: [], + pagination: { + page: parseInt(page || 1), + pageSize: parseInt(pageSize || 20), + total: 0, + totalPages: 0, + hasPrevious: false, + hasNext: false, + }, + summary: { + total_quantity: 0, + total_locked: 0, + total_available: 0, + total_items: 0, + }, + }, + message: `查询失败: ${error.message}`, + }; + } + } + isEmptyValue(value) { + if (value === undefined || value === null) { + return true; + } + + if (typeof value === 'string' && value.trim() === '') { + return true; + } + + if (Array.isArray(value) && value.length === 0) { + return true; + } + + return false; + } + /** + * 构建Sequelize查询条件 + * @param {string} fieldKey - 字段键名 + * @param {Object} condition - 条件对象 + * @param {Object} app - Egg应用实例 + * @return {Object|null} Sequelize条件对象 + */ + buildSequelizeCondition(fieldKey, condition, app) { + const { + Sequelize, + } = app; + const { + operator = 'eq', value, type, isMultiple, + } = condition; + + // 处理字段名 + const fieldName = condition.field || fieldKey; + + // 特殊值处理 + const processedValue = this.processConditionValue(value, type); + // 根据操作符构建条件 + switch (operator.toLowerCase()) { + case 'eq': + return { + [fieldName]: processedValue, + }; + + case 'ne': + return { + [fieldName]: { + [Sequelize.Op.ne]: processedValue, + }, + }; + + case 'contains': + case 'like': + // 处理多值情况 + if (Array.isArray(processedValue) && processedValue.length > 0) { + // 多个值使用 OR 连接 + return { + [Sequelize.Op.or]: processedValue.map(val => ({ + [fieldName]: { + [Sequelize.Op.like]: `%${val}%`, + }, + })), + }; + } + // 单个值正常处理 + return { + [fieldName]: { + [Sequelize.Op.like]: `%${processedValue}%`, + }, + }; + + case 'startswith': + // 处理多值情况 + if (Array.isArray(processedValue) && processedValue.length > 0) { + return { + [Sequelize.Op.or]: processedValue.map(val => ({ + [fieldName]: { + [Sequelize.Op.like]: `${val}%`, + }, + })), + }; + } + return { + [fieldName]: { + [Sequelize.Op.like]: `${processedValue}%`, + }, + }; + + case 'endswith': + // 处理多值情况 + if (Array.isArray(processedValue) && processedValue.length > 0) { + return { + [Sequelize.Op.or]: processedValue.map(val => ({ + [fieldName]: { + [Sequelize.Op.like]: `%${val}`, + }, + })), + }; + } + return { + [fieldName]: { + [Sequelize.Op.like]: `%${processedValue}`, + }, + }; + + case 'gt': + return { + [fieldName]: { + [Sequelize.Op.gt]: processedValue, + }, + }; + + case 'lt': + return { + [fieldName]: { + [Sequelize.Op.lt]: processedValue, + }, + }; + + case 'ge': + return { + [fieldName]: { + [Sequelize.Op.gte]: processedValue, + }, + }; + + case 'le': + return { + [fieldName]: { + [Sequelize.Op.lte]: processedValue, + }, + }; + + case 'in': + return Array.isArray(processedValue) ? { + [fieldName]: { + [Sequelize.Op.in]: processedValue, + }, + } : + null; + + case 'notin': + return Array.isArray(processedValue) ? { + [fieldName]: { + [Sequelize.Op.notIn]: processedValue, + }, + } : + null; + + case 'between': + return Array.isArray(processedValue) && processedValue.length === 2 ? { + [fieldName]: { + [Sequelize.Op.between]: processedValue, + }, + } : + null; + + case 'notbetween': + return Array.isArray(processedValue) && processedValue.length === 2 ? { + [fieldName]: { + [Sequelize.Op.notBetween]: processedValue, + }, + } : + null; + + case 'isnull': + return { + [fieldName]: { + [Sequelize.Op.is]: null, + }, + }; + + case 'isnotnull': + return { + [fieldName]: { + [Sequelize.Op.not]: null, + }, + }; + + case 'regexp': + return { + [fieldName]: { + [Sequelize.Op.regexp]: processedValue, + }, + }; + + case 'notregexp': + return { + [fieldName]: { + [Sequelize.Op.notRegexp]: processedValue, + }, + }; + + default: + // 默认使用等于操作符 + return { + [fieldName]: processedValue, + }; + } + } + /** + * 处理条件值 + * @param {any} value - 原始值 + * @param {string} type - 字段类型 + * @return {any} 处理后的值 + */ + processConditionValue(value, type) { + const { service } = this; + if (value === undefined || value === null) { + return value; + } + + switch (type) { + case 'boolean': + // 处理布尔值:true/Y -> 'Y', false/N -> 'N' + if (value === true || value === 'true' || value === 'Y' || value === 'y') { + return 'Y'; + } + if (value === false || value === 'false' || value === 'N' || value === 'n') { + return 'N'; + } + return value; + + case 'date': + // 单个日期,根据业务需求决定是开始还是结束时间 + // 通常是开始时间(00:00:00) + return service.main.normalizeDate(value, false); + + case 'daterange': + // 处理日期范围:数组的第一个元素是开始时间,第二个元素是结束时间 + if (Array.isArray(value) && value.length === 2) { + const [ startDate, endDate ] = value; + console.log(startDate, endDate); + console.log(startDate ? service.main.normalizeDate(startDate, false) : null, endDate ? service.main.normalizeDate(endDate, true) : null); + return [ + startDate ? service.main.normalizeDate(startDate, false) : null, // 开始时间设为00:00:00 + endDate ? service.main.normalizeDate(endDate, true) : null, // 结束时间设为23:59:59 + ]; + } + return value; + + case 'number': + // 转换为数字 + const num = parseFloat(value); + return isNaN(num) ? value : num; + + case 'text': + // 文本类型,支持逗号分隔 + if (typeof value === 'string') { + return value.split(',').map(item => item.trim()); + } + return value; + + default: + return value; + } + } + async create(data) { + const { + delivery_method, + license_plate, + loading_method, + remark, + status, + store_id, + total_boxes, + total_pallets, + tracking_number, + video_device_id, + } = data; + + const { ctx } = this; + const { app } = ctx; + + try { + // 1. 获取当前用户信息 + const warehouse_id = ctx.user.store_id; + const creator_id = ctx.user.employees_id; + const creator_snapshot = { + name: ctx.user.employees_name, + employees_id: ctx.user.employees_id, + id: creator_id, + }; + + // 2. 生成收货单号 (格式: R + 时间戳的day + 3位序列号,如: RR20231215001) + const now = new Date(); + console.log('当前时间:', now); + const dateStr = Math.floor(now.getTime() / (1000 * 60 * 60 * 24)); // 时间戳到今日的天数 + const prefix = `R${dateStr}`; + + // 查找当天最大的收货单号 + const maxReceiving = await app.model.Receiving.findOne({ + where: { + receiving_number: { + [app.Sequelize.Op.like]: `${prefix}%`, + }, + warehouse_id + }, + order: [[ 'receiving_number', 'DESC' ]], + }); + + let sequence = 1; + if (maxReceiving) { + // 提取最大收货单号的序号部分 + const lastNumStr = maxReceiving.receiving_number.replace(prefix, ''); + const lastNum = parseInt(lastNumStr); + sequence = lastNum + 1; + } + + // 序号动态长度:<1000用3位,<10000用4位,>=10000用5位 + let seqLen = 3; + if (sequence >= 1000 && sequence < 10000) seqLen = 4; + if (sequence >= 10000) seqLen = 5; + const receiving_number = `${prefix}${sequence.toString().padStart(seqLen, '0')}`; + // 3. 获取店铺名称(如果有货主) + let store_name = null; + if (store_id) { + const store = await app.model.StoreWarehouse.findOne({ + where: { store_id }, + }); + if (store) { + store_name = store.store_name; + } + } + + // 4. 创建收货单记录 + const receivingData = { + receiving_number, + creator_id, + creator_snapshot: JSON.stringify(creator_snapshot), + status: status || 'receiving', + detail_status: 'unmatched', + storage_status: 'none', + delivery_method, + license_plate: delivery_method === 'truck' ? license_plate : null, + tracking_number: delivery_method !== 'truck' && delivery_method !== 'other' ? tracking_number : null, + loading_method, + video_device_id: video_device_id || null, + total_boxes: parseInt(total_boxes) || 0, + total_pallets: parseInt(total_pallets) || 0, + total_items: 0, + total_quantity: 0, + warehouse_id, + remark: remark || null, + store_name, + store_id: store_id || null, + receiving_start_time: new Date(), + is_deleted: false, + }; + + // 5. 保存到数据库 + const result = await app.model.Receiving.create(receivingData); + + return { + code: 200, + id: result.id, + receiving_number: result.receiving_number, + message: '收货任务创建成功', + }; + + } catch (error) { + ctx.logger.error('创建收货任务失败:', error); + return { + code: 0, + message: `创建失败: ${error.message}`, + }; + } + } + async get(data) { + const { id } = data; + const { ctx, app } = this; + const { Op } = app.Sequelize; + + // 获取用户仓库ID,增加错误处理 + const warehouseId = ctx.user?.store_id; + const creator_id = ctx.user.employees_id; + if (!warehouseId) { + return { code: 0, message: '用户未绑定仓库', data: {} }; + } + + try { + // 1. 查询收货单主表 + const receiving = await app.model.Receiving.findOne({ + where: { + id, + warehouse_id: warehouseId, + }, + include: [{ + model: ctx.model.StoreWarehouse, + as: 'store', + attributes: [ 'store_remask' ], + where: { + use_status: 1, + }, + required: false, + }, { + model: ctx.model.AccountStoreEmployee, + as: 'creator', + attributes: [ 'real_name' ], + required: false, + }], + // 不需要order,因为根据id查询已经是唯一的 + }); + + if (!receiving) { + return { code: 0, message: '无记录或无权访问', data: {} }; + } + console.log('查询收货单明细'); + // 2. 查询收货单明细 + const receivingItems = await app.model.ReceivingDetail.findAll({ + where: { + receiving_id: id, + }, + include: [ + { + model: ctx.model.LocationSpace, + as: 'receiving_space', + attributes: [ 'space_code', 'custom_barcode', 'custom_name' ], + }, + ], + order: [[ 'id', 'DESC' ]], // 保持倒序,最新在前 + }); + + // 3. 获取明细ID数组 + const receivingItemsIds = receivingItems.map(item => item.id); + + // 4. 查询明细图片(如果明细数量大于0) + const itemImagesMap = {}; // 用于存储每个明细的图片 + if (receivingItemsIds.length > 0) { + const receivingItemsImages = await ctx.model.FileReference.findAll({ + where: { + business_type: 'receivingItem', + business_id: { + [Op.in]: receivingItemsIds, + }, + }, + include: [{ + model: ctx.model.File, + as: 'file', + attributes: [ 'file_url' ], + required: true, + }], + }); + + // 将图片按 business_id 分组 + receivingItemsImages.forEach(itemImage => { + const businessId = itemImage.business_id; + if (!itemImagesMap[businessId]) { + itemImagesMap[businessId] = []; + } + itemImagesMap[businessId].push({ + url: itemImage.file.file_url, + id: itemImage.file_id, + }); + }); + } + + // 5. 将图片合并到对应的明细中 + const items = receivingItems.map(item => { + const itemData = item.toJSON(); + itemData.images = itemImagesMap[item.id] || []; // 获取该明细的图片,如果没有则为空数组 + return itemData; + }); + + // 6. 查询主表的图片 + const receivingImages = await ctx.model.FileReference.findAll({ + where: { + business_type: 'receiving', + business_id: id, + }, + include: [{ + model: ctx.model.File, + as: 'file', + attributes: [ 'file_url' ], + required: true, + }], + }); + + // 7. 组装返回数据 + const result = { + ...receiving.toJSON(), // 使用toJSON()确保获得纯对象 + details: items, // 包含图片的明细数据 + images: receivingImages.map(item => ({ + url: item.file.file_url, + id: item.file_id, + })), + }; + + return { code: 200, message: '成功', data: result }; + + } catch (error) { + console.error('获取收货单详情失败:', error); + return { code: 500, message: '服务器错误', data: {} }; + } + } + async addDetail(data) { + const ctx = this.ctx; + const { receiving_id } = data; + + // 获取当前用户信息 + const creator_id = ctx.user.employees_id; + const warehouse_id = ctx.user.store_id; + // 验证收货单是否存在 + const receiving = await ctx.model.Receiving.findOne({ + where: { id: receiving_id, warehouse_id }, + }); + + if (!receiving) { + return { + code: 404, + message: '收货单不存在', + }; + } + + // 验证收货单状态是否允许添加明细 + if (receiving.status !== 'receiving') { + return { + code: 400, + message: '收货单状态不允许添加明细', + }; + } + + try { + // 创建默认的收货明细 + const newDetail = await ctx.model.ReceivingDetail.create({ + receiving_id, + product_name: '新商品', + barcode: '', + actual_quantity: 0, + box_quantity: 0, + boxes_per_pallet: 0, + pallet_quantity: 0, + receiving_status: 'pending', + storage_status: 'none', + stored_quantity: 0, + batch_number: '', + production_date: null, + expiry_date: null, + remark: '', + space_id: 1, + creator_id, + }); + + + // 获取更新后的明细列表 + const allDetails = await ctx.model.ReceivingDetail.findAll({ + where: { receiving_id }, + order: [[ 'id', 'DESC' ]], + }); + + // 格式化返回数据 + const formattedDetails = allDetails.map(detail => { + const detailData = detail.toJSON(); + + // 处理product_snapshot + if (detailData.product_snapshot) { + try { + detailData.product_snapshot = JSON.parse(detailData.product_snapshot); + } catch (e) { + detailData.product_snapshot = null; + } + } + + // 如果有关联的系统商品,可以合并信息 + if (detailData.system_product) { + detailData.system_product_info = detailData.system_product; + } + + return detailData; + }); + + await this.updateReceivingStats(receiving_id); + return { + code: 200, + message: '添加成功', + data: { + details: formattedDetails, + selectId: newDetail.id, + }, + }; + + } catch (error) { + ctx.logger.error('添加收货明细失败:', error); + return { + code: 500, + message: `添加失败: ${error.message}`, + }; + } + } + + async updateDetail(data) { + const ctx = this.ctx; + const { id, ...updateData } = data; + + // 验证明细是否存在 + const detail = await ctx.model.ReceivingDetail.findOne({ + where: { id }, + include: [ + { + model: ctx.model.Receiving, + as: 'receiving', + attributes: [ 'id', 'status' ], + }, + ], + }); + + if (!detail) { + return { + code: 404, + message: '明细不存在', + }; + } + + // 验证关联的收货单状态是否允许修改 + if (detail.receiving && detail.receiving.status !== 'receiving') { + return { + code: 400, + message: '收货单状态不允许修改明细', + }; + } + + // 验证必填字段 + if (updateData.product_name && !updateData.product_name.trim()) { + return { + code: 400, + message: '商品名称不能为空', + }; + } + + if (updateData.actual_quantity !== undefined && updateData.actual_quantity <= 0) { + return { + code: 400, + message: '实际数量必须大于0', + }; + } + + try { + // 如果需要处理商品匹配 + if (updateData.barcode && updateData.barcode.trim()) { + // 尝试根据条码匹配系统商品 + const systemProduct = await ctx.model.StockWarehouse.findOne({ + where: { barcode: updateData.barcode }, + }); + + if (systemProduct) { + updateData.system_product_id = systemProduct.id; + + // 创建商品快照 + updateData.product_snapshot = JSON.stringify({ + name: systemProduct.name, + barcode: systemProduct.barcode, + spec: systemProduct.spec, + unit: systemProduct.unit, + images: systemProduct.images ? JSON.parse(systemProduct.images) : [], + }); + + // 如果用户没有输入商品名称,使用系统商品名称 + if (!updateData.product_name) { + updateData.product_name = systemProduct.name; + } + } + } + + // 处理数量类型的转换 + if (updateData.actual_quantity !== undefined) { + updateData.actual_quantity = parseInt(updateData.actual_quantity) || 0; + } + + if (updateData.box_quantity !== undefined) { + updateData.box_quantity = parseInt(updateData.box_quantity) || 0; + } + + if (updateData.boxes_per_pallet !== undefined) { + updateData.boxes_per_pallet = parseInt(updateData.boxes_per_pallet) || 1; + } + + if (updateData.pallet_quantity !== undefined) { + updateData.pallet_quantity = parseInt(updateData.pallet_quantity) || 0; + } + + if (updateData.stored_quantity !== undefined) { + updateData.stored_quantity = parseInt(updateData.stored_quantity) || 0; + + // 根据入库数量更新入库状态 + if (updateData.stored_quantity >= updateData.actual_quantity) { + updateData.storage_status = 'all'; + } else if (updateData.stored_quantity > 0) { + updateData.storage_status = 'partial'; + } else { + updateData.storage_status = 'none'; + } + } + + // 更新明细 + const [ affectedRows ] = await ctx.model.ReceivingDetail.update(updateData, { + where: { id }, + }); + + if (affectedRows === 0) { + return { + code: 400, + message: '更新失败', + }; + } + + // 更新收货单统计信息 + if (detail.receiving_id) { + await this.updateReceivingStats(detail.receiving_id); + } + + // 获取更新后的明细 + const updatedDetail = await ctx.model.ReceivingDetail.findOne({ + where: { id }, + include: [ + { + model: ctx.model.StockWarehouse, + as: 'system_product', + attributes: [ 'id', 'name', 'barcode', 'spec', 'unit', 'images' ], + }, + ], + }); + + // 格式化返回数据 + const detailData = updatedDetail.toJSON(); + + if (detailData.product_snapshot) { + try { + detailData.product_snapshot = JSON.parse(detailData.product_snapshot); + } catch (e) { + detailData.product_snapshot = null; + } + } + + if (detailData.system_product && detailData.system_product.images) { + try { + detailData.system_product.images = JSON.parse(detailData.system_product.images); + } catch (e) { + detailData.system_product.images = []; + } + } + + return { + code: 200, + message: '更新成功', + data: detailData, + }; + + } catch (error) { + ctx.logger.error('更新收货明细失败:', error); + return { + code: 500, + message: `更新失败: ${error.message}`, + }; + } + } + async getStockStoreInfo(stock_id) { + const ctx = this.ctx; + + try { + // 方法1:通过 StockWarehouse 直接关联 StoreWarehouse + const stockWarehouse = await ctx.model.StockWarehouse.findOne({ + where: { id: stock_id }, + include: [ + { + model: ctx.model.StoreWarehouse, + as: 'store_stock', + attributes: [ 'store_id', 'store_remask' ], + }, + ], + }); + + if (!stockWarehouse || !stockWarehouse.store_stock) { + return null; + } + + // 直接返回 store_stock 的信息 + return { + store_id: stockWarehouse.store_stock.store_id, + store_remask: stockWarehouse.store_stock.store_remask, + }; + + } catch (error) { + ctx.logger.error(`获取库存 ${stock_id} 的店铺信息失败:`, error); + // 根据需求决定是否抛出错误 + // throw error; + return null; + } + } + // 更新收货单统计信息的辅助方法 + async updateReceivingStats(receivingId) { + const { ctx, app } = this; + const { Op } = app.Sequelize; + const transaction = await ctx.model.transaction(); + const warehouseId = ctx.user.store_id; + + try { + // 1. 先查询收货单,并加锁 + const receiving = await ctx.model.Receiving.findOne({ + where: { + warehouse_id: warehouseId, + id: receivingId, + status: 'receiving', + }, + lock: transaction.LOCK.UPDATE, + transaction, + }); + + if (!receiving) { + await transaction.rollback(); + return; + } + + // 2. 检查收货单是否已有 store_id(优先使用已有值) + let storeId = receiving.store_id; + let storeName = receiving.store_name; + + // 如果收货单没有 store_id,尝试从已匹配的商品详情中获取 + if (!storeId) { + // 查找第一个已匹配的商品详情(system_product_id 不为空) + const matchedDetail = await app.model.ReceivingDetail.findOne({ + where: { + receiving_id: receivingId, + system_product_id: { + [Op.ne]: null, + }, + }, + transaction, + }); + console.log('matchedDetail第一个有绑定的商品', matchedDetail); + if (matchedDetail && matchedDetail.system_product_id) { + try { + // 调用 getStockStoreInfo 获取库存信息 + const storeInfo = await this.getStockStoreInfo(matchedDetail.system_product_id); + + if (storeInfo && storeInfo.store_id) { + storeId = storeInfo.store_id; + // 注意:这里使用 store_remask 作为 store_name + storeName = storeInfo.store_remask; // 或者 storeInfo.store_remask + } + } catch (error) { + ctx.logger.warn(`获取商品 ${matchedDetail.system_product_id} 的库存信息失败:`, error); + // 继续执行,使用默认值 + } + } + } + + // 3. 统计该收货单的所有明细 + const stats = await ctx.model.ReceivingDetail.findAll({ + where: { receiving_id: receivingId }, + attributes: [ + [ ctx.model.fn('COUNT', ctx.model.col('id')), 'total_items' ], + [ ctx.model.fn('SUM', ctx.model.col('actual_quantity')), 'total_quantity' ], + ], + raw: true, + transaction, + }); + + const stat = stats[0] || {}; + + // 4. 判断收货单的整体状态 + const allDetails = await ctx.model.ReceivingDetail.findAll({ + where: { receiving_id: receivingId }, + transaction, + }); + + let detailStatus = 'unmatched'; + + if (allDetails.length > 0) { + const completedCount = allDetails.filter(d => !!d.system_product_id).length; + if (completedCount === allDetails.length) { + detailStatus = 'all_matched'; + } else if (completedCount > 0) { + detailStatus = 'partial_matched'; + } + } + + // 5. 更新收货单 + const updateData = { + total_items: parseInt(stat.total_items) || 0, + total_quantity: parseFloat(stat.total_quantity) || 0, + detail_status: detailStatus, + updated_at: new Date(), + }; + + // 只在有值且收货单当前没有这些值时更新 store 信息 + if (storeId && !receiving.store_id) { + updateData.store_id = storeId; + updateData.store_name = storeName; + } else if (storeId && storeName && receiving.store_name !== storeName) { + // 如果 store_id 已有但 store_name 不同,也更新名称 + updateData.store_name = storeName; + } + + await ctx.model.Receiving.update(updateData, { + where: { + id: receivingId, + warehouse_id: warehouseId, + }, + transaction, + }); + + // 6. 提交事务 + await transaction.commit(); + + ctx.logger.info(`成功更新收货单 ${receivingId} 的统计信息`); + + } catch (error) { + // 7. 发生错误时回滚事务 + if (transaction) { + await transaction.rollback(); + } + console.log(error); + ctx.logger.error('更新收货单统计失败:', error); + throw error; + } + } + + async deleteDetail(data) { + const ctx = this.ctx; + const { detail_id } = data; + const creator_id = ctx.user.employees_id; + const warehouse_id = ctx.user.store_id; + // 验证明细是否存在 + const detail = await ctx.model.ReceivingDetail.findOne({ + where: { id: detail_id, creator_id }, + include: [ + { + model: ctx.model.Receiving, + as: 'receiving', + attributes: [ 'id', 'status' ], + where: { + warehouse_id, + }, + required: true, + }, + ], + }); + + if (!detail) { + return { + code: 404, + message: '明细不存在', + }; + } + + // 验证关联的收货单状态是否允许删除 + if (detail.receiving && detail.receiving.status !== 'receiving') { + return { + code: 400, + message: '收货单状态不允许删除明细', + }; + } + + // 检查是否已入库(已入库的明细不能删除) + if (detail.storage_status !== 'none' && detail.stored_quantity > 0) { + return { + code: 400, + message: '该明细已入库,不能删除', + }; + } + + try { + // 获取receiving_id用于后续更新统计 + const receiving_id = detail.receiving_id; + + // 删除明细 + const deletedCount = await ctx.model.ReceivingDetail.destroy({ + where: { id: detail_id }, + }); + + if (deletedCount === 0) { + return { + code: 400, + message: '删除失败', + }; + } + + // 获取删除后的所有明细 + const remainingDetails = await ctx.model.ReceivingDetail.findAll({ + where: { receiving_id }, + order: [[ 'id', 'DESC' ]], + }); + + // 格式化返回数据 + const formattedDetails = remainingDetails.map(detail => { + const detailData = detail.toJSON(); + + if (detailData.product_snapshot) { + try { + detailData.product_snapshot = JSON.parse(detailData.product_snapshot); + } catch (e) { + detailData.product_snapshot = null; + } + } + + return detailData; + }); + + // 返回下一个选中的明细ID(如果有剩余明细) + let selectId = null; + if (remainingDetails.length > 0) { + // 默认选中第一个 + selectId = remainingDetails[0].id; + } + await this.updateReceivingStats(receiving_id); + return { + code: 200, + message: '删除成功', + data: { + details: formattedDetails, + selectId, + }, + }; + + } catch (error) { + ctx.logger.error('删除收货明细失败:', error); + return { + code: 500, + message: `删除失败: ${error.message}`, + }; + } + } + async detailChange(data) { + const { ctx, app } = this; + const warehouseId = ctx.user.store_id; + + try { + // 1. 提取前端输入字段 + const { + id, // 收货明细ID + receiving_id, // 收货单ID + actual_quantity, // 实际收货数量 + batch_number, // 批次号 + production_date, // 生产日期 + expiry_date, // 到期日期 + box_quantity, // 箱数 + boxes_per_pallet, // 每托盘箱数 + pallet_quantity, // 托盘数 + space_id, // 存放库位ID + remark, // 备注 + system_product_id, // 系统商品ID + barcode, // 条码 + product_name, // 商品名称 + box_width, + box_height, + box_length, + weight, + } = data; + console.log('barcode', barcode); + // 2. 验证必填字段 + if (!id) { + return { + code: 400, + message: '收货明细ID不能为空', + }; + } + + if (!receiving_id) { + return { + code: 400, + message: '收货单ID不能为空', + }; + } + + + // 3. 获取收货明细信息 + const receivingDetail = await app.model.ReceivingDetail.findOne({ + where: { id }, + include: [ + { + model: app.model.Receiving, + as: 'receiving', + attributes: [ 'id', 'warehouse_id', 'store_id', 'store_name' ], + where: { + warehouse_id: warehouseId, + id: receiving_id, + status: 'receiving', + }, + required: true, + }, + ], + }); + + if (!receivingDetail) { + return { + code: 404, + message: '收货明细不存在', + }; + } + + + // 5. 验证箱规数据 + if (box_quantity !== undefined && box_quantity < 0) { + return { + code: 400, + message: '箱数不能为负数', + }; + } + + if (pallet_quantity !== undefined && pallet_quantity < 0) { + return { + code: 400, + message: '托盘数不能为负数', + }; + } + + // 6. 准备更新数据 + const updateData = { + actual_quantity, + remark: remark || '', + }; + + // 箱规相关字段 + if (box_quantity !== undefined) updateData.box_quantity = box_quantity || 0; + if (boxes_per_pallet !== undefined) updateData.boxes_per_pallet = boxes_per_pallet || 0; + if (pallet_quantity !== undefined) updateData.pallet_quantity = pallet_quantity || 0; + if (barcode !== undefined) updateData.barcode = barcode || ''; + + if (box_length !== undefined) updateData.box_length = box_length || 0; + if (box_width !== undefined) updateData.box_width = box_width || 0; + if (box_height !== undefined) updateData.box_height = box_height || 0; + if (weight !== undefined) updateData.weight = weight || 0; + + // 批次信息 + if (batch_number !== undefined) updateData.batch_number = batch_number; + if (production_date !== undefined) updateData.production_date = production_date; + if (expiry_date !== undefined) updateData.expiry_date = expiry_date; + + // 库位信息 + if (space_id !== undefined) updateData.space_id = space_id; + + // 7. 如果携带了系统商品ID,则更新商品相关信息 + if (system_product_id) { + // 获取系统商品信息 + const stockWarehouse = await app.model.StockWarehouse.findOne({ + where: { + id: system_product_id, + warehouse_id: warehouseId, + }, + include: [ + { + model: app.model.StoreWarehouse, + as: 'store_stock', + attributes: [ 'store_id', 'store_remask' ], + }, + { + model: app.model.StockBarcode, + as: 'barcodes', + attributes: [ 'barcode' ], + required: false, + }, + ], + }); + + if (stockWarehouse) { + // 更新商品相关信息 + updateData.system_product_id = system_product_id; + console.log('商品信息', stockWarehouse); + // 使用系统商品的条码(如果前端没有提供) + const barcodes = stockWarehouse.barcodes?.map(b => b.barcode) || []; + updateData.barcode = updateData.barcode || barcodes.join(';'); + updateData.weight = updateData.weight || stockWarehouse.gross_weight; + if (stockWarehouse.enable_box_spec) { + updateData.boxes_per_pallet = updateData.boxes_per_pallet || stockWarehouse.quantity_per_box; + updateData.box_height = updateData.box_height || stockWarehouse.box_height; + updateData.box_width = updateData.box_width || stockWarehouse.box_width; + updateData.box_length = updateData.box_length || stockWarehouse.box_length; + } + // 使用系统商品的名称(如果前端没有提供) + updateData.product_name = stockWarehouse.item_name || product_name; + + // 如果有货主信息,更新到产品快照中 + if (stockWarehouse.store_stock) { + const productSnapshot = { + ...(receivingDetail.product_snapshot ? JSON.parse(receivingDetail.product_snapshot) : {}), + store_id: stockWarehouse.store_stock.store_id, + store_name: stockWarehouse.store_stock.store_remask, + updated_at: new Date(), + }; + updateData.product_snapshot = JSON.stringify(productSnapshot); + } + } + } else if (barcode !== undefined || product_name !== undefined) { + // 如果没有系统商品ID,但有条码或商品名称,也更新 + if (barcode !== undefined) updateData.barcode = barcode; + if (product_name !== undefined) updateData.product_name = product_name; + updateData.system_product_id = null; + } + if (space_id) { + const sapce = await app.model.LocationSpace.findOne({ + where: { + id: space_id, + [app.Sequelize.Op.or]: [ + { warehouse_id: warehouseId }, + { warehouse_id: null }, + ], + }, + }); + if (sapce) { + updateData.space_id = space_id; + } + } + console.log('更新收货明细', updateData); + // 8. 更新收货明细 + await ctx.model.ReceivingDetail.update(updateData, { + where: { id }, + }); + console.log('更新收货明细2'); + await this.updateReceivingStats(receiving_id); + // 9. 返回成功响应 + return { + code: 200, + data: { + id: receivingDetail.id, + receiving_id: receivingDetail.receiving_id, + actual_quantity: receivingDetail.actual_quantity, + product_name: receivingDetail.product_name, + barcode: receivingDetail.barcode, + system_product_id: receivingDetail.system_product_id, + updated_at: receivingDetail.updated_at, + }, + message: '修改成功', + }; + + } catch (error) { + ctx.logger.error('修改失败:', error); + return { + code: 500, + message: '修改失败,请稍后重试', + error: process.env.NODE_ENV === 'development' ? error.message : undefined, + }; + } + } + async invalid(data) { + const { ctx, app } = this; + const warehouseId = ctx.user.store_id; + const { Op } = app.Sequelize; + const { id: receivingId, invalid_reason } = data; + + const transaction = await ctx.model.transaction(); + + try { + // 1. 查询收货单并加锁 + const receiving = await ctx.model.Receiving.findOne({ + where: { + id: receivingId, + warehouse_id: warehouseId, + is_deleted: false, + }, + lock: transaction.LOCK.UPDATE, + transaction, + include: [{ + model: ctx.model.ReceivingDetail, + as: 'details', + required: false, + }], + }); + + if (!receiving) { + await transaction.rollback(); + ctx.throw(404, '收货单不存在或已被删除'); + } + + // 2. 检查状态是否允许作废 + if (receiving.status === 'cancelled') { + return { + code: 200, + success: true, + message: '收货单已作废,无需重复操作', + }; + } + + if (receiving.status === 'completed' && receiving.storage_status === 'all') { + await transaction.rollback(); + ctx.throw(400, '已全部入库完成,无法作废'); + } + + // 3. 获取操作人信息 + const operator = ctx.user; + + // 4. 更新收货单状态为作废 + await ctx.model.Receiving.update({ + status: 'cancelled', + remark: invalid_reason ? `已作废: ${invalid_reason}` : (receiving.remark || '') + ' - 已作废', + updated_at: new Date(), + }, { + where: { id: receivingId }, + transaction, + }); + + // 5. 处理已匹配的商品明细 + if (receiving.details && receiving.details.length > 0) { + const matchedDetails = receiving.details.filter(detail => detail.system_product_id); + + if (matchedDetails.length > 0) { + // 解除已匹配的商品关联 + await ctx.model.ReceivingDetail.update({ + system_product_id: null, + matched_at: null, + matched_by: null, + updated_at: new Date(), + }, { + where: { + receiving_id: receivingId, + system_product_id: { [Op.ne]: null }, + }, + transaction, + }); + + // 可以在这里处理库存的释放逻辑(如果需要) + // await this.releaseLockedStock(receivingId, transaction); + } + } + + // 6. 处理关联的入库记录(如果有部分入库的情况) + if (receiving.storage_status === 'partial') { + // 将关联的入库记录状态也更新为作废 + await ctx.model.Storage.update({ + status: 'cancelled', + remark: `关联收货单${receiving.receiving_number}已作废`, + updated_at: new Date(), + }, { + where: { + receiving_id: receivingId, + status: { [Op.ne]: 'cancelled' }, + }, + transaction, + }); + } + + // 8. 提交事务 + await transaction.commit(); + + + return { + code: 200, + success: true, + message: '作废成功', + data: { + receiving_id: receivingId, + receiving_number: receiving.receiving_number, + previous_status: receiving.status, + invalidated_at: new Date(), + invalidated_by: operator.name, + invalid_reason, + }, + }; + + } catch (error) { + console.log(error); + // 10. 回滚事务 + if (transaction) { + await transaction.rollback(); + } + + ctx.logger.error(`作废收货单失败: ${error.message}`, { + receivingId, + warehouseId, + userId: ctx.user.id, + error: error.stack, + }); + + // 重新抛出错误,让上层处理 + throw error; + } + } + async completeReceiving(data) { + const { ctx, app } = this; + const warehouseId = ctx.user.store_id; + const { id, remark } = data; + const { Op } = app.Sequelize; + const transaction = await ctx.model.transaction(); + + try { + // 1. 查询收货单并加锁 + const receiving = await ctx.model.Receiving.findOne({ + where: { + id, + warehouse_id: warehouseId, + is_deleted: false, + }, + lock: transaction.LOCK.UPDATE, + transaction, + include: [{ + model: ctx.model.ReceivingDetail, + as: 'details', + required: false, + attributes: [ 'id', 'system_product_id', 'product_name', 'barcode', 'actual_quantity', 'weight' ], + }], + }); + + if (!receiving) { + await transaction.rollback(); + return { + code: 404, + message: '收货单不存在或已被删除', + }; + } + + // 2. 状态检查 + if (receiving.status === 'completed') { + return { + code: 200, + message: '收货单已完成', + }; + } + + if (receiving.status === 'cancelled') { + await transaction.rollback(); + return { + code: 400, + message: '已作废的收货单不可完成', + }; + } + + // 3. 检查是否有明细 + if (!receiving.details || receiving.details.length === 0) { + await transaction.rollback(); + return { + code: 400, + message: '收货单没有明细,请先添加商品', + }; + } + + // 4. 校验所有明细的完成条件 + const invalidDetails = []; + const unmatchedDetails = receiving.details.filter(d => !d.system_product_id); + + // 只有存在未绑定系统商品的明细时,才需要查询照片 + + const detailsIds = receiving.details.map(item => item.id); + const images = await ctx.model.FileReference.findAll({ + where: { + business_type: 'receivingItem', + business_id: { + [Op.in]: detailsIds, + }, + }, + transaction, + }); + + // 按照业务ID分组照片 + const imageMap = new Map(); + images.forEach(image => { + const businessId = String(image.business_id).trim(); + if (!imageMap.has(businessId)) { + imageMap.set(businessId, []); + } + imageMap.get(businessId).push(image); + }); + + console.log('imageMap', imageMap); + + // 检查未绑定系统商品的明细 + for (const detail of receiving.details) { + // 先检查是否有对应的图片数组 + const businessId = String(detail.id).trim(); + const imageArray = imageMap.get(businessId); + + // 这里的关键修复:不仅要检查数组是否存在且有长度,还要检查数组中的元素是否有实际的数据 + const hasPhoto = imageArray && + imageArray.length > 0 && + imageArray.some(img => { + // 检查图片对象是否有实际的数据 + return img.dataValues || + img.file_path || + img.url || + (img._options && Object.keys(img._options).length > 0); + }); + const hasBarcode = !!detail.barcode && detail.barcode.trim() !== ''; + const hasWeight = detail.weight > 0; + const hasCount = detail.actual_quantity > 0; + console.log('detailInfo', hasBarcode, hasWeight, hasCount); + + if (!hasPhoto || !hasBarcode || !hasWeight || !hasCount) { + const itemName = detail.product_name || '未命名商品'; + invalidDetails.push({ + detail_id: detail.id, + item_name: itemName, + missing_fields: [ + !hasPhoto && '照片', + !hasBarcode && '条码', + !hasWeight && '重量', + !hasCount && '数量', + ].filter(Boolean), + }); + } + } + + // 5. 如果有不符合条件的明细,返回错误 + if (invalidDetails.length > 0) { + await transaction.rollback(); + + const errorMsg = invalidDetails.length === 1 + ? `商品"${invalidDetails[0].item_name}"缺少${invalidDetails[0].missing_fields.join('、')}` + : `有${invalidDetails.length}个商品缺少必要信息`; + + return { + success: false, + code: 'DETAIL_INCOMPLETE', + message: errorMsg, + data: { + invalid_details: invalidDetails, + total_details: receiving.details.length, + matched_details: receiving.details.filter(d => d.system_product_id).length, + unmatched_details: unmatchedDetails.length, + }, + }; + } + + + // 7. 获取操作人信息 + const operator = ctx.user; + + // 8. 更新收货单状态 + const now = new Date(); + const updateData = { + status: 'completed', + receiving_end_time: now, + updated_at: now, + }; + + // 更新备注 + if (remark) { + const remarkPrefix = receiving.remark ? `${receiving.remark}\n` : ''; + updateData.remark = `${remarkPrefix}【完成收货】${now.toLocaleString()} ${operator.employees_name} ${remark}`; + } else { + const remarkPrefix = receiving.remark ? `${receiving.remark}\n` : ''; + updateData.remark = `${remarkPrefix}【完成收货】${now.toLocaleString()} ${operator.employees_name}`; + } + + await ctx.model.Receiving.update(updateData, { + where: { id }, + transaction, + }); + + // 9. 记录统计信息 + const stats = { + total_details: receiving.details.length, + matched_details: receiving.details.filter(d => d.system_product_id).length, + unmatched_details: unmatchedDetails.length, + total_quantity: receiving.details.reduce((sum, d) => sum + (d.actual_quantity || 0), 0), + }; + + if (stats.matched_details > 0) { + // 通知 + await ctx.service.systems.notification.send({ + type: 'system', + title: `收货单${receiving.receiving_number}已完成`, + content: `收货单${receiving.receiving_number}已完成,匹配商品${stats.matched_details}件,未匹配商品${stats.unmatched_details}件。`, + bussinessType: 'receiving', + bussinessId: receiving.id, + }); + } + + // 11. 提交事务 + await transaction.commit(); + + // 记录操作日志 + ctx.logger.info('收货单已完成', { + receiving_id: id, + receiving_number: receiving.receiving_number, + completed_by: operator.employees_name, + stats, + }); + + return { + success: true, + message: '收货完成成功', + data: { + receiving_id: id, + receiving_number: receiving.receiving_number, + completed_at: now, + completed_by: operator.employees_name, + stats, + }, + }; + + } catch (error) { + // 12. 回滚事务 + if (transaction) { + await transaction.rollback(); + } + + ctx.logger.error(`完成收货失败: ${error.message}`, { + receiving_id: id, + warehouseId, + error: error.stack, + }); + + // 如果是已知的业务错误,返回具体信息 + if (error.code && error.code.startsWith('DETAIL_')) { + return { + success: false, + code: error.code, + message: error.message, + }; + } + + // 其他错误 + return { + success: false, + code: 'SYSTEM_ERROR', + message: error.message || '系统错误,请稍后重试', + }; + } + } +} + +module.exports = ReceivingService; diff --git a/app/service/systems/store.js b/app/service/systems/store.js new file mode 100644 index 0000000..5fa210a --- /dev/null +++ b/app/service/systems/store.js @@ -0,0 +1,794 @@ +'use strict'; +const Service = require('egg').Service; + +class StoreService extends Service { + /** + * 根据ID获取商家信息 + * @param storeId + */ + async getStoreName(storeId) { + try { + const store = await this.app.model.Store.findByPk(storeId, { + attributes: [ 'id', 'company_name', 'status', 'is_warehouse' ], + }); + + if (!store) { + return { + code: 404, + message: '商家不存在', + data: null, + }; + } + + return { + code: 200, + message: '获取成功', + data: store, + }; + } catch (error) { + this.ctx.logger.error('获取商家信息失败:', error); + return { + code: 500, + message: '获取商家信息失败', + data: null, + }; + } + } + + /** + * 获取商家仓库备注名 + * @param storeId + * @param warehouseId + */ + async getStoreRemaskName(storeId, warehouseId) { + try { + const relation = await this.app.model.StoreWarehouse.findOne({ + where: { + store_id: storeId, + warehouse_id: warehouseId, + }, + }); + + if (!relation) { + return { + code: 404, + message: '商家仓库关系不存在', + data: null, + }; + } + + return { + code: 200, + message: '获取成功', + data: relation, + }; + } catch (error) { + this.ctx.logger.error('获取商家仓库关系失败:', error); + return { + code: 500, + message: '获取商家仓库关系失败', + data: null, + }; + } + } + + /** + * 创建商家(不需要审核) + * @param data + */ + async createStore(data) { + const { + ctx, + } = this; + const transaction = await ctx.model.transaction(); + + try { + const userId = ctx.userId || (ctx.user && ctx.user.id); + + if (!userId) { + return { + code: 401, + message: '用户未登录', + data: null, + }; + } + + // 验证必填字段 + const requiredFields = [ 'company_name', 'business_license', 'contact_person', 'contact_phone' ]; + for (const field of requiredFields) { + if (!data[field]) { + return { + code: 400, + message: `字段 ${field} 不能为空`, + data: null, + }; + } + } + + // 检查公司名称是否已存在 + const existingStore = await ctx.model.Store.findOne({ + where: { + company_name: data.company_name, + }, + }); + + if (existingStore) { + return { + code: 409, + message: '公司名称已存在', + data: null, + }; + } + + // 创建商家 + const storeData = { + company_name: data.company_name, + business_license: data.business_license, + legal_person: data.legal_person, + contact_phone: data.contact_phone, + contact_email: data.contact_email, + contact_person: data.contact_person, + address: data.address, + industry: data.industry, + account_id: userId, // 商家管理员 + status: 1, // 直接启用 + created_by: userId, + is_warehouse: 0, // 默认不是仓库 + logo_url: data.logo_url, + domain: data.domain, + auth_start: data.auth_start, + auth_end: data.auth_end, + }; + + const store = await ctx.model.Store.create(storeData, { + transaction, + }); + + // 为创建者自动分配商家管理员角色 + const role_id = await this.assignAdminRoleToCreator(store.id, userId, data.contact_person, transaction); + console.log(role_id); + await transaction.commit(); + + return { + code: 200, + message: '商家创建成功', + data: { + store_id: store.id, + company_name: store.company_name, + role_id: role_id.id, + }, + }; + + } catch (error) { + await transaction.rollback(); + this.ctx.logger.error('创建商家失败:', error); + + if (error.name === 'SequelizeUniqueConstraintError') { + return { + code: 409, + message: '商家信息已存在', + data: null, + }; + } + + return { + code: 500, + message: '创建商家失败', + data: null, + }; + } + } + + /** + * 创建仓库(需要审核) + * @param data + */ + async createWarehouse(data) { + const { + ctx, + } = this; + const transaction = await ctx.model.transaction(); + + try { + const userId = ctx.userId || (ctx.user && ctx.user.id); + + if (!userId) { + return { + code: 401, + message: '用户未登录', + data: null, + }; + } + + // 验证必填字段 + const requiredFields = [ 'company_name', 'contact_person', 'contact_phone' ]; + for (const field of requiredFields) { + if (!data[field]) { + return { + code: 400, + message: `字段 ${field} 不能为空`, + data: null, + }; + } + } + + // 检查公司名称是否已存在 + const existingStore = await ctx.model.Store.findOne({ + where: { + company_name: data.company_name, + }, + }); + + if (existingStore) { + return { + code: 409, + message: '公司名称已存在', + data: null, + }; + } + + // 创建仓库(也是商家,但 is_warehouse = 1) + const warehouseData = { + company_name: data.company_name, + business_license: data.business_license, + legal_person: data.legal_person, + contact_phone: data.contact_phone, + contact_email: data.contact_email, + contact_person: data.contact_person, + address: data.address, + industry: data.industry, + account_id: userId, + status: 1, // 直接通过 + created_by: userId, + is_warehouse: 1, // 标记为仓库 + logo_url: data.logo_url, + domain: data.domain, + auth_start: new Date(), // 设置当前时间为授权开始时间 + auth_end: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000), // 默认授权7天试用 + }; + + const warehouse = await ctx.model.Store.create(warehouseData, { + transaction, + }); + // 为创建者自动分配商家管理员角色 + const role_id = await this.assignAdminRoleToCreator(warehouse.id, userId, data.contact_person, + transaction, false); + await transaction.commit(); + return { + code: 200, + message: '仓库创建申请已提交,等待审核', + data: { + store_id: warehouse.id, + company_name: warehouse.company_name, + role_id: role_id.id, + }, + }; + + } catch (error) { + await transaction.rollback(); + this.ctx.logger.error('创建仓库申请失败:', error); + + if (error.name === 'SequelizeUniqueConstraintError') { + return { + code: 409, + message: '仓库信息已存在', + data: null, + }; + } + + return { + code: 500, + message: '提交申请失败', + data: null, + }; + } + } + + /** + * 加入商家 + * @param data + */ + async joinStore(data) { + const { + ctx, + } = this; + const transaction = await ctx.model.transaction(); + + try { + const userId = ctx.userId || (ctx.user && ctx.user.id); + console.log('申请参数', data); + // 验证必填字段 + if (!data.employees_name) { + return { + code: 400, + message: '真实姓名不能为空', + data: null, + }; + } + + // 删除用户的其他待审核申请 + await ctx.model.StoreJoin.destroy({ + where: { + account_id: userId, + audit_status: 'pending', + }, + transaction, + }); + + + // 生成加入链接(用于分享给管理员) + const joinToken = this.generateJoinToken(userId, data.store_id); + + // 创建加入申请 + const applyData = { + account_id: userId, + real_name: data.employees_name, + warehouse: 0, + apply_time: new Date(), + apply_username: ctx.username || '', + audit_status: 'pending', + remark: data.remark, + join_token: joinToken, + }; + + const applyRecord = await ctx.model.StoreJoin.create(applyData, { + transaction, + }); + + + await transaction.commit(); + + return { + code: 200, + message: '加入申请已提交', + data: { + apply_id: applyRecord.id, + joinToken, + }, + }; + + } catch (error) { + await transaction.rollback(); + console.log('error', error); + return { + code: 500, + message: '创建申请链接失败', + data: null, + }; + } + } + + /** + * 加入仓库 + * @param data + */ + async joinWarehouse(data) { + const { + ctx, + } = this; + const transaction = await ctx.model.transaction(); + + try { + const userId = ctx.userId || (ctx.user && ctx.user.id); + console.log('申请参数', data); + // 验证必填字段 + if (!data.employees_name) { + return { + code: 400, + message: '真实姓名不能为空', + data: null, + }; + } + + // 删除用户的其他待审核申请 + await ctx.model.StoreJoin.destroy({ + where: { + account_id: userId, + audit_status: 'pending', + }, + transaction, + }); + + + // 生成加入链接(用于分享给管理员) + const joinToken = this.generateJoinToken(userId, data.store_id); + + // 创建加入申请 + const applyData = { + account_id: userId, + real_name: data.employees_name, + warehouse: 1, + apply_time: new Date(), + apply_username: ctx.username || '', + audit_status: 'pending', + remark: data.remark, + join_token: joinToken, + }; + + const applyRecord = await ctx.model.StoreJoin.create(applyData, { + transaction, + }); + + + await transaction.commit(); + + return { + code: 200, + message: '加入申请已提交', + data: { + apply_id: applyRecord.id, + joinToken, + }, + }; + + } catch (error) { + await transaction.rollback(); + console.log('error', error); + return { + code: 500, + message: '创建申请链接失败', + data: null, + }; + } + } + + // ==================== 辅助方法 ==================== + + /** + * 为创建者分配管理员角色 + * @param storeId + * @param userId + * @param realName + * @param transaction + * @param isStore + */ + async assignAdminRoleToCreator(storeId, userId, realName, transaction, isStore = true) { + const { + ctx, + } = this; + + // 创建或获取管理员角色 + const role_code = isStore ? 'store_admin_default' : 'warehouse_admin_default'; + const adminRole = await ctx.model.Role.findOne({ + where: { + store_id: 0, + role_code, + }, + }); + + if (!adminRole) { + throw new Error(`未初始化${role_code}管理员角色`); + } + + // 分配角色给创建者 + const storerole = await ctx.model.AccountStoreRole.create({ + account_id: userId, + store_id: storeId, + role_id: adminRole.id, + status: 1, + real_name: realName || '', + assigned_by: userId, + }, { + transaction, + }); + return storerole; + } + + + /** + * 生成加入令牌 + * @param userId + * @param storeId + * @param type + */ + generateJoinToken(userId, storeId, type = 'store') { + const crypto = require('crypto'); + const timestamp = Date.now(); + const randomStr = Math.random().toString(36).substring(2, 10); + + const data = `${userId}_${storeId}_${type}_${timestamp}_${randomStr}`; + return crypto.createHash('sha256').update(data).digest('hex') + .substring(0, 32); + } + + /** + * 发送通知 + * @param notificationData + */ + async sendNotification(notificationData) { + const { + ctx, + } = this; + + try { + await ctx.model.Notification.create({ + ...notificationData, + is_read: 0, + created_at: new Date(), + }); + } catch (error) { + this.ctx.logger.error('发送通知失败:', error); + } + } + + /** + * 发送通知给系统管理员 + * @param notificationData + */ + async sendNotificationToAdmins(notificationData) { + const { + ctx, + } = this; + + try { + // 获取所有系统管理员 + const admins = await ctx.model.Account.findAll({ + where: { + status: 1, + // 这里可以根据角色筛选系统管理员 + }, + attributes: [ 'id' ], + }); + + for (const admin of admins) { + await this.sendNotification({ + ...notificationData, + account_id: admin.id, + }); + } + } catch (error) { + this.ctx.logger.error('发送管理员通知失败:', error); + } + } + async getStoreRoles(data) { + const { + ctx, + } = this; + try { + console.log('ctx', ctx.user.store_id); + const userId = ctx.user.id; + const storeId = ctx.user.store_id; + // 验证必填字段 + if (!data.code) { + return { + code: 400, + message: '参数错误', + data: null, + }; + } + const code = data.code; + console.log('申请参数', userId, storeId, code); + const applyData = await ctx.model.StoreJoin.findOne({ + where: { + join_token: code, + audit_status: 'pending', + }, + attributes: [ 'account_id', 'real_name', 'remark', 'audit_status', 'apply_time' ], + }); + const store = await ctx.model.Store.findOne({ + where: { + id: storeId, + status: 1, + }, + attributes: [ 'company_name', 'id' ], + }); + + const Roles = await ctx.model.Role.findAll({ + where: { + store_id: storeId, + deleted_at: null, + }, + }); + + return { + code: 200, + message: '获取成功', + data: { + info: applyData, + store, + roles: Roles, + }, + }; + } catch (error) { + console.log('error', error); + return { + code: 500, + message: '请求失败', + data: null, + }; + } + } + async auditApply(data) { + const { ctx } = this; + const transaction = await ctx.model.transaction(); + + try { + // 1. 验证必填字段 - 修复逻辑错误 + if (!data.audit_status || !data.code || !data.store_id || !data.role_ids || data.role_ids.length === 0) { + await transaction.rollback(); + return { + code: 400, + message: '参数错误:audit_status、code和role_ids为必填字段', + data: null, + }; + } + + // 2. 验证store_id + if (ctx.user.store_id != data.store_id) { + await transaction.rollback(); + return { + code: 400, + message: '参数错误:审批角色与访问接口不一致', + data: null, + }; + } + + const { code, audit_status, role_ids } = data; + const store_id = ctx.user.store_id; + + console.log('申请参数', data); + + // 3. 查找申请记录 + const applyData = await ctx.model.StoreJoin.findOne({ + where: { + join_token: code, + audit_status: 'pending', + }, + attributes: [ 'id', 'account_id', 'real_name', 'remark', 'audit_status', 'apply_time' ], + transaction, + }); + + if (!applyData) { + await transaction.rollback(); + return { + code: 400, + message: '没有找到对应的申请信息,可能已被他人审核或者申请者重新提交了申请资料', + data: null, + }; + } + + // 4. 查询角色信息 + const roles = await ctx.model.Role.findAll({ + where: { + store_id, + deleted_at: null, + id: role_ids, // in查询 + }, + transaction, + }); + + // 5. 验证role_ids是否都存在 + if (roles.length !== role_ids.length) { + await transaction.rollback(); + const foundRoleIds = roles.map(role => role.id); + const missingRoleIds = role_ids.filter(id => !foundRoleIds.includes(id)); + return { + code: 400, + message: `角色ID不存在或无权限:${missingRoleIds.join(',')}`, + data: null, + }; + } + + // 6. 根据审核状态处理不同的逻辑 + if (audit_status === 'approved') { + // 审核通过:分配角色并更新申请状态 + const { account_id, real_name } = applyData; + + for (const role of roles) { + // 检查是否已存在该角色分配 + const existingRole = await ctx.model.AccountStoreRole.findOne({ + where: { + account_id, + store_id, + role_id: role.id, + status: 1, + }, + transaction, + }); + + if (!existingRole) { + await ctx.model.AccountStoreRole.create({ + account_id, + store_id, + role_id: role.id, + status: 1, + real_name, + join_token: code, + }, { transaction }); + } + } + + // 更新申请记录状态 + await ctx.model.StoreJoin.update({ + audit_status: 'approved', + audit_time: new Date(), + auditor_id: ctx.user.account_id, + auditor_name: ctx.user.real_name || ctx.user.username, + }, { + where: { id: applyData.id }, + transaction, + }); + await this.ctx.Service.systems.auth.user.clearUserCache(ctx.user.account_id);// 立即清理用户缓存 + await transaction.commit(); + const result = await this.getStoreRoles({ code }); + return { + code: 200, + message: '审批通过成功', + data: result.data, + }; + + } else if (audit_status === 'rejected') { + // 审核拒绝:只更新申请状态 + await ctx.model.StoreJoin.update({ + audit_status: 'rejected', + audit_time: new Date(), + auditor_id: ctx.user.account_id, + auditor_name: ctx.user.real_name || ctx.user.username, + reject_reason: data.reject_reason || '审核不通过', + }, { + where: { id: applyData.id }, + transaction, + }); + + await transaction.commit(); + + return { + code: 200, + message: '审批拒绝成功', + data: null, + }; + + } + await transaction.rollback(); + return { + code: 400, + message: 'audit_status参数错误,只能为approved或rejected', + data: null, + }; + + + } catch (error) { + await transaction.rollback(); + console.error('审核申请出错:', error); + + // 根据错误类型返回更详细的错误信息 + let errorMessage = '请求失败'; + if (error.name === 'SequelizeValidationError') { + errorMessage = '数据验证失败'; + } else if (error.name === 'SequelizeUniqueConstraintError') { + errorMessage = '数据已存在'; + } + + return { + code: 500, + message: errorMessage, + data: null, + error: process.env.NODE_ENV === 'development' ? error.message : undefined, + }; + } + } + async loadStores() { + const { app, ctx } = this; + + try { + const stores = await ctx.model.StoreWarehouse.findAll({ + where: { + use_status: 1, + warehouse_id: ctx.user.store_id, + }, + attributes: [ + [ 'store_id', 'value' ], // store_id 字段别名为 value + [ 'store_remask', 'label' ], // store_remask 字段别名为 label + ], + raw: true, // 可选:返回纯JSON数据 + }); + + return stores; + } catch (error) { + ctx.logger.error('[Service.loadStores] 查询失败:', error); + throw error; + } + } +} + +module.exports = StoreService; diff --git a/app/service/systems/upload.js b/app/service/systems/upload.js new file mode 100644 index 0000000..b25a8e2 --- /dev/null +++ b/app/service/systems/upload.js @@ -0,0 +1,596 @@ +'use strict'; + +const Service = require('egg').Service; +const COS = require('cos-nodejs-sdk-v5'); +const path = require('path'); +const crypto = require('crypto'); +const { v4: uuidv4 } = require('uuid'); +const dayjs = require('dayjs'); + +class UploadService extends Service { + constructor(ctx) { + super(ctx); + this.initCOS(); + } + initCOS() { + const { secretId, secretKey } = this.config.cos; + this.cos = new COS({ + SecretId: secretId, + SecretKey: secretKey, + }); + this.ctx.logger.info('COS client initialized'); + } + + /** + * 获取上传参数 - 使用与PHP一致的算法 + * @param fileInfo + */ + async getUploadParams(fileInfo) { + const { ctx } = this; + const warehouseId = ctx.user.store_id; + console.log('fileInfo', fileInfo); + const { fileName, fileType, fileSize, type, id, md5 } = fileInfo; + + if (md5) { + const existingFile = await ctx.model.File.findOne({ + where: { + md5_hash: md5, + warehouse_id: warehouseId, + is_deleted: false, + }, + }); + + if (existingFile) { + this.ctx.logger.info(`文件已存在,返回已有记录: ${existingFile.file_url}`); + return { + fileId: existingFile.id, + fileUrl: existingFile.file_url, + fileKey: existingFile.file_key, + fileName: existingFile.file_name, + isNew: false, + }; + } + } + // 验证文件 + this.validateFileInfo({ fileName, fileType, fileSize }); + + const warehouse_quota = await this.app.model.query( + 'SELECT * FROM vw_warehouse_quota WHERE warehouse_id = :warehouseId', + { + replacements: { warehouseId }, + type: this.app.model.QueryTypes.SELECT, + } + ); + const remaining_bytes = warehouse_quota[0].remaining_bytes; + if (remaining_bytes - fileSize < 0) { + return { + error: true, + msg: '空间配额已满', + }; + } + console.log('空间计算剩余可用', remaining_bytes - fileSize); + // 生成文件名 + const cosFileName = this.generateFileName(fileName, fileType, type, md5); + + // 获取当前时间戳 + const now = Math.floor(Date.now() / 1000); + const expire = now + this.config.cos.expire; + const keyTime = `${now};${expire}`; + + // 使用与PHP一致的算法生成签名 + const { policy, signature } = this.generatePolicyAndSignature(cosFileName, now, expire); + + // 构建返回参数 + return { + fileName: cosFileName, + uploadUrl: `https://${this.config.cos.bucket}.cos.${this.config.cos.region}.myqcloud.com`, + bucket: this.config.cos.bucket, + region: this.config.cos.region, + signature: { + secretId: this.config.cos.secretId, + signature, + keyTime, + key: cosFileName, + }, + // 添加 data 字段以匹配前端 + data: { + key: cosFileName, + policy, + 'q-sign-algorithm': 'sha1', + 'q-ak': this.config.cos.secretId, + 'q-sign-time': keyTime, + 'q-key-time': keyTime, + 'q-signature': signature, + success_action_status: '200', + 'x-cos-security-token': '', + 'x-cos-meta-filename': encodeURIComponent(fileName), + 'x-cos-meta-filetype': fileType, + category: type || '', + }, + // 用于前端验证 + fileInfo: { + name: fileName, + url: cosFileName, + type: fileType, + size: fileSize, + md5, + }, + // 有效期 + expires: this.config.cos.expire, + // 前端需要的额外参数 + frontendConfig: this.getFrontendConfig(fileType, fileSize), + isNew: true, + }; + } + + /** + * 生成策略和签名 - 与PHP算法完全一致 + * 参考你的PHP代码: + * $signature = hash_hmac('sha1', sha1($policy), hash_hmac('sha1', $keytime, $config['secretKey'])); + * @param key + * @param startTime + * @param expireTime + */ + generatePolicyAndSignature(key, startTime, expireTime) { + const { secretId, secretKey, bucket } = this.config.cos; + const keyTime = `${startTime};${expireTime}`; + + // 1. 生成策略 - 与PHP完全一致 + const policy = { + expiration: new Date(expireTime * 1000).toISOString(), + conditions: [ + { 'q-sign-algorithm': 'sha1' }, + { 'q-ak': secretId }, + { 'q-sign-time': keyTime }, + ], + }; + + const policyString = JSON.stringify(policy); + const policyBase64 = Buffer.from(policyString).toString('base64'); + + // 2. 计算签名 - 与PHP算法完全一致 + // 步骤1: 计算内层HMAC: hash_hmac('sha1', $keytime, $config['secretKey']) + const innerHmac = crypto.createHmac('sha1', secretKey); + innerHmac.update(keyTime); + const signKey = innerHmac.digest('hex'); // PHP中的 hash_hmac('sha1', $keytime, $secretKey) + + // 步骤2: 计算SHA1(policy) + const policySha1 = crypto.createHash('sha1'); + policySha1.update(policyString); + const policyHash = policySha1.digest('hex'); // PHP中的 sha1($policy) + + // 步骤3: 外层HMAC: hash_hmac('sha1', sha1($policy), signKey) + const outerHmac = crypto.createHmac('sha1', signKey); + outerHmac.update(policyHash); + const signature = outerHmac.digest('hex'); // 最终的签名 + + // 调试信息 + console.log('策略原始内容:', policyString); + console.log('策略Base64:', policyBase64); + console.log('keyTime:', keyTime); + console.log('signKey (内层HMAC):', signKey); + console.log('policyHash (SHA1):', policyHash); + console.log('signature (外层HMAC):', signature); + + return { + policy: policyBase64, + signature, + policyString, + signKey, + policyHash, + }; + } + /** + * 验证文件信息 + * @param root0 + * @param root0.fileName + * @param root0.fileType + * @param root0.fileSize + */ + validateFileInfo({ fileName, fileType, fileSize }) { + const { maxsize, mimetype } = this.config.cos; + + // 验证文件大小 + const maxSizeBytes = this.parseSizeToBytes(maxsize); + if (fileSize > maxSizeBytes) { + throw new Error(`文件大小不能超过 ${this.formatFileSize(maxSizeBytes)}`); + } + + // 验证文件类型 + const allowedTypes = mimetype.split(','); + const fileExt = path.extname(fileName).toLowerCase().replace('.', ''); + + if (!fileExt || !allowedTypes.includes(fileExt)) { + throw new Error(`不支持的文件类型 ${fileExt},仅支持: ${allowedTypes.join(', ')}`); + } + + return true; + } + + /** + * 生成文件唯一名称 + * @param fileName + * @param fileType + * @param category + * @param md5 + */ + generateFileName(fileName, fileType, category = '', md5) { + const { savekey, dirs } = this.config.cos; + const ext = path.extname(fileName); + const name = path.basename(fileName, ext); + const timestamp = dayjs().format('YYYYMMDDHHmmss'); + const random = Math.random().toString(36).substring(2, 10); + const { ctx } = this; + // 根据文件类型或指定的分类获取目录 + let dir = dirs.default; + if (category && dirs[category]) { + dir = dirs[category]; + } else { + const typeKey = this.config.fileTypes[fileType] || 'default'; + dir = dirs[typeKey] || dirs.default; + } + + // 替换模板变量 + const result = savekey + .replace('{warehouseId}', ctx.user.store_id) + .replace('{dir}', dir) + .replace('{year}', dayjs().format('YYYY')) + .replace('{mon}', dayjs().format('MM')) + .replace('{day}', dayjs().format('DD')) + .replace('{timestamp}', timestamp) + .replace('{random}', random) + .replace('{filename}', name) + .replace('{filemd5}', md5) + .replace('{.suffix}', ext); + + // 添加目录前缀并规范化路径 + const fullPath = path.posix.join(result).replace(/\/\//g, '/'); + return fullPath; + } + + /** + * 解析文件大小字符串为字节数 + * @param sizeStr + */ + parseSizeToBytes(sizeStr) { + if (typeof sizeStr === 'number') { + return sizeStr; + } + + const units = { + B: 1, + KB: 1024, + MB: 1024 * 1024, + GB: 1024 * 1024 * 1024, + TB: 1024 * 1024 * 1024 * 1024, + }; + + const match = sizeStr.match(/^(\d+(?:\.\d+)?)\s*([KMGT]?B)$/i); + if (match) { + const size = parseFloat(match[1]); + const unit = match[2].toUpperCase(); + return size * (units[unit] || 1); + } + + return 100 * 1024 * 1024; + } + + /** + * 格式化文件大小 + * @param bytes + */ + formatFileSize(bytes) { + if (bytes === 0) return '0 B'; + + const k = 1024; + const sizes = [ 'B', 'KB', 'MB', 'GB', 'TB' ]; + const i = Math.floor(Math.log(bytes) / Math.log(k)); + + return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i]; + } + + /** + * 获取前端配置 + * @param fileType + * @param fileSize + */ + getFrontendConfig(fileType, fileSize) { + const { chunkSize } = this.config.cos; + + return { + useMultipart: fileSize > 5 * 1024 * 1024, + chunkSize, + parallelLimit: 3, + enableMD5: true, + timeout: 30 * 60 * 1000, + retryCount: 3, + progressInterval: 1000, + }; + } + + /** + * 服务器端上传文件 + * @param fileStream + * @param options + */ + async uploadFile(fileStream, options = {}) { + const { bucket, region } = this.config.cos; + + try { + this.validateFile(fileStream, options); + + const fileName = options.key || this.generateFileName( + fileStream.filename, + fileStream.mimeType, + options.category + ); + + const result = await this.cos.putObject({ + Bucket: bucket, + Region: region, + Key: fileName, + Body: fileStream, + ContentLength: fileStream.fileSize, + onProgress: options.onProgress, + }); + + return { + fileName, + cosUrl: `${this.config.cos.uploadurl}/${fileName}`, + cdnUrl: `${this.config.cos.cdnurl}/${fileName}`, + url: `${this.config.cos.cdnurl}/${fileName}`, + etag: result.ETag, + location: result.Location, + uploadAt: new Date().toISOString(), + }; + } catch (error) { + this.ctx.logger.error('文件上传失败:', error); + throw error; + } + } + + /** + * 验证文件 + * @param fileStream + * @param options + */ + validateFile(fileStream, options = {}) { + const { maxsize, mimetype } = this.config.cos; + const { filename, fileSize } = fileStream; + + const maxSizeBytes = this.parseSizeToBytes(maxsize); + if (fileSize > maxSizeBytes) { + throw new Error(`文件大小不能超过 ${this.formatFileSize(maxSizeBytes)}`); + } + + const allowedTypes = (options.mimetype || mimetype).split(','); + const fileExt = path.extname(filename).toLowerCase().replace('.', ''); + + if (!allowedTypes.includes(fileExt)) { + throw new Error(`不支持的文件类型 ${fileExt},仅支持: ${allowedTypes.join(', ')}`); + } + + return true; + } + /** + * 上传成功通知 - 记录到数据库并返回文件URL + * @param {Object} data - 上传成功的数据 + * @param {string} data.fileKey - 文件在COS的key + * @param {string} data.fileName - 原始文件名 + * @param {string} data.fileType - 文件类型 + * @param {string} data.mimeType - MIME类型 + * @param {number} data.fileSize - 文件大小 + * @param {string} data.md5Hash - 文件MD5(可选) + * @param {string} data.sha1Hash - 文件SHA1(可选) + * @param {string} data.category - 业务分类 + * @param {string} data.uploaderType - 上传者类型 + * @param {string} data.uploaderDept - 上传者部门 + */ + async uploadSuccessNotify(data) { + const { ctx } = this; + console.log('上传成功', data); + try { + // 从上下文获取用户信息(根据你的实际用户认证方式) + const warehouseId = ctx.user?.store_id || ctx.query.warehouseId || ctx.request.body.warehouseId; + const userId = ctx.user?.id || ctx.query.userId || ctx.request.body.userId; + const userName = ctx.user?.real_name || ctx.user?.username || '系统用户'; + + // 如果没有用户信息,使用默认值或抛出错误 + if (!warehouseId || !userId) { + this.ctx.logger.warn('上传成功通知缺少用户信息,使用默认值'); + } + + // 生成完整的访问URL + const fileUrl = `${this.config.cos.cdnurl || this.config.cos.uploadurl}/${data.url}`; + + // 计算哈希值(如果前端没有提供) + let md5Hash = data.md5; + + if (!md5Hash && data.fileContent) { + // 如果有文件内容,可以计算哈希 + md5Hash = crypto.createHash('md5').update(data.fileContent).digest('hex'); + } + + // 构建数据库记录 + const fileRecord = { + warehouse_id: warehouseId || 0, // 默认为0或使用默认仓库 + file_key: data.url, + file_url: fileUrl, + file_name: data.name, + file_size: data.size, + file_type: data.type, + mime_type: data.type, + md5_hash: md5Hash || '', + storage_mode: 'cos', + storage_class: 'standard', + uploader_id: userId?.toString() || '0', + uploader_name: userName, + uploader_dept: data.uploaderDept || '', + created_at: new Date(), + }; + + // 检查是否已存在相同文件(根据MD5去重) + if (md5Hash) { + const existingFile = await ctx.model.File.findOne({ + where: { + md5_hash: md5Hash, + warehouse_id: warehouseId, + is_deleted: false, + }, + }); + + if (existingFile) { + this.ctx.logger.info(`文件已存在,返回已有记录: ${existingFile.file_url}`); + return { + fileId: existingFile.id, + fileUrl: existingFile.file_url, + fileKey: existingFile.file_key, + fileName: existingFile.file_name, + isNew: false, + }; + } + } + + // 保存到数据库 + const savedFile = await ctx.model.File.create(fileRecord); + + // 根据业务类型创建引用关系(如果需要) + if (data.businessType && data.businessId) { + await this.createFileReference(savedFile.id, data.businessType, data.businessId); + } + + this.ctx.logger.info(`文件记录保存成功: ${savedFile.id} - ${data.fileName}`); + + // 返回成功响应 + return { + code: 0, + message: '文件上传成功', + data: { + fileId: savedFile.id, + fileUrl, + fileKey: data.fileKey, + fileName: data.fileName, + fileSize: data.fileSize, + mimeType: data.mimeType, + isNew: true, + createdAt: savedFile.created_at, + }, + }; + + } catch (error) { + this.ctx.logger.error('上传成功通知处理失败:', error); + + // 根据错误类型返回相应错误 + if (error.name === 'SequelizeUniqueConstraintError') { + return { + code: 1001, + message: '文件已存在(唯一约束冲突)', + data: null, + }; + } + + return { + code: 500, + message: `文件记录保存失败: ${error.message}`, + data: null, + }; + } + } + + /** + * 根据文件名获取MIME类型 + * @param fileName + */ + getMimeType(fileName) { + const ext = path.extname(fileName).toLowerCase(); + + const mimeTypes = { + '.jpg': 'image/jpeg', + '.jpeg': 'image/jpeg', + '.png': 'image/png', + '.gif': 'image/gif', + '.bmp': 'image/bmp', + '.webp': 'image/webp', + '.pdf': 'application/pdf', + '.doc': 'application/msword', + '.docx': 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + '.xls': 'application/vnd.ms-excel', + '.xlsx': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + '.ppt': 'application/vnd.ms-powerpoint', + '.pptx': 'application/vnd.openxmlformats-officedocument.presentationml.presentation', + '.zip': 'application/zip', + '.rar': 'application/x-rar-compressed', + '.mp4': 'video/mp4', + '.mp3': 'audio/mpeg', + '.txt': 'text/plain', + }; + + return mimeTypes[ext] || 'application/octet-stream'; + } + + /** + * 创建文件业务引用关系 + * @param fileId + * @param businessType + * @param businessId + */ + async createFileReference(fileId, businessType, businessId) { + const { ctx } = this; + + try { + // 如果有文件引用模型 + if (ctx.model.FileReference) { + const reference = await ctx.model.FileReference.create({ + file_id: fileId, + business_type: businessType, + business_id: businessId, + created_at: new Date(), + }); + + this.ctx.logger.info(`文件引用关系创建成功: fileId=${fileId}, businessType=${businessType}, businessId=${businessId}`); + return reference; + } + + return null; + } catch (error) { + this.ctx.logger.error(`创建文件引用关系失败: ${error.message}`); + return null; + } + } + + /** + * 上传完成回调接口 - 供前端调用 + * @param callbackData + */ + async handleUploadCallback(callbackData) { + const { ctx } = this; + + try { + // 解析回调数据 + const { key, size, mimeType, etag, location, businessInfo } = callbackData; + + // 构建文件信息 + const fileInfo = { + fileKey: key, + fileName: key.substring(key.lastIndexOf('/') + 1), + fileSize: size, + mimeType, + category: businessInfo?.type || 'default', + uploaderType: ctx.user?.role || 'system_api', + uploaderDept: ctx.user?.department || '', + businessType: businessInfo?.type, + businessId: businessInfo?.id, + }; + + // 调用上传成功通知 + const result = await this.uploadSuccessNotify(fileInfo); + + return result; + } catch (error) { + this.ctx.logger.error('上传回调处理失败:', error); + throw error; + } + } +} + +module.exports = UploadService; diff --git a/app/view/printer_setting.html b/app/view/printer_setting.html new file mode 100644 index 0000000..fce9bc8 --- /dev/null +++ b/app/view/printer_setting.html @@ -0,0 +1,78 @@ + + + + + + <%= title %> + + + +
+

打印台设置

+
+ + + + + + + +
+
+
+ + + diff --git a/config/config.default.js b/config/config.default.js new file mode 100644 index 0000000..8cfba58 --- /dev/null +++ b/config/config.default.js @@ -0,0 +1,172 @@ +/* + * @param {Egg.EggAppInfo} appInfo app info + */ +module.exports = appInfo => { + /** + * built-in config + * @type {Egg.EggAppConfig} + **/ + const config = exports = {}; + + // use for cookie sign key, should change to your own and keep security + config.keys = appInfo.name + '_1745985142442_9900'; + + // add your middleware config here + config.middleware = []; + + // add your user config here + const userConfig = { + // myAppName: 'egg', + }; + config.redis = { + clients: { + cache: { + port: 6379, + host: '112.124.21.102', + password: 'qwe2019@', + db: 10, + }, + printer: { + port: 6379, + host: '112.124.21.102', + password: 'qwe2019@', + db: 11, + } + }, + }; + config.security = { + csrf: { + enable: false, + }, + }; + config.qimen = { + appKey: 23535631, + security: 'd0cbd3935e3afa2b42b5dc600c08a795', + }; + config.cos = { + appId: 1234567890, + secretId: 'AKIDeFhx1tQ5PYVYP9K8PXUFoazHRPBlpTXP', + secretKey: 'pcHtKbhcKqDNLqEQRIxRjpjRHxTnvGQT', + bucket: 'ye4s-1255377868', + region: 'ap-guangzhou', + uploadurl: 'https://ye4s-1255377868.cos.ap-guangzhou.myqcloud.com', + cdnurl: 'https://ye4s.file.gzxunren.com', + savekey: '/{warehouseId}/{dir}/{year}{mon}{day}/{filemd5}{.suffix}', + expire: 600, + maxsize: '100M', + mimetype: 'jpg,png,bmp,jpeg,gif,zip,rar,xls,xlsx,apk', + apiupload: 1, + dirs: { + image: '/images/', + document: '/documents/', + apk: '/apks/', + temp: '/temp/', // 临时文件目录 + }, + }; + config.fileTypes = { + // 图片类型 + image: 'image', + 'image/jpeg': 'image', + 'image/jpg': 'image', + 'image/png': 'image', + 'image/gif': 'image', + 'image/bmp': 'image', + 'image/webp': 'image', + 'image/svg+xml': 'image', + + // 文档类型 + 'application/pdf': 'document', + 'application/msword': 'document', + 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': 'document', + 'application/vnd.ms-excel': 'document', + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': 'document', + 'application/vnd.ms-powerpoint': 'document', + 'application/vnd.openxmlformats-officedocument.presentationml.presentation': 'document', + 'text/plain': 'document', + + // 压缩文件 + 'application/zip': 'document', + 'application/x-rar-compressed': 'document', + 'application/x-7z-compressed': 'document', + + // APK + 'application/vnd.android.package-archive': 'apk', + + // 视频 + 'video/mp4': 'video', + 'video/mpeg': 'video', + 'video/quicktime': 'video', + 'video/x-msvideo': 'video', + + // 音频 + 'audio/mpeg': 'audio', + 'audio/wav': 'audio', + 'audio/x-wav': 'audio', + 'audio/x-m4a': 'audio', + }; + config.cors = { + origin: '*', // 允许所有源,生产环境应指定具体域名 + allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH,OPTIONS', + credentials: true, // 允许携带 cookie + }; + + config.mysql = { + clients: { + wms: { + host: '10.10.0.1', + port: '3306', + user: 'wms', + password: 'P6j3YTHTpirepYWz', + database: 'wms', + }, + }, + app: true, + agent: false, + }; + exports.sequelize = { + dialect: 'mysql', + host: '10.10.0.1', + port: 3306, + database: 'wms', + username: 'wms', + password: 'P6j3YTHTpirepYWz', + define: { + freezeTableName: true, + underscored: true, + timestamps: true, + paranoid: true, // 启用软删除 + deletedAt: 'deleted_at', // 软删除字段名 + }, + pool: { + max: 5, + min: 1, + idle: 10000, + acquire: 30000, + }, + }; + + config.jwt = { + expiresIn: 14400, + secret: 'E5#ex.g@,GfL_8?', + }; + + /*config.view = { + defaultViewEngine: 'ejs', + mapping: { + '.html': 'ejs', + }, + };*/ + config.cluster = { + listen: { + port: 6060, // 使用其他端口避免冲突 + hostname: '0.0.0.0', + }, + }; + config.printService = { + url: 'http://localhost:4050', + }; + return { + ...config, + ...userConfig, + }; +}; diff --git a/config/plugin.js b/config/plugin.js new file mode 100644 index 0000000..a827fec --- /dev/null +++ b/config/plugin.js @@ -0,0 +1,30 @@ +/** @type Egg.EggPlugin */ +module.exports = { + mysql: { + // disable direct mysql connections during tests + enable: process.env.NODE_ENV !== 'test', + package: 'egg-mysql', + }, + redis: { + // disable redis connection during unit tests + enable: process.env.NODE_ENV !== 'test', + package: 'egg-redis', + }, + jwt: { + enable: true, + package: 'egg-jwt', + }, + sequelize: { + // disable real database connection during unit tests + enable: process.env.NODE_ENV !== 'test', + package: 'egg-sequelize', + }, + cors: { + enable: true, + package: 'egg-cors', + }, + ejs: { + enable: true, + package: 'egg-view-ejs', + }, +}; diff --git a/database/migrations/20251109160640-init-wms_account.js b/database/migrations/20251109160640-init-wms_account.js new file mode 100644 index 0000000..bae015e --- /dev/null +++ b/database/migrations/20251109160640-init-wms_account.js @@ -0,0 +1,108 @@ +'use strict'; + +module.exports = { + async up(queryInterface, Sequelize) { + const { BIGINT, STRING, INTEGER, DATE, TINYINT } = Sequelize; + + await queryInterface.createTable('wms_account', { + id: { + type: BIGINT(20), + primaryKey: true, + autoIncrement: true, + allowNull: false, + comment: '账号ID', + }, + username: { + type: STRING(50), + allowNull: false, + unique: true, + comment: '用户名', + }, + phone: { + type: STRING(20), + allowNull: false, + comment: '手机号', + }, + email: { + type: STRING(100), + allowNull: true, + comment: '邮箱', + }, + password_hash: { + type: STRING(255), + allowNull: false, + comment: '密码哈希', + }, + real_name: { + type: STRING(50), + allowNull: false, + comment: '真实姓名', + }, + user_type: { + type: TINYINT(4), + allowNull: false, + defaultValue: 1, + comment: '用户类型:1-平台管理员,2-仓库管理员', + }, + status: { + type: TINYINT(4), + allowNull: false, + defaultValue: 1, + comment: '状态:0-禁用,1-启用,2-离职', + }, + last_login_at: { + type: DATE, + allowNull: true, + comment: '最后登录时间', + }, + created_at: { + type: DATE, + allowNull: false, + defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'), + comment: '创建时间', + }, + updated_at: { + type: DATE, + allowNull: false, + defaultValue: Sequelize.literal('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), + comment: '更新时间', + }, + salt: { + type: STRING(20), + allowNull: true, + comment: '密码盐', + }, + }, { + engine: 'InnoDB', + charset: 'utf8mb4', + collate: 'utf8mb4_general_ci', + comment: 'WMS账户表', + }); + + // 添加索引 + await queryInterface.addIndex('wms_account', [ 'username' ], { + name: 'idx_username', + unique: true, + }); + + await queryInterface.addIndex('wms_account', [ 'phone' ], { + name: 'idx_phone', + }); + + await queryInterface.addIndex('wms_account', [ 'email' ], { + name: 'idx_email', + }); + + await queryInterface.addIndex('wms_account', [ 'user_type' ], { + name: 'idx_user_type', + }); + + await queryInterface.addIndex('wms_account', [ 'status' ], { + name: 'idx_status', + }); + }, + + async down(queryInterface, Sequelize) { + await queryInterface.dropTable('wms_account'); + }, +}; diff --git a/database/migrations/20251110081122-create-wms-account-login-log.js b/database/migrations/20251110081122-create-wms-account-login-log.js new file mode 100644 index 0000000..06259ed --- /dev/null +++ b/database/migrations/20251110081122-create-wms-account-login-log.js @@ -0,0 +1,113 @@ +'use strict'; + +module.exports = { + async up(queryInterface, Sequelize) { + const { INTEGER, BIGINT, STRING, DATE, TINYINT } = Sequelize; + + // 先检查表是否存在,避免重复创建 + const [ tables ] = await queryInterface.sequelize.query( + "SHOW TABLES LIKE 'wms_account_login_log'" + ); + + if (tables.length > 0) { + console.log('Table wms_account_login_log already exists, skipping creation'); + return; + } + + await queryInterface.createTable('wms_account_login_log', { + id: { + type: INTEGER(11), + primaryKey: true, + autoIncrement: true, + allowNull: false, + comment: '日志ID', + }, + user_id: { + type: BIGINT(20), + allowNull: false, + references: { + model: 'wms_account', + key: 'id', + }, + onUpdate: 'CASCADE', + onDelete: 'NO ACTION', + comment: '用户ID', + }, + login_ip: { + type: STRING(50), + allowNull: false, + comment: '登录IP', + }, + user_agent: { + type: STRING(500), + allowNull: false, + comment: '用户代理', + }, + login_time: { + type: DATE, + allowNull: false, + defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'), + comment: '登录时间', + }, + success: { + type: TINYINT(4), + allowNull: false, + defaultValue: 1, + comment: '是否成功(0失败,1成功)', + }, + remark: { + type: STRING(200), + allowNull: true, + comment: '备注', + }, + }, { + engine: 'InnoDB', + charset: 'utf8mb4', + collate: 'utf8mb4_general_ci', + comment: 'WMS账户登录日志表', + }); + + // 安全创建索引的函数 + const safeCreateIndex = async (tableName, fields, options) => { + const [ existingIndexes ] = await queryInterface.sequelize.query( + `SHOW INDEX FROM ${tableName} WHERE Key_name = '${options.name}'` + ); + if (existingIndexes.length === 0) { + await queryInterface.addIndex(tableName, fields, options); + } + }; + + // 添加索引 + await safeCreateIndex('wms_account_login_log', [ 'user_id' ], { + name: 'idx_user_id', + }); + + await safeCreateIndex('wms_account_login_log', [ 'login_time' ], { + name: 'idx_login_time', + }); + + await safeCreateIndex('wms_account_login_log', [ 'success' ], { + name: 'idx_success', + }); + + await safeCreateIndex('wms_account_login_log', [ 'login_ip' ], { + name: 'idx_login_ip', + }); + + // 添加复合索引用于常用查询 + await safeCreateIndex('wms_account_login_log', [ 'user_id', 'login_time' ], { + name: 'idx_user_login_time', + }); + }, + + async down(queryInterface, Sequelize) { + // 安全删除表 + const [ tables ] = await queryInterface.sequelize.query( + "SHOW TABLES LIKE 'wms_account_login_log'" + ); + + if (tables.length > 0) { + await queryInterface.dropTable('wms_account_login_log'); + } + }, +}; diff --git a/database/migrations/20251110081641-create-wms-qimen-apps.js b/database/migrations/20251110081641-create-wms-qimen-apps.js new file mode 100644 index 0000000..ec95c0e --- /dev/null +++ b/database/migrations/20251110081641-create-wms-qimen-apps.js @@ -0,0 +1,87 @@ +'use strict'; + +module.exports = { + async up(queryInterface, Sequelize) { + const { INTEGER, STRING, DATE } = Sequelize; + + // 先检查表是否存在,避免重复创建 + const [ tables ] = await queryInterface.sequelize.query( + "SHOW TABLES LIKE 'wms_qimen_apps'" + ); + + if (tables.length > 0) { + console.log('Table wms_qimen_apps already exists, skipping creation'); + return; + } + + await queryInterface.createTable('wms_qimen_apps', { + id: { + type: INTEGER(11), + primaryKey: true, + autoIncrement: true, + allowNull: false, + comment: '应用ID', + }, + name: { + type: STRING(100), + allowNull: true, + comment: '应用名称', + }, + app_key: { + type: STRING(50), + allowNull: true, + unique: true, + comment: '应用密钥', + }, + created_at: { + type: DATE, + allowNull: false, + defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'), + comment: '创建时间', + }, + updated_at: { + type: DATE, + allowNull: false, + defaultValue: Sequelize.literal('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), + comment: '更新时间', + }, + }, { + engine: 'InnoDB', + charset: 'utf8mb4', + collate: 'utf8mb4_general_ci', + comment: '奇门应用配置表', + }); + + // 安全创建索引的函数 + const safeCreateIndex = async (tableName, fields, options) => { + const [ existingIndexes ] = await queryInterface.sequelize.query( + `SHOW INDEX FROM ${tableName} WHERE Key_name = '${options.name}'` + ); + if (existingIndexes.length === 0) { + await queryInterface.addIndex(tableName, fields, options); + } + }; + + // 添加唯一索引(如果创建表时unique约束没生效,这里确保创建) + await safeCreateIndex('wms_qimen_apps', [ 'app_key' ], { + name: 'uk_app_key', + unique: true, + }); + + // 添加普通索引 + await safeCreateIndex('wms_qimen_apps', [ 'name' ], { + name: 'idx_name', + }); + }, + + async down(queryInterface, Sequelize) { + // 安全删除表 + const [ tables ] = await queryInterface.sequelize.query( + "SHOW TABLES LIKE 'wms_qimen_apps'" + ); + + if (tables.length > 0) { + await queryInterface.dropTable('wms_qimen_apps'); + } + }, +}; diff --git a/database/migrations/20251110082013-create-wms-store.js b/database/migrations/20251110082013-create-wms-store.js new file mode 100644 index 0000000..69904ca --- /dev/null +++ b/database/migrations/20251110082013-create-wms-store.js @@ -0,0 +1,195 @@ +'use strict'; + +module.exports = { + async up(queryInterface, Sequelize) { + const { BIGINT, STRING, INTEGER, DATE, TINYINT } = Sequelize; + + // 先检查表是否存在,避免重复创建 + const [ tables ] = await queryInterface.sequelize.query( + "SHOW TABLES LIKE 'wms_store'" + ); + + if (tables.length > 0) { + console.log('Table wms_store already exists, skipping creation'); + return; + } + + await queryInterface.createTable('wms_store', { + id: { + type: BIGINT(20), + primaryKey: true, + autoIncrement: true, + allowNull: false, + comment: '商家ID', + }, + store_name: { + type: STRING(100), + allowNull: false, + comment: '商家名称', + }, + company_name: { + type: STRING(200), + allowNull: false, + unique: true, + comment: '公司全称', + }, + business_license: { + type: STRING(100), + allowNull: true, + unique: true, + comment: '营业执照号', + }, + legal_person: { + type: STRING(50), + allowNull: true, + comment: '法人代表', + }, + contact_phone: { + type: STRING(20), + allowNull: false, + comment: '联系电话', + }, + contact_email: { + type: STRING(100), + allowNull: true, + comment: '联系邮箱', + }, + contact_person: { + type: STRING(50), + allowNull: false, + comment: '联系人', + }, + address: { + type: STRING(500), + allowNull: true, + comment: '公司地址', + }, + industry: { + type: STRING(100), + allowNull: true, + comment: '所属行业', + }, + account_id: { + type: BIGINT(20), + allowNull: false, + comment: '关联账号ID(商家管理员)', + }, + status: { + type: TINYINT(4), + allowNull: false, + defaultValue: 2, + comment: '状态:0-禁用,1-启用,2-审核中', + }, + created_by: { + type: BIGINT(20), + allowNull: false, + comment: '创建人', + }, + created_at: { + type: DATE, + allowNull: false, + defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'), + comment: '创建时间', + }, + updated_at: { + type: DATE, + allowNull: false, + defaultValue: Sequelize.literal('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), + comment: '更新时间', + }, + is_warehouse: { + type: INTEGER(11), + allowNull: true, + defaultValue: 0, + comment: '是否为仓库:0-否,1-是', + }, + logo_url: { + type: STRING(255), + allowNull: true, + comment: 'logo链接', + }, + domain: { + type: STRING(100), + allowNull: true, + comment: '绑定域名', + }, + auth_start: { + type: DATE, + allowNull: true, + comment: '授权开始时间', + }, + auth_end: { + type: DATE, + allowNull: true, + comment: '授权结束时间', + }, + }, { + engine: 'InnoDB', + charset: 'utf8mb4', + collate: 'utf8mb4_unicode_ci', + comment: '商家信息表', + }); + + // 安全创建索引的函数 + const safeCreateIndex = async (tableName, fields, options) => { + const [ existingIndexes ] = await queryInterface.sequelize.query( + `SHOW INDEX FROM ${tableName} WHERE Key_name = '${options.name}'` + ); + if (existingIndexes.length === 0) { + await queryInterface.addIndex(tableName, fields, options); + } + }; + + // 添加唯一索引 + await safeCreateIndex('wms_store', [ 'company_name' ], { + name: 'uk_company_name', + unique: true, + }); + + await safeCreateIndex('wms_store', [ 'business_license' ], { + name: 'uk_business_license', + unique: true, + }); + + // 添加普通索引 + await safeCreateIndex('wms_store', [ 'status' ], { + name: 'idx_status', + }); + + await safeCreateIndex('wms_store', [ 'account_id' ], { + name: 'idx_account_id', + }); + + await safeCreateIndex('wms_store', [ 'store_name' ], { + name: 'idx_store_name', + }); + + await safeCreateIndex('wms_store', [ 'contact_phone' ], { + name: 'idx_contact_phone', + }); + + await safeCreateIndex('wms_store', [ 'is_warehouse' ], { + name: 'idx_is_warehouse', + }); + + await safeCreateIndex('wms_store', [ 'auth_end' ], { + name: 'idx_auth_end', + }); + + // 添加复合索引 + await safeCreateIndex('wms_store', [ 'status', 'is_warehouse' ], { + name: 'idx_status_warehouse', + }); + }, + + async down(queryInterface, Sequelize) { + // 安全删除表 + const [ tables ] = await queryInterface.sequelize.query( + "SHOW TABLES LIKE 'wms_store'" + ); + + if (tables.length > 0) { + await queryInterface.dropTable('wms_store'); + } + }, +}; diff --git a/database/migrations/20251110084033-create-wms-store-warehouse.js b/database/migrations/20251110084033-create-wms-store-warehouse.js new file mode 100644 index 0000000..36e1f33 --- /dev/null +++ b/database/migrations/20251110084033-create-wms-store-warehouse.js @@ -0,0 +1,198 @@ +'use strict'; + +module.exports = { + async up(queryInterface, Sequelize) { + const { BIGINT, TEXT, STRING, DATE, TINYINT } = Sequelize; + + // 先检查表是否存在,避免重复创建 + const [ tables ] = await queryInterface.sequelize.query( + "SHOW TABLES LIKE 'wms_store_warehouse'" + ); + + if (tables.length > 0) { + console.log('Table wms_store_warehouse already exists, skipping creation'); + return; + } + + await queryInterface.createTable('wms_store_warehouse', { + id: { + type: BIGINT(20), + primaryKey: true, + autoIncrement: true, + allowNull: false, + comment: '授权ID', + }, + store_id: { + type: BIGINT(20), + allowNull: false, + references: { + model: 'wms_store', + key: 'id', + }, + onUpdate: 'CASCADE', + onDelete: 'NO ACTION', + comment: '商家ID', + }, + warehouse_id: { + type: BIGINT(20), + allowNull: false, + references: { + model: 'wms_store', + key: 'id', + }, + onUpdate: 'CASCADE', + onDelete: 'NO ACTION', + comment: '仓库ID', + }, + auth_status: { + type: TINYINT(4), + allowNull: false, + defaultValue: 1, + comment: '授权状态:1-申请中,2-已通过,3-已拒绝,4-已解除,5-已过期', + }, + apply_reason: { + type: TEXT, + allowNull: true, + comment: '申请理由', + }, + review_comment: { + type: TEXT, + allowNull: true, + comment: '审核意见', + }, + apply_time: { + type: DATE, + allowNull: false, + defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'), + comment: '申请时间', + }, + review_time: { + type: DATE, + allowNull: true, + comment: '审核时间', + }, + auth_start: { + type: DATE, + allowNull: true, + comment: '授权开始日期', + }, + auth_end: { + type: DATE, + allowNull: true, + comment: '授权结束日期', + }, + actual_end: { + type: DATE, + allowNull: true, + comment: '实际结束时间', + }, + applied_by: { + type: BIGINT(20), + allowNull: false, + comment: '申请人', + }, + reviewed_by: { + type: BIGINT(20), + allowNull: true, + comment: '审核人', + }, + ended_by: { + type: BIGINT(20), + allowNull: true, + comment: '解除人', + }, + created_at: { + type: DATE, + allowNull: false, + defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'), + comment: '创建时间', + }, + updated_at: { + type: DATE, + allowNull: false, + defaultValue: Sequelize.literal('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), + comment: '更新时间', + }, + store_remask: { + type: STRING(50), + allowNull: true, + comment: '商家备注', + }, + warehouse_remask: { + type: STRING(50), + allowNull: true, + comment: '仓库备注', + }, + }, { + engine: 'InnoDB', + charset: 'utf8mb4', + collate: 'utf8mb4_general_ci', + comment: '商家仓库授权关系表', + }); + + // 安全创建索引的函数 + const safeCreateIndex = async (tableName, fields, options) => { + const [ existingIndexes ] = await queryInterface.sequelize.query( + `SHOW INDEX FROM ${tableName} WHERE Key_name = '${options.name}'` + ); + if (existingIndexes.length === 0) { + await queryInterface.addIndex(tableName, fields, options); + } + }; + + // 添加唯一索引 - 商家和仓库的组合唯一 + await safeCreateIndex('wms_store_warehouse', [ 'store_id', 'warehouse_id' ], { + name: 'uk_store_warehouse', + unique: true, + }); + + // 添加普通索引 + await safeCreateIndex('wms_store_warehouse', [ 'store_id' ], { + name: 'idx_store_id', + }); + + await safeCreateIndex('wms_store_warehouse', [ 'warehouse_id' ], { + name: 'idx_warehouse_id', + }); + + await safeCreateIndex('wms_store_warehouse', [ 'auth_status' ], { + name: 'idx_auth_status', + }); + + await safeCreateIndex('wms_store_warehouse', [ 'apply_time' ], { + name: 'idx_apply_time', + }); + + await safeCreateIndex('wms_store_warehouse', [ 'auth_start', 'auth_end' ], { + name: 'idx_auth_period', + }); + + await safeCreateIndex('wms_store_warehouse', [ 'applied_by' ], { + name: 'idx_applied_by', + }); + + await safeCreateIndex('wms_store_warehouse', [ 'reviewed_by' ], { + name: 'idx_reviewed_by', + }); + + await safeCreateIndex('wms_store_warehouse', [ 'auth_end' ], { + name: 'idx_auth_end', + }); + + // 添加复合索引用于常用查询 + await safeCreateIndex('wms_store_warehouse', [ 'auth_status', 'apply_time' ], { + name: 'idx_status_apply_time', + }); + }, + + async down(queryInterface, Sequelize) { + // 安全删除表 + const [ tables ] = await queryInterface.sequelize.query( + "SHOW TABLES LIKE 'wms_store_warehouse'" + ); + + if (tables.length > 0) { + await queryInterface.dropTable('wms_store_warehouse'); + } + }, +}; diff --git a/database/migrations/20251110090742-create-wms-interface-type.js b/database/migrations/20251110090742-create-wms-interface-type.js new file mode 100644 index 0000000..21a1571 --- /dev/null +++ b/database/migrations/20251110090742-create-wms-interface-type.js @@ -0,0 +1,121 @@ +'use strict'; + +module.exports = { + async up(queryInterface, Sequelize) { + const { INTEGER, STRING, TEXT, ENUM, TINYINT, DATE } = Sequelize; + + // 先检查表是否存在,避免重复创建 + const [ tables ] = await queryInterface.sequelize.query( + "SHOW TABLES LIKE 'wms_interface_type'" + ); + + if (tables.length > 0) { + console.log('Table wms_interface_type already exists, skipping creation'); + return; + } + + await queryInterface.createTable('wms_interface_type', { + id: { + type: INTEGER(10), + primaryKey: true, + autoIncrement: true, + allowNull: false, + comment: '接口类型ID', + }, + interface_code: { + type: STRING(100), + allowNull: false, + unique: true, + comment: '接口编码,唯一标识', + }, + interface_name: { + type: STRING(200), + allowNull: false, + comment: '接口名称', + }, + interface_category: { + type: ENUM('QM_WMS', 'OPEN_API'), + allowNull: false, + comment: '接口类别:QM_WMS-奇门仓储, OPEN_API-开放接口', + }, + entry_url: { + type: STRING(500), + allowNull: false, + comment: '入口链接', + }, + description: { + type: TEXT, + allowNull: true, + comment: '接口描述', + }, + is_enabled: { + type: TINYINT(1), + allowNull: false, + defaultValue: 1, + comment: '是否启用', + }, + created_at: { + type: DATE, + allowNull: false, + defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'), + comment: '创建时间', + }, + updated_at: { + type: DATE, + allowNull: false, + defaultValue: Sequelize.literal('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), + comment: '更新时间', + }, + }, { + engine: 'InnoDB', + charset: 'utf8mb4', + collate: 'utf8mb4_unicode_ci', + comment: '接口类型配置表', + }); + + // 安全创建索引的函数 + const safeCreateIndex = async (tableName, fields, options) => { + const [ existingIndexes ] = await queryInterface.sequelize.query( + `SHOW INDEX FROM ${tableName} WHERE Key_name = '${options.name}'` + ); + if (existingIndexes.length === 0) { + await queryInterface.addIndex(tableName, fields, options); + } + }; + + // 添加唯一索引 + await safeCreateIndex('wms_interface_type', [ 'interface_code' ], { + name: 'uk_interface_code', + unique: true, + }); + + // 添加普通索引 + await safeCreateIndex('wms_interface_type', [ 'interface_category' ], { + name: 'idx_interface_category', + }); + + await safeCreateIndex('wms_interface_type', [ 'is_enabled' ], { + name: 'idx_is_enabled', + }); + + await safeCreateIndex('wms_interface_type', [ 'interface_name' ], { + name: 'idx_interface_name', + }); + + // 添加复合索引 + await safeCreateIndex('wms_interface_type', [ 'interface_category', 'is_enabled' ], { + name: 'idx_category_enabled', + }); + }, + + async down(queryInterface, Sequelize) { + // 安全删除表 + const [ tables ] = await queryInterface.sequelize.query( + "SHOW TABLES LIKE 'wms_interface_type'" + ); + + if (tables.length > 0) { + await queryInterface.dropTable('wms_interface_type'); + } + }, +}; diff --git a/database/migrations/20251110091013-create-wms-api-app.js b/database/migrations/20251110091013-create-wms-api-app.js new file mode 100644 index 0000000..ec44d98 --- /dev/null +++ b/database/migrations/20251110091013-create-wms-api-app.js @@ -0,0 +1,220 @@ +'use strict'; + +module.exports = { + async up(queryInterface, Sequelize) { + const { BIGINT, STRING, INTEGER, JSON, TINYINT, DATE } = Sequelize; + + // 先检查表是否存在,避免重复创建 + const [ tables ] = await queryInterface.sequelize.query( + "SHOW TABLES LIKE 'wms_api_app'" + ); + + if (tables.length > 0) { + console.log('Table wms_api_app already exists, skipping creation'); + return; + } + + await queryInterface.createTable('wms_api_app', { + id: { + type: BIGINT(20), + primaryKey: true, + autoIncrement: true, + allowNull: false, + comment: '应用ID', + }, + app_name: { + type: STRING(200), + allowNull: false, + comment: '应用名称', + }, + interface_type_id: { + type: INTEGER(10), + allowNull: false, + references: { + model: 'wms_interface_type', + key: 'id', + }, + onUpdate: 'RESTRICT', + onDelete: 'RESTRICT', + comment: '接口类型ID', + }, + contract_id: { + type: BIGINT(20), + allowNull: true, + references: { + model: 'wms_store_warehouse', + key: 'id', + }, + onUpdate: 'RESTRICT', + onDelete: 'RESTRICT', + comment: '合约ID,关联wms_store_warehouse.id(货主接口使用)', + }, + warehouse_id: { + type: BIGINT(20), + allowNull: true, + comment: '仓库ID(仓库接口使用)', + }, + self_app_key: { + type: STRING(100), + allowNull: true, + unique: true, + comment: '自身AppKey(开放接口使用,系统生成)', + }, + self_app_secret: { + type: STRING(500), + allowNull: true, + comment: '自身AppSecret(开放接口使用,系统生成)', + }, + self_ip_whitelist: { + type: JSON, + allowNull: true, + comment: '自身IP白名单', + }, + qimen_app_key: { + type: STRING(100), + allowNull: true, + comment: '奇门对方AppKey', + }, + qimen_customer_id: { + type: STRING(100), + allowNull: true, + comment: '奇门客户ID', + }, + qimen_warehouse_code: { + type: STRING(100), + allowNull: true, + comment: '奇门仓库编码', + }, + api_version: { + type: STRING(50), + allowNull: true, + defaultValue: '1.0', + comment: 'API版本', + }, + sign_method: { + type: STRING(50), + allowNull: true, + defaultValue: 'md5', + comment: '签名方法', + }, + rate_limit: { + type: INTEGER(11), + allowNull: true, + defaultValue: 1000, + comment: '速率限制(次/分钟)', + }, + timeout_seconds: { + type: INTEGER(11), + allowNull: true, + defaultValue: 30, + comment: '超时时间(秒)', + }, + contact_person: { + type: STRING(100), + allowNull: true, + comment: '联系人', + }, + contact_phone: { + type: STRING(20), + allowNull: true, + comment: '联系电话', + }, + email: { + type: STRING(100), + allowNull: true, + comment: '邮箱', + }, + is_enabled: { + type: TINYINT(1), + allowNull: false, + defaultValue: 1, + comment: '是否启用', + }, + created_at: { + type: DATE, + allowNull: false, + defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'), + comment: '创建时间', + }, + updated_at: { + type: DATE, + allowNull: false, + defaultValue: Sequelize.literal('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), + comment: '更新时间', + }, + }, { + engine: 'InnoDB', + charset: 'utf8mb4', + collate: 'utf8mb4_unicode_ci', + comment: 'API应用配置表', + }); + + // 安全创建索引的函数 + const safeCreateIndex = async (tableName, fields, options) => { + const [ existingIndexes ] = await queryInterface.sequelize.query( + `SHOW INDEX FROM ${tableName} WHERE Key_name = '${options.name}'` + ); + if (existingIndexes.length === 0) { + await queryInterface.addIndex(tableName, fields, options); + } + }; + + // 添加唯一索引 + await safeCreateIndex('wms_api_app', [ 'app_name', 'interface_type_id' ], { + name: 'uk_app_name_interface', + unique: true, + }); + + await safeCreateIndex('wms_api_app', [ 'self_app_key' ], { + name: 'uk_self_app_key', + unique: true, + }); + + await safeCreateIndex('wms_api_app', [ 'qimen_app_key', 'qimen_customer_id' ], { + name: 'uk_interface_warehouse', + unique: true, + }); + + await safeCreateIndex('wms_api_app', [ 'interface_type_id', 'contract_id' ], { + name: 'uk_interface_contract', + unique: true, + }); + + // 添加普通索引 + await safeCreateIndex('wms_api_app', [ 'contract_id' ], { + name: 'fk_wms_api_app_contract', + }); + + await safeCreateIndex('wms_api_app', [ 'interface_type_id' ], { + name: 'idx_interface_type_id', + }); + + await safeCreateIndex('wms_api_app', [ 'warehouse_id' ], { + name: 'idx_warehouse_id', + }); + + await safeCreateIndex('wms_api_app', [ 'is_enabled' ], { + name: 'idx_is_enabled', + }); + + await safeCreateIndex('wms_api_app', [ 'created_at' ], { + name: 'idx_created_at', + }); + + // 添加复合索引 + await safeCreateIndex('wms_api_app', [ 'interface_type_id', 'is_enabled' ], { + name: 'idx_interface_enabled', + }); + }, + + async down(queryInterface, Sequelize) { + // 安全删除表 + const [ tables ] = await queryInterface.sequelize.query( + "SHOW TABLES LIKE 'wms_api_app'" + ); + + if (tables.length > 0) { + await queryInterface.dropTable('wms_api_app'); + } + }, +}; diff --git a/database/migrations/20251111083733-create-wms-stock-store.js b/database/migrations/20251111083733-create-wms-stock-store.js new file mode 100644 index 0000000..173353e --- /dev/null +++ b/database/migrations/20251111083733-create-wms-stock-store.js @@ -0,0 +1,298 @@ +// database/migrations/20241201000008-create-wms-stock-store.js +'use strict'; + +module.exports = { + async up(queryInterface, Sequelize) { + const { BIGINT, STRING, DECIMAL, INTEGER, DATE, ENUM, CHAR } = Sequelize; + + // 先检查表是否存在,避免重复创建 + const [ tables ] = await queryInterface.sequelize.query( + "SHOW TABLES LIKE 'wms_stock_store'" + ); + + if (tables.length > 0) { + console.log('Table wms_stock_store already exists, skipping creation'); + return; + } + + await queryInterface.createTable('wms_stock_store', { + id: { + type: BIGINT(20), + primaryKey: true, + autoIncrement: true, + allowNull: false, + comment: '库存商品ID', + }, + warehouse_code: { + type: BIGINT(20), + allowNull: false, + comment: '仓库编码', + }, + owner_code: { + type: STRING(50), + allowNull: false, + comment: '货主编码', + }, + app_key: { + type: STRING(50), + allowNull: true, + comment: '应用密钥', + }, + is_area_sale: { + type: CHAR(1), + allowNull: false, + defaultValue: 'N', + comment: '是否区域销售', + }, + item_code: { + type: STRING(50), + allowNull: false, + comment: '商品编码', + }, + goods_code: { + type: STRING(50), + allowNull: false, + comment: '货物编码', + }, + item_name: { + type: STRING(255), + allowNull: false, + comment: '商品名称', + }, + sku_property: { + type: STRING(100), + allowNull: true, + comment: 'SKU规格', + }, + stock_unit: { + type: STRING(20), + allowNull: false, + comment: '库存单位', + }, + length: { + type: DECIMAL(10, 2), + allowNull: true, + defaultValue: 0.00, + comment: '长度', + }, + width: { + type: DECIMAL(10, 2), + allowNull: true, + defaultValue: 0.00, + comment: '宽度', + }, + height: { + type: DECIMAL(10, 2), + allowNull: true, + defaultValue: 0.00, + comment: '高度', + }, + volume: { + type: DECIMAL(10, 2), + allowNull: true, + defaultValue: 0.00, + comment: '体积', + }, + gross_weight: { + type: DECIMAL(10, 2), + allowNull: true, + defaultValue: 0.00, + comment: '毛重', + }, + net_weight: { + type: DECIMAL(10, 2), + allowNull: true, + defaultValue: 0.00, + comment: '净重', + }, + category_id: { + type: INTEGER(11), + allowNull: false, + comment: '分类ID', + }, + category_name: { + type: STRING(100), + allowNull: false, + comment: '分类名称', + }, + item_type: { + type: STRING(10), + allowNull: false, + comment: '商品类型', + }, + tag_price: { + type: DECIMAL(10, 2), + allowNull: true, + defaultValue: 0.00, + comment: '标价', + }, + retail_price: { + type: DECIMAL(10, 2), + allowNull: true, + defaultValue: 0.00, + comment: '零售价', + }, + is_sn_mgmt: { + type: CHAR(1), + allowNull: false, + defaultValue: 'N', + comment: '是否序列号管理', + }, + is_shelf_life_mgmt: { + type: CHAR(1), + allowNull: false, + defaultValue: 'N', + comment: '是否保质期管理', + }, + is_batch_mgmt: { + type: CHAR(1), + allowNull: false, + defaultValue: 'N', + comment: '是否批次管理', + }, + create_time: { + type: DATE, + allowNull: false, + comment: '创建时间', + }, + update_time: { + type: DATE, + allowNull: false, + defaultValue: Sequelize.literal('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), + comment: '更新时间', + }, + is_valid: { + type: CHAR(1), + allowNull: false, + defaultValue: 'Y', + comment: '是否有效', + }, + barcode: { + type: STRING(255), + allowNull: true, + comment: '条形码', + }, + stock_id: { + type: BIGINT(20), + allowNull: true, + comment: '库存ID', + }, + warehouse_id: { + type: BIGINT(20), + allowNull: false, + references: { + model: 'wms_store', + key: 'id', + }, + onUpdate: 'RESTRICT', + onDelete: 'NO ACTION', + comment: '仓库ID', + }, + store_id: { + type: BIGINT(20), + allowNull: false, + references: { + model: 'wms_store', + key: 'id', + }, + onUpdate: 'RESTRICT', + onDelete: 'NO ACTION', + comment: '商家ID', + }, + create_from: { + type: ENUM('qimen', 'api'), + allowNull: true, + comment: '创建来源', + }, + delete_at: { + type: DATE, + allowNull: true, + comment: '删除时间', + }, + }, { + engine: 'InnoDB', + charset: 'utf8mb4', + collate: 'utf8mb4_unicode_ci', + comment: '库存商品信息表', + }); + + // 安全创建索引的函数 + const safeCreateIndex = async (tableName, fields, options) => { + const [ existingIndexes ] = await queryInterface.sequelize.query( + `SHOW INDEX FROM ${tableName} WHERE Key_name = '${options.name}'` + ); + if (existingIndexes.length === 0) { + await queryInterface.addIndex(tableName, fields, options); + } + }; + + // 添加唯一索引 + await safeCreateIndex('wms_stock_store', [ + 'warehouse_code', 'owner_code', 'item_code', 'app_key', 'warehouse_id', 'store_id', + ], { + name: 'uk_warehouse_owner_item', + unique: true, + }); + + // 添加普通索引 + await safeCreateIndex('wms_stock_store', [ 'owner_code' ], { + name: 'idx_owner_code', + }); + + await safeCreateIndex('wms_stock_store', [ 'goods_code' ], { + name: 'idx_goods_code', + }); + + await safeCreateIndex('wms_stock_store', [ 'category_id' ], { + name: 'idx_category_id', + }); + + await safeCreateIndex('wms_stock_store', [ 'create_time' ], { + name: 'idx_create_time', + }); + + await safeCreateIndex('wms_stock_store', [ 'is_valid' ], { + name: 'idx_is_valid', + }); + + await safeCreateIndex('wms_stock_store', [ 'item_code' ], { + name: 'uk_item_code', + }); + + await safeCreateIndex('wms_stock_store', [ 'warehouse_id' ], { + name: 'idx_warehouse_id', + }); + + await safeCreateIndex('wms_stock_store', [ 'store_id' ], { + name: 'idx_store_id', + }); + + await safeCreateIndex('wms_stock_store', [ 'barcode' ], { + name: 'idx_barcode', + }); + + // 添加复合索引 + await safeCreateIndex('wms_stock_store', [ 'warehouse_id', 'is_valid' ], { + name: 'idx_warehouse_valid', + }); + + await safeCreateIndex('wms_stock_store', [ 'store_id', 'is_valid' ], { + name: 'idx_store_valid', + }); + + await safeCreateIndex('wms_stock_store', [ 'item_code', 'is_valid' ], { + name: 'idx_item_valid', + }); + }, + + async down(queryInterface, Sequelize) { + // 安全删除表 + const [ tables ] = await queryInterface.sequelize.query( + "SHOW TABLES LIKE 'wms_stock_store'" + ); + + if (tables.length > 0) { + await queryInterface.dropTable('wms_stock_store'); + } + }, +}; diff --git a/database/migrations/20251112085825-create-wms-entry-order.js b/database/migrations/20251112085825-create-wms-entry-order.js new file mode 100644 index 0000000..72a6fed --- /dev/null +++ b/database/migrations/20251112085825-create-wms-entry-order.js @@ -0,0 +1,249 @@ +// database/migrations/20241201000009-create-wms-entry-order.js +'use strict'; + +module.exports = { + async up(queryInterface, Sequelize) { + const { BIGINT, STRING, INTEGER, DATE, ENUM, TEXT, TINYINT } = Sequelize; + + // 先检查表是否存在,避免重复创建 + const [ tables ] = await queryInterface.sequelize.query( + "SHOW TABLES LIKE 'wms_entry_order'" + ); + + if (tables.length > 0) { + console.log('Table wms_entry_order already exists, skipping creation'); + return; + } + + await queryInterface.createTable('wms_entry_order', { + id: { + type: BIGINT(20), + primaryKey: true, + autoIncrement: true, + allowNull: false, + comment: '入库单ID', + }, + entry_order_code: { + type: STRING(50), + allowNull: false, + comment: '入库单号', + }, + order_type: { + type: ENUM('SCRK', 'LYRK', 'CCRK', 'CGRK', 'DBRK', 'QTRK', 'B2BRK', 'XNRK'), + allowNull: false, + comment: '业务类型', + }, + purchase_order_code: { + type: STRING(50), + allowNull: true, + comment: '采购单号', + }, + total_order_lines: { + type: INTEGER(11), + allowNull: true, + defaultValue: 0, + comment: '单据总行数', + }, + order_create_time: { + type: DATE, + allowNull: true, + comment: '订单创建时间', + }, + expect_start_time: { + type: DATE, + allowNull: true, + comment: '预期到货时间', + }, + expect_end_time: { + type: DATE, + allowNull: true, + comment: '最迟预期到货时间', + }, + logistics_code: { + type: STRING(50), + allowNull: true, + comment: '物流公司编码', + }, + logistics_name: { + type: STRING(200), + allowNull: true, + comment: '物流公司名称', + }, + express_code: { + type: STRING(50), + allowNull: true, + comment: '运单号', + }, + supplier_code: { + type: STRING(50), + allowNull: true, + comment: '供应商编码', + }, + supplier_name: { + type: STRING(200), + allowNull: true, + comment: '供应商名称', + }, + source_type: { + type: ENUM('WMS', 'API', 'QM'), + allowNull: true, + defaultValue: 'API', + comment: '来源类型', + }, + order_status: { + type: ENUM('PENDING', 'CONFIRMED', 'PARTIAL_RECEIVED', 'COMPLETED', 'CANCELLED'), + allowNull: true, + defaultValue: 'PENDING', + comment: '订单状态', + }, + sync_status: { + type: ENUM('PENDING', 'SUCCESS', 'FAILED'), + allowNull: true, + defaultValue: 'PENDING', + comment: '同步状态', + }, + sync_message: { + type: TEXT, + allowNull: true, + comment: '同步返回信息', + }, + is_enabled: { + type: TINYINT(1), + allowNull: true, + defaultValue: 1, + comment: '是否启用', + }, + created_at: { + type: DATE, + allowNull: false, + defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'), + comment: '创建时间', + }, + updated_at: { + type: DATE, + allowNull: false, + defaultValue: Sequelize.literal('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), + comment: '更新时间', + }, + warehouse_id: { + type: BIGINT(20), + allowNull: false, + references: { + model: 'wms_store', + key: 'id', + }, + onUpdate: 'NO ACTION', + onDelete: 'NO ACTION', + comment: '仓库ID', + }, + store_id: { + type: BIGINT(20), + allowNull: false, + references: { + model: 'wms_store', + key: 'id', + }, + onUpdate: 'NO ACTION', + onDelete: 'NO ACTION', + comment: '货主ID', + }, + remark: { + type: STRING(500), + allowNull: true, + comment: 'ERP备注', + }, + store_name: { + type: STRING(200), + allowNull: true, + comment: '货主名称快照', + }, + warehouse_name: { + type: STRING(200), + allowNull: true, + comment: '仓库名称快照', + }, + }, { + engine: 'InnoDB', + charset: 'utf8mb4', + collate: 'utf8mb4_unicode_ci', + comment: '入库单主表', + }); + + // 安全创建索引的函数 + const safeCreateIndex = async (tableName, fields, options) => { + const [ existingIndexes ] = await queryInterface.sequelize.query( + `SHOW INDEX FROM ${tableName} WHERE Key_name = '${options.name}'` + ); + if (existingIndexes.length === 0) { + await queryInterface.addIndex(tableName, fields, options); + } + }; + + // 添加唯一索引 + await safeCreateIndex('wms_entry_order', [ 'entry_order_code', 'warehouse_id', 'store_id' ], { + name: 'uk_entry_order_code', + unique: true, + }); + + // 添加普通索引 + await safeCreateIndex('wms_entry_order', [ 'order_type' ], { + name: 'idx_order_type', + }); + + await safeCreateIndex('wms_entry_order', [ 'order_status' ], { + name: 'idx_order_status', + }); + + await safeCreateIndex('wms_entry_order', [ 'sync_status' ], { + name: 'idx_sync_status', + }); + + await safeCreateIndex('wms_entry_order', [ 'source_type' ], { + name: 'idx_source', + }); + + await safeCreateIndex('wms_entry_order', [ 'order_create_time' ], { + name: 'idx_create_time', + }); + + await safeCreateIndex('wms_entry_order', [ 'warehouse_id' ], { + name: 'wms_entry_order_ibfk_1', + }); + + await safeCreateIndex('wms_entry_order', [ 'store_id' ], { + name: 'wms_entry_order_ibfk_2', + }); + + await safeCreateIndex('wms_entry_order', [ 'purchase_order_code' ], { + name: 'idx_purchase_order', + }); + + await safeCreateIndex('wms_entry_order', [ 'supplier_code' ], { + name: 'idx_supplier_code', + }); + + // 添加复合索引 + await safeCreateIndex('wms_entry_order', [ 'warehouse_id', 'order_status' ], { + name: 'idx_warehouse_status', + }); + + await safeCreateIndex('wms_entry_order', [ 'store_id', 'order_status' ], { + name: 'idx_store_status', + }); + + await safeCreateIndex('wms_entry_order', [ 'order_create_time', 'order_status' ], { + name: 'idx_create_time_status', + }); + }, + + async down(queryInterface, Sequelize) { + // 安全删除表 + const [ tables ] = await queryInterface.sequelize.query( + "SHOW TABLES LIKE 'wms_entry_order'" + ); + + if (tables.length > 0) { + await queryInterface.dropTable('wms_entry_order'); + } + }, +}; diff --git a/database/migrations/20251112085844-create-wms-entry-items.js b/database/migrations/20251112085844-create-wms-entry-items.js new file mode 100644 index 0000000..d13fe01 --- /dev/null +++ b/database/migrations/20251112085844-create-wms-entry-items.js @@ -0,0 +1,151 @@ +// database/migrations/20241201000010-create-wms-entry-items.js +'use strict'; + +module.exports = { + async up(queryInterface, Sequelize) { + const { BIGINT, STRING, INTEGER } = Sequelize; + + // 先检查表是否存在,避免重复创建 + const [ tables ] = await queryInterface.sequelize.query( + "SHOW TABLES LIKE 'wms_entry_items'" + ); + + if (tables.length > 0) { + console.log('Table wms_entry_items already exists, skipping creation'); + return; + } + + await queryInterface.createTable('wms_entry_items', { + id: { + type: BIGINT(20), + primaryKey: true, + autoIncrement: true, + allowNull: false, + comment: '入库单明细ID', + }, + order_id: { + type: BIGINT(20), + allowNull: false, + references: { + model: 'wms_entry_order', + key: 'id', + }, + onUpdate: 'CASCADE', + onDelete: 'NO ACTION', + comment: '入库单ID', + }, + out_biz_code: { + type: STRING(255), + allowNull: true, + comment: '外部业务编码', + }, + order_line_no: { + type: INTEGER(12), + allowNull: true, + comment: '订单行号', + }, + owner_code: { + type: STRING(50), + allowNull: true, + comment: '货主编码', + }, + item_code: { + type: STRING(50), + allowNull: true, + comment: '商品编码', + }, + item_id: { + type: BIGINT(20), + allowNull: true, + comment: '商品ID', + }, + count: { + type: INTEGER(12), + allowNull: true, + comment: '数量', + }, + inventory_type: { + type: STRING(255), + allowNull: true, + comment: '库存类型', + }, + stock_id: { + type: BIGINT(20), + allowNull: true, + references: { + model: 'wms_stock_warehouse', + key: 'id', + }, + onUpdate: 'RESTRICT', + onDelete: 'NO ACTION', + comment: '库存ID', + }, + }, { + engine: 'InnoDB', + charset: 'utf8mb4', + collate: 'utf8mb4_general_ci', + comment: '入库单明细表', + }); + + // 安全创建索引的函数 + const safeCreateIndex = async (tableName, fields, options) => { + const [ existingIndexes ] = await queryInterface.sequelize.query( + `SHOW INDEX FROM ${tableName} WHERE Key_name = '${options.name}'` + ); + if (existingIndexes.length === 0) { + await queryInterface.addIndex(tableName, fields, options); + } + }; + + // 添加唯一索引 + await safeCreateIndex('wms_entry_items', [ 'order_id', 'out_biz_code' ], { + name: 'uk_order_out_biz', + unique: true, + }); + + // 添加普通索引 + await safeCreateIndex('wms_entry_items', [ 'stock_id' ], { + name: 'idx_stock_id', + }); + + await safeCreateIndex('wms_entry_items', [ 'order_id' ], { + name: 'idx_order_id', + }); + + await safeCreateIndex('wms_entry_items', [ 'item_code' ], { + name: 'idx_item_code', + }); + + await safeCreateIndex('wms_entry_items', [ 'item_id' ], { + name: 'idx_item_id', + }); + + await safeCreateIndex('wms_entry_items', [ 'owner_code' ], { + name: 'idx_owner_code', + }); + + await safeCreateIndex('wms_entry_items', [ 'order_line_no' ], { + name: 'idx_order_line_no', + }); + + // 添加复合索引 + await safeCreateIndex('wms_entry_items', [ 'order_id', 'item_code' ], { + name: 'idx_order_item', + }); + + await safeCreateIndex('wms_entry_items', [ 'order_id', 'order_line_no' ], { + name: 'idx_order_line', + }); + }, + + async down(queryInterface, Sequelize) { + // 安全删除表 + const [ tables ] = await queryInterface.sequelize.query( + "SHOW TABLES LIKE 'wms_entry_items'" + ); + + if (tables.length > 0) { + await queryInterface.dropTable('wms_entry_items'); + } + }, +}; diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 0000000..1bbed3f --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,5 @@ +{ + "include": [ + "**/*" + ] +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..05547a6 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,14945 @@ +{ + "name": "oms", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "oms", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "await-stream-ready": "^1.0.1", + "cos-js-sdk-v5": "^1.10.1", + "cos-nodejs-sdk-v5": "^2.15.4", + "crypto-js": "^4.2.0", + "egg": "^3.17.5", + "egg-cors": "^3.0.1", + "egg-jwt": "^3.1.7", + "egg-mysql": "^5.0.0", + "egg-redis": "^2.6.1", + "egg-scripts": "2", + "egg-sequelize": "^6.0.0", + "egg-view-ejs": "^3.0.0", + "ejs": "^5.0.1", + "fast-xml-parser": "^5.3.1", + "mysql2": "^3.15.3", + "path": "^0.12.7", + "qiniu-js": "^3.4.3", + "soap": "^1.8.0", + "spark-md5": "^3.0.2" + }, + "devDependencies": { + "egg-bin": "6", + "egg-mock": "5", + "eslint": "8", + "eslint-config-egg": "13", + "sequelize-cli": "^6.6.3" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@artus-cli/artus-cli": { + "version": "0.2.10", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@artus-cli/artus-cli/-/artus-cli-0.2.10.tgz", + "integrity": "sha512-DmNKs8JwOtQTIqnLxGbLMy7cur1OUzcEvPIYNdBZpF9dFib7sYJt2+c4cnNVH9j8VeGAHIwWFPX2MQhFpUjIKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@artus-cli/plugin-help": "^1.0.0", + "@artus-cli/plugin-version": "^1.0.0", + "@artus/core": "^1.0.0", + "@artus/injection": "^0.5.1", + "@artus/pipeline": "^0.2.2", + "command-line-usage": "^6.1.3", + "koa-compose": "^4.1.0", + "lodash": "^4.17.21", + "pkg-up": "^3.1.0", + "reflect-metadata": "^0.1.13", + "tslib": "^2.4.0", + "type-fest": "^3.4.0", + "yargs-parser": "^21.1.1" + } + }, + "node_modules/@artus-cli/plugin-autocomplete": { + "version": "0.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@artus-cli/plugin-autocomplete/-/plugin-autocomplete-0.1.1.tgz", + "integrity": "sha512-7xlYTRpD39HyAPMJ+NgIan8TsgvScuOWkAZP3pbmg2vzIi4QdEqpXoLRf86GwG3IUiUFQ2XIiCEcUz7Vb3Qejg==", + "dev": true, + "license": "MIT", + "dependencies": { + "inquirer": "^8.2.5", + "tslib": "^2.4.0", + "yargs-parser": "^21.1.1" + } + }, + "node_modules/@artus-cli/plugin-help": { + "version": "1.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@artus-cli/plugin-help/-/plugin-help-1.1.0.tgz", + "integrity": "sha512-N4r6yIag06fwq41ROeIe6Gy7Oq5ShdbwShUQhET/XFT/e505mf+GUb65R6jWGbofp2+8gAGh98YgBNqa7+cUwg==", + "dev": true, + "license": "MIT", + "dependencies": { + "command-line-usage": "^6.1.3", + "tslib": "^2.4.0" + } + }, + "node_modules/@artus-cli/plugin-version": { + "version": "1.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@artus-cli/plugin-version/-/plugin-version-1.0.2.tgz", + "integrity": "sha512-gD/nJAoYdF6XAho0fcMlbwiekmAsunwqq4R7BHKaq3f+qOWVFHqoAFWa05evxx+TUQHd3+18RrwxqJN6LydVhg==", + "dev": true, + "license": "MIT", + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@artus/core": { + "version": "1.0.9", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@artus/core/-/core-1.0.9.tgz", + "integrity": "sha512-6/jaSThVFhV9jLR98aJ4u4JSB3ObQ2wt54XGn4YfJsYt2OpPw2rD6/vQFeZtRoZ9CpTiLeKgNuz6Fe4EzYXbsQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@artus/injection": "^0.5.1", + "@artus/pipeline": "^0.2.2", + "deepmerge": "^4.2.2", + "minimatch": "^5.0.1" + }, + "peerDependencies": { + "reflect-metadata": "^0.1.13" + } + }, + "node_modules/@artus/injection": { + "version": "0.5.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@artus/injection/-/injection-0.5.3.tgz", + "integrity": "sha512-0/F6EWZhT4Ki5Y5ugIDEehPMj6NFguG5lD6Q0UynaLN76A7Hbs7Ooiu2VWioouzodx6vCW3bthZ7V6vj+5Daog==", + "dev": true, + "license": "ISC", + "dependencies": { + "tslib": "^2.6.2" + } + }, + "node_modules/@artus/pipeline": { + "version": "0.2.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@artus/pipeline/-/pipeline-0.2.3.tgz", + "integrity": "sha512-W4gBvkjD5bh7DScWn5DIdg3mRi93kabYCsOPTVN1sjtYVHlLX3xikyscdFphTjYlrmO4G+tP2lPH4pfBm3Sepg==", + "dev": true, + "license": "MIT", + "dependencies": { + "tslib": "^2.3.1" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.27.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.27.1", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.28.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@babel/compat-data/-/compat-data-7.28.5.tgz", + "integrity": "sha512-6uFXyCayocRbqhZOB+6XcuZbkMNimwfVGFji8CTZnCzOHVGvDqzvitu1re2AU5LROliz7eQPhB8CpAMvnx9EjA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.28.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@babel/core/-/core-7.28.5.tgz", + "integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/generator": "^7.28.5", + "@babel/helper-compilation-targets": "^7.27.2", + "@babel/helper-module-transforms": "^7.28.3", + "@babel/helpers": "^7.28.4", + "@babel/parser": "^7.28.5", + "@babel/template": "^7.27.2", + "@babel/traverse": "^7.28.5", + "@babel/types": "^7.28.5", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/eslint-parser": { + "version": "7.28.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@babel/eslint-parser/-/eslint-parser-7.28.5.tgz", + "integrity": "sha512-fcdRcWahONYo+JRnJg1/AekOacGvKx12Gu0qXJXFi2WBqQA1i7+O5PaxRB7kxE/Op94dExnCiiar6T09pvdHpA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nicolo-ribaudo/eslint-scope-5-internals": "5.1.1-v1", + "eslint-visitor-keys": "^2.1.0", + "semver": "^6.3.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || >=14.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.11.0", + "eslint": "^7.5.0 || ^8.0.0 || ^9.0.0" + } + }, + "node_modules/@babel/eslint-parser/node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=10" + } + }, + "node_modules/@babel/eslint-parser/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/generator": { + "version": "7.28.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@babel/generator/-/generator-7.28.5.tgz", + "integrity": "sha512-3EwLFhZ38J4VyIP6WNtt2kUdW9dokXA9Cr4IVIFHuCpZ3H8/YFOl5JjZHisrn1fATPBmKKqXzDFvh9fUwHz6CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.28.5", + "@babel/types": "^7.28.5", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.27.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.2.tgz", + "integrity": "sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.27.2", + "@babel/helper-validator-option": "^7.27.1", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-globals": { + "version": "7.28.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@babel/helper-globals/-/helper-globals-7.28.0.tgz", + "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.27.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@babel/helper-module-imports/-/helper-module-imports-7.27.1.tgz", + "integrity": "sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.27.1", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.28.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@babel/helper-module-transforms/-/helper-module-transforms-7.28.3.tgz", + "integrity": "sha512-gytXUbs8k2sXS9PnQptz5o0QnpLL51SwASIORY6XaBKF88nsOT0Zw9szLqlSGQDP/4TljBAD5y98p2U1fqkdsw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.27.1", + "@babel/helper-validator-identifier": "^7.27.1", + "@babel/traverse": "^7.28.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.27.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.28.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.27.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", + "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.28.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@babel/helpers/-/helpers-7.28.4.tgz", + "integrity": "sha512-HFN59MmQXGHVyYadKLVumYsA9dBFun/ldYxipEjzA4196jpLZd8UjEEBLkbEkvfYreDqJhZxYAWFPtrfhNpj4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.27.2", + "@babel/types": "^7.28.4" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.28.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@babel/parser/-/parser-7.28.5.tgz", + "integrity": "sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.5" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/runtime-corejs2": { + "version": "7.28.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@babel/runtime-corejs2/-/runtime-corejs2-7.28.4.tgz", + "integrity": "sha512-chjPHn3p+okNMesTjKU/pnpVT06oiJG1sVDJHTkAwYTCnVdM/2V5LI5xz3Y2y7MNngn8fQ19fpXjV3f9Jqun9w==", + "license": "MIT", + "dependencies": { + "core-js": "^2.6.12" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template": { + "version": "7.27.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@babel/template/-/template-7.27.2.tgz", + "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/parser": "^7.27.2", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.28.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@babel/traverse/-/traverse-7.28.5.tgz", + "integrity": "sha512-TCCj4t55U90khlYkVV/0TfkJkAkUg3jZFA3Neb7unZT8CPok7iiRfaX0F+WnqWqt7OxhOn0uBKXCw4lbL8W0aQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/generator": "^7.28.5", + "@babel/helper-globals": "^7.28.0", + "@babel/parser": "^7.28.5", + "@babel/template": "^7.27.2", + "@babel/types": "^7.28.5", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@babel/types": { + "version": "7.28.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@babel/types/-/types-7.28.5.tgz", + "integrity": "sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.28.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "1.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@bcoe/v8-coverage/-/v8-coverage-1.0.2.tgz", + "integrity": "sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@eggjs/ip": { + "version": "2.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@eggjs/ip/-/ip-2.1.0.tgz", + "integrity": "sha512-jOsufOpySKBld+N1GG8IAW9EEQNmQ6bDaBnrRlYFk6AspoxG8gAzXSW93ZFfEPwscS5rL7UbDUKyIHUkmkTPyw==", + "license": "MIT", + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/@eggjs/rds": { + "version": "1.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@eggjs/rds/-/rds-1.3.0.tgz", + "integrity": "sha512-MshrDFuP18G30Zt1U0NcxHFmFEfi6LDXOUDAJ5Qvf4rn6PDzZ8U0kvp/C8tHeWA2RK3rIDGRqWlqvAzwwdGpFA==", + "license": "MIT", + "dependencies": { + "mysql2": "^3.9.1", + "sqlstring": "^2.3.3" + }, + "engines": { + "node": ">= 16.17.0" + } + }, + "node_modules/@eggjs/router": { + "version": "2.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@eggjs/router/-/router-2.2.0.tgz", + "integrity": "sha512-EKnOrZ/pHMFQ1gAj3z0Yn1UnGYH/wSsc2jk06H6RrZp6ty9H6RWyP782e7FT8WL3pAevRY+SAQoH7aPh1SDSVA==", + "license": "MIT", + "dependencies": { + "co": "^4.6.0", + "http-errors": "^1.3.1", + "inflection": "^1.12.0", + "koa-compose": "^3.0.0", + "koa-convert": "^1.2.0", + "methods": "^1.0.1", + "path-to-regexp": "^1.9.0", + "urijs": "^1.19.0", + "utility": "^1.15.0" + }, + "engines": { + "node": ">= 8.5.0" + } + }, + "node_modules/@eggjs/router/node_modules/koa-compose": { + "version": "3.2.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/koa-compose/-/koa-compose-3.2.1.tgz", + "integrity": "sha512-8gen2cvKHIZ35eDEik5WOo8zbVp9t4cP8p4hW4uE55waxolLRexKKrqfCpwhGVppnB40jWeF8bZeTVg99eZgPw==", + "license": "MIT", + "dependencies": { + "any-promise": "^1.1.0" + } + }, + "node_modules/@eggjs/router/node_modules/utility": { + "version": "1.18.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/utility/-/utility-1.18.0.tgz", + "integrity": "sha512-PYxZDA+6QtvRvm//++aGdmKG/cI07jNwbROz0Ql+VzFV1+Z0Dy55NI4zZ7RHc9KKpBePNFwoErqIuqQv/cjiTA==", + "license": "MIT", + "dependencies": { + "copy-to": "^2.0.1", + "escape-html": "^1.0.3", + "mkdirp": "^0.5.1", + "mz": "^2.7.0", + "unescape": "^1.0.1" + }, + "engines": { + "node": ">= 0.12.0" + } + }, + "node_modules/@eggjs/utils": { + "version": "4.4.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@eggjs/utils/-/utils-4.4.1.tgz", + "integrity": "sha512-/bu4ORRNSLSjrQQ4KDBgtyF92EmgmtdgjoXBIhBexxEqoV5Tg6kX4xdcG42cw+Cq3WBnUq/PzSthEPHbSlkQgg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@es-joy/jsdoccomment": { + "version": "0.41.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@es-joy/jsdoccomment/-/jsdoccomment-0.41.0.tgz", + "integrity": "sha512-aKUhyn1QI5Ksbqcr3fFJj16p99QdjUxXAEuFst1Z47DRyoiMwivIH9MV/ARcJOCXVjPfjITciej8ZD2O/6qUmw==", + "dev": true, + "license": "MIT", + "dependencies": { + "comment-parser": "1.4.1", + "esquery": "^1.5.0", + "jsdoc-type-pratt-parser": "~4.0.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.9.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz", + "integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/eslintrc/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@eslint/eslintrc/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@eslint/js": { + "version": "8.57.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@eslint/js/-/js-8.57.1.tgz", + "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@fastify/busboy": { + "version": "2.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@fastify/busboy/-/busboy-2.1.1.tgz", + "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/@hapi/bourne": { + "version": "3.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@hapi/bourne/-/bourne-3.0.0.tgz", + "integrity": "sha512-Waj1cwPXJDucOib4a3bAISsKJVb15MKi9IvmTI/7ssVEm6sywXGjVJDhl6/umt1pK1ZS7PacXU3A1PmFKHEZ2w==", + "license": "BSD-3-Clause" + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.13.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", + "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", + "deprecated": "Use @eslint/config-array instead", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.3", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", + "deprecated": "Use @eslint/object-schema instead", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@inquirer/external-editor": { + "version": "1.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@inquirer/external-editor/-/external-editor-1.0.2.tgz", + "integrity": "sha512-yy9cOoBnx58TlsPrIxauKIFQTiyH+0MK4e97y4sV9ERbI+zDxw7i2hxHLCIEGIE/8PPvDxGhgzIOTSOWcs6/MQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "chardet": "^2.1.0", + "iconv-lite": "^0.7.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@inquirer/external-editor/node_modules/iconv-lite": { + "version": "0.7.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/iconv-lite/-/iconv-lite-0.7.0.tgz", + "integrity": "sha512-cf6L2Ds3h57VVmkZe+Pn+5APsT7FpqJtEhhieDCvrE2MK5Qk9MyffgQyuxQTm6BChfeZNtcOLHp9IcWRVcIcBQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/@ioredis/commands": { + "version": "1.5.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@ioredis/commands/-/commands-1.5.0.tgz", + "integrity": "sha512-eUgLqrMf8nJkZxT24JvVRrQya1vZkQh8BBeYNwGDqa5I0VUi8ACx7uFvAaLxintokpTenkK6DASvo/bvNbBGow==", + "license": "MIT" + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/types": { + "version": "29.6.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/types/node_modules/@types/yargs": { + "version": "17.0.34", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/yargs/-/yargs-17.0.34.tgz", + "integrity": "sha512-KExbHVa92aJpw9WDQvzBaGVE2/Pz+pLZQloT2hjL8IqsZnV62rlPOYvNnLmf/L2dyllfVUOVBj64M0z/46eR2A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@jest/types/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@jest/types/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jest/types/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@jest/types/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jest/types/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/types/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@koa/cors": { + "version": "5.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@koa/cors/-/cors-5.0.0.tgz", + "integrity": "sha512-x/iUDjcS90W69PryLDIMgFyV21YLTnG9zOpPXS7Bkt2b8AsY3zZsIpOLBkYr9fBcF3HbkKaER5hOBZLfpLgYNw==", + "license": "MIT", + "dependencies": { + "vary": "^1.1.2" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/@nicolo-ribaudo/eslint-scope-5-internals": { + "version": "5.1.1-v1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz", + "integrity": "sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-scope": "5.1.1" + } + }, + "node_modules/@nicolo-ribaudo/eslint-scope-5-internals/node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@nicolo-ribaudo/eslint-scope-5-internals/node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/@noble/hashes": { + "version": "1.8.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@noble/hashes/-/hashes-1.8.0.tgz", + "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==", + "license": "MIT", + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@one-ini/wasm": { + "version": "0.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@one-ini/wasm/-/wasm-0.1.1.tgz", + "integrity": "sha512-XuySG1E38YScSJoMlqovLru4KTUNSjgVTIjyh7qMX6aNN5HY5Ct5LhRJdxO79JtTzKfzV/bnWpz+zquYrISsvw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@paralleldrive/cuid2": { + "version": "2.3.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@paralleldrive/cuid2/-/cuid2-2.3.1.tgz", + "integrity": "sha512-XO7cAxhnTZl0Yggq6jOgjiOHhbgcO4NqFqwSmQpjK3b6TEE6Uj/jfSk6wzYyemh3+I0sHirKSetjQwn5cZktFw==", + "license": "MIT", + "dependencies": { + "@noble/hashes": "^1.1.5" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@rtsao/scc": { + "version": "1.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@rtsao/scc/-/scc-1.1.0.tgz", + "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", + "dev": true, + "license": "MIT" + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.11", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@tsconfig/node10/-/node10-1.0.11.tgz", + "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/accepts": { + "version": "1.3.7", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Pay9fq2lM2wXPWbteBsRAGiWH2hig4ZE2asK+mm7kUzlxRTfL961rj89I6zV/E3PcIkDqyuBEcMxFT7rccugeQ==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/bluebird": { + "version": "3.5.42", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/bluebird/-/bluebird-3.5.42.tgz", + "integrity": "sha512-Jhy+MWRlro6UjVi578V/4ZGNfeCOcNCp0YaFNIUGFKlImowqwb1O/22wDVk3FDGMLqxdpOV3qQHD5fPEH4hK6A==", + "license": "MIT" + }, + "node_modules/@types/body-parser": { + "version": "1.19.6", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/body-parser/-/body-parser-1.19.6.tgz", + "integrity": "sha512-HLFeCYgz89uk22N5Qg3dvGvsv46B8GLvKKo1zKG4NybA8U2DiEO3w9lqGg29t/tfLRJpJ6iQxnVw4OnB7MoM9g==", + "license": "MIT", + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "node_modules/@types/connect": { + "version": "3.4.38", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/content-disposition": { + "version": "0.5.9", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/content-disposition/-/content-disposition-0.5.9.tgz", + "integrity": "sha512-8uYXI3Gw35MhiVYhG3s295oihrxRyytcRHjSjqnqZVDDy/xcGBRny7+Xj1Wgfhv5QzRtN2hB2dVRBUX9XW3UcQ==", + "license": "MIT" + }, + "node_modules/@types/continuation-local-storage": { + "version": "3.2.7", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/continuation-local-storage/-/continuation-local-storage-3.2.7.tgz", + "integrity": "sha512-Q7dPOymVpRG5Zpz90/o26+OAqOG2Sw+FED7uQmTrJNCF/JAPTylclZofMxZKd6W7g1BDPmT9/C/jX0ZcSNTQwQ==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/cookiejar": { + "version": "2.1.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/cookiejar/-/cookiejar-2.1.5.tgz", + "integrity": "sha512-he+DHOWReW0nghN24E1WUqM0efK4kI9oTqDm6XmK8ZPe2djZ90BSNdGnIyCLzCPw7/pogPlGbzI2wHGGmi4O/Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/cookies": { + "version": "0.9.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/cookies/-/cookies-0.9.2.tgz", + "integrity": "sha512-1AvkDdZM2dbyFybL4fxpuNCaWyv//0AwsuUk2DWeXyM1/5ZKm6W3z6mQi24RZ4l2ucY+bkSHzbDVpySqPGuV8A==", + "license": "MIT", + "dependencies": { + "@types/connect": "*", + "@types/express": "*", + "@types/keygrip": "*", + "@types/node": "*" + } + }, + "node_modules/@types/dargs": { + "version": "5.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/dargs/-/dargs-5.1.0.tgz", + "integrity": "sha512-2cXlO8pz13kVYMp6Zgr8Z5DACbaGfoBp7svqZqPGcO+qG3LQLWdB5BzPPASj+UI447XxGmFHi6KjLgUB0fzucQ==", + "license": "MIT" + }, + "node_modules/@types/debug": { + "version": "4.1.12", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/debug/-/debug-4.1.12.tgz", + "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", + "license": "MIT", + "dependencies": { + "@types/ms": "*" + } + }, + "node_modules/@types/depd": { + "version": "1.1.37", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/depd/-/depd-1.1.37.tgz", + "integrity": "sha512-PkEYFHnqDFgs+bJXJX0L8mq7sn3DWh+TP0m8BBJUJfZ2WcjRm7jd7Cq68jIJt+c31R1gX0cwSK1ZXOECvN97Rg==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/express": { + "version": "5.0.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/express/-/express-5.0.5.tgz", + "integrity": "sha512-LuIQOcb6UmnF7C1PCFmEU1u2hmiHL43fgFQX67sN3H4Z+0Yk0Neo++mFsBjhOAuLzvlQeqAAkeDOZrJs9rzumQ==", + "license": "MIT", + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^5.0.0", + "@types/serve-static": "^1" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "5.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/express-serve-static-core/-/express-serve-static-core-5.1.0.tgz", + "integrity": "sha512-jnHMsrd0Mwa9Cf4IdOzbz543y4XJepXrbia2T4b6+spXC2We3t1y6K44D3mR8XMFSXMCf3/l7rCgddfx7UNVBA==", + "license": "MIT", + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*", + "@types/send": "*" + } + }, + "node_modules/@types/http-assert": { + "version": "1.5.6", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/http-assert/-/http-assert-1.5.6.tgz", + "integrity": "sha512-TTEwmtjgVbYAzZYWyeHPrrtWnfVkm8tQkP8P21uQifPgMRgjrow3XDEYqucuC8SKZJT7pUnhU/JymvjggxO9vw==", + "license": "MIT" + }, + "node_modules/@types/http-errors": { + "version": "2.0.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/http-errors/-/http-errors-2.0.5.tgz", + "integrity": "sha512-r8Tayk8HJnX0FztbZN7oVqGccWgw98T/0neJphO91KkmOzug1KkofZURD4UaD5uH8AqcFLfdPErnBod0u71/qg==", + "license": "MIT" + }, + "node_modules/@types/ioredis": { + "version": "4.28.10", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/ioredis/-/ioredis-4.28.10.tgz", + "integrity": "sha512-69LyhUgrXdgcNDv7ogs1qXZomnfOEnSmrmMFqKgt1XMJxmoOSG/u3wYy13yACIfKuMJ8IhKgHafDO3sx19zVQQ==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.6", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/istanbul-lib-report": { + "version": "3.0.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", + "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/istanbul-lib-coverage": "*" + } + }, + "node_modules/@types/istanbul-reports": { + "version": "3.0.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", + "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/istanbul-lib-report": "*" + } + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json5": { + "version": "0.0.29", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/keygrip": { + "version": "1.0.6", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/keygrip/-/keygrip-1.0.6.tgz", + "integrity": "sha512-lZuNAY9xeJt7Bx4t4dx0rYCDqGPW8RXhQZK1td7d4H6E9zYbLoOtjBvfwdTKpsyxQI/2jv+armjX/RW+ZNpXOQ==", + "license": "MIT" + }, + "node_modules/@types/koa": { + "version": "2.15.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/koa/-/koa-2.15.0.tgz", + "integrity": "sha512-7QFsywoE5URbuVnG3loe03QXuGajrnotr3gQkXcEBShORai23MePfFYdhz90FEtBBpkyIYQbVD+evKtloCgX3g==", + "license": "MIT", + "dependencies": { + "@types/accepts": "*", + "@types/content-disposition": "*", + "@types/cookies": "*", + "@types/http-assert": "*", + "@types/http-errors": "*", + "@types/keygrip": "*", + "@types/koa-compose": "*", + "@types/node": "*" + } + }, + "node_modules/@types/koa-compose": { + "version": "3.2.9", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/koa-compose/-/koa-compose-3.2.9.tgz", + "integrity": "sha512-BroAZ9FTvPiCy0Pi8tjD1OfJ7bgU1gQf0eR6e1Vm+JJATy9eKOG3hQMFtMciMawiSOVnLMdmUOC46s7HBhSTsA==", + "license": "MIT", + "dependencies": { + "@types/koa": "*" + } + }, + "node_modules/@types/koa-router": { + "version": "7.4.9", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/koa-router/-/koa-router-7.4.9.tgz", + "integrity": "sha512-YibkqJrFWwwF55YtZo6dORpMj/1zfweHHIZA/qpA+2JPcVbBopAvLjejTcO1ojWAJfzf1tPC+CrPnLDuVRkUEA==", + "license": "MIT", + "dependencies": { + "@types/koa": "*" + } + }, + "node_modules/@types/lodash": { + "version": "4.17.20", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-H3MHACvFUEiujabxhaI/ImO6gUrd8oOurg7LQtS7mbwIXA/cUqWrvBsaeJ23aZEPk1TAYkurjfMbSELfoCXlGA==", + "license": "MIT" + }, + "node_modules/@types/methods": { + "version": "1.1.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/methods/-/methods-1.1.4.tgz", + "integrity": "sha512-ymXWVrDiCxTBE3+RIrrP533E70eA+9qu7zdWoHuOmGujkYtzf4HQF96b8nwHLqhuf4ykX61IGRIB38CC6/sImQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/mime": { + "version": "1.3.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/mime/-/mime-1.3.5.tgz", + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "license": "MIT" + }, + "node_modules/@types/minimatch": { + "version": "3.0.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==", + "license": "MIT" + }, + "node_modules/@types/ms": { + "version": "2.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/ms/-/ms-2.1.0.tgz", + "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "24.10.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/node/-/node-24.10.0.tgz", + "integrity": "sha512-qzQZRBqkFsYyaSWXuEHc2WR9c0a0CXwiE5FWUvn7ZM+vdy1uZLfCunD38UzhuB7YN/J11ndbDBcTmOdxJo9Q7A==", + "license": "MIT", + "dependencies": { + "undici-types": "~7.16.0" + } + }, + "node_modules/@types/qs": { + "version": "6.14.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/qs/-/qs-6.14.0.tgz", + "integrity": "sha512-eOunJqu0K1923aExK6y8p6fsihYEn/BYuQ4g0CxAAgFc4b/ZLN4CrsRZ55srTdqoiLzU2B2evC+apEIxprEzkQ==", + "license": "MIT" + }, + "node_modules/@types/range-parser": { + "version": "1.2.7", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "license": "MIT" + }, + "node_modules/@types/semver": { + "version": "7.7.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-FmgJfu+MOcQ370SD0ev7EI8TlCAfKYU+B4m5T3yXc1CiRN94g/SZPtsCkk506aUDtlMnFZvasDwHHUcZUEaYuA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/send": { + "version": "1.2.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/send/-/send-1.2.1.tgz", + "integrity": "sha512-arsCikDvlU99zl1g69TcAB3mzZPpxgw0UQnaHeC1Nwb015xp8bknZv5rIfri9xTOcMuaVgvabfIRA7PSZVuZIQ==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/sequelize": { + "version": "4.28.20", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/sequelize/-/sequelize-4.28.20.tgz", + "integrity": "sha512-XaGOKRhdizC87hDgQ0u3btxzbejlF+t6Hhvkek1HyphqCI4y7zVBIVAGmuc4cWJqGpxusZ1RiBToHHnNK/Edlw==", + "license": "MIT", + "dependencies": { + "@types/bluebird": "*", + "@types/continuation-local-storage": "*", + "@types/lodash": "*", + "@types/validator": "*" + } + }, + "node_modules/@types/serve-static": { + "version": "1.15.10", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/serve-static/-/serve-static-1.15.10.tgz", + "integrity": "sha512-tRs1dB+g8Itk72rlSI2ZrW6vZg0YrLI81iQSTkMmOqnqCaNr/8Ek4VwWcN5vZgCYWbg/JJSGBlUaYGAOP73qBw==", + "license": "MIT", + "dependencies": { + "@types/http-errors": "*", + "@types/node": "*", + "@types/send": "<1" + } + }, + "node_modules/@types/serve-static/node_modules/@types/send": { + "version": "0.17.6", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/send/-/send-0.17.6.tgz", + "integrity": "sha512-Uqt8rPBE8SY0RK8JB1EzVOIZ32uqy8HwdxCnoCOsYrvnswqmFZ/k+9Ikidlk/ImhsdvBsloHbAlewb2IEBV/Og==", + "license": "MIT", + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, + "node_modules/@types/superagent": { + "version": "8.1.9", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/superagent/-/superagent-8.1.9.tgz", + "integrity": "sha512-pTVjI73witn+9ILmoJdajHGW2jkSaOzhiFYF1Rd3EQ94kymLqB9PjD9ISg7WaALC7+dCHT0FGe9T2LktLq/3GQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/cookiejar": "^2.1.5", + "@types/methods": "^1.1.4", + "@types/node": "*", + "form-data": "^4.0.0" + } + }, + "node_modules/@types/supertest": { + "version": "2.0.16", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/supertest/-/supertest-2.0.16.tgz", + "integrity": "sha512-6c2ogktZ06tr2ENoZivgm7YnprnhYE4ZoXGMY+oA7IuAf17M8FWvujXZGmxLv8y0PTyts4x5A+erSwVUFA8XSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/superagent": "*" + } + }, + "node_modules/@types/validator": { + "version": "13.15.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/validator/-/validator-13.15.4.tgz", + "integrity": "sha512-LSFfpSnJJY9wbC0LQxgvfb+ynbHftFo0tMsFOl/J4wexLnYMmDSPaj2ZyDv3TkfL1UePxPrxOWJfbiRS8mQv7A==", + "license": "MIT" + }, + "node_modules/@types/yargs": { + "version": "12.0.20", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/yargs/-/yargs-12.0.20.tgz", + "integrity": "sha512-MjOKUoDmNattFOBJvAZng7X9KXIKSGy6XHoXY9mASkKwCn35X4Ckh+Ugv1DewXZXrWYXMNtLiXhlCfWlpcAV+Q==", + "license": "MIT" + }, + "node_modules/@types/yargs-parser": { + "version": "21.0.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", + "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "6.21.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz", + "integrity": "sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/type-utils": "6.21.0", + "@typescript-eslint/utils": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { + "version": "7.7.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "6.21.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@typescript-eslint/parser/-/parser-6.21.0.tgz", + "integrity": "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/typescript-estree": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "6.21.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", + "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "6.21.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz", + "integrity": "sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/typescript-estree": "6.21.0", + "@typescript-eslint/utils": "6.21.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/type-utils/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "6.21.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@typescript-eslint/types/-/types-6.21.0.tgz", + "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "6.21.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", + "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "9.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { + "version": "7.7.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "6.21.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@typescript-eslint/utils/-/utils-6.21.0.tgz", + "integrity": "sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/typescript-estree": "6.21.0", + "semver": "^7.5.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/semver": { + "version": "7.7.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "6.21.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", + "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", + "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", + "dev": true, + "license": "ISC" + }, + "node_modules/@xmldom/is-dom-node": { + "version": "1.0.1", + "resolved": "https://mirrors.cloud.tencent.com/npm/@xmldom/is-dom-node/-/is-dom-node-1.0.1.tgz", + "integrity": "sha512-CJDxIgE5I0FH+ttq/Fxy6nRpxP70+e2O048EPe85J2use3XKdatVM7dDVvFNjQudd9B49NPoZ+8PG49zj4Er8Q==", + "license": "MIT", + "engines": { + "node": ">= 16" + } + }, + "node_modules/@xmldom/xmldom": { + "version": "0.8.11", + "resolved": "https://mirrors.cloud.tencent.com/npm/@xmldom/xmldom/-/xmldom-0.8.11.tgz", + "integrity": "sha512-cQzWCtO6C8TQiYl1ruKNn2U6Ao4o4WBBcbL61yJl84x+j5sOWWFU9X7DpND8XZG3daDppSsigMdfAIl2upQBRw==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/abbrev": { + "version": "2.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/abbrev/-/abbrev-2.0.0.tgz", + "integrity": "sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "license": "MIT", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/acorn": { + "version": "8.15.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.3.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/acorn-walk/-/acorn-walk-8.3.4.tgz", + "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.11.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/address": { + "version": "2.0.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/address/-/address-2.0.3.tgz", + "integrity": "sha512-XNAb/a6TCqou+TufU8/u11HCu9x1gYvOoxLwtlXgIqmkrYQADVv6ljyW2zwiPhHz9R1gItAWpuDrdJMmrOBFEA==", + "license": "MIT", + "engines": { + "node": ">= 16.0.0" + } + }, + "node_modules/agentkeepalive": { + "version": "4.6.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/agentkeepalive/-/agentkeepalive-4.6.0.tgz", + "integrity": "sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==", + "license": "MIT", + "dependencies": { + "humanize-ms": "^1.2.1" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats": { + "version": "1.6.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ajv-formats/-/ajv-formats-1.6.1.tgz", + "integrity": "sha512-4CjkH20If1lhR5CGtqkrVg3bbOtFEG80X9v6jDOIUhbzzbB+UzPBGy8GQhUNVZ0yvMHdMpawCOcy5ydGMsagGQ==", + "license": "MIT", + "dependencies": { + "ajv": "^7.0.0" + }, + "peerDependencies": { + "ajv": "^7.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/ajv-formats/node_modules/ajv": { + "version": "7.2.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ajv/-/ajv-7.2.4.tgz", + "integrity": "sha512-nBeQgg/ZZA3u3SYxyaDvpvDtgZ/EZPF547ARgZBrG9Bhu1vKDwAIjtIf+sDtJUKa2zOcEbmRLBRSyMraS/Oy1A==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "license": "MIT" + }, + "node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "license": "MIT", + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "license": "MIT" + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/are-docs-informative": { + "version": "0.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/are-docs-informative/-/are-docs-informative-0.0.2.tgz", + "integrity": "sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true, + "license": "MIT" + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/aria-query": { + "version": "5.3.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/aria-query/-/aria-query-5.3.2.tgz", + "integrity": "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/array-back": { + "version": "4.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/array-back/-/array-back-4.0.2.tgz", + "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", + "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "is-array-buffer": "^3.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-differ": { + "version": "3.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/array-differ/-/array-differ-3.0.0.tgz", + "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/array-includes": { + "version": "3.1.9", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/array-includes/-/array-includes-3.1.9.tgz", + "integrity": "sha512-FmeCCAenzH0KH381SPT5FZmiA/TmpndpcaShhfgEN9eCVjnFBqq3l1xrI42y8+PPLI6hypzou4GXw00WHmPBLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.24.0", + "es-object-atoms": "^1.1.1", + "get-intrinsic": "^1.3.0", + "is-string": "^1.1.1", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/array.prototype.findlast": { + "version": "1.2.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/array.prototype.findlast/-/array.prototype.findlast-1.2.5.tgz", + "integrity": "sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.findlastindex": { + "version": "1.2.6", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.6.tgz", + "integrity": "sha512-F/TKATkzseUExPlfvmwQKGITM3DGTK+vkAsCZoDc5daVygbJBnjEUCbgkAvVFsgfXfX4YIqZ/27G3k3tdXrTxQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.9", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "es-shim-unscopables": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flat": { + "version": "1.3.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/array.prototype.flat/-/array.prototype.flat-1.3.3.tgz", + "integrity": "sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flatmap": { + "version": "1.3.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/array.prototype.flatmap/-/array.prototype.flatmap-1.3.3.tgz", + "integrity": "sha512-Y7Wt51eKJSyi80hFrJCePGGNo5ktJCslFuboqJsbf57CCPcm5zztluPlc4/aD8sWsKvlwatezpV4U1efk8kpjg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.tosorted": { + "version": "1.1.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/array.prototype.tosorted/-/array.prototype.tosorted-1.1.4.tgz", + "integrity": "sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.3", + "es-errors": "^1.3.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz", + "integrity": "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/arrify": { + "version": "2.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/asap": { + "version": "2.0.6", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/asap/-/asap-2.0.6.tgz", + "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", + "license": "MIT" + }, + "node_modules/asn1": { + "version": "0.2.6", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/asn1/-/asn1-0.2.6.tgz", + "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", + "license": "MIT", + "dependencies": { + "safer-buffer": "~2.1.0" + } + }, + "node_modules/assert-plus": { + "version": "1.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", + "license": "MIT", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/ast-types-flow": { + "version": "0.0.8", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ast-types-flow/-/ast-types-flow-0.0.8.tgz", + "integrity": "sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/async": { + "version": "1.5.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/async/-/async-1.5.2.tgz", + "integrity": "sha512-nSVgobk4rv61R9PUSDtYt7mPVB2olxNR5RWJcAsH676/ef11bUZwvu7+RGYrYauVdDPcO519v68wRhXQtxsV9w==", + "license": "MIT" + }, + "node_modules/async-function": { + "version": "1.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/async-function/-/async-function-1.0.0.tgz", + "integrity": "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, + "node_modules/at-least-node": { + "version": "1.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/atomically": { + "version": "1.7.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/atomically/-/atomically-1.7.0.tgz", + "integrity": "sha512-Xcz9l0z7y9yQ9rdDaxlmaI4uJHf/T8g9hOEzJcsEqX2SjCj4J20uK7+ldkDHMbpJDK76wF7xEIgxc/vSlsfw5w==", + "license": "MIT", + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/await-event": { + "version": "2.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/await-event/-/await-event-2.1.0.tgz", + "integrity": "sha512-hADm2dFnyugZnfFoJ0Oug2T9xAT2gFdvxZXXnWUOFsHL+VTCvj4Q7oBOinUYzvAFeAD5HN1YSrP78iS3/SQ7iQ==", + "license": "MIT" + }, + "node_modules/await-first": { + "version": "1.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/await-first/-/await-first-1.0.0.tgz", + "integrity": "sha512-SK20HicVu6lXvNM0nS1flurrs4/1NdhvccvEn52Gf+vpERZnnkKBnJvAQDsYkzJnsHs1bRNNKEiobEet7a/0TA==", + "license": "MIT", + "dependencies": { + "ee-first": "^1.1.1" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/await-stream-ready": { + "version": "1.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/await-stream-ready/-/await-stream-ready-1.0.1.tgz", + "integrity": "sha512-6ixSbvbBLztuO5BVFjb2N+8ol6W+/2hEGdmhIGYUPY8IsVU4Rg84WRoLRQRtz0nbhkx1Jnu7S7XiVAzW3lLF/g==", + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/aws-sign2": { + "version": "0.7.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", + "license": "Apache-2.0", + "engines": { + "node": "*" + } + }, + "node_modules/aws-ssl-profiles": { + "version": "1.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/aws-ssl-profiles/-/aws-ssl-profiles-1.1.2.tgz", + "integrity": "sha512-NZKeq9AfyQvEeNlN0zSYAaWrmBffJh3IELMZfRpJVWgrpEbtEpnjvzqBPf+mxoI287JohRDoa+/nsfqqiZmF6g==", + "license": "MIT", + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/aws4": { + "version": "1.13.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/aws4/-/aws4-1.13.2.tgz", + "integrity": "sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==", + "license": "MIT" + }, + "node_modules/axe-core": { + "version": "4.11.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/axe-core/-/axe-core-4.11.0.tgz", + "integrity": "sha512-ilYanEU8vxxBexpJd8cWM4ElSQq4QctCLKih0TSfjIfCQTeyH/6zVrmIJfLPrKTKJRbiG+cfnZbQIjAlJmF1jQ==", + "dev": true, + "license": "MPL-2.0", + "engines": { + "node": ">=4" + } + }, + "node_modules/axios": { + "version": "1.13.6", + "resolved": "https://mirrors.cloud.tencent.com/npm/axios/-/axios-1.13.6.tgz", + "integrity": "sha512-ChTCHMouEe2kn713WHbQGcuYrr6fXTBiu460OTwWrWob16g1bXn4vtz07Ope7ewMozJAnEquLk5lWQWtBig9DQ==", + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.15.11", + "form-data": "^4.0.5", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/axios-ntlm": { + "version": "1.4.6", + "resolved": "https://mirrors.cloud.tencent.com/npm/axios-ntlm/-/axios-ntlm-1.4.6.tgz", + "integrity": "sha512-4nR5cbVEBfPMTFkd77FEDpDuaR205JKibmrkaQyNwGcCx0szWNpRZaL0jZyMx4+mVY2PXHjRHuJafv9Oipl0Kg==", + "license": "MIT", + "dependencies": { + "axios": "^1.12.2", + "des.js": "^1.1.0", + "dev-null": "^0.1.1", + "js-md4": "^0.3.2" + } + }, + "node_modules/axobject-query": { + "version": "4.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/axobject-query/-/axobject-query-4.1.0.tgz", + "integrity": "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "license": "MIT" + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/baseline-browser-mapping": { + "version": "2.8.25", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/baseline-browser-mapping/-/baseline-browser-mapping-2.8.25.tgz", + "integrity": "sha512-2NovHVesVF5TXefsGX1yzx1xgr7+m9JQenvz6FQY3qd+YXkKkYiv+vTCc7OriP9mcDZpTC5mAOYN4ocd29+erA==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.js" + } + }, + "node_modules/bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", + "license": "BSD-3-Clause", + "dependencies": { + "tweetnacl": "^0.14.3" + } + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/black-hole-stream": { + "version": "0.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/black-hole-stream/-/black-hole-stream-0.0.1.tgz", + "integrity": "sha512-FQSWhFQZmddoqWkwPMFeR5hJo9waZE796MuO7b0poStaPrm0Qr2em9FT4/TF1+0rOA1dRFabX+88rdX8YHxDTA==", + "license": "MIT" + }, + "node_modules/bluebird": { + "version": "3.7.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "dev": true, + "license": "MIT" + }, + "node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browser-stdout": { + "version": "1.3.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true, + "license": "ISC" + }, + "node_modules/browserslist": { + "version": "4.27.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/browserslist/-/browserslist-4.27.0.tgz", + "integrity": "sha512-AXVQwdhot1eqLihwasPElhX2tAZiBjWdJ9i/Zcj2S6QYIjkx62OKSfnobkriB81C3l4w0rVy3Nt4jaTBltYEpw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "baseline-browser-mapping": "^2.8.19", + "caniuse-lite": "^1.0.30001751", + "electron-to-chromium": "^1.5.238", + "node-releases": "^2.0.26", + "update-browserslist-db": "^1.1.4" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", + "license": "BSD-3-Clause" + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "license": "MIT" + }, + "node_modules/builtin-modules": { + "version": "3.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/builtin-modules/-/builtin-modules-3.3.0.tgz", + "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/busboy": { + "version": "1.6.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, + "node_modules/byte": { + "version": "2.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/byte/-/byte-2.0.0.tgz", + "integrity": "sha512-rNiK8YxOMvquToaBubKxA10sjRIZ/taDqtc/1jLQA4X7aNDlA1XGx4Ciml3YxL8DskFz1XX3WFskSp0peKYSKg==", + "license": "MIT", + "dependencies": { + "debug": "^3.1.0", + "long": "^4.0.0", + "utility": "^1.13.1" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/byte/node_modules/utility": { + "version": "1.18.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/utility/-/utility-1.18.0.tgz", + "integrity": "sha512-PYxZDA+6QtvRvm//++aGdmKG/cI07jNwbROz0Ql+VzFV1+Z0Dy55NI4zZ7RHc9KKpBePNFwoErqIuqQv/cjiTA==", + "license": "MIT", + "dependencies": { + "copy-to": "^2.0.1", + "escape-html": "^1.0.3", + "mkdirp": "^0.5.1", + "mz": "^2.7.0", + "unescape": "^1.0.1" + }, + "engines": { + "node": ">= 0.12.0" + } + }, + "node_modules/bytes": { + "version": "2.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/bytes/-/bytes-2.2.0.tgz", + "integrity": "sha512-zGRpnr2l5w/s8PxkrquUJoVeR06KvqPelrYqiSyQV7QEBqCYivpb6UzXYWC6JDBVtNFOT0rzJRFhkfJgxzmILA==", + "license": "MIT" + }, + "node_modules/c8": { + "version": "10.1.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/c8/-/c8-10.1.3.tgz", + "integrity": "sha512-LvcyrOAaOnrrlMpW22n690PUvxiq4Uf9WMhQwNJ9vgagkL/ph1+D4uvjvDA5XCbykrc0sx+ay6pVi9YZ1GnhyA==", + "dev": true, + "license": "ISC", + "dependencies": { + "@bcoe/v8-coverage": "^1.0.1", + "@istanbuljs/schema": "^0.1.3", + "find-up": "^5.0.0", + "foreground-child": "^3.1.1", + "istanbul-lib-coverage": "^3.2.0", + "istanbul-lib-report": "^3.0.1", + "istanbul-reports": "^3.1.6", + "test-exclude": "^7.0.1", + "v8-to-istanbul": "^9.0.0", + "yargs": "^17.7.2", + "yargs-parser": "^21.1.1" + }, + "bin": { + "c8": "bin/c8.js" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "monocart-coverage-reports": "^2" + }, + "peerDependenciesMeta": { + "monocart-coverage-reports": { + "optional": true + } + } + }, + "node_modules/cache-content-type": { + "version": "1.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/cache-content-type/-/cache-content-type-1.0.1.tgz", + "integrity": "sha512-IKufZ1o4Ut42YUrZSo8+qnMTrFuKkvyoLXUywKz9GJ5BrhOFGhLdkx9sG4KAnVvbY6kEcSFjLQul+DVmBm2bgA==", + "license": "MIT", + "dependencies": { + "mime-types": "^2.1.18", + "ylru": "^1.2.0" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/call-bind": { + "version": "1.0.8", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/camel-case": { + "version": "3.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/camel-case/-/camel-case-3.0.0.tgz", + "integrity": "sha512-+MbKztAYHXPr1jNTSKQF52VpcFjwY5RkR7fxksV8Doo4KAYc5Fl4UJRgthBbTmEx8C54DqahhbLJkDwjI3PI/w==", + "license": "MIT", + "dependencies": { + "no-case": "^2.2.0", + "upper-case": "^1.1.1" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001754", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/caniuse-lite/-/caniuse-lite-1.0.30001754.tgz", + "integrity": "sha512-x6OeBXueoAceOmotzx3PO4Zpt4rzpeIFsSr6AAePTZxSkXiYDUmpypEl7e2+8NCd9bD7bXjqyef8CJYPC1jfxg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/caseless": { + "version": "0.12.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", + "license": "Apache-2.0" + }, + "node_modules/cfork": { + "version": "1.11.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/cfork/-/cfork-1.11.0.tgz", + "integrity": "sha512-pYyWhuXPq5OoaVPaQZXFf243oQ/+eCXu7ufOZxqi8HFI7TcTxbsi1/16CpT75dSuk78ErMJQlTkpzz9O82G/Ig==", + "license": "MIT", + "dependencies": { + "utility": "^1.12.0" + }, + "engines": { + "node": ">= 0.12.0" + } + }, + "node_modules/cfork/node_modules/utility": { + "version": "1.18.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/utility/-/utility-1.18.0.tgz", + "integrity": "sha512-PYxZDA+6QtvRvm//++aGdmKG/cI07jNwbROz0Ql+VzFV1+Z0Dy55NI4zZ7RHc9KKpBePNFwoErqIuqQv/cjiTA==", + "license": "MIT", + "dependencies": { + "copy-to": "^2.0.1", + "escape-html": "^1.0.3", + "mkdirp": "^0.5.1", + "mz": "^2.7.0", + "unescape": "^1.0.1" + }, + "engines": { + "node": ">= 0.12.0" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chan": { + "version": "0.6.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/chan/-/chan-0.6.1.tgz", + "integrity": "sha512-/TdBP2UhbBmw7qnqkzo9Mk4rzvwRv4dlNPXFerqWy90T8oBspKagJNZxrDbExKHhx9uXXHjo3f9mHgs9iKO3nQ==", + "license": "MIT" + }, + "node_modules/change-case": { + "version": "3.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/change-case/-/change-case-3.1.0.tgz", + "integrity": "sha512-2AZp7uJZbYEzRPsFoa+ijKdvp9zsrnnt6+yFokfwEpeJm0xuJDVoxiRCAaTzyJND8GJkofo2IcKWaUZ/OECVzw==", + "license": "MIT", + "dependencies": { + "camel-case": "^3.0.0", + "constant-case": "^2.0.0", + "dot-case": "^2.1.0", + "header-case": "^1.0.0", + "is-lower-case": "^1.1.0", + "is-upper-case": "^1.1.0", + "lower-case": "^1.1.1", + "lower-case-first": "^1.0.0", + "no-case": "^2.3.2", + "param-case": "^2.1.0", + "pascal-case": "^2.0.0", + "path-case": "^2.1.0", + "sentence-case": "^2.1.0", + "snake-case": "^2.1.0", + "swap-case": "^1.1.0", + "title-case": "^2.1.0", + "upper-case": "^1.1.1", + "upper-case-first": "^1.1.0" + } + }, + "node_modules/chardet": { + "version": "2.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/chardet/-/chardet-2.1.1.tgz", + "integrity": "sha512-PsezH1rqdV9VvyNhxxOW32/d75r01NY7TQCmOqomRo15ZSOKbpTFVsfjghxo6JloQUCGnH4k1LGu0R4yCLlWQQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/ci-info": { + "version": "3.9.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/circular-json-for-egg": { + "version": "1.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/circular-json-for-egg/-/circular-json-for-egg-1.0.0.tgz", + "integrity": "sha512-BzMR1dg0+YqcFoMETHq0gFeQNNKliXI1Oe+C0nx/4npLaohsR7/Oj3UFht65MLwF7zs6x13gOr+f4+JeYni6vw==", + "license": "MIT" + }, + "node_modules/cli-cursor": { + "version": "3.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "restore-cursor": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-spinners": { + "version": "2.9.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-width": { + "version": "3.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/cli-width/-/cli-width-3.0.0.tgz", + "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 10" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/cliui/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/cliui/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/clone": { + "version": "1.0.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/clone/-/clone-1.0.4.tgz", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/cluster-client": { + "version": "3.7.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/cluster-client/-/cluster-client-3.7.0.tgz", + "integrity": "sha512-n0pLGPWlAjaGDJrLKTenjF1qoHbDjuYFlvX4UBoWCt9NjUTZGQhfNafF6Gw4Rj7oJqqdBGrdiIdHSvtOMQX5AA==", + "license": "MIT", + "dependencies": { + "byte": "^2.0.0", + "co": "^4.6.0", + "egg-logger": "^3.5.0", + "is-type-of": "^1.4.0", + "json-stringify-safe": "^5.0.1", + "long": "^4.0.0", + "sdk-base": "^4.2.1", + "serialize-json": "^1.0.3", + "tcp-base": "^3.2.0", + "utility": "^2.1.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/cluster-client/node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/cluster-key-slot": { + "version": "1.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz", + "integrity": "sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==", + "license": "Apache-2.0", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/cluster-reload": { + "version": "1.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/cluster-reload/-/cluster-reload-1.1.0.tgz", + "integrity": "sha512-lY3n9ohbJvDsDoaGGx/ER6eqaDKgVVmYjgoSL+XPxI0NHhkr4Ag60RSqVD1B9yZJz/q3FjB94bLfnuGuFuh7aw==", + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/co": { + "version": "4.6.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/co/-/co-4.6.0.tgz", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "license": "MIT", + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "node_modules/co-body": { + "version": "6.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/co-body/-/co-body-6.2.0.tgz", + "integrity": "sha512-Kbpv2Yd1NdL1V/V4cwLVxraHDV6K8ayohr2rmH0J87Er8+zJjcTa6dAn9QMPC9CRgU8+aNajKbSf1TzDB1yKPA==", + "license": "MIT", + "dependencies": { + "@hapi/bourne": "^3.0.0", + "inflation": "^2.0.0", + "qs": "^6.5.2", + "raw-body": "^2.3.3", + "type-is": "^1.6.16" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/co-busboy": { + "version": "2.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/co-busboy/-/co-busboy-2.0.2.tgz", + "integrity": "sha512-xntc6PdplMQ9M92T5aKWRu8OBh4CbQcLHPnf2K3c+rD2xhAJcIjC5liblUquxDGTErsnHadMOsCcd6xhnpPAFA==", + "license": "MIT", + "dependencies": { + "black-hole-stream": "~0.0.1", + "busboy": "^1.6.0", + "chan": "^0.6.1", + "inflation": "^2.0.0" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/coffee": { + "version": "5.5.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/coffee/-/coffee-5.5.1.tgz", + "integrity": "sha512-ZKt9b/Iq0jhe7tYpDMXJggx8l/+YIcQFi2C+LvJRQ7lUSJnzayir1BGbsoHELKKyV+zevWMCsfmGAI1fREyRbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^6.0.5", + "debug": "^4.1.0", + "is-type-of": "^1.2.1" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/coffee/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/coffee/node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "license": "MIT" + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/command-line-usage": { + "version": "6.1.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/command-line-usage/-/command-line-usage-6.1.3.tgz", + "integrity": "sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-back": "^4.0.2", + "chalk": "^2.4.2", + "table-layout": "^1.0.2", + "typical": "^5.2.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "license": "MIT" + }, + "node_modules/comment-parser": { + "version": "1.4.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/comment-parser/-/comment-parser-1.4.1.tgz", + "integrity": "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/common-bin": { + "version": "2.9.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/common-bin/-/common-bin-2.9.2.tgz", + "integrity": "sha512-fw6YBX8dr4wgMCHqcOR5eIqWZxoZa6+0JAiqjZuOZFCh/pz9hW6EY2EGFc3QpHwp/DlLuw/du/Sr2InhrfAYSQ==", + "license": "MIT", + "dependencies": { + "@types/dargs": "^5.1.0", + "@types/node": "^10.12.18", + "@types/yargs": "^12.0.4", + "chalk": "^2.4.1", + "change-case": "^3.0.2", + "co": "^4.6.0", + "dargs": "^6.0.0", + "debug": "^4.1.0", + "is-type-of": "^1.2.1", + "semver": "^5.5.1", + "yargs": "^13.3.0", + "yargs-parser": "^13.1.2" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/common-bin/node_modules/@types/node": { + "version": "10.17.60", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/node/-/node-10.17.60.tgz", + "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==", + "license": "MIT" + }, + "node_modules/common-bin/node_modules/ansi-regex": { + "version": "4.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/common-bin/node_modules/cliui": { + "version": "5.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "license": "ISC", + "dependencies": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "node_modules/common-bin/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/common-bin/node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/common-bin/node_modules/emoji-regex": { + "version": "7.0.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "license": "MIT" + }, + "node_modules/common-bin/node_modules/find-up": { + "version": "3.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "license": "MIT", + "dependencies": { + "locate-path": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/common-bin/node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/common-bin/node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/common-bin/node_modules/locate-path": { + "version": "3.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "license": "MIT", + "dependencies": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/common-bin/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/common-bin/node_modules/p-locate": { + "version": "3.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "license": "MIT", + "dependencies": { + "p-limit": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/common-bin/node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/common-bin/node_modules/string-width": { + "version": "3.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/common-bin/node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/common-bin/node_modules/wrap-ansi": { + "version": "5.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/common-bin/node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "license": "ISC" + }, + "node_modules/common-bin/node_modules/yargs": { + "version": "13.3.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "license": "MIT", + "dependencies": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + } + }, + "node_modules/common-bin/node_modules/yargs-parser": { + "version": "13.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "license": "ISC", + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + }, + "node_modules/component-emitter": { + "version": "1.3.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/component-emitter/-/component-emitter-1.3.1.tgz", + "integrity": "sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/compressible": { + "version": "2.0.18", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/compressible/-/compressible-2.0.18.tgz", + "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", + "license": "MIT", + "dependencies": { + "mime-db": ">= 1.43.0 < 2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "license": "MIT" + }, + "node_modules/conf": { + "version": "9.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/conf/-/conf-9.0.2.tgz", + "integrity": "sha512-rLSiilO85qHgaTBIIHQpsv8z+NnVfZq3cKuYNCXN1AOqPzced0GWZEe/A517VldRLyQYXUMyV+vszavE2jSAqw==", + "license": "MIT", + "dependencies": { + "ajv": "^7.0.3", + "ajv-formats": "^1.5.1", + "atomically": "^1.7.0", + "debounce-fn": "^4.0.0", + "dot-prop": "^6.0.1", + "env-paths": "^2.2.0", + "json-schema-typed": "^7.0.3", + "make-dir": "^3.1.0", + "onetime": "^5.1.2", + "pkg-up": "^3.1.0", + "semver": "^7.3.4" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/conf/node_modules/ajv": { + "version": "7.2.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ajv/-/ajv-7.2.4.tgz", + "integrity": "sha512-nBeQgg/ZZA3u3SYxyaDvpvDtgZ/EZPF547ARgZBrG9Bhu1vKDwAIjtIf+sDtJUKa2zOcEbmRLBRSyMraS/Oy1A==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/conf/node_modules/dot-prop": { + "version": "6.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/dot-prop/-/dot-prop-6.0.1.tgz", + "integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==", + "license": "MIT", + "dependencies": { + "is-obj": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/conf/node_modules/is-obj": { + "version": "2.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/conf/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "license": "MIT" + }, + "node_modules/conf/node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "license": "MIT", + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/conf/node_modules/make-dir/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/conf/node_modules/semver": { + "version": "7.7.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/config-chain": { + "version": "1.1.13", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/config-chain/-/config-chain-1.1.13.tgz", + "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ini": "^1.3.4", + "proto-list": "~1.2.1" + } + }, + "node_modules/constant-case": { + "version": "2.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/constant-case/-/constant-case-2.0.0.tgz", + "integrity": "sha512-eS0N9WwmjTqrOmR3o83F5vW8Z+9R1HnVz3xmzT2PMFug9ly+Au/fxRWlEBSb6LcZwspSsEn9Xs1uw9YgzAg1EQ==", + "license": "MIT", + "dependencies": { + "snake-case": "^2.1.0", + "upper-case": "^1.1.1" + } + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "license": "MIT", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookiejar": { + "version": "2.1.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/cookiejar/-/cookiejar-2.1.4.tgz", + "integrity": "sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==", + "dev": true, + "license": "MIT" + }, + "node_modules/cookies": { + "version": "0.9.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/cookies/-/cookies-0.9.1.tgz", + "integrity": "sha512-TG2hpqe4ELx54QER/S3HQ9SRVnQnGBtKUz5bLQWtYAQ+o6GpgMs6sYUvaiJjVxb+UXwhRhAEP3m7LbsIZ77Hmw==", + "license": "MIT", + "dependencies": { + "depd": "~2.0.0", + "keygrip": "~1.1.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/copy-to": { + "version": "2.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/copy-to/-/copy-to-2.0.1.tgz", + "integrity": "sha512-3DdaFaU/Zf1AnpLiFDeNCD4TOWe3Zl2RZaTzUvWiIk5ERzcCodOE20Vqq4fzCbNoHURFHT4/us/Lfq+S2zyY4w==", + "license": "MIT" + }, + "node_modules/core-js": { + "version": "2.6.12", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.", + "hasInstallScript": true, + "license": "MIT" + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "license": "MIT" + }, + "node_modules/cos-js-sdk-v5": { + "version": "1.10.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/cos-js-sdk-v5/-/cos-js-sdk-v5-1.10.1.tgz", + "integrity": "sha512-a4SRfCY5g6Z35C7OWe9te/S1zk77rVQzfpvZ33gmTdJQzKxbNbEG7Aw/v453XwVMsQB352FIf7KRMm5Ya/wlZQ==", + "hasInstallScript": true, + "license": "ISC", + "dependencies": { + "fast-xml-parser": "4.5.0" + } + }, + "node_modules/cos-js-sdk-v5/node_modules/fast-xml-parser": { + "version": "4.5.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/fast-xml-parser/-/fast-xml-parser-4.5.0.tgz", + "integrity": "sha512-/PlTQCI96+fZMAOLMZK4CWG1ItCbfZ/0jx7UIJFChPNrx7tcEgerUgWbeieCM9MfHInUDyK8DWYZ+YrywDJuTg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + }, + { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" + } + ], + "license": "MIT", + "dependencies": { + "strnum": "^1.0.5" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, + "node_modules/cos-js-sdk-v5/node_modules/strnum": { + "version": "1.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/strnum/-/strnum-1.1.2.tgz", + "integrity": "sha512-vrN+B7DBIoTTZjnPNewwhx6cBA/H+IS7rfW68n7XxC1y7uoiGQBxaKzqucGUgavX15dJgiGztLJ8vxuEzwqBdA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT" + }, + "node_modules/cos-nodejs-sdk-v5": { + "version": "2.15.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/cos-nodejs-sdk-v5/-/cos-nodejs-sdk-v5-2.15.4.tgz", + "integrity": "sha512-TP/iYTvKKKhRK89on9SRfSMGEw/9SFAAU8EC1kdT5Fmpx7dAwaCNM2+R2H1TSYoQt+03rwOs8QEfNkX8GOHjHQ==", + "license": "ISC", + "dependencies": { + "conf": "^9.0.0", + "fast-xml-parser": "4.2.5", + "mime-types": "^2.1.24", + "request": "^2.88.2" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/cos-nodejs-sdk-v5/node_modules/fast-xml-parser": { + "version": "4.2.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/fast-xml-parser/-/fast-xml-parser-4.2.5.tgz", + "integrity": "sha512-B9/wizE4WngqQftFPmdaMYlXoJlJOYxGQOanC77fq9k8+Z0v5dDSVh+3glErdIROP//s/jgb7ZuxKfB8nVyo0g==", + "funding": [ + { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" + }, + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT", + "dependencies": { + "strnum": "^1.0.5" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, + "node_modules/cos-nodejs-sdk-v5/node_modules/strnum": { + "version": "1.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/strnum/-/strnum-1.1.2.tgz", + "integrity": "sha512-vrN+B7DBIoTTZjnPNewwhx6cBA/H+IS7rfW68n7XxC1y7uoiGQBxaKzqucGUgavX15dJgiGztLJ8vxuEzwqBdA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT" + }, + "node_modules/crc": { + "version": "3.8.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/crc/-/crc-3.8.0.tgz", + "integrity": "sha512-iX3mfgcTMIq3ZKLIsVFAbv7+Mc10kxabAGQb8HvjA1o3T1PIYprbakQ65d3I+2HGHt6nSKkM9PYjgoJO2KcFBQ==", + "license": "MIT", + "dependencies": { + "buffer": "^5.1.0" + } + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/cron-parser": { + "version": "2.18.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/cron-parser/-/cron-parser-2.18.0.tgz", + "integrity": "sha512-s4odpheTyydAbTBQepsqd2rNWGa2iV3cyo8g7zbI2QQYGLVsfbhmwukayS1XHppe02Oy1fg7mg6xoaraVJeEcg==", + "license": "MIT", + "dependencies": { + "is-nan": "^1.3.0", + "moment-timezone": "^0.5.31" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/cross-spawn": { + "version": "6.0.6", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/cross-spawn/-/cross-spawn-6.0.6.tgz", + "integrity": "sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==", + "dev": true, + "license": "MIT", + "dependencies": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "engines": { + "node": ">=4.8" + } + }, + "node_modules/crypto-js": { + "version": "4.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/crypto-js/-/crypto-js-4.2.0.tgz", + "integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==", + "license": "MIT" + }, + "node_modules/csrf": { + "version": "3.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/csrf/-/csrf-3.1.0.tgz", + "integrity": "sha512-uTqEnCvWRk042asU6JtapDTcJeeailFy4ydOQS28bj1hcLnYRiqi8SsD2jS412AY1I/4qdOwWZun774iqywf9w==", + "license": "MIT", + "dependencies": { + "rndm": "1.2.0", + "tsscmp": "1.0.6", + "uid-safe": "2.1.5" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/cssfilter": { + "version": "0.0.10", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/cssfilter/-/cssfilter-0.0.10.tgz", + "integrity": "sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw==", + "license": "MIT" + }, + "node_modules/damerau-levenshtein": { + "version": "1.0.8", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz", + "integrity": "sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==", + "dev": true, + "license": "BSD-2-Clause" + }, + "node_modules/dargs": { + "version": "6.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/dargs/-/dargs-6.1.0.tgz", + "integrity": "sha512-5dVBvpBLBnPwSsYXqfybFyehMmC/EenKEcf23AhCTgTf48JFBbmJKqoZBsERDnjL0FyiVTYWdFsRfTLHxLyKdQ==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/dashdash": { + "version": "1.14.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", + "license": "MIT", + "dependencies": { + "assert-plus": "^1.0.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/data-view-buffer": { + "version": "1.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/data-view-buffer/-/data-view-buffer-1.0.2.tgz", + "integrity": "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz", + "integrity": "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/inspect-js" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz", + "integrity": "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/dateformat": { + "version": "4.6.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/dateformat/-/dateformat-4.6.3.tgz", + "integrity": "sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/dayjs": { + "version": "1.11.19", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/dayjs/-/dayjs-1.11.19.tgz", + "integrity": "sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw==", + "license": "MIT" + }, + "node_modules/debounce": { + "version": "1.2.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/debounce/-/debounce-1.2.1.tgz", + "integrity": "sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug==", + "license": "MIT" + }, + "node_modules/debounce-fn": { + "version": "4.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/debounce-fn/-/debounce-fn-4.0.0.tgz", + "integrity": "sha512-8pYCQiL9Xdcg0UPSD3d+0KMlOjp+KGU5EPwYddgzQ7DATsg4fuUDjQtsYLmWjnk2obnNHgV3vE2Y4jejSOJVBQ==", + "license": "MIT", + "dependencies": { + "mimic-fn": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/debounce-fn/node_modules/mimic-fn": { + "version": "3.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/mimic-fn/-/mimic-fn-3.1.0.tgz", + "integrity": "sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/debug": { + "version": "3.2.7", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/decamelize": { + "version": "4.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/deep-equal": { + "version": "1.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/deep-equal/-/deep-equal-1.0.1.tgz", + "integrity": "sha512-bHtC0iYvWhyaTzvV3CZgPeZQqCOBGyGsVV7v4eevpdkLHfiSrXUdBG+qAuSz4RI70sszvjQ1QSZ98An1yNwpSw==", + "license": "MIT" + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/default-user-agent": { + "version": "1.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/default-user-agent/-/default-user-agent-1.0.0.tgz", + "integrity": "sha512-bDF7bg6OSNcSwFWPu4zYKpVkJZQYVrAANMYB8bc9Szem1D0yKdm4sa/rOCs2aC9+2GMqQ7KnwtZRvDhmLF0dXw==", + "license": "MIT", + "dependencies": { + "os-name": "~1.0.3" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/defaults": { + "version": "1.0.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "clone": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "license": "MIT", + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "license": "MIT" + }, + "node_modules/denque": { + "version": "1.5.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/denque/-/denque-1.5.1.tgz", + "integrity": "sha512-XwE+iZ4D6ZUB7mfYRMb5wByE8L74HCn30FBN7sWnXksWc1LO1bPDl67pBR9o/kC4z/xSNAwkMYcGgqDV3BE3Hw==", + "license": "Apache-2.0", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/des.js": { + "version": "1.1.0", + "resolved": "https://mirrors.cloud.tencent.com/npm/des.js/-/des.js-1.1.0.tgz", + "integrity": "sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "license": "MIT", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/detect-port": { + "version": "2.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/detect-port/-/detect-port-2.1.0.tgz", + "integrity": "sha512-epZuWb/6Q62L+nDHJc/hQAqf8pylsqgk3BpZXVBx1CDnr3nkrVNn73Uu1rXcFzkNcc+hkP3whuOg7JZYaQB65Q==", + "license": "MIT", + "dependencies": { + "address": "^2.0.1" + }, + "bin": { + "detect": "dist/commonjs/bin/detect-port.js", + "detect-port": "dist/commonjs/bin/detect-port.js" + }, + "engines": { + "node": ">= 16.0.0" + } + }, + "node_modules/dev-null": { + "version": "0.1.1", + "resolved": "https://mirrors.cloud.tencent.com/npm/dev-null/-/dev-null-0.1.1.tgz", + "integrity": "sha512-nMNZG0zfMgmdv8S5O0TM5cpwNbGKRGPCxVsr0SmA3NZZy9CYBbuNLL0PD3Acx9e5LIUgwONXtM9kM6RlawPxEQ==", + "license": "MIT" + }, + "node_modules/dezalgo": { + "version": "1.0.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/dezalgo/-/dezalgo-1.0.4.tgz", + "integrity": "sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==", + "license": "ISC", + "dependencies": { + "asap": "^2.0.0", + "wrappy": "1" + } + }, + "node_modules/diff": { + "version": "5.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/digest-header": { + "version": "1.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/digest-header/-/digest-header-1.1.0.tgz", + "integrity": "sha512-glXVh42vz40yZb9Cq2oMOt70FIoWiv+vxNvdKdU8CwjLad25qHM3trLxhl9bVjdr6WaslIXhWpn0NO8T/67Qjg==", + "license": "MIT", + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "license": "MIT", + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/dot-case": { + "version": "2.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/dot-case/-/dot-case-2.1.1.tgz", + "integrity": "sha512-HnM6ZlFqcajLsyudHq7LeeLDr2rFAVYtDv/hV5qchQEidSck8j9OPUsXY9KwJv/lHMtYlX4DjRQqwFYa+0r8Ug==", + "license": "MIT", + "dependencies": { + "no-case": "^2.2.0" + } + }, + "node_modules/dot-prop": { + "version": "4.2.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/dot-prop/-/dot-prop-4.2.1.tgz", + "integrity": "sha512-l0p4+mIuJIua0mhxGoh4a+iNL9bmeK5DvnSVQa6T0OhrVmaEa1XScX5Etc673FePCJOArq/4Pa2cLGODUWTPOQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-obj": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/dottie": { + "version": "2.0.6", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/dottie/-/dottie-2.0.6.tgz", + "integrity": "sha512-iGCHkfUc5kFekGiqhe8B/mdaurD+lakO9txNnTvKtA6PISrw86LgqHvRzWYPyoE2Ph5aMIrCw9/uko6XHTKCwA==", + "license": "MIT" + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/duplexer": { + "version": "0.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/duplexer/-/duplexer-0.1.2.tgz", + "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==", + "license": "MIT" + }, + "node_modules/duplexify": { + "version": "3.7.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + } + }, + "node_modules/duplexify/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "license": "MIT" + }, + "node_modules/duplexify/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/duplexify/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "license": "MIT" + }, + "node_modules/duplexify/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true, + "license": "MIT" + }, + "node_modules/ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", + "license": "MIT", + "dependencies": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/editorconfig": { + "version": "1.0.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/editorconfig/-/editorconfig-1.0.4.tgz", + "integrity": "sha512-L9Qe08KWTlqYMVvMcTIvMAdl1cDUubzRNYL+WfA4bLDMHe4nemKkpmYzkznE1FwLKu0EEmy6obgQKzMJrg4x9Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@one-ini/wasm": "0.1.1", + "commander": "^10.0.0", + "minimatch": "9.0.1", + "semver": "^7.5.3" + }, + "bin": { + "editorconfig": "bin/editorconfig" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/editorconfig/node_modules/commander": { + "version": "10.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/editorconfig/node_modules/minimatch": { + "version": "9.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/minimatch/-/minimatch-9.0.1.tgz", + "integrity": "sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/editorconfig/node_modules/semver": { + "version": "7.7.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/egg": { + "version": "3.31.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/egg/-/egg-3.31.0.tgz", + "integrity": "sha512-byWruMp4PtCnTTNYMc56Xo+v3s73GIb+K6Klw1A3oJzzae6jQPfAYGE8URjsA3CyiQ4HrXSIVAI+Gxa9+jcR3w==", + "license": "MIT", + "dependencies": { + "@types/accepts": "^1.3.5", + "@types/koa": "^2.13.5", + "@types/koa-router": "^7.4.4", + "accepts": "^1.3.8", + "agentkeepalive": "^4.2.1", + "cache-content-type": "^1.0.1", + "circular-json-for-egg": "^1.0.0", + "cluster-client": "^3.3.0", + "delegates": "^1.0.0", + "egg-cluster": "^2.0.0", + "egg-cookies": "^2.6.1", + "egg-core": "^5.4.0", + "egg-development": "^3.0.0", + "egg-errors": "^2.3.1", + "egg-i18n": "^2.1.1", + "egg-jsonp": "^2.0.0", + "egg-logger": "^3.0.1", + "egg-logrotator": "^3.1.0", + "egg-multipart": "^3.1.0", + "egg-onerror": "^2.1.1", + "egg-schedule": "^4.0.0", + "egg-security": "^3.0.0", + "egg-session": "^3.3.0", + "egg-static": "^2.2.0", + "egg-view": "^2.1.3", + "egg-watcher": "^3.1.1", + "extend2": "^1.0.1", + "graceful": "^1.1.0", + "humanize-ms": "^1.2.1", + "is-type-of": "^2.1.0", + "koa-bodyparser": "^4.4.1", + "koa-is-json": "^1.0.0", + "koa-override": "^3.0.0", + "ms": "^2.1.3", + "on-finished": "^2.4.1", + "onelogger": "^1.0.0", + "sendmessage": "^2.0.0", + "urllib": "^2.33.0", + "urllib-next": "npm:urllib@^3.27.1", + "urllib4": "npm:urllib@^4.5.0", + "utility": "^2.1.0", + "ylru": "^1.3.2" + }, + "engines": { + "node": ">= 14.20.0" + } + }, + "node_modules/egg-bin": { + "version": "6.13.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/egg-bin/-/egg-bin-6.13.0.tgz", + "integrity": "sha512-dlztm1Y5DnSkofCeTaMf+O7kARPDGFbcbLDJ5cc029qRRbhStM7AsBBgLc+EEZuumZupejDHdvxraXRVut1ZTA==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "@artus-cli/artus-cli": "^0.2.9", + "@artus-cli/plugin-autocomplete": "^0.1.1", + "@artus-cli/plugin-version": "^1.0.1", + "@eggjs/utils": "^4.0.2", + "c8": "^10.0.0", + "detect-port": "^2.0.0", + "egg-ts-helper": "^2.1.0", + "globby": "^11.1.0", + "jest-changed-files": "^29.4.2", + "mocha": "^10.2.0", + "mochawesome-with-mocha": "^7.1.3", + "runscript": "^2.0.0", + "ts-node": "^10.9.2", + "tsconfig-paths": "^4.1.2" + }, + "bin": { + "egg-bin": "dist/bin/cli.js" + }, + "engines": { + "node": ">= 16.19.0" + }, + "peerDependencies": { + "egg-mock": ">=5.10.2" + }, + "peerDependenciesMeta": { + "egg-mock": { + "optional": true + } + } + }, + "node_modules/egg-cluster": { + "version": "2.4.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/egg-cluster/-/egg-cluster-2.4.0.tgz", + "integrity": "sha512-Cv3OqEBIJ1iEWjXZ/ylE+Xc8n900x2f04Pwx7mh+rCzVdZWY4kPpc++FmItYpDUCkXjn6VZL2Caa4DL89zgidQ==", + "license": "MIT", + "dependencies": { + "await-event": "^2.1.0", + "cfork": "^1.7.1", + "cluster-reload": "^1.0.2", + "detect-port": "^2.0.1", + "egg-logger": "^3.3.0", + "egg-utils": "^2.4.1", + "get-ready": "^2.0.1", + "graceful-process": "^1.2.0", + "is-type-of": "^1.2.1", + "ps-tree": "^1.2.0", + "sendmessage": "^1.1.0", + "terminal-link": "^2.1.1", + "utility": "^1.15.0" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/egg-cluster/node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/egg-cluster/node_modules/sendmessage": { + "version": "1.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/sendmessage/-/sendmessage-1.1.0.tgz", + "integrity": "sha512-riI/U2etmtMKaVPe7zMnr++eG46F191F6Zycwrkm+/sEiHzucNXJETPJ5dQryNaDuHTpYdzmesEJQ2le1DxlMQ==", + "license": "MIT", + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/egg-cluster/node_modules/utility": { + "version": "1.18.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/utility/-/utility-1.18.0.tgz", + "integrity": "sha512-PYxZDA+6QtvRvm//++aGdmKG/cI07jNwbROz0Ql+VzFV1+Z0Dy55NI4zZ7RHc9KKpBePNFwoErqIuqQv/cjiTA==", + "license": "MIT", + "dependencies": { + "copy-to": "^2.0.1", + "escape-html": "^1.0.3", + "mkdirp": "^0.5.1", + "mz": "^2.7.0", + "unescape": "^1.0.1" + }, + "engines": { + "node": ">= 0.12.0" + } + }, + "node_modules/egg-cookies": { + "version": "2.10.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/egg-cookies/-/egg-cookies-2.10.1.tgz", + "integrity": "sha512-fjlGF9jIu0GmU0bA+ZGOoz8OhbUECy18Y69wgpt8secmtaFzSbKay3DhKA13evqUDoiag5vQXQaN+N7Pp8vFsA==", + "license": "MIT", + "dependencies": { + "scmp": "^2.0.0", + "should-send-same-site-none": "^2.0.2", + "utility": "^1.14.0" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/egg-cookies/node_modules/utility": { + "version": "1.18.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/utility/-/utility-1.18.0.tgz", + "integrity": "sha512-PYxZDA+6QtvRvm//++aGdmKG/cI07jNwbROz0Ql+VzFV1+Z0Dy55NI4zZ7RHc9KKpBePNFwoErqIuqQv/cjiTA==", + "license": "MIT", + "dependencies": { + "copy-to": "^2.0.1", + "escape-html": "^1.0.3", + "mkdirp": "^0.5.1", + "mz": "^2.7.0", + "unescape": "^1.0.1" + }, + "engines": { + "node": ">= 0.12.0" + } + }, + "node_modules/egg-core": { + "version": "5.5.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/egg-core/-/egg-core-5.5.1.tgz", + "integrity": "sha512-6oLO6tLv40vraka+OxXHwaLeXHt/0XRuJlY7zlsz9tS6Z42xDGgjpYXUC2hsFEWQD+SdshC4kTEXllHvplxsqQ==", + "license": "MIT", + "dependencies": { + "@eggjs/router": "^2.2.0", + "@types/depd": "^1.1.32", + "@types/koa": "^2.13.5", + "co": "^4.6.0", + "debug": "^4.1.1", + "depd": "^2.0.0", + "egg-logger": "^3.1.0", + "egg-path-matching": "^1.2.0", + "extend2": "^1.0.0", + "gals": "^1.0.1", + "get-ready": "^2.0.1", + "globby": "^11.0.2", + "is-type-of": "^1.2.1", + "koa": "^2.14.0", + "koa-convert": "^1.2.0", + "node-homedir": "^1.1.1", + "ready-callback": "^3.0.0", + "tsconfig-paths": "^4.1.1", + "utility": "^1.16.1" + }, + "engines": { + "node": ">= 14.19.0" + } + }, + "node_modules/egg-core/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/egg-core/node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/egg-core/node_modules/utility": { + "version": "1.18.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/utility/-/utility-1.18.0.tgz", + "integrity": "sha512-PYxZDA+6QtvRvm//++aGdmKG/cI07jNwbROz0Ql+VzFV1+Z0Dy55NI4zZ7RHc9KKpBePNFwoErqIuqQv/cjiTA==", + "license": "MIT", + "dependencies": { + "copy-to": "^2.0.1", + "escape-html": "^1.0.3", + "mkdirp": "^0.5.1", + "mz": "^2.7.0", + "unescape": "^1.0.1" + }, + "engines": { + "node": ">= 0.12.0" + } + }, + "node_modules/egg-cors": { + "version": "3.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/egg-cors/-/egg-cors-3.0.1.tgz", + "integrity": "sha512-p4TpA2C4CP8iqzUMixjag+jLXFAhQhGlPWSRreMlT9kf/jQzwspALYae0V0EBtkTJtW1eB3lXHKGoPsuf5+0Ag==", + "dependencies": { + "@koa/cors": "^5.0.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/egg-development": { + "version": "3.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/egg-development/-/egg-development-3.0.2.tgz", + "integrity": "sha512-sxJzgw+EwfaZhrVcoGniLBT3B3Xd99VsNZnpLKrYp35upaLqw+tCB+kaTYmXZYqXv1Zm2c6RoGCvJbyqr+Mkjw==", + "license": "MIT", + "dependencies": { + "debounce": "^1.1.0", + "multimatch": "^5.0.0", + "utility": "^2.4.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/egg-errors": { + "version": "2.3.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/egg-errors/-/egg-errors-2.3.2.tgz", + "integrity": "sha512-E+Sx7IBVrfRyHSjFXaq4sCZ3Uk3ka9PYySaQ8VbRZmLEt9ENBCD99yVzLIeWUH2QfzvkrjY9El1eHmLeRx7cfw==", + "license": "MIT", + "engines": { + "node": ">=8.9.0" + } + }, + "node_modules/egg-i18n": { + "version": "2.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/egg-i18n/-/egg-i18n-2.1.1.tgz", + "integrity": "sha512-rpKP2nrUzeTOkjQObvlrLbb/BZAMtP7zeoGggwJLN9+zKbFKVkeF6Q0BrpuucDSekD+2oHQz7fC3w/5eQY1g8w==", + "license": "MIT", + "dependencies": { + "debug": "^3.1.0", + "koa-locales": "^1.11.0" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/egg-jsonp": { + "version": "2.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/egg-jsonp/-/egg-jsonp-2.0.0.tgz", + "integrity": "sha512-dno7BXAvSFO0WTb3GJD0aci9MFlaQhdgvEznwARam75GGJdLpg1K0XQq88/dEvYWHxEHa+iGIOXcNx5NOyyUHw==", + "license": "MIT", + "dependencies": { + "is-type-of": "^1.2.0", + "jsonp-body": "^1.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/egg-jsonp/node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/egg-jwt": { + "version": "3.1.7", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/egg-jwt/-/egg-jwt-3.1.7.tgz", + "integrity": "sha512-N3An6zn8f2AgbmRXAeJEL2sKhMDul3Sv1vPXr84FTBZDQUIvnhyRDBEoMz6X064aWlKVTIAApwK2OqyIoZGpvw==", + "license": "MIT", + "dependencies": { + "jsonwebtoken": "^8.3.0", + "koa-jwt2": "^1.0.3" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/egg-logger": { + "version": "3.6.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/egg-logger/-/egg-logger-3.6.1.tgz", + "integrity": "sha512-lGiEumARJAT7NiwMm577NFiOEBMX9FlZzfuBsLLS6eu14R9udcTI1IzXLGJ63SrCmFIXB+zsWLQv5U11e8fq0Q==", + "license": "MIT", + "dependencies": { + "chalk": "^4.1.2", + "circular-json-for-egg": "^1.0.0", + "depd": "^2.0.0", + "egg-errors": "^2.3.1", + "iconv-lite": "^0.6.3", + "utility": "^2.1.0" + }, + "engines": { + "node": ">=14.17.0" + } + }, + "node_modules/egg-logger/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/egg-logger/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/egg-logger/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/egg-logger/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" + }, + "node_modules/egg-logger/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/egg-logger/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/egg-logrotator": { + "version": "3.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/egg-logrotator/-/egg-logrotator-3.2.0.tgz", + "integrity": "sha512-2KYN4wwBd15FYbNtLxL7IoIkFL7JuHHA3eXWZd5zVKfWgeoy4J+oTnCLDixW1UhVIdehL0q1oQxEldWm5af1Eg==", + "license": "MIT", + "dependencies": { + "moment": "^2.24.0", + "mz": "^2.7.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/egg-mock": { + "version": "5.15.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/egg-mock/-/egg-mock-5.15.2.tgz", + "integrity": "sha512-8g+GzGcjfPaM/XwGaoej27wfIw7qeKR3tqYZPB3mIRWMzChYnyI2Bb+5qud23Ealj0raNamE+85ZsBKI2kq8nw==", + "dev": true, + "dependencies": { + "@eggjs/utils": "^4.0.2", + "@types/supertest": "^2.0.7", + "await-event": "^2.1.0", + "co": "^4.6.0", + "coffee": "^5.2.1", + "detect-port": "^2.0.1", + "egg-logger": "^3.5.0", + "extend2": "^1.0.0", + "get-ready": "^3.1.0", + "globby": "^11.1.0", + "is-type-of": "^2.2.0", + "merge-descriptors": "^1.0.1", + "methods": "^1.1.2", + "mm": "^3.0.2", + "sdk-base": "^4.2.1", + "supertest": "^6.2.4", + "urllib": "3" + }, + "engines": { + "node": ">= 14.18.0" + }, + "peerDependencies": { + "egg": "^3.12.0", + "mocha": "^10.2.0", + "urllib": "^3 || ^4" + } + }, + "node_modules/egg-mock/node_modules/get-ready": { + "version": "3.4.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/get-ready/-/get-ready-3.4.0.tgz", + "integrity": "sha512-D7N1WED4f5rQUveyl19GxfJupMeR+y106EVK6na/zI+w34FcTAShvetX0X2k61x+lJXCEiOnGHk0xro6YRyrjQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 16.13.0" + } + }, + "node_modules/egg-mock/node_modules/type-fest": { + "version": "4.41.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/egg-mock/node_modules/urllib": { + "version": "3.27.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/urllib/-/urllib-3.27.3.tgz", + "integrity": "sha512-24ht/hHAkhWXbqSCM499B8gFPXaf4aFQJNqJH5pMsvfyo+aM3zKuQ/uiZ/mdz41Nnw6ItuiqMVMK5VDAlAHLlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "default-user-agent": "^1.0.0", + "digest-header": "^1.0.0", + "form-data-encoder": "^1.7.2", + "formdata-node": "^4.3.3", + "formstream": "^1.1.1", + "mime-types": "^2.1.35", + "pump": "^3.0.0", + "qs": "^6.11.2", + "type-fest": "^4.3.1", + "undici": "^5.28.2", + "ylru": "^1.3.2" + }, + "engines": { + "node": ">= 14.19.3" + } + }, + "node_modules/egg-multipart": { + "version": "3.5.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/egg-multipart/-/egg-multipart-3.5.0.tgz", + "integrity": "sha512-AWJ50gr+toCvixgtHvLXbtzemJuqnbtJtBZbBNZ8/ADONvOZ9Ib7lkvzcA4Wq0lypfa0rtlLDRq8A09wOd6tVA==", + "license": "MIT", + "dependencies": { + "co-busboy": "^2.0.0", + "dayjs": "^1.11.5", + "egg-path-matching": "^1.2.0", + "humanize-bytes": "^1.0.1" + }, + "engines": { + "node": ">= 14.17.0" + } + }, + "node_modules/egg-mysql": { + "version": "5.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/egg-mysql/-/egg-mysql-5.0.0.tgz", + "integrity": "sha512-QWTQQJ2RUP8VzFgQx+W3f92p3oMMqXYIurQJJ+6Raga9Vp0eFJzVWwUDeAhRu6TIjHuGcYsPLXTACocVaRbLTQ==", + "license": "MIT", + "dependencies": { + "@eggjs/rds": "^1.2.1" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/egg-onerror": { + "version": "2.4.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/egg-onerror/-/egg-onerror-2.4.0.tgz", + "integrity": "sha512-btmUsP1m6H9awd1IaAlvlzqN+uIbUKzaxJ8ArZI71r5FQ9LShZGv2pOT5fhL9mSnGkrvHUsjb9I5KoX2AY63bA==", + "dependencies": { + "cookie": "^0.7.2", + "koa-onerror": "^4.0.0", + "mustache": "^2.3.0", + "stack-trace": "^0.0.10" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/egg-path-matching": { + "version": "1.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/egg-path-matching/-/egg-path-matching-1.2.0.tgz", + "integrity": "sha512-u88hY0tH8GfWu4iocWFxux/abXvi7bh4lr/GIRlUHCTJFk8RQNCCfk5H3Vm67pqTBljtBOCl0lLykOsxj8trXQ==", + "license": "MIT", + "dependencies": { + "path-to-regexp": "^1.9.0" + } + }, + "node_modules/egg-redis": { + "version": "2.6.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/egg-redis/-/egg-redis-2.6.1.tgz", + "integrity": "sha512-YZaoPS/9tVe68CakYUTFZ4a/+NpC3zO6SQxD72SI5DOZaMKlrOPlPPeJYa5kFRHybS29dtQEZ6Hlitbu1tgTcA==", + "license": "MIT", + "dependencies": { + "@types/ioredis": "^4.0.10", + "await-first": "^1.0.0", + "ioredis": "^4.9.0" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/egg-schedule": { + "version": "4.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/egg-schedule/-/egg-schedule-4.0.1.tgz", + "integrity": "sha512-9BgIEOA5+jsqqvW8qLj/0SbTHkr9t2vNRBbZQkqqscejocViGysGd866vN+rcpuqd2zmnP6EQ0YqPAV5fI8P6Q==", + "license": "MIT", + "dependencies": { + "cron-parser": "^2.16.3", + "humanize-ms": "^1.2.1", + "is-type-of": "^1.2.1", + "safe-timers": "^1.1.0", + "utility": "^1.16.3" + }, + "engines": { + "node": ">=14.17.0" + } + }, + "node_modules/egg-schedule/node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/egg-schedule/node_modules/utility": { + "version": "1.18.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/utility/-/utility-1.18.0.tgz", + "integrity": "sha512-PYxZDA+6QtvRvm//++aGdmKG/cI07jNwbROz0Ql+VzFV1+Z0Dy55NI4zZ7RHc9KKpBePNFwoErqIuqQv/cjiTA==", + "license": "MIT", + "dependencies": { + "copy-to": "^2.0.1", + "escape-html": "^1.0.3", + "mkdirp": "^0.5.1", + "mz": "^2.7.0", + "unescape": "^1.0.1" + }, + "engines": { + "node": ">= 0.12.0" + } + }, + "node_modules/egg-scripts": { + "version": "2.17.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/egg-scripts/-/egg-scripts-2.17.0.tgz", + "integrity": "sha512-2OHW0HuKKhOsl3yczYW6vcweyDrtFVOBccJ5xfuZRJOM3wTLRKAIfvXO/oNV1Mo0LSVuphhHiWmrUp481hcRXA==", + "license": "MIT", + "dependencies": { + "await-event": "^2.1.0", + "common-bin": "^2.8.0", + "debug": "^4.1.0", + "egg-utils": "^2.4.1", + "moment": "^2.23.0", + "mz": "^2.7.0", + "mz-modules": "^2.1.0", + "node-homedir": "^1.1.1", + "runscript": "^1.3.0", + "source-map-support": "^0.5.9", + "zlogger": "^1.1.0" + }, + "bin": { + "egg-scripts": "bin/egg-scripts.js", + "eggctl": "bin/egg-scripts.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/egg-scripts/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/egg-scripts/node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/egg-scripts/node_modules/runscript": { + "version": "1.6.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/runscript/-/runscript-1.6.0.tgz", + "integrity": "sha512-lI0ybcwtdC5Wz3aiVtMAK6U5jcTDeLseEBSXcz6ABtQeMmQGpj35dmzpmpy2C9Bn0k2wTjTRLZoya0NFt8Mxsg==", + "license": "MIT", + "dependencies": { + "is-type-of": "^1.1.0" + }, + "engines": { + "node": ">=4.2.3" + } + }, + "node_modules/egg-security": { + "version": "3.7.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/egg-security/-/egg-security-3.7.0.tgz", + "integrity": "sha512-bIlPTBUW2FZ7MHntPExv0F7xigKMMK3irfEo8ypeG7S2G2vg/uFoNZumzBv4PnJeNwTzjUuG+G/YDHFOgSbTsQ==", + "license": "MIT", + "dependencies": { + "@eggjs/ip": "^2.0.2", + "csrf": "^3.0.6", + "delegates": "^1.0.0", + "egg-path-matching": "^1.0.0", + "escape-html": "^1.0.3", + "extend": "^3.0.1", + "koa-compose": "^4.1.0", + "matcher": "^4.0.0", + "methods": "^1.1.2", + "nanoid": "^3.3.6", + "platform": "^1.3.4", + "statuses": "^2.0.1", + "type-is": "^1.6.15", + "xss": "^1.0.3" + }, + "engines": { + "node": ">=14.20.0" + } + }, + "node_modules/egg-sequelize": { + "version": "6.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/egg-sequelize/-/egg-sequelize-6.0.0.tgz", + "integrity": "sha512-uEeBWydcvkFNIVsshE9ZMZXgPmnOtSA+PzKXXoRgOsbN0DqzBRxcdpV4OiW0q3u5f9cfSg/h2HD7imw/z7LGnQ==", + "license": "MIT", + "dependencies": { + "@types/sequelize": "^4.27.24", + "mz-modules": "^2.1.0", + "sequelize": "^6.0.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/egg-session": { + "version": "3.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/egg-session/-/egg-session-3.3.0.tgz", + "integrity": "sha512-RCPWHLWi0Ak+xI/zXN71Wpva/wsqevmKDvkOGk2uu5UdwRHw5lKuTtYm161NMDGZi6lvcnzR2lN7xRcDuhGiIw==", + "dependencies": { + "koa-session": "^6.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/egg-static": { + "version": "2.3.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/egg-static/-/egg-static-2.3.1.tgz", + "integrity": "sha512-OODn2ccm4znFM/EdhiPUmIpgCkYvAdtjuVAy3N/Ub4cSRgqIPcjXajmDsbhEo43mCieukPhsOxgWD3vKZurzHQ==", + "license": "MIT", + "dependencies": { + "is-type-of": "^1.2.1", + "koa-compose": "^4.1.0", + "koa-range": "^0.3.0", + "koa-static-cache": "^5.1.2", + "ylru": "^1.3.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/egg-static/node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/egg-ts-helper": { + "version": "2.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/egg-ts-helper/-/egg-ts-helper-2.1.1.tgz", + "integrity": "sha512-/uA9aPi9ptAvT8NIASv20bJftTdGZb5L3wFX2q74IBNGF9hBZW4CX9b80driXNFYpL9z6BusZ1qkGZwzRWkykA==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "chokidar": "^3.0.0", + "commander": "^2.15.1", + "dot-prop": "^4.2.0", + "enquirer": "^2.3.0", + "globby": "^11.0.0", + "json5": "^2.2.3", + "ts-node": "^10.9.1", + "tslib": "^2.6.1", + "typescript": "^5.1.6", + "yn": "^3.0.0" + }, + "bin": { + "ets": "dist/bin.js" + }, + "engines": { + "node": ">= 14.21.3" + } + }, + "node_modules/egg-ts-helper/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/egg-ts-helper/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/egg-ts-helper/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/egg-ts-helper/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/egg-ts-helper/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/egg-ts-helper/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/egg-utils": { + "version": "2.5.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/egg-utils/-/egg-utils-2.5.0.tgz", + "integrity": "sha512-zQDXcqD0v+6IDBxcxzpTWoDTMg0G3iISSSeOHN7dZzyJWXXmw4ijBPAwKQPVvqBoXB6jAXj5f8B8/LVM9AN//A==", + "license": "MIT", + "dependencies": { + "mkdirp": "^0.5.1", + "utility": "^1.15.0" + } + }, + "node_modules/egg-utils/node_modules/utility": { + "version": "1.18.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/utility/-/utility-1.18.0.tgz", + "integrity": "sha512-PYxZDA+6QtvRvm//++aGdmKG/cI07jNwbROz0Ql+VzFV1+Z0Dy55NI4zZ7RHc9KKpBePNFwoErqIuqQv/cjiTA==", + "license": "MIT", + "dependencies": { + "copy-to": "^2.0.1", + "escape-html": "^1.0.3", + "mkdirp": "^0.5.1", + "mz": "^2.7.0", + "unescape": "^1.0.1" + }, + "engines": { + "node": ">= 0.12.0" + } + }, + "node_modules/egg-view": { + "version": "2.1.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/egg-view/-/egg-view-2.1.4.tgz", + "integrity": "sha512-8zJ/S7YU5SK3EbAYESlUCixLpDZPnyKimoowavrgW2vONnh8AJVuDGqgKCYmuymvWq3uaHoNx7mYbdMQwMTZ6A==", + "license": "MIT", + "dependencies": { + "mz": "^2.7.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/egg-view-ejs": { + "version": "3.0.0", + "resolved": "https://mirrors.cloud.tencent.com/npm/egg-view-ejs/-/egg-view-ejs-3.0.0.tgz", + "integrity": "sha512-NieVt4Rh+aXFeNcpp6SZRQZ6hLFL9kexKnN8D98W1RCchZMoewOT1AD5IZMatt2yHV02zv22m3u7x1OmQufJKQ==", + "license": "MIT", + "dependencies": { + "ejs": "^3" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/egg-view-ejs/node_modules/ejs": { + "version": "3.1.10", + "resolved": "https://mirrors.cloud.tencent.com/npm/ejs/-/ejs-3.1.10.tgz", + "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", + "license": "Apache-2.0", + "dependencies": { + "jake": "^10.8.5" + }, + "bin": { + "ejs": "bin/cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/egg-watcher": { + "version": "3.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/egg-watcher/-/egg-watcher-3.1.1.tgz", + "integrity": "sha512-fLo8f2GD9kSrAKeDoXaCckl9MaMMwTEkqU9gVDYWYGPYLsmX79ugA+Wo/2RGQkytsxSCk3bn8YqhPdMzsozgWA==", + "dependencies": { + "camelcase": "^5.0.0", + "sdk-base": "^3.5.0", + "wt": "^1.2.0" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/egg-watcher/node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/egg-watcher/node_modules/sdk-base": { + "version": "3.6.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/sdk-base/-/sdk-base-3.6.0.tgz", + "integrity": "sha512-jxHUIrRLlAoRFRwiXKhOGjd6BeFWO/jz7tv+E7lbMSef6F9jzFN2Sv3hLW58oDDKscKaBGG6vQdkbXn7isE7fw==", + "license": "MIT", + "dependencies": { + "await-event": "^2.1.0", + "await-first": "^1.0.0", + "co": "^4.6.0", + "is-type-of": "^1.2.1" + } + }, + "node_modules/ejs": { + "version": "5.0.1", + "resolved": "https://mirrors.cloud.tencent.com/npm/ejs/-/ejs-5.0.1.tgz", + "integrity": "sha512-COqBPFMxuPTPspXl2DkVYaDS3HtrD1GpzOGkNTJ1IYkifq/r9h8SVEFrjA3D9/VJGOEoMQcrlhpntcSUrM8k6A==", + "license": "Apache-2.0", + "bin": { + "ejs": "bin/cli.js" + }, + "engines": { + "node": ">=0.12.18" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.5.248", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/electron-to-chromium/-/electron-to-chromium-1.5.248.tgz", + "integrity": "sha512-zsur2yunphlyAO4gIubdJEXCK6KOVvtpiuDfCIqbM9FjcnMYiyn0ICa3hWfPr0nc41zcLWobgy1iL7VvoOyA2Q==", + "dev": true, + "license": "ISC" + }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true, + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/end-of-stream/-/end-of-stream-1.4.5.tgz", + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/enquirer": { + "version": "2.4.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/enquirer/-/enquirer-2.4.1.tgz", + "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-colors": "^4.1.1", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/es-abstract": { + "version": "1.24.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/es-abstract/-/es-abstract-1.24.0.tgz", + "integrity": "sha512-WSzPgsdLtTcQwm4CROfS5ju2Wa1QQcVeT37jFjYzdFz1r9ahadC8B8/a4qxJxM+09F18iumCdRmlr96ZYkQvEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.2", + "arraybuffer.prototype.slice": "^1.0.4", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "data-view-buffer": "^1.0.2", + "data-view-byte-length": "^1.0.2", + "data-view-byte-offset": "^1.0.1", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "es-set-tostringtag": "^2.1.0", + "es-to-primitive": "^1.3.0", + "function.prototype.name": "^1.1.8", + "get-intrinsic": "^1.3.0", + "get-proto": "^1.0.1", + "get-symbol-description": "^1.1.0", + "globalthis": "^1.0.4", + "gopd": "^1.2.0", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "internal-slot": "^1.1.0", + "is-array-buffer": "^3.0.5", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.2", + "is-negative-zero": "^2.0.3", + "is-regex": "^1.2.1", + "is-set": "^2.0.3", + "is-shared-array-buffer": "^1.0.4", + "is-string": "^1.1.1", + "is-typed-array": "^1.1.15", + "is-weakref": "^1.1.1", + "math-intrinsics": "^1.1.0", + "object-inspect": "^1.13.4", + "object-keys": "^1.1.1", + "object.assign": "^4.1.7", + "own-keys": "^1.0.1", + "regexp.prototype.flags": "^1.5.4", + "safe-array-concat": "^1.1.3", + "safe-push-apply": "^1.0.0", + "safe-regex-test": "^1.1.0", + "set-proto": "^1.0.0", + "stop-iteration-iterator": "^1.1.0", + "string.prototype.trim": "^1.2.10", + "string.prototype.trimend": "^1.0.9", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.3", + "typed-array-byte-length": "^1.0.3", + "typed-array-byte-offset": "^1.0.4", + "typed-array-length": "^1.0.7", + "unbox-primitive": "^1.1.0", + "which-typed-array": "^1.1.19" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-iterator-helpers": { + "version": "1.2.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/es-iterator-helpers/-/es-iterator-helpers-1.2.1.tgz", + "integrity": "sha512-uDn+FE1yrDzyC0pCo961B2IHbdM8y/ACZsKD4dG6WqrjV53BADjwa7D+1aom2rsNVfLyDgU/eigvlJGJ08OQ4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.6", + "es-errors": "^1.3.0", + "es-set-tostringtag": "^2.0.3", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.6", + "globalthis": "^1.0.4", + "gopd": "^1.2.0", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "internal-slot": "^1.1.0", + "iterator.prototype": "^1.1.4", + "safe-array-concat": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-shim-unscopables": { + "version": "1.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/es-shim-unscopables/-/es-shim-unscopables-1.1.0.tgz", + "integrity": "sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-to-primitive": { + "version": "1.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/es-to-primitive/-/es-to-primitive-1.3.0.tgz", + "integrity": "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-callable": "^1.2.7", + "is-date-object": "^1.0.5", + "is-symbol": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/eslint": { + "version": "8.57.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/eslint/-/eslint-8.57.1.tgz", + "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", + "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.1", + "@humanwhocodes/config-array": "^0.13.0", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-config-egg": { + "version": "13.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/eslint-config-egg/-/eslint-config-egg-13.1.0.tgz", + "integrity": "sha512-Jubl5uvuIbAFrC+lb80hzmcL0o5hwyf4u5puK7d8qEk88FKo/6Xw52VAy58B/glbIMzIPXaXfoYY3AVzAvxRvQ==", + "dev": true, + "dependencies": { + "@babel/core": "^7.16.0", + "@babel/eslint-parser": "^7.16.3", + "@typescript-eslint/eslint-plugin": "^6.7.0", + "@typescript-eslint/parser": "^6.7.0", + "eslint-plugin-eggache": "^2.0.0", + "eslint-plugin-import": "^2.29.1", + "eslint-plugin-jsdoc": "^46.9.1", + "eslint-plugin-jsx-a11y": "^6.8.0", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-react": "^7.33.2" + }, + "engines": { + "node": ">= 16.0.0" + } + }, + "node_modules/eslint-import-resolver-node": { + "version": "0.3.9", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", + "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^3.2.7", + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" + } + }, + "node_modules/eslint-module-utils": { + "version": "2.12.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/eslint-module-utils/-/eslint-module-utils-2.12.1.tgz", + "integrity": "sha512-L8jSWTze7K2mTg0vos/RuLRS5soomksDPoJLXIslC7c8Wmut3bx7CPpJijDcBZtxQ5lrbUdM+s0OlNbz0DCDNw==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^3.2.7" + }, + "engines": { + "node": ">=4" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-eggache": { + "version": "2.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/eslint-plugin-eggache/-/eslint-plugin-eggache-2.0.0.tgz", + "integrity": "sha512-IHPrZ8LZgTRJTN5e6bXEgmv4vE0yDTAYFgHyvlf2KED8gRSiZ/kVPur+VHjpV4/8OVGJg2YaNEqsiBHxgMCKyA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.17.0" + } + }, + "node_modules/eslint-plugin-es": { + "version": "3.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/eslint-plugin-es/-/eslint-plugin-es-3.0.1.tgz", + "integrity": "sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-utils": "^2.0.0", + "regexpp": "^3.0.0" + }, + "engines": { + "node": ">=8.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=4.19.1" + } + }, + "node_modules/eslint-plugin-import": { + "version": "2.32.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/eslint-plugin-import/-/eslint-plugin-import-2.32.0.tgz", + "integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rtsao/scc": "^1.1.0", + "array-includes": "^3.1.9", + "array.prototype.findlastindex": "^1.2.6", + "array.prototype.flat": "^1.3.3", + "array.prototype.flatmap": "^1.3.3", + "debug": "^3.2.7", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.9", + "eslint-module-utils": "^2.12.1", + "hasown": "^2.0.2", + "is-core-module": "^2.16.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.fromentries": "^2.0.8", + "object.groupby": "^1.0.3", + "object.values": "^1.2.1", + "semver": "^6.3.1", + "string.prototype.trimend": "^1.0.9", + "tsconfig-paths": "^3.15.0" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9" + } + }, + "node_modules/eslint-plugin-import/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint-plugin-import/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-import/node_modules/json5": { + "version": "1.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/eslint-plugin-import/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/eslint-plugin-import/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/eslint-plugin-import/node_modules/tsconfig-paths": { + "version": "3.15.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, + "node_modules/eslint-plugin-jsdoc": { + "version": "46.10.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-46.10.1.tgz", + "integrity": "sha512-x8wxIpv00Y50NyweDUpa+58ffgSAI5sqe+zcZh33xphD0AVh+1kqr1ombaTRb7Fhpove1zfUuujlX9DWWBP5ag==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@es-joy/jsdoccomment": "~0.41.0", + "are-docs-informative": "^0.0.2", + "comment-parser": "1.4.1", + "debug": "^4.3.4", + "escape-string-regexp": "^4.0.0", + "esquery": "^1.5.0", + "is-builtin-module": "^3.2.1", + "semver": "^7.5.4", + "spdx-expression-parse": "^4.0.0" + }, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0" + } + }, + "node_modules/eslint-plugin-jsdoc/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-jsdoc/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint-plugin-jsdoc/node_modules/semver": { + "version": "7.7.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-plugin-jsx-a11y": { + "version": "6.10.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.10.2.tgz", + "integrity": "sha512-scB3nz4WmG75pV8+3eRUQOHZlNSUhFNq37xnpgRkCCELU3XMvXAxLk1eqWWyE22Ki4Q01Fnsw9BA3cJHDPgn2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "aria-query": "^5.3.2", + "array-includes": "^3.1.8", + "array.prototype.flatmap": "^1.3.2", + "ast-types-flow": "^0.0.8", + "axe-core": "^4.10.0", + "axobject-query": "^4.1.0", + "damerau-levenshtein": "^1.0.8", + "emoji-regex": "^9.2.2", + "hasown": "^2.0.2", + "jsx-ast-utils": "^3.3.5", + "language-tags": "^1.0.9", + "minimatch": "^3.1.2", + "object.fromentries": "^2.0.8", + "safe-regex-test": "^1.0.3", + "string.prototype.includes": "^2.0.1" + }, + "engines": { + "node": ">=4.0" + }, + "peerDependencies": { + "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9" + } + }, + "node_modules/eslint-plugin-jsx-a11y/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint-plugin-jsx-a11y/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/eslint-plugin-node": { + "version": "11.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz", + "integrity": "sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-plugin-es": "^3.0.0", + "eslint-utils": "^2.0.0", + "ignore": "^5.1.1", + "minimatch": "^3.0.4", + "resolve": "^1.10.1", + "semver": "^6.1.0" + }, + "engines": { + "node": ">=8.10.0" + }, + "peerDependencies": { + "eslint": ">=5.16.0" + } + }, + "node_modules/eslint-plugin-node/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint-plugin-node/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/eslint-plugin-node/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/eslint-plugin-react": { + "version": "7.37.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/eslint-plugin-react/-/eslint-plugin-react-7.37.5.tgz", + "integrity": "sha512-Qteup0SqU15kdocexFNAJMvCJEfa2xUKNV4CC1xsVMrIIqEy3SQ/rqyxCWNzfrd3/ldy6HMlD2e0JDVpDg2qIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-includes": "^3.1.8", + "array.prototype.findlast": "^1.2.5", + "array.prototype.flatmap": "^1.3.3", + "array.prototype.tosorted": "^1.1.4", + "doctrine": "^2.1.0", + "es-iterator-helpers": "^1.2.1", + "estraverse": "^5.3.0", + "hasown": "^2.0.2", + "jsx-ast-utils": "^2.4.1 || ^3.0.0", + "minimatch": "^3.1.2", + "object.entries": "^1.1.9", + "object.fromentries": "^2.0.8", + "object.values": "^1.2.1", + "prop-types": "^15.8.1", + "resolve": "^2.0.0-next.5", + "semver": "^6.3.1", + "string.prototype.matchall": "^4.0.12", + "string.prototype.repeat": "^1.0.0" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7" + } + }, + "node_modules/eslint-plugin-react/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint-plugin-react/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-react/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/eslint-plugin-react/node_modules/resolve": { + "version": "2.0.0-next.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/resolve/-/resolve-2.0.0-next.5.tgz", + "integrity": "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/eslint-plugin-react/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-utils": { + "version": "2.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^1.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/eslint/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/eslint/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/eslint/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/eslint/node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/eslint/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/eslint/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/eslint/node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/which": { + "version": "2.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.6.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/event-stream": { + "version": "3.3.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/event-stream/-/event-stream-3.3.4.tgz", + "integrity": "sha512-QHpkERcGsR0T7Qm3HNJSyXKEEj8AHNxkY3PK8TS2KJvQ7NiSHe3DDpwVKKtoYprL/AreyzFBeIkBIWChAqn60g==", + "license": "MIT", + "dependencies": { + "duplexer": "~0.1.1", + "from": "~0", + "map-stream": "~0.1.0", + "pause-stream": "0.0.11", + "split": "0.3", + "stream-combiner": "~0.0.4", + "through": "~2.3.1" + } + }, + "node_modules/execa": { + "version": "5.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/execa/node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/execa/node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/execa/node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/execa/node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/execa/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/execa/node_modules/which": { + "version": "2.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "license": "MIT" + }, + "node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "license": "MIT", + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extend2": { + "version": "1.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/extend2/-/extend2-1.0.1.tgz", + "integrity": "sha512-ISoKeVhtewd5YHzMo+r9KC3Zx0fdpNBqoRzot+6BeEQ3bWQYQQOt0jkkY5gLveI2e7j+vdCJKeszHJIbg2Uceg==", + "license": "MIT" + }, + "node_modules/extsprintf": { + "version": "1.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", + "engines": [ + "node >=0.6.0" + ], + "license": "MIT" + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "license": "MIT" + }, + "node_modules/fast-glob": { + "version": "3.3.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-safe-stringify": { + "version": "2.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-xml-parser": { + "version": "5.3.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/fast-xml-parser/-/fast-xml-parser-5.3.1.tgz", + "integrity": "sha512-jbNkWiv2Ec1A7wuuxk0br0d0aTMUtQ4IkL+l/i1r9PRf6pLXjDgsBsWwO+UyczmQlnehi4Tbc8/KIvxGQe+I/A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT", + "dependencies": { + "strnum": "^2.1.0" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, + "node_modules/fastq": { + "version": "1.19.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/fastq/-/fastq-1.19.1.tgz", + "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/figures": { + "version": "3.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/filelist": { + "version": "1.0.6", + "resolved": "https://mirrors.cloud.tencent.com/npm/filelist/-/filelist-1.0.6.tgz", + "integrity": "sha512-5giy2PkLYY1cP39p17Ech+2xlpTRL9HLspOfEgm0L6CwBXBTgsK5ou0JtzYuepxkaQ/tvhCFIJ5uXo0OrM2DxA==", + "license": "Apache-2.0", + "dependencies": { + "minimatch": "^5.0.1" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, + "license": "BSD-3-Clause", + "bin": { + "flat": "cli.js" + } + }, + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.3.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", + "dev": true, + "license": "ISC" + }, + "node_modules/follow-redirects": { + "version": "1.15.11", + "resolved": "https://mirrors.cloud.tencent.com/npm/follow-redirects/-/follow-redirects-1.15.11.tgz", + "integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/for-each": { + "version": "0.3.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/for-each/-/for-each-0.3.5.tgz", + "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-callable": "^1.2.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/foreground-child": { + "version": "3.3.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/foreground-child/node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/foreground-child/node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/foreground-child/node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/foreground-child/node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/foreground-child/node_modules/which": { + "version": "2.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/forever-agent": { + "version": "0.6.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", + "license": "Apache-2.0", + "engines": { + "node": "*" + } + }, + "node_modules/form-data": { + "version": "4.0.5", + "resolved": "https://mirrors.cloud.tencent.com/npm/form-data/-/form-data-4.0.5.tgz", + "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/form-data-encoder": { + "version": "1.9.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/form-data-encoder/-/form-data-encoder-1.9.0.tgz", + "integrity": "sha512-rahaRMkN8P8d/tgK/BLPX+WBVM27NbvdXBxqQujBtkDAIFspaRqN7Od7lfdGQA6KAD+f82fYCLBq1ipvcu8qLw==", + "license": "MIT" + }, + "node_modules/formdata-node": { + "version": "4.4.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/formdata-node/-/formdata-node-4.4.1.tgz", + "integrity": "sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==", + "license": "MIT", + "dependencies": { + "node-domexception": "1.0.0", + "web-streams-polyfill": "4.0.0-beta.3" + }, + "engines": { + "node": ">= 12.20" + } + }, + "node_modules/formidable": { + "version": "2.1.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/formidable/-/formidable-2.1.5.tgz", + "integrity": "sha512-Oz5Hwvwak/DCaXVVUtPn4oLMLLy1CdclLKO1LFgU7XzDpVMUU5UjlSLpGMocyQNNk8F6IJW9M/YdooSn2MRI+Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@paralleldrive/cuid2": "^2.2.2", + "dezalgo": "^1.0.4", + "once": "^1.4.0", + "qs": "^6.11.0" + }, + "funding": { + "url": "https://ko-fi.com/tunnckoCore/commissions" + } + }, + "node_modules/formstream": { + "version": "1.5.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/formstream/-/formstream-1.5.2.tgz", + "integrity": "sha512-NASf0lgxC1AyKNXQIrXTEYkiX99LhCEXTkiGObXAkpBui86a4u8FjH1o2bGb3PpqI3kafC+yw4zWeK6l6VHTgg==", + "license": "MIT", + "dependencies": { + "destroy": "^1.0.4", + "mime": "^2.5.2", + "node-hex": "^1.0.1", + "pause-stream": "~0.0.11" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/from": { + "version": "0.1.7", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/from/-/from-0.1.7.tgz", + "integrity": "sha512-twe20eF1OxVxp/ML/kq2p1uc6KvFK/+vs8WjEbeKmV2He22MKm7YF2ANIt+EOqhJ5L3K/SuuPhk0hWQDjOM23g==", + "license": "MIT" + }, + "node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/fs-readdir-recursive": { + "version": "1.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", + "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==", + "license": "MIT" + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "license": "ISC" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/fsu": { + "version": "1.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/fsu/-/fsu-1.1.1.tgz", + "integrity": "sha512-xQVsnjJ/5pQtcKh+KjUoZGzVWn4uNkchxTF6Lwjr4Gf7nQr8fmUfhKJ62zE77+xQg9xnxi5KUps7XGs+VC986A==", + "dev": true, + "license": "MIT" + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/function.prototype.name": { + "version": "1.1.8", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/function.prototype.name/-/function.prototype.name-1.1.8.tgz", + "integrity": "sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "functions-have-names": "^1.2.3", + "hasown": "^2.0.2", + "is-callable": "^1.2.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gals": { + "version": "1.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/gals/-/gals-1.0.2.tgz", + "integrity": "sha512-h5c1Q6Q2cnRkO2v8ZxbuFCNRpM96CjGxGuoNcThoNF3dAEEYagF166EqJmaa9r2/I+ryij8TO3yMmqrMvQ1YXw==", + "license": "MIT", + "engines": { + "node": ">= 16.0.0" + } + }, + "node_modules/generate-function": { + "version": "2.3.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/generate-function/-/generate-function-2.3.1.tgz", + "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", + "license": "MIT", + "dependencies": { + "is-property": "^1.0.2" + } + }, + "node_modules/generator-function": { + "version": "2.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/generator-function/-/generator-function-2.0.1.tgz", + "integrity": "sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/get-ready": { + "version": "2.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/get-ready/-/get-ready-2.0.1.tgz", + "integrity": "sha512-q2zoHPGbHognNvofksty0SOrviWowfUVxYcv3j3+Mf1BRRMHmq6q/1pciravEf8jkSL5iovloMWnonEc2QOpqA==", + "license": "MIT", + "dependencies": { + "is-type-of": "^1.0.0" + }, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/get-ready/node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-symbol-description": { + "version": "1.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/get-symbol-description/-/get-symbol-description-1.1.0.tgz", + "integrity": "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/getpass": { + "version": "0.1.7", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", + "license": "MIT", + "dependencies": { + "assert-plus": "^1.0.0" + } + }, + "node_modules/glob": { + "version": "8.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globals": { + "version": "13.24.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globals/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globalthis": { + "version": "1.0.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-properties": "^1.2.1", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "license": "MIT", + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful": { + "version": "1.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/graceful/-/graceful-1.1.0.tgz", + "integrity": "sha512-sImEQVLLBo8hSeX4Vp6HVdWSdqCkHoVlZwBuBL65tNwcPTvnMaW40iWs1vdCbyP0znkCEuvv6rZ37QPloPi9Fw==", + "license": "MIT", + "dependencies": { + "humanize-ms": "^1.2.1", + "ps-tree": "^1.1.0" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/graceful-process": { + "version": "1.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/graceful-process/-/graceful-process-1.3.0.tgz", + "integrity": "sha512-tlldpcdxQgSgVD/A+OawlyjGU9Z+wbBTI6QroGo4u6znQNLgglp+V2KnixRHUXRttnrCpbQSSCJ6wvsMkzR9Aw==", + "license": "MIT", + "dependencies": { + "is-type-of": "^1.2.0", + "once": "^1.4.0" + } + }, + "node_modules/graceful-process/node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true, + "license": "MIT" + }, + "node_modules/har-schema": { + "version": "2.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", + "license": "ISC", + "engines": { + "node": ">=4" + } + }, + "node_modules/har-validator": { + "version": "5.1.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "deprecated": "this library is no longer supported", + "license": "MIT", + "dependencies": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/has-bigints": { + "version": "1.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/has-bigints/-/has-bigints-1.1.0.tgz", + "integrity": "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/has-proto/-/has-proto-1.2.0.tgz", + "integrity": "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "license": "MIT", + "bin": { + "he": "bin/he" + } + }, + "node_modules/header-case": { + "version": "1.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/header-case/-/header-case-1.0.1.tgz", + "integrity": "sha512-i0q9mkOeSuhXw6bGgiQCCBgY/jlZuV/7dZXyZ9c6LcBrqwvT8eT719E9uxE5LiZftdl+z81Ugbg/VvXV4OJOeQ==", + "license": "MIT", + "dependencies": { + "no-case": "^2.2.0", + "upper-case": "^1.1.3" + } + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true, + "license": "MIT" + }, + "node_modules/http-assert": { + "version": "1.5.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/http-assert/-/http-assert-1.5.0.tgz", + "integrity": "sha512-uPpH7OKX4H25hBmU6G1jWNaqJGpTXxey+YOUizJUAgu0AjLUeC8D73hTrhvDS5D+GJN1DN1+hhc/eF/wpxtp0w==", + "license": "MIT", + "dependencies": { + "deep-equal": "~1.0.1", + "http-errors": "~1.8.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/http-errors": { + "version": "1.8.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/http-errors/-/http-errors-1.8.1.tgz", + "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", + "license": "MIT", + "dependencies": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/http-errors/node_modules/depd": { + "version": "1.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/depd/-/depd-1.1.2.tgz", + "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/http-errors/node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/http-signature": { + "version": "1.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", + "license": "MIT", + "dependencies": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + }, + "engines": { + "node": ">=0.8", + "npm": ">=1.3.7" + } + }, + "node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/humanize-bytes": { + "version": "1.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/humanize-bytes/-/humanize-bytes-1.0.1.tgz", + "integrity": "sha512-OZMIHt5YhQM4S3R82KGoKnWv4vaNnWuEhPAK+u5v7rD2tRM3DU2NghYEHipAPYwyTR6+fMVZQ9ETpZIZeZUapQ==", + "license": "MIT", + "dependencies": { + "bytes": "~2.2.0" + } + }, + "node_modules/humanize-ms": { + "version": "1.2.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.0.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflation": { + "version": "2.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/inflation/-/inflation-2.1.0.tgz", + "integrity": "sha512-t54PPJHG1Pp7VQvxyVCJ9mBbjG3Hqryges9bXoOO6GExCPa+//i/d5GSuFtpx3ALLd7lgIAur6zrIlBQyJuMlQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/inflection": { + "version": "1.13.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/inflection/-/inflection-1.13.4.tgz", + "integrity": "sha512-6I/HUDeYFfuNCVS3td055BaXBwKYuzw7K3ExVMStBowKo9oOAMJIXIHvdyR3iboTCp1b+1i5DSkIZTcwIktuDw==", + "engines": [ + "node >= 0.4.0" + ], + "license": "MIT" + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "license": "ISC" + }, + "node_modules/inquirer": { + "version": "8.2.7", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/inquirer/-/inquirer-8.2.7.tgz", + "integrity": "sha512-UjOaSel/iddGZJ5xP/Eixh6dY1XghiBw4XK13rCCIJcJfyhhoul/7KhLLUGtebEj6GDYM6Vnx/mVsjx2L/mFIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/external-editor": "^1.0.0", + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.1", + "cli-cursor": "^3.1.0", + "cli-width": "^3.0.0", + "figures": "^3.0.0", + "lodash": "^4.17.21", + "mute-stream": "0.0.8", + "ora": "^5.4.1", + "run-async": "^2.4.0", + "rxjs": "^7.5.5", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6", + "wrap-ansi": "^6.0.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/inquirer/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/inquirer/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/inquirer/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/inquirer/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/inquirer/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/inquirer/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/internal-slot": { + "version": "1.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/internal-slot/-/internal-slot-1.1.0.tgz", + "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "hasown": "^2.0.2", + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ioredis": { + "version": "4.30.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ioredis/-/ioredis-4.30.1.tgz", + "integrity": "sha512-17Ed70njJ7wT7JZsdTVLb0j/cmwHwfQCFu+AP6jY7nFKd+CA7MBW7nX121mM64eT8S9ekAVtYYt8nGQPmm3euA==", + "license": "MIT", + "dependencies": { + "@ioredis/commands": "^1.0.2", + "cluster-key-slot": "^1.1.0", + "debug": "^4.3.1", + "denque": "^1.1.0", + "lodash.defaults": "^4.2.0", + "lodash.flatten": "^4.4.0", + "lodash.isarguments": "^3.1.0", + "p-map": "^2.1.0", + "redis-errors": "^1.2.0", + "redis-parser": "^3.0.0", + "standard-as-callback": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/ioredis" + } + }, + "node_modules/ioredis/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-array-buffer/-/is-array-buffer-3.0.5.tgz", + "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-async-function": { + "version": "2.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-async-function/-/is-async-function-2.1.1.tgz", + "integrity": "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "async-function": "^1.0.0", + "call-bound": "^1.0.3", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-bigint": { + "version": "1.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-bigint/-/is-bigint-1.1.0.tgz", + "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-bigints": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-boolean-object": { + "version": "1.2.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-boolean-object/-/is-boolean-object-1.2.2.tgz", + "integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-builtin-module": { + "version": "3.2.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-builtin-module/-/is-builtin-module-3.2.1.tgz", + "integrity": "sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==", + "dev": true, + "license": "MIT", + "dependencies": { + "builtin-modules": "^3.3.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-class-hotfix": { + "version": "0.0.6", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-class-hotfix/-/is-class-hotfix-0.0.6.tgz", + "integrity": "sha512-0n+pzCC6ICtVr/WXnN2f03TK/3BfXY7me4cjCAqT8TYXEl0+JBRoqBo94JJHXcyDSLUeWbNX8Fvy5g5RJdAstQ==", + "license": "MIT" + }, + "node_modules/is-core-module": { + "version": "2.16.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-view": { + "version": "1.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-data-view/-/is-data-view-1.0.2.tgz", + "integrity": "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-date-object/-/is-date-object-1.1.0.tgz", + "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-finalizationregistry": { + "version": "1.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz", + "integrity": "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-generator-function": { + "version": "1.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-generator-function/-/is-generator-function-1.1.2.tgz", + "integrity": "sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.4", + "generator-function": "^2.0.0", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-interactive": { + "version": "1.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-lower-case": { + "version": "1.1.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-lower-case/-/is-lower-case-1.1.3.tgz", + "integrity": "sha512-+5A1e/WJpLLXZEDlgz4G//WYSHyQBD32qa4Jd3Lw06qQlv3fJHnp3YIHjTQSGzHMgzmVKz2ZP3rBxTHkPw/lxA==", + "license": "MIT", + "dependencies": { + "lower-case": "^1.1.0" + } + }, + "node_modules/is-map": { + "version": "2.0.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-map/-/is-map-2.0.3.tgz", + "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-nan": { + "version": "1.3.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-nan/-/is-nan-1.3.2.tgz", + "integrity": "sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-number-object": { + "version": "1.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-number-object/-/is-number-object-1.1.1.tgz", + "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-obj": { + "version": "1.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha512-l4RyHgRqGN4Y3+9JHVrNqO+tN0rV5My76uW5/nuO4K1b6vw5G8d/cmFjP9tRfEsdhZNt0IFdZuK/c2Vr4Nb+Qg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-property": { + "version": "1.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-property/-/is-property-1.0.2.tgz", + "integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==", + "license": "MIT" + }, + "node_modules/is-regex": { + "version": "1.2.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-set": { + "version": "2.0.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-set/-/is-set-2.0.3.tgz", + "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", + "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-string": { + "version": "1.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-string/-/is-string-1.1.1.tgz", + "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-symbol/-/is-symbol-1.1.1.tgz", + "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "has-symbols": "^1.1.0", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-type-of": { + "version": "2.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-type-of/-/is-type-of-2.2.0.tgz", + "integrity": "sha512-72axShMJMnMy5HSU/jLGNOonZD5rWM0MwJSCYpKCTQCbggQZBJO/CLMMVP5HgS8kPSYFBkTysJexsD6NMvGKDQ==", + "license": "MIT" + }, + "node_modules/is-typed-array": { + "version": "1.1.15", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-typed-array/-/is-typed-array-1.1.15.tgz", + "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", + "license": "MIT" + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-upper-case": { + "version": "1.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-upper-case/-/is-upper-case-1.1.2.tgz", + "integrity": "sha512-GQYSJMgfeAmVwh9ixyk888l7OIhNAGKtY6QA+IrWlu9MDTCaXmeozOZ2S9Knj7bQwBO/H6J2kb+pbyTUiMNbsw==", + "license": "MIT", + "dependencies": { + "upper-case": "^1.1.0" + } + }, + "node_modules/is-weakmap": { + "version": "2.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-weakmap/-/is-weakmap-2.0.2.tgz", + "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakref": { + "version": "1.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-weakref/-/is-weakref-1.1.1.tgz", + "integrity": "sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakset": { + "version": "2.0.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-weakset/-/is-weakset-2.0.4.tgz", + "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/isstream": { + "version": "0.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", + "license": "MIT" + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-reports": { + "version": "3.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/istanbul-reports/-/istanbul-reports-3.2.0.tgz", + "integrity": "sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/iterator.prototype": { + "version": "1.1.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/iterator.prototype/-/iterator.prototype-1.1.5.tgz", + "integrity": "sha512-H0dkQoCa3b2VEeKQBOxFph+JAbcrQdE7KC0UkqwpLmv2EC4P41QXP+rqo9wYodACiG5/WM5s9oDApTU8utwj9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.6", + "get-proto": "^1.0.0", + "has-symbols": "^1.1.0", + "set-function-name": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/jake": { + "version": "10.9.4", + "resolved": "https://mirrors.cloud.tencent.com/npm/jake/-/jake-10.9.4.tgz", + "integrity": "sha512-wpHYzhxiVQL+IV05BLE2Xn34zW1S223hvjtqk0+gsPrwd/8JNLXJgZZM/iPFsYc1xyphF+6M6EvdE5E9MBGkDA==", + "license": "Apache-2.0", + "dependencies": { + "async": "^3.2.6", + "filelist": "^1.0.4", + "picocolors": "^1.1.1" + }, + "bin": { + "jake": "bin/cli.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jake/node_modules/async": { + "version": "3.2.6", + "resolved": "https://mirrors.cloud.tencent.com/npm/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "license": "MIT" + }, + "node_modules/jest-changed-files": { + "version": "29.7.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/jest-changed-files/-/jest-changed-files-29.7.0.tgz", + "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", + "dev": true, + "license": "MIT", + "dependencies": { + "execa": "^5.0.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-util": { + "version": "29.7.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-util/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-util/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-util/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-util/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-util/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-util/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/js-beautify": { + "version": "1.15.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/js-beautify/-/js-beautify-1.15.4.tgz", + "integrity": "sha512-9/KXeZUKKJwqCXUdBxFJ3vPh467OCckSBmYDwSK/EtV090K+iMJ7zx2S3HLVDIWFQdqMIsZWbnaGiba18aWhaA==", + "dev": true, + "license": "MIT", + "dependencies": { + "config-chain": "^1.1.13", + "editorconfig": "^1.0.4", + "glob": "^10.4.2", + "js-cookie": "^3.0.5", + "nopt": "^7.2.1" + }, + "bin": { + "css-beautify": "js/bin/css-beautify.js", + "html-beautify": "js/bin/html-beautify.js", + "js-beautify": "js/bin/js-beautify.js" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/js-beautify/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/js-beautify/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/js-cookie": { + "version": "3.0.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/js-cookie/-/js-cookie-3.0.5.tgz", + "integrity": "sha512-cEiJEAEoIbWfCZYKWhVwFuvPX1gETRYPw6LlaTKoxD3s2AkXzkCjnp6h0V77ozyqj0jakteJ4YqDJT830+lVGw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/js-md4": { + "version": "0.3.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/js-md4/-/js-md4-0.3.2.tgz", + "integrity": "sha512-/GDnfQYsltsjRswQhN9fhv3EMw2sCpUdrdxyWDOUK7eyD++r3gRhzgiQgc/x4MAv2i1iuQ4lxO5mvqM3vj4bwA==", + "license": "MIT" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsbn": { + "version": "0.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", + "license": "MIT" + }, + "node_modules/jsdoc-type-pratt-parser": { + "version": "4.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.0.0.tgz", + "integrity": "sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema": { + "version": "0.4.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/json-schema/-/json-schema-0.4.0.tgz", + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", + "license": "(AFL-2.1 OR BSD-3-Clause)" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "license": "MIT" + }, + "node_modules/json-schema-typed": { + "version": "7.0.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/json-schema-typed/-/json-schema-typed-7.0.3.tgz", + "integrity": "sha512-7DE8mpG+/fVw+dTpjbxnx47TaMnDfOI1jwft9g1VybltZCduyRQPJPvc+zzKY9WPHxhPWczyFuYa6I8Mw4iU5A==", + "license": "BSD-2-Clause" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "license": "ISC" + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsonfile": { + "version": "6.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/jsonfile/-/jsonfile-6.2.0.tgz", + "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", + "dev": true, + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jsonp-body": { + "version": "1.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/jsonp-body/-/jsonp-body-1.1.0.tgz", + "integrity": "sha512-ZQyNWgHI8vvqclzz0l4/PatmeGureejrdMiLQGxTupMw0yQMHf+pQwS/7d5tpo2NBHsuwLCmXvZeNiz2RKdklA==", + "license": "MIT", + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/jsonwebtoken": { + "version": "8.5.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", + "integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==", + "license": "MIT", + "dependencies": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^5.6.0" + }, + "engines": { + "node": ">=4", + "npm": ">=1.4.28" + } + }, + "node_modules/jsprim": { + "version": "1.4.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/jsprim/-/jsprim-1.4.2.tgz", + "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", + "license": "MIT", + "dependencies": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.4.0", + "verror": "1.10.0" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/jsx-ast-utils": { + "version": "3.3.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", + "integrity": "sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-includes": "^3.1.6", + "array.prototype.flat": "^1.3.1", + "object.assign": "^4.1.4", + "object.values": "^1.1.6" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/jwa": { + "version": "1.4.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/jwa/-/jwa-1.4.2.tgz", + "integrity": "sha512-eeH5JO+21J78qMvTIDdBXidBd6nG2kZjg5Ohz/1fpa28Z4CcsWUzJ1ZZyFq/3z3N17aZy+ZuBoHljASbL1WfOw==", + "license": "MIT", + "dependencies": { + "buffer-equal-constant-time": "^1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jws": { + "version": "3.2.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/jws/-/jws-3.2.3.tgz", + "integrity": "sha512-byiJ0FLRdLdSVSReO/U4E7RoEyOCKnEnEPMjq3HxWtvzLsV08/i5RQKsFVNkCldrCaPr2vDNAOMsfs8T/Hze7g==", + "license": "MIT", + "dependencies": { + "jwa": "^1.4.2", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/keygrip": { + "version": "1.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/keygrip/-/keygrip-1.1.0.tgz", + "integrity": "sha512-iYSchDJ+liQ8iwbSI2QqsQOvqv58eJCEanyJPJi+Khyu8smkcKSFUCbPwzFcL7YVtZ6eONjqRX/38caJ7QjRAQ==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "license": "MIT", + "dependencies": { + "tsscmp": "1.0.6" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/ko-sleep": { + "version": "1.1.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ko-sleep/-/ko-sleep-1.1.4.tgz", + "integrity": "sha512-s05WGpvvzyTuRlRE8fM7ru2Z3O+InbJuBcckTWKg2W+2c1k6SnFa3IfiSSt0/peFrlYAXgNoxuJWWVNmWh+K/A==", + "license": "MIT", + "dependencies": { + "ms": "*" + } + }, + "node_modules/koa": { + "version": "2.16.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/koa/-/koa-2.16.3.tgz", + "integrity": "sha512-zPPuIt+ku1iCpFBRwseMcPYQ1cJL8l60rSmKeOuGfOXyE6YnTBmf2aEFNL2HQGrD0cPcLO/t+v9RTgC+fwEh/g==", + "license": "MIT", + "dependencies": { + "accepts": "^1.3.5", + "cache-content-type": "^1.0.0", + "content-disposition": "~0.5.2", + "content-type": "^1.0.4", + "cookies": "~0.9.0", + "debug": "^4.3.2", + "delegates": "^1.0.0", + "depd": "^2.0.0", + "destroy": "^1.0.4", + "encodeurl": "^1.0.2", + "escape-html": "^1.0.3", + "fresh": "~0.5.2", + "http-assert": "^1.3.0", + "http-errors": "^1.6.3", + "is-generator-function": "^1.0.7", + "koa-compose": "^4.1.0", + "koa-convert": "^2.0.0", + "on-finished": "^2.3.0", + "only": "~0.0.2", + "parseurl": "^1.3.2", + "statuses": "^1.5.0", + "type-is": "^1.6.16", + "vary": "^1.1.2" + }, + "engines": { + "node": "^4.8.4 || ^6.10.1 || ^7.10.1 || >= 8.1.4" + } + }, + "node_modules/koa-bodyparser": { + "version": "4.4.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/koa-bodyparser/-/koa-bodyparser-4.4.1.tgz", + "integrity": "sha512-kBH3IYPMb+iAXnrxIhXnW+gXV8OTzCu8VPDqvcDHW9SQrbkHmqPQtiZwrltNmSq6/lpipHnT7k7PsjlVD7kK0w==", + "license": "MIT", + "dependencies": { + "co-body": "^6.0.0", + "copy-to": "^2.0.1", + "type-is": "^1.6.18" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/koa-compose": { + "version": "4.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/koa-compose/-/koa-compose-4.1.0.tgz", + "integrity": "sha512-8ODW8TrDuMYvXRwra/Kh7/rJo9BtOfPc6qO8eAfC80CnCvSjSl0bkRM24X6/XBBEyj0v1nRUQ1LyOy3dbqOWXw==", + "license": "MIT" + }, + "node_modules/koa-convert": { + "version": "1.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/koa-convert/-/koa-convert-1.2.0.tgz", + "integrity": "sha512-K9XqjmEDStGX09v3oxR7t5uPRy0jqJdvodHa6wxWTHrTfDq0WUNnYTOOUZN6g8OM8oZQXprQASbiIXG2Ez8ehA==", + "license": "MIT", + "dependencies": { + "co": "^4.6.0", + "koa-compose": "^3.0.0" + }, + "engines": { + "node": ">= 4" + } + }, + "node_modules/koa-convert/node_modules/koa-compose": { + "version": "3.2.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/koa-compose/-/koa-compose-3.2.1.tgz", + "integrity": "sha512-8gen2cvKHIZ35eDEik5WOo8zbVp9t4cP8p4hW4uE55waxolLRexKKrqfCpwhGVppnB40jWeF8bZeTVg99eZgPw==", + "license": "MIT", + "dependencies": { + "any-promise": "^1.1.0" + } + }, + "node_modules/koa-is-json": { + "version": "1.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/koa-is-json/-/koa-is-json-1.0.0.tgz", + "integrity": "sha512-+97CtHAlWDx0ndt0J8y3P12EWLwTLMXIfMnYDev3wOTwH/RpBGMlfn4bDXlMEg1u73K6XRE9BbUp+5ZAYoRYWw==", + "license": "MIT" + }, + "node_modules/koa-jwt2": { + "version": "1.0.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/koa-jwt2/-/koa-jwt2-1.0.3.tgz", + "integrity": "sha512-ACW/sQ21vlkR/HBXnGvJfM2yDkKnv1GZe6/1nro+Mt4+bWhJq007esu2h9oZcj2+nce47PXcan2rXVaKmX295w==", + "license": "MIT", + "dependencies": { + "async": "^1.5.0", + "jsonwebtoken": "^8.1.0", + "koa-unless": "^1.0.7", + "lodash.isfunction": "^3.0.9", + "lodash.set": "^4.0.0" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/koa-locales": { + "version": "1.12.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/koa-locales/-/koa-locales-1.12.0.tgz", + "integrity": "sha512-lalx0OuvdZ39JppTVqHnYKIgJJbByon9xpt5KSKFOL6/VQS+XBMklMX83+fgkCXzsNacynWaN75ihWP2EGsWIQ==", + "license": "MIT", + "dependencies": { + "debug": "^2.6.0", + "humanize-ms": "^1.2.0", + "ini": "^1.3.4", + "object-assign": "^4.1.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/koa-locales/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/koa-locales/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/koa-onerror": { + "version": "4.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/koa-onerror/-/koa-onerror-4.2.0.tgz", + "integrity": "sha512-D15tp5rxevHqqcvOiEDbtQolG6z3NpBNupz3EUZz43pjYv5SGMom2Xz1FKM8oTya56+aq+hejPW/iBrNnC/UGQ==", + "license": "MIT", + "dependencies": { + "escape-html": "^1.0.3", + "stream-wormhole": "^1.1.0" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/koa-override": { + "version": "3.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/koa-override/-/koa-override-3.0.0.tgz", + "integrity": "sha512-w2rWCfapbQUZ8TrRBarj6iwryCTooEcdw9lr1hYC1q4FnaCZcAOhpjB1VpqtbODALVMgY3JGlzLSeYRXc5Ky0Q==", + "license": "MIT", + "dependencies": { + "methods": "^1.1.2" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/koa-range": { + "version": "0.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/koa-range/-/koa-range-0.3.0.tgz", + "integrity": "sha512-Ich3pCz6RhtbajYXRWjIl6O5wtrLs6kE3nkXc9XmaWe+MysJyZO7K4L3oce1Jpg/iMgCbj+5UCiMm/rqVtcDIg==", + "license": "MIT", + "dependencies": { + "stream-slice": "^0.1.2" + }, + "engines": { + "node": ">=7" + } + }, + "node_modules/koa-session": { + "version": "6.4.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/koa-session/-/koa-session-6.4.0.tgz", + "integrity": "sha512-h/dxmSOvNEXpHQPRs4TV03TZVFyZIjmYQiTAW5JBFTYBOZ0VdpZ8QEE6Dud75g8z9JNGXi3m++VqRmqToB+c2A==", + "license": "MIT", + "dependencies": { + "crc": "^3.8.0", + "debug": "^4.3.3", + "is-type-of": "^1.2.1", + "uuid": "^8.3.2" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/koa-session/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/koa-session/node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/koa-static-cache": { + "version": "5.1.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/koa-static-cache/-/koa-static-cache-5.1.4.tgz", + "integrity": "sha512-abVWOHY6z6qSTvNtapWMAnvHS9SUiUCaQQQubClSAT9ybQPsZ6ioKcRarnownS4fMD0sXQgQ5ey8CYEuwoa1Yg==", + "license": "MIT", + "dependencies": { + "compressible": "^2.0.6", + "debug": "^3.1.0", + "fs-readdir-recursive": "^1.0.0", + "mime-types": "^2.1.8", + "mz": "^2.7.0" + }, + "engines": { + "node": ">= 7.6.0" + } + }, + "node_modules/koa-unless": { + "version": "1.0.7", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/koa-unless/-/koa-unless-1.0.7.tgz", + "integrity": "sha512-NKiz+nk4KxSJFskiJMuJvxeA41Lcnx3d8Zy+8QETgifm4ab4aOeGD3RgR6bIz0FGNWwo3Fz0DtnK77mEIqHWxA==", + "license": "MIT" + }, + "node_modules/koa/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/koa/node_modules/koa-convert": { + "version": "2.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/koa-convert/-/koa-convert-2.0.0.tgz", + "integrity": "sha512-asOvN6bFlSnxewce2e/DK3p4tltyfC4VM7ZwuTuepI7dEQVcvpyFuBcEARu1+Hxg8DIwytce2n7jrZtRlPrARA==", + "license": "MIT", + "dependencies": { + "co": "^4.6.0", + "koa-compose": "^4.1.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/koa/node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/language-subtag-registry": { + "version": "0.3.23", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/language-subtag-registry/-/language-subtag-registry-0.3.23.tgz", + "integrity": "sha512-0K65Lea881pHotoGEa5gDlMxt3pctLi2RplBb7Ezh4rRdLEOtgi7n4EwK9lamnUCkKBqaeKRVebTq6BAxSkpXQ==", + "dev": true, + "license": "CC0-1.0" + }, + "node_modules/language-tags": { + "version": "1.0.9", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/language-tags/-/language-tags-1.0.9.tgz", + "integrity": "sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA==", + "dev": true, + "license": "MIT", + "dependencies": { + "language-subtag-registry": "^0.3.20" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "license": "MIT" + }, + "node_modules/lodash.defaults": { + "version": "4.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/lodash.defaults/-/lodash.defaults-4.2.0.tgz", + "integrity": "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==", + "license": "MIT" + }, + "node_modules/lodash.flatten": { + "version": "4.4.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/lodash.flatten/-/lodash.flatten-4.4.0.tgz", + "integrity": "sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g==", + "license": "MIT" + }, + "node_modules/lodash.includes": { + "version": "4.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==", + "license": "MIT" + }, + "node_modules/lodash.isarguments": { + "version": "3.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", + "integrity": "sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==", + "license": "MIT" + }, + "node_modules/lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==", + "license": "MIT" + }, + "node_modules/lodash.isempty": { + "version": "4.4.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/lodash.isempty/-/lodash.isempty-4.4.0.tgz", + "integrity": "sha512-oKMuF3xEeqDltrGMfDxAPGIVMSSRv8tbRSODbrs4KGsRRLEhrW8N8Rd4DRgB2+621hY8A8XwwrTVhXWpxFvMzg==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.isfunction": { + "version": "3.0.9", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/lodash.isfunction/-/lodash.isfunction-3.0.9.tgz", + "integrity": "sha512-AirXNj15uRIMMPihnkInB4i3NHeb4iBtNg9WRWuK2o31S+ePwwNmDPaTL3o7dTJ+VXNZim7rFs4rxN4YU1oUJw==", + "license": "MIT" + }, + "node_modules/lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==", + "license": "MIT" + }, + "node_modules/lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==", + "license": "MIT" + }, + "node_modules/lodash.isobject": { + "version": "3.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/lodash.isobject/-/lodash.isobject-3.0.2.tgz", + "integrity": "sha512-3/Qptq2vr7WeJbB4KHUSKlq8Pl7ASXi3UG6CMbBm8WRtXi8+GHm7mKaU3urfpSEzWe2wCIChs6/sdocUsTKJiA==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", + "license": "MIT" + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", + "license": "MIT" + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.once": { + "version": "4.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", + "license": "MIT" + }, + "node_modules/lodash.set": { + "version": "4.3.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/lodash.set/-/lodash.set-4.3.2.tgz", + "integrity": "sha512-4hNPN5jlm/N/HLMCO43v8BXKq9Z7QdAGc/VGrRD61w8gN9g/6jF9A4L1pbUgBLCffi0w9VsXfTOij5x8iTyFvg==", + "license": "MIT" + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-symbols/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/log-symbols/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/log-symbols/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/log-symbols/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/log-symbols/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/log-symbols/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/long": { + "version": "4.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==", + "license": "Apache-2.0" + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/lower-case": { + "version": "1.1.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/lower-case/-/lower-case-1.1.4.tgz", + "integrity": "sha512-2Fgx1Ycm599x+WGpIYwJOvsjmXFzTSc34IwDWALRA/8AopUKAVPwfJ+h5+f85BCp0PWmmJcWzEpxOpoXycMpdA==", + "license": "MIT" + }, + "node_modules/lower-case-first": { + "version": "1.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/lower-case-first/-/lower-case-first-1.0.2.tgz", + "integrity": "sha512-UuxaYakO7XeONbKrZf5FEgkantPf5DUqDayzP5VXZrtRPdH86s4kN47I8B3TW10S4QKiE3ziHNf3kRN//okHjA==", + "license": "MIT", + "dependencies": { + "lower-case": "^1.1.2" + } + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/lru.min": { + "version": "1.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/lru.min/-/lru.min-1.1.2.tgz", + "integrity": "sha512-Nv9KddBcQSlQopmBHXSsZVY5xsdlZkdH/Iey0BlcBYggMd4two7cZnKOK9vmy3nY0O5RGH99z1PCeTpPqszUYg==", + "license": "MIT", + "engines": { + "bun": ">=1.0.0", + "deno": ">=1.30.0", + "node": ">=8.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wellwelwel" + } + }, + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "7.7.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true, + "license": "ISC" + }, + "node_modules/map-stream": { + "version": "0.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/map-stream/-/map-stream-0.1.0.tgz", + "integrity": "sha512-CkYQrPYZfWnu/DAmVCpTSX/xHpKZ80eKh2lAkyA6AJTef6bW+6JpbQZN5rofum7da+SyN1bi5ctTm+lTfcCW3g==" + }, + "node_modules/matcher": { + "version": "4.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/matcher/-/matcher-4.0.0.tgz", + "integrity": "sha512-S6x5wmcDmsDRRU/c2dkccDwQPXoFczc5+HpQ2lON8pnvHlnvHAHj5WlLVvw6n6vNyHuVugYrFohYxbS+pvFpKQ==", + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/matcher/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true, + "license": "MIT" + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime": { + "version": "2.6.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/mime/-/mime-2.6.0.tgz", + "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types/node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://mirrors.cloud.tencent.com/npm/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "license": "ISC" + }, + "node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "license": "MIT", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/mm": { + "version": "3.4.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/mm/-/mm-3.4.0.tgz", + "integrity": "sha512-pXyBKWM0cMG0QD5NoXCUZok8XOhqe/Pf4ILOYFJ4Ur2RIHJni6YHdxt/zHOiwjf2FAMQH2fowczaQMtIDvq+bw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-type-of": "^1.2.1", + "muk-prop": "^1.2.1", + "thenify": "^3.3.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/mm/node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/mocha": { + "version": "10.8.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/mocha/-/mocha-10.8.2.tgz", + "integrity": "sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-colors": "^4.1.3", + "browser-stdout": "^1.3.1", + "chokidar": "^3.5.3", + "debug": "^4.3.5", + "diff": "^5.2.0", + "escape-string-regexp": "^4.0.0", + "find-up": "^5.0.0", + "glob": "^8.1.0", + "he": "^1.2.0", + "js-yaml": "^4.1.0", + "log-symbols": "^4.1.0", + "minimatch": "^5.1.6", + "ms": "^2.1.3", + "serialize-javascript": "^6.0.2", + "strip-json-comments": "^3.1.1", + "supports-color": "^8.1.1", + "workerpool": "^6.5.1", + "yargs": "^16.2.0", + "yargs-parser": "^20.2.9", + "yargs-unparser": "^2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha.js" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/mocha/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/mocha/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/mocha/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/mocha/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/mocha/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/mocha/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/mocha/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/mocha/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mocha/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/mochawesome-report-generator": { + "version": "6.3.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/mochawesome-report-generator/-/mochawesome-report-generator-6.3.2.tgz", + "integrity": "sha512-iB6iyOUMyMr8XOUYTNfrqYuZQLZka3K/Gr2GPc6CHPe7t2ZhxxfcoVkpMLOtyDKnWbY1zgu1/7VNRsigrvKnOQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.2", + "dateformat": "^4.5.1", + "escape-html": "^1.0.3", + "fs-extra": "^10.0.0", + "fsu": "^1.1.1", + "lodash.isfunction": "^3.0.9", + "opener": "^1.5.2", + "prop-types": "^15.7.2", + "tcomb": "^3.2.17", + "tcomb-validation": "^3.3.0", + "yargs": "^17.2.1" + }, + "bin": { + "marge": "bin/cli.js" + } + }, + "node_modules/mochawesome-report-generator/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/mochawesome-report-generator/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/mochawesome-report-generator/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/mochawesome-report-generator/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/mochawesome-report-generator/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/mochawesome-report-generator/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/mochawesome-with-mocha": { + "version": "7.1.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/mochawesome-with-mocha/-/mochawesome-with-mocha-7.1.3.tgz", + "integrity": "sha512-C7df5V1hy2nvAlX7Z7H2YjvvFPUCyyqaK39JdSTK+owpfiTz2OjhGGpraAMW+DgimGbd3uLPn1RW62Ow5T7ZZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.2", + "diff": "^5.0.0", + "json-stringify-safe": "^5.0.1", + "lodash.isempty": "^4.4.0", + "lodash.isfunction": "^3.0.9", + "lodash.isobject": "^3.0.2", + "lodash.isstring": "^4.0.1", + "mocha": "^10.2.0", + "mochawesome-report-generator": "^6.2.0", + "strip-ansi": "^6.0.1", + "uuid": "^8.3.2" + } + }, + "node_modules/mochawesome-with-mocha/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/mochawesome-with-mocha/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/mochawesome-with-mocha/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/mochawesome-with-mocha/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/mochawesome-with-mocha/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/mochawesome-with-mocha/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/moment": { + "version": "2.30.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/moment/-/moment-2.30.1.tgz", + "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/moment-timezone": { + "version": "0.5.48", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/moment-timezone/-/moment-timezone-0.5.48.tgz", + "integrity": "sha512-f22b8LV1gbTO2ms2j2z13MuPogNoh5UzxL3nzNAYKGraILnbGc9NEE6dyiiiLv46DGRb8A4kg8UKWLjPthxBHw==", + "license": "MIT", + "dependencies": { + "moment": "^2.29.4" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/muk-prop": { + "version": "1.2.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/muk-prop/-/muk-prop-1.2.1.tgz", + "integrity": "sha512-NdkOVav3GoIkBZqMUneU435HW0a90zitpuO1erPRhOQdPtl65dXD3G9/1k46G6/0ZMau4CJFFUHkMKVsyNZT+w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/multimatch": { + "version": "5.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/multimatch/-/multimatch-5.0.0.tgz", + "integrity": "sha512-ypMKuglUrZUD99Tk2bUQ+xNQj43lPEfAeX2o9cTteAmShXy2VHDJpuwu1o0xqoKCt9jLVAvwyFKdLTPXKAfJyA==", + "license": "MIT", + "dependencies": { + "@types/minimatch": "^3.0.3", + "array-differ": "^3.0.0", + "array-union": "^2.1.0", + "arrify": "^2.0.1", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/multimatch/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/multimatch/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/mustache": { + "version": "2.3.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/mustache/-/mustache-2.3.2.tgz", + "integrity": "sha512-KpMNwdQsYz3O/SBS1qJ/o3sqUJ5wSb8gb0pul8CO0S56b9Y2ALm8zCfsjPXsqGFfoNBkDwZuZIAjhsZI03gYVQ==", + "license": "MIT", + "bin": { + "mustache": "bin/mustache" + }, + "engines": { + "npm": ">=1.4.0" + } + }, + "node_modules/mute-stream": { + "version": "0.0.8", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "dev": true, + "license": "ISC" + }, + "node_modules/mysql2": { + "version": "3.15.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/mysql2/-/mysql2-3.15.3.tgz", + "integrity": "sha512-FBrGau0IXmuqg4haEZRBfHNWB5mUARw6hNwPDXXGg0XzVJ50mr/9hb267lvpVMnhZ1FON3qNd4Xfcez1rbFwSg==", + "license": "MIT", + "dependencies": { + "aws-ssl-profiles": "^1.1.1", + "denque": "^2.1.0", + "generate-function": "^2.3.1", + "iconv-lite": "^0.7.0", + "long": "^5.2.1", + "lru.min": "^1.0.0", + "named-placeholders": "^1.1.3", + "seq-queue": "^0.0.5", + "sqlstring": "^2.3.2" + }, + "engines": { + "node": ">= 8.0" + } + }, + "node_modules/mysql2/node_modules/denque": { + "version": "2.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/denque/-/denque-2.1.0.tgz", + "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", + "license": "Apache-2.0", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/mysql2/node_modules/iconv-lite": { + "version": "0.7.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/iconv-lite/-/iconv-lite-0.7.0.tgz", + "integrity": "sha512-cf6L2Ds3h57VVmkZe+Pn+5APsT7FpqJtEhhieDCvrE2MK5Qk9MyffgQyuxQTm6BChfeZNtcOLHp9IcWRVcIcBQ==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/mysql2/node_modules/long": { + "version": "5.3.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/long/-/long-5.3.2.tgz", + "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", + "license": "Apache-2.0" + }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "node_modules/mz-modules": { + "version": "2.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/mz-modules/-/mz-modules-2.1.0.tgz", + "integrity": "sha512-sjk8lcRW3vrVYnZ+W+67L/2rL+jbO5K/N6PFGIcLWTiYytNr22Ah9FDXFs+AQntTM1boZcoHi5qS+CV1seuPog==", + "license": "MIT", + "dependencies": { + "glob": "^7.1.2", + "ko-sleep": "^1.0.3", + "mkdirp": "^0.5.1", + "pump": "^3.0.0", + "rimraf": "^2.6.1" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/mz-modules/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/mz-modules/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/mz-modules/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/mz-modules/node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "node_modules/named-placeholders": { + "version": "1.1.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/named-placeholders/-/named-placeholders-1.1.3.tgz", + "integrity": "sha512-eLoBxg6wE/rZkJPhU/xRX1WTpkFEwDJEN96oxFrTsqBdbT5ec295Q+CoHrL9IT0DipqKhmGcaZmwOt8OON5x1w==", + "license": "MIT", + "dependencies": { + "lru-cache": "^7.14.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/named-placeholders/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/ndir": { + "version": "0.1.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ndir/-/ndir-0.1.5.tgz", + "integrity": "sha512-GEdViSiVHi63HASUGaQXNBbUNe5KDnuAYvOGBlY7y+CCCRT3NBeMWQlODb2GVV2cKwEIwHzo9KOCMsPBXlKsOg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/nice-try": { + "version": "1.0.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/no-case": { + "version": "2.3.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/no-case/-/no-case-2.3.2.tgz", + "integrity": "sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==", + "license": "MIT", + "dependencies": { + "lower-case": "^1.1.1" + } + }, + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "deprecated": "Use your platform's native DOMException instead", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "engines": { + "node": ">=10.5.0" + } + }, + "node_modules/node-hex": { + "version": "1.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/node-hex/-/node-hex-1.0.1.tgz", + "integrity": "sha512-iwpZdvW6Umz12ICmu9IYPRxg0tOLGmU3Tq2tKetejCj3oZd7b2nUXwP3a7QA5M9glWy8wlPS1G3RwM/CdsUbdQ==", + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/node-homedir": { + "version": "1.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/node-homedir/-/node-homedir-1.1.1.tgz", + "integrity": "sha512-Xsmf94D/DdeDISAECUaxXVxhh+kHdbOQE4CnP4igo3HXL3BSmmUpD5M7orH434EZZwBTFF2xe5SgsQr/wOBuNw==", + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/node-releases": { + "version": "2.0.27", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/node-releases/-/node-releases-2.0.27.tgz", + "integrity": "sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/nopt": { + "version": "7.2.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/nopt/-/nopt-7.2.1.tgz", + "integrity": "sha512-taM24ViiimT/XntxbPyJQzCG+p4EKOpgD3mxFwW38mGjVUrfERQOeY4EDHjdnptttfHuHQXFx+lTP08Q+mLa/w==", + "dev": true, + "license": "ISC", + "dependencies": { + "abbrev": "^2.0.0" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/npm-run-path/node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/oauth-sign": { + "version": "0.9.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "license": "Apache-2.0", + "engines": { + "node": "*" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.7", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/object.assign/-/object.assign-4.1.7.tgz", + "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0", + "has-symbols": "^1.1.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.entries": { + "version": "1.1.9", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/object.entries/-/object.entries-1.1.9.tgz", + "integrity": "sha512-8u/hfXFRBD1O0hPUjioLhoWFHRmt6tKA4/vZPyckBr18l1KE9uHrFaFaUi8MDRTpi4uak2goyPTSNJLXX2k2Hw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.fromentries": { + "version": "2.0.8", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/object.fromentries/-/object.fromentries-2.0.8.tgz", + "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.groupby": { + "version": "1.0.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/object.groupby/-/object.groupby-1.0.3.tgz", + "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.values": { + "version": "1.2.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/object.values/-/object.values-1.2.1.tgz", + "integrity": "sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onelogger": { + "version": "1.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/onelogger/-/onelogger-1.0.1.tgz", + "integrity": "sha512-CssDwyG8cnY8fGm9HJurr2LNScfn2u//hnxgivLMgTj+B/S2IspJbbxgFboaRJ+V0CPzi59wqTLuikMcXyVeaw==", + "license": "MIT", + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/only": { + "version": "0.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/only/-/only-0.0.2.tgz", + "integrity": "sha512-Fvw+Jemq5fjjyWz6CpKx6w9s7xxqo3+JCyM0WXWeCSOboZ8ABkyvP8ID4CZuChA/wxSx+XSJmdOm8rGVyJ1hdQ==" + }, + "node_modules/opener": { + "version": "1.5.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/opener/-/opener-1.5.2.tgz", + "integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==", + "dev": true, + "license": "(WTFPL OR MIT)", + "bin": { + "opener": "bin/opener-bin.js" + } + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/ora": { + "version": "5.4.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/ora/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/ora/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/ora/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/ora/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ora/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/os-name": { + "version": "1.0.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/os-name/-/os-name-1.0.3.tgz", + "integrity": "sha512-f5estLO2KN8vgtTRaILIgEGBoBrMnZ3JQ7W9TMZCnOIGwHe8TRGSpcagnWDo+Dfhd/z08k9Xe75hvciJJ8Qaew==", + "license": "MIT", + "dependencies": { + "osx-release": "^1.0.0", + "win-release": "^1.0.0" + }, + "bin": { + "os-name": "cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/osx-release": { + "version": "1.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/osx-release/-/osx-release-1.1.0.tgz", + "integrity": "sha512-ixCMMwnVxyHFQLQnINhmIpWqXIfS2YOXchwQrk+OFzmo6nDjQ0E4KXAyyUh0T0MZgV4bUhkRrAbVqlE4yLVq4A==", + "license": "MIT", + "dependencies": { + "minimist": "^1.1.0" + }, + "bin": { + "osx-release": "cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/own-keys": { + "version": "1.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/own-keys/-/own-keys-1.0.1.tgz", + "integrity": "sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.6", + "object-keys": "^1.1.1", + "safe-push-apply": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-map": { + "version": "2.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/p-map/-/p-map-2.1.0.tgz", + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/p-timeout": { + "version": "4.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/p-timeout/-/p-timeout-4.1.0.tgz", + "integrity": "sha512-+/wmHtzJuWii1sXn3HCuH/FTwGhrp4tmJTxSKJbfS+vkipci6osxXM5mY0jUiRzWKMTgUT8l7HFbeSwZAynqHw==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, + "node_modules/param-case": { + "version": "2.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/param-case/-/param-case-2.1.1.tgz", + "integrity": "sha512-eQE845L6ot89sk2N8liD8HAuH4ca6Vvr7VWAWwt7+kvvG5aBcPmmphQ68JsEG2qa9n1TykS2DLeMt363AAH8/w==", + "license": "MIT", + "dependencies": { + "no-case": "^2.2.0" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/pascal-case": { + "version": "2.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/pascal-case/-/pascal-case-2.0.1.tgz", + "integrity": "sha512-qjS4s8rBOJa2Xm0jmxXiyh1+OFf6ekCWOvUaRgAQSktzlTbMotS0nmG9gyYAybCWBcuP4fsBeRCKNwGBnMe2OQ==", + "license": "MIT", + "dependencies": { + "camel-case": "^3.0.0", + "upper-case-first": "^1.1.0" + } + }, + "node_modules/path": { + "version": "0.12.7", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/path/-/path-0.12.7.tgz", + "integrity": "sha512-aXXC6s+1w7otVF9UletFkFcDsJeO7lSZBPUQhtb5O0xJe8LtYhj/GxldoL09bBj9+ZmE2hNoHqQSFMN5fikh4Q==", + "license": "MIT", + "dependencies": { + "process": "^0.11.1", + "util": "^0.10.3" + } + }, + "node_modules/path-case": { + "version": "2.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/path-case/-/path-case-2.1.1.tgz", + "integrity": "sha512-Ou0N05MioItesaLr9q8TtHVWmJ6fxWdqKB2RohFmNWVyJ+2zeKIeDNWAN6B/Pe7wpzWChhZX6nONYmOnMeJQ/Q==", + "license": "MIT", + "dependencies": { + "no-case": "^2.2.0" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "license": "MIT" + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/path-to-regexp": { + "version": "1.9.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/path-to-regexp/-/path-to-regexp-1.9.0.tgz", + "integrity": "sha512-xIp7/apCFJuUHdDLWe8O1HIkb0kQrOMb/0u6FXQjemHn/ii5LrIzU6bdECnsiTF/GjZkMEKg1xdiZwNqDYlZ6g==", + "license": "MIT", + "dependencies": { + "isarray": "0.0.1" + } + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/pause-stream": { + "version": "0.0.11", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/pause-stream/-/pause-stream-0.0.11.tgz", + "integrity": "sha512-e3FBlXLmN/D1S+zHzanP4E/4Z60oFAa3O051qt1pxa7DEJWKAyil6upYVXCWadEnuoqa4Pkc9oUx9zsxYeRv8A==", + "license": [ + "MIT", + "Apache2" + ], + "dependencies": { + "through": "~2.3" + } + }, + "node_modules/performance-now": { + "version": "2.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", + "license": "MIT" + }, + "node_modules/pg-connection-string": { + "version": "2.9.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/pg-connection-string/-/pg-connection-string-2.9.1.tgz", + "integrity": "sha512-nkc6NpDcvPVpZXxrreI/FOtX3XemeLl8E0qFr6F2Lrm/I8WOnaWNhIPK2Z7OHpw7gh5XJThi6j6ppgNoaT1w4w==", + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pkg-up": { + "version": "3.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/pkg-up/-/pkg-up-3.1.0.tgz", + "integrity": "sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==", + "license": "MIT", + "dependencies": { + "find-up": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-up/node_modules/find-up": { + "version": "3.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "license": "MIT", + "dependencies": { + "locate-path": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/pkg-up/node_modules/locate-path": { + "version": "3.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "license": "MIT", + "dependencies": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/pkg-up/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pkg-up/node_modules/p-locate": { + "version": "3.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "license": "MIT", + "dependencies": { + "p-limit": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/pkg-up/node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/platform": { + "version": "1.3.6", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/platform/-/platform-1.3.6.tgz", + "integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==", + "license": "MIT" + }, + "node_modules/possible-typed-array-names": { + "version": "1.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", + "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "license": "MIT", + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "license": "MIT" + }, + "node_modules/prop-types": { + "version": "15.8.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "dev": true, + "license": "MIT", + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, + "node_modules/proto-list": { + "version": "1.2.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/proto-list/-/proto-list-1.2.4.tgz", + "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", + "dev": true, + "license": "ISC" + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://mirrors.cloud.tencent.com/npm/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "license": "MIT" + }, + "node_modules/ps-tree": { + "version": "1.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ps-tree/-/ps-tree-1.2.0.tgz", + "integrity": "sha512-0VnamPPYHl4uaU/nSFeZZpR21QAWRz+sRv4iW9+v/GS/J5U5iZB5BNN6J0RMoOvdx2gWM2+ZFMIm58q24e4UYA==", + "license": "MIT", + "dependencies": { + "event-stream": "=3.3.4" + }, + "bin": { + "ps-tree": "bin/ps-tree.js" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/psl": { + "version": "1.15.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/psl/-/psl-1.15.0.tgz", + "integrity": "sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w==", + "license": "MIT", + "dependencies": { + "punycode": "^2.3.1" + }, + "funding": { + "url": "https://github.com/sponsors/lupomontero" + } + }, + "node_modules/pump": { + "version": "3.0.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/pump/-/pump-3.0.3.tgz", + "integrity": "sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==", + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/pumpify": { + "version": "1.5.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/pumpify/-/pumpify-1.5.1.tgz", + "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", + "license": "MIT", + "dependencies": { + "duplexify": "^3.6.0", + "inherits": "^2.0.3", + "pump": "^2.0.0" + } + }, + "node_modules/pumpify/node_modules/pump": { + "version": "2.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/qiniu-js": { + "version": "3.4.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/qiniu-js/-/qiniu-js-3.4.3.tgz", + "integrity": "sha512-3kO82r0jvGkiKnTtRStrETESBK0lKDsDVSHSp55R5liVPAUoEYII0koGTXdjdU8zfxCrWxMw1vRuL58feuLJIQ==", + "license": "MIT", + "dependencies": { + "@babel/runtime-corejs2": "^7.10.2", + "querystring": "^0.2.1", + "spark-md5": "^3.0.0" + } + }, + "node_modules/qs": { + "version": "6.14.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/qs/-/qs-6.14.0.tgz", + "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/querystring": { + "version": "0.2.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/querystring/-/querystring-0.2.1.tgz", + "integrity": "sha512-wkvS7mL/JMugcup3/rMitHmd9ecIGd2lhFhK9N3UUQ450h66d1r3Y9nvXzQAW1Lq+wyx61k/1pfKS5KuKiyEbg==", + "deprecated": "The querystring API is considered Legacy. new code should use the URLSearchParams API instead.", + "license": "MIT", + "engines": { + "node": ">=0.4.x" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/random-bytes": { + "version": "1.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/random-bytes/-/random-bytes-1.0.0.tgz", + "integrity": "sha512-iv7LhNVO047HzYR3InF6pUcUsPQiHTM1Qal51DcGSuZFBil1aBBWG5eHPNek7bvILMaYJ/8RU1e8w1AMdHmLQQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/raw-body/node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/raw-body/node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "license": "MIT", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/raw-body/node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/raw-body/node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/ready-callback": { + "version": "3.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ready-callback/-/ready-callback-3.0.0.tgz", + "integrity": "sha512-wGhjJMrxVEX35Ec+QlM2FW+ZsXhThNCbmdk+x22vzwRPPsDUNgq7C6nU0EpJRvNJSK/MiwQ73XZljo/IKhovXA==", + "license": "MIT", + "dependencies": { + "debug": "^4.3.4", + "get-ready": "^2.0.1", + "once": "^1.4.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/ready-callback/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/redis-errors": { + "version": "1.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/redis-errors/-/redis-errors-1.2.0.tgz", + "integrity": "sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/redis-parser": { + "version": "3.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/redis-parser/-/redis-parser-3.0.0.tgz", + "integrity": "sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A==", + "license": "MIT", + "dependencies": { + "redis-errors": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/reduce-flatten": { + "version": "2.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/reduce-flatten/-/reduce-flatten-2.0.0.tgz", + "integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/reflect-metadata": { + "version": "0.1.14", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/reflect-metadata/-/reflect-metadata-0.1.14.tgz", + "integrity": "sha512-ZhYeb6nRaXCfhnndflDK8qI6ZQ/YcWZCISRAWICW9XYqMUwjZM9Z0DveWX/ABN01oxSHwVxKQmxeYZSsm0jh5A==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/reflect.getprototypeof": { + "version": "1.0.10", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", + "integrity": "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.9", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.7", + "get-proto": "^1.0.1", + "which-builtin-type": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", + "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "set-function-name": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/regexpp": { + "version": "3.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/request": { + "version": "2.88.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", + "license": "Apache-2.0", + "dependencies": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/request/node_modules/form-data": { + "version": "2.3.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 0.12" + } + }, + "node_modules/request/node_modules/qs": { + "version": "6.5.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/qs/-/qs-6.5.3.tgz", + "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/request/node_modules/uuid": { + "version": "3.4.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", + "license": "MIT", + "bin": { + "uuid": "bin/uuid" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "license": "ISC" + }, + "node_modules/resolve": { + "version": "1.22.11", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/resolve/-/resolve-1.22.11.tgz", + "integrity": "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.16.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/restore-cursor": { + "version": "3.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/restore-cursor/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/retry-as-promised": { + "version": "7.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/retry-as-promised/-/retry-as-promised-7.1.1.tgz", + "integrity": "sha512-hMD7odLOt3LkTjcif8aRZqi/hybjpLNgSk5oF5FCowfCjok6LukpN2bDX7R5wDmbgBQFn7YoBxSagmtXHaJYJw==", + "license": "MIT" + }, + "node_modules/reusify": { + "version": "1.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/rimraf/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/rndm": { + "version": "1.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/rndm/-/rndm-1.2.0.tgz", + "integrity": "sha512-fJhQQI5tLrQvYIYFpOnFinzv9dwmR7hRnUz1XqP3OJ1jIweTNOd6aTO4jwQSgcBSFUB+/KHJxuGneime+FdzOw==", + "license": "MIT" + }, + "node_modules/run-async": { + "version": "2.4.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/runscript": { + "version": "2.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/runscript/-/runscript-2.0.1.tgz", + "integrity": "sha512-CjlpKusSKpE943TsCLkqU1dBDfC2nWwaaiaVlXu3IG3FvSa4IqSn7dMGT16Q6wDNUJX/51IO4mifbEipXnMKDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-type-of": "^2.2.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/rxjs": { + "version": "7.8.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/rxjs/-/rxjs-7.8.2.tgz", + "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/safe-array-concat": { + "version": "1.1.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/safe-array-concat/-/safe-array-concat-1.1.3.tgz", + "integrity": "sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "has-symbols": "^1.1.0", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-array-concat/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true, + "license": "MIT" + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safe-push-apply": { + "version": "1.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/safe-push-apply/-/safe-push-apply-1.0.0.tgz", + "integrity": "sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-push-apply/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true, + "license": "MIT" + }, + "node_modules/safe-regex-test": { + "version": "1.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/safe-regex-test/-/safe-regex-test-1.1.0.tgz", + "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-regex": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-timers": { + "version": "1.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/safe-timers/-/safe-timers-1.1.0.tgz", + "integrity": "sha512-9aqY+v5eMvmRaluUEtdRThV1EjlSElzO7HuCj0sTW9xvp++8iJ9t/RWGNWV6/WHcUJLHpyT2SNf/apoKTU2EpA==", + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/sax": { + "version": "1.5.0", + "resolved": "https://mirrors.cloud.tencent.com/npm/sax/-/sax-1.5.0.tgz", + "integrity": "sha512-21IYA3Q5cQf089Z6tgaUTr7lDAyzoTPx5HRtbhsME8Udispad8dC/+sziTNugOEx54ilvatQ9YCzl4KQLPcRHA==", + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=11.0.0" + } + }, + "node_modules/scmp": { + "version": "2.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/scmp/-/scmp-2.1.0.tgz", + "integrity": "sha512-o/mRQGk9Rcer/jEEw/yw4mwo3EU/NvYvp577/Btqrym9Qy5/MdWGBqipbALgd2lrdWTJ5/gqDusxfnQBxOxT2Q==", + "license": "BSD-3-Clause" + }, + "node_modules/sdk-base": { + "version": "4.2.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/sdk-base/-/sdk-base-4.2.1.tgz", + "integrity": "sha512-B33iy/AkIpLyxexn/5v+8jmYHCyUaJizEQcmhvMY+SoiXViY1FEULbQibQH/EcOfzPwJqJ5UDeXyUJGO47Sq3g==", + "license": "MIT", + "dependencies": { + "await-event": "^2.1.0", + "await-first": "^1.0.0", + "co": "^4.6.0", + "p-timeout": "^4.1.0" + } + }, + "node_modules/semver": { + "version": "5.7.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/sendmessage": { + "version": "2.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/sendmessage/-/sendmessage-2.0.0.tgz", + "integrity": "sha512-//UAqD/jhpCAQd4zRJ8KRv5FoaM2jeT94p+C2DlR0yGXZyjJTIQnl/fG7KpLo+x6tH+1SglUUh88C6LOxtaZbA==", + "license": "MIT", + "engines": { + "node": ">= 14.17.0" + } + }, + "node_modules/sentence-case": { + "version": "2.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/sentence-case/-/sentence-case-2.1.1.tgz", + "integrity": "sha512-ENl7cYHaK/Ktwk5OTD+aDbQ3uC8IByu/6Bkg+HDv8Mm+XnBnppVNalcfJTNsp1ibstKh030/JKQQWglDvtKwEQ==", + "license": "MIT", + "dependencies": { + "no-case": "^2.2.0", + "upper-case-first": "^1.1.2" + } + }, + "node_modules/seq-queue": { + "version": "0.0.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/seq-queue/-/seq-queue-0.0.5.tgz", + "integrity": "sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q==" + }, + "node_modules/sequelize": { + "version": "6.37.7", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/sequelize/-/sequelize-6.37.7.tgz", + "integrity": "sha512-mCnh83zuz7kQxxJirtFD7q6Huy6liPanI67BSlbzSYgVNl5eXVdE2CN1FuAeZwG1SNpGsNRCV+bJAVVnykZAFA==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/sequelize" + } + ], + "license": "MIT", + "dependencies": { + "@types/debug": "^4.1.8", + "@types/validator": "^13.7.17", + "debug": "^4.3.4", + "dottie": "^2.0.6", + "inflection": "^1.13.4", + "lodash": "^4.17.21", + "moment": "^2.29.4", + "moment-timezone": "^0.5.43", + "pg-connection-string": "^2.6.1", + "retry-as-promised": "^7.0.4", + "semver": "^7.5.4", + "sequelize-pool": "^7.1.0", + "toposort-class": "^1.0.1", + "uuid": "^8.3.2", + "validator": "^13.9.0", + "wkx": "^0.5.0" + }, + "engines": { + "node": ">=10.0.0" + }, + "peerDependenciesMeta": { + "ibm_db": { + "optional": true + }, + "mariadb": { + "optional": true + }, + "mysql2": { + "optional": true + }, + "oracledb": { + "optional": true + }, + "pg": { + "optional": true + }, + "pg-hstore": { + "optional": true + }, + "snowflake-sdk": { + "optional": true + }, + "sqlite3": { + "optional": true + }, + "tedious": { + "optional": true + } + } + }, + "node_modules/sequelize-cli": { + "version": "6.6.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/sequelize-cli/-/sequelize-cli-6.6.3.tgz", + "integrity": "sha512-1YYPrcSRt/bpMDDSKM5ubY1mnJ2TEwIaGZcqITw4hLtGtE64nIqaBnLtMvH8VKHg6FbWpXTiFNc2mS/BtQCXZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "fs-extra": "^9.1.0", + "js-beautify": "1.15.4", + "lodash": "^4.17.21", + "picocolors": "^1.1.1", + "resolve": "^1.22.1", + "umzug": "^2.3.0", + "yargs": "^16.2.0" + }, + "bin": { + "sequelize": "lib/sequelize", + "sequelize-cli": "lib/sequelize" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/sequelize-cli/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/sequelize-cli/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/sequelize-cli/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/sequelize-cli/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/sequelize-cli/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/sequelize-cli/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/sequelize-cli/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/sequelize-cli/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/sequelize-pool": { + "version": "7.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/sequelize-pool/-/sequelize-pool-7.1.0.tgz", + "integrity": "sha512-G9c0qlIWQSK29pR/5U2JF5dDQeqqHRragoyahj/Nx4KOOQ3CPPfzxnfqFPCSB7x5UgjOgnZ61nSxz+fjDpRlJg==", + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/sequelize/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/sequelize/node_modules/semver": { + "version": "7.7.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/serialize-javascript": { + "version": "6.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/serialize-json": { + "version": "1.0.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/serialize-json/-/serialize-json-1.0.3.tgz", + "integrity": "sha512-TJvXOXSUEH4Lh2FNy1mYzNkUyBG7Ti5fRKGAbcpaDX3mLq23aT/5unC+cIFc5JTDi4/BHTaYLhynrboCCYrFaQ==", + "license": "MIT", + "dependencies": { + "debug": "^3.2.6", + "is-type-of": "^1.2.1", + "utility": "^1.15.0" + }, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/serialize-json/node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/serialize-json/node_modules/utility": { + "version": "1.18.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/utility/-/utility-1.18.0.tgz", + "integrity": "sha512-PYxZDA+6QtvRvm//++aGdmKG/cI07jNwbROz0Ql+VzFV1+Z0Dy55NI4zZ7RHc9KKpBePNFwoErqIuqQv/cjiTA==", + "license": "MIT", + "dependencies": { + "copy-to": "^2.0.1", + "escape-html": "^1.0.3", + "mkdirp": "^0.5.1", + "mz": "^2.7.0", + "unescape": "^1.0.1" + }, + "engines": { + "node": ">= 0.12.0" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "license": "ISC" + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-proto": { + "version": "1.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/set-proto/-/set-proto-1.0.0.tgz", + "integrity": "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/should-send-same-site-none": { + "version": "2.0.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/should-send-same-site-none/-/should-send-same-site-none-2.0.5.tgz", + "integrity": "sha512-7dig49H7sKnv1v/GPoFQChGgJdEX9s2oy9TQBSD5RbUx7M9CCRjHMaFP06v+DZQNM0K+o8dBhvBAd4eEKirqbQ==", + "license": "MIT" + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/snake-case": { + "version": "2.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/snake-case/-/snake-case-2.1.0.tgz", + "integrity": "sha512-FMR5YoPFwOLuh4rRz92dywJjyKYZNLpMn1R5ujVpIYkbA9p01fq8RMg0FkO4M+Yobt4MjHeLTJVm5xFFBHSV2Q==", + "license": "MIT", + "dependencies": { + "no-case": "^2.2.0" + } + }, + "node_modules/soap": { + "version": "1.8.0", + "resolved": "https://mirrors.cloud.tencent.com/npm/soap/-/soap-1.8.0.tgz", + "integrity": "sha512-WRIzZm4M13a9j1t8yMdZZtbbkxNatXAhvtO8UXc/LvdfZ/Op1MqZS6qsAbILLsLTk3oLM/PRw0XOG0U53dAZzg==", + "license": "MIT", + "dependencies": { + "axios": "^1.13.6", + "axios-ntlm": "^1.4.6", + "debug": "^4.4.3", + "follow-redirects": "^1.15.11", + "formidable": "^3.5.4", + "sax": "^1.5.0", + "whatwg-mimetype": "4.0.0", + "xml-crypto": "^6.1.2" + }, + "engines": { + "node": ">=20.19.0" + } + }, + "node_modules/soap/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://mirrors.cloud.tencent.com/npm/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/soap/node_modules/formidable": { + "version": "3.5.4", + "resolved": "https://mirrors.cloud.tencent.com/npm/formidable/-/formidable-3.5.4.tgz", + "integrity": "sha512-YikH+7CUTOtP44ZTnUhR7Ic2UASBPOqmaRkRKxRbywPTe5VxF7RRCck4af9wutiZ/QKM5nME9Bie2fFaPz5Gug==", + "license": "MIT", + "dependencies": { + "@paralleldrive/cuid2": "^2.2.2", + "dezalgo": "^1.0.4", + "once": "^1.4.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "funding": { + "url": "https://ko-fi.com/tunnckoCore/commissions" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/spark-md5": { + "version": "3.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/spark-md5/-/spark-md5-3.0.2.tgz", + "integrity": "sha512-wcFzz9cDfbuqe0FZzfi2or1sgyIrsDwmPwfZC4hiNidPdPINjeUwNfv5kldczoEAcjl9Y1L3SM7Uz2PUEQzxQw==", + "license": "(WTFPL OR MIT)" + }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "dev": true, + "license": "CC-BY-3.0" + }, + "node_modules/spdx-expression-parse": { + "version": "4.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/spdx-expression-parse/-/spdx-expression-parse-4.0.0.tgz", + "integrity": "sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.22", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/spdx-license-ids/-/spdx-license-ids-3.0.22.tgz", + "integrity": "sha512-4PRT4nh1EImPbt2jASOKHX7PB7I+e4IWNLvkKFDxNhJlfjbYlleYQh285Z/3mPTHSAK/AvdMmw5BNNuYH8ShgQ==", + "dev": true, + "license": "CC0-1.0" + }, + "node_modules/split": { + "version": "0.3.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/split/-/split-0.3.3.tgz", + "integrity": "sha512-wD2AeVmxXRBoX44wAycgjVpMhvbwdI2aZjCkvfNcH1YqHQvJVa1duWc73OyVGJUc05fhFaTZeQ/PYsrmyH0JVA==", + "license": "MIT", + "dependencies": { + "through": "2" + }, + "engines": { + "node": "*" + } + }, + "node_modules/split2": { + "version": "2.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/split2/-/split2-2.2.0.tgz", + "integrity": "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==", + "license": "ISC", + "dependencies": { + "through2": "^2.0.2" + } + }, + "node_modules/sqlstring": { + "version": "2.3.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/sqlstring/-/sqlstring-2.3.3.tgz", + "integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/sshpk": { + "version": "1.18.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/sshpk/-/sshpk-1.18.0.tgz", + "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", + "license": "MIT", + "dependencies": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + }, + "bin": { + "sshpk-conv": "bin/sshpk-conv", + "sshpk-sign": "bin/sshpk-sign", + "sshpk-verify": "bin/sshpk-verify" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/stack-trace": { + "version": "0.0.10", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/standard-as-callback": { + "version": "2.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/standard-as-callback/-/standard-as-callback-2.1.0.tgz", + "integrity": "sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==", + "license": "MIT" + }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/stop-iteration-iterator": { + "version": "1.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", + "integrity": "sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "internal-slot": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/stream-combiner": { + "version": "0.0.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/stream-combiner/-/stream-combiner-0.0.4.tgz", + "integrity": "sha512-rT00SPnTVyRsaSz5zgSPma/aHSOic5U1prhYdRy5HS2kTZviFpmDgzilbtsJsxiroqACmayynDN/9VzIbX5DOw==", + "license": "MIT", + "dependencies": { + "duplexer": "~0.1.1" + } + }, + "node_modules/stream-shift": { + "version": "1.0.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/stream-shift/-/stream-shift-1.0.3.tgz", + "integrity": "sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ==", + "license": "MIT" + }, + "node_modules/stream-slice": { + "version": "0.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/stream-slice/-/stream-slice-0.1.2.tgz", + "integrity": "sha512-QzQxpoacatkreL6jsxnVb7X5R/pGw9OUv2qWTYWnmLpg4NdN31snPy/f3TdQE1ZUXaThRvj1Zw4/OGg0ZkaLMA==", + "license": "MIT" + }, + "node_modules/stream-wormhole": { + "version": "1.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/stream-wormhole/-/stream-wormhole-1.1.0.tgz", + "integrity": "sha512-gHFfL3px0Kctd6Po0M8TzEvt3De/xu6cnRrjlfYNhwbhLPLwigI2t1nc6jrzNuaYg5C4YF78PPFuQPzRiqn9ew==", + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/streamsearch": { + "version": "1.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/string-width/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/string.prototype.includes": { + "version": "2.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/string.prototype.includes/-/string.prototype.includes-2.0.1.tgz", + "integrity": "sha512-o7+c9bW6zpAdJHTtujeePODAhkuicdAryFsfVKwA+wGw89wJ4GTY484WTucM9hLtDEOpOvI+aHnzqnC5lHp4Rg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.3" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/string.prototype.matchall": { + "version": "4.0.12", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/string.prototype.matchall/-/string.prototype.matchall-4.0.12.tgz", + "integrity": "sha512-6CC9uyBL+/48dYizRf7H7VAYCMCNTBeM78x/VTUe9bFEaxBepPJDa1Ow99LqI/1yF7kuy7Q3cQsYMrcjGUcskA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.6", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.6", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "internal-slot": "^1.1.0", + "regexp.prototype.flags": "^1.5.3", + "set-function-name": "^2.0.2", + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.repeat": { + "version": "1.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/string.prototype.repeat/-/string.prototype.repeat-1.0.0.tgz", + "integrity": "sha512-0u/TldDbKD8bFCQ/4f5+mNRrXwZ8hg2w7ZR8wa16e8z9XpePWl3eGEcUD0OXpEH/VJH/2G3gjUtR3ZOiBe2S/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "node_modules/string.prototype.trim": { + "version": "1.2.10", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", + "integrity": "sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-data-property": "^1.1.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-object-atoms": "^1.0.0", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.9", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz", + "integrity": "sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.8", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/strnum": { + "version": "2.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/strnum/-/strnum-2.1.1.tgz", + "integrity": "sha512-7ZvoFTiCnGxBtDqJ//Cu6fWtZtc7Y3x+QOirG15wztbdngGSkht27o2pyGWrVy0b4WAy3jbKmnoK6g5VlVNUUw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT" + }, + "node_modules/superagent": { + "version": "8.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/superagent/-/superagent-8.1.2.tgz", + "integrity": "sha512-6WTxW1EB6yCxV5VFOIPQruWGHqc3yI7hEmZK6h+pyk69Lk/Ut7rLUY6W/ONF2MjBuGjvmMiIpsrVJ2vjrHlslA==", + "deprecated": "Please upgrade to superagent v10.2.2+, see release notes at https://github.com/forwardemail/superagent/releases/tag/v10.2.2 - maintenance is supported by Forward Email @ https://forwardemail.net", + "dev": true, + "license": "MIT", + "dependencies": { + "component-emitter": "^1.3.0", + "cookiejar": "^2.1.4", + "debug": "^4.3.4", + "fast-safe-stringify": "^2.1.1", + "form-data": "^4.0.0", + "formidable": "^2.1.2", + "methods": "^1.1.2", + "mime": "2.6.0", + "qs": "^6.11.0", + "semver": "^7.3.8" + }, + "engines": { + "node": ">=6.4.0 <13 || >=14" + } + }, + "node_modules/superagent/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/superagent/node_modules/semver": { + "version": "7.7.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/supertest": { + "version": "6.3.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/supertest/-/supertest-6.3.4.tgz", + "integrity": "sha512-erY3HFDG0dPnhw4U+udPfrzXa4xhSG+n4rxfRuZWCUvjFWwKl+OxWf/7zk50s84/fAAs7vf5QAb9uRa0cCykxw==", + "deprecated": "Please upgrade to supertest v7.1.3+, see release notes at https://github.com/forwardemail/supertest/releases/tag/v7.1.3 - maintenance is supported by Forward Email @ https://forwardemail.net", + "dev": true, + "license": "MIT", + "dependencies": { + "methods": "^1.1.2", + "superagent": "^8.1.2" + }, + "engines": { + "node": ">=6.4.0" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/supports-hyperlinks": { + "version": "2.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/supports-hyperlinks/-/supports-hyperlinks-2.3.0.tgz", + "integrity": "sha512-RpsAZlpWcDwOPQA22aCH4J0t7L8JmAvsCxfOSEwm7cQs3LshN36QaTkwd70DnBOXDWGssw2eUoc8CaRWT0XunA==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0", + "supports-color": "^7.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-hyperlinks/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-hyperlinks/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/swap-case": { + "version": "1.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/swap-case/-/swap-case-1.1.2.tgz", + "integrity": "sha512-BAmWG6/bx8syfc6qXPprof3Mn5vQgf5dwdUNJhsNqU9WdPt5P+ES/wQ5bxfijy8zwZgZZHslC3iAsxsuQMCzJQ==", + "license": "MIT", + "dependencies": { + "lower-case": "^1.1.1", + "upper-case": "^1.1.1" + } + }, + "node_modules/table-layout": { + "version": "1.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/table-layout/-/table-layout-1.0.2.tgz", + "integrity": "sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-back": "^4.0.1", + "deep-extend": "~0.6.0", + "typical": "^5.2.0", + "wordwrapjs": "^4.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/tcomb": { + "version": "3.2.29", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/tcomb/-/tcomb-3.2.29.tgz", + "integrity": "sha512-di2Hd1DB2Zfw6StGv861JoAF5h/uQVu/QJp2g8KVbtfKnoHdBQl5M32YWq6mnSYBQ1vFFrns5B1haWJL7rKaOQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/tcomb-validation": { + "version": "3.4.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/tcomb-validation/-/tcomb-validation-3.4.1.tgz", + "integrity": "sha512-urVVMQOma4RXwiVCa2nM2eqrAomHROHvWPuj6UkDGz/eb5kcy0x6P0dVt6kzpUZtYMNoAqJLWmz1BPtxrtjtrA==", + "dev": true, + "license": "MIT", + "dependencies": { + "tcomb": "^3.0.0" + } + }, + "node_modules/tcp-base": { + "version": "3.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/tcp-base/-/tcp-base-3.2.0.tgz", + "integrity": "sha512-fFAqH8QTbheuEbXLdbxTSe31Gkw6Lg3nq4loyrxIXM6+ILGdbYXEblgyuu7UltOkOHbP/q2iqaC+gIXXu0C5bg==", + "license": "MIT", + "dependencies": { + "is-type-of": "^1.0.0", + "sdk-base": "^3.1.1" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/tcp-base/node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/tcp-base/node_modules/sdk-base": { + "version": "3.6.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/sdk-base/-/sdk-base-3.6.0.tgz", + "integrity": "sha512-jxHUIrRLlAoRFRwiXKhOGjd6BeFWO/jz7tv+E7lbMSef6F9jzFN2Sv3hLW58oDDKscKaBGG6vQdkbXn7isE7fw==", + "license": "MIT", + "dependencies": { + "await-event": "^2.1.0", + "await-first": "^1.0.0", + "co": "^4.6.0", + "is-type-of": "^1.2.1" + } + }, + "node_modules/terminal-link": { + "version": "2.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/terminal-link/-/terminal-link-2.1.1.tgz", + "integrity": "sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ==", + "license": "MIT", + "dependencies": { + "ansi-escapes": "^4.2.1", + "supports-hyperlinks": "^2.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/test-exclude": { + "version": "7.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/test-exclude/-/test-exclude-7.0.1.tgz", + "integrity": "sha512-pFYqmTw68LXVjeWJMST4+borgQP2AyMNbg1BpZh9LbyhUeNkeaPF9gzfPGUAnSMV3qPYdWUwDIjjCLiSDOl7vg==", + "dev": true, + "license": "ISC", + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^10.4.1", + "minimatch": "^9.0.4" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/test-exclude/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/test-exclude/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true, + "license": "MIT" + }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "license": "MIT", + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "license": "MIT" + }, + "node_modules/through2": { + "version": "2.0.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "license": "MIT", + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/through2/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "license": "MIT" + }, + "node_modules/through2/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/through2/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "license": "MIT" + }, + "node_modules/through2/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/title-case": { + "version": "2.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/title-case/-/title-case-2.1.1.tgz", + "integrity": "sha512-EkJoZ2O3zdCz3zJsYCsxyq2OC5hrxR9mfdd5I+w8h/tmFfeOxJ+vvkxsKxdmN0WtS9zLdHEgfgVOiMVgv+Po4Q==", + "license": "MIT", + "dependencies": { + "no-case": "^2.2.0", + "upper-case": "^1.0.3" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/toposort-class": { + "version": "1.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/toposort-class/-/toposort-class-1.0.1.tgz", + "integrity": "sha512-OsLcGGbYF3rMjPUf8oKktyvCiUxSbqMMS39m33MAjLTC1DVIH6x3WSt63/M77ihI09+Sdfk1AXvfhCEeUmC7mg==", + "license": "MIT" + }, + "node_modules/tough-cookie": { + "version": "2.5.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "license": "BSD-3-Clause", + "dependencies": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/ts-api-utils": { + "version": "1.4.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ts-api-utils/-/ts-api-utils-1.4.3.tgz", + "integrity": "sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, + "node_modules/ts-node": { + "version": "10.9.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/ts-node/node_modules/diff": { + "version": "4.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/tsconfig-paths": { + "version": "4.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz", + "integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==", + "license": "MIT", + "dependencies": { + "json5": "^2.2.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD" + }, + "node_modules/tsscmp": { + "version": "1.0.6", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/tsscmp/-/tsscmp-1.0.6.tgz", + "integrity": "sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==", + "license": "MIT", + "engines": { + "node": ">=0.6.x" + } + }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/tweetnacl": { + "version": "0.14.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", + "license": "Unlicense" + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-fest": { + "version": "3.13.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/type-fest/-/type-fest-3.13.1.tgz", + "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "license": "MIT", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typed-array-buffer": { + "version": "1.0.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", + "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz", + "integrity": "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz", + "integrity": "sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.15", + "reflect.getprototypeof": "^1.0.9" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.7", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/typed-array-length/-/typed-array-length-1.0.7.tgz", + "integrity": "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0", + "reflect.getprototypeof": "^1.0.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/typical": { + "version": "5.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/uid-safe": { + "version": "2.1.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/uid-safe/-/uid-safe-2.1.5.tgz", + "integrity": "sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==", + "license": "MIT", + "dependencies": { + "random-bytes": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/umzug": { + "version": "2.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/umzug/-/umzug-2.3.0.tgz", + "integrity": "sha512-Z274K+e8goZK8QJxmbRPhl89HPO1K+ORFtm6rySPhFKfKc5GHhqdzD0SGhSWHkzoXasqJuItdhorSvY7/Cgflw==", + "dev": true, + "license": "MIT", + "dependencies": { + "bluebird": "^3.7.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/unbox-primitive": { + "version": "1.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/unbox-primitive/-/unbox-primitive-1.1.0.tgz", + "integrity": "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-bigints": "^1.0.2", + "has-symbols": "^1.1.0", + "which-boxed-primitive": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/undici": { + "version": "5.29.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/undici/-/undici-5.29.0.tgz", + "integrity": "sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==", + "license": "MIT", + "dependencies": { + "@fastify/busboy": "^2.0.0" + }, + "engines": { + "node": ">=14.0" + } + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "license": "MIT" + }, + "node_modules/unescape": { + "version": "1.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/unescape/-/unescape-1.0.1.tgz", + "integrity": "sha512-O0+af1Gs50lyH1nUu3ZyYS1cRh01Q/kUKatTOkSs7jukXE6/NebucDVxyiDsA9AQ4JC1V1jUH9EO8JX2nMDgGQ==", + "license": "MIT", + "dependencies": { + "extend-shallow": "^2.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.1.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/update-browserslist-db/-/update-browserslist-db-1.1.4.tgz", + "integrity": "sha512-q0SPT4xyU84saUX+tomz1WLkxUbuaJnR1xWt17M7fJtEJigJeWUNGUqrauFXsHnqev9y9JTRGwk13tFBuKby4A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/upper-case": { + "version": "1.1.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/upper-case/-/upper-case-1.1.3.tgz", + "integrity": "sha512-WRbjgmYzgXkCV7zNVpy5YgrHgbBv126rMALQQMrmzOVC4GM2waQ9x7xtm8VU+1yF2kWyPzI9zbZ48n4vSxwfSA==", + "license": "MIT" + }, + "node_modules/upper-case-first": { + "version": "1.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/upper-case-first/-/upper-case-first-1.1.2.tgz", + "integrity": "sha512-wINKYvI3Db8dtjikdAqoBbZoP6Q+PZUyfMR7pmwHzjC2quzSkUq5DmPrTtPEqHaz8AGtmsB4TqwapMTM1QAQOQ==", + "license": "MIT", + "dependencies": { + "upper-case": "^1.1.1" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/urijs": { + "version": "1.19.11", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/urijs/-/urijs-1.19.11.tgz", + "integrity": "sha512-HXgFDgDommxn5/bIv0cnQZsPhHDA90NPHD6+c/v21U5+Sx5hoP8+dP9IZXBU1gIfvdRfhG8cel9QNPeionfcCQ==", + "license": "MIT" + }, + "node_modules/urllib": { + "version": "2.44.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/urllib/-/urllib-2.44.0.tgz", + "integrity": "sha512-zRCJqdfYllRDA9bXUtx+vccyRqtJPKsw85f44zH7zPD28PIvjMqIgw9VwoTLV7xTBWZsbebUFVHU5ghQcWku2A==", + "license": "MIT", + "dependencies": { + "any-promise": "^1.3.0", + "content-type": "^1.0.2", + "default-user-agent": "^1.0.0", + "digest-header": "^1.0.0", + "ee-first": "~1.1.1", + "formstream": "^1.1.0", + "humanize-ms": "^1.2.0", + "iconv-lite": "^0.6.3", + "pump": "^3.0.0", + "qs": "^6.4.0", + "statuses": "^1.3.1", + "utility": "^1.16.1" + }, + "engines": { + "node": ">= 0.10.0" + }, + "peerDependencies": { + "proxy-agent": "^5.0.0" + }, + "peerDependenciesMeta": { + "proxy-agent": { + "optional": true + } + } + }, + "node_modules/urllib-next": { + "name": "urllib", + "version": "3.27.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/urllib/-/urllib-3.27.3.tgz", + "integrity": "sha512-24ht/hHAkhWXbqSCM499B8gFPXaf4aFQJNqJH5pMsvfyo+aM3zKuQ/uiZ/mdz41Nnw6ItuiqMVMK5VDAlAHLlw==", + "license": "MIT", + "dependencies": { + "default-user-agent": "^1.0.0", + "digest-header": "^1.0.0", + "form-data-encoder": "^1.7.2", + "formdata-node": "^4.3.3", + "formstream": "^1.1.1", + "mime-types": "^2.1.35", + "pump": "^3.0.0", + "qs": "^6.11.2", + "type-fest": "^4.3.1", + "undici": "^5.28.2", + "ylru": "^1.3.2" + }, + "engines": { + "node": ">= 14.19.3" + } + }, + "node_modules/urllib-next/node_modules/type-fest": { + "version": "4.41.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/urllib/node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/urllib/node_modules/utility": { + "version": "1.18.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/utility/-/utility-1.18.0.tgz", + "integrity": "sha512-PYxZDA+6QtvRvm//++aGdmKG/cI07jNwbROz0Ql+VzFV1+Z0Dy55NI4zZ7RHc9KKpBePNFwoErqIuqQv/cjiTA==", + "license": "MIT", + "dependencies": { + "copy-to": "^2.0.1", + "escape-html": "^1.0.3", + "mkdirp": "^0.5.1", + "mz": "^2.7.0", + "unescape": "^1.0.1" + }, + "engines": { + "node": ">= 0.12.0" + } + }, + "node_modules/urllib4": { + "name": "urllib", + "version": "4.8.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/urllib/-/urllib-4.8.2.tgz", + "integrity": "sha512-V5oo9kzQfF9UQAC9KOVFmmmbYPJ9nksgO8HM89BZse96QcCyjrssPVxKzL/9sVPRC8D4Sd3nAdaMCXAZ3dqEYA==", + "license": "MIT", + "dependencies": { + "form-data": "^4.0.1", + "formstream": "^1.5.1", + "mime-types": "^2.1.35", + "qs": "^6.12.1", + "type-fest": "^4.20.1", + "undici": "^7.1.1", + "ylru": "^2.0.0" + }, + "engines": { + "node": ">= 18.19.0" + } + }, + "node_modules/urllib4/node_modules/type-fest": { + "version": "4.41.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/urllib4/node_modules/undici": { + "version": "7.16.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/undici/-/undici-7.16.0.tgz", + "integrity": "sha512-QEg3HPMll0o3t2ourKwOeUAZ159Kn9mx5pnzHRQO8+Wixmh88YdZRiIwat0iNzNNXn0yoEtXJqFpyW7eM8BV7g==", + "license": "MIT", + "engines": { + "node": ">=20.18.1" + } + }, + "node_modules/urllib4/node_modules/ylru": { + "version": "2.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ylru/-/ylru-2.0.0.tgz", + "integrity": "sha512-T6hTrKcr9lKeUG0MQ/tO72D3UGptWVohgzpHG8ljU1jeBt2RCjcWxvsTPD8ZzUq1t1FvwROAw1kxg2euvg/THg==", + "license": "MIT", + "engines": { + "node": ">= 18.19.0" + } + }, + "node_modules/util": { + "version": "0.10.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/util/-/util-0.10.4.tgz", + "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", + "license": "MIT", + "dependencies": { + "inherits": "2.0.3" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" + }, + "node_modules/util/node_modules/inherits": { + "version": "2.0.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==", + "license": "ISC" + }, + "node_modules/utility": { + "version": "2.5.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/utility/-/utility-2.5.0.tgz", + "integrity": "sha512-lDbOVde5UAKgtxrSyZNhqrTA7f7anba6DTqbsDWgUFk6PZlmr7djqPYw0FnL5a6TbJvRt38VmYqt07zVLzXG2A==", + "license": "MIT", + "dependencies": { + "escape-html": "^1.0.3", + "unescape": "^1.0.1", + "ylru": "^2.0.0" + }, + "engines": { + "node": ">= 16.0.0" + } + }, + "node_modules/utility/node_modules/ylru": { + "version": "2.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ylru/-/ylru-2.0.0.tgz", + "integrity": "sha512-T6hTrKcr9lKeUG0MQ/tO72D3UGptWVohgzpHG8ljU1jeBt2RCjcWxvsTPD8ZzUq1t1FvwROAw1kxg2euvg/THg==", + "license": "MIT", + "engines": { + "node": ">= 18.19.0" + } + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true, + "license": "MIT" + }, + "node_modules/v8-to-istanbul": { + "version": "9.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", + "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", + "dev": true, + "license": "ISC", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^2.0.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/validator": { + "version": "13.15.22", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/validator/-/validator-13.15.22.tgz", + "integrity": "sha512-uT/YQjiyLJP7HSrv/dPZqK9L28xf8hsNca01HSz1dfmI0DgMfjopp1rO/z13NeGF1tVystF0Ejx3y4rUKPw+bQ==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/verror": { + "version": "1.10.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/verror/-/verror-1.10.0.tgz", + "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", + "engines": [ + "node >=0.6.0" + ], + "license": "MIT", + "dependencies": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "node_modules/verror/node_modules/core-util-is": { + "version": "1.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", + "license": "MIT" + }, + "node_modules/wcwidth": { + "version": "1.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", + "dev": true, + "license": "MIT", + "dependencies": { + "defaults": "^1.0.3" + } + }, + "node_modules/web-streams-polyfill": { + "version": "4.0.0-beta.3", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.3.tgz", + "integrity": "sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==", + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/whatwg-mimetype": { + "version": "4.0.0", + "resolved": "https://mirrors.cloud.tencent.com/npm/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/which": { + "version": "1.3.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", + "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-bigint": "^1.1.0", + "is-boolean-object": "^1.2.1", + "is-number-object": "^1.1.1", + "is-string": "^1.1.1", + "is-symbol": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-builtin-type": { + "version": "1.2.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/which-builtin-type/-/which-builtin-type-1.2.1.tgz", + "integrity": "sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "function.prototype.name": "^1.1.6", + "has-tostringtag": "^1.0.2", + "is-async-function": "^2.0.0", + "is-date-object": "^1.1.0", + "is-finalizationregistry": "^1.1.0", + "is-generator-function": "^1.0.10", + "is-regex": "^1.2.1", + "is-weakref": "^1.0.2", + "isarray": "^2.0.5", + "which-boxed-primitive": "^1.1.0", + "which-collection": "^1.0.2", + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-builtin-type/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true, + "license": "MIT" + }, + "node_modules/which-collection": { + "version": "1.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/which-collection/-/which-collection-1.0.2.tgz", + "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-map": "^2.0.3", + "is-set": "^2.0.3", + "is-weakmap": "^2.0.2", + "is-weakset": "^2.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-module": { + "version": "2.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", + "license": "ISC" + }, + "node_modules/which-typed-array": { + "version": "1.1.19", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/which-typed-array/-/which-typed-array-1.1.19.tgz", + "integrity": "sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "for-each": "^0.3.5", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/win-release": { + "version": "1.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/win-release/-/win-release-1.1.1.tgz", + "integrity": "sha512-iCRnKVvGxOQdsKhcQId2PXV1vV3J/sDPXKA4Oe9+Eti2nb2ESEsYHRYls/UjoUW3bIc5ZDO8dTH50A/5iVN+bw==", + "license": "MIT", + "dependencies": { + "semver": "^5.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wkx": { + "version": "0.5.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/wkx/-/wkx-0.5.0.tgz", + "integrity": "sha512-Xng/d4Ichh8uN4l0FToV/258EjMGU9MGcA0HV2d9B/ZpZB3lqQm7nkOdZdm5GhKtLLhAE7PiVQwN4eN+2YJJUg==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wordwrapjs": { + "version": "4.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/wordwrapjs/-/wordwrapjs-4.0.1.tgz", + "integrity": "sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA==", + "dev": true, + "license": "MIT", + "dependencies": { + "reduce-flatten": "^2.0.0", + "typical": "^5.2.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/workerpool": { + "version": "6.5.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/workerpool/-/workerpool-6.5.1.tgz", + "integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + }, + "node_modules/wt": { + "version": "1.2.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/wt/-/wt-1.2.0.tgz", + "integrity": "sha512-nJttxFyxnIvWBWYcy7Px4XkXbRoEe77by66d0FDof266Mv00vVBNcUGa00rL1+0DdsXG75LG1rwBnBfUa2bNLA==", + "license": "MIT", + "dependencies": { + "debug": "^2.2.0", + "ndir": "^0.1.5", + "sdk-base": "^2.0.1" + }, + "engines": { + "node": ">= 0.12.9" + } + }, + "node_modules/wt/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/wt/node_modules/get-ready": { + "version": "1.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/get-ready/-/get-ready-1.0.0.tgz", + "integrity": "sha512-mFXCZPJIlcYcth+N8267+mghfYN9h3EhsDa6JSnbA3Wrhh/XFpuowviFcsDeYZtKspQyWyJqfs4O6P8CHeTwzw==", + "license": "MIT" + }, + "node_modules/wt/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/wt/node_modules/sdk-base": { + "version": "2.0.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/sdk-base/-/sdk-base-2.0.1.tgz", + "integrity": "sha512-eeG26wRwhtwYuKGCDM3LixCaxY27Pa/5lK4rLKhQa7HBjJ3U3Y+f81MMZQRsDw/8SC2Dao/83yJTXJ8aULuN8Q==", + "license": "MIT", + "dependencies": { + "get-ready": "~1.0.0" + } + }, + "node_modules/xml-crypto": { + "version": "6.1.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/xml-crypto/-/xml-crypto-6.1.2.tgz", + "integrity": "sha512-leBOVQdVi8FvPJrMYoum7Ici9qyxfE4kVi+AkpUoYCSXaQF4IlBm1cneTK9oAxR61LpYxTx7lNcsnBIeRpGW2w==", + "license": "MIT", + "dependencies": { + "@xmldom/is-dom-node": "^1.0.1", + "@xmldom/xmldom": "^0.8.10", + "xpath": "^0.0.33" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/xpath": { + "version": "0.0.33", + "resolved": "https://mirrors.cloud.tencent.com/npm/xpath/-/xpath-0.0.33.tgz", + "integrity": "sha512-NNXnzrkDrAzalLhIUc01jO2mOzXGXh1JwPgkihcLLzw98c0WgYDmmjSh1Kl3wzaxSVWMuA+fe0WTWOBDWCBmNA==", + "license": "MIT", + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/xss": { + "version": "1.0.15", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/xss/-/xss-1.0.15.tgz", + "integrity": "sha512-FVdlVVC67WOIPvfOwhoMETV72f6GbW7aOabBC3WxN/oUdoEMDyLz4OgRv5/gck2ZeNqEQu+Tb0kloovXOfpYVg==", + "license": "MIT", + "dependencies": { + "commander": "^2.20.3", + "cssfilter": "0.0.10" + }, + "bin": { + "xss": "bin/xss" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "license": "MIT", + "engines": { + "node": ">=0.4" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-unparser": { + "version": "2.0.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-unparser/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ylru": { + "version": "1.4.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/ylru/-/ylru-1.4.0.tgz", + "integrity": "sha512-2OQsPNEmBCvXuFlIni/a+Rn+R2pHW9INm0BxXJ4hVDA8TirqMj+J/Rp9ItLatT/5pZqWwefVrTQcHpixsxnVlA==", + "license": "MIT", + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/zlogger": { + "version": "1.1.0", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/zlogger/-/zlogger-1.1.0.tgz", + "integrity": "sha512-WjRPkjHe4rajXun45zZRAnViTSLkIr2PEFI303u+3NYIkhWqxhpTr0j67XPzhTJMmDH27pGoTSxGg/qP8FiaJA==", + "license": "MIT", + "dependencies": { + "pumpify": "^1.3.5", + "split2": "^2.1.0", + "through2": "^2.0.1" + }, + "engines": { + "node": ">=4.3.1" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..4712c53 --- /dev/null +++ b/package.json @@ -0,0 +1,56 @@ +{ + "name": "oms", + "version": "1.0.0", + "description": "奇门wms", + "private": true, + "egg": { + "declarations": true + }, + "dependencies": { + "await-stream-ready": "^1.0.1", + "cos-js-sdk-v5": "^1.10.1", + "cos-nodejs-sdk-v5": "^2.15.4", + "crypto-js": "^4.2.0", + "egg": "^3.17.5", + "egg-cors": "^3.0.1", + "egg-jwt": "^3.1.7", + "egg-mysql": "^5.0.0", + "egg-redis": "^2.6.1", + "egg-scripts": "2", + "egg-sequelize": "^6.0.0", + "egg-view-ejs": "^3.0.0", + "ejs": "^5.0.1", + "fast-xml-parser": "^5.3.1", + "mysql2": "^3.15.3", + "path": "^0.12.7", + "qiniu-js": "^3.4.3", + "soap": "^1.8.0", + "spark-md5": "^3.0.2" + }, + "devDependencies": { + "egg-bin": "6", + "egg-mock": "5", + "eslint": "8", + "eslint-config-egg": "13", + "sequelize-cli": "^6.6.3" + }, + "engines": { + "node": ">=18.0.0" + }, + "scripts": { + "start": "egg-scripts start ", + "stop": "egg-scripts stop", + "dev": "egg-bin dev --port=6060", + "test": "npm run lint -- --fix && npm run test:local", + "test:local": "egg-bin test", + "cov": "egg-bin cov", + "lint": "eslint .", + "ci": "npm run lint && npm run cov" + }, + "repository": { + "type": "git", + "url": "" + }, + "author": "刘付明仁", + "license": "MIT" +} diff --git a/test/app/controller/api_v2.test.js b/test/app/controller/api_v2.test.js new file mode 100644 index 0000000..89011df --- /dev/null +++ b/test/app/controller/api_v2.test.js @@ -0,0 +1,43 @@ +const { strict: assert } = require('node:assert'); +const { app } = require('egg-mock/bootstrap'); + +describe('test/app/controller/api_v2.test.js', () => { + before(() => { + // avoid database or factory initialization during tests + app.model = {}; + }); + + it('dispatches a simple method and returns payload', async () => { + // mock dispatcher.invoke so we don't need real services or auth + app.mockService('dispatcher', 'invoke', async (method, data, auth, ctx) => { + // verify parameters arrived as expected + assert(method === 'index.fastWhereTree'); + assert.deepEqual(data, { type: 'example' }); + // return a fake successful response + return { isLog: true, result: { status: 200, data: { foo: 'bar', method } } }; + }); + + const res = await app.httpRequest() + .post('/api/v2?method=index.fastWhereTree&v=1.0&format=json×tamp=123') + .set('Content-Type', 'application/json') + .send({ type: 'example' }) + .expect(200); + + assert.deepEqual(res.body, { foo: 'bar', method: 'index.fastWhereTree' }); + }); + + it('returns 401 when dispatcher.invoke throws (simulating auth failure)', async () => { + // simulate auth failure by making invoke return unauthorized + app.mockService('dispatcher', 'invoke', async () => { + return { isLog: false, result: { status: 401, message: 'Unauthorized' } }; + }); + + const res = await app.httpRequest() + .post('/api/v2?method=index.fastWhereTree&v=1.0&format=json×tamp=123') + .set('Content-Type', 'application/json') + .send({}) + .expect(401); // controller forwards status from dispatcher + + assert(res.body && res.body.message === 'Unauthorized'); + }); +}); diff --git a/test/app/controller/home.test.js b/test/app/controller/home.test.js new file mode 100644 index 0000000..ea43dbb --- /dev/null +++ b/test/app/controller/home.test.js @@ -0,0 +1,23 @@ +const { strict: assert } = require('node:assert'); +const path = require('node:path'); +const { statSync } = require('node:fs'); +const { app } = require('egg-mock/bootstrap'); + +describe('test/app/controller/home.test.js', () => { + it('should assert', async () => { + const pkg = require('../../../package.json'); + assert(app.config.keys.startsWith(pkg.name)); + }); + + it('should typings exists', async () => { + const typings = path.join(__dirname, '../../../typings'); + assert(statSync(typings)); + }); + + it('should GET /', async () => { + return app.httpRequest() + .get('/') + .expect('hi, egg') + .expect(200); + }); +}); diff --git a/wms.code-workspace b/wms.code-workspace new file mode 100644 index 0000000..61e510d --- /dev/null +++ b/wms.code-workspace @@ -0,0 +1,9 @@ +{ + "folders": [ + { + "path": "." + } + ], + "settings": { + } +} \ No newline at end of file