Upgrade API & Schema dependencies (#13845)

Fixes #13837
This commit is contained in:
Rijk van Zanten
2022-06-10 15:59:52 -04:00
committed by GitHub
parent cb93edcccd
commit 6955c538a3
9 changed files with 4506 additions and 3804 deletions

View File

@@ -76,7 +76,7 @@
"README.md"
],
"dependencies": {
"@aws-sdk/client-ses": "^3.40.0",
"@aws-sdk/client-ses": "^3.107.0",
"@directus/app": "9.12.2",
"@directus/drive": "9.12.2",
"@directus/drive-azure": "9.12.2",
@@ -87,76 +87,76 @@
"@directus/schema": "9.12.2",
"@directus/shared": "9.12.2",
"@directus/specs": "9.12.2",
"@godaddy/terminus": "^4.9.0",
"@godaddy/terminus": "^4.10.2",
"@rollup/plugin-alias": "^3.1.9",
"@rollup/plugin-virtual": "^2.0.3",
"argon2": "^0.28.2",
"async": "^3.2.0",
"async-mutex": "^0.3.1",
"axios": "^0.24.0",
"@rollup/plugin-virtual": "^2.1.0",
"argon2": "^0.28.5",
"async": "^3.2.4",
"async-mutex": "^0.3.2",
"axios": "^0.27.2",
"busboy": "^0.3.1",
"camelcase": "^6.2.0",
"chalk": "^4.1.1",
"chokidar": "^3.5.2",
"chokidar": "^3.5.3",
"commander": "^8.0.0",
"cookie-parser": "^1.4.5",
"cookie-parser": "^1.4.6",
"cors": "^2.8.5",
"csv-parser": "^3.0.0",
"date-fns": "^2.22.1",
"date-fns": "^2.28.0",
"deep-diff": "^1.0.2",
"deep-map": "^2.0.0",
"destroy": "^1.0.4",
"destroy": "^1.2.0",
"dotenv": "^10.0.0",
"eventemitter2": "^6.4.3",
"eventemitter2": "^6.4.5",
"execa": "^5.1.1",
"exifr": "^7.1.2",
"express": "^4.17.1",
"exifr": "^7.1.3",
"express": "^4.18.1",
"fast-redact": "^3.1.1",
"flat": "^5.0.2",
"fs-extra": "^10.0.0",
"fs-extra": "^10.1.0",
"globby": "^11.0.4",
"graphql": "^15.5.0",
"graphql-compose": "^9.0.1",
"graphql-compose": "^9.0.8",
"helmet": "^4.6.0",
"inquirer": "^8.1.1",
"inquirer": "^8.2.4",
"ioredis": "^4.27.6",
"joi": "^17.3.0",
"joi": "^17.6.0",
"js-yaml": "^4.1.0",
"js2xmlparser": "^4.0.1",
"json2csv": "^5.0.3",
"js2xmlparser": "^4.0.2",
"json2csv": "^5.0.7",
"jsonwebtoken": "^8.5.1",
"keyv": "^4.0.3",
"knex": "^2.0.0",
"knex-schema-inspector": "1.7.3",
"ldapjs": "^2.3.1",
"liquidjs": "^9.25.0",
"keyv": "^4.3.0",
"knex": "^2.1.0",
"knex-schema-inspector": "^2.0.0",
"ldapjs": "^2.3.3",
"liquidjs": "^9.37.0",
"lodash": "^4.17.21",
"macos-release": "^2.4.1",
"marked": "^4.0.3",
"marked": "^4.0.16",
"micromustache": "^8.0.3",
"mime-types": "^2.1.31",
"mime-types": "^2.1.35",
"ms": "^2.1.3",
"nanoid": "^3.1.23",
"node-cron": "^3.0.0",
"node-cron": "^3.0.1",
"node-machine-id": "^1.1.12",
"nodemailer": "^6.6.1",
"nodemailer": "^6.7.5",
"object-hash": "^2.2.0",
"openapi3-ts": "^2.0.0",
"openid-client": "^5.0.0",
"openapi3-ts": "^2.0.2",
"openid-client": "^5.1.6",
"ora": "^5.4.0",
"otplib": "^12.0.1",
"pino": "6.13.3",
"pino-colada": "^2.1.0",
"pino-colada": "^2.2.2",
"pino-http": "5.8.0",
"qs": "^6.9.4",
"rate-limiter-flexible": "^2.2.2",
"qs": "^6.10.5",
"rate-limiter-flexible": "^2.3.7",
"resolve-cwd": "^3.0.0",
"rollup": "^2.67.3",
"sanitize-html": "^2.6.0",
"sharp": "^0.30.3",
"stream-json": "^1.7.1",
"rollup": "^2.75.6",
"sanitize-html": "^2.7.0",
"sharp": "^0.30.6",
"stream-json": "^1.7.4",
"strip-bom-stream": "^4.0.0",
"supertest": "^6.1.6",
"supertest": "^6.2.3",
"tmp-promise": "^3.0.3",
"update-check": "^1.5.4",
"uuid": "^8.3.2",
@@ -164,21 +164,21 @@
"wellknown": "^0.5.0"
},
"optionalDependencies": {
"@keyv/redis": "^2.1.2",
"@keyv/redis": "^2.3.6",
"keyv-memcache": "^1.2.5",
"memcached": "^2.2.2",
"mysql": "^2.18.1",
"nodemailer-mailgun-transport": "^2.1.3",
"pg": "^8.6.0",
"sqlite3": "^5.0.6",
"nodemailer-mailgun-transport": "^2.1.4",
"pg": "^8.7.3",
"sqlite3": "^5.0.8",
"tedious": "^13.0.0"
},
"gitHead": "24621f3934dc77eb23441331040ed13c676ceffd",
"devDependencies": {
"@types/async": "3.2.10",
"@types/async": "3.2.13",
"@types/body-parser": "1.19.2",
"@types/busboy": "0.3.1",
"@types/cookie-parser": "1.4.2",
"@types/cookie-parser": "1.4.3",
"@types/cors": "2.8.12",
"@types/deep-diff": "1.0.1",
"@types/destroy": "1.0.0",
@@ -188,16 +188,16 @@
"@types/fast-redact": "^3.0.1",
"@types/flat": "5.0.2",
"@types/fs-extra": "9.0.13",
"@types/inquirer": "8.1.3",
"@types/inquirer": "8.2.1",
"@types/ioredis": "^4.28.10",
"@types/jest": "27.4.1",
"@types/js-yaml": "4.0.5",
"@types/json2csv": "5.0.3",
"@types/jsonwebtoken": "8.5.6",
"@types/keyv": "3.1.3",
"@types/jsonwebtoken": "8.5.8",
"@types/keyv": "3.1.4",
"@types/ldapjs": "2.2.2",
"@types/lodash": "4.14.177",
"@types/marked": "4.0.1",
"@types/lodash": "4.14.182",
"@types/marked": "4.0.3",
"@types/mime-types": "2.1.1",
"@types/ms": "0.7.31",
"@types/node": "16.11.9",
@@ -205,22 +205,22 @@
"@types/nodemailer": "6.4.4",
"@types/object-hash": "2.2.1",
"@types/pino": "6.3.12",
"@types/pino-http": "5.8.0",
"@types/pino-http": "5.8.1",
"@types/qs": "6.9.7",
"@types/sanitize-html": "2.5.0",
"@types/sharp": "0.29.4",
"@types/stream-json": "1.7.1",
"@types/supertest": "2.0.11",
"@types/uuid": "8.3.3",
"@types/sanitize-html": "2.6.2",
"@types/sharp": "0.30.4",
"@types/stream-json": "1.7.2",
"@types/supertest": "2.0.12",
"@types/uuid": "8.3.4",
"@types/uuid-validate": "0.0.1",
"@types/wellknown": "0.5.1",
"@types/wellknown": "0.5.3",
"copyfiles": "2.4.1",
"cross-env": "7.0.3",
"form-data": "^4.0.0",
"jest": "27.5.1",
"knex-mock-client": "1.7.0",
"knex-mock-client": "1.8.4",
"ts-jest": "27.1.3",
"ts-node-dev": "1.1.8",
"typescript": "4.5.2"
"typescript": "4.7.3"
}
}

