@kentico/kontent-cli
Advanced tools
Comparing version 0.5.1 to 0.6.0-next.1
export {}; | ||
//# sourceMappingURL=backup.d.ts.map |
@@ -0,0 +0,0 @@ "use strict"; |
export {}; | ||
//# sourceMappingURL=environment.d.ts.map |
@@ -0,0 +0,0 @@ "use strict"; |
export {}; | ||
//# sourceMappingURL=add.d.ts.map |
@@ -0,0 +0,0 @@ "use strict"; |
export {}; | ||
//# sourceMappingURL=migration.d.ts.map |
@@ -0,0 +0,0 @@ "use strict"; |
export {}; | ||
//# sourceMappingURL=add.d.ts.map |
@@ -0,0 +0,0 @@ "use strict"; |
import { IRange } from '../../models/range'; | ||
export declare const getRange: (range: string) => IRange | null; | ||
//# sourceMappingURL=run.d.ts.map |
@@ -68,5 +68,5 @@ "use strict"; | ||
}, | ||
debug: { | ||
alias: 'd', | ||
describe: 'Run in debug mode', | ||
'log-http-service-errors-to-console': { | ||
alias: 'l', | ||
describe: 'Log HttpService errors to console log.', | ||
default: false, | ||
@@ -122,3 +122,3 @@ type: 'boolean', | ||
const runRange = argv.range && exports.getRange(argv.range); | ||
const debugMode = argv.debug; | ||
const logHttpServiceErrorsToConsole = argv.logHttpServiceErrorsToConsole; | ||
const continueOnError = argv.continueOnError; | ||
@@ -135,3 +135,3 @@ let migrationsResults = 0; | ||
apiKey, | ||
debugMode, | ||
logHttpServiceErrorsToConsole, | ||
}); | ||
@@ -158,3 +158,3 @@ statusManager_1.loadMigrationsExecutionStatus(); | ||
for (const migration of sortedMigrationsToRun) { | ||
const migrationResult = yield migrationUtils_1.runMigration(migration, apiClient, projectId, debugMode); | ||
const migrationResult = yield migrationUtils_1.runMigration(migration, apiClient, projectId); | ||
if (migrationResult > 0) { | ||
@@ -178,3 +178,3 @@ if (!continueOnError) { | ||
}; | ||
migrationsResults = yield migrationUtils_1.runMigration(migration, apiClient, projectId, debugMode); | ||
migrationsResults = yield migrationUtils_1.runMigration(migration, apiClient, projectId); | ||
} | ||
@@ -181,0 +181,0 @@ process.exit(migrationsResults); |
#!/usr/bin/env node | ||
export {}; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -0,0 +0,0 @@ #!/usr/bin/env node |
@@ -5,3 +5,3 @@ import { ManagementClient } from '@kentico/kontent-management'; | ||
readonly apiKey: string; | ||
readonly debugMode: boolean; | ||
readonly logHttpServiceErrorsToConsole: boolean; | ||
} | ||
@@ -8,0 +8,0 @@ export declare const createManagementClient: (params: ICreateManagementClientParams) => ManagementClient; |
@@ -18,2 +18,3 @@ "use strict"; | ||
const httpService = new kontent_core_1.HttpService({ | ||
logErrorsToConsole: params.logHttpServiceErrorsToConsole, | ||
axiosRequestConfig: { | ||
@@ -20,0 +21,0 @@ headers: { |
@@ -0,0 +0,0 @@ export interface IEnvironment { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=environment.js.map |
@@ -0,0 +0,0 @@ import { MigrationModule } from '../types'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=migration.js.map |
@@ -0,0 +0,0 @@ export interface IRange { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=range.js.map |
@@ -0,0 +0,0 @@ export interface IMigrationStatus { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=status.js.map |
@@ -0,0 +0,0 @@ export declare enum TemplateType { |
@@ -0,0 +0,0 @@ "use strict"; |
export {}; | ||
//# sourceMappingURL=createMigration.test.d.ts.map |
@@ -0,0 +0,0 @@ "use strict"; |
export {}; | ||
//# sourceMappingURL=duplicateMigration.test.d.ts.map |
@@ -0,0 +0,0 @@ "use strict"; |
export {}; | ||
//# sourceMappingURL=fileUtils.test.d.ts.map |
@@ -0,0 +0,0 @@ "use strict"; |
export {}; | ||
//# sourceMappingURL=invalidOrderMigration.test.d.ts.map |
@@ -0,0 +0,0 @@ "use strict"; |
export {}; | ||
//# sourceMappingURL=statusManager.test.d.ts.map |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { ManagementClient } from '@kentico/kontent-management'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=index.js.map |
@@ -0,0 +0,0 @@ import { IEnvironmentsConfig } from '../models/environment'; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ /// <reference types="node" /> |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -8,3 +8,3 @@ import { ManagementClient } from '@kentico/kontent-management'; | ||
export declare const saveMigrationFile: (migrationName: string, migrationData: string, templateType: TemplateType) => string; | ||
export declare const runMigration: (migration: IMigration, client: ManagementClient, projectId: string, debugMode?: boolean) => Promise<number>; | ||
export declare const runMigration: (migration: IMigration, client: ManagementClient, projectId: string) => Promise<number>; | ||
export declare const generateTypedMigration: () => string; | ||
@@ -11,0 +11,0 @@ export declare const generatePlainMigration: () => string; |
@@ -54,3 +54,3 @@ "use strict"; | ||
}; | ||
exports.runMigration = (migration, client, projectId, debugMode = false) => __awaiter(void 0, void 0, void 0, function* () { | ||
exports.runMigration = (migration, client, projectId) => __awaiter(void 0, void 0, void 0, function* () { | ||
console.log(`Running the ${migration.name} migration.`); | ||
@@ -65,2 +65,3 @@ let isSuccess = true; | ||
console.error(chalk_1.default.redBright('An error occurred while running migration:'), chalk_1.default.yellowBright(migration.name), chalk_1.default.redBright('see the output from running the script.')); | ||
let error = e; | ||
if (e.originalError !== undefined) { | ||
@@ -72,20 +73,23 @@ console.group('Error details'); | ||
console.groupEnd(); | ||
if (debugMode) { | ||
const requestConfig = e.originalError.config; | ||
const bodyData = JSON.parse(requestConfig.data || {}); | ||
console.log(); | ||
console.group('Request details:'); | ||
console.error(chalk_1.default.yellow('URL:'), requestConfig.url); | ||
console.error(chalk_1.default.yellow('Method:'), requestConfig.method); | ||
console.error(chalk_1.default.yellow('Body:'), bodyData); | ||
console.groupEnd(); | ||
console.log(); | ||
console.group('Response details:'); | ||
console.error(chalk_1.default.yellow('Message:'), e.originalError.message); | ||
console.groupEnd(); | ||
} | ||
console.log(); | ||
console.group('Response details:'); | ||
console.error(chalk_1.default.redBright('Message:'), e.originalError.message); | ||
console.groupEnd(); | ||
error = e.originalError; | ||
} | ||
else { | ||
console.group('Error details'); | ||
console.error(chalk_1.default.redBright('Message:'), e.message); | ||
console.groupEnd(); | ||
} | ||
const requestConfig = error.config; | ||
if (requestConfig) { | ||
const bodyData = JSON.parse(requestConfig.data || {}); | ||
console.log(); | ||
console.group('Request details:'); | ||
console.error(chalk_1.default.yellow('URL:'), requestConfig.url); | ||
console.error(chalk_1.default.yellow('Method:'), requestConfig.method); | ||
console.error(chalk_1.default.yellow('Body:'), bodyData); | ||
console.groupEnd(); | ||
} | ||
isSuccess = false; | ||
@@ -92,0 +96,0 @@ } |
@@ -0,0 +0,0 @@ export declare const markAsCompleted: (projectId: string, name: string, order: number) => void; |
@@ -0,0 +0,0 @@ "use strict"; |
{ | ||
"name": "@kentico/kontent-cli", | ||
"version": "0.5.1", | ||
"version": "0.6.0-next.1", | ||
"description": "Command line interface tool that can be used for generating and running Kontent migration scripts", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
104682
1203