@kentico/kontent-backup-manager
Advanced tools
Comparing version 1.7.1 to 1.8.0
{ | ||
"name": "@kentico/kontent-backup-manager", | ||
"version": "1.7.1", | ||
"version": "1.8.0", | ||
"description": "This utility enables backup & restore of Kentico Kontent projects", | ||
@@ -5,0 +5,0 @@ "preferGlobal": true, |
@@ -14,3 +14,5 @@ import { ContentItemContracts, ContentTypeContracts, ContentTypeSnippetContracts, LanguageVariantContracts, TaxonomyContracts, AssetContracts, LanguageContracts, AssetFolderContracts, ProjectContracts } from '@kentico/kontent-management'; | ||
exportContentTypeSnippetsAsync(): Promise<ContentTypeSnippetContracts.IContentTypeSnippetContract[]>; | ||
exportContentTypesAsync(): Promise<ContentTypeContracts.IContentTypeContract[]>; | ||
exportContentTypesAsync(data: { | ||
processItem: boolean; | ||
}): Promise<ContentTypeContracts.IContentTypeContract[]>; | ||
exportContentItemsAsync(): Promise<ContentItemContracts.IContentItemModelContract[]>; | ||
@@ -17,0 +19,0 @@ exportLanguageVariantsAsync(typeIds: string[]): Promise<LanguageVariantContracts.ILanguageVariantModelContract[]>; |
@@ -54,11 +54,6 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var contentTypes, projectValidation, exportItems, data, _u, _v, _w, _x, _y, _z, _0, _1; | ||
var exportItems, contentTypes, projectValidation, data, _u, _v, _w, _x, _y, _z, _0, _1; | ||
return __generator(this, function (_2) { | ||
switch (_2.label) { | ||
case 0: return [4 /*yield*/, this.exportContentTypesAsync()]; | ||
case 1: | ||
contentTypes = _2.sent(); | ||
return [4 /*yield*/, this.exportProjectValidationAsync()]; | ||
case 2: | ||
projectValidation = _2.sent(); | ||
case 0: | ||
exportItems = { | ||
@@ -75,2 +70,8 @@ asset: (_b = (_a = this.config.exportFilter) === null || _a === void 0 ? void 0 : _a.includes('asset')) !== null && _b !== void 0 ? _b : true, | ||
}; | ||
return [4 /*yield*/, this.exportContentTypesAsync({ processItem: exportItems.contentType })]; | ||
case 1: | ||
contentTypes = _2.sent(); | ||
return [4 /*yield*/, this.exportProjectValidationAsync()]; | ||
case 2: | ||
projectValidation = _2.sent(); | ||
_u = { | ||
@@ -264,3 +265,3 @@ contentTypes: exportItems.contentType ? contentTypes : [] | ||
}; | ||
ExportService.prototype.exportContentTypesAsync = function () { | ||
ExportService.prototype.exportContentTypesAsync = function (data) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
@@ -274,3 +275,5 @@ var response; | ||
response = _a.sent(); | ||
response.data.items.forEach(function (m) { return _this.processItem(m.name, 'contentType', m); }); | ||
if (data.processItem) { | ||
response.data.items.forEach(function (m) { return _this.processItem(m.name, 'contentType', m); }); | ||
} | ||
return [2 /*return*/, response.data.items.map(function (m) { return m._raw; })]; | ||
@@ -277,0 +280,0 @@ } |
@@ -232,2 +232,4 @@ "use strict"; | ||
ZipService.prototype.getBinaryDataFromUrl = function (url, enableLog) { | ||
// temp fix for Kontent Repository not validating url | ||
url = url.replace('#', '%23'); | ||
if (enableLog) { | ||
@@ -234,0 +236,0 @@ console.log("Downloading asset: " + url); |
@@ -5,2 +5,14 @@ # Changelog | ||
## [1.8.0](https://github.com/Kentico/kontent-backup-manager-js/compare/v1.7.1...v1.8.0) (2020-08-07) | ||
### Features | ||
* do not process content type if content type is not supposed to be exported ([a463b6a](https://github.com/Kentico/kontent-backup-manager-js/commit/a463b6a5236ea09273990b7a1e953d6037bb59e3)) | ||
### Bug Fixes | ||
* fixes kontent not encoding # in url ([9707990](https://github.com/Kentico/kontent-backup-manager-js/commit/970799096142f09dcc1cf12b18e158d3ec347f6c)) | ||
### [1.7.1](https://github.com/Kentico/kontent-backup-manager-js/compare/v1.7.0...v1.7.1) (2020-08-06) | ||
@@ -7,0 +19,0 @@ |
{ | ||
"name": "@kentico/kontent-backup-manager", | ||
"version": "1.7.1", | ||
"version": "1.8.0", | ||
"description": "This utility enables backup & restore of Kentico Kontent projects", | ||
@@ -5,0 +5,0 @@ "preferGlobal": true, |
@@ -31,5 +31,2 @@ import { | ||
public async exportAllAsync(): Promise<IExportAllResult> { | ||
const contentTypes = await this.exportContentTypesAsync(); | ||
const projectValidation = await this.exportProjectValidationAsync(); | ||
const exportItems = { | ||
@@ -47,2 +44,5 @@ asset: this.config.exportFilter?.includes('asset') ?? true, | ||
const contentTypes = await this.exportContentTypesAsync({processItem: exportItems.contentType}); | ||
const projectValidation = await this.exportProjectValidationAsync(); | ||
const data: IExportData = { | ||
@@ -119,5 +119,7 @@ contentTypes: exportItems.contentType ? contentTypes : [], | ||
public async exportContentTypesAsync(): Promise<ContentTypeContracts.IContentTypeContract[]> { | ||
public async exportContentTypesAsync(data: {processItem: boolean}): Promise<ContentTypeContracts.IContentTypeContract[]> { | ||
const response = await this.client.listContentTypes().toAllPromise(); | ||
response.data.items.forEach(m => this.processItem(m.name, 'contentType', m)); | ||
if (data.processItem) { | ||
response.data.items.forEach(m => this.processItem(m.name, 'contentType', m)); | ||
} | ||
return response.data.items.map(m => m._raw); | ||
@@ -124,0 +126,0 @@ } |
@@ -161,2 +161,5 @@ import { AssetContracts } from '@kentico/kontent-management'; | ||
private getBinaryDataFromUrl(url: string, enableLog: boolean): Promise<any> { | ||
// temp fix for Kontent Repository not validating url | ||
url = url.replace('#', '%23'); | ||
if (enableLog) { | ||
@@ -163,0 +166,0 @@ console.log(`Downloading asset: ${url}`); |
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
331202
5148