Jean-Sébastien Herbaux e55ea1d6b5
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

58 lines
1.5 KiB
JavaScript

'use strict';
/**
* Export shared utilities
*/
const { buildQuery, hasDeepFilters } = require('./build-query');
const { convertRestQueryParams, VALID_REST_OPERATORS } = require('./convert-rest-query-params');
const parseMultipartData = require('./parse-multipart');
const sanitizeEntity = require('./sanitize-entity');
const parseType = require('./parse-type');
const finder = require('./finder');
const logger = require('./logger');
const models = require('./models');
const policy = require('./policy');
const templateConfiguration = require('./template-configuration');
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');
module.exports = {
yup,
formatYupErrors,
finder,
logger,
models,
policy,
templateConfiguration,
convertRestQueryParams,
VALID_REST_OPERATORS,
buildQuery,
hasDeepFilters,
parseMultipartData,
sanitizeEntity,
parseType,
nameToSlug,
nameToCollectionName,
getCommonBeginning,
getConfigUrls,
escapeQuery,
removeUndefined,
getAbsoluteAdminUrl,
getAbsoluteServerUrl,
generateTimestampCode,
stringIncludes,
stringEquals,
contentTypes,
};