Fix build

This commit is contained in:
rijkvanzanten
2021-08-06 16:46:01 -04:00
parent f95ac276fb
commit 21e221fa84
9 changed files with 10 additions and 9 deletions

View File

@@ -43,5 +43,3 @@ export const FILTER_VARIABLES = ['$NOW', '$CURRENT_USER', '$CURRENT_ROLE'];
export const ALIAS_TYPES = ['alias', 'o2m', 'm2m', 'm2a', 'files', 'files', 'translations'];
export const COLUMN_TRANSFORMS = ['year', 'month', 'day', 'weekday', 'hour', 'minute', 'second'];
export const REGEX_BETWEEN_PARENS = /\(([^)]+)\)/;

View File

@@ -20,7 +20,7 @@ import { getSchema } from './utils/get-schema';
import * as services from './services';
import { schedule, validate } from 'node-cron';
import { REGEX_BETWEEN_PARENS } from './constants';
import { REGEX_BETWEEN_PARENS } from '@directus/shared/constants';
import { rollup } from 'rollup';
// @TODO Remove this once a new version of @rollup/plugin-virtual has been released
// @ts-expect-error

View File

@@ -1,4 +1,4 @@
import { REGEX_BETWEEN_PARENS } from '../constants';
import { REGEX_BETWEEN_PARENS } from '@directus/shared/constants';
/**
* Takes in a column name, and transforms the original name with the generated column name based on

View File

@@ -25,7 +25,7 @@ export default function applyQuery(
dbQuery.orderBy(
query.sort.map((sort) => ({
...sort,
column: getColumn(knex, collection, sort.column, false) as any,
column: getColumn(knex, collection, sort.column) as any,
}))
);
}
@@ -304,7 +304,8 @@ export function applyFilter(
const [table, column] = key.split('.');
// Is processed through Knex.Raw, so should be safe to string-inject into these where queries
const selectionRaw = getColumn(knex, table, column, false) as any;
const selectionRaw = getColumn(knex, table, column) as any;
// Knex supports "raw" in the columnName parameter, but isn't typed as such. Too bad..
// See https://github.com/knex/knex/issues/4518 @TODO remove as any once knex is updated

View File

@@ -1,6 +1,6 @@
import { Knex } from 'knex';
import { FunctionsHelper } from '../database/functions';
import { REGEX_BETWEEN_PARENS } from '../constants';
import { REGEX_BETWEEN_PARENS } from '@directus/shared/constants';
import { applyFunctionToColumnName } from './apply-function-to-column-name';
/**

View File

@@ -1,4 +1,4 @@
import { REGEX_BETWEEN_PARENS } from '../constants';
import { REGEX_BETWEEN_PARENS } from '@directus/shared/constants';
/**
* Strip the function declarations from a list of fields

2
package-lock.json generated
View File

@@ -59830,7 +59830,7 @@
"mime": "2.5.2",
"mitt": "3.0.0",
"nanoid": "3.1.23",
"p-queue": "*",
"p-queue": "^6.6.2",
"pinia": "2.0.0-beta.5",
"prettier": "2.3.2",
"pretty-ms": "7.0.1",

View File

@@ -1,3 +1,4 @@
export * from './extensions';
export * from './fields';
export * from './regex';
export * from './symbols';

View File

@@ -0,0 +1 @@
export const REGEX_BETWEEN_PARENS = /\(([^)]+)\)/;