@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ditojs/server",
3
- "version": "1.5.5",
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.5.5",
25
- "@ditojs/build": "^1.5.5",
26
- "@ditojs/router": "^1.5.5",
27
- "@ditojs/utils": "^1.5.5",
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.1131.0",
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.8",
70
- "vite-plugin-vue2": "^2.0.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": "157b519f3f3552fb25b67adf7e0fd402485ac4c9"
82
+ "gitHead": "20bdea5596f70da591987707df7aa5336ecb6aa3"
83
83
  }
@@ -1,5 +1,5 @@
1
1
  import objection from 'objection'
2
- import Ajv from 'ajv'
2
+ import Ajv from 'ajv/dist/2020.js'
3
3
  import addFormats from 'ajv-formats'
4
4
  import { isArray, isObject, clone, isAsync, isPromise } from '@ditojs/utils'
5
5
  import { formatJson } from '../utils/index.js'
@@ -1,7 +1,7 @@
1
1
  import pico from 'picocolors'
2
2
 
3
- export async function migrate(knex, config) {
4
- const [batch, log] = await knex.migrate.latest(config)
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`) +
@@ -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, config) {
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(config)
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)
@@ -1,7 +1,7 @@
1
1
  import pico from 'picocolors'
2
2
 
3
- export async function rollback(knex, config) {
4
- const [batch, log] = await knex.migrate.rollback(config)
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`) +
@@ -1,7 +1,7 @@
1
1
  import pico from 'picocolors'
2
2
 
3
- export async function unlock(knex, config) {
4
- await knex.migrate.forceFreeMigrationsLock(config)
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)
@@ -366,7 +366,6 @@ export class Model extends objection.Model {
366
366
  merge(schema, this.definition.schema)
367
367
  return {
368
368
  $id: this.name,
369
- $schema: 'http://json-schema.org/draft-07/schema',
370
369
  ...schema
371
370
  }
372
371
  }, {})
@@ -2,11 +2,12 @@ export const range = {
2
2
  type: ['number', 'integer'],
3
3
  metaSchema: {
4
4
  type: 'array',
5
- items: [
5
+ prefixItems: [
6
6
  { type: 'number' },
7
7
  { type: 'number' }
8
8
  ],
9
- additionalItems: false
9
+ minItems: 2,
10
+ items: false
10
11
  },
11
12
  macro(config) {
12
13
  return {
@@ -1,4 +1,4 @@
1
- import Ajv from 'ajv'
1
+ import Ajv from 'ajv/dist/2020.js'
2
2
  import { isNumber, isArray } from '@ditojs/utils'
3
3
 
4
4
  export const validate = {