2016-03-18 11:12:50 +01:00
|
|
|
/**
|
|
|
|
* Export shared utilities
|
|
|
|
*/
|
2023-06-06 10:58:36 +02:00
|
|
|
import parseMultipartData from './parse-multipart';
|
|
|
|
import parseType from './parse-type';
|
|
|
|
import * as policy from './policy';
|
|
|
|
import templateConfiguration from './template-configuration';
|
|
|
|
import { yup, handleYupError, validateYupSchema, validateYupSchemaSync } from './validators';
|
|
|
|
import * as errors from './errors';
|
|
|
|
import {
|
2020-05-08 13:50:00 +02:00
|
|
|
nameToSlug,
|
|
|
|
nameToCollectionName,
|
|
|
|
getCommonBeginning,
|
|
|
|
escapeQuery,
|
2020-06-23 16:31:16 +02:00
|
|
|
stringIncludes,
|
|
|
|
stringEquals,
|
2021-08-20 15:23:02 +02:00
|
|
|
isKebabCase,
|
|
|
|
isCamelCase,
|
2022-02-21 18:04:36 +01:00
|
|
|
toRegressedEnumValue,
|
|
|
|
startsWithANumber,
|
2022-03-15 11:51:43 +01:00
|
|
|
joinBy,
|
2022-03-28 11:17:49 +02:00
|
|
|
toKebabCase,
|
2023-06-06 10:58:36 +02:00
|
|
|
} from './string-formatting';
|
|
|
|
import { removeUndefined, keysDeep } from './object-formatting';
|
|
|
|
import { getConfigUrls, getAbsoluteAdminUrl, getAbsoluteServerUrl } from './config';
|
|
|
|
import { generateTimestampCode } from './code-generator';
|
|
|
|
import * as contentTypes from './content-types';
|
|
|
|
import env from './env-helper';
|
|
|
|
import * as relations from './relations';
|
|
|
|
import setCreatorFields from './set-creator-fields';
|
|
|
|
import * as hooks from './hooks';
|
|
|
|
import providerFactory from './provider-factory';
|
|
|
|
import * as pagination from './pagination';
|
|
|
|
import sanitize from './sanitize';
|
|
|
|
import traverseEntity from './traverse-entity';
|
|
|
|
import { pipeAsync, mapAsync, reduceAsync, forEachAsync } from './async';
|
|
|
|
import convertQueryParams from './convert-query-params';
|
|
|
|
import importDefault from './import-default';
|
|
|
|
import * as template from './template';
|
|
|
|
import * as file from './file';
|
|
|
|
import * as traverse from './traverse';
|
2019-03-13 19:27:18 +01:00
|
|
|
|
2023-06-06 10:58:36 +02:00
|
|
|
export {
|
2019-12-24 14:49:44 +01:00
|
|
|
yup,
|
2021-10-27 18:54:58 +02:00
|
|
|
handleYupError,
|
2019-12-24 14:49:44 +01:00
|
|
|
policy,
|
|
|
|
templateConfiguration,
|
2019-08-21 12:10:23 +02:00
|
|
|
parseMultipartData,
|
2021-11-04 15:47:53 +01:00
|
|
|
sanitize,
|
|
|
|
traverseEntity,
|
2019-12-04 12:17:45 +01:00
|
|
|
parseType,
|
2020-03-20 19:00:48 +01:00
|
|
|
nameToSlug,
|
2022-02-21 18:04:36 +01:00
|
|
|
toRegressedEnumValue,
|
|
|
|
startsWithANumber,
|
2022-03-15 11:51:43 +01:00
|
|
|
joinBy,
|
2020-03-20 19:00:48 +01:00
|
|
|
nameToCollectionName,
|
2020-05-08 13:50:00 +02:00
|
|
|
getCommonBeginning,
|
|
|
|
getConfigUrls,
|
2020-04-24 12:06:35 +02:00
|
|
|
escapeQuery,
|
2020-05-15 17:15:24 +02:00
|
|
|
removeUndefined,
|
2022-12-30 19:46:33 +01:00
|
|
|
keysDeep,
|
2020-05-28 11:17:59 +02:00
|
|
|
getAbsoluteAdminUrl,
|
|
|
|
getAbsoluteServerUrl,
|
2020-06-23 16:31:16 +02:00
|
|
|
generateTimestampCode,
|
|
|
|
stringIncludes,
|
|
|
|
stringEquals,
|
2022-12-30 18:57:27 +01:00
|
|
|
template,
|
2021-08-20 15:23:02 +02:00
|
|
|
isKebabCase,
|
|
|
|
isCamelCase,
|
2022-03-28 11:17:49 +02:00
|
|
|
toKebabCase,
|
2020-08-18 17:09:21 +02:00
|
|
|
contentTypes,
|
2020-11-06 15:19:18 +01:00
|
|
|
env,
|
2020-12-16 15:28:11 +01:00
|
|
|
relations,
|
2021-01-27 12:35:24 +01:00
|
|
|
setCreatorFields,
|
2021-03-25 14:59:44 +01:00
|
|
|
hooks,
|
|
|
|
providerFactory,
|
2021-07-30 11:44:26 +02:00
|
|
|
pagination,
|
2021-11-04 16:43:27 +01:00
|
|
|
pipeAsync,
|
2023-01-17 15:10:19 +01:00
|
|
|
mapAsync,
|
2023-01-31 15:14:26 +01:00
|
|
|
reduceAsync,
|
2023-02-06 15:59:47 +01:00
|
|
|
forEachAsync,
|
2021-10-20 17:30:05 +02:00
|
|
|
errors,
|
2021-11-03 19:31:57 +01:00
|
|
|
validateYupSchema,
|
|
|
|
validateYupSchemaSync,
|
2022-08-30 15:11:38 +02:00
|
|
|
convertQueryParams,
|
2022-10-17 14:51:19 +02:00
|
|
|
importDefault,
|
2023-02-08 15:57:14 +01:00
|
|
|
file,
|
2023-02-09 11:35:50 +01:00
|
|
|
traverse,
|
2016-03-18 11:12:50 +01:00
|
|
|
};
|
2023-06-06 10:58:36 +02:00
|
|
|
|
|
|
|
const utils = {
|
|
|
|
yup,
|
|
|
|
handleYupError,
|
|
|
|
policy,
|
|
|
|
templateConfiguration,
|
|
|
|
parseMultipartData,
|
|
|
|
sanitize,
|
|
|
|
traverseEntity,
|
|
|
|
parseType,
|
|
|
|
nameToSlug,
|
|
|
|
toRegressedEnumValue,
|
|
|
|
startsWithANumber,
|
|
|
|
joinBy,
|
|
|
|
nameToCollectionName,
|
|
|
|
getCommonBeginning,
|
|
|
|
getConfigUrls,
|
|
|
|
escapeQuery,
|
|
|
|
removeUndefined,
|
|
|
|
keysDeep,
|
|
|
|
getAbsoluteAdminUrl,
|
|
|
|
getAbsoluteServerUrl,
|
|
|
|
generateTimestampCode,
|
|
|
|
stringIncludes,
|
|
|
|
stringEquals,
|
|
|
|
template,
|
|
|
|
isKebabCase,
|
|
|
|
isCamelCase,
|
|
|
|
toKebabCase,
|
|
|
|
contentTypes,
|
|
|
|
env,
|
|
|
|
relations,
|
|
|
|
setCreatorFields,
|
|
|
|
hooks,
|
|
|
|
providerFactory,
|
|
|
|
pagination,
|
|
|
|
pipeAsync,
|
|
|
|
mapAsync,
|
|
|
|
reduceAsync,
|
|
|
|
forEachAsync,
|
|
|
|
errors,
|
|
|
|
validateYupSchema,
|
|
|
|
validateYupSchemaSync,
|
|
|
|
convertQueryParams,
|
|
|
|
importDefault,
|
|
|
|
file,
|
|
|
|
traverse,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default utils;
|