This repository has been archived by the owner on Feb 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: Adds support for backing up & restoring workflows as well as k…
…eeping the workflow status of imported language variants. Because of this the now deprecated "workflowSteps" are removed in favor of dedicated "workflows". Adds new configuration option 'preserveWorkflow'.
- Loading branch information
Showing
16 changed files
with
355 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const defaultWorkflowCodename: string = 'Default'; | ||
export const defaultObjectId: string = '00000000-0000-0000-0000-000000000000'; | ||
export const codenameOfReservedDefaultWorkflowSteps: string[] = ['Draft', 'Published', 'Archived']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,26 @@ | ||
import { SharedModels } from '@kentico/kontent-management'; | ||
|
||
export function getFilenameWithoutExtension(filename: string): string { | ||
if (!filename) { | ||
throw Error(`Invalid filename`); | ||
} | ||
|
||
if (!filename.includes('.')) { | ||
return filename | ||
}; | ||
return filename; | ||
} | ||
|
||
return filename | ||
.split('.') | ||
.slice(0, -1) | ||
.join('.'); | ||
return filename.split('.').slice(0, -1).join('.'); | ||
} | ||
|
||
export function handleError(error: any | SharedModels.ContentManagementBaseKontentError): void { | ||
let result = error; | ||
if (error instanceof SharedModels.ContentManagementBaseKontentError) { | ||
result = { | ||
Message: `Failed to import data with error: ${error.message}`, | ||
ErrorCode: error.errorCode, | ||
RequestId: error.requestId, | ||
ValidationErrors: `${error.validationErrors.map((m) => m.message).join(', ')}` | ||
}; | ||
} | ||
throw result; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export * from './core.models'; | ||
export * from './translation-helper'; | ||
export * from './id-translate-helper'; | ||
export * from './global-helper'; | ||
export * from './global-helper'; | ||
export * from './core-properties'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.