Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
feat: unifies package metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Enngage committed May 11, 2020
1 parent 87b6c6c commit 47c45f5
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 29 deletions.
20 changes: 20 additions & 0 deletions src/core/core.models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,23 @@ export interface IImportItemResult<TRaw, TModel> {
export interface IIdCodenameTranslationResult {
[key: string]: string;
}

export interface IPackageMetadata {
version: string;
projectId: string;
timestamp: Date;
isInconsistentExport: boolean;
dataOverview: IPackageDataOverview;
}

export interface IPackageDataOverview {
taxonomiesCount: number;
contentTypeSnippetsCount: number;
contentTypesCount: number;
contentItemsCount: number;
languageVariantsCount: number;
languagesCount: number;
assetsCount: number;
assetFoldersCount: number;
}

23 changes: 2 additions & 21 deletions src/export/export.models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
ProjectContracts,
} from '@kentico/kontent-management';

import { IProcessedItem } from '../core';
import { IProcessedItem, IPackageMetadata } from '../core';

export interface IExportConfig {
projectId: string;
Expand All @@ -29,27 +29,8 @@ export interface IExportData {
assetFolders: AssetFolderContracts.IAssetFolderContract[];
}

export interface IExportMetadata {
version: string;
projectId: string;
timestamp: Date;
isInconsistentExport: boolean;
dataOverview: IExportMetadataDataOverview;
}

export interface IExportMetadataDataOverview {
taxonomiesCount: number;
contentTypeSnippetsCount: number;
contentTypesCount: number;
contentItemsCount: number;
languageVariantsCount: number;
languagesCount: number;
assetsCount: number;
assetFoldersCount: number;
}

export interface IExportAllResult {
metadata: IExportMetadata;
metadata: IPackageMetadata;
data: IExportData;
validation: ProjectContracts.IProjectReportResponseContract;
}
10 changes: 2 additions & 8 deletions src/import/import.models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
ProjectContracts,
} from '@kentico/kontent-management';

import { IProcessedItem, ItemType } from '../core';
import { IProcessedItem, ItemType, IPackageMetadata } from '../core';

export interface IImportConfig {
workflowIdForImportedItems?: string;
Expand Down Expand Up @@ -63,7 +63,7 @@ export interface IImportSource {
languages: LanguageContracts.ILanguageModelContract[];
assets: AssetContracts.IAssetModelContract[];
};
metadata: IImportMetadata;
metadata: IPackageMetadata;
validation: ProjectContracts.IProjectReportResponseContract;
assetFolders: AssetFolderContracts.IAssetFolderContract[];
binaryFiles: IBinaryFile[];
Expand All @@ -80,9 +80,3 @@ export interface IFlattenedFolder {
externalId?: string;
id: string;
}

export interface IImportMetadata {
projectId: string;
timestamp: Date;
isInconsistentExport: boolean;
}

0 comments on commit 47c45f5

Please sign in to comment.