@@ -11,6 +11,7 @@ import { HTTP_TEXTS, HTTP_CODES, LOCALE_MAPPER, STEPPER_STEPS, CMS } from "../co
1111import { BadRequestError , ExceptionFunction } from "../utils/custom-errors.utils.js" ;
1212import { fieldAttacher } from "../utils/field-attacher.utils.js" ;
1313import { siteCoreService } from "./sitecore.service.js" ;
14+ import { wordpressService } from "./wordpress.service.js" ;
1415import { testFolderCreator } from "../utils/test-folder-creator.utils.js" ;
1516import { utilsCli } from './runCli.service.js' ;
1617import customLogger from "../utils/custom-logger.utils.js" ;
@@ -223,10 +224,27 @@ const startTestMigration = async (req: Request): Promise<any> => {
223224 case CMS . SITECORE_V8 :
224225 case CMS . SITECORE_V9 :
225226 case CMS . SITECORE_V10 : {
227+ if ( packagePath ) {
228+ await siteCoreService ?. createEntry ( { packagePath, contentTypes, destinationStackId : project ?. current_test_stack_id , projectId, keyMapper : project ?. mapperKeys } ) ;
229+ await siteCoreService ?. createLocale ( req , project ?. current_test_stack_id , projectId ) ;
230+ await siteCoreService ?. createVersionFile ( project ?. current_test_stack_id ) ;
231+ }
232+ break ;
233+ }
234+ case CMS . WORDPRESS : {
226235 if ( packagePath ) {
227- await siteCoreService ?. createEntry ( { packagePath, contentTypes, master_locale : project ?. stackDetails ?. master_locale , destinationStackId : project ?. current_test_stack_id , projectId, keyMapper : project ?. mapperKeys } ) ;
228- await siteCoreService ?. createLocale ( req , project ?. current_test_stack_id , projectId ) ;
229- await siteCoreService ?. createVersionFile ( project ?. current_test_stack_id ) ;
236+ await wordpressService ?. getAllAssets ( file_path , packagePath , project ?. current_test_stack_id , projectId )
237+ await wordpressService ?. createAssetFolderFile ( file_path , project ?. current_test_stack_id , projectId )
238+ await wordpressService ?. getAllreference ( file_path , packagePath , project ?. current_test_stack_id , projectId )
239+ await wordpressService ?. extractChunks ( file_path , packagePath , project ?. current_test_stack_id , projectId )
240+ await wordpressService ?. getAllAuthors ( file_path , packagePath , project ?. current_test_stack_id , projectId , contentTypes , project ?. mapperKeys )
241+ //await wordpressService?.extractContentTypes(projectId, project?.current_test_stack_id, contentTypes)
242+ await wordpressService ?. getAllTerms ( file_path , packagePath , project ?. current_test_stack_id , projectId , contentTypes , project ?. mapperKeys )
243+ await wordpressService ?. getAllTags ( file_path , packagePath , project ?. current_test_stack_id , projectId , contentTypes , project ?. mapperKeys )
244+ await wordpressService ?. getAllCategories ( file_path , packagePath , project ?. current_test_stack_id , projectId , contentTypes , project ?. mapperKeys )
245+ await wordpressService ?. extractPosts ( packagePath , project ?. current_test_stack_id , projectId , contentTypes , project ?. mapperKeys )
246+ await wordpressService ?. extractGlobalFields ( project ?. current_test_stack_id , projectId )
247+ await wordpressService ?. createVersionFile ( project ?. current_test_stack_id , projectId ) ;
230248 }
231249 break ;
232250 }
@@ -288,6 +306,25 @@ const startMigration = async (req: Request): Promise<any> => {
288306 }
289307 break ;
290308 }
309+ case CMS . WORDPRESS : {
310+ if ( packagePath ) {
311+ await wordpressService ?. getAllAssets ( file_path , packagePath , project ?. destination_stack_id , projectId )
312+ await wordpressService ?. createAssetFolderFile ( file_path , project ?. destination_stack_id , projectId )
313+ await wordpressService ?. getAllreference ( file_path , packagePath , project ?. destination_stack_id , projectId )
314+ await wordpressService ?. extractChunks ( file_path , packagePath , project ?. destination_stack_id , projectId )
315+ await wordpressService ?. getAllAuthors ( file_path , packagePath , project ?. destination_stack_id , projectId , contentTypes , project ?. mapperKeys )
316+ //await wordpressService?.extractContentTypes(projectId, project?.destination_stack_id)
317+ await wordpressService ?. getAllTerms ( file_path , packagePath , project ?. destination_stack_id , projectId , contentTypes , project ?. mapperKeys )
318+ await wordpressService ?. getAllTags ( file_path , packagePath , project ?. destination_stack_id , projectId , contentTypes , project ?. mapperKeys )
319+ await wordpressService ?. getAllCategories ( file_path , packagePath , project ?. destination_stack_id , projectId , contentTypes , project ?. mapperKeys )
320+ await wordpressService ?. extractPosts ( packagePath , project ?. destination_stack_id , projectId , contentTypes , project ?. mapperKeys )
321+ await wordpressService ?. extractGlobalFields ( project ?. destination_stack_id , projectId )
322+ await wordpressService ?. createVersionFile ( project ?. destination_stack_id , projectId ) ;
323+
324+
325+ }
326+ break ;
327+ }
291328 case CMS . CONTENTFUL : {
292329 await contentfulService ?. createLocale ( file_path , project ?. destination_stack_id , projectId ) ;
293330 await contentfulService ?. createRefrence ( file_path , project ?. destination_stack_id , projectId ) ;
0 commit comments