diff --git a/src/modules/sync/modelTransfomers/contentTypeSnippets.ts b/src/modules/sync/modelTransfomers/contentTypeSnippets.ts index cd0db290..2bac290b 100644 --- a/src/modules/sync/modelTransfomers/contentTypeSnippets.ts +++ b/src/modules/sync/modelTransfomers/contentTypeSnippets.ts @@ -1,5 +1,3 @@ -import { ContentTypeElements } from "@kontent-ai/management-sdk"; - import { omit } from "../../../utils/object.js"; import { EnvironmentModel } from "../generateSyncModel.js"; import { @@ -9,7 +7,7 @@ import { transformGuidelinesElement, transformLinkedItemsElement, transformMultipleChoiceElement, - transformRichText, + transformRichTextElement, transformTaxonomyElement, } from "./elementTransformers.js"; @@ -22,7 +20,7 @@ export const transformContentTypeSnippetsModel = ( switch (element.type) { case "guidelines": return transformGuidelinesElement( - element as unknown as ContentTypeElements.IGuidelinesElement, + element, environmentModel.assets, environmentModel.items, ); @@ -38,13 +36,13 @@ export const transformContentTypeSnippetsModel = ( environmentModel.taxonomyGroups, ); case "multiple_choice": - return transformMultipleChoiceElement(element as ContentTypeElements.IMultipleChoiceElement); + return transformMultipleChoiceElement(element); case "custom": - return transformCustomElement(element as ContentTypeElements.ICustomElement, snippet); + return transformCustomElement(element, snippet); case "asset": - return transformAssetElement(element as ContentTypeElements.IAssetElement, environmentModel.assets); + return transformAssetElement(element, environmentModel.assets); case "rich_text": - return transformRichText(element as ContentTypeElements.IRichTextElement, environmentModel.contentTypes); + return transformRichTextElement(element, environmentModel.contentTypes); default: return transformDefaultElement(element); } diff --git a/src/modules/sync/modelTransfomers/elementTransformers.ts b/src/modules/sync/modelTransfomers/elementTransformers.ts index b16f5a98..0f553111 100644 --- a/src/modules/sync/modelTransfomers/elementTransformers.ts +++ b/src/modules/sync/modelTransfomers/elementTransformers.ts @@ -41,7 +41,7 @@ const findContentType = ( return { codename: type.codename }; }; -export const replaceRichTextReferences = ( +const replaceRichTextReferences = ( richText: string, assets: ReadonlyArray, items: ReadonlyArray, @@ -130,7 +130,7 @@ export const transformAssetElement = ( }; }; -export const transformRichText = ( +export const transformRichTextElement = ( element: ContentTypeElements.IRichTextElement, contentTypes: ReadonlyArray, ): SyncSnippetRichTextElement => { diff --git a/tests/unit/sync/elementTransformers.test.ts b/tests/unit/sync/elementTransformers.test.ts index a3b8d6c0..f46a4827 100644 --- a/tests/unit/sync/elementTransformers.test.ts +++ b/tests/unit/sync/elementTransformers.test.ts @@ -15,7 +15,7 @@ import { transformGuidelinesElement, transformLinkedItemsElement, transformMultipleChoiceElement, - transformRichText, + transformRichTextElement, transformTaxonomyElement, } from "../../../src/modules/sync/modelTransfomers/elementTransformers"; @@ -221,7 +221,7 @@ describe("elementTransfomers test", () => { allowed_item_link_types: [{ codename: contentTypes[0].codename }], }; - const transformedElement = transformRichText(element, contentTypes); + const transformedElement = transformRichTextElement(element, contentTypes); expect(transformedElement).toEqual(expectedOutput); });