@kentico/kontent-backup-manager
Advanced tools
Comparing version 1.0.0 to 1.1.0
{ | ||
"name": "@kentico/kontent-backup-manager", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "This utility enables backup & restore of Kentico Kontent projects", | ||
@@ -5,0 +5,0 @@ "preferGlobal": true, |
@@ -134,3 +134,3 @@ #!/usr/bin/env node | ||
enableLog: config.enableLog, | ||
workflowIdForImportedItems: '00000000-0000-0000-0000-000000000000', | ||
workflowIdForImportedItems: undefined, | ||
process: { | ||
@@ -137,0 +137,0 @@ contentItem: function (item) { |
import { AssetContracts, AssetFolderContracts, ContentItemContracts, ContentTypeContracts, ContentTypeSnippetContracts, LanguageContracts, LanguageVariantContracts, TaxonomyContracts, ProjectContracts } from '@kentico/kontent-management'; | ||
import { IProcessedItem, ItemType } from '../core'; | ||
export interface IImportConfig { | ||
workflowIdForImportedItems: string; | ||
workflowIdForImportedItems?: string; | ||
projectId: string; | ||
@@ -6,0 +6,0 @@ apiKey: string; |
@@ -6,2 +6,3 @@ import { IImportItemResult, ValidImportContract, ValidImportModel } from '../core'; | ||
private readonly defaultLanguageId; | ||
private readonly defaultWorkflowId; | ||
private readonly client; | ||
@@ -8,0 +9,0 @@ /** |
@@ -46,2 +46,3 @@ "use strict"; | ||
this.defaultLanguageId = '00000000-0000-0000-0000-000000000000'; | ||
this.defaultWorkflowId = '00000000-0000-0000-0000-000000000000'; | ||
/** | ||
@@ -644,11 +645,12 @@ * Maximum allowed size of asset in Bytes. | ||
ImportService.prototype.importLanguageVariantsAsync = function (languageVariants, currentItems) { | ||
var _a; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var importedItems, _loop_13, this_13, _i, languageVariants_1, languageVariant; | ||
var _this = this; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
importedItems = []; | ||
_loop_13 = function (languageVariant) { | ||
var itemCodename, languageCodename; | ||
var itemCodename, languageCodename, newWorkflowId; | ||
return __generator(this, function (_a) { | ||
@@ -667,4 +669,4 @@ switch (_a.label) { | ||
core_1.idTranslateHelper.replaceIdReferencesWithNewId(languageVariant, currentItems); | ||
// set workflow id (there is no API to create workflows programatically) | ||
languageVariant.workflow_step.id = this_13.config.workflowIdForImportedItems; | ||
newWorkflowId = (_a = this_13.config.workflowIdForImportedItems) !== null && _a !== void 0 ? _a : this_13.defaultWorkflowId; | ||
languageVariant.workflow_step.id = newWorkflowId; | ||
return [4 /*yield*/, this_13.client | ||
@@ -694,3 +696,3 @@ .upsertLanguageVariant() | ||
_i = 0, languageVariants_1 = languageVariants; | ||
_a.label = 1; | ||
_b.label = 1; | ||
case 1: | ||
@@ -701,4 +703,4 @@ if (!(_i < languageVariants_1.length)) return [3 /*break*/, 4]; | ||
case 2: | ||
_a.sent(); | ||
_a.label = 3; | ||
_b.sent(); | ||
_b.label = 3; | ||
case 3: | ||
@@ -705,0 +707,0 @@ _i++; |
@@ -5,2 +5,10 @@ # Changelog | ||
## [1.1.0](https://github.com/Kentico/kontent-backup-manager-js/compare/v0.0.9...v1.1.0) (2020-04-08) | ||
### Features | ||
* exports ZipService ([d4d8543](https://github.com/Kentico/kontent-backup-manager-js/commit/d4d854388c24cf35eb04f81e004366932b5ef51a)) | ||
* makes default workflow id optional ([cd6d03e](https://github.com/Kentico/kontent-backup-manager-js/commit/cd6d03e1358d49100c19762056167cf58af92801)) | ||
### [0.0.9](https://github.com/Enngage/kontent-backup-manager/compare/v0.0.8...v0.0.9) (2020-04-08) | ||
@@ -7,0 +15,0 @@ |
{ | ||
"name": "@kentico/kontent-backup-manager", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "This utility enables backup & restore of Kentico Kontent projects", | ||
@@ -5,0 +5,0 @@ "preferGlobal": true, |
@@ -83,3 +83,3 @@ #!/usr/bin/env node | ||
enableLog: config.enableLog, | ||
workflowIdForImportedItems: '00000000-0000-0000-0000-000000000000', | ||
workflowIdForImportedItems: undefined, | ||
process: { | ||
@@ -86,0 +86,0 @@ contentItem: item => { |
@@ -16,3 +16,3 @@ import { | ||
export interface IImportConfig { | ||
workflowIdForImportedItems: string; | ||
workflowIdForImportedItems?: string; | ||
projectId: string; | ||
@@ -19,0 +19,0 @@ apiKey: string; |
@@ -35,2 +35,3 @@ import { HttpService } from '@kentico/kontent-core'; | ||
private readonly defaultLanguageId: string = '00000000-0000-0000-0000-000000000000'; | ||
private readonly defaultWorkflowId: string = '00000000-0000-0000-0000-000000000000'; | ||
private readonly client: IManagementClient; | ||
@@ -580,3 +581,4 @@ | ||
// set workflow id (there is no API to create workflows programatically) | ||
languageVariant.workflow_step.id = this.config.workflowIdForImportedItems; | ||
const newWorkflowId: string = this.config.workflowIdForImportedItems ?? this.defaultWorkflowId; | ||
languageVariant.workflow_step.id = newWorkflowId; | ||
@@ -583,0 +585,0 @@ await this.client |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
297833
4701