mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 00:23:03 +00:00
build: update dependencies
This commit is contained in:
committed by
Rainer Killinger
parent
98f02b8830
commit
6ceb763b5a
@@ -14,12 +14,13 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {SCNotFoundErrorResponse, SCUnsupportedMediaTypeErrorResponse} from '@openstapps/core';
|
||||
import {SCValidator} from '@openstapps/core-validator';
|
||||
import {Validator} from '@openstapps/core-tools/lib/validate';
|
||||
import * as bodyParser from 'body-parser';
|
||||
import * as config from 'config';
|
||||
import * as cors from 'cors';
|
||||
import * as express from 'express';
|
||||
import * as morgan from 'morgan';
|
||||
import {join} from 'path';
|
||||
import {logger, mailer} from './common';
|
||||
import {MailQueue} from './notification/MailQueue';
|
||||
import {bulkAddRouter} from './routes/BulkAddRoute';
|
||||
@@ -58,8 +59,8 @@ const databases: {[name: string]: DatabaseConstructor} = {
|
||||
};
|
||||
|
||||
// validate config file
|
||||
export const scValidator = new SCValidator('./node_modules/@openstapps/core/lib/schema/');
|
||||
scValidator.feedValidator();
|
||||
export const scValidator = new Validator();
|
||||
scValidator.addSchemas(join('node_modules', '@openstapps', 'core', 'lib', 'schema'));
|
||||
|
||||
// validate the config file
|
||||
const configValidation = scValidator.validate(config.util.toObject(), 'ConfigFile');
|
||||
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
SCRoute,
|
||||
SCValidationErrorResponse,
|
||||
} from '@openstapps/core';
|
||||
import {SCValidator} from '@openstapps/core-validator';
|
||||
import {Validator} from '@openstapps/core-tools/lib/validate';
|
||||
import {Application, Router} from 'express';
|
||||
import PromiseRouter from 'express-promise-router';
|
||||
import {logger} from '../common';
|
||||
@@ -71,7 +71,7 @@ export function createRoute<RETURNTYPE>(
|
||||
|
||||
try {
|
||||
// get the core validator from the app
|
||||
const validator: SCValidator = req.app.get('validator');
|
||||
const validator: Validator = req.app.get('validator');
|
||||
|
||||
// validate request
|
||||
const requestValidation = validator.validate(req.body, routeClass.requestBodyName.substring(2));
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {SCBulkRequest, SCThingTypes} from '@openstapps/core';
|
||||
import {SCBulkRequest, SCThingType} from '@openstapps/core';
|
||||
import * as moment from 'moment';
|
||||
import * as NodeCache from 'node-cache';
|
||||
import {promisify} from 'util';
|
||||
@@ -59,7 +59,7 @@ export class Bulk implements SCBulkRequest {
|
||||
/**
|
||||
* Type of data in the bulk
|
||||
*/
|
||||
type: SCThingTypes;
|
||||
type: SCThingType;
|
||||
|
||||
/**
|
||||
* Unique identifier of the bulk
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
SCSearchQuery,
|
||||
SCSearchResponse,
|
||||
SCThings,
|
||||
SCThingTypes,
|
||||
SCThingType,
|
||||
SCUuid,
|
||||
} from '@openstapps/core';
|
||||
import * as ES from 'elasticsearch';
|
||||
@@ -144,7 +144,7 @@ export class Elasticsearch implements Database {
|
||||
let aliases: {
|
||||
[index: string]: {
|
||||
aliases: {
|
||||
[K in SCThingTypes]: any
|
||||
[K in SCThingType]: any
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -214,7 +214,7 @@ export class Elasticsearch implements Database {
|
||||
* @param source source of data in the index
|
||||
* @param bulk bulk process which created this index
|
||||
*/
|
||||
private getIndex(type: SCThingTypes, source: string, bulk: SCBulkResponse) {
|
||||
private getIndex(type: SCThingType, source: string, bulk: SCBulkResponse) {
|
||||
return `stapps_${type.toLowerCase().replace(' ', '_')}_${source}_${bulk.uid.substring(0, 8)}`;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,10 +13,10 @@
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {SCBackendAggregationConfiguration, SCFacet, SCThingTypes} from '@openstapps/core';
|
||||
import {SCBackendAggregationConfiguration, SCFacet, SCThingType} from '@openstapps/core';
|
||||
import {AggregationSchema} from './common';
|
||||
|
||||
export type aggregationType = SCThingTypes | '@all';
|
||||
export type aggregationType = SCThingType | '@all';
|
||||
|
||||
/**
|
||||
* Builds the aggregation
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {SCThingTypes} from '@openstapps/core';
|
||||
import {SCThingType} from '@openstapps/core';
|
||||
import {SCThing} from '@openstapps/core';
|
||||
|
||||
/**
|
||||
@@ -111,7 +111,7 @@ export interface ESTermsFilter {
|
||||
*/
|
||||
export interface ESTypeFilter {
|
||||
type: {
|
||||
value: SCThingTypes;
|
||||
value: SCThingType;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import {
|
||||
SCSearchSort,
|
||||
SCSportCoursePriceGroup,
|
||||
SCThingsField,
|
||||
SCThingTypes,
|
||||
SCThingType,
|
||||
} from '@openstapps/core';
|
||||
import {ElasticsearchConfig, ScriptSort} from './common';
|
||||
import {
|
||||
@@ -221,7 +221,7 @@ export function buildQuery(
|
||||
if (typeof params.sort !== 'undefined') {
|
||||
params.sort.forEach((sort) => {
|
||||
// types that the sort is supported on
|
||||
const types: SCThingTypes[] = [];
|
||||
const types: SCThingType[] = [];
|
||||
|
||||
defaultConfig.backend.sortableFields
|
||||
.filter((sortableField) => {
|
||||
|
||||
Reference in New Issue
Block a user