From 6c194ff333da182c6438f820bd92c0d80a18cdde Mon Sep 17 00:00:00 2001 From: Jim Laurie Date: Fri, 18 May 2018 14:22:24 +0200 Subject: [PATCH 01/18] Init create new app test --- .eslintrc | 3 +- package.json | 4 +- .../admin/src/containers/AdminPage/index.js | 102 +++++++----- packages/strapi-admin/package.json | 2 +- .../internals/webpack/webpack.base.babel.js | 88 ++++++----- .../internals/webpack/webpack.dev.babel.js | 131 +++++++++++----- .../internals/webpack/webpack.prod.babel.js | 145 +++++++++++++----- packages/strapi-helper-plugin/package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- packages/strapi-plugin-upload/package.json | 2 +- .../package.json | 2 +- packages/strapi/lib/Strapi.js | 144 +++++++++-------- packages/strapi/lib/core/plugins.js | 66 ++++++-- test/index.test.js | 46 ++++++ 16 files changed, 499 insertions(+), 244 deletions(-) create mode 100644 test/index.test.js diff --git a/.eslintrc b/.eslintrc index 17169bf41d..011380c7d0 100755 --- a/.eslintrc +++ b/.eslintrc @@ -10,7 +10,8 @@ "commonjs": true, "es6": true, "node": true, - "mocha": true + "mocha": true, + "jest": true }, "parserOptions": { "ecmaFeatures": { diff --git a/package.json b/package.json index bba50f763d..f1f8a07cf6 100755 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "eslint-plugin-redux-saga": "^0.3.0", "gitbook-cli": "^2.3.2", "istanbul": "~0.4.2", + "jest": "^22.4.3", "lerna": "^2.0.0", "lodash": "^4.17.5", "mocha": "~2.4.5", @@ -29,7 +30,7 @@ "setup:build": "npm run setup --build", "setup": "npm run clean:all && npm install ./packages/strapi-lint --save-dev && npm install && node ./scripts/setup.js && npm run clean", "lint": "node ./scripts/lint.js", - "test": "echo \"Error: no test specified yet...\"", + "test": "jest", "prettier": "node ./packages/strapi-lint/lib/internals/prettier/index.js" }, "author": { @@ -46,7 +47,6 @@ ], "pre-commit": [ "clean", - "prettier", "lint" ], "repository": { diff --git a/packages/strapi-admin/admin/src/containers/AdminPage/index.js b/packages/strapi-admin/admin/src/containers/AdminPage/index.js index 45697e074f..bb302fcff8 100644 --- a/packages/strapi-admin/admin/src/containers/AdminPage/index.js +++ b/packages/strapi-admin/admin/src/containers/AdminPage/index.js @@ -19,10 +19,7 @@ import { get, includes, isFunction, map, omit } from 'lodash'; import { compose } from 'redux'; // Actions required for disabling and enabling the OverlayBlocker -import { - disableGlobalOverlayBlocker, - enableGlobalOverlayBlocker, -} from 'actions/overlayBlocker'; +import { disableGlobalOverlayBlocker, enableGlobalOverlayBlocker } from 'actions/overlayBlocker'; import { pluginLoaded, updatePlugin } from 'containers/App/actions'; import { @@ -63,17 +60,16 @@ import styles from './styles.scss'; const PLUGINS_TO_BLOCK_PRODUCTION = ['content-type-builder', 'settings-manager']; -export class AdminPage extends React.Component { // eslint-disable-line react/prefer-stateless-function +export class AdminPage extends React.Component { + // eslint-disable-line react/prefer-stateless-function state = { hasAlreadyRegistereOtherPlugins: false }; - getChildContext = () => ( - { - disableGlobalOverlayBlocker: this.props.disableGlobalOverlayBlocker, - enableGlobalOverlayBlocker: this.props.enableGlobalOverlayBlocker, - plugins: this.props.plugins, - updatePlugin: this.props.updatePlugin, - } - ); + getChildContext = () => ({ + disableGlobalOverlayBlocker: this.props.disableGlobalOverlayBlocker, + enableGlobalOverlayBlocker: this.props.enableGlobalOverlayBlocker, + plugins: this.props.plugins, + updatePlugin: this.props.updatePlugin, + }); componentDidMount() { this.checkLogin(this.props); @@ -91,7 +87,10 @@ export class AdminPage extends React.Component { // eslint-disable-line react/pr } } - if (get(nextProps.plugins.toJS(), ['users-permissions', 'hasAdminUser']) !== get(this.props.plugins.toJS(), ['users-permissions', 'hasAdminUser'])) { + if ( + get(nextProps.plugins.toJS(), ['users-permissions', 'hasAdminUser']) !== + get(this.props.plugins.toJS(), ['users-permissions', 'hasAdminUser']) + ) { this.checkLogin(nextProps, true); } @@ -106,23 +105,34 @@ export class AdminPage extends React.Component { // eslint-disable-line react/pr return; } - const endPoint = this.hasAdminUser(props) ? 'login': 'register'; + const endPoint = this.hasAdminUser(props) ? 'login' : 'register'; this.props.history.push(`/plugins/users-permissions/auth/${endPoint}`); } - if (!this.isUrlProtected(props) && includes(props.location.pathname, 'auth/register') && this.hasAdminUser(props) && !skipAction) { + if ( + !this.isUrlProtected(props) && + includes(props.location.pathname, 'auth/register') && + this.hasAdminUser(props) && + !skipAction + ) { this.props.history.push('/plugins/users-permissions/auth/login'); } - if (props.hasUserPlugin && !this.isUrlProtected(props) && !includes(props.location.pathname, 'auth/register') && !this.hasAdminUser(props)) { + if ( + props.hasUserPlugin && + !this.isUrlProtected(props) && + !includes(props.location.pathname, 'auth/register') && + !this.hasAdminUser(props) + ) { this.props.history.push('/plugins/users-permissions/auth/register'); } - if (!props.hasUserPlugin || auth.getToken() && !this.state.hasAlreadyRegistereOtherPlugins) { + if (!props.hasUserPlugin || (auth.getToken() && !this.state.hasAlreadyRegistereOtherPlugins)) { map(omit(this.props.plugins.toJS(), ['users-permissions', 'email']), plugin => { switch (true) { case isFunction(plugin.bootstrap) && isFunction(plugin.pluginRequirements): - plugin.pluginRequirements(plugin) + plugin + .pluginRequirements(plugin) .then(plugin => { return plugin.bootstrap(plugin); }) @@ -140,31 +150,35 @@ export class AdminPage extends React.Component { // eslint-disable-line react/pr this.setState({ hasAlreadyRegistereOtherPlugins: true }); } - } + }; - hasUserPluginLoaded = (props) => typeof get(props.plugins.toJS(), ['users-permissions', 'hasAdminUser']) !== 'undefined'; + hasUserPluginLoaded = props => + typeof get(props.plugins.toJS(), ['users-permissions', 'hasAdminUser']) !== 'undefined'; - hasAdminUser = (props) => get(props.plugins.toJS(), ['users-permissions', 'hasAdminUser']); + hasAdminUser = props => get(props.plugins.toJS(), ['users-permissions', 'hasAdminUser']); - isUrlProtected = (props) => !includes(props.location.pathname, get(props.plugins.toJS(), ['users-permissions', 'nonProtectedUrl'])); + isUrlProtected = props => + !includes(props.location.pathname, get(props.plugins.toJS(), ['users-permissions', 'nonProtectedUrl'])); shouldDisplayLogout = () => auth.getToken() && this.props.hasUserPlugin && this.isUrlProtected(this.props); showLeftMenu = () => !includes(this.props.location.pathname, 'users-permissions/auth/'); retrievePlugins = () => { - const { adminPage: { currentEnvironment }, plugins } = this.props; + const { + adminPage: { currentEnvironment }, + plugins, + } = this.props; if (currentEnvironment === 'production') { let pluginsToDisplay = plugins; - PLUGINS_TO_BLOCK_PRODUCTION.map(plugin => - pluginsToDisplay = pluginsToDisplay.delete(plugin)); + PLUGINS_TO_BLOCK_PRODUCTION.map(plugin => (pluginsToDisplay = pluginsToDisplay.delete(plugin))); return pluginsToDisplay; } return plugins; - } + }; render() { const { adminPage } = this.props; @@ -247,13 +261,27 @@ const mapStateToProps = createStructuredSelector({ function mapDispatchToProps(dispatch) { return { - disableGlobalOverlayBlocker: () => { dispatch(disableGlobalOverlayBlocker()); }, - enableGlobalOverlayBlocker: () => { dispatch(enableGlobalOverlayBlocker()); }, - getGaStatus: () => { dispatch(getGaStatus()); }, - getLayout: () => { dispatch(getLayout()); }, - onHideNotification: (id) => { dispatch(hideNotification(id)); }, - pluginLoaded: (plugin) => { dispatch(pluginLoaded(plugin)); }, - updatePlugin: (pluginId, updatedKey, updatedValue) => { dispatch(updatePlugin(pluginId, updatedKey, updatedValue)); }, + disableGlobalOverlayBlocker: () => { + dispatch(disableGlobalOverlayBlocker()); + }, + enableGlobalOverlayBlocker: () => { + dispatch(enableGlobalOverlayBlocker()); + }, + getGaStatus: () => { + dispatch(getGaStatus()); + }, + getLayout: () => { + dispatch(getLayout()); + }, + onHideNotification: id => { + dispatch(hideNotification(id)); + }, + pluginLoaded: plugin => { + dispatch(pluginLoaded(plugin)); + }, + updatePlugin: (pluginId, updatedKey, updatedValue) => { + dispatch(updatePlugin(pluginId, updatedKey, updatedValue)); + }, dispatch, }; } @@ -262,10 +290,6 @@ const withConnect = connect(mapStateToProps, mapDispatchToProps); const withReducer = injectReducer({ key: 'adminPage', reducer }); const withSaga = injectSaga({ key: 'adminPage', saga }); -export default compose( - withReducer, - withSaga, - withConnect, -)(AdminPage); +export default compose(withReducer, withSaga, withConnect)(AdminPage); // export default connect(mapStateToProps, mapDispatchToProps)(AdminPage); diff --git a/packages/strapi-admin/package.json b/packages/strapi-admin/package.json index a1c8611803..b01bdff4f7 100755 --- a/packages/strapi-admin/package.json +++ b/packages/strapi-admin/package.json @@ -51,4 +51,4 @@ "npm": ">= 5.0.0" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/packages/strapi-helper-plugin/lib/internals/webpack/webpack.base.babel.js b/packages/strapi-helper-plugin/lib/internals/webpack/webpack.base.babel.js index c46c83a506..708d4bb4e5 100755 --- a/packages/strapi-helper-plugin/lib/internals/webpack/webpack.base.babel.js +++ b/packages/strapi-helper-plugin/lib/internals/webpack/webpack.base.babel.js @@ -22,7 +22,7 @@ const appPath = (() => { return isAdmin ? path.resolve(process.env.PWD, '..') : path.resolve(process.env.PWD, '..', '..'); })(); // const isSetup = path.resolve(process.env.PWD, '..', '..') === path.resolve(process.env.INIT_CWD); -const isSetup = process.env.IS_MONOREPO; +const isSetup = process.env.IS_MONOREPO; const adminPath = (() => { if (isAdmin && isSetup) { @@ -42,7 +42,13 @@ const URLs = { if (isAdmin && !isSetup) { // Load server configuration. - const serverConfig = path.resolve(appPath, 'config', 'environments', _.lowerCase(process.env.NODE_ENV), 'server.json'); + const serverConfig = path.resolve( + appPath, + 'config', + 'environments', + _.lowerCase(process.env.NODE_ENV), + 'server.json', + ); try { const server = require(serverConfig); @@ -88,21 +94,32 @@ if (process.env.npm_lifecycle_event === 'start') { // Read `plugins` directory and check if the plugin comes with an UI (it has an App container). // If we don't do this check webpack expects the plugin to have a containers/App/reducer.js to create // the plugin's store (redux). - plugins.src = isAdmin && !plugins.exist ? fs.readdirSync(path.resolve(appPath, 'plugins')).filter(x => { - let hasAdminFolder; + plugins.src = + isAdmin && !plugins.exist + ? fs.readdirSync(path.resolve(appPath, 'plugins')).filter(x => { + let hasAdminFolder; - try { - fs.accessSync(path.resolve(appPath, 'plugins', x, 'admin', 'src', 'containers', 'App')); - hasAdminFolder = true; - } catch(err) { - hasAdminFolder = false; - } - return x[0] !== '.' && hasAdminFolder; - }) : []; + try { + fs.accessSync(path.resolve(appPath, 'plugins', x, 'admin', 'src', 'containers', 'App')); + hasAdminFolder = true; + } catch (err) { + hasAdminFolder = false; + } + return x[0] !== '.' && hasAdminFolder; + }) + : []; // Construct object of plugin' paths. plugins.folders = plugins.src.reduce((acc, current) => { - acc[current] = path.resolve(appPath, 'plugins', current, 'node_modules', 'strapi-helper-plugin', 'lib', 'src'); + acc[current] = path.resolve( + appPath, + 'plugins', + current, + 'node_modules', + 'strapi-helper-plugin', + 'lib', + 'src', + ); return acc; }, {}); @@ -110,14 +127,16 @@ if (process.env.npm_lifecycle_event === 'start') { // Tell webpack to use a loader only for those files const foldersToInclude = [path.join(adminPath, 'admin', 'src')] - .concat(plugins.src.reduce((acc, current) => { - acc.push(path.resolve(appPath, 'plugins', current, 'admin', 'src'), plugins.folders[current]); + .concat( + plugins.src.reduce((acc, current) => { + acc.push(path.resolve(appPath, 'plugins', current, 'admin', 'src'), plugins.folders[current]); - return acc; - }, [])) + return acc; + }, []), + ) .concat([path.join(adminPath, 'node_modules', 'strapi-helper-plugin', 'lib', 'src')]); -module.exports = (options) => { +module.exports = options => { // The disable option is only for production // Config from https://github.com/facebook/create-react-app/blob/next/packages/react-scripts/config/webpack.config.prod.js const extractSass = new ExtractTextPlugin({ @@ -127,11 +146,16 @@ module.exports = (options) => { return { entry: options.entry, - output: Object.assign({ // Compile into js/build.js - path: path.join(adminPath, 'admin', 'build'), - }, options.output), // Merge with env dependent settings + output: Object.assign( + { + // Compile into js/build.js + path: path.join(adminPath, 'admin', 'build'), + }, + options.output, + ), // Merge with env dependent settings module: { - rules: [ // TODO: add eslint formatter + rules: [ + // TODO: add eslint formatter { // "oneOf" will traverse all following loaders until one will // match the requirements. When no loader matches it will fall @@ -145,9 +169,7 @@ module.exports = (options) => { presets: options.babelPresets, env: { production: { - only: [ - 'src', - ], + only: ['src'], plugins: [ require.resolve('babel-plugin-transform-react-remove-prop-types'), require.resolve('babel-plugin-transform-react-constant-elements'), @@ -159,9 +181,7 @@ module.exports = (options) => { ], }, test: { - plugins: [ - 'istanbul', - ], + plugins: ['istanbul'], }, }, }, @@ -305,16 +325,8 @@ module.exports = (options) => { ], alias: options.alias, symlinks: false, - extensions: [ - '.js', - '.jsx', - '.react.js', - ], - mainFields: [ - 'browser', - 'jsnext:main', - 'main', - ], + extensions: ['.js', '.jsx', '.react.js'], + mainFields: ['browser', 'jsnext:main', 'main'], }, externals: options.externals, resolveLoader: { diff --git a/packages/strapi-helper-plugin/lib/internals/webpack/webpack.dev.babel.js b/packages/strapi-helper-plugin/lib/internals/webpack/webpack.dev.babel.js index 74c1603829..0c60f380b1 100755 --- a/packages/strapi-helper-plugin/lib/internals/webpack/webpack.dev.babel.js +++ b/packages/strapi-helper-plugin/lib/internals/webpack/webpack.dev.babel.js @@ -26,7 +26,9 @@ const appPath = (() => { const rootAdminpath = (() => { if (isSetup) { - return isAdmin ? path.resolve(appPath, 'strapi-admin') : path.resolve(appPath, 'packages', 'strapi-admin'); + return isAdmin + ? path.resolve(appPath, 'strapi-admin') + : path.resolve(appPath, 'packages', 'strapi-admin'); } return path.resolve(appPath, 'admin'); })(); @@ -46,42 +48,54 @@ if (process.env.npm_lifecycle_event === 'start') { plugins.exist = true; } - plugins.src = process.env.IS_ADMIN === 'true' && !plugins.exist ? fs.readdirSync(path.resolve(appPath, 'plugins')).filter(x => { - let hasAdminFolder; + plugins.src = + process.env.IS_ADMIN === 'true' && !plugins.exist + ? fs.readdirSync(path.resolve(appPath, 'plugins')).filter(x => { + let hasAdminFolder; - // Don't inject the plugins that don't have an admin into the app - try { - fs.accessSync(path.resolve(appPath, 'plugins', x, 'admin', 'src', 'containers', 'App')); - hasAdminFolder = true; - } catch(err) { - hasAdminFolder = false; - } + // Don't inject the plugins that don't have an admin into the app + try { + fs.accessSync(path.resolve(appPath, 'plugins', x, 'admin', 'src', 'containers', 'App')); + hasAdminFolder = true; + } catch (err) { + hasAdminFolder = false; + } - return x[0] !== '.' && hasAdminFolder; - }) : []; + return x[0] !== '.' && hasAdminFolder; + }) + : []; plugins.folders = plugins.src.reduce((acc, current) => { - acc[current] = path.resolve(appPath, 'plugins', current, 'node_modules', 'strapi-helper-plugin', 'lib', 'src'); + acc[current] = path.resolve( + appPath, + 'plugins', + current, + 'node_modules', + 'strapi-helper-plugin', + 'lib', + 'src', + ); return acc; }, {}); } - const port = argv.port || process.env.PORT || 3000; module.exports = require('./webpack.base.babel')({ // Add hot reloading in development - entry: Object.assign({ - main: [ - `webpack-hot-middleware/client?path=http://localhost:${port}/__webpack_hmr`, - path.join(appPath, 'admin', 'admin', 'src', 'app.js'), - ], - }, plugins.src.reduce((acc, current) => { - acc[current] = path.resolve(plugins.folders[current], 'app.js'); + entry: Object.assign( + { + main: [ + `webpack-hot-middleware/client?path=http://localhost:${port}/__webpack_hmr`, + path.join(appPath, 'admin', 'admin', 'src', 'app.js'), + ], + }, + plugins.src.reduce((acc, current) => { + acc[current] = path.resolve(plugins.folders[current], 'app.js'); - return acc; - }, {}) + return acc; + }, {}), ), // Don't use hashes in dev mode for better performance @@ -112,10 +126,12 @@ module.exports = require('./webpack.base.babel')({ // Process the CSS with PostCSS postcssPlugins: [ postcssFocus(), // Add a :focus to every :hover - cssnext({ // Allow future CSS features to be used, also auto-prefixes the CSS... + cssnext({ + // Allow future CSS features to be used, also auto-prefixes the CSS... browsers: ['last 2 versions', 'IE > 10'], // ...based on this browser list }), - postcssReporter({ // Posts messages from plugins to the terminal + postcssReporter({ + // Posts messages from plugins to the terminal clearMessages: true, }), ], @@ -136,30 +152,69 @@ module.exports = require('./webpack.base.babel')({ ], alias: { moment: 'moment/moment.js', - 'babel-polyfill': path.resolve(rootAdminpath, 'node_modules', 'strapi-helper-plugin', 'node_modules', 'babel-polyfill'), - 'lodash': path.resolve(rootAdminpath, 'node_modules', 'strapi-helper-plugin', 'node_modules', 'lodash'), - 'immutable': path.resolve(rootAdminpath, 'node_modules', 'strapi-helper-plugin', 'node_modules', 'immutable'), - 'react-intl': path.resolve(rootAdminpath, 'node_modules', 'strapi-helper-plugin', 'node_modules', 'react-intl'), - 'react': path.resolve(rootAdminpath, 'node_modules', 'strapi-helper-plugin', 'node_modules', 'react'), - 'react-dom': path.resolve(rootAdminpath, 'node_modules', 'strapi-helper-plugin', 'node_modules', 'react-dom'), - 'react-transition-group': path.resolve(rootAdminpath, 'node_modules', 'strapi-helper-plugin', 'node_modules', 'react-transition-group'), - 'reactstrap': path.resolve(rootAdminpath, 'node_modules', 'strapi-helper-plugin', 'node_modules', 'reactstrap'), - 'styled-components': path.resolve(rootAdminpath, 'node_modules', 'strapi-helper-plugin', 'node_modules', 'styled-components') + 'babel-polyfill': path.resolve( + rootAdminpath, + 'node_modules', + 'strapi-helper-plugin', + 'node_modules', + 'babel-polyfill', + ), + lodash: path.resolve(rootAdminpath, 'node_modules', 'strapi-helper-plugin', 'node_modules', 'lodash'), + immutable: path.resolve( + rootAdminpath, + 'node_modules', + 'strapi-helper-plugin', + 'node_modules', + 'immutable', + ), + 'react-intl': path.resolve( + rootAdminpath, + 'node_modules', + 'strapi-helper-plugin', + 'node_modules', + 'react-intl', + ), + react: path.resolve(rootAdminpath, 'node_modules', 'strapi-helper-plugin', 'node_modules', 'react'), + 'react-dom': path.resolve( + rootAdminpath, + 'node_modules', + 'strapi-helper-plugin', + 'node_modules', + 'react-dom', + ), + 'react-transition-group': path.resolve( + rootAdminpath, + 'node_modules', + 'strapi-helper-plugin', + 'node_modules', + 'react-transition-group', + ), + reactstrap: path.resolve( + rootAdminpath, + 'node_modules', + 'strapi-helper-plugin', + 'node_modules', + 'reactstrap', + ), + 'styled-components': path.resolve( + rootAdminpath, + 'node_modules', + 'strapi-helper-plugin', + 'node_modules', + 'styled-components', + ), }, // Emit a source map for easier debugging devtool: 'cheap-module-source-map', }); - /** * We dynamically generate the HTML content in development so that the different * DLL Javascript files are loaded in script tags and available to our application. */ function templateContent() { - const html = fs.readFileSync( - path.resolve(appPath, 'admin', 'admin', 'src', 'index.html') - ).toString(); + const html = fs.readFileSync(path.resolve(appPath, 'admin', 'admin', 'src', 'index.html')).toString(); return html; } diff --git a/packages/strapi-helper-plugin/lib/internals/webpack/webpack.prod.babel.js b/packages/strapi-helper-plugin/lib/internals/webpack/webpack.prod.babel.js index 62cc5c40b8..e8c8908867 100755 --- a/packages/strapi-helper-plugin/lib/internals/webpack/webpack.prod.babel.js +++ b/packages/strapi-helper-plugin/lib/internals/webpack/webpack.prod.babel.js @@ -33,7 +33,9 @@ const adminPath = (() => { const rootAdminpath = (() => { if (isSetup) { - return isAdmin ? path.resolve(appPath, 'strapi-admin') : path.resolve(appPath, 'packages', 'strapi-admin'); + return isAdmin + ? path.resolve(appPath, 'strapi-admin') + : path.resolve(appPath, 'packages', 'strapi-admin'); } return path.resolve(appPath, 'admin'); })(); @@ -64,7 +66,13 @@ let publicPath; if (isAdmin && !isSetup) { // Load server configuration. - const serverConfig = path.resolve(appPath, 'config', 'environments', _.lowerCase(process.env.NODE_ENV), 'server.json'); + const serverConfig = path.resolve( + appPath, + 'config', + 'environments', + _.lowerCase(process.env.NODE_ENV), + 'server.json', + ); try { const server = require(serverConfig); @@ -83,32 +91,40 @@ if (isAdmin && !isSetup) { // Build the `index.html file` if (isAdmin) { - plugins.push(new HtmlWebpackPlugin({ - template: 'admin/src/index.html', - minify: { - removeComments: true, - collapseWhitespace: true, - removeRedundantAttributes: true, - useShortDoctype: true, - removeEmptyAttributes: true, - removeStyleLinkTypeAttributes: true, - keepClosingSlash: true, - minifyJS: true, - minifyCSS: true, - minifyURLs: true, - }, - chunksSortMode: 'manual', - chunks: ['main'], - inject: true, - })); - plugins.push(new AddAssetHtmlPlugin({ - filepath: path.resolve(__dirname, 'dist/*.dll.js'), - })); - plugins.push(new CopyWebpackPlugin([{ - from: 'config/plugins.json', - context: path.resolve(adminPath, 'admin', 'src'), - to: 'config/plugins.json', - }])); + plugins.push( + new HtmlWebpackPlugin({ + template: 'admin/src/index.html', + minify: { + removeComments: true, + collapseWhitespace: true, + removeRedundantAttributes: true, + useShortDoctype: true, + removeEmptyAttributes: true, + removeStyleLinkTypeAttributes: true, + keepClosingSlash: true, + minifyJS: true, + minifyCSS: true, + minifyURLs: true, + }, + chunksSortMode: 'manual', + chunks: ['main'], + inject: true, + }), + ); + plugins.push( + new AddAssetHtmlPlugin({ + filepath: path.resolve(__dirname, 'dist/*.dll.js'), + }), + ); + plugins.push( + new CopyWebpackPlugin([ + { + from: 'config/plugins.json', + context: path.resolve(adminPath, 'admin', 'src'), + to: 'config/plugins.json', + }, + ]), + ); } const main = (() => { @@ -128,11 +144,14 @@ module.exports = base({ }, // Utilize long-term caching by adding content hashes (not compilation hashes) to compiled assets - output: _.omitBy({ - filename: '[name].js', - chunkFilename: '[name].[chunkhash].chunk.js', - publicPath, - }, _.isUndefined), + output: _.omitBy( + { + filename: '[name].js', + chunkFilename: '[name].[chunkhash].chunk.js', + publicPath, + }, + _.isUndefined, + ), // In production, we minify our CSS with cssnano postcssPlugins: [ @@ -164,15 +183,57 @@ module.exports = base({ alias: { moment: 'moment/moment.js', - 'babel-polyfill': path.resolve(rootAdminpath, 'node_modules', 'strapi-helper-plugin', 'node_modules', 'babel-polyfill'), - 'lodash': path.resolve(rootAdminpath, 'node_modules', 'strapi-helper-plugin', 'node_modules', 'lodash'), - 'immutable': path.resolve(rootAdminpath, 'node_modules', 'strapi-helper-plugin', 'node_modules', 'immutable'), - 'react-intl': path.resolve(rootAdminpath, 'node_modules', 'strapi-helper-plugin', 'node_modules', 'react-intl'), - 'react': path.resolve(rootAdminpath, 'node_modules', 'strapi-helper-plugin', 'node_modules', 'react'), - 'react-dom': path.resolve(rootAdminpath, 'node_modules', 'strapi-helper-plugin', 'node_modules', 'react-dom'), - 'react-transition-group': path.resolve(rootAdminpath, 'node_modules', 'strapi-helper-plugin', 'node_modules', 'react-transition-group'), - 'reactstrap': path.resolve(rootAdminpath, 'node_modules', 'strapi-helper-plugin', 'node_modules', 'reactstrap'), - 'styled-components': path.resolve(rootAdminpath, 'node_modules', 'strapi-helper-plugin', 'node_modules', 'styled-components'), + 'babel-polyfill': path.resolve( + rootAdminpath, + 'node_modules', + 'strapi-helper-plugin', + 'node_modules', + 'babel-polyfill', + ), + lodash: path.resolve(rootAdminpath, 'node_modules', 'strapi-helper-plugin', 'node_modules', 'lodash'), + immutable: path.resolve( + rootAdminpath, + 'node_modules', + 'strapi-helper-plugin', + 'node_modules', + 'immutable', + ), + 'react-intl': path.resolve( + rootAdminpath, + 'node_modules', + 'strapi-helper-plugin', + 'node_modules', + 'react-intl', + ), + react: path.resolve(rootAdminpath, 'node_modules', 'strapi-helper-plugin', 'node_modules', 'react'), + 'react-dom': path.resolve( + rootAdminpath, + 'node_modules', + 'strapi-helper-plugin', + 'node_modules', + 'react-dom', + ), + 'react-transition-group': path.resolve( + rootAdminpath, + 'node_modules', + 'strapi-helper-plugin', + 'node_modules', + 'react-transition-group', + ), + reactstrap: path.resolve( + rootAdminpath, + 'node_modules', + 'strapi-helper-plugin', + 'node_modules', + 'reactstrap', + ), + 'styled-components': path.resolve( + rootAdminpath, + 'node_modules', + 'strapi-helper-plugin', + 'node_modules', + 'styled-components', + ), }, devtool: 'cheap-module-source-map', diff --git a/packages/strapi-helper-plugin/package.json b/packages/strapi-helper-plugin/package.json index e07869d9ea..35675e2375 100755 --- a/packages/strapi-helper-plugin/package.json +++ b/packages/strapi-helper-plugin/package.json @@ -117,4 +117,4 @@ "webpack-hot-middleware": "^2.18.2", "whatwg-fetch": "^2.0.3" } -} +} \ No newline at end of file diff --git a/packages/strapi-plugin-content-manager/package.json b/packages/strapi-plugin-content-manager/package.json index 8ff894bcfe..7bf093b39c 100755 --- a/packages/strapi-plugin-content-manager/package.json +++ b/packages/strapi-plugin-content-manager/package.json @@ -46,4 +46,4 @@ "npm": ">= 5.0.0" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/packages/strapi-plugin-content-type-builder/package.json b/packages/strapi-plugin-content-type-builder/package.json index ca62cace13..c862d8aeca 100755 --- a/packages/strapi-plugin-content-type-builder/package.json +++ b/packages/strapi-plugin-content-type-builder/package.json @@ -50,4 +50,4 @@ "npm": ">= 5.0.0" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/packages/strapi-plugin-settings-manager/package.json b/packages/strapi-plugin-settings-manager/package.json index 102c36dcc8..135e9e81d1 100755 --- a/packages/strapi-plugin-settings-manager/package.json +++ b/packages/strapi-plugin-settings-manager/package.json @@ -48,4 +48,4 @@ "npm": ">= 5.0.0" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/packages/strapi-plugin-upload/package.json b/packages/strapi-plugin-upload/package.json index fbf40045e3..7bdd3e14bb 100644 --- a/packages/strapi-plugin-upload/package.json +++ b/packages/strapi-plugin-upload/package.json @@ -47,4 +47,4 @@ "npm": ">= 3.0.0" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/packages/strapi-plugin-users-permissions/package.json b/packages/strapi-plugin-users-permissions/package.json index ff57f8cdf6..83480753a7 100644 --- a/packages/strapi-plugin-users-permissions/package.json +++ b/packages/strapi-plugin-users-permissions/package.json @@ -54,4 +54,4 @@ "npm": ">= 5.0.0" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/packages/strapi/lib/Strapi.js b/packages/strapi/lib/Strapi.js index 9bc45b13db..aab96d85f2 100755 --- a/packages/strapi/lib/Strapi.js +++ b/packages/strapi/lib/Strapi.js @@ -10,7 +10,16 @@ const { includes, get, assign, toLower } = require('lodash'); const { logger, models } = require('strapi-utils'); const stackTrace = require('stack-trace'); const utils = require('./utils'); -const { nestedConfigurations, appConfigurations, apis, middlewares, hooks, plugins, admin, store } = require('./core'); +const { + nestedConfigurations, + appConfigurations, + apis, + middlewares, + hooks, + plugins, + admin, + store, +} = require('./core'); const initializeMiddlewares = require('./middlewares'); const initializeHooks = require('./hooks'); @@ -41,7 +50,7 @@ class Strapi extends EventEmitter { // Utils. this.utils = { - models + models, }; // Exclude EventEmitter, Koa and HTTP server to be freezed. @@ -73,12 +82,12 @@ class Strapi extends EventEmitter { services: 'services', static: 'public', validators: 'validators', - views: 'views' + views: 'views', }, middleware: {}, hook: {}, functions: {}, - routes: {} + routes: {}, }; // Bind context functions. @@ -92,8 +101,6 @@ class Strapi extends EventEmitter { // Emit starting event. this.emit('server:starting'); - // Enhance app. - await this.enhancer(); // Load the app. await this.load(); // Run bootstrap function. @@ -169,7 +176,11 @@ class Strapi extends EventEmitter { // Destroy server and available connections. this.server.destroy(); - if (cluster.isWorker && this.config.environment === 'development' && get(this.config, 'currentEnvironment.server.autoReload.enabled', true) === true) { + if ( + cluster.isWorker && + this.config.environment === 'development' && + get(this.config, 'currentEnvironment.server.autoReload.enabled', true) === true + ) { process.send('stop'); } @@ -194,7 +205,7 @@ class Strapi extends EventEmitter { nestedConfigurations.call(this), apis.call(this), middlewares.call(this), - hooks.call(this) + hooks.call(this), ]); // Populate AST with configurations. @@ -207,10 +218,7 @@ class Strapi extends EventEmitter { await store.call(this); // Initialize hooks and middlewares. - await Promise.all([ - initializeMiddlewares.call(this), - initializeHooks.call(this) - ]); + await Promise.all([initializeMiddlewares.call(this), initializeHooks.call(this)]); // Harmonize plugins configuration. await plugins.call(this); @@ -218,15 +226,19 @@ class Strapi extends EventEmitter { reload() { const state = { - shouldReload: true + shouldReload: true, }; - const reload = function () { + const reload = function() { if (state.shouldReload === false) { return; } - if (cluster.isWorker && this.config.environment === 'development' && get(this.config, 'currentEnvironment.server.autoReload.enabled', true) === true) { + if ( + cluster.isWorker && + this.config.environment === 'development' && + get(this.config, 'currentEnvironment.server.autoReload.enabled', true) === true + ) { process.send('reload'); } }; @@ -234,14 +246,14 @@ class Strapi extends EventEmitter { Object.defineProperty(reload, 'isWatching', { configurable: true, enumerable: true, - set: (value) => { + set: value => { // Special state when the reloader is disabled temporarly (see GraphQL plugin example). state.shouldReload = !(state.isWatching === false && value === true); state.isWatching = value; }, get: () => { return state.isWatching; - } + }, }); reload.isReloading = false; @@ -251,45 +263,49 @@ class Strapi extends EventEmitter { } async bootstrap() { - const execBootstrap = (fn) => !fn ? Promise.resolve() : new Promise((resolve, reject) => { - const timeoutMs = this.config.bootstrapTimeout || 3500; - const timer = setTimeout(() => { - this.log.warn(`Bootstrap is taking unusually long to execute its callback ${timeoutMs} miliseconds).`); - this.log.warn('Perhaps you forgot to call it?'); - }, timeoutMs); + const execBootstrap = fn => + !fn + ? Promise.resolve() + : new Promise((resolve, reject) => { + const timeoutMs = this.config.bootstrapTimeout || 3500; + const timer = setTimeout(() => { + this.log.warn( + `Bootstrap is taking unusually long to execute its callback ${timeoutMs} miliseconds).`, + ); + this.log.warn('Perhaps you forgot to call it?'); + }, timeoutMs); - let ranBootstrapFn = false; + let ranBootstrapFn = false; - try { - fn(err => { - if (ranBootstrapFn) { - this.log.error('You called the callback in `strapi.config.boostrap` more than once!'); + try { + fn(err => { + if (ranBootstrapFn) { + this.log.error('You called the callback in `strapi.config.boostrap` more than once!'); - return reject(); + return reject(); + } + + ranBootstrapFn = true; + clearTimeout(timer); + + return resolve(err); + }); + } catch (e) { + if (ranBootstrapFn) { + this.log.error('The bootstrap function threw an error after its callback was called.'); + + return reject(e); + } + + ranBootstrapFn = true; + clearTimeout(timer); + + return resolve(e); } - - ranBootstrapFn = true; - clearTimeout(timer); - - return resolve(err); }); - } catch (e) { - if (ranBootstrapFn) { - this.log.error('The bootstrap function threw an error after its callback was called.'); - - return reject(e); - } - - ranBootstrapFn = true; - clearTimeout(timer); - - return resolve(e); - } - }); return Promise.all( - Object.values(this.plugins) - .map(x => execBootstrap(get(x, 'config.functions.bootstrap'))) + Object.values(this.plugins).map(x => execBootstrap(get(x, 'config.functions.bootstrap'))), ).then(() => execBootstrap(this.config.functions.bootstrap)); } @@ -299,19 +315,24 @@ class Strapi extends EventEmitter { // Remove object from tree. delete this.propertiesToNotFreeze; - return Object.keys(this).filter(x => !includes(propertiesToNotFreeze, x)).forEach(key => { - Object.freeze(this[key]); - }); + return Object.keys(this) + .filter(x => !includes(propertiesToNotFreeze, x)) + .forEach(key => { + Object.freeze(this[key]); + }); } query(entity, plugin) { if (!entity) { - return this.log.error(`You can't call the query method without passing the model's name as a first argument.`); + return this.log.error( + `You can't call the query method without passing the model's name as a first argument.`, + ); } const model = entity.toLowerCase(); - const Model = get(strapi.plugins, [plugin, 'models', model]) || get(strapi, ['models', model]) || undefined; + const Model = + get(strapi.plugins, [plugin, 'models', model]) || get(strapi, ['models', model]) || undefined; if (!Model) { return this.log.error(`The model ${model} can't be found.`); @@ -355,12 +376,15 @@ class Strapi extends EventEmitter { } // Bind queries with the current model to allow the use of `this`. - const bindQueries = Object.keys(queries).reduce((acc, current) => { - return acc[current] = queries[current].bind(Model), acc; - }, { - orm: connector, - primaryKey: Model.primaryKey - }); + const bindQueries = Object.keys(queries).reduce( + (acc, current) => { + return (acc[current] = queries[current].bind(Model)), acc; + }, + { + orm: connector, + primaryKey: Model.primaryKey, + }, + ); return bindQueries; } diff --git a/packages/strapi/lib/core/plugins.js b/packages/strapi/lib/core/plugins.js index d830902edd..2425051cdf 100644 --- a/packages/strapi/lib/core/plugins.js +++ b/packages/strapi/lib/core/plugins.js @@ -8,13 +8,13 @@ const _ = require('lodash'); module.exports = function() { return new Promise((resolve, reject) => { const folder = ((url = _.get(strapi.config.currentEnvironment.server, 'admin.path', 'admin')) => - url[0] === '/' ? url.substring(1) : url - )().replace(/\/$/, '') ; + url[0] === '/' ? url.substring(1) : url)().replace(/\/$/, ''); const configuratePlugin = (acc, current, source, name) => { switch (source) { case 'host': { - const host = _.get(this.config.environments[current].server, 'admin.build.host').replace(/\/$/, '') || '/'; + const host = + _.get(this.config.environments[current].server, 'admin.build.host').replace(/\/$/, '') || '/'; if (!host) { throw new Error(`You can't use \`remote\` as a source without set the \`host\` configuration.`); @@ -32,12 +32,20 @@ module.exports = function() { } case 'custom': if (!_.isEmpty(_.get(this.plugins[name].config, `sources.${current}`, {}))) { - return acc[current] = this.plugins[name].config.sources[current]; + return (acc[current] = this.plugins[name].config.sources[current]); } - throw new Error(`You have to define the source URL for each environment in \`./plugins/**/config/sources.json\``); + throw new Error( + `You have to define the source URL for each environment in \`./plugins/**/config/sources.json\``, + ); case 'backend': { - const backend = _.get(this.config.environments[current], 'server.admin.build.backend', `http://${this.config.environments[current].server.host}:${this.config.environments[current].server.port}`).replace(/\/$/, ''); + const backend = _.get( + this.config.environments[current], + 'server.admin.build.backend', + `http://${this.config.environments[current].server.host}:${ + this.config.environments[current].server.port + }`, + ).replace(/\/$/, ''); return `${backend}/${folder.replace(/\/$/, '')}/${name}/main.js`; } @@ -46,12 +54,30 @@ module.exports = function() { } }; - const sourcePath = process.env.NODE_ENV !== 'test' ? - path.resolve(this.config.appPath, 'admin', 'admin', 'src', 'config', 'plugins.json'): - path.resolve(this.config.appPath, 'packages', 'strapi-admin', 'admin', 'src', 'config', 'plugins.json'); - const buildPath = process.env.NODE_ENV !== 'test' ? - path.resolve(this.config.appPath, 'admin', 'admin', 'build', 'config', 'plugins.json'): - path.resolve(this.config.appPath, 'packages', 'strapi-admin', 'admin', 'build', 'config', 'plugins.json'); + const sourcePath = + this.config.environment !== 'test' + ? path.resolve(this.config.appPath, 'admin', 'admin', 'src', 'config', 'plugins.json') + : path.resolve( + this.config.appPath, + 'packages', + 'strapi-admin', + 'admin', + 'src', + 'config', + 'plugins.json', + ); + const buildPath = + this.config.environment !== 'test' + ? path.resolve(this.config.appPath, 'admin', 'admin', 'build', 'config', 'plugins.json') + : path.resolve( + this.config.appPath, + 'packages', + 'strapi-admin', + 'admin', + 'build', + 'config', + 'plugins.json', + ); try { fs.access(path.resolve(this.config.appPath, 'admin', 'admin'), err => { @@ -115,14 +141,16 @@ module.exports = function() { // Create `plugins.json` file. // Don't inject the plugins without an Admin - const data = Object.keys(this.plugins) + const data = Object.keys(this.plugins) .filter(plugin => { let hasAdminFolder; try { - fs.accessSync(path.resolve(this.config.appPath, 'plugins', plugin, 'admin', 'src', 'containers', 'App')); + fs.accessSync( + path.resolve(this.config.appPath, 'plugins', plugin, 'admin', 'src', 'containers', 'App'), + ); hasAdminFolder = true; - } catch(err) { + } catch (err) { hasAdminFolder = false; } return hasAdminFolder; @@ -130,7 +158,11 @@ module.exports = function() { .map(name => ({ id: name, source: Object.keys(this.config.environments).reduce((acc, current) => { - const source = _.get(this.config.environments[current].server, 'admin.build.plugins.source', 'default'); + const source = _.get( + this.config.environments[current].server, + 'admin.build.plugins.source', + 'default', + ); if (_.isString(source)) { acc[current] = configuratePlugin(acc, current, source, name); @@ -139,7 +171,7 @@ module.exports = function() { } return acc; - }, {}) + }, {}), })); fs.writeFileSync(sourcePath, JSON.stringify(data, null, 2), 'utf8'); diff --git a/test/index.test.js b/test/index.test.js new file mode 100644 index 0000000000..bef0e762b0 --- /dev/null +++ b/test/index.test.js @@ -0,0 +1,46 @@ +const exec = require('child_process').exec; +const fs = require('fs-extra'); +const path = require('path'); + +const bin = path.resolve('./packages/strapi/bin/strapi.js'); +const appName = 'testApp'; + +describe('Basic setup', () => { + beforeAll(() => { + return new Promise(resolve => { + fs.exists(appName, exists => { + if (exists) { + fs.removeSync(appName); + } + + resolve(); + }); + }); + }); + + test( + 'Create new test app', + () => { + return expect( + new Promise(resolve => { + const appCreation = exec( + `node ${bin} new ${appName} --dev --dbclient=mongo --dbhost=localhost --dbport=27017 --dbname=strapi-test-${new Date().getTime()} --dbusername="" --dbpassword=""`, + ); + + appCreation.stdout.on('data', data => { + if (data.includes('is ready at')) { + appCreation.kill(); + return resolve(true); + } + + if (data.includes('Database connection has failed')) { + appCreation.kill(); + return resolve(false); + } + }); + }), + ).resolves.toBeTruthy(); + }, + 120000, + ); +}); From e6b4b2a214d99ac08f1c00552896ed0158ccec48 Mon Sep 17 00:00:00 2001 From: Jim Laurie Date: Mon, 21 May 2018 17:04:25 +0200 Subject: [PATCH 02/18] Setup test project Change test structure Generate new testApp from node script and launch app Add new feature: Be able to user strapi start and specify an app path (WIP) configs are loaded Generate test API with relations - articles, tag and category --- package.json | 3 +- packages/strapi/bin/strapi-start.js | 18 ++-- packages/strapi/bin/strapi.js | 6 +- packages/strapi/lib/core/hooks.js | 3 +- test/helper/generators.json | 123 ++++++++++++++++++++++++++++ test/helper/restart.js | 20 +++++ test/index.test.js | 80 +++++++++--------- test/start.js | 84 +++++++++++++++++++ 8 files changed, 288 insertions(+), 49 deletions(-) create mode 100644 test/helper/generators.json create mode 100644 test/helper/restart.js create mode 100644 test/start.js diff --git a/package.json b/package.json index f1f8a07cf6..ef89f55c19 100755 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "3.0.0-alpha.12.2", "devDependencies": { "assert": "~1.3.0", + "axios": "^0.18.0", "babel-eslint": "^6.1.2", "chalk": "^2.4.1", "eslint": "^3.12.2", @@ -30,7 +31,7 @@ "setup:build": "npm run setup --build", "setup": "npm run clean:all && npm install ./packages/strapi-lint --save-dev && npm install && node ./scripts/setup.js && npm run clean", "lint": "node ./scripts/lint.js", - "test": "jest", + "test": "node ./test/start.js", "prettier": "node ./packages/strapi-lint/lib/internals/prettier/index.js" }, "author": { diff --git a/packages/strapi/bin/strapi-start.js b/packages/strapi/bin/strapi-start.js index 3a36dd8b53..f6b2d4bd1e 100755 --- a/packages/strapi/bin/strapi-start.js +++ b/packages/strapi/bin/strapi-start.js @@ -24,16 +24,18 @@ const { cli, logger } = require('strapi-utils'); * (fire up the application in our working directory). */ -module.exports = function() { +module.exports = function(appPath = '') { // Check that we're in a valid Strapi project. if (!cli.isStrapiApp()) { return logger.error('This command can only be used inside a Strapi project.'); } + appPath = path.join(process.cwd(), appPath); + try { const strapi = function () { try { - return require(path.resolve(process.cwd(), 'node_modules', 'strapi')); + return require(path.resolve(appPath, 'node_modules', 'strapi')); } catch (e) { return require('strapi'); // eslint-disable-line import/no-unresolved } @@ -46,7 +48,7 @@ module.exports = function() { // Require server configurations const server = require(path.resolve( - process.cwd(), + appPath, 'config', 'environments', 'development', @@ -81,7 +83,7 @@ module.exports = function() { }); }; - setFilesToWatch(process.cwd()); + setFilesToWatch(appPath); @@ -124,7 +126,9 @@ module.exports = function() { } }); - return strapi.start(afterwards); + return strapi.start({ + appPath + }, afterwards); } else { return; } @@ -133,7 +137,9 @@ module.exports = function() { // Otherwise, if no workable local `strapi` module exists, // run the application using the currently running version // of `strapi`. This is probably always the global install. - strapi.start(afterwards); + strapi.start({ + appPath + }, afterwards); } catch (e) { logger.error(e); process.exit(0); diff --git a/packages/strapi/bin/strapi.js b/packages/strapi/bin/strapi.js index e207442ca1..7d497e2517 100755 --- a/packages/strapi/bin/strapi.js +++ b/packages/strapi/bin/strapi.js @@ -64,9 +64,11 @@ program // `$ strapi start` program - .command('start') + .command('start [appPath]') .description('start your Strapi application') - .action(require('./strapi-start')); + .action((appPath) => { + require('./strapi-start')(appPath); + }); // `$ strapi generate:api` program diff --git a/packages/strapi/lib/core/hooks.js b/packages/strapi/lib/core/hooks.js index cbaf55e428..41104c0411 100755 --- a/packages/strapi/lib/core/hooks.js +++ b/packages/strapi/lib/core/hooks.js @@ -25,7 +25,8 @@ module.exports = function() { './node_modules/strapi-middleware-*', './node_modules/strapi-upload-*', './node_modules/strapi-lint' - ] + ], + cwd: this.config.appPath }, (err, files) => { if (err) { return reject(err); diff --git a/test/helper/generators.json b/test/helper/generators.json new file mode 100644 index 0000000000..878fb8512d --- /dev/null +++ b/test/helper/generators.json @@ -0,0 +1,123 @@ +{ + "article": { + "attributes":[ + { + "name":"title", + "params":{ + "appearance":{ + "WYSIWYG":false + }, + "multiple":false, + "type":"string" + } + }, + { + "name":"content", + "params":{ + "appearance":{ + "WYSIWYG":true + }, + "multiple":false, + "type":"text" + } + }, + { + "name":"published", + "params":{ + "appearance":{ + "WYSIWYG":false + }, + "multiple":false, + "type":"boolean" + } + }, + { + "name":"cover", + "params":{ + "appearance":{ + "WYSIWYG":false + }, + "multiple":false, + "type":"media" + } + }, + { + "name":"author", + "params":{ + "nature":"manyToOne", + "target":"user", + "pluginValue":"users-permissions", + "key":"articles", + "plugin":true + } + } + ], + "connection":"default", + "name":"article", + "description":"", + "collectionName":"" + }, + "tag": { + "attributes":[ + { + "name":"name", + "params":{ + "appearance":{ + "WYSIWYG":false + }, + "multiple":false, + "type":"string" + } + }, + { + "name":"articles", + "params":{ + "dominant":true, + "nature":"manyToMany", + "target":"article", + "key":"tags" + } + } + ], + "connection":"default", + "name":"tag", + "description":"", + "collectionName":"" + }, + "category": { + "attributes":[ + { + "name":"name", + "params":{ + "appearance":{ + "WYSIWYG":false + }, + "multiple":false, + "type":"string" + } + }, + { + "name":"images", + "params":{ + "appearance":{ + "WYSIWYG":false + }, + "multiple":true, + "type":"media" + } + }, + { + "name":"articles", + "params":{ + "nature":"oneToMany", + "target":"article", + "key":"category" + } + } + ], + "connection":"default", + "name":"category", + "description":"", + "collectionName":"" + } +} diff --git a/test/helper/restart.js b/test/helper/restart.js new file mode 100644 index 0000000000..1433ecfa9b --- /dev/null +++ b/test/helper/restart.js @@ -0,0 +1,20 @@ +module.exports = function (request) { + + return new Promise(async (resolve) => { + const ping = async () => { + try { + await request.get(''); + } catch (err) { + if (err.response) { + return resolve(); + } else { + return setTimeout(() => { + ping(); + }, 4000); + } + } + }; + + ping(); + }); +}; diff --git a/test/index.test.js b/test/index.test.js index bef0e762b0..b2e86f6afa 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -1,46 +1,48 @@ -const exec = require('child_process').exec; -const fs = require('fs-extra'); -const path = require('path'); +const axios = require('axios'); -const bin = path.resolve('./packages/strapi/bin/strapi.js'); -const appName = 'testApp'; +const request = axios.create({ + baseURL: 'http://localhost:1337', +}); -describe('Basic setup', () => { - beforeAll(() => { - return new Promise(resolve => { - fs.exists(appName, exists => { - if (exists) { - fs.removeSync(appName); - } - - resolve(); - }); - }); - }); +const params = require('./helper/generators'); +const restart = require('./helper/restart'); +describe('App setup auth', () => { test( - 'Create new test app', - () => { - return expect( - new Promise(resolve => { - const appCreation = exec( - `node ${bin} new ${appName} --dev --dbclient=mongo --dbhost=localhost --dbport=27017 --dbname=strapi-test-${new Date().getTime()} --dbusername="" --dbpassword=""`, - ); + 'Register admin user', + async () => { + const body = await request.post('/auth/local/register', { + username: 'admin', + email: 'admin@strapi.io', + password: 'pcw123' + }); - appCreation.stdout.on('data', data => { - if (data.includes('is ready at')) { - appCreation.kill(); - return resolve(true); - } - - if (data.includes('Database connection has failed')) { - appCreation.kill(); - return resolve(false); - } - }); - }), - ).resolves.toBeTruthy(); - }, - 120000, + axios.defaults.headers.common['Authorization'] = `Bearer ${body.data.jwt}`; + } + ); +}); + +describe('Generate test APIs', () => { + beforeEach(async () => { + await restart(request); + }, 60000); + + test( + 'Create new article API', + async () => { + await request.post('/content-type-builder/models', params.article); + } + ); + test( + 'Create new tag API', + async () => { + await request.post('/content-type-builder/models', params.tag); + } + ); + test( + 'Create new category API', + async () => { + await request.post('/content-type-builder/models', params.category); + } ); }); diff --git a/test/start.js b/test/start.js new file mode 100644 index 0000000000..cd6111c323 --- /dev/null +++ b/test/start.js @@ -0,0 +1,84 @@ +const exec = require('child_process').exec; +const fs = require('fs-extra'); +const path = require('path'); + +const strapiBin = path.resolve('./packages/strapi/bin/strapi.js'); +const appName = 'testApp'; +let appStart; + +const {runCLI: jest} = require('jest-cli/build/cli'); + +const main = async () => { + const clean = () => { + return new Promise((resolve) => { + fs.exists(appName, exists => { + if (exists) { + fs.removeSync(appName); + } + + resolve(); + }); + }); + }; + + const generate = () => { + return new Promise((resolve) => { + const appCreation = exec( + `node ${strapiBin} new ${appName} --dev --dbclient=mongo --dbhost=localhost --dbport=27017 --dbname=strapi-test-${new Date().getTime()} --dbusername="" --dbpassword=""`, + ); + + appCreation.stdout.on('data', data => { + console.log(data.toString()); + + if (data.includes('is ready at')) { + appCreation.kill(); + return resolve(); + } + + if (data.includes('Database connection has failed')) { + appCreation.kill(); + return reject(); + } + }); + }); + }; + + const start = () => { + return new Promise((resolve) => { + appStart = exec( + `node ${strapiBin} start ${appName}`, + ); + + appStart.stdout.on('data', data => { + console.log(data.toString()); + + if (data.includes('To shut down your server')) { + return resolve(); + } + }); + }); + }; + + const test = () => { + console.log('Launch test suits'); + return new Promise(async (resolve) => { + const options = { + projects: [process.cwd()], + silent: false + }; + + await jest(options, options.projects); + + resolve(); + }); + }; + + await clean(); + await generate(); + await start(); + await test(); + + appStart.kill(); +}; + +main(); From b8b1afa1039292f11a9fe7d2e159ae26a3b689b9 Mon Sep 17 00:00:00 2001 From: Jim Laurie Date: Thu, 24 May 2018 15:12:15 +0200 Subject: [PATCH 03/18] Use request to send form axios not support FormData request from nodejs script --- package.json | 2 + .../admin/src/config/manifest.json | 2 +- test/helper/restart.js | 17 ++- test/index.test.js | 122 ++++++++++++++++-- 4 files changed, 123 insertions(+), 20 deletions(-) diff --git a/package.json b/package.json index ef89f55c19..b62bd1ee3b 100755 --- a/package.json +++ b/package.json @@ -13,11 +13,13 @@ "gitbook-cli": "^2.3.2", "istanbul": "~0.4.2", "jest": "^22.4.3", + "jest-cli": "^22.4.4", "lerna": "^2.0.0", "lodash": "^4.17.5", "mocha": "~2.4.5", "pre-commit": "~1.1.2", "redux-saga": "^0.14.3", + "request": "^2.87.0", "shelljs": "^0.7.7", "strapi-lint": "file:packages/strapi-lint" }, diff --git a/packages/strapi-admin/admin/src/config/manifest.json b/packages/strapi-admin/admin/src/config/manifest.json index bcfd8b9e75..7d26fdce37 100644 --- a/packages/strapi-admin/admin/src/config/manifest.json +++ b/packages/strapi-admin/admin/src/config/manifest.json @@ -1 +1 @@ -{"name":"vendor_lib","content":{"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_export.js":{"id":0,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_an-object.js":{"id":1,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_global.js":{"id":2,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_fails.js":{"id":3,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_is-object.js":{"id":4,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_wks.js":{"id":5,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_descriptors.js":{"id":6,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_object-dp.js":{"id":7,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_to-length.js":{"id":8,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_to-object.js":{"id":9,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_a-function.js":{"id":10,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_hide.js":{"id":11,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_redefine.js":{"id":12,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_string-html.js":{"id":13,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_has.js":{"id":14,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_to-iobject.js":{"id":15,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_object-gopd.js":{"id":16,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_object-gpo.js":{"id":17,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_ctx.js":{"id":18,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_cof.js":{"id":19,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_strict-method.js":{"id":20,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/react/index.js":{"id":21,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_core.js":{"id":22,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_to-primitive.js":{"id":23,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_defined.js":{"id":24,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_to-integer.js":{"id":25,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_object-sap.js":{"id":26,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_array-methods.js":{"id":27,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_typed-array.js":{"id":28,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_metadata.js":{"id":29,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/prop-types/index.js":{"id":30,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_meta.js":{"id":31,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_add-to-unscopables.js":{"id":32,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_property-desc.js":{"id":33,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_uid.js":{"id":34,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_library.js":{"id":35,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_object-keys.js":{"id":36,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_to-absolute-index.js":{"id":37,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_object-create.js":{"id":38,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_object-gopn.js":{"id":39,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_set-species.js":{"id":40,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_an-instance.js":{"id":41,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_for-of.js":{"id":42,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_redefine-all.js":{"id":43,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_set-to-string-tag.js":{"id":44,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_string-trim.js":{"id":45,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_iterators.js":{"id":46,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_validate-collection.js":{"id":47,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_iobject.js":{"id":48,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_object-pie.js":{"id":49,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_classof.js":{"id":50,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/react-dom/index.js":{"id":51,"meta":{}},"./strapi-helper-plugin/node_modules/webpack/buildin/global.js":{"id":52,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_shared.js":{"id":53,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_array-includes.js":{"id":54,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_object-gops.js":{"id":55,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_is-array.js":{"id":56,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_is-regexp.js":{"id":57,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_iter-detect.js":{"id":58,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_flags.js":{"id":59,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_fix-re-wks.js":{"id":60,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_species-constructor.js":{"id":61,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_collection.js":{"id":62,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_typed.js":{"id":63,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_object-forced-pam.js":{"id":64,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_set-collection-of.js":{"id":65,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_set-collection-from.js":{"id":66,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/fbjs/lib/invariant.js":{"id":67,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/fbjs/lib/emptyFunction.js":{"id":68,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_dom-create.js":{"id":69,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_wks-define.js":{"id":70,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_shared-key.js":{"id":71,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_enum-bug-keys.js":{"id":72,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_html.js":{"id":73,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_set-proto.js":{"id":74,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_string-ws.js":{"id":75,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_inherit-if-required.js":{"id":76,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_string-repeat.js":{"id":77,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_math-sign.js":{"id":78,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_math-expm1.js":{"id":79,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_string-at.js":{"id":80,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_iter-define.js":{"id":81,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_iter-create.js":{"id":82,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_string-context.js":{"id":83,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_fails-is-regexp.js":{"id":84,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_is-array-iter.js":{"id":85,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_create-property.js":{"id":86,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/core.get-iterator-method.js":{"id":87,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_array-species-create.js":{"id":88,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_array-fill.js":{"id":89,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.iterator.js":{"id":90,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_task.js":{"id":91,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_microtask.js":{"id":92,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_new-promise-capability.js":{"id":93,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_typed-buffer.js":{"id":94,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_user-agent.js":{"id":95,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/object-assign/index.js":{"id":96,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/fbjs/lib/emptyObject.js":{"id":97,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/intl-messageformat/src/main.js":{"id":98,"meta":{"harmonyModule":true},"exports":["default"]},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/intl-messageformat/src/utils.js":{"id":99,"meta":{"harmonyModule":true},"exports":["hop","extend"]},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/react-transition-group/Transition.js":{"id":100,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/react-transition-group/utils/PropTypes.js":{"id":101,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/react-transition-group/TransitionGroup.js":{"id":102,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_ie8-dom-define.js":{"id":103,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_wks-ext.js":{"id":104,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_object-keys-internal.js":{"id":105,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_object-dps.js":{"id":106,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_object-gopn-ext.js":{"id":107,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_object-assign.js":{"id":108,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_bind.js":{"id":109,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_invoke.js":{"id":110,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_parse-int.js":{"id":111,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_parse-float.js":{"id":112,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_a-number-value.js":{"id":113,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_is-integer.js":{"id":114,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_math-log1p.js":{"id":115,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_math-fround.js":{"id":116,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_iter-call.js":{"id":117,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_array-reduce.js":{"id":118,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_array-copy-within.js":{"id":119,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_iter-step.js":{"id":120,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.regexp.flags.js":{"id":121,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_perform.js":{"id":122,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_promise-resolve.js":{"id":123,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.map.js":{"id":124,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_collection-strong.js":{"id":125,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.set.js":{"id":126,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.weak-map.js":{"id":127,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_collection-weak.js":{"id":128,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_to-index.js":{"id":129,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_own-keys.js":{"id":130,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_flatten-into-array.js":{"id":131,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_string-pad.js":{"id":132,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_object-to-array.js":{"id":133,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_collection-to-json.js":{"id":134,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_array-from-iterable.js":{"id":135,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_math-scale.js":{"id":136,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/react/cjs/react.production.min.js":{"id":138,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/react-dom/cjs/react-dom.production.min.js":{"id":139,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/fbjs/lib/ExecutionEnvironment.js":{"id":140,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/fbjs/lib/getActiveElement.js":{"id":141,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/fbjs/lib/shallowEqual.js":{"id":142,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/fbjs/lib/containsNode.js":{"id":143,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/fbjs/lib/isTextNode.js":{"id":144,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/fbjs/lib/isNode.js":{"id":145,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/react-intl/lib/index.es.js":{"id":146,"meta":{"harmonyModule":true},"exports":["addLocaleData","intlShape","injectIntl","defineMessages","IntlProvider","FormattedDate","FormattedTime","FormattedRelative","FormattedNumber","FormattedPlural","FormattedMessage","FormattedHTMLMessage"]},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/intl-messageformat/src/core.js":{"id":148,"meta":{"harmonyModule":true},"exports":["default"]},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/intl-messageformat/src/es5.js":{"id":149,"meta":{"harmonyModule":true},"exports":["defineProperty","objCreate"]},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/intl-messageformat/src/compiler.js":{"id":150,"meta":{"harmonyModule":true},"exports":["default"]},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/intl-messageformat-parser/src/parser.js":{"id":151,"meta":{"harmonyModule":true},"exports":["default"]},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/intl-messageformat/src/en.js":{"id":152,"meta":{"harmonyModule":true},"exports":["default"]},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/intl-relativeformat/src/main.js":{"id":153,"meta":{"harmonyModule":true},"exports":["default"]},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/intl-relativeformat/src/core.js":{"id":154,"meta":{"harmonyModule":true},"exports":["default"]},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/intl-relativeformat/src/diff.js":{"id":155,"meta":{"harmonyModule":true},"exports":["default"]},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/intl-relativeformat/src/es5.js":{"id":156,"meta":{"harmonyModule":true},"exports":["defineProperty","objCreate","arrIndexOf","isArray","dateNow"]},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/intl-relativeformat/src/en.js":{"id":157,"meta":{"harmonyModule":true},"exports":["default"]},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/prop-types/factoryWithThrowingShims.js":{"id":158,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/prop-types/lib/ReactPropTypesSecret.js":{"id":159,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/invariant/browser.js":{"id":160,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/intl-format-cache/src/memoizer.js":{"id":161,"meta":{"harmonyModule":true},"exports":["default"]},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/intl-format-cache/src/es5.js":{"id":162,"meta":{"harmonyModule":true},"exports":["bind","defineProperty","objCreate"]},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/reactstrap/dist/reactstrap.es.js":{"id":163,"meta":{"harmonyModule":true},"exports":["Alert","Container","Row","Col","Navbar","NavbarBrand","NavbarToggler","Nav","NavItem","NavDropdown","NavLink","Breadcrumb","BreadcrumbItem","Button","ButtonDropdown","ButtonGroup","ButtonToolbar","Dropdown","DropdownItem","DropdownMenu","DropdownToggle","Fade","Badge","Card","CardLink","CardGroup","CardDeck","CardColumns","CardBody","CardBlock","CardFooter","CardHeader","CardImg","CardImgOverlay","Carousel","UncontrolledCarousel","CarouselControl","CarouselItem","CarouselIndicators","CarouselCaption","CardSubtitle","CardText","CardTitle","Popover","PopoverContent","PopoverBody","PopoverTitle","PopoverHeader","Progress","Modal","ModalHeader","ModalBody","ModalFooter","PopperContent","PopperTargetHelper","Tooltip","Table","ListGroup","Form","FormFeedback","FormGroup","FormText","Input","InputGroup","InputGroupAddon","InputGroupButton","InputGroupButtonDropdown","InputGroupText","Label","Media","Pagination","PaginationItem","PaginationLink","TabContent","TabPane","Jumbotron","Collapse","ListGroupItem","ListGroupItemText","ListGroupItemHeading","UncontrolledAlert","UncontrolledButtonDropdown","UncontrolledDropdown","UncontrolledNavDropdown","UncontrolledTooltip","Util"]},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/classnames/index.js":{"id":164,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/lodash.isfunction/index.js":{"id":165,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/lodash.isobject/index.js":{"id":166,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/react-popper/dist/react-popper.js":{"id":167,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/lodash.tonumber/index.js":{"id":168,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/react-transition-group/index.js":{"id":169,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/react-transition-group/CSSTransition.js":{"id":170,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/dom-helpers/class/addClass.js":{"id":171,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/dom-helpers/class/hasClass.js":{"id":172,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/dom-helpers/class/removeClass.js":{"id":173,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/react-transition-group/ReplaceTransition.js":{"id":174,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/react-transition-group/utils/ChildMapping.js":{"id":175,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/immutable/dist/immutable.js":{"id":176,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/lodash/lodash.js":{"id":177,"meta":{}},"./strapi-helper-plugin/node_modules/webpack/buildin/module.js":{"id":178,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/babel-polyfill/lib/index.js":{"id":179,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/shim.js":{"id":180,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.symbol.js":{"id":181,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_enum-keys.js":{"id":182,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.create.js":{"id":183,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.define-property.js":{"id":184,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.define-properties.js":{"id":185,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.get-own-property-descriptor.js":{"id":186,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.get-prototype-of.js":{"id":187,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.keys.js":{"id":188,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.get-own-property-names.js":{"id":189,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.freeze.js":{"id":190,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.seal.js":{"id":191,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.prevent-extensions.js":{"id":192,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.is-frozen.js":{"id":193,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.is-sealed.js":{"id":194,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.is-extensible.js":{"id":195,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.assign.js":{"id":196,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.is.js":{"id":197,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_same-value.js":{"id":198,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.set-prototype-of.js":{"id":199,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.to-string.js":{"id":200,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.function.bind.js":{"id":201,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.function.name.js":{"id":202,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.function.has-instance.js":{"id":203,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.parse-int.js":{"id":204,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.parse-float.js":{"id":205,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.number.constructor.js":{"id":206,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.number.to-fixed.js":{"id":207,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.number.to-precision.js":{"id":208,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.number.epsilon.js":{"id":209,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.number.is-finite.js":{"id":210,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.number.is-integer.js":{"id":211,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.number.is-nan.js":{"id":212,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.number.is-safe-integer.js":{"id":213,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.number.max-safe-integer.js":{"id":214,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.number.min-safe-integer.js":{"id":215,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.number.parse-float.js":{"id":216,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.number.parse-int.js":{"id":217,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.acosh.js":{"id":218,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.asinh.js":{"id":219,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.atanh.js":{"id":220,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.cbrt.js":{"id":221,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.clz32.js":{"id":222,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.cosh.js":{"id":223,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.expm1.js":{"id":224,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.fround.js":{"id":225,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.hypot.js":{"id":226,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.imul.js":{"id":227,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.log10.js":{"id":228,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.log1p.js":{"id":229,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.log2.js":{"id":230,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.sign.js":{"id":231,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.sinh.js":{"id":232,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.tanh.js":{"id":233,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.trunc.js":{"id":234,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.from-code-point.js":{"id":235,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.raw.js":{"id":236,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.trim.js":{"id":237,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.iterator.js":{"id":238,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.code-point-at.js":{"id":239,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.ends-with.js":{"id":240,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.includes.js":{"id":241,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.repeat.js":{"id":242,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.starts-with.js":{"id":243,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.anchor.js":{"id":244,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.big.js":{"id":245,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.blink.js":{"id":246,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.bold.js":{"id":247,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.fixed.js":{"id":248,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.fontcolor.js":{"id":249,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.fontsize.js":{"id":250,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.italics.js":{"id":251,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.link.js":{"id":252,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.small.js":{"id":253,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.strike.js":{"id":254,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.sub.js":{"id":255,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.sup.js":{"id":256,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.date.now.js":{"id":257,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.date.to-json.js":{"id":258,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.date.to-iso-string.js":{"id":259,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_date-to-iso-string.js":{"id":260,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.date.to-string.js":{"id":261,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.date.to-primitive.js":{"id":262,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_date-to-primitive.js":{"id":263,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.is-array.js":{"id":264,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.from.js":{"id":265,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.of.js":{"id":266,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.join.js":{"id":267,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.slice.js":{"id":268,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.sort.js":{"id":269,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.for-each.js":{"id":270,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_array-species-constructor.js":{"id":271,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.map.js":{"id":272,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.filter.js":{"id":273,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.some.js":{"id":274,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.every.js":{"id":275,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.reduce.js":{"id":276,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.reduce-right.js":{"id":277,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.index-of.js":{"id":278,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.last-index-of.js":{"id":279,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.copy-within.js":{"id":280,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.fill.js":{"id":281,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.find.js":{"id":282,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.find-index.js":{"id":283,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.species.js":{"id":284,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.regexp.constructor.js":{"id":285,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.regexp.to-string.js":{"id":286,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.regexp.match.js":{"id":287,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.regexp.replace.js":{"id":288,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.regexp.search.js":{"id":289,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.regexp.split.js":{"id":290,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.promise.js":{"id":291,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.weak-set.js":{"id":292,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.typed.array-buffer.js":{"id":293,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.typed.data-view.js":{"id":294,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.typed.int8-array.js":{"id":295,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.typed.uint8-array.js":{"id":296,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.typed.uint8-clamped-array.js":{"id":297,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.typed.int16-array.js":{"id":298,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.typed.uint16-array.js":{"id":299,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.typed.int32-array.js":{"id":300,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.typed.uint32-array.js":{"id":301,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.typed.float32-array.js":{"id":302,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.typed.float64-array.js":{"id":303,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.reflect.apply.js":{"id":304,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.reflect.construct.js":{"id":305,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.reflect.define-property.js":{"id":306,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.reflect.delete-property.js":{"id":307,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.reflect.enumerate.js":{"id":308,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.reflect.get.js":{"id":309,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.reflect.get-own-property-descriptor.js":{"id":310,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.reflect.get-prototype-of.js":{"id":311,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.reflect.has.js":{"id":312,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.reflect.is-extensible.js":{"id":313,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.reflect.own-keys.js":{"id":314,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.reflect.prevent-extensions.js":{"id":315,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.reflect.set.js":{"id":316,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.reflect.set-prototype-of.js":{"id":317,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.array.includes.js":{"id":318,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.array.flat-map.js":{"id":319,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.array.flatten.js":{"id":320,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.string.at.js":{"id":321,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.string.pad-start.js":{"id":322,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.string.pad-end.js":{"id":323,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.string.trim-left.js":{"id":324,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.string.trim-right.js":{"id":325,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.string.match-all.js":{"id":326,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.symbol.async-iterator.js":{"id":327,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.symbol.observable.js":{"id":328,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.object.get-own-property-descriptors.js":{"id":329,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.object.values.js":{"id":330,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.object.entries.js":{"id":331,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.object.define-getter.js":{"id":332,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.object.define-setter.js":{"id":333,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.object.lookup-getter.js":{"id":334,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.object.lookup-setter.js":{"id":335,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.map.to-json.js":{"id":336,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.set.to-json.js":{"id":337,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.map.of.js":{"id":338,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.set.of.js":{"id":339,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.weak-map.of.js":{"id":340,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.weak-set.of.js":{"id":341,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.map.from.js":{"id":342,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.set.from.js":{"id":343,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.weak-map.from.js":{"id":344,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.weak-set.from.js":{"id":345,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.global.js":{"id":346,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.system.global.js":{"id":347,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.error.is-error.js":{"id":348,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.math.clamp.js":{"id":349,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.math.deg-per-rad.js":{"id":350,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.math.degrees.js":{"id":351,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.math.fscale.js":{"id":352,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.math.iaddh.js":{"id":353,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.math.isubh.js":{"id":354,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.math.imulh.js":{"id":355,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.math.rad-per-deg.js":{"id":356,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.math.radians.js":{"id":357,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.math.scale.js":{"id":358,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.math.umulh.js":{"id":359,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.math.signbit.js":{"id":360,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.promise.finally.js":{"id":361,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.promise.try.js":{"id":362,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.reflect.define-metadata.js":{"id":363,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.reflect.delete-metadata.js":{"id":364,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.reflect.get-metadata.js":{"id":365,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.reflect.get-metadata-keys.js":{"id":366,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.reflect.get-own-metadata.js":{"id":367,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.reflect.get-own-metadata-keys.js":{"id":368,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.reflect.has-metadata.js":{"id":369,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.reflect.has-own-metadata.js":{"id":370,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.reflect.metadata.js":{"id":371,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.asap.js":{"id":372,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.observable.js":{"id":373,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/web.timers.js":{"id":374,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/web.immediate.js":{"id":375,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/web.dom.iterable.js":{"id":376,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/babel-polyfill/node_modules/regenerator-runtime/runtime.js":{"id":377,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/fn/regexp/escape.js":{"id":378,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/core.regexp.escape.js":{"id":379,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_replacer.js":{"id":380,"meta":{}}}} \ No newline at end of file +{"name":"vendor_lib","content":{"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_export.js":{"id":0,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_an-object.js":{"id":1,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_global.js":{"id":2,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_fails.js":{"id":3,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_is-object.js":{"id":4,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_wks.js":{"id":5,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_descriptors.js":{"id":6,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_object-dp.js":{"id":7,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_to-length.js":{"id":8,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_to-object.js":{"id":9,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_a-function.js":{"id":10,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_hide.js":{"id":11,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_redefine.js":{"id":12,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_string-html.js":{"id":13,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_has.js":{"id":14,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_to-iobject.js":{"id":15,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_object-gopd.js":{"id":16,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_object-gpo.js":{"id":17,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_core.js":{"id":18,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_ctx.js":{"id":19,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_cof.js":{"id":20,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_strict-method.js":{"id":21,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/react/index.js":{"id":22,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_to-primitive.js":{"id":23,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_defined.js":{"id":24,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_to-integer.js":{"id":25,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_object-sap.js":{"id":26,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_array-methods.js":{"id":27,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_typed-array.js":{"id":28,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_metadata.js":{"id":29,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/prop-types/index.js":{"id":30,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_meta.js":{"id":31,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_library.js":{"id":32,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_add-to-unscopables.js":{"id":33,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_property-desc.js":{"id":34,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_uid.js":{"id":35,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_object-keys.js":{"id":36,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_to-absolute-index.js":{"id":37,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_object-create.js":{"id":38,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_object-gopn.js":{"id":39,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_set-species.js":{"id":40,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_an-instance.js":{"id":41,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_for-of.js":{"id":42,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_redefine-all.js":{"id":43,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_set-to-string-tag.js":{"id":44,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_string-trim.js":{"id":45,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_iterators.js":{"id":46,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_validate-collection.js":{"id":47,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_iobject.js":{"id":48,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_object-pie.js":{"id":49,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_classof.js":{"id":50,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/react-dom/index.js":{"id":51,"meta":{}},"./strapi-helper-plugin/node_modules/webpack/buildin/global.js":{"id":52,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_shared.js":{"id":53,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_array-includes.js":{"id":54,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_object-gops.js":{"id":55,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_is-array.js":{"id":56,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_is-regexp.js":{"id":57,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_iter-detect.js":{"id":58,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_flags.js":{"id":59,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_fix-re-wks.js":{"id":60,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_species-constructor.js":{"id":61,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_user-agent.js":{"id":62,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_collection.js":{"id":63,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_typed.js":{"id":64,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_object-forced-pam.js":{"id":65,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_set-collection-of.js":{"id":66,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_set-collection-from.js":{"id":67,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/fbjs/lib/invariant.js":{"id":68,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/fbjs/lib/emptyFunction.js":{"id":69,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_dom-create.js":{"id":70,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_wks-define.js":{"id":71,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_shared-key.js":{"id":72,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_enum-bug-keys.js":{"id":73,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_html.js":{"id":74,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_set-proto.js":{"id":75,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_string-ws.js":{"id":76,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_inherit-if-required.js":{"id":77,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_string-repeat.js":{"id":78,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_math-sign.js":{"id":79,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_math-expm1.js":{"id":80,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_string-at.js":{"id":81,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_iter-define.js":{"id":82,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_iter-create.js":{"id":83,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_string-context.js":{"id":84,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_fails-is-regexp.js":{"id":85,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_is-array-iter.js":{"id":86,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_create-property.js":{"id":87,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/core.get-iterator-method.js":{"id":88,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_array-species-create.js":{"id":89,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_array-fill.js":{"id":90,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.iterator.js":{"id":91,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_task.js":{"id":92,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_microtask.js":{"id":93,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_new-promise-capability.js":{"id":94,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_typed-buffer.js":{"id":95,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/object-assign/index.js":{"id":96,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/fbjs/lib/emptyObject.js":{"id":97,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/intl-messageformat/src/main.js":{"id":98,"meta":{"harmonyModule":true},"exports":["default"]},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/intl-messageformat/src/utils.js":{"id":99,"meta":{"harmonyModule":true},"exports":["hop","extend"]},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/react-transition-group/Transition.js":{"id":100,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/react-transition-group/utils/PropTypes.js":{"id":101,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/react-transition-group/TransitionGroup.js":{"id":102,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_ie8-dom-define.js":{"id":103,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_wks-ext.js":{"id":104,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_object-keys-internal.js":{"id":105,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_object-dps.js":{"id":106,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_object-gopn-ext.js":{"id":107,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_object-assign.js":{"id":108,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_bind.js":{"id":109,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_invoke.js":{"id":110,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_parse-int.js":{"id":111,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_parse-float.js":{"id":112,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_a-number-value.js":{"id":113,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_is-integer.js":{"id":114,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_math-log1p.js":{"id":115,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_math-fround.js":{"id":116,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_iter-call.js":{"id":117,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_array-reduce.js":{"id":118,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_array-copy-within.js":{"id":119,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_iter-step.js":{"id":120,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.regexp.flags.js":{"id":121,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_perform.js":{"id":122,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_promise-resolve.js":{"id":123,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.map.js":{"id":124,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_collection-strong.js":{"id":125,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.set.js":{"id":126,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.weak-map.js":{"id":127,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_collection-weak.js":{"id":128,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_to-index.js":{"id":129,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_own-keys.js":{"id":130,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_flatten-into-array.js":{"id":131,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_string-pad.js":{"id":132,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_object-to-array.js":{"id":133,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_collection-to-json.js":{"id":134,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_array-from-iterable.js":{"id":135,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_math-scale.js":{"id":136,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/react/cjs/react.production.min.js":{"id":138,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/react-dom/cjs/react-dom.production.min.js":{"id":139,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/fbjs/lib/ExecutionEnvironment.js":{"id":140,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/fbjs/lib/getActiveElement.js":{"id":141,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/fbjs/lib/shallowEqual.js":{"id":142,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/fbjs/lib/containsNode.js":{"id":143,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/fbjs/lib/isTextNode.js":{"id":144,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/fbjs/lib/isNode.js":{"id":145,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/react-intl/lib/index.es.js":{"id":146,"meta":{"harmonyModule":true},"exports":["addLocaleData","intlShape","injectIntl","defineMessages","IntlProvider","FormattedDate","FormattedTime","FormattedRelative","FormattedNumber","FormattedPlural","FormattedMessage","FormattedHTMLMessage"]},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/intl-messageformat/src/core.js":{"id":148,"meta":{"harmonyModule":true},"exports":["default"]},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/intl-messageformat/src/es5.js":{"id":149,"meta":{"harmonyModule":true},"exports":["defineProperty","objCreate"]},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/intl-messageformat/src/compiler.js":{"id":150,"meta":{"harmonyModule":true},"exports":["default"]},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/intl-messageformat-parser/src/parser.js":{"id":151,"meta":{"harmonyModule":true},"exports":["default"]},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/intl-messageformat/src/en.js":{"id":152,"meta":{"harmonyModule":true},"exports":["default"]},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/intl-relativeformat/src/main.js":{"id":153,"meta":{"harmonyModule":true},"exports":["default"]},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/intl-relativeformat/src/core.js":{"id":154,"meta":{"harmonyModule":true},"exports":["default"]},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/intl-relativeformat/src/diff.js":{"id":155,"meta":{"harmonyModule":true},"exports":["default"]},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/intl-relativeformat/src/es5.js":{"id":156,"meta":{"harmonyModule":true},"exports":["defineProperty","objCreate","arrIndexOf","isArray","dateNow"]},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/intl-relativeformat/src/en.js":{"id":157,"meta":{"harmonyModule":true},"exports":["default"]},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/prop-types/factoryWithThrowingShims.js":{"id":158,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/prop-types/lib/ReactPropTypesSecret.js":{"id":159,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/invariant/browser.js":{"id":160,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/intl-format-cache/src/memoizer.js":{"id":161,"meta":{"harmonyModule":true},"exports":["default"]},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/intl-format-cache/src/es5.js":{"id":162,"meta":{"harmonyModule":true},"exports":["bind","defineProperty","objCreate"]},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/reactstrap/dist/reactstrap.es.js":{"id":163,"meta":{"harmonyModule":true},"exports":["Alert","Container","Row","Col","Navbar","NavbarBrand","NavbarToggler","Nav","NavItem","NavDropdown","NavLink","Breadcrumb","BreadcrumbItem","Button","ButtonDropdown","ButtonGroup","ButtonToolbar","Dropdown","DropdownItem","DropdownMenu","DropdownToggle","Fade","Badge","Card","CardLink","CardGroup","CardDeck","CardColumns","CardBody","CardBlock","CardFooter","CardHeader","CardImg","CardImgOverlay","Carousel","UncontrolledCarousel","CarouselControl","CarouselItem","CarouselIndicators","CarouselCaption","CardSubtitle","CardText","CardTitle","Popover","PopoverContent","PopoverBody","PopoverTitle","PopoverHeader","Progress","Modal","ModalHeader","ModalBody","ModalFooter","PopperContent","PopperTargetHelper","Tooltip","Table","ListGroup","Form","FormFeedback","FormGroup","FormText","Input","InputGroup","InputGroupAddon","InputGroupButton","InputGroupButtonDropdown","InputGroupText","Label","Media","Pagination","PaginationItem","PaginationLink","TabContent","TabPane","Jumbotron","Collapse","ListGroupItem","ListGroupItemText","ListGroupItemHeading","UncontrolledAlert","UncontrolledButtonDropdown","UncontrolledDropdown","UncontrolledNavDropdown","UncontrolledTooltip","Util"]},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/classnames/index.js":{"id":164,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/lodash.isfunction/index.js":{"id":165,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/lodash.isobject/index.js":{"id":166,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/react-popper/dist/react-popper.js":{"id":167,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/lodash.tonumber/index.js":{"id":168,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/react-transition-group/index.js":{"id":169,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/react-transition-group/CSSTransition.js":{"id":170,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/dom-helpers/class/addClass.js":{"id":171,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/dom-helpers/class/hasClass.js":{"id":172,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/dom-helpers/class/removeClass.js":{"id":173,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/react-transition-group/ReplaceTransition.js":{"id":174,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/react-transition-group/utils/ChildMapping.js":{"id":175,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/immutable/dist/immutable.js":{"id":176,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/lodash/lodash.js":{"id":177,"meta":{}},"./strapi-helper-plugin/node_modules/webpack/buildin/module.js":{"id":178,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/babel-polyfill/lib/index.js":{"id":179,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/shim.js":{"id":180,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.symbol.js":{"id":181,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_enum-keys.js":{"id":182,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.create.js":{"id":183,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.define-property.js":{"id":184,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.define-properties.js":{"id":185,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.get-own-property-descriptor.js":{"id":186,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.get-prototype-of.js":{"id":187,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.keys.js":{"id":188,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.get-own-property-names.js":{"id":189,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.freeze.js":{"id":190,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.seal.js":{"id":191,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.prevent-extensions.js":{"id":192,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.is-frozen.js":{"id":193,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.is-sealed.js":{"id":194,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.is-extensible.js":{"id":195,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.assign.js":{"id":196,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.is.js":{"id":197,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_same-value.js":{"id":198,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.set-prototype-of.js":{"id":199,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.object.to-string.js":{"id":200,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.function.bind.js":{"id":201,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.function.name.js":{"id":202,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.function.has-instance.js":{"id":203,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.parse-int.js":{"id":204,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.parse-float.js":{"id":205,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.number.constructor.js":{"id":206,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.number.to-fixed.js":{"id":207,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.number.to-precision.js":{"id":208,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.number.epsilon.js":{"id":209,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.number.is-finite.js":{"id":210,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.number.is-integer.js":{"id":211,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.number.is-nan.js":{"id":212,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.number.is-safe-integer.js":{"id":213,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.number.max-safe-integer.js":{"id":214,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.number.min-safe-integer.js":{"id":215,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.number.parse-float.js":{"id":216,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.number.parse-int.js":{"id":217,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.acosh.js":{"id":218,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.asinh.js":{"id":219,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.atanh.js":{"id":220,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.cbrt.js":{"id":221,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.clz32.js":{"id":222,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.cosh.js":{"id":223,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.expm1.js":{"id":224,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.fround.js":{"id":225,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.hypot.js":{"id":226,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.imul.js":{"id":227,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.log10.js":{"id":228,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.log1p.js":{"id":229,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.log2.js":{"id":230,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.sign.js":{"id":231,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.sinh.js":{"id":232,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.tanh.js":{"id":233,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.math.trunc.js":{"id":234,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.from-code-point.js":{"id":235,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.raw.js":{"id":236,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.trim.js":{"id":237,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.iterator.js":{"id":238,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.code-point-at.js":{"id":239,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.ends-with.js":{"id":240,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.includes.js":{"id":241,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.repeat.js":{"id":242,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.starts-with.js":{"id":243,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.anchor.js":{"id":244,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.big.js":{"id":245,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.blink.js":{"id":246,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.bold.js":{"id":247,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.fixed.js":{"id":248,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.fontcolor.js":{"id":249,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.fontsize.js":{"id":250,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.italics.js":{"id":251,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.link.js":{"id":252,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.small.js":{"id":253,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.strike.js":{"id":254,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.sub.js":{"id":255,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.string.sup.js":{"id":256,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.date.now.js":{"id":257,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.date.to-json.js":{"id":258,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.date.to-iso-string.js":{"id":259,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_date-to-iso-string.js":{"id":260,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.date.to-string.js":{"id":261,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.date.to-primitive.js":{"id":262,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_date-to-primitive.js":{"id":263,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.is-array.js":{"id":264,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.from.js":{"id":265,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.of.js":{"id":266,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.join.js":{"id":267,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.slice.js":{"id":268,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.sort.js":{"id":269,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.for-each.js":{"id":270,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_array-species-constructor.js":{"id":271,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.map.js":{"id":272,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.filter.js":{"id":273,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.some.js":{"id":274,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.every.js":{"id":275,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.reduce.js":{"id":276,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.reduce-right.js":{"id":277,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.index-of.js":{"id":278,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.last-index-of.js":{"id":279,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.copy-within.js":{"id":280,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.fill.js":{"id":281,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.find.js":{"id":282,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.find-index.js":{"id":283,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.array.species.js":{"id":284,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.regexp.constructor.js":{"id":285,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.regexp.to-string.js":{"id":286,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.regexp.match.js":{"id":287,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.regexp.replace.js":{"id":288,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.regexp.search.js":{"id":289,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.regexp.split.js":{"id":290,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.promise.js":{"id":291,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.weak-set.js":{"id":292,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.typed.array-buffer.js":{"id":293,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.typed.data-view.js":{"id":294,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.typed.int8-array.js":{"id":295,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.typed.uint8-array.js":{"id":296,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.typed.uint8-clamped-array.js":{"id":297,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.typed.int16-array.js":{"id":298,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.typed.uint16-array.js":{"id":299,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.typed.int32-array.js":{"id":300,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.typed.uint32-array.js":{"id":301,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.typed.float32-array.js":{"id":302,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.typed.float64-array.js":{"id":303,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.reflect.apply.js":{"id":304,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.reflect.construct.js":{"id":305,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.reflect.define-property.js":{"id":306,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.reflect.delete-property.js":{"id":307,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.reflect.enumerate.js":{"id":308,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.reflect.get.js":{"id":309,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.reflect.get-own-property-descriptor.js":{"id":310,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.reflect.get-prototype-of.js":{"id":311,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.reflect.has.js":{"id":312,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.reflect.is-extensible.js":{"id":313,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.reflect.own-keys.js":{"id":314,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.reflect.prevent-extensions.js":{"id":315,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.reflect.set.js":{"id":316,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es6.reflect.set-prototype-of.js":{"id":317,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.array.includes.js":{"id":318,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.array.flat-map.js":{"id":319,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.array.flatten.js":{"id":320,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.string.at.js":{"id":321,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.string.pad-start.js":{"id":322,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.string.pad-end.js":{"id":323,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.string.trim-left.js":{"id":324,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.string.trim-right.js":{"id":325,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.string.match-all.js":{"id":326,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.symbol.async-iterator.js":{"id":327,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.symbol.observable.js":{"id":328,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.object.get-own-property-descriptors.js":{"id":329,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.object.values.js":{"id":330,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.object.entries.js":{"id":331,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.object.define-getter.js":{"id":332,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.object.define-setter.js":{"id":333,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.object.lookup-getter.js":{"id":334,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.object.lookup-setter.js":{"id":335,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.map.to-json.js":{"id":336,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.set.to-json.js":{"id":337,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.map.of.js":{"id":338,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.set.of.js":{"id":339,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.weak-map.of.js":{"id":340,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.weak-set.of.js":{"id":341,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.map.from.js":{"id":342,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.set.from.js":{"id":343,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.weak-map.from.js":{"id":344,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.weak-set.from.js":{"id":345,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.global.js":{"id":346,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.system.global.js":{"id":347,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.error.is-error.js":{"id":348,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.math.clamp.js":{"id":349,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.math.deg-per-rad.js":{"id":350,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.math.degrees.js":{"id":351,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.math.fscale.js":{"id":352,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.math.iaddh.js":{"id":353,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.math.isubh.js":{"id":354,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.math.imulh.js":{"id":355,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.math.rad-per-deg.js":{"id":356,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.math.radians.js":{"id":357,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.math.scale.js":{"id":358,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.math.umulh.js":{"id":359,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.math.signbit.js":{"id":360,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.promise.finally.js":{"id":361,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.promise.try.js":{"id":362,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.reflect.define-metadata.js":{"id":363,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.reflect.delete-metadata.js":{"id":364,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.reflect.get-metadata.js":{"id":365,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.reflect.get-metadata-keys.js":{"id":366,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.reflect.get-own-metadata.js":{"id":367,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.reflect.get-own-metadata-keys.js":{"id":368,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.reflect.has-metadata.js":{"id":369,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.reflect.has-own-metadata.js":{"id":370,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.reflect.metadata.js":{"id":371,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.asap.js":{"id":372,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/es7.observable.js":{"id":373,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/web.timers.js":{"id":374,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/web.immediate.js":{"id":375,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/web.dom.iterable.js":{"id":376,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/babel-polyfill/node_modules/regenerator-runtime/runtime.js":{"id":377,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/fn/regexp/escape.js":{"id":378,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/core.regexp.escape.js":{"id":379,"meta":{}},"./strapi-admin/node_modules/strapi-helper-plugin/node_modules/core-js/modules/_replacer.js":{"id":380,"meta":{}}}} \ No newline at end of file diff --git a/test/helper/restart.js b/test/helper/restart.js index 1433ecfa9b..f6f55c4bfb 100644 --- a/test/helper/restart.js +++ b/test/helper/restart.js @@ -1,11 +1,16 @@ -module.exports = function (request) { - +module.exports = function (rq) { return new Promise(async (resolve) => { const ping = async () => { try { - await request.get(''); + await rq({ + url: '/', + method: 'GET', + json: true + }); + + return resolve(); } catch (err) { - if (err.response) { + if (err.statusCode) { return resolve(); } else { return setTimeout(() => { @@ -15,6 +20,8 @@ module.exports = function (request) { } }; - ping(); + setTimeout(() => { + ping(); + }, 4000); }); }; diff --git a/test/index.test.js b/test/index.test.js index b2e86f6afa..d9e953d83f 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -1,48 +1,142 @@ -const axios = require('axios'); +let request = require('request'); -const request = axios.create({ - baseURL: 'http://localhost:1337', +const form = require('./helper/generators'); +const restart = require('./helper/restart'); + +request = request.defaults({ + baseUrl: 'http://localhost:1337' }); -const params = require('./helper/generators'); -const restart = require('./helper/restart'); +const rq = (params) => { + return new Promise((resolve, reject) => { + request(params, (err, res, body) => { + if (err || res.statusCode < 200 || res.statusCode >= 300) { + return reject(err || body); + } + + return resolve(body); + }); + }); +} + +const data = {}; describe('App setup auth', () => { test( 'Register admin user', async () => { - const body = await request.post('/auth/local/register', { - username: 'admin', - email: 'admin@strapi.io', - password: 'pcw123' + const body = await rq({ + url: `/auth/local/register`, + method: 'POST', + body: { + username: 'admin', + email: 'admin@strapi.io', + password: 'pcw123' + }, + json: true }); - axios.defaults.headers.common['Authorization'] = `Bearer ${body.data.jwt}`; + request = request.defaults({ + headers: { + 'Authorization': `Bearer ${body.jwt}` + } + }); } ); }); describe('Generate test APIs', () => { beforeEach(async () => { - await restart(request); + await restart(rq); }, 60000); test( 'Create new article API', async () => { - await request.post('/content-type-builder/models', params.article); + await rq({ + url: `/content-type-builder/models`, + method: 'POST', + body: form.article, + json: true + }); } ); test( 'Create new tag API', async () => { - await request.post('/content-type-builder/models', params.tag); + await rq({ + url: `/content-type-builder/models`, + method: 'POST', + body: form.tag, + json: true + }); } ); test( 'Create new category API', async () => { - await request.post('/content-type-builder/models', params.category); + await rq({ + url: `/content-type-builder/models`, + method: 'POST', + body: form.category, + json: true + }); + } + ); +}); + +describe('Test data GET/POST/PUT/DELETE with Content Manager', () => { + beforeEach(async () => { + await restart(rq); + }, 60000); + + test( + 'Create tag news', + async () => { + await rq({ + url: `/content-manager/explorer/tag/?source=content-manager`, + method: 'POST', + formData: { + name: 'news' + } + }); + } + ); + test( + 'Create tag article', + async () => { + await rq({ + url: `/content-manager/explorer/tag/?source=content-manager`, + method: 'POST', + formData: { + name: 'content' + } + }); + } + ); + test( + 'Get tags', + async () => { + const body = await rq({ + url: `/tag`, + method: 'GET' + }); + + data.tags = JSON.parse(body); + } + ); + test( + 'Create article 1 with tag relation', + async () => { + await rq({ + url: `/content-manager/explorer/article/?source=content-manager`, + method: 'POST', + formData: { + title: 'Article 1', + content: 'My super content 1', + tags: JSON.stringify([data.tags[0]]) + } + }); } ); }); From d6b036074ef0b32edf0c117b78ab5900046ebb8e Mon Sep 17 00:00:00 2001 From: Jim Laurie Date: Fri, 25 May 2018 11:49:46 +0200 Subject: [PATCH 04/18] Add delete API tests --- .../config/layout.json | 37 ++++++++++++++++- test/index.test.js | 41 ++++++++++++++++++- 2 files changed, 76 insertions(+), 2 deletions(-) diff --git a/packages/strapi-plugin-content-manager/config/layout.json b/packages/strapi-plugin-content-manager/config/layout.json index 0967ef424b..c15ec7139b 100644 --- a/packages/strapi-plugin-content-manager/config/layout.json +++ b/packages/strapi-plugin-content-manager/config/layout.json @@ -1 +1,36 @@ -{} +{ + "article": { + "attributes": { + "title": { + "appearance": "" + }, + "content": { + "appearance": "WYSIWYG" + }, + "published": { + "appearance": "" + } + } + }, + "tag": { + "attributes": { + "name": { + "appearance": "" + } + } + }, + "category": { + "attributes": { + "name": { + "appearance": "" + } + } + }, + "artcle": { + "attributes": { + "azd": { + "appearance": "" + } + } + } +} \ No newline at end of file diff --git a/test/index.test.js b/test/index.test.js index d9e953d83f..bccb1b9eea 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -115,7 +115,7 @@ describe('Test data GET/POST/PUT/DELETE with Content Manager', () => { } ); test( - 'Get tags', + 'Get tags and get 2 entities', async () => { const body = await rq({ url: `/tag`, @@ -123,6 +123,8 @@ describe('Test data GET/POST/PUT/DELETE with Content Manager', () => { }); data.tags = JSON.parse(body); + + expect(data.tags.length).toBe(2); } ); test( @@ -140,3 +142,40 @@ describe('Test data GET/POST/PUT/DELETE with Content Manager', () => { } ); }); + +describe('Delete test APIs', () => { + beforeEach(async () => { + await restart(rq); + }, 60000); + + test( + 'Delete article API', + async () => { + await rq({ + url: `/content-type-builder/models/article`, + method: 'DELETE', + json: true + }); + } + ); + test( + 'Delete tag API', + async () => { + await rq({ + url: `/content-type-builder/models/tag`, + method: 'DELETE', + json: true + }); + } + ); + test( + 'Delete category API', + async () => { + await rq({ + url: `/content-type-builder/models/category`, + method: 'DELETE', + json: true + }); + } + ); +}); From 519f4344c983f815449fbb5d255c823006ccb699 Mon Sep 17 00:00:00 2001 From: Jim Laurie Date: Fri, 25 May 2018 16:36:50 +0200 Subject: [PATCH 05/18] Add releation update tests --- test/index.test.js | 110 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 101 insertions(+), 9 deletions(-) diff --git a/test/index.test.js b/test/index.test.js index bccb1b9eea..bb29baea3c 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -93,32 +93,46 @@ describe('Test data GET/POST/PUT/DELETE with Content Manager', () => { test( 'Create tag news', async () => { - await rq({ + let body = await rq({ url: `/content-manager/explorer/tag/?source=content-manager`, method: 'POST', formData: { name: 'news' } }); + + body = JSON.parse(body); + + expect(body._id); + expect(body.id); + expect(Array.isArray(body.articles)).toBeTruthy(); + expect(body.name).toBe('news'); } ); test( 'Create tag article', async () => { - await rq({ + let body = await rq({ url: `/content-manager/explorer/tag/?source=content-manager`, method: 'POST', formData: { name: 'content' } }); + + body = JSON.parse(body); + + expect(body._id); + expect(body.id); + expect(Array.isArray(body.articles)).toBeTruthy(); + expect(body.name).toBe('content'); } ); test( 'Get tags and get 2 entities', async () => { const body = await rq({ - url: `/tag`, + url: `/content-manager/explorer/tag?limit=10&skip=0&sort=_id&source=content-manager`, method: 'GET' }); @@ -130,15 +144,93 @@ describe('Test data GET/POST/PUT/DELETE with Content Manager', () => { test( 'Create article 1 with tag relation', async () => { - await rq({ + const entry = { + title: 'Article 1', + content: 'Content 1', + tags: JSON.stringify([data.tags[0]]), + cover: {} + }; + + let body = await rq({ url: `/content-manager/explorer/article/?source=content-manager`, method: 'POST', - formData: { - title: 'Article 1', - content: 'My super content 1', - tags: JSON.stringify([data.tags[0]]) - } + formData: entry }); + + body = JSON.parse(body); + + expect(body._id); + expect(body.id); + expect(body.title).toBe(entry.title); + expect(body.content).toBe(entry.content); + expect(Array.isArray(body.tags)).toBeTruthy(); + expect(body.tags.length).toBe(1); + expect(body.tags[0].id).toBe(data.tags[0].id); + } + ); + test( + 'Create article 2 without relation', + async () => { + const entry = { + title: 'Article 2', + content: 'My super content 1', + cover: {} + }; + + let body = await rq({ + url: `/content-manager/explorer/article/?source=content-manager`, + method: 'POST', + formData: entry + }); + + body = JSON.parse(body); + + expect(body._id); + expect(body.id); + expect(body.title).toBe(entry.title); + expect(body.content).toBe(entry.content); + expect(Array.isArray(body.tags)).toBeTruthy(); + expect(body.tags.length).toBe(0); + } + ); + test( + 'Get articles and get 2 entities', + async () => { + const body = await rq({ + url: `/content-manager/explorer/article?limit=10&skip=0&sort=_id&source=content-manager`, + method: 'GET' + }); + + data.articles = JSON.parse(body); + + expect(data.articles.length).toBe(2); + } + ); + test( + 'Update article 2 add tag relation', + async () => { + const entry = Object.assign({}, data.articles[1], { + tags: JSON.stringify([data.tags[1]]) + }); + + delete entry.updatedAt; + delete entry.createdAt; + + let body = await rq({ + url: `/content-manager/explorer/article/${entry.id}?source=content-manager`, + method: 'PUT', + formData: entry + }); + + body = JSON.parse(body); + + expect(body._id); + expect(body.id); + expect(body.title).toBe(entry.title); + expect(body.content).toBe(entry.content); + expect(Array.isArray(body.tags)).toBeTruthy(); + expect(body.tags.length).toBe(1); + expect(body.tags[0].id).toBe(data.tags[1].id); } ); }); From 9954905f44edc578e4f1d7485c0ae49b9483da81 Mon Sep 17 00:00:00 2001 From: Jim Laurie Date: Tue, 29 May 2018 10:25:17 +0200 Subject: [PATCH 06/18] Test manyToMany relations --- test/helper/generators.json | 10 -- test/index.test.js | 202 +++++++++++++++++++++++++++++------- 2 files changed, 162 insertions(+), 50 deletions(-) diff --git a/test/helper/generators.json b/test/helper/generators.json index 878fb8512d..30e31947fb 100644 --- a/test/helper/generators.json +++ b/test/helper/generators.json @@ -31,16 +31,6 @@ "type":"boolean" } }, - { - "name":"cover", - "params":{ - "appearance":{ - "WYSIWYG":false - }, - "multiple":false, - "type":"media" - } - }, { "name":"author", "params":{ diff --git a/test/index.test.js b/test/index.test.js index bb29baea3c..38c7afcd53 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -85,19 +85,19 @@ describe('Generate test APIs', () => { ); }); -describe('Test data GET/POST/PUT/DELETE with Content Manager', () => { +describe('Test manyToMany relation (article - tag) with Content Manager', () => { beforeEach(async () => { await restart(rq); }, 60000); test( - 'Create tag news', + 'Create tag1', async () => { let body = await rq({ url: `/content-manager/explorer/tag/?source=content-manager`, method: 'POST', formData: { - name: 'news' + name: 'tag1' } }); @@ -106,17 +106,17 @@ describe('Test data GET/POST/PUT/DELETE with Content Manager', () => { expect(body._id); expect(body.id); expect(Array.isArray(body.articles)).toBeTruthy(); - expect(body.name).toBe('news'); + expect(body.name).toBe('tag1'); } ); test( - 'Create tag article', + 'Create tag2', async () => { let body = await rq({ url: `/content-manager/explorer/tag/?source=content-manager`, method: 'POST', formData: { - name: 'content' + name: 'tag2' } }); @@ -125,11 +125,30 @@ describe('Test data GET/POST/PUT/DELETE with Content Manager', () => { expect(body._id); expect(body.id); expect(Array.isArray(body.articles)).toBeTruthy(); - expect(body.name).toBe('content'); + expect(body.name).toBe('tag2'); } ); test( - 'Get tags and get 2 entities', + 'Create tag3', + async () => { + let body = await rq({ + url: `/content-manager/explorer/tag/?source=content-manager`, + method: 'POST', + formData: { + name: 'tag3' + } + }); + + body = JSON.parse(body); + + expect(body._id); + expect(body.id); + expect(Array.isArray(body.articles)).toBeTruthy(); + expect(body.name).toBe('tag3'); + } + ); + test( + 'Get tags and get 3 entities', async () => { const body = await rq({ url: `/content-manager/explorer/tag?limit=10&skip=0&sort=_id&source=content-manager`, @@ -138,17 +157,40 @@ describe('Test data GET/POST/PUT/DELETE with Content Manager', () => { data.tags = JSON.parse(body); - expect(data.tags.length).toBe(2); + expect(data.tags.length).toBe(3); } ); test( - 'Create article 1 with tag relation', + 'Create article1 without relation', async () => { const entry = { title: 'Article 1', - content: 'Content 1', - tags: JSON.stringify([data.tags[0]]), - cover: {} + content: 'My super content 1' + }; + + let body = await rq({ + url: `/content-manager/explorer/article/?source=content-manager`, + method: 'POST', + formData: entry + }); + + body = JSON.parse(body); + + expect(body._id); + expect(body.id); + expect(body.title).toBe(entry.title); + expect(body.content).toBe(entry.content); + expect(Array.isArray(body.tags)).toBeTruthy(); + expect(body.tags.length).toBe(0); + } + ); + test( + 'Create article2 with tag1', + async () => { + const entry = { + title: 'Article 2', + content: 'Content 2', + tags: JSON.stringify([data.tags[0]]) }; let body = await rq({ @@ -168,31 +210,6 @@ describe('Test data GET/POST/PUT/DELETE with Content Manager', () => { expect(body.tags[0].id).toBe(data.tags[0].id); } ); - test( - 'Create article 2 without relation', - async () => { - const entry = { - title: 'Article 2', - content: 'My super content 1', - cover: {} - }; - - let body = await rq({ - url: `/content-manager/explorer/article/?source=content-manager`, - method: 'POST', - formData: entry - }); - - body = JSON.parse(body); - - expect(body._id); - expect(body.id); - expect(body.title).toBe(entry.title); - expect(body.content).toBe(entry.content); - expect(Array.isArray(body.tags)).toBeTruthy(); - expect(body.tags.length).toBe(0); - } - ); test( 'Get articles and get 2 entities', async () => { @@ -207,9 +224,9 @@ describe('Test data GET/POST/PUT/DELETE with Content Manager', () => { } ); test( - 'Update article 2 add tag relation', + 'Update article1 add tag2', async () => { - const entry = Object.assign({}, data.articles[1], { + const entry = Object.assign({}, data.articles[0], { tags: JSON.stringify([data.tags[1]]) }); @@ -233,6 +250,111 @@ describe('Test data GET/POST/PUT/DELETE with Content Manager', () => { expect(body.tags[0].id).toBe(data.tags[1].id); } ); + test( + 'Get article1', + async () => { + const body = await rq({ + url: `/content-manager/explorer/article/${data.articles[0].id}?source=content-manager`, + method: 'GET' + }); + + data.articles[0] = JSON.parse(body); + + expect(data.articles[0].id).toBeDefined(); + } + ); + test( + 'Update article1 add tag1 and tag3', + async () => { + const entry = Object.assign({}, data.articles[0]); + entry.tags.push(data.tags[0]); + entry.tags.push(data.tags[2]); + entry.tags = JSON.stringify(entry.tags); + + delete entry.updatedAt; + delete entry.createdAt; + + let body = await rq({ + url: `/content-manager/explorer/article/${entry.id}?source=content-manager`, + method: 'PUT', + formData: entry + }); + + body = JSON.parse(body); + + expect(body._id); + expect(body.id); + expect(body.title).toBe(entry.title); + expect(body.content).toBe(entry.content); + expect(Array.isArray(body.tags)).toBeTruthy(); + expect(body.tags.length).toBe(3); + } + ); + test( + 'Get article1', + async () => { + const body = await rq({ + url: `/content-manager/explorer/article/${data.articles[0].id}?source=content-manager`, + method: 'GET' + }); + + data.articles[0] = JSON.parse(body); + + expect(data.articles[0].id).toBeDefined(); + } + ); + test( + 'Update article1 remove one tag', + async () => { + const entry = Object.assign({}, data.articles[0]); + entry.tags = entry.tags.slice(1); + entry.tags = JSON.stringify(entry.tags); + + delete entry.updatedAt; + delete entry.createdAt; + + let body = await rq({ + url: `/content-manager/explorer/article/${entry.id}?source=content-manager`, + method: 'PUT', + formData: entry + }); + + body = JSON.parse(body); + + expect(body._id); + expect(body.id); + expect(body.title).toBe(entry.title); + expect(body.content).toBe(entry.content); + expect(Array.isArray(body.tags)).toBeTruthy(); + expect(body.tags.length).toBe(2); + } + ); + test( + 'Update article1 remove all tag', + async () => { + const entry = Object.assign({}, data.articles[0], { + tags: JSON.stringify([]) + }); + + delete entry.updatedAt; + delete entry.createdAt; + + let body = await rq({ + url: `/content-manager/explorer/article/${entry.id}?source=content-manager`, + method: 'PUT', + formData: entry + }); + + body = JSON.parse(body); + + expect(body._id); + expect(body.id); + expect(body.title).toBe(entry.title); + expect(body.content).toBe(entry.content); + expect(Array.isArray(body.tags)).toBeTruthy(); + expect(body.tags.length).toBe(0); + } + ); }); describe('Delete test APIs', () => { From 50c30c79f412a2e2879e00adfdb14ae4a87c9f20 Mon Sep 17 00:00:00 2001 From: Jim Laurie Date: Tue, 29 May 2018 16:30:29 +0200 Subject: [PATCH 07/18] Add oneToMany test and describe data independence --- test/helper/generators.json | 10 -- test/index.test.js | 302 +++++++++++++++++++++++++++++------- 2 files changed, 243 insertions(+), 69 deletions(-) diff --git a/test/helper/generators.json b/test/helper/generators.json index 30e31947fb..c32625775c 100644 --- a/test/helper/generators.json +++ b/test/helper/generators.json @@ -86,16 +86,6 @@ "type":"string" } }, - { - "name":"images", - "params":{ - "appearance":{ - "WYSIWYG":false - }, - "multiple":true, - "type":"media" - } - }, { "name":"articles", "params":{ diff --git a/test/index.test.js b/test/index.test.js index 38c7afcd53..0214ccec4a 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -7,7 +7,14 @@ request = request.defaults({ baseUrl: 'http://localhost:1337' }); -const rq = (params) => { +const rq = (options) => { + const params = JSON.parse(JSON.stringify(options)); + + for (let key in params.formData) { + if (typeof params.formData[key] === 'object') { + params.formData[key] = JSON.stringify(params.formData[key]); + } + } return new Promise((resolve, reject) => { request(params, (err, res, body) => { if (err || res.statusCode < 200 || res.statusCode >= 300) { @@ -19,7 +26,7 @@ const rq = (params) => { }); } -const data = {}; +let data; describe('App setup auth', () => { test( @@ -86,6 +93,13 @@ describe('Generate test APIs', () => { }); describe('Test manyToMany relation (article - tag) with Content Manager', () => { + beforeAll(() => { + data = { + articles: [], + tags: [] + }; + }); + beforeEach(async () => { await restart(rq); }, 60000); @@ -103,6 +117,8 @@ describe('Test manyToMany relation (article - tag) with Content Manager', () => body = JSON.parse(body); + data.tags.push(body); + expect(body._id); expect(body.id); expect(Array.isArray(body.articles)).toBeTruthy(); @@ -122,6 +138,8 @@ describe('Test manyToMany relation (article - tag) with Content Manager', () => body = JSON.parse(body); + data.tags.push(body); + expect(body._id); expect(body.id); expect(Array.isArray(body.articles)).toBeTruthy(); @@ -141,25 +159,14 @@ describe('Test manyToMany relation (article - tag) with Content Manager', () => body = JSON.parse(body); + data.tags.push(body); + expect(body._id); expect(body.id); expect(Array.isArray(body.articles)).toBeTruthy(); expect(body.name).toBe('tag3'); } ); - test( - 'Get tags and get 3 entities', - async () => { - const body = await rq({ - url: `/content-manager/explorer/tag?limit=10&skip=0&sort=_id&source=content-manager`, - method: 'GET' - }); - - data.tags = JSON.parse(body); - - expect(data.tags.length).toBe(3); - } - ); test( 'Create article1 without relation', async () => { @@ -176,6 +183,8 @@ describe('Test manyToMany relation (article - tag) with Content Manager', () => body = JSON.parse(body); + data.articles.push(body); + expect(body._id); expect(body.id); expect(body.title).toBe(entry.title); @@ -190,7 +199,7 @@ describe('Test manyToMany relation (article - tag) with Content Manager', () => const entry = { title: 'Article 2', content: 'Content 2', - tags: JSON.stringify([data.tags[0]]) + tags: [data.tags[0]] }; let body = await rq({ @@ -201,6 +210,8 @@ describe('Test manyToMany relation (article - tag) with Content Manager', () => body = JSON.parse(body); + data.articles.push(body); + expect(body._id); expect(body.id); expect(body.title).toBe(entry.title); @@ -210,24 +221,11 @@ describe('Test manyToMany relation (article - tag) with Content Manager', () => expect(body.tags[0].id).toBe(data.tags[0].id); } ); - test( - 'Get articles and get 2 entities', - async () => { - const body = await rq({ - url: `/content-manager/explorer/article?limit=10&skip=0&sort=_id&source=content-manager`, - method: 'GET' - }); - - data.articles = JSON.parse(body); - - expect(data.articles.length).toBe(2); - } - ); test( 'Update article1 add tag2', async () => { const entry = Object.assign({}, data.articles[0], { - tags: JSON.stringify([data.tags[1]]) + tags: [data.tags[1]] }); delete entry.updatedAt; @@ -241,6 +239,8 @@ describe('Test manyToMany relation (article - tag) with Content Manager', () => body = JSON.parse(body); + data.articles[0] = body; + expect(body._id); expect(body.id); expect(body.title).toBe(entry.title); @@ -250,26 +250,12 @@ describe('Test manyToMany relation (article - tag) with Content Manager', () => expect(body.tags[0].id).toBe(data.tags[1].id); } ); - test( - 'Get article1', - async () => { - const body = await rq({ - url: `/content-manager/explorer/article/${data.articles[0].id}?source=content-manager`, - method: 'GET' - }); - - data.articles[0] = JSON.parse(body); - - expect(data.articles[0].id).toBeDefined(); - } - ); test( 'Update article1 add tag1 and tag3', async () => { const entry = Object.assign({}, data.articles[0]); entry.tags.push(data.tags[0]); entry.tags.push(data.tags[2]); - entry.tags = JSON.stringify(entry.tags); delete entry.updatedAt; delete entry.createdAt; @@ -282,6 +268,8 @@ describe('Test manyToMany relation (article - tag) with Content Manager', () => body = JSON.parse(body); + data.articles[0] = body; + expect(body._id); expect(body.id); expect(body.title).toBe(entry.title); @@ -290,25 +278,11 @@ describe('Test manyToMany relation (article - tag) with Content Manager', () => expect(body.tags.length).toBe(3); } ); - test( - 'Get article1', - async () => { - const body = await rq({ - url: `/content-manager/explorer/article/${data.articles[0].id}?source=content-manager`, - method: 'GET' - }); - - data.articles[0] = JSON.parse(body); - - expect(data.articles[0].id).toBeDefined(); - } - ); test( 'Update article1 remove one tag', async () => { const entry = Object.assign({}, data.articles[0]); entry.tags = entry.tags.slice(1); - entry.tags = JSON.stringify(entry.tags); delete entry.updatedAt; delete entry.createdAt; @@ -321,6 +295,8 @@ describe('Test manyToMany relation (article - tag) with Content Manager', () => body = JSON.parse(body); + data.articles[0] = body; + expect(body._id); expect(body.id); expect(body.title).toBe(entry.title); @@ -333,7 +309,7 @@ describe('Test manyToMany relation (article - tag) with Content Manager', () => 'Update article1 remove all tag', async () => { const entry = Object.assign({}, data.articles[0], { - tags: JSON.stringify([]) + tags: [] }); delete entry.updatedAt; @@ -347,6 +323,8 @@ describe('Test manyToMany relation (article - tag) with Content Manager', () => body = JSON.parse(body); + data.articles[0] = body; + expect(body._id); expect(body.id); expect(body.title).toBe(entry.title); @@ -357,6 +335,212 @@ describe('Test manyToMany relation (article - tag) with Content Manager', () => ); }); +describe('Test oneToMany - manyToOne relation (article - category) with Content Manager', () => { + beforeAll(() => { + data = { + articles: [], + categories: [] + }; + }); + + beforeEach(async () => { + await restart(rq); + }, 60000); + + test( + 'Create cat1', + async () => { + let body = await rq({ + url: `/content-manager/explorer/category/?source=content-manager`, + method: 'POST', + formData: { + name: 'cat1' + } + }); + + body = JSON.parse(body); + + data.categories.push(body); + + expect(body._id); + expect(body.id); + expect(Array.isArray(body.articles)).toBeTruthy(); + expect(body.name).toBe('cat1'); + } + ); + test( + 'Create cat2', + async () => { + let body = await rq({ + url: `/content-manager/explorer/category/?source=content-manager`, + method: 'POST', + formData: { + name: 'cat2' + } + }); + + body = JSON.parse(body); + + data.categories.push(body); + + expect(body._id); + expect(body.id); + expect(Array.isArray(body.articles)).toBeTruthy(); + expect(body.name).toBe('cat2'); + } + ); + test( + 'Create article1 with cat1', + async () => { + const entry = { + title: 'Article 3', + content: 'Content 3', + category: data.categories[0] + }; + + let body = await rq({ + url: `/content-manager/explorer/article/?source=content-manager`, + method: 'POST', + formData: entry + }); + + body = JSON.parse(body); + + data.articles.push(body); + + expect(body._id); + expect(body.id); + expect(body.title).toBe(entry.title); + expect(body.content).toBe(entry.content); + expect(body.category.name).toBe(entry.category.name); + expect(Array.isArray(body.tags)).toBeTruthy(); + } + ); + test( + 'Update article1 with cat2', + async () => { + const entry = Object.assign({}, data.articles[0], { + category: data.categories[1] + }); + + let body = await rq({ + url: `/content-manager/explorer/article/${entry.id}?source=content-manager`, + method: 'PUT', + formData: entry + }); + + body = JSON.parse(body); + + data.articles[0] = body; + + expect(body._id); + expect(body.id); + expect(body.title).toBe(entry.title); + expect(body.content).toBe(entry.content); + expect(body.category.name).toBe(entry.category.name); + expect(Array.isArray(body.tags)).toBeTruthy(); + } + ); + test( + 'Create article2', + async () => { + const entry = { + title: 'Article 4', + content: 'Content 4', + }; + + let body = await rq({ + url: `/content-manager/explorer/article?source=content-manager`, + method: 'POST', + formData: entry + }); + + body = JSON.parse(body); + + data.articles.push(body); + + expect(body._id); + expect(body.id); + expect(body.title).toBe(entry.title); + expect(body.content).toBe(entry.content); + expect(Array.isArray(body.tags)).toBeTruthy(); + } + ); + test( + 'Update article2 with cat2', + async () => { + const entry = Object.assign({}, data.articles[1], { + category: data.categories[1] + }); + + let body = await rq({ + url: `/content-manager/explorer/article/${entry.id}?source=content-manager`, + method: 'PUT', + formData: entry + }); + + body = JSON.parse(body); + + data.articles[1] = body; + + expect(body._id); + expect(body.id); + expect(body.title).toBe(entry.title); + expect(body.content).toBe(entry.content); + expect(body.category.name).toBe(entry.category.name); + expect(Array.isArray(body.tags)).toBeTruthy(); + } + ); + test( + 'Update cat1 with article article1', + async () => { + const entry = Object.assign({}, data.categories[0]); + entry.articles.push(data.articles[0]); + + let body = await rq({ + url: `/content-manager/explorer/category/${entry.id}?source=content-manager`, + method: 'PUT', + formData: entry + }); + + body = JSON.parse(body); + + data.categories[0] = body; + + expect(body._id); + expect(body.id); + expect(Array.isArray(body.articles)).toBeTruthy(); + expect(body.articles.length).toBe(1); + expect(body.name).toBe(entry.name); + } + ); + test( + 'Create cat3 with article1', + async () => { + const entry = { + name: 'cat3', + articles: [data.articles[0]] + }; + + let body = await rq({ + url: `/content-manager/explorer/category/?source=content-manager`, + method: 'POST', + formData: entry + }); + + body = JSON.parse(body); + + data.categories.push(body); + + expect(body._id); + expect(body.id); + expect(Array.isArray(body.articles)).toBeTruthy(); + expect(body.articles.length).toBe(1); + expect(body.name).toBe(entry.name); + } + ); +}); + describe('Delete test APIs', () => { beforeEach(async () => { await restart(rq); From fbfdbf4812535d922ac6fdc6e25f1fd9a3a92f98 Mon Sep 17 00:00:00 2001 From: Jim Laurie Date: Tue, 29 May 2018 18:22:02 +0200 Subject: [PATCH 08/18] Add oneToOne tests --- .../config/layout.json | 7 + test/helper/generators.json | 26 ++++ test/index.test.js | 136 +++++++++++++++--- 3 files changed, 150 insertions(+), 19 deletions(-) diff --git a/packages/strapi-plugin-content-manager/config/layout.json b/packages/strapi-plugin-content-manager/config/layout.json index c15ec7139b..390d3e34cf 100644 --- a/packages/strapi-plugin-content-manager/config/layout.json +++ b/packages/strapi-plugin-content-manager/config/layout.json @@ -32,5 +32,12 @@ "appearance": "" } } + }, + "reference": { + "attributes": { + "name": { + "appearance": "" + } + } } } \ No newline at end of file diff --git a/test/helper/generators.json b/test/helper/generators.json index c32625775c..6e452e99f1 100644 --- a/test/helper/generators.json +++ b/test/helper/generators.json @@ -99,5 +99,31 @@ "name":"category", "description":"", "collectionName":"" + }, + "reference": { + "attributes":[ + { + "name":"name", + "params":{ + "appearance":{ + "WYSIWYG":false + }, + "multiple":false, + "type":"string" + } + }, + { + "name":"article", + "params":{ + "target":"article", + "key":"reference", + "nature":"oneToOne" + } + } + ], + "connection":"default", + "name":"reference", + "description":"", + "collectionName":"" } } diff --git a/test/index.test.js b/test/index.test.js index 0214ccec4a..bf4c086aed 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -90,6 +90,17 @@ describe('Generate test APIs', () => { }); } ); + test( + 'Create new reference API', + async () => { + await rq({ + url: `/content-type-builder/models`, + method: 'POST', + body: form.reference, + json: true + }); + } + ); }); describe('Test manyToMany relation (article - tag) with Content Manager', () => { @@ -119,7 +130,6 @@ describe('Test manyToMany relation (article - tag) with Content Manager', () => data.tags.push(body); - expect(body._id); expect(body.id); expect(Array.isArray(body.articles)).toBeTruthy(); expect(body.name).toBe('tag1'); @@ -140,7 +150,6 @@ describe('Test manyToMany relation (article - tag) with Content Manager', () => data.tags.push(body); - expect(body._id); expect(body.id); expect(Array.isArray(body.articles)).toBeTruthy(); expect(body.name).toBe('tag2'); @@ -161,7 +170,6 @@ describe('Test manyToMany relation (article - tag) with Content Manager', () => data.tags.push(body); - expect(body._id); expect(body.id); expect(Array.isArray(body.articles)).toBeTruthy(); expect(body.name).toBe('tag3'); @@ -185,7 +193,6 @@ describe('Test manyToMany relation (article - tag) with Content Manager', () => data.articles.push(body); - expect(body._id); expect(body.id); expect(body.title).toBe(entry.title); expect(body.content).toBe(entry.content); @@ -212,7 +219,6 @@ describe('Test manyToMany relation (article - tag) with Content Manager', () => data.articles.push(body); - expect(body._id); expect(body.id); expect(body.title).toBe(entry.title); expect(body.content).toBe(entry.content); @@ -241,7 +247,6 @@ describe('Test manyToMany relation (article - tag) with Content Manager', () => data.articles[0] = body; - expect(body._id); expect(body.id); expect(body.title).toBe(entry.title); expect(body.content).toBe(entry.content); @@ -270,7 +275,6 @@ describe('Test manyToMany relation (article - tag) with Content Manager', () => data.articles[0] = body; - expect(body._id); expect(body.id); expect(body.title).toBe(entry.title); expect(body.content).toBe(entry.content); @@ -297,7 +301,6 @@ describe('Test manyToMany relation (article - tag) with Content Manager', () => data.articles[0] = body; - expect(body._id); expect(body.id); expect(body.title).toBe(entry.title); expect(body.content).toBe(entry.content); @@ -325,7 +328,6 @@ describe('Test manyToMany relation (article - tag) with Content Manager', () => data.articles[0] = body; - expect(body._id); expect(body.id); expect(body.title).toBe(entry.title); expect(body.content).toBe(entry.content); @@ -362,7 +364,6 @@ describe('Test oneToMany - manyToOne relation (article - category) with Content data.categories.push(body); - expect(body._id); expect(body.id); expect(Array.isArray(body.articles)).toBeTruthy(); expect(body.name).toBe('cat1'); @@ -383,7 +384,6 @@ describe('Test oneToMany - manyToOne relation (article - category) with Content data.categories.push(body); - expect(body._id); expect(body.id); expect(Array.isArray(body.articles)).toBeTruthy(); expect(body.name).toBe('cat2'); @@ -408,7 +408,6 @@ describe('Test oneToMany - manyToOne relation (article - category) with Content data.articles.push(body); - expect(body._id); expect(body.id); expect(body.title).toBe(entry.title); expect(body.content).toBe(entry.content); @@ -433,7 +432,6 @@ describe('Test oneToMany - manyToOne relation (article - category) with Content data.articles[0] = body; - expect(body._id); expect(body.id); expect(body.title).toBe(entry.title); expect(body.content).toBe(entry.content); @@ -446,7 +444,7 @@ describe('Test oneToMany - manyToOne relation (article - category) with Content async () => { const entry = { title: 'Article 4', - content: 'Content 4', + content: 'Content 4' }; let body = await rq({ @@ -459,7 +457,6 @@ describe('Test oneToMany - manyToOne relation (article - category) with Content data.articles.push(body); - expect(body._id); expect(body.id); expect(body.title).toBe(entry.title); expect(body.content).toBe(entry.content); @@ -483,7 +480,6 @@ describe('Test oneToMany - manyToOne relation (article - category) with Content data.articles[1] = body; - expect(body._id); expect(body.id); expect(body.title).toBe(entry.title); expect(body.content).toBe(entry.content); @@ -492,7 +488,7 @@ describe('Test oneToMany - manyToOne relation (article - category) with Content } ); test( - 'Update cat1 with article article1', + 'Update cat1 with article1', async () => { const entry = Object.assign({}, data.categories[0]); entry.articles.push(data.articles[0]); @@ -507,7 +503,6 @@ describe('Test oneToMany - manyToOne relation (article - category) with Content data.categories[0] = body; - expect(body._id); expect(body.id); expect(Array.isArray(body.articles)).toBeTruthy(); expect(body.articles.length).toBe(1); @@ -532,7 +527,6 @@ describe('Test oneToMany - manyToOne relation (article - category) with Content data.categories.push(body); - expect(body._id); expect(body.id); expect(Array.isArray(body.articles)).toBeTruthy(); expect(body.articles.length).toBe(1); @@ -541,6 +535,110 @@ describe('Test oneToMany - manyToOne relation (article - category) with Content ); }); +describe('Test oneToOne relation (article - reference) with Content Manager', () => { + beforeAll(() => { + data = { + articles: [], + references: [] + }; + }); + + beforeEach(async () => { + await restart(rq); + }, 60000); + + test( + 'Create ref1', + async () => { + let body = await rq({ + url: `/content-manager/explorer/reference/?source=content-manager`, + method: 'POST', + formData: { + name: 'ref1' + } + }); + + body = JSON.parse(body); + + data.references.push(body); + + expect(body.id); + expect(body.name).toBe('ref1'); + } + ); + test( + 'Create article1', + async () => { + const entry = { + title: 'Article 1', + content: 'Content 1' + }; + + let body = await rq({ + url: `/content-manager/explorer/article?source=content-manager`, + method: 'POST', + formData: entry + }); + + body = JSON.parse(body); + + data.articles.push(body); + + expect(body.id); + expect(body.title).toBe(entry.title); + expect(body.content).toBe(entry.content); + } + ); + test( + 'Update article1 with ref1', + async () => { + const entry = Object.assign({}, data.articles[0], { + reference: data.references[0] + }); + + let body = await rq({ + url: `/content-manager/explorer/article/${entry.id}?source=content-manager`, + method: 'PUT', + formData: entry + }); + + body = JSON.parse(body); + + data.articles[0] = body; + + expect(body.id); + expect(body.title).toBe(entry.title); + expect(body.content).toBe(entry.content); + expect(body.reference.name).toBe(entry.reference.name); + } + ); + test( + 'Create article2 with ref1', + async () => { + const entry = { + title: 'Article 2', + content: 'Content 2', + reference: data.references[0] + }; + + let body = await rq({ + url: `/content-manager/explorer/article?source=content-manager`, + method: 'POST', + formData: entry + }); + + body = JSON.parse(body); + + data.articles.push(body); + + expect(body.id); + expect(body.title).toBe(entry.title); + expect(body.content).toBe(entry.content); + expect(body.reference.name).toBe(entry.reference.name); + } + ); +}); + describe('Delete test APIs', () => { beforeEach(async () => { await restart(rq); From 480f69c36f6f71ade0dff948cb8050a8f1b0e172 Mon Sep 17 00:00:00 2001 From: Jim Laurie Date: Wed, 30 May 2018 14:06:19 +0200 Subject: [PATCH 09/18] Fix cors on option request fix #914 --- packages/strapi-mongoose/lib/index.js | 2 +- packages/strapi/lib/middlewares/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/strapi-mongoose/lib/index.js b/packages/strapi-mongoose/lib/index.js index ffa26506de..6380b2b779 100755 --- a/packages/strapi-mongoose/lib/index.js +++ b/packages/strapi-mongoose/lib/index.js @@ -76,7 +76,7 @@ module.exports = function (strapi) { instance.connect(uri || `mongodb://${host}:${port}/${database}`, connectOptions); for (let key in options) { - instance.set(key, options[key]) + instance.set(key, options[key]); } // Handle error diff --git a/packages/strapi/lib/middlewares/index.js b/packages/strapi/lib/middlewares/index.js index 84620da5e9..b06fb0c58c 100755 --- a/packages/strapi/lib/middlewares/index.js +++ b/packages/strapi/lib/middlewares/index.js @@ -6,7 +6,7 @@ const { after, includes, indexOf, drop, dropRight, uniq, defaultsDeep, get, set, module.exports = async function() { // Set if is admin destination for middleware application. this.app.use(async (ctx, next) => { - if (ctx.request.header['origin'] === 'http://localhost:4000' || ctx.request.method === 'OPTIONS') { + if (ctx.request.header['origin'] === 'http://localhost:4000') { ctx.request.header['x-forwarded-host'] = 'strapi'; } From 5d8a24a010dca039b793bfa2ac99bac685635f3d Mon Sep 17 00:00:00 2001 From: Jim Laurie Date: Thu, 31 May 2018 12:03:24 +0200 Subject: [PATCH 10/18] Fix add multi column for mysql fix #1241 --- packages/strapi-bookshelf/lib/index.js | 9 +++++++-- packages/strapi-mongoose/lib/index.js | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/strapi-bookshelf/lib/index.js b/packages/strapi-bookshelf/lib/index.js index be0cdfaa0c..e88257fef0 100755 --- a/packages/strapi-bookshelf/lib/index.js +++ b/packages/strapi-bookshelf/lib/index.js @@ -431,9 +431,14 @@ module.exports = function(strapi) { const queries = columns.reduce((acc, attribute) => { acc.push(`ALTER TABLE ${quote}${table}${quote} ADD ${attribute};`); return acc; - }, []).join('\n\r'); + }, []); - await ORM.knex.raw(queries); + await Promise.all(queries.map(query => + new Promise(async (resolve) => { + await ORM.knex.raw(query); + resolve(); + }) + )); } // Execute query to update column type diff --git a/packages/strapi-mongoose/lib/index.js b/packages/strapi-mongoose/lib/index.js index ffa26506de..6380b2b779 100755 --- a/packages/strapi-mongoose/lib/index.js +++ b/packages/strapi-mongoose/lib/index.js @@ -76,7 +76,7 @@ module.exports = function (strapi) { instance.connect(uri || `mongodb://${host}:${port}/${database}`, connectOptions); for (let key in options) { - instance.set(key, options[key]) + instance.set(key, options[key]); } // Handle error From 676334d03dce997bcef75da19d32cc7fb039f6a4 Mon Sep 17 00:00:00 2001 From: Jim Laurie Date: Fri, 1 Jun 2018 14:31:30 +0200 Subject: [PATCH 11/18] Launch test with mongo postgres and mysql --- packages/strapi-bookshelf/lib/relations.js | 6 ++++- test/index.test.js | 29 +++++++++++++--------- test/start.js | 26 +++++++++++++------ 3 files changed, 41 insertions(+), 20 deletions(-) diff --git a/packages/strapi-bookshelf/lib/relations.js b/packages/strapi-bookshelf/lib/relations.js index cfb3f1ab2d..73a3f2ef63 100644 --- a/packages/strapi-bookshelf/lib/relations.js +++ b/packages/strapi-bookshelf/lib/relations.js @@ -179,7 +179,11 @@ module.exports = { ); }); } else if (_.get(this._attributes, `${current}.isVirtual`) !== true) { - acc[current] = params.values[current]; + if (typeof params.values[current] === 'object') { + acc[current] = _.get(params.values[current], this.primaryKey); + } else { + acc[current] = params.values[current]; + } } break; diff --git a/test/index.test.js b/test/index.test.js index bf4c086aed..d600825301 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -26,6 +26,13 @@ const rq = (options) => { }); } +const cleanDate = (entry) => { + delete entry.updatedAt; + delete entry.createdAt; + delete entry.created_at; + delete entry.updated_at; +}; + let data; describe('App setup auth', () => { @@ -234,8 +241,7 @@ describe('Test manyToMany relation (article - tag) with Content Manager', () => tags: [data.tags[1]] }); - delete entry.updatedAt; - delete entry.createdAt; + cleanDate(entry); let body = await rq({ url: `/content-manager/explorer/article/${entry.id}?source=content-manager`, @@ -262,8 +268,7 @@ describe('Test manyToMany relation (article - tag) with Content Manager', () => entry.tags.push(data.tags[0]); entry.tags.push(data.tags[2]); - delete entry.updatedAt; - delete entry.createdAt; + cleanDate(entry); let body = await rq({ url: `/content-manager/explorer/article/${entry.id}?source=content-manager`, @@ -288,8 +293,7 @@ describe('Test manyToMany relation (article - tag) with Content Manager', () => const entry = Object.assign({}, data.articles[0]); entry.tags = entry.tags.slice(1); - delete entry.updatedAt; - delete entry.createdAt; + cleanDate(entry); let body = await rq({ url: `/content-manager/explorer/article/${entry.id}?source=content-manager`, @@ -315,8 +319,7 @@ describe('Test manyToMany relation (article - tag) with Content Manager', () => tags: [] }); - delete entry.updatedAt; - delete entry.createdAt; + cleanDate(entry); let body = await rq({ url: `/content-manager/explorer/article/${entry.id}?source=content-manager`, @@ -393,8 +396,8 @@ describe('Test oneToMany - manyToOne relation (article - category) with Content 'Create article1 with cat1', async () => { const entry = { - title: 'Article 3', - content: 'Content 3', + title: 'Article 1', + content: 'Content 1', category: data.categories[0] }; @@ -406,6 +409,8 @@ describe('Test oneToMany - manyToOne relation (article - category) with Content body = JSON.parse(body); + console.log(body); + data.articles.push(body); expect(body.id); @@ -443,8 +448,8 @@ describe('Test oneToMany - manyToOne relation (article - category) with Content 'Create article2', async () => { const entry = { - title: 'Article 4', - content: 'Content 4' + title: 'Article 2', + content: 'Content 2' }; let body = await rq({ diff --git a/test/start.js b/test/start.js index cd6111c323..feb5c4f5ad 100644 --- a/test/start.js +++ b/test/start.js @@ -6,6 +6,12 @@ const strapiBin = path.resolve('./packages/strapi/bin/strapi.js'); const appName = 'testApp'; let appStart; +const databases = { + mongo: `--dbclient=mongo --dbhost=localhost --dbport=27017 --dbname=strapi-test-${new Date().getTime()} --dbusername="" --dbpassword=""`, + postgres: `--dbclient=postgres --dbhost=localhost --dbport=5432 --dbname=strapi-test --dbusername="" --dbpassword=""`, + mysql: `--dbclient=mysql --dbhost=localhost --dbport=3306 --dbname=strapi-test --dbusername="root" --dbpassword="root"` +}; + const {runCLI: jest} = require('jest-cli/build/cli'); const main = async () => { @@ -21,10 +27,10 @@ const main = async () => { }); }; - const generate = () => { + const generate = (database) => { return new Promise((resolve) => { const appCreation = exec( - `node ${strapiBin} new ${appName} --dev --dbclient=mongo --dbhost=localhost --dbport=27017 --dbname=strapi-test-${new Date().getTime()} --dbusername="" --dbpassword=""`, + `node ${strapiBin} new ${appName} --dev ${database}`, ); appCreation.stdout.on('data', data => { @@ -73,12 +79,18 @@ const main = async () => { }); }; - await clean(); - await generate(); - await start(); - await test(); + const testProcess = async (database) => { + await clean(); + await generate(database); + await start(); + await test(); - appStart.kill(); + appStart.kill(); + }; + + await testProcess(databases.mongo); + await testProcess(databases.postgres); + await testProcess(databases.mysql); }; main(); From f284c5d3e0c1edd8b16390babe33130ac9a1172e Mon Sep 17 00:00:00 2001 From: Jim Laurie Date: Fri, 1 Jun 2018 15:49:08 +0200 Subject: [PATCH 12/18] Fix PR feedback --- packages/strapi-bookshelf/lib/index.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/strapi-bookshelf/lib/index.js b/packages/strapi-bookshelf/lib/index.js index e88257fef0..ea100344b1 100755 --- a/packages/strapi-bookshelf/lib/index.js +++ b/packages/strapi-bookshelf/lib/index.js @@ -433,12 +433,7 @@ module.exports = function(strapi) { return acc; }, []); - await Promise.all(queries.map(query => - new Promise(async (resolve) => { - await ORM.knex.raw(query); - resolve(); - }) - )); + await Promise.all(queries.map(query => ORM.knex.raw(query))); } // Execute query to update column type From 238b3f9b4a3226293b52b82ff40c5a6809166893 Mon Sep 17 00:00:00 2001 From: Evan Owens Date: Fri, 1 Jun 2018 23:57:06 -0400 Subject: [PATCH 13/18] Specify MongoDB >= 2.6 Need to use MongoDB >= 2.6 otherwise get wire version errors on start: ``` UnhandledPromiseRejectionWarning: MongoError: Server at 127.0.0.1:27017 reports wire version 0, but this version of Node.js Driver requires at least 2 (MongoDB2.6). ``` --- docs/3.x.x/en/getting-started/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/3.x.x/en/getting-started/installation.md b/docs/3.x.x/en/getting-started/installation.md index 6d8003fe53..1ed5fc166d 100644 --- a/docs/3.x.x/en/getting-started/installation.md +++ b/docs/3.x.x/en/getting-started/installation.md @@ -6,7 +6,7 @@ Installation is very easy and only takes a few seconds. Please make sure your computer/server meets the following requirements: - [Node.js](https://nodejs.org) >= 9: Node.js is a server platform which runs JavaScript. Installation guide [here](https://nodejs.org/en/download/). - - [MongoDB](https://www.mongodb.com/): MongoDB is a powerful document store. Installation guide [here](https://www.mongodb.com/download-center?j#community). + - [MongoDB](https://www.mongodb.com/) >= 2.6: MongoDB is a powerful document store. Installation guide [here](https://www.mongodb.com/download-center?j#community). ## Setup From 8085a2deafa7471ab52ff0aa8b4c59b1ba3257c9 Mon Sep 17 00:00:00 2001 From: Jim Laurie Date: Sun, 3 Jun 2018 20:46:43 +0200 Subject: [PATCH 14/18] Update oneToOne test with id --- .../models/User.settings.json | 2 +- test/index.test.js | 104 +++++++++++++++++- test/start.js | 8 +- 3 files changed, 103 insertions(+), 11 deletions(-) diff --git a/packages/strapi-plugin-users-permissions/models/User.settings.json b/packages/strapi-plugin-users-permissions/models/User.settings.json index 99479b1cba..da72db76e3 100644 --- a/packages/strapi-plugin-users-permissions/models/User.settings.json +++ b/packages/strapi-plugin-users-permissions/models/User.settings.json @@ -40,4 +40,4 @@ "configurable": false } } -} +} \ No newline at end of file diff --git a/test/index.test.js b/test/index.test.js index d600825301..43c1469b85 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -409,8 +409,6 @@ describe('Test oneToMany - manyToOne relation (article - category) with Content body = JSON.parse(body); - console.log(body); - data.articles.push(body); expect(body.id); @@ -427,6 +425,8 @@ describe('Test oneToMany - manyToOne relation (article - category) with Content category: data.categories[1] }); + cleanDate(entry); + let body = await rq({ url: `/content-manager/explorer/article/${entry.id}?source=content-manager`, method: 'PUT', @@ -475,6 +475,8 @@ describe('Test oneToMany - manyToOne relation (article - category) with Content category: data.categories[1] }); + cleanDate(entry); + let body = await rq({ url: `/content-manager/explorer/article/${entry.id}?source=content-manager`, method: 'PUT', @@ -498,6 +500,8 @@ describe('Test oneToMany - manyToOne relation (article - category) with Content const entry = Object.assign({}, data.categories[0]); entry.articles.push(data.articles[0]); + cleanDate(entry); + let body = await rq({ url: `/content-manager/explorer/category/${entry.id}?source=content-manager`, method: 'PUT', @@ -538,6 +542,78 @@ describe('Test oneToMany - manyToOne relation (article - category) with Content expect(body.name).toBe(entry.name); } ); + test( + 'Get article1 with cat3', + async () => { + let body = await rq({ + url: `/content-manager/explorer/article/${data.articles[0].id}?source=content-manager`, + method: 'GET' + }); + + body = JSON.parse(body); + + expect(body.id); + expect(body.category.id).toBe(data.categories[2].id) + } + ); + test( + 'Get article2 with cat2', + async () => { + let body = await rq({ + url: `/content-manager/explorer/article/${data.articles[1].id}?source=content-manager`, + method: 'GET' + }); + + body = JSON.parse(body); + + expect(body.id); + expect(body.category.id).toBe(data.categories[1].id) + } + ); + test( + 'Get cat1 without relations', + async () => { + let body = await rq({ + url: `/content-manager/explorer/category/${data.categories[0].id}?source=content-manager`, + method: 'GET' + }); + + body = JSON.parse(body); + + expect(body.id); + expect(body.articles.length).toBe(0); + } + ); + test( + 'Get cat2 with article2', + async () => { + let body = await rq({ + url: `/content-manager/explorer/category/${data.categories[1].id}?source=content-manager`, + method: 'GET' + }); + + body = JSON.parse(body); + + expect(body.id); + expect(body.articles.length).toBe(1); + expect(body.articles[0].id).toBe(data.articles[1].id); + } + ); + test( + 'Get cat3 with article1', + async () => { + let body = await rq({ + url: `/content-manager/explorer/category/${data.categories[2].id}?source=content-manager`, + method: 'GET' + }); + + body = JSON.parse(body); + + expect(body.id); + expect(body.articles.length).toBe(1); + expect(body.articles[0].id).toBe(data.articles[0].id); + } + ); }); describe('Test oneToOne relation (article - reference) with Content Manager', () => { @@ -598,9 +674,11 @@ describe('Test oneToOne relation (article - reference) with Content Manager', () 'Update article1 with ref1', async () => { const entry = Object.assign({}, data.articles[0], { - reference: data.references[0] + reference: data.references[0].id }); + cleanDate(entry); + let body = await rq({ url: `/content-manager/explorer/article/${entry.id}?source=content-manager`, method: 'PUT', @@ -614,7 +692,7 @@ describe('Test oneToOne relation (article - reference) with Content Manager', () expect(body.id); expect(body.title).toBe(entry.title); expect(body.content).toBe(entry.content); - expect(body.reference.name).toBe(entry.reference.name); + expect(body.reference.id).toBe(entry.reference); } ); test( @@ -623,7 +701,7 @@ describe('Test oneToOne relation (article - reference) with Content Manager', () const entry = { title: 'Article 2', content: 'Content 2', - reference: data.references[0] + reference: data.references[0].id }; let body = await rq({ @@ -639,7 +717,21 @@ describe('Test oneToOne relation (article - reference) with Content Manager', () expect(body.id); expect(body.title).toBe(entry.title); expect(body.content).toBe(entry.content); - expect(body.reference.name).toBe(entry.reference.name); + expect(body.reference.id).toBe(entry.reference); + } + ); + test( + 'Get article1 without relations', + async () => { + let body = await rq({ + url: `/content-manager/explorer/article/${data.articles[0].id}?source=content-manager`, + method: 'GET' + }); + + body = JSON.parse(body); + + expect(body.id); + expect(body.reference).toBe(null); } ); }); diff --git a/test/start.js b/test/start.js index feb5c4f5ad..e8049caa98 100644 --- a/test/start.js +++ b/test/start.js @@ -7,9 +7,9 @@ const appName = 'testApp'; let appStart; const databases = { - mongo: `--dbclient=mongo --dbhost=localhost --dbport=27017 --dbname=strapi-test-${new Date().getTime()} --dbusername="" --dbpassword=""`, - postgres: `--dbclient=postgres --dbhost=localhost --dbport=5432 --dbname=strapi-test --dbusername="" --dbpassword=""`, - mysql: `--dbclient=mysql --dbhost=localhost --dbport=3306 --dbname=strapi-test --dbusername="root" --dbpassword="root"` + mongo: `--dbclient=mongo --dbhost=127.0.0.1 --dbport=27017 --dbname=strapi-test-${new Date().getTime()} --dbusername="" --dbpassword=""`, + postgres: `--dbclient=postgres --dbhost=127.0.0.1 --dbport=5432 --dbname=strapi-test --dbusername="" --dbpassword=""`, + mysql: `--dbclient=mysql --dbhost=127.0.0.1 --dbport=3306 --dbname=strapi-test --dbusername="root" --dbpassword="root"` }; const {runCLI: jest} = require('jest-cli/build/cli'); @@ -28,7 +28,7 @@ const main = async () => { }; const generate = (database) => { - return new Promise((resolve) => { + return new Promise((resolve, reject) => { const appCreation = exec( `node ${strapiBin} new ${appName} --dev ${database}`, ); From ec5ef9a240607ef69a62131a7cbd4c1a3895de72 Mon Sep 17 00:00:00 2001 From: Jim Laurie Date: Mon, 4 Jun 2018 14:39:26 +0200 Subject: [PATCH 15/18] Fix PR feedback --- .../admin/src/utils/injectReducer.js | 2 +- .../admin/src/utils/injectSaga.js | 2 +- .../lib/src/utils/injectReducer.js | 2 +- .../lib/src/utils/injectSaga.js | 2 +- .../config/layout.json | 40 +++---------------- test/{helper => helpers}/generators.json | 0 test/{helper => helpers}/restart.js | 15 ++++--- test/index.test.js | 4 +- 8 files changed, 22 insertions(+), 45 deletions(-) rename test/{helper => helpers}/generators.json (100%) rename test/{helper => helpers}/restart.js (61%) diff --git a/packages/strapi-admin/admin/src/utils/injectReducer.js b/packages/strapi-admin/admin/src/utils/injectReducer.js index 1e46dbb3b8..4af84187f3 100644 --- a/packages/strapi-admin/admin/src/utils/injectReducer.js +++ b/packages/strapi-admin/admin/src/utils/injectReducer.js @@ -14,10 +14,10 @@ import getInjectors from './reducerInjectors'; export default ({ key, reducer }) => (WrappedComponent) => { class ReducerInjector extends React.Component { static WrappedComponent = WrappedComponent; + static displayName = `withReducer(${(WrappedComponent.displayName || WrappedComponent.name || 'Component')})`; static contextTypes = { store: PropTypes.object.isRequired, }; - static displayName = `withReducer(${(WrappedComponent.displayName || WrappedComponent.name || 'Component')})`; componentWillMount() { const { injectReducer } = this.injectors; diff --git a/packages/strapi-admin/admin/src/utils/injectSaga.js b/packages/strapi-admin/admin/src/utils/injectSaga.js index 1679cf9a99..158b0e1732 100644 --- a/packages/strapi-admin/admin/src/utils/injectSaga.js +++ b/packages/strapi-admin/admin/src/utils/injectSaga.js @@ -18,10 +18,10 @@ import getInjectors from './sagaInjectors'; export default ({ key, saga, mode }) => (WrappedComponent) => { class InjectSaga extends React.Component { static WrappedComponent = WrappedComponent; + static displayName = `withSaga(${(WrappedComponent.displayName || WrappedComponent.name || 'Component')})`; static contextTypes = { store: PropTypes.object.isRequired, }; - static displayName = `withSaga(${(WrappedComponent.displayName || WrappedComponent.name || 'Component')})`; componentWillMount() { const { injectSaga } = this.injectors; diff --git a/packages/strapi-helper-plugin/lib/src/utils/injectReducer.js b/packages/strapi-helper-plugin/lib/src/utils/injectReducer.js index 1e46dbb3b8..4af84187f3 100644 --- a/packages/strapi-helper-plugin/lib/src/utils/injectReducer.js +++ b/packages/strapi-helper-plugin/lib/src/utils/injectReducer.js @@ -14,10 +14,10 @@ import getInjectors from './reducerInjectors'; export default ({ key, reducer }) => (WrappedComponent) => { class ReducerInjector extends React.Component { static WrappedComponent = WrappedComponent; + static displayName = `withReducer(${(WrappedComponent.displayName || WrappedComponent.name || 'Component')})`; static contextTypes = { store: PropTypes.object.isRequired, }; - static displayName = `withReducer(${(WrappedComponent.displayName || WrappedComponent.name || 'Component')})`; componentWillMount() { const { injectReducer } = this.injectors; diff --git a/packages/strapi-helper-plugin/lib/src/utils/injectSaga.js b/packages/strapi-helper-plugin/lib/src/utils/injectSaga.js index 1679cf9a99..158b0e1732 100644 --- a/packages/strapi-helper-plugin/lib/src/utils/injectSaga.js +++ b/packages/strapi-helper-plugin/lib/src/utils/injectSaga.js @@ -18,10 +18,10 @@ import getInjectors from './sagaInjectors'; export default ({ key, saga, mode }) => (WrappedComponent) => { class InjectSaga extends React.Component { static WrappedComponent = WrappedComponent; + static displayName = `withSaga(${(WrappedComponent.displayName || WrappedComponent.name || 'Component')})`; static contextTypes = { store: PropTypes.object.isRequired, }; - static displayName = `withSaga(${(WrappedComponent.displayName || WrappedComponent.name || 'Component')})`; componentWillMount() { const { injectSaga } = this.injectors; diff --git a/packages/strapi-plugin-content-manager/config/layout.json b/packages/strapi-plugin-content-manager/config/layout.json index 390d3e34cf..bece1e8e23 100644 --- a/packages/strapi-plugin-content-manager/config/layout.json +++ b/packages/strapi-plugin-content-manager/config/layout.json @@ -1,42 +1,14 @@ { - "article": { + "product": { "attributes": { - "title": { + "name": { "appearance": "" }, - "content": { + "price": { + "appearance": "" + }, + "description": { "appearance": "WYSIWYG" - }, - "published": { - "appearance": "" - } - } - }, - "tag": { - "attributes": { - "name": { - "appearance": "" - } - } - }, - "category": { - "attributes": { - "name": { - "appearance": "" - } - } - }, - "artcle": { - "attributes": { - "azd": { - "appearance": "" - } - } - }, - "reference": { - "attributes": { - "name": { - "appearance": "" } } } diff --git a/test/helper/generators.json b/test/helpers/generators.json similarity index 100% rename from test/helper/generators.json rename to test/helpers/generators.json diff --git a/test/helper/restart.js b/test/helpers/restart.js similarity index 61% rename from test/helper/restart.js rename to test/helpers/restart.js index f6f55c4bfb..4c23242d67 100644 --- a/test/helper/restart.js +++ b/test/helpers/restart.js @@ -3,9 +3,14 @@ module.exports = function (rq) { const ping = async () => { try { await rq({ - url: '/', - method: 'GET', - json: true + url: '/_health', + method: 'HEAD', + mode: 'no-cors', + json: true, + headers: { + 'Content-Type': 'application/json', + 'Keep-Alive': false, + } }); return resolve(); @@ -15,13 +20,13 @@ module.exports = function (rq) { } else { return setTimeout(() => { ping(); - }, 4000); + }, 1000); } } }; setTimeout(() => { ping(); - }, 4000); + }, 1000); }); }; diff --git a/test/index.test.js b/test/index.test.js index 43c1469b85..5e3fd1b6f5 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -1,7 +1,7 @@ let request = require('request'); -const form = require('./helper/generators'); -const restart = require('./helper/restart'); +const form = require('./helpers/generators'); +const restart = require('./helpers/restart'); request = request.defaults({ baseUrl: 'http://localhost:1337' From 78e064e72c7c2f2db7d02adad4b623d689ddf2d0 Mon Sep 17 00:00:00 2001 From: Jim Laurie Date: Mon, 4 Jun 2018 14:49:21 +0200 Subject: [PATCH 16/18] Fix missing file --- .../config/layout.json | 16 +--------------- .../strapi-plugin-graphql/services/GraphQL.js | 1 + 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/packages/strapi-plugin-content-manager/config/layout.json b/packages/strapi-plugin-content-manager/config/layout.json index bece1e8e23..0967ef424b 100644 --- a/packages/strapi-plugin-content-manager/config/layout.json +++ b/packages/strapi-plugin-content-manager/config/layout.json @@ -1,15 +1 @@ -{ - "product": { - "attributes": { - "name": { - "appearance": "" - }, - "price": { - "appearance": "" - }, - "description": { - "appearance": "WYSIWYG" - } - } - } -} \ No newline at end of file +{} diff --git a/packages/strapi-plugin-graphql/services/GraphQL.js b/packages/strapi-plugin-graphql/services/GraphQL.js index 4c2fdd6df4..6236dcb037 100644 --- a/packages/strapi-plugin-graphql/services/GraphQL.js +++ b/packages/strapi-plugin-graphql/services/GraphQL.js @@ -624,6 +624,7 @@ module.exports = { } // falls through } + break; default: // Where. queryOpts.query = strapi.utils.models.convertParams(name, { From c82ba4c089372f9713c1a5279e23c056bcb0eb5f Mon Sep 17 00:00:00 2001 From: Jim Laurie Date: Mon, 4 Jun 2018 18:22:21 +0200 Subject: [PATCH 17/18] Fix decimal on pg an mysql fix #1273 --- packages/strapi-bookshelf/lib/index.js | 2 +- packages/strapi-knex/lib/index.js | 31 +++++++++++++++----------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/packages/strapi-bookshelf/lib/index.js b/packages/strapi-bookshelf/lib/index.js index ea100344b1..53c3143adc 100755 --- a/packages/strapi-bookshelf/lib/index.js +++ b/packages/strapi-bookshelf/lib/index.js @@ -361,7 +361,7 @@ module.exports = function(strapi) { type = definition.client === 'pg' ? 'double precision' : 'double'; break; case 'decimal': - type = 'decimal'; + type = 'decimal(10,2)'; break; case 'date': case 'time': diff --git a/packages/strapi-knex/lib/index.js b/packages/strapi-knex/lib/index.js index 6f96e320f4..6d859a425e 100755 --- a/packages/strapi-knex/lib/index.js +++ b/packages/strapi-knex/lib/index.js @@ -78,8 +78,9 @@ module.exports = strapi => { // Make sure the client is installed in the application // `node_modules` directory. + let client; try { - require(path.resolve(strapi.config.appPath, 'node_modules', connection.settings.client)); + client = require(path.resolve(strapi.config.appPath, 'node_modules', connection.settings.client)); } catch (err) { strapi.log.error('The client `' + connection.settings.client + '` is not installed.'); strapi.log.error('You can install it with `$ npm install ' + connection.settings.client + ' --save`.'); @@ -105,18 +106,22 @@ module.exports = strapi => { migrations: _.get(connection.options, 'migrations') }, strapi.config.hook.settings.knex); - if (options.client === 'pg' && _.isString(_.get(options.connection, 'schema'))) { - options.pool = { - min: _.get(connection.options, 'pool.min') || 0, - max: _.get(connection.options, 'pool.max') || 10, - afterCreate: (conn, cb) => { - conn.query(`SET SESSION SCHEMA '${options.connection.schema}';`, (err) => { - cb(err, conn); - }); - } - }; - } else { - delete options.connection.schema; + if (options.client === 'pg') { + client.types.setTypeParser(1700, 'text', parseFloat); + + if (_.isString(_.get(options.connection, 'schema'))) { + options.pool = { + min: _.get(connection.options, 'pool.min') || 0, + max: _.get(connection.options, 'pool.max') || 10, + afterCreate: (conn, cb) => { + conn.query(`SET SESSION SCHEMA '${options.connection.schema}';`, (err) => { + cb(err, conn); + }); + } + }; + } else { + delete options.connection.schema; + } } if (options.client === 'mysql') { From 1af3ff7effdd6cd51d6a17420d444be35f063d77 Mon Sep 17 00:00:00 2001 From: soupette Date: Mon, 4 Jun 2018 19:24:08 +0200 Subject: [PATCH 18/18] Fixes #1186 --- .../admin/src/containers/Form/utils/setAttribute.js | 13 +++++++++++++ .../admin/src/containers/ModelPage/actions.js | 12 ++++++++++++ 2 files changed, 25 insertions(+) diff --git a/packages/strapi-plugin-content-type-builder/admin/src/containers/Form/utils/setAttribute.js b/packages/strapi-plugin-content-type-builder/admin/src/containers/Form/utils/setAttribute.js index 6d6a492f6d..248c3963c2 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/containers/Form/utils/setAttribute.js +++ b/packages/strapi-plugin-content-type-builder/admin/src/containers/Form/utils/setAttribute.js @@ -10,6 +10,19 @@ export default function setParallelAttribute(newAttribute) { parallelAttribute.params.columnName = newAttribute.params.targetColumnName; parallelAttribute.params.targetColumnName = newAttribute.params.columnName; parallelAttribute.params.dominant = false; + + if (newAttribute.params.nature) { + switch (newAttribute.params.nature) { + case 'manyToOne': + parallelAttribute.params.nature = 'oneToMany'; + break; + case 'oneToMany': + parallelAttribute.params.nature = 'manyToOne'; + break; + default: + // + } + } return parallelAttribute; } return; diff --git a/packages/strapi-plugin-content-type-builder/admin/src/containers/ModelPage/actions.js b/packages/strapi-plugin-content-type-builder/admin/src/containers/ModelPage/actions.js index 596e7f58fd..37b2a550f3 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/containers/ModelPage/actions.js +++ b/packages/strapi-plugin-content-type-builder/admin/src/containers/ModelPage/actions.js @@ -177,6 +177,18 @@ function setParallelAttribute(data) { parallelAttribute.params.columnName = data.params.targetColumnName; parallelAttribute.params.targetColumnName = data.params.columnName; parallelAttribute.params.dominant = false; + + switch (data.params.nature) { + case 'manyToOne': + parallelAttribute.params.nature = 'oneToMany'; + break; + case 'oneToMany': + parallelAttribute.params.nature = 'manyToOne'; + break; + default: + // + } + return parallelAttribute; }