mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-04 21:19:27 +08:00
chore(deps): upgrade dependencies (#6708)
* chore: upgrade jsonwebtoken to version 9.0.2 * chore: update * fix: deps * fix: semver * chore: dicer * chore: upgrade multer * fix: dicer * fix: remove sqlite * chore: check db dialect * chore: remove sqlite3 * fix: yarn add sqlite3 --no-save -W * fix: test * fix: test * fix: ci * fix: test * fix: deps
This commit is contained in:
parent
73956a834d
commit
120aa3420c
4
.github/workflows/nocobase-test-backend.yml
vendored
4
.github/workflows/nocobase-test-backend.yml
vendored
@ -61,7 +61,9 @@ jobs:
|
|||||||
node-version: ${{ matrix.node_version }}
|
node-version: ${{ matrix.node_version }}
|
||||||
cache: 'yarn'
|
cache: 'yarn'
|
||||||
- name: Install project dependencies
|
- name: Install project dependencies
|
||||||
run: yarn install
|
run: |
|
||||||
|
yarn install
|
||||||
|
yarn add sqlite3 --no-save -W
|
||||||
- name: Test with Sqlite
|
- name: Test with Sqlite
|
||||||
run: yarn test --server --single-thread=false
|
run: yarn test --server --single-thread=false
|
||||||
env:
|
env:
|
||||||
|
4
.github/workflows/nocobase-test-windows.yml
vendored
4
.github/workflows/nocobase-test-windows.yml
vendored
@ -63,7 +63,9 @@ jobs:
|
|||||||
${{ runner.os }}-yarn-
|
${{ runner.os }}-yarn-
|
||||||
|
|
||||||
- name: Install project dependencies
|
- name: Install project dependencies
|
||||||
run: yarn --prefer-offline
|
run: |
|
||||||
|
yarn --prefer-offline
|
||||||
|
yarn add sqlite3 --no-save -W
|
||||||
|
|
||||||
- name: Test with Sqlite
|
- name: Test with Sqlite
|
||||||
run: yarn test --server --single-thread=false
|
run: yarn test --server --single-thread=false
|
||||||
|
@ -8,7 +8,11 @@ RUN cd /app \
|
|||||||
&& yarn config set network-timeout 600000 -g \
|
&& yarn config set network-timeout 600000 -g \
|
||||||
&& npx -y create-nocobase-app@${CNA_VERSION} my-nocobase-app --skip-dev-dependencies -a -e APP_ENV=production \
|
&& npx -y create-nocobase-app@${CNA_VERSION} my-nocobase-app --skip-dev-dependencies -a -e APP_ENV=production \
|
||||||
&& cd /app/my-nocobase-app \
|
&& cd /app/my-nocobase-app \
|
||||||
&& yarn install --production
|
&& yarn install --production \
|
||||||
|
&& rm -rf yarn.lock \
|
||||||
|
&& find node_modules -type f -name "yarn.lock" -delete \
|
||||||
|
&& find node_modules -type f -name "bower.json" -delete \
|
||||||
|
&& find node_modules -type f -name "composer.json" -delete
|
||||||
|
|
||||||
RUN cd /app \
|
RUN cd /app \
|
||||||
&& rm -rf nocobase.tar.gz \
|
&& rm -rf nocobase.tar.gz \
|
||||||
|
@ -11,8 +11,8 @@
|
|||||||
"@nocobase/database": "1.6.21",
|
"@nocobase/database": "1.6.21",
|
||||||
"@nocobase/resourcer": "1.6.21",
|
"@nocobase/resourcer": "1.6.21",
|
||||||
"@nocobase/utils": "1.6.21",
|
"@nocobase/utils": "1.6.21",
|
||||||
"@types/jsonwebtoken": "^8.5.8",
|
"@types/jsonwebtoken": "^9.0.9",
|
||||||
"jsonwebtoken": "^8.5.1"
|
"jsonwebtoken": "^9.0.2"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
const { Command } = require('commander');
|
const { Command } = require('commander');
|
||||||
const { generatePlugins, run, postCheck, nodeCheck, promptForTs, isPortReachable } = require('../util');
|
const { generatePlugins, run, postCheck, nodeCheck, promptForTs, isPortReachable, checkDBDialect } = require('../util');
|
||||||
const { getPortPromise } = require('portfinder');
|
const { getPortPromise } = require('portfinder');
|
||||||
const chokidar = require('chokidar');
|
const chokidar = require('chokidar');
|
||||||
const { uid } = require('@formily/shared');
|
const { uid } = require('@formily/shared');
|
||||||
@ -36,6 +36,7 @@ module.exports = (cli) => {
|
|||||||
.option('-i, --inspect [port]')
|
.option('-i, --inspect [port]')
|
||||||
.allowUnknownOption()
|
.allowUnknownOption()
|
||||||
.action(async (opts) => {
|
.action(async (opts) => {
|
||||||
|
checkDBDialect();
|
||||||
let subprocess;
|
let subprocess;
|
||||||
const runDevClient = () => {
|
const runDevClient = () => {
|
||||||
console.log('starting client', 1 * clientPort);
|
console.log('starting client', 1 * clientPort);
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const { Command } = require('commander');
|
const { Command } = require('commander');
|
||||||
const { run, isPortReachable } = require('../util');
|
const { run, isPortReachable, checkDBDialect } = require('../util');
|
||||||
const { execSync } = require('node:child_process');
|
const { execSync } = require('node:child_process');
|
||||||
const axios = require('axios');
|
const axios = require('axios');
|
||||||
const { pTest } = require('./p-test');
|
const { pTest } = require('./p-test');
|
||||||
@ -165,6 +165,7 @@ const filterArgv = () => {
|
|||||||
*/
|
*/
|
||||||
module.exports = (cli) => {
|
module.exports = (cli) => {
|
||||||
const e2e = cli.command('e2e').hook('preAction', () => {
|
const e2e = cli.command('e2e').hook('preAction', () => {
|
||||||
|
checkDBDialect();
|
||||||
if (process.env.APP_BASE_URL) {
|
if (process.env.APP_BASE_URL) {
|
||||||
process.env.APP_BASE_URL = process.env.APP_BASE_URL.replace('localhost', '127.0.0.1');
|
process.env.APP_BASE_URL = process.env.APP_BASE_URL.replace('localhost', '127.0.0.1');
|
||||||
console.log('APP_BASE_URL:', process.env.APP_BASE_URL);
|
console.log('APP_BASE_URL:', process.env.APP_BASE_URL);
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const { Command } = require('commander');
|
const { Command } = require('commander');
|
||||||
const { run, isDev, isProd, promptForTs, downloadPro } = require('../util');
|
const { run, isDev, isProd, promptForTs, downloadPro, checkDBDialect } = require('../util');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -21,6 +21,7 @@ module.exports = (cli) => {
|
|||||||
.option('-h, --help')
|
.option('-h, --help')
|
||||||
.option('--ts-node-dev')
|
.option('--ts-node-dev')
|
||||||
.action(async (options) => {
|
.action(async (options) => {
|
||||||
|
checkDBDialect();
|
||||||
const cmd = process.argv.slice(2)?.[0];
|
const cmd = process.argv.slice(2)?.[0];
|
||||||
if (cmd === 'install') {
|
if (cmd === 'install') {
|
||||||
await downloadPro();
|
await downloadPro();
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
const { Command } = require('commander');
|
const { Command } = require('commander');
|
||||||
const { run, postCheck, downloadPro, promptForTs } = require('../util');
|
const { run, postCheck, downloadPro, promptForTs, checkDBDialect } = require('../util');
|
||||||
const { existsSync, rmSync } = require('fs');
|
const { existsSync, rmSync } = require('fs');
|
||||||
const { resolve, isAbsolute } = require('path');
|
const { resolve, isAbsolute } = require('path');
|
||||||
const chalk = require('chalk');
|
const chalk = require('chalk');
|
||||||
@ -50,6 +50,7 @@ module.exports = (cli) => {
|
|||||||
.option('--quickstart')
|
.option('--quickstart')
|
||||||
.allowUnknownOption()
|
.allowUnknownOption()
|
||||||
.action(async (opts) => {
|
.action(async (opts) => {
|
||||||
|
checkDBDialect();
|
||||||
if (opts.quickstart) {
|
if (opts.quickstart) {
|
||||||
await downloadPro();
|
await downloadPro();
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const { run } = require('../util');
|
const { run, checkDBDialect } = require('../util');
|
||||||
const fg = require('fast-glob');
|
const fg = require('fast-glob');
|
||||||
|
|
||||||
const coreClientPackages = ['packages/core/client', 'packages/core/sdk'];
|
const coreClientPackages = ['packages/core/client', 'packages/core/sdk'];
|
||||||
@ -30,6 +30,7 @@ const getPackagesDir = (isClient) => {
|
|||||||
|
|
||||||
module.exports = (cli) => {
|
module.exports = (cli) => {
|
||||||
cli.command('test-coverage:server').action(async () => {
|
cli.command('test-coverage:server').action(async () => {
|
||||||
|
checkDBDialect();
|
||||||
const packageRoots = getPackagesDir(false);
|
const packageRoots = getPackagesDir(false);
|
||||||
for (const dir of packageRoots) {
|
for (const dir of packageRoots) {
|
||||||
try {
|
try {
|
||||||
@ -41,6 +42,7 @@ module.exports = (cli) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
cli.command('test-coverage:client').action(async () => {
|
cli.command('test-coverage:client').action(async () => {
|
||||||
|
checkDBDialect();
|
||||||
const packageRoots = getPackagesDir(true);
|
const packageRoots = getPackagesDir(true);
|
||||||
for (const dir of packageRoots) {
|
for (const dir of packageRoots) {
|
||||||
try {
|
try {
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const { Command } = require('commander');
|
const { Command } = require('commander');
|
||||||
const { run } = require('../util');
|
const { run, checkDBDialect } = require('../util');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -29,6 +29,7 @@ function addTestCommand(name, cli) {
|
|||||||
.arguments('[paths...]')
|
.arguments('[paths...]')
|
||||||
.allowUnknownOption()
|
.allowUnknownOption()
|
||||||
.action(async (paths, opts) => {
|
.action(async (paths, opts) => {
|
||||||
|
checkDBDialect();
|
||||||
if (name === 'test:server') {
|
if (name === 'test:server') {
|
||||||
process.env.TEST_ENV = 'server-side';
|
process.env.TEST_ENV = 'server-side';
|
||||||
} else if (name === 'test:client') {
|
} else if (name === 'test:client') {
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
const chalk = require('chalk');
|
const chalk = require('chalk');
|
||||||
const { Command } = require('commander');
|
const { Command } = require('commander');
|
||||||
const { resolve } = require('path');
|
const { resolve } = require('path');
|
||||||
const { run, promptForTs, runAppCommand, hasCorePackages, downloadPro, hasTsNode } = require('../util');
|
const { run, promptForTs, runAppCommand, hasCorePackages, downloadPro, hasTsNode, checkDBDialect } = require('../util');
|
||||||
const { existsSync, rmSync } = require('fs');
|
const { existsSync, rmSync } = require('fs');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -26,6 +26,7 @@ module.exports = (cli) => {
|
|||||||
.option('--next')
|
.option('--next')
|
||||||
.option('-S|--skip-code-update')
|
.option('-S|--skip-code-update')
|
||||||
.action(async (options) => {
|
.action(async (options) => {
|
||||||
|
checkDBDialect();
|
||||||
if (hasTsNode()) promptForTs();
|
if (hasTsNode()) promptForTs();
|
||||||
if (hasCorePackages()) {
|
if (hasCorePackages()) {
|
||||||
// await run('yarn', ['install']);
|
// await run('yarn', ['install']);
|
||||||
|
@ -360,7 +360,7 @@ exports.initEnv = function initEnv() {
|
|||||||
API_BASE_PATH: '/api/',
|
API_BASE_PATH: '/api/',
|
||||||
API_CLIENT_STORAGE_PREFIX: 'NOCOBASE_',
|
API_CLIENT_STORAGE_PREFIX: 'NOCOBASE_',
|
||||||
API_CLIENT_STORAGE_TYPE: 'localStorage',
|
API_CLIENT_STORAGE_TYPE: 'localStorage',
|
||||||
DB_DIALECT: 'sqlite',
|
// DB_DIALECT: 'sqlite',
|
||||||
DB_STORAGE: 'storage/db/nocobase.sqlite',
|
DB_STORAGE: 'storage/db/nocobase.sqlite',
|
||||||
// DB_TIMEZONE: '+00:00',
|
// DB_TIMEZONE: '+00:00',
|
||||||
DB_UNDERSCORED: parseEnv('DB_UNDERSCORED'),
|
DB_UNDERSCORED: parseEnv('DB_UNDERSCORED'),
|
||||||
@ -472,6 +472,12 @@ exports.initEnv = function initEnv() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exports.checkDBDialect = function () {
|
||||||
|
if (!process.env.DB_DIALECT) {
|
||||||
|
throw new Error('DB_DIALECT is required.');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
exports.generatePlugins = function () {
|
exports.generatePlugins = function () {
|
||||||
try {
|
try {
|
||||||
require.resolve('@nocobase/devtools/umiConfig');
|
require.resolve('@nocobase/devtools/umiConfig');
|
||||||
|
@ -21,7 +21,7 @@ cli
|
|||||||
.option('--quickstart', 'quickstart app creation')
|
.option('--quickstart', 'quickstart app creation')
|
||||||
.option('--skip-dev-dependencies')
|
.option('--skip-dev-dependencies')
|
||||||
.option('-a, --all-db-dialect', 'install all database dialect dependencies')
|
.option('-a, --all-db-dialect', 'install all database dialect dependencies')
|
||||||
.option('-d, --db-dialect <dbDialect>', 'database dialect, current support sqlite/mysql/postgres', 'sqlite')
|
.option('-d, --db-dialect <dbDialect>', 'database dialect, current support mysql/postgres', 'postgres')
|
||||||
.option('-e, --env <env>', 'environment variables write into .env file', concat, [])
|
.option('-e, --env <env>', 'environment variables write into .env file', concat, [])
|
||||||
.description('create a new application')
|
.description('create a new application')
|
||||||
.action(async (name, options) => {
|
.action(async (name, options) => {
|
||||||
|
@ -61,7 +61,7 @@ class AppGenerator extends Generator {
|
|||||||
|
|
||||||
checkDialect() {
|
checkDialect() {
|
||||||
const dialect = this.args.dbDialect;
|
const dialect = this.args.dbDialect;
|
||||||
const supportDialects = ['mysql', 'mariadb', 'sqlite', 'postgres'];
|
const supportDialects = ['mysql', 'mariadb', 'postgres'];
|
||||||
if (!supportDialects.includes(dialect)) {
|
if (!supportDialects.includes(dialect)) {
|
||||||
console.log(
|
console.log(
|
||||||
`dialect ${chalk.red(dialect)} is not supported, currently supported dialects are ${chalk.green(
|
`dialect ${chalk.red(dialect)} is not supported, currently supported dialects are ${chalk.green(
|
||||||
@ -76,27 +76,15 @@ class AppGenerator extends Generator {
|
|||||||
const env = this.env;
|
const env = this.env;
|
||||||
const envs = [];
|
const envs = [];
|
||||||
const dependencies = [];
|
const dependencies = [];
|
||||||
const { dbDialect, allDbDialect } = this.args;
|
const { dbDialect } = this.args;
|
||||||
|
|
||||||
if (allDbDialect) {
|
dependencies.push(`"mysql2": "^3.14.0"`);
|
||||||
dependencies.push(`"mysql2": "^3.11.0"`);
|
dependencies.push(`"mariadb": "^3.4.1"`);
|
||||||
dependencies.push(`"mariadb": "^2.5.6"`);
|
dependencies.push(`"pg": "^8.14.1"`);
|
||||||
dependencies.push(`"pg": "^8.7.3"`);
|
dependencies.push(`"pg-hstore": "^2.3.4"`);
|
||||||
dependencies.push(`"pg-hstore": "^2.3.4"`);
|
|
||||||
dependencies.push(`"sqlite3": "^5.0.8"`);
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (dbDialect) {
|
switch (dbDialect) {
|
||||||
case 'sqlite':
|
|
||||||
if (!allDbDialect) {
|
|
||||||
dependencies.push(`"sqlite3": "^5.0.8"`);
|
|
||||||
}
|
|
||||||
envs.push(`DB_STORAGE=${env.DB_STORAGE || 'storage/db/nocobase.sqlite'}`);
|
|
||||||
break;
|
|
||||||
case 'mysql':
|
case 'mysql':
|
||||||
if (!allDbDialect) {
|
|
||||||
dependencies.push(`"mysql2": "^3.11.0"`);
|
|
||||||
}
|
|
||||||
envs.push(`DB_HOST=${env.DB_HOST || 'localhost'}`);
|
envs.push(`DB_HOST=${env.DB_HOST || 'localhost'}`);
|
||||||
envs.push(`DB_PORT=${env.DB_PORT || 3306}`);
|
envs.push(`DB_PORT=${env.DB_PORT || 3306}`);
|
||||||
envs.push(`DB_DATABASE=${env.DB_DATABASE || ''}`);
|
envs.push(`DB_DATABASE=${env.DB_DATABASE || ''}`);
|
||||||
@ -104,9 +92,6 @@ class AppGenerator extends Generator {
|
|||||||
envs.push(`DB_PASSWORD=${env.DB_PASSWORD || ''}`);
|
envs.push(`DB_PASSWORD=${env.DB_PASSWORD || ''}`);
|
||||||
break;
|
break;
|
||||||
case 'mariadb':
|
case 'mariadb':
|
||||||
if (!allDbDialect) {
|
|
||||||
dependencies.push(`"mariadb": "^2.5.6"`);
|
|
||||||
}
|
|
||||||
envs.push(`DB_HOST=${env.DB_HOST || 'localhost'}`);
|
envs.push(`DB_HOST=${env.DB_HOST || 'localhost'}`);
|
||||||
envs.push(`DB_PORT=${env.DB_PORT || 3306}`);
|
envs.push(`DB_PORT=${env.DB_PORT || 3306}`);
|
||||||
envs.push(`DB_DATABASE=${env.DB_DATABASE || ''}`);
|
envs.push(`DB_DATABASE=${env.DB_DATABASE || ''}`);
|
||||||
@ -115,10 +100,6 @@ class AppGenerator extends Generator {
|
|||||||
break;
|
break;
|
||||||
case 'kingbase':
|
case 'kingbase':
|
||||||
case 'postgres':
|
case 'postgres':
|
||||||
if (!allDbDialect) {
|
|
||||||
dependencies.push(`"pg": "^8.7.3"`);
|
|
||||||
dependencies.push(`"pg-hstore": "^2.3.4"`);
|
|
||||||
}
|
|
||||||
envs.push(`DB_HOST=${env.DB_HOST || 'localhost'}`);
|
envs.push(`DB_HOST=${env.DB_HOST || 'localhost'}`);
|
||||||
envs.push(`DB_PORT=${env.DB_PORT || 5432}`);
|
envs.push(`DB_PORT=${env.DB_PORT || 5432}`);
|
||||||
envs.push(`DB_DATABASE=${env.DB_DATABASE || ''}`);
|
envs.push(`DB_DATABASE=${env.DB_DATABASE || ''}`);
|
||||||
|
@ -28,9 +28,10 @@
|
|||||||
"@types/react-dom": "^18.0.0",
|
"@types/react-dom": "^18.0.0",
|
||||||
"react-router-dom": "6.28.1",
|
"react-router-dom": "6.28.1",
|
||||||
"react-router": "6.28.1",
|
"react-router": "6.28.1",
|
||||||
"async": "3.2.6",
|
"async": "^3.2.6",
|
||||||
"antd": "5.12.8",
|
"antd": "5.12.8",
|
||||||
"rollup": "4.24.0"
|
"rollup": "4.24.0",
|
||||||
|
"semver": "^7.7.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nocobase/cli": "{{{version}}}",
|
"@nocobase/cli": "{{{version}}}",
|
||||||
|
@ -11,8 +11,8 @@
|
|||||||
"@nocobase/database": "1.6.21",
|
"@nocobase/database": "1.6.21",
|
||||||
"@nocobase/resourcer": "1.6.21",
|
"@nocobase/resourcer": "1.6.21",
|
||||||
"@nocobase/utils": "1.6.21",
|
"@nocobase/utils": "1.6.21",
|
||||||
"@types/jsonwebtoken": "^8.5.8",
|
"@types/jsonwebtoken": "^9.0.9",
|
||||||
"jsonwebtoken": "^8.5.1"
|
"jsonwebtoken": "^9.0.2"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
"deepmerge": "^4.2.2",
|
"deepmerge": "^4.2.2",
|
||||||
"koa-compose": "^4.1.0",
|
"koa-compose": "^4.1.0",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"path-to-regexp": "6.2.2",
|
"path-to-regexp": "^6.3.0",
|
||||||
"qs": "^6.9.4"
|
"qs": "^6.9.4"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -367,7 +367,7 @@ export class ResourceManager {
|
|||||||
: params.resourceName;
|
: params.resourceName;
|
||||||
ctx.action.params.filterByTk = params.resourceIndex;
|
ctx.action.params.filterByTk = params.resourceIndex;
|
||||||
const query = parseQuery(ctx.request.querystring);
|
const query = parseQuery(ctx.request.querystring);
|
||||||
if (pathToRegexp('/resourcer/{:associatedName.}?:resourceName{\\::actionName}').test(ctx.request.path)) {
|
if (pathToRegexp('/resourcer/:rest(.*)').test(ctx.request.path)) {
|
||||||
ctx.action.mergeParams({
|
ctx.action.mergeParams({
|
||||||
...query,
|
...query,
|
||||||
...params,
|
...params,
|
||||||
|
@ -67,17 +67,25 @@ export function parseRequest(request: ParseRequest, options: ParseOptions = {}):
|
|||||||
...(options.accessors || {}),
|
...(options.accessors || {}),
|
||||||
};
|
};
|
||||||
const keys = [];
|
const keys = [];
|
||||||
const regexp = pathToRegexp('/resourcer/{:associatedName.}?:resourceName{\\::actionName}', keys);
|
|
||||||
|
const regexp = pathToRegexp('/resourcer/:rest(.*)', keys);
|
||||||
const reqPath = decodeURI(request.path);
|
const reqPath = decodeURI(request.path);
|
||||||
const matches = regexp.exec(reqPath);
|
const matches = regexp.exec(reqPath);
|
||||||
if (matches) {
|
if (matches) {
|
||||||
const params = {};
|
const params = {};
|
||||||
keys.forEach((obj, index) => {
|
const [resource, action] = matches[1].split(':');
|
||||||
if (matches[index + 1] === undefined) {
|
const [res1, res2] = resource.split('.');
|
||||||
return;
|
if (res1) {
|
||||||
|
if (res2) {
|
||||||
|
params['associatedName'] = res1;
|
||||||
|
params['resourceName'] = res2;
|
||||||
|
} else {
|
||||||
|
params['resourceName'] = res1;
|
||||||
}
|
}
|
||||||
params[obj.name] = matches[index + 1];
|
}
|
||||||
});
|
if (action) {
|
||||||
|
params['actionName'] = action;
|
||||||
|
}
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
const defaults = {
|
const defaults = {
|
||||||
|
@ -8,8 +8,8 @@
|
|||||||
"@formily/json-schema": "2.x",
|
"@formily/json-schema": "2.x",
|
||||||
"@hapi/topo": "^6.0.0",
|
"@hapi/topo": "^6.0.0",
|
||||||
"@koa/cors": "^5.0.0",
|
"@koa/cors": "^5.0.0",
|
||||||
"@koa/multer": "^3.0.2",
|
"@koa/multer": "^3.1.0",
|
||||||
"@koa/router": "^9.4.0",
|
"@koa/router": "^13.1.0",
|
||||||
"@nocobase/acl": "1.6.21",
|
"@nocobase/acl": "1.6.21",
|
||||||
"@nocobase/actions": "1.6.21",
|
"@nocobase/actions": "1.6.21",
|
||||||
"@nocobase/auth": "1.6.21",
|
"@nocobase/auth": "1.6.21",
|
||||||
@ -26,7 +26,7 @@
|
|||||||
"@types/decompress": "4.2.7",
|
"@types/decompress": "4.2.7",
|
||||||
"@types/ini": "^1.3.31",
|
"@types/ini": "^1.3.31",
|
||||||
"@types/koa-send": "^4.1.3",
|
"@types/koa-send": "^4.1.3",
|
||||||
"@types/multer": "^1.4.5",
|
"@types/multer": "^1.4.12",
|
||||||
"async-mutex": "^0.5.0",
|
"async-mutex": "^0.5.0",
|
||||||
"axios": "^1.7.0",
|
"axios": "^1.7.0",
|
||||||
"chalk": "^4.1.1",
|
"chalk": "^4.1.1",
|
||||||
@ -45,7 +45,7 @@
|
|||||||
"koa-send": "^5.0.1",
|
"koa-send": "^5.0.1",
|
||||||
"koa-static": "^5.0.0",
|
"koa-static": "^5.0.0",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"multer": "^1.4.2",
|
"multer": "^1.4.5-lts.2",
|
||||||
"nanoid": "^3.3.11",
|
"nanoid": "^3.3.11",
|
||||||
"semver": "^7.7.1",
|
"semver": "^7.7.1",
|
||||||
"serve-handler": "^6.1.6",
|
"serve-handler": "^6.1.6",
|
||||||
|
@ -15,7 +15,7 @@ const deps: Record<string, string> = {
|
|||||||
'@formily': '2.x',
|
'@formily': '2.x',
|
||||||
|
|
||||||
'@formily/antd-v5': '1.x',
|
'@formily/antd-v5': '1.x',
|
||||||
jsonwebtoken: '8.x',
|
jsonwebtoken: '9.x',
|
||||||
'cache-manager': '5.x',
|
'cache-manager': '5.x',
|
||||||
sequelize: '6.x',
|
sequelize: '6.x',
|
||||||
umzug: '3.x',
|
umzug: '3.x',
|
||||||
@ -26,7 +26,7 @@ const deps: Record<string, string> = {
|
|||||||
'winston-daily-rotate-file': '4.x',
|
'winston-daily-rotate-file': '4.x',
|
||||||
koa: '2.x',
|
koa: '2.x',
|
||||||
'@koa/cors': '5.x',
|
'@koa/cors': '5.x',
|
||||||
'@koa/router': '9.x',
|
'@koa/router': '13.x',
|
||||||
multer: '1.x',
|
multer: '1.x',
|
||||||
'@koa/multer': '3.x',
|
'@koa/multer': '3.x',
|
||||||
'koa-bodyparser': '4.x',
|
'koa-bodyparser': '4.x',
|
||||||
|
@ -69,7 +69,6 @@
|
|||||||
"mysql2": "^3.11.0",
|
"mysql2": "^3.11.0",
|
||||||
"pg": "^8.7.3",
|
"pg": "^8.7.3",
|
||||||
"pg-hstore": "^2.3.4",
|
"pg-hstore": "^2.3.4",
|
||||||
"sqlite3": "^5.0.8",
|
|
||||||
"supertest": "^6.1.6",
|
"supertest": "^6.1.6",
|
||||||
"vite": "^5.0.0",
|
"vite": "^5.0.0",
|
||||||
"vitest": "^1.5.0",
|
"vitest": "^1.5.0",
|
||||||
|
@ -7,13 +7,13 @@
|
|||||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import http from 'http';
|
|
||||||
import url from 'url';
|
|
||||||
import pg from 'pg';
|
|
||||||
import dotenv from 'dotenv';
|
import dotenv from 'dotenv';
|
||||||
import path from 'path';
|
import http from 'http';
|
||||||
import mysql from 'mysql2/promise';
|
|
||||||
import mariadb from 'mariadb';
|
import mariadb from 'mariadb';
|
||||||
|
import mysql from 'mysql2/promise';
|
||||||
|
import path from 'path';
|
||||||
|
import pg from 'pg';
|
||||||
|
import url from 'url';
|
||||||
|
|
||||||
dotenv.config({ path: path.resolve(process.cwd(), '.env.test') });
|
dotenv.config({ path: path.resolve(process.cwd(), '.env.test') });
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
"flat-to-nested": "^1.1.1",
|
"flat-to-nested": "^1.1.1",
|
||||||
"graphlib": "^2.1.8",
|
"graphlib": "^2.1.8",
|
||||||
"handlebars": "^4.7.8",
|
"handlebars": "^4.7.8",
|
||||||
"multer": "^1.4.5-lts.1",
|
"multer": "^1.4.5-lts.2",
|
||||||
"object-path": "^0.11.8"
|
"object-path": "^0.11.8"
|
||||||
},
|
},
|
||||||
"gitHead": "d0b4efe4be55f8c79a98a331d99d9f8cf99021a1"
|
"gitHead": "d0b4efe4be55f8c79a98a331d99d9f8cf99021a1"
|
||||||
|
@ -13,8 +13,8 @@
|
|||||||
"Users & permissions"
|
"Users & permissions"
|
||||||
],
|
],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jsonwebtoken": "^8.5.8",
|
"@types/jsonwebtoken": "^9.0.9",
|
||||||
"jsonwebtoken": "^8.5.1",
|
"jsonwebtoken": "^9.0.2",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0"
|
"react-dom": "^18.2.0"
|
||||||
},
|
},
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
"@formily/core": "2.x",
|
"@formily/core": "2.x",
|
||||||
"@formily/react": "2.x",
|
"@formily/react": "2.x",
|
||||||
"@formily/shared": "2.x",
|
"@formily/shared": "2.x",
|
||||||
"@koa/multer": "^3.0.2",
|
"@koa/multer": "^3.1.0",
|
||||||
"@types/node-xlsx": "^0.15.1",
|
"@types/node-xlsx": "^0.15.1",
|
||||||
"antd": "5.x",
|
"antd": "5.x",
|
||||||
"async-mutex": "^0.5.0",
|
"async-mutex": "^0.5.0",
|
||||||
|
@ -15,15 +15,15 @@
|
|||||||
"@formily/core": "2.x",
|
"@formily/core": "2.x",
|
||||||
"@formily/react": "2.x",
|
"@formily/react": "2.x",
|
||||||
"@formily/shared": "2.x",
|
"@formily/shared": "2.x",
|
||||||
"@koa/multer": "^3.0.0",
|
"@koa/multer": "^3.1.0",
|
||||||
"@types/koa-multer": "^1.0.1",
|
"@types/koa-multer": "^1.0.4",
|
||||||
"@types/multer": "^1.4.5",
|
"@types/multer": "^1.4.5",
|
||||||
"antd": "5.x",
|
"antd": "5.x",
|
||||||
"cos-nodejs-sdk-v5": "^2.11.14",
|
"cos-nodejs-sdk-v5": "^2.11.14",
|
||||||
"koa-static": "^5.0.0",
|
"koa-static": "^5.0.0",
|
||||||
"mime-match": "^1.0.2",
|
"mime-match": "^1.0.2",
|
||||||
"mkdirp": "~0.5.4",
|
"mkdirp": "~0.5.4",
|
||||||
"multer": "^1.4.2",
|
"multer": "^1.4.5-lts.2",
|
||||||
"multer-aliyun-oss": "2.1.3",
|
"multer-aliyun-oss": "2.1.3",
|
||||||
"multer-cos": "^1.0.3",
|
"multer-cos": "^1.0.3",
|
||||||
"multer-s3": "^3.0.1",
|
"multer-s3": "^3.0.1",
|
||||||
|
@ -10,8 +10,8 @@
|
|||||||
"homepage": "https://docs.nocobase.com/handbook/users",
|
"homepage": "https://docs.nocobase.com/handbook/users",
|
||||||
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/users",
|
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/users",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jsonwebtoken": "^8.5.8",
|
"@types/jsonwebtoken": "^9.0.9",
|
||||||
"jsonwebtoken": "^8.5.1"
|
"jsonwebtoken": "^9.0.2"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@nocobase/actions": "1.x",
|
"@nocobase/actions": "1.x",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user