Skip to content

Commit 37aaa7b

Browse files
Merge pull request #1001 from contentstack/feature/cmg-774
Feature/cmg 774
2 parents 51e05eb + 89483fb commit 37aaa7b

7 files changed

Lines changed: 375 additions & 575 deletions

File tree

api/src/services/drupal.service.ts

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { createRefrence } from './drupal/references.service.js';
66
import { createTaxonomy } from './drupal/taxonomy.service.js';
77
import { createVersionFile } from './drupal/version.service.js';
88
import { createQuery, createQueryConfig } from './drupal/query.service.js';
9-
import { generateContentTypeSchemas } from './drupal/content-types.service.js';
9+
import type { DbConfig, AssetsConfig } from './drupal/interface.js';
1010

1111
/**
1212
* Drupal migration service with SQL-based data extraction.
@@ -16,24 +16,22 @@ import { generateContentTypeSchemas } from './drupal/content-types.service.js';
1616
*
1717
* IMPORTANT: Run in this order for proper dependency resolution:
1818
* 1. createQuery - Generate dynamic queries from database analysis (MUST RUN FIRST)
19-
* 2. generateContentTypeSchemas - Convert upload-api schema to API content types (MUST RUN AFTER upload-api)
20-
* 3. createAssets - Extract assets first (needed by entries)
21-
* 4. createRefrence - Create reference mappings (needed by entries)
22-
* 5. createTaxonomy - Extract taxonomies (needed by entries for taxonomy references)
23-
* 6. createEntry - Process entries (uses assets, references, and taxonomies)
24-
* 7. createLocale - Create locale configurations
25-
* 8. createVersionFile - Create version metadata file
19+
* 2. createAssets - Extract assets first (needed by entries)
20+
* 3. createRefrence - Create reference mappings (needed by entries)
21+
* 4. createTaxonomy - Extract taxonomies (needed by entries for taxonomy references)
22+
* 5. createEntry - Process entries (uses assets, references, and taxonomies)
23+
* 6. createLocale - Create locale configurations
24+
* 7. createVersionFile - Create version metadata file
2625
*/
2726
export const drupalService = {
2827
createQuery, // Generate dynamic queries from database analysis (MUST RUN FIRST)
2928
createQueryConfig, // Helper: Create query configuration file for dynamic SQL
30-
generateContentTypeSchemas, // Convert upload-api schema to API content types (MUST RUN AFTER upload-api)
3129
createAssets: (
32-
dbConfig: any,
30+
dbConfig: DbConfig,
3331
destination_stack_id: string,
3432
projectId: string,
3533
isTest = false,
36-
assetsConfig?: any
34+
assetsConfig?: AssetsConfig
3735
) => {
3836
return createAssets(
3937
dbConfig,
@@ -47,22 +45,22 @@ export const drupalService = {
4745
createRefrence, // Create reference mappings for relationships (run before entries)
4846
createTaxonomy, // Extract and process Drupal taxonomies (vocabularies and terms)
4947
createEntry: (
50-
dbConfig: any,
48+
dbConfig: DbConfig,
5149
destination_stack_id: string,
5250
projectId: string,
5351
isTest = false,
5452
masterLocale = 'en-us',
55-
contentTypeMapping: any[] = [],
56-
project: any = null
53+
project: Record<string, unknown> | null = null,
54+
contentTypes: Record<string, unknown>[] = []
5755
) => {
5856
return createEntry(
5957
dbConfig,
6058
destination_stack_id,
6159
projectId,
6260
isTest,
6361
masterLocale,
64-
contentTypeMapping,
65-
project
62+
project,
63+
contentTypes
6664
);
6765
},
6866
createLocale, // Create locale configurations

0 commit comments

Comments
 (0)