Files

74 lines
2.1 KiB
TypeScript

import { existsSync, readdirSync } from 'fs';
import { join } from 'path';
export const { CUSTOM_TRANSFER_TOKEN_ACCESS_KEY } = require('../app-template/src/constants');
const APP_TEMPLATE_API_DIR = join(__dirname, '../app-template/src/api');
const getAppTemplateContentTypes = () => {
if (!existsSync(APP_TEMPLATE_API_DIR)) {
return [];
}
return readdirSync(APP_TEMPLATE_API_DIR, { withFileTypes: true })
.filter((api) => api.isDirectory())
.sort((a, b) => a.name.localeCompare(b.name))
.flatMap((api) => {
const contentTypesDir = join(APP_TEMPLATE_API_DIR, api.name, 'content-types');
if (!existsSync(contentTypesDir)) {
return [];
}
return readdirSync(contentTypesDir, { withFileTypes: true })
.filter((contentType) => contentType.isDirectory())
.sort((a, b) => a.name.localeCompare(b.name))
.map((contentType) => `api::${api.name}.${contentType.name}`);
});
};
const APP_TEMPLATE_CONTENT_TYPES = getAppTemplateContentTypes();
export const ALLOWED_CONTENT_TYPES = [
'admin::user',
'admin::role',
'admin::permission',
'admin::api-token',
'admin::transfer-token',
...APP_TEMPLATE_CONTENT_TYPES,
'plugin::content-manager.history-version',
/**
* I18N
*/
'plugin::i18n.locale',
/**
* CONTENT RELEASES
*/
'plugin::content-releases.release',
'plugin::content-releases.release-action',
/**
* REVIEW WORKFLOWS
*/
'plugin::review-workflows.workflow-stage',
'plugin::review-workflows.workflow',
/**
* UPLOADS
*/
'plugin::upload.file',
];
export const TITLE_LOGIN = 'Strapi Admin';
export const TITLE_HOME = 'Homepage | Strapi';
// TODO: we should start using @strapi.io addresses to have the chance one day to
// actually receive and check the emails; also: it is not nice to spam other peoples
// websites
export const ADMIN_EMAIL_ADDRESS = 'test@testing.com';
export const ADMIN_PASSWORD = 'Testing123!';
export const EDITOR_EMAIL_ADDRESS = 'editor@testing.com';
export const EDITOR_PASSWORD = 'Testing123!';
export const AUTHOR_EMAIL_ADDRESS = 'author@testing.com';
export const AUTHOR_PASSWORD = 'Testing123!';