@ditojs/server 1.5.5 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +9 -9
- package/src/app/Validator.js +1 -1
- package/src/cli/db/migrate.js +2 -2
- package/src/cli/db/reset.js +2 -2
- package/src/cli/db/rollback.js +2 -2
- package/src/cli/db/unlock.js +2 -2
- package/src/cli/index.js +0 -3
- package/src/models/Model.js +0 -1
- package/src/schema/keywords/_range.js +3 -2
- package/src/schema/keywords/_validate.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ditojs/server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Dito.js Server – Dito.js is a declarative and modern web framework, based on Objection.js, Koa.js and Vue.js",
|
|
6
6
|
"repository": "https://github.com/ditojs/dito/tree/master/packages/server",
|
|
@@ -21,16 +21,16 @@
|
|
|
21
21
|
"node >= 16"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@ditojs/admin": "^1.
|
|
25
|
-
"@ditojs/build": "^1.
|
|
26
|
-
"@ditojs/router": "^1.
|
|
27
|
-
"@ditojs/utils": "^1.
|
|
24
|
+
"@ditojs/admin": "^1.7.0",
|
|
25
|
+
"@ditojs/build": "^1.7.0",
|
|
26
|
+
"@ditojs/router": "^1.6.0",
|
|
27
|
+
"@ditojs/utils": "^1.6.0",
|
|
28
28
|
"@koa/cors": "^3.3.0",
|
|
29
29
|
"@koa/multer": "^3.0.0",
|
|
30
30
|
"@originjs/vite-plugin-commonjs": "^1.0.3",
|
|
31
31
|
"ajv": "^8.11.0",
|
|
32
32
|
"ajv-formats": "^2.1.1",
|
|
33
|
-
"aws-sdk": "^2.
|
|
33
|
+
"aws-sdk": "^2.1141.0",
|
|
34
34
|
"axios": "^0.27.2",
|
|
35
35
|
"bcryptjs": "^2.4.3",
|
|
36
36
|
"bytes": "^3.1.2",
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"pluralize": "^8.0.0",
|
|
67
67
|
"repl": "^0.1.3",
|
|
68
68
|
"uuid": "^8.3.2",
|
|
69
|
-
"vite": "^2.9.
|
|
70
|
-
"vite-plugin-vue2": "^2.0.
|
|
69
|
+
"vite": "^2.9.9",
|
|
70
|
+
"vite-plugin-vue2": "^2.0.1",
|
|
71
71
|
"vue": "^2.6.14",
|
|
72
72
|
"vue-template-compiler": "^2.6.14"
|
|
73
73
|
},
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"knex": "^2.0.0",
|
|
80
80
|
"objection": "^3.0.1"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "20bdea5596f70da591987707df7aa5336ecb6aa3"
|
|
83
83
|
}
|
package/src/app/Validator.js
CHANGED
package/src/cli/db/migrate.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import pico from 'picocolors'
|
|
2
2
|
|
|
3
|
-
export async function migrate(knex
|
|
4
|
-
const [batch, log] = await knex.migrate.latest(
|
|
3
|
+
export async function migrate(knex) {
|
|
4
|
+
const [batch, log] = await knex.migrate.latest()
|
|
5
5
|
console.info(log.length === 0
|
|
6
6
|
? pico.cyan('Already up to date')
|
|
7
7
|
: pico.green(`Batch ${batch} run: ${log.length} migrations\n`) +
|
package/src/cli/db/reset.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import pico from 'picocolors'
|
|
2
2
|
import { migrate } from './migrate.js'
|
|
3
3
|
|
|
4
|
-
export async function reset(knex
|
|
4
|
+
export async function reset(knex) {
|
|
5
5
|
const batches = []
|
|
6
6
|
const migrations = []
|
|
7
7
|
while (true) {
|
|
8
|
-
const [batch, log] = await knex.migrate.rollback(
|
|
8
|
+
const [batch, log] = await knex.migrate.rollback()
|
|
9
9
|
if (log.length === 0) break
|
|
10
10
|
batches.push(batch)
|
|
11
11
|
migrations.push(...log)
|
package/src/cli/db/rollback.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import pico from 'picocolors'
|
|
2
2
|
|
|
3
|
-
export async function rollback(knex
|
|
4
|
-
const [batch, log] = await knex.migrate.rollback(
|
|
3
|
+
export async function rollback(knex) {
|
|
4
|
+
const [batch, log] = await knex.migrate.rollback()
|
|
5
5
|
console.info(log.length === 0
|
|
6
6
|
? pico.cyan('Already at the base migration')
|
|
7
7
|
: pico.green(`Batch ${batch} rolled back: ${log.length} migrations\n`) +
|
package/src/cli/db/unlock.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import pico from 'picocolors'
|
|
2
2
|
|
|
3
|
-
export async function unlock(knex
|
|
4
|
-
await knex.migrate.forceFreeMigrationsLock(
|
|
3
|
+
export async function unlock(knex) {
|
|
4
|
+
await knex.migrate.forceFreeMigrationsLock()
|
|
5
5
|
console.info(
|
|
6
6
|
pico.green(`Successfully unlocked the migrations lock table`)
|
|
7
7
|
)
|
package/src/cli/index.js
CHANGED
|
@@ -45,9 +45,6 @@ async function execute() {
|
|
|
45
45
|
// A config object with a knex field was passed in, create a knex object
|
|
46
46
|
// from it to pass on to the execute function.
|
|
47
47
|
arg = Knex(arg.knex)
|
|
48
|
-
// Also add `knex.migrations` config as the first argument to `execute()`,
|
|
49
|
-
// so db:migrate & co. can receive migration configuration settings.
|
|
50
|
-
args.unshift(arg.knex.migrations || null)
|
|
51
48
|
}
|
|
52
49
|
const res = await execute(arg, ...args)
|
|
53
50
|
process.exit(res === true ? 0 : 1)
|
package/src/models/Model.js
CHANGED
|
@@ -2,11 +2,12 @@ export const range = {
|
|
|
2
2
|
type: ['number', 'integer'],
|
|
3
3
|
metaSchema: {
|
|
4
4
|
type: 'array',
|
|
5
|
-
|
|
5
|
+
prefixItems: [
|
|
6
6
|
{ type: 'number' },
|
|
7
7
|
{ type: 'number' }
|
|
8
8
|
],
|
|
9
|
-
|
|
9
|
+
minItems: 2,
|
|
10
|
+
items: false
|
|
10
11
|
},
|
|
11
12
|
macro(config) {
|
|
12
13
|
return {
|