contentful-import
Version:
this tool allows you to import JSON dump exported by contentful-export
67 lines (59 loc) • 2.41 kB
JavaScript
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _yargs = require('yargs');
var _yargs2 = _interopRequireDefault(_yargs);
var _package = require('../package');
var packageFile = _interopRequireWildcard(_package);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _yargs2.default.version(packageFile.version || 'Version only available on installed package').usage('Usage: $0 [options]').option('space-id', {
describe: 'ID of the destination space',
type: 'string',
demand: true
}).option('environment-id', {
describe: 'ID the environment in the destination space',
type: 'string',
default: 'master',
demand: false
}).option('management-token', {
describe: 'Contentful management API token for the destination space',
type: 'string',
demand: true
}).option('content-file', {
describe: 'JSON file that contains data to be import to your space',
type: 'string',
demand: true
}).option('content-model-only', {
describe: 'Import only content types',
type: 'boolean',
default: false
}).option('skip-content-model', {
describe: 'Skip importing content types and locales',
type: 'boolean',
default: false
}).option('skip-locales', {
describe: 'Skip importing locales',
type: 'boolean',
default: false
}).option('skip-content-publishing', {
describe: 'Skips content publishing. Creates content but does not publish it',
type: 'boolean',
default: false
}).option('error-log-file', {
describe: 'Full path to the error log file',
type: 'string'
}).option('host', {
describe: 'Management API host',
type: 'string',
default: 'api.contentful.com'
}).option('proxy', {
describe: 'Proxy configuration in HTTP auth format: [http|https]://host:port or [http|https]://user:password@host:port',
type: 'string'
}).option('raw-proxy', {
describe: 'Pass proxy config to Axios instead of creating a custom httpsAgent',
type: 'boolean',
default: false
}).config('config', 'An optional configuration JSON file containing all the options for a single run').argv;
module.exports = exports.default;