View File

@@ -211,7 +211,6 @@ export class FieldsService {
try {
column = await this.schemaInspector.columnInfo(collection, field);
column.default_value = getDefaultValue(column);
} catch {
// Do nothing
}
@@ -220,12 +219,19 @@ export class FieldsService {
const type = getLocalType(column, fieldInfo);
const columnWithCastDefaultValue = column
? {
...column,
default_value: getDefaultValue(column),
}
: null;
const data = {
collection,
field,
type,
meta: fieldInfo || null,
schema: type === 'alias' ? null : column,
schema: type === 'alias' ? null : columnWithCastDefaultValue,
};
return data;

View File

@@ -105,7 +105,12 @@ const localTypeMap: Record<string, Type | 'unknown'> = {
};
export default function getLocalType(
column?: SchemaOverview[string]['columns'][string] | Column,
column?: {
data_type: string;
numeric_precision?: null | number;
numeric_scale?: null | number;
max_length?: null | number;
},
field?: { special?: FieldMeta['special'] }
): Type | 'unknown' {
if (!column) return 'alias';

8165
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -42,7 +42,7 @@
"eslint-plugin-vue": "9.1.0",
"globby": "11.0.4",
"jest": "27.5.1",
"knex": "2.0.0",
"knex": "2.1.0",
"lerna": "4.0.0",
"lint-staged": "11.2.6",
"listr": "0.14.3",

View File

@@ -47,7 +47,7 @@
"typescript": "4.5.2"
},
"dependencies": {
"knex-schema-inspector": "1.7.3",
"knex-schema-inspector": "^2.0.0",
"lodash": "^4.17.21"
},
"gitHead": "24621f3934dc77eb23441331040ed13c676ceffd"

View File

@@ -8,7 +8,7 @@ export default class CockroachDB extends KnexCockroachDB implements SchemaInspec
type RawColumn = {
table_name: string;
column_name: string;
default_value: string;
default_value: string | null;
data_type: string;
max_length: number | null;
is_identity: boolean;

View File

@@ -8,7 +8,7 @@ export default class Postgres extends KnexPostgres implements SchemaInspector {
type RawColumn = {
table_name: string;
column_name: string;
default_value: string;
default_value: string | null;
data_type: string;
max_length: number | null;
is_identity: boolean;

View File

@@ -5,7 +5,7 @@ export type SchemaOverview = {
[column: string]: {
table_name: string;
column_name: string;
default_value: any;
default_value: string | null;
is_nullable: boolean;
is_generated: boolean;
data_type: string;