71 lines
1.8 KiB
JavaScript
Raw Normal View History

2016-03-18 11:12:50 +01:00
'use strict';
/**
* Export shared utilities
*/
const { buildQuery, hasDeepFilters } = require('./build-query');
const {
convertRestQueryParams,
VALID_REST_OPERATORS,
QUERY_OPERATORS,
} = require('./convert-rest-query-params');
const parseMultipartData = require('./parse-multipart');
Hide creator fields from public api by default (#8052) * Add model option to hide/show creators fields in public API response Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu> * Add content-types util, rework sanitize-entity's private handling Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu> * Update search e2e tests, fix an issue on empty search for the core-api controller (find) Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu> * Fix GraphQL plugin (handle privates attributes on typeDefs + resolver builds) Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu> * Fix sanitizeEntity import Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu> * Move doc update from beta to stable Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu> * Fix e2e test Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu> * Fix pr comments Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu> * Remove creator's field from upload controller routes Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu> * Fix typedef build for graphql association Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu> * Fix pr (comments + several issues) Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu> * Add tests for search behavior in content-manager Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu> * Rename files variables to meaningful names (upload controllers) Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu> * Fix test with search id matching serialNumber Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com> * Add toHasBeenCalledWith check for config.get (utils/content-types.test.js) Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-10-01 17:47:08 +02:00
const sanitizeEntity = require('./sanitize-entity');
2019-12-04 12:17:45 +01:00
const parseType = require('./parse-type');
2019-12-24 14:49:44 +01:00
const finder = require('./finder');
const logger = require('./logger');
const models = require('./models');
const policy = require('./policy');
const templateConfiguration = require('./template-configuration');
2019-12-24 14:49:44 +01:00
const { yup, formatYupErrors } = require('./validators');
const {
nameToSlug,
nameToCollectionName,
getCommonBeginning,
escapeQuery,
stringIncludes,
stringEquals,
} = require('./string-formatting');
const { removeUndefined } = require('./object-formatting');
const { getConfigUrls, getAbsoluteAdminUrl, getAbsoluteServerUrl } = require('./config');
const { generateTimestampCode } = require('./code-generator');
const contentTypes = require('./content-types');
const webhook = require('./webhook');
const env = require('./env-helper');
2020-12-16 15:28:11 +01:00
const relations = require('./relations');
const setCreatorFields = require('./set-creator-fields');
2019-03-13 19:27:18 +01:00
2016-03-18 11:12:50 +01:00
module.exports = {
2019-12-24 14:49:44 +01:00
yup,
formatYupErrors,
finder,
logger,
models,
policy,
templateConfiguration,
2019-03-13 19:27:18 +01:00
convertRestQueryParams,
VALID_REST_OPERATORS,
QUERY_OPERATORS,
2019-03-13 19:27:18 +01:00
buildQuery,
hasDeepFilters,
parseMultipartData,
sanitizeEntity,
2019-12-04 12:17:45 +01:00
parseType,
nameToSlug,
nameToCollectionName,
getCommonBeginning,
getConfigUrls,
escapeQuery,
removeUndefined,
getAbsoluteAdminUrl,
getAbsoluteServerUrl,
generateTimestampCode,
stringIncludes,
stringEquals,
contentTypes,
webhook,
env,
2020-12-16 15:28:11 +01:00
relations,
setCreatorFields,
2016-03-18 11:12:50 +01:00
};