@strapi2front/generators 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3275,7 +3275,9 @@ function generateUtilityTypesJSDoc(blocksRendererInstalled, strapiVersion) {
|
|
|
3275
3275
|
* @returns {T}
|
|
3276
3276
|
*/
|
|
3277
3277
|
function flattenV4Response(item) {
|
|
3278
|
-
|
|
3278
|
+
/** @type {any} */
|
|
3279
|
+
const merged = { id: item.id, ...item.attributes };
|
|
3280
|
+
return merged;
|
|
3279
3281
|
}
|
|
3280
3282
|
|
|
3281
3283
|
/**
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/formatter.ts","../src/utils/file.ts","../src/utils/naming.ts","../src/shared/type-mapper.ts","../src/output/typescript/types.ts","../src/output/jsdoc/types.ts","../src/types/generator.ts","../src/output/jsdoc/services.ts","../src/services/generator.ts","../src/frameworks/astro/actions.ts","../src/actions/generator.ts","../src/client/generator.ts","../src/locales/generator.ts","../src/by-feature/generator.ts","../src/frameworks/nextjs/actions.ts","../src/frameworks/nuxt/server-routes.ts","../src/frameworks/index.ts"],"names":["path","generateUtilityTypes","generateCollectionType","generateSingleType","generateComponentType","generateCollectionService","generateSingleService","generateClient","generateLocalesFile","generateCollectionActions","generateAttributes"],"mappings":";;;;;AAKA,eAAsB,WAAW,IAAA,EAA+B;AAC9D,EAAA,IAAI;AACF,IAAA,OAAO,MAAe,gBAAO,IAAA,EAAM;AAAA,MACjC,MAAA,EAAQ,YAAA;AAAA,MACR,IAAA,EAAM,IAAA;AAAA,MACN,WAAA,EAAa,IAAA;AAAA,MACb,aAAA,EAAe,KAAA;AAAA,MACf,UAAA,EAAY,GAAA;AAAA,MACZ,QAAA,EAAU,CAAA;AAAA,MACV,OAAA,EAAS;AA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"index.js","sourcesContent":["import * as prettier from 'prettier';\n\n/**\n * Format TypeScript code using Prettier\n */\nexport async function formatCode(code: string): Promise<string> {\n try {\n return await prettier.format(code, {\n parser: 'typescript',\n semi: true,\n singleQuote: true,\n trailingComma: 'es5',\n printWidth: 100,\n tabWidth: 2,\n useTabs: false,\n });\n } catch {\n // If formatting fails, return original code\n return code;\n }\n}\n\n/**\n * Format JSON code using Prettier\n */\nexport async function formatJson(code: string): Promise<string> {\n try {\n return await prettier.format(code, {\n parser: 'json',\n tabWidth: 2,\n });\n } catch {\n return code;\n }\n}\n","import fs from 'node:fs/promises';\nimport path from 'node:path';\n\n/**\n * Ensure a directory exists, creating it if necessary\n */\nexport async function ensureDir(dirPath: string): Promise<void> {\n try {\n await fs.mkdir(dirPath, { recursive: true });\n } catch (error) {\n // Ignore if directory already exists\n if ((error as NodeJS.ErrnoException).code !== 'EEXIST') {\n throw error;\n }\n }\n}\n\n/**\n * Write content to a file, creating parent directories if needed\n */\nexport async function writeFile(filePath: string, content: string): Promise<void> {\n const dir = path.dirname(filePath);\n await ensureDir(dir);\n await fs.writeFile(filePath, content, 'utf-8');\n}\n\n/**\n * Read a file's content\n */\nexport async function readFile(filePath: string): Promise<string> {\n return await fs.readFile(filePath, 'utf-8');\n}\n\n/**\n * Check if a file exists\n */\nexport async function fileExists(filePath: string): Promise<boolean> {\n try {\n await fs.access(filePath);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Delete a file if it exists\n */\nexport async function deleteFile(filePath: string): Promise<void> {\n try {\n await fs.unlink(filePath);\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== 'ENOENT') {\n throw error;\n }\n }\n}\n\n/**\n * List files in a directory matching a pattern\n */\nexport async function listFiles(dirPath: string, extension?: string): Promise<string[]> {\n try {\n const entries = await fs.readdir(dirPath, { withFileTypes: true });\n let files = entries\n .filter((entry) => entry.isFile())\n .map((entry) => path.join(dirPath, entry.name));\n\n if (extension) {\n files = files.filter((file) => file.endsWith(extension));\n }\n\n return files;\n } catch {\n return [];\n }\n}\n","/**\n * Convert string to PascalCase\n */\nexport function toPascalCase(str: string): string {\n return str\n .split(/[-_\\s]+/)\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join('');\n}\n\n/**\n * Convert string to camelCase\n */\nexport function toCamelCase(str: string): string {\n const pascal = toPascalCase(str);\n return pascal.charAt(0).toLowerCase() + pascal.slice(1);\n}\n\n/**\n * Convert string to kebab-case\n */\nexport function toKebabCase(str: string): string {\n return str\n .replace(/([a-z])([A-Z])/g, '$1-$2')\n .replace(/[\\s_]+/g, '-')\n .toLowerCase();\n}\n\n/**\n * Pluralize a word (simple version)\n */\nexport function pluralize(word: string): string {\n if (word.endsWith('s') || word.endsWith('x') || word.endsWith('ch') || word.endsWith('sh')) {\n return word + 'es';\n }\n if (word.endsWith('y') && !['a', 'e', 'i', 'o', 'u'].includes(word.charAt(word.length - 2))) {\n return word.slice(0, -1) + 'ies';\n }\n return word + 's';\n}\n","/**\n * Type mapping utilities\n * Shared logic for converting Strapi attributes to TypeScript/JSDoc types\n */\n\nimport type { Attribute, ComponentType } from '@strapi2front/core';\nimport { toPascalCase } from '../utils/naming.js';\n\n/**\n * Mapped type information\n */\nexport interface MappedType {\n /** The type string (e.g., \"string\", \"number\", \"Article\") */\n type: string;\n /** Whether this type needs an import */\n needsImport: boolean;\n /** Import details if needed */\n import?: {\n name: string;\n from: string;\n isRelation?: boolean;\n isComponent?: boolean;\n };\n}\n\n/**\n * Convert Strapi attribute to type string\n */\nexport function mapAttributeToType(attr: Attribute, _components: ComponentType[]): MappedType {\n switch (attr.type) {\n case 'string':\n case 'text':\n case 'richtext':\n case 'email':\n case 'password':\n case 'uid':\n return { type: 'string', needsImport: false };\n\n case 'blocks':\n return {\n type: 'BlocksContent',\n needsImport: true,\n import: { name: 'BlocksContent', from: 'utils' }\n };\n\n case 'integer':\n case 'biginteger':\n case 'float':\n case 'decimal':\n return { type: 'number', needsImport: false };\n\n case 'boolean':\n return { type: 'boolean', needsImport: false };\n\n case 'date':\n case 'time':\n case 'datetime':\n case 'timestamp':\n return { type: 'string', needsImport: false };\n\n case 'json':\n return { type: 'unknown', needsImport: false };\n\n case 'enumeration':\n if ('enum' in attr && attr.enum) {\n return {\n type: attr.enum.map((v) => `'${v}'`).join(' | '),\n needsImport: false\n };\n }\n return { type: 'string', needsImport: false };\n\n case 'media':\n if ('multiple' in attr && attr.multiple) {\n return {\n type: 'StrapiMedia[]',\n needsImport: true,\n import: { name: 'StrapiMedia', from: 'utils' }\n };\n }\n return {\n type: 'StrapiMedia | null',\n needsImport: true,\n import: { name: 'StrapiMedia', from: 'utils' }\n };\n\n case 'relation':\n if ('target' in attr && attr.target) {\n const targetName = attr.target.split('.').pop() || 'unknown';\n const typeName = toPascalCase(targetName);\n const isMany = attr.relation === 'oneToMany' || attr.relation === 'manyToMany';\n return {\n type: isMany ? `${typeName}[]` : `${typeName} | null`,\n needsImport: true,\n import: { name: typeName, from: targetName, isRelation: true }\n };\n }\n return { type: 'unknown', needsImport: false };\n\n case 'component':\n if ('component' in attr && attr.component) {\n const componentName = attr.component.split('.').pop() || 'unknown';\n const typeName = toPascalCase(componentName);\n if ('repeatable' in attr && attr.repeatable) {\n return {\n type: `${typeName}[]`,\n needsImport: true,\n import: { name: typeName, from: componentName, isComponent: true }\n };\n }\n return {\n type: `${typeName} | null`,\n needsImport: true,\n import: { name: typeName, from: componentName, isComponent: true }\n };\n }\n return { type: 'unknown', needsImport: false };\n\n case 'dynamiczone':\n if ('components' in attr && attr.components) {\n const types = attr.components.map((c) => {\n const name = c.split('.').pop() || 'unknown';\n return toPascalCase(name);\n });\n return {\n type: `(${types.join(' | ')})[]`,\n needsImport: true,\n // Dynamic zones need multiple imports, handled separately\n };\n }\n return { type: 'unknown[]', needsImport: false };\n\n default:\n return { type: 'unknown', needsImport: false };\n }\n}\n\n/**\n * Get JSDoc type annotation for an attribute\n */\nexport function getJSDocType(mappedType: MappedType): string {\n return mappedType.type;\n}\n\n/**\n * Get attribute comment/description\n */\nexport function getAttributeComment(attr: Attribute): string | null {\n const parts: string[] = [];\n\n if (attr.required) {\n parts.push('Required');\n }\n\n if ('minLength' in attr && attr.minLength !== undefined) {\n parts.push(`Min length: ${attr.minLength}`);\n }\n\n if ('maxLength' in attr && attr.maxLength !== undefined) {\n parts.push(`Max length: ${attr.maxLength}`);\n }\n\n if ('min' in attr && attr.min !== undefined) {\n parts.push(`Min: ${attr.min}`);\n }\n\n if ('max' in attr && attr.max !== undefined) {\n parts.push(`Max: ${attr.max}`);\n }\n\n return parts.length > 0 ? parts.join(', ') : null;\n}\n\n/**\n * Extract all dependencies (relations and components) from attributes\n */\nexport function extractDependencies(\n attributes: Record<string, Attribute>,\n selfName: string\n): { relations: Set<string>; components: Set<string> } {\n const relations = new Set<string>();\n const components = new Set<string>();\n\n for (const attr of Object.values(attributes)) {\n if (attr.type === 'relation' && 'target' in attr && attr.target) {\n const targetName = attr.target.split('.').pop() || '';\n const typeName = toPascalCase(targetName);\n // Don't import self\n if (typeName !== selfName && targetName) {\n relations.add(targetName);\n }\n }\n\n if (attr.type === 'component' && 'component' in attr && attr.component) {\n const componentName = attr.component.split('.').pop() || '';\n if (componentName) {\n components.add(componentName);\n }\n }\n\n if (attr.type === 'dynamiczone' && 'components' in attr && attr.components) {\n for (const comp of attr.components) {\n const componentName = comp.split('.').pop() || '';\n if (componentName) {\n components.add(componentName);\n }\n }\n }\n }\n\n return { relations, components };\n}\n","/**\n * TypeScript type generator\n * Generates .ts files with interfaces\n */\n\nimport path from 'node:path';\nimport type { ParsedSchema, CollectionType, SingleType, ComponentType, Attribute } from '@strapi2front/core';\nimport type { StrapiVersion } from '../../shared/types.js';\nimport { formatCode } from '../../utils/formatter.js';\nimport { writeFile, ensureDir } from '../../utils/file.js';\nimport { toPascalCase, toKebabCase } from '../../utils/naming.js';\nimport { mapAttributeToType, getAttributeComment, extractDependencies } from '../../shared/type-mapper.js';\n\nexport interface TypeScriptTypesOptions {\n outputDir: string;\n blocksRendererInstalled?: boolean;\n strapiVersion?: StrapiVersion;\n}\n\n/**\n * Generate TypeScript types from parsed schema\n */\nexport async function generateTypeScriptTypes(\n schema: ParsedSchema,\n options: TypeScriptTypesOptions\n): Promise<string[]> {\n const { outputDir } = options;\n const generatedFiles: string[] = [];\n\n // Ensure directories exist\n await ensureDir(path.join(outputDir, 'collections'));\n await ensureDir(path.join(outputDir, 'components'));\n\n // Generate utility types\n const utilsPath = path.join(outputDir, 'utils.ts');\n const strapiVersion = options.strapiVersion ?? 'v5';\n await writeFile(utilsPath, await formatCode(generateUtilityTypes(options.blocksRendererInstalled ?? false, strapiVersion)));\n generatedFiles.push(utilsPath);\n\n // Generate collection types\n for (const collection of schema.collections) {\n const fileName = `${toKebabCase(collection.singularName)}.ts`;\n const filePath = path.join(outputDir, 'collections', fileName);\n const content = generateCollectionType(collection, schema.components);\n await writeFile(filePath, await formatCode(content));\n generatedFiles.push(filePath);\n }\n\n // Generate single types\n for (const single of schema.singles) {\n const fileName = `${toKebabCase(single.singularName)}.ts`;\n const filePath = path.join(outputDir, 'collections', fileName);\n const content = generateSingleType(single, schema.components);\n await writeFile(filePath, await formatCode(content));\n generatedFiles.push(filePath);\n }\n\n // Generate component types\n for (const component of schema.components) {\n const fileName = `${toKebabCase(component.name)}.ts`;\n const filePath = path.join(outputDir, 'components', fileName);\n const content = generateComponentType(component);\n await writeFile(filePath, await formatCode(content));\n generatedFiles.push(filePath);\n }\n\n return generatedFiles;\n}\n\n/**\n * Generate utility types\n */\nfunction generateUtilityTypes(blocksRendererInstalled: boolean, strapiVersion: StrapiVersion): string {\n const isV4 = strapiVersion === \"v4\";\n\n const blocksContentType = isV4\n ? `/**\n * Rich text content (Strapi v4)\n * Can be markdown string or custom JSON structure\n */\nexport type RichTextContent = string;`\n : blocksRendererInstalled\n ? `/**\n * Blocks content type (Strapi v5 rich text)\n * Re-exported from @strapi/blocks-react-renderer\n */\nexport type { BlocksContent } from '@strapi/blocks-react-renderer';`\n : `/**\n * Blocks content type (Strapi v5 rich text)\n *\n * For full type support and rendering, install:\n * npm install @strapi/blocks-react-renderer\n *\n * Then re-run: npx strapi2front sync\n */\nexport type BlocksContent = unknown[];`;\n\n const baseEntity = isV4\n ? `/**\n * Base entity fields (Strapi v4)\n */\nexport interface StrapiBaseEntity {\n id: number;\n createdAt: string;\n updatedAt: string;\n publishedAt: string | null;\n}`\n : `/**\n * Base entity fields (Strapi v5)\n */\nexport interface StrapiBaseEntity {\n id: number;\n documentId: string;\n createdAt: string;\n updatedAt: string;\n publishedAt: string | null;\n}`;\n\n const mediaType = isV4\n ? `/**\n * Strapi media object (v4)\n */\nexport interface StrapiMedia {\n id: number;\n name: string;\n alternativeText: string | null;\n caption: string | null;\n width: number;\n height: number;\n formats: {\n thumbnail?: StrapiMediaFormat;\n small?: StrapiMediaFormat;\n medium?: StrapiMediaFormat;\n large?: StrapiMediaFormat;\n } | null;\n hash: string;\n ext: string;\n mime: string;\n size: number;\n url: string;\n previewUrl: string | null;\n provider: string;\n createdAt: string;\n updatedAt: string;\n}`\n : `/**\n * Strapi media object (v5)\n */\nexport interface StrapiMedia {\n id: number;\n documentId: string;\n name: string;\n alternativeText: string | null;\n caption: string | null;\n width: number;\n height: number;\n formats: {\n thumbnail?: StrapiMediaFormat;\n small?: StrapiMediaFormat;\n medium?: StrapiMediaFormat;\n large?: StrapiMediaFormat;\n } | null;\n hash: string;\n ext: string;\n mime: string;\n size: number;\n url: string;\n previewUrl: string | null;\n provider: string;\n createdAt: string;\n updatedAt: string;\n}`;\n\n const rawResponseTypes = isV4\n ? `\n/**\n * Strapi v4 raw API response (with nested attributes)\n */\nexport interface StrapiV4RawItem<T> {\n id: number;\n attributes: Omit<T, 'id'>;\n}\n\nexport interface StrapiV4RawResponse<T> {\n data: StrapiV4RawItem<T>;\n meta: Record<string, unknown>;\n}\n\nexport interface StrapiV4RawListResponse<T> {\n data: StrapiV4RawItem<T>[];\n meta: {\n pagination: StrapiPagination;\n };\n}\n\n/**\n * Flatten Strapi v4 response item\n */\nexport function flattenV4Response<T>(item: StrapiV4RawItem<T>): T {\n return { id: item.id, ...item.attributes } as T;\n}\n\n/**\n * Flatten Strapi v4 list response\n */\nexport function flattenV4ListResponse<T>(items: StrapiV4RawItem<T>[]): T[] {\n return items.map(item => flattenV4Response<T>(item));\n}`\n : '';\n\n return `/**\n * Strapi utility types\n * Generated by strapi2front\n * Strapi version: ${strapiVersion}\n */\n\n${mediaType}\n\nexport interface StrapiMediaFormat {\n name: string;\n hash: string;\n ext: string;\n mime: string;\n width: number;\n height: number;\n size: number;\n url: string;\n}\n\n/**\n * Strapi pagination\n */\nexport interface StrapiPagination {\n page: number;\n pageSize: number;\n pageCount: number;\n total: number;\n}\n\n/**\n * Strapi response wrapper\n */\nexport interface StrapiResponse<T> {\n data: T;\n meta: {\n pagination?: StrapiPagination;\n };\n}\n\n/**\n * Strapi list response\n */\nexport interface StrapiListResponse<T> {\n data: T[];\n meta: {\n pagination: StrapiPagination;\n };\n}\n\n${baseEntity}\n${rawResponseTypes}\n${blocksContentType}\n`;\n}\n\n/**\n * Generate import statements for dependencies\n */\nfunction generateDependencyImports(\n relations: Set<string>,\n components: Set<string>\n): string {\n const imports: string[] = [];\n\n // Import relations (other collections/singles)\n for (const relation of relations) {\n const typeName = toPascalCase(relation);\n const fileName = toKebabCase(relation);\n imports.push(`import type { ${typeName} } from './${fileName}';`);\n }\n\n // Import components\n for (const component of components) {\n const typeName = toPascalCase(component);\n const fileName = toKebabCase(component);\n imports.push(`import type { ${typeName} } from '../components/${fileName}';`);\n }\n\n return imports.join('\\n');\n}\n\n/**\n * Generate type for a collection\n */\nfunction generateCollectionType(collection: CollectionType, components: ComponentType[]): string {\n const typeName = toPascalCase(collection.singularName);\n const attributes = generateAttributes(collection.attributes, components);\n const { relations, components: componentDeps } = extractDependencies(collection.attributes, typeName);\n const dependencyImports = generateDependencyImports(relations, componentDeps);\n\n // Build utils imports based on what's actually used\n const utilsImports: string[] = ['StrapiBaseEntity'];\n const attributesStr = JSON.stringify(collection.attributes);\n if (attributesStr.includes('\"type\":\"media\"')) {\n utilsImports.push('StrapiMedia');\n }\n if (attributesStr.includes('\"type\":\"blocks\"')) {\n utilsImports.push('BlocksContent');\n }\n\n return `/**\n * ${collection.displayName}\n * ${collection.description || ''}\n * Generated by strapi2front\n */\n\nimport type { ${utilsImports.join(', ')} } from '../utils';\n${dependencyImports ? dependencyImports + '\\n' : ''}\nexport interface ${typeName} extends StrapiBaseEntity {\n${attributes}\n}\n\nexport interface ${typeName}Filters {\n id?: number | { $eq?: number; $ne?: number; $in?: number[]; $notIn?: number[] };\n documentId?: string | { $eq?: string; $ne?: string };\n createdAt?: string | { $eq?: string; $gt?: string; $gte?: string; $lt?: string; $lte?: string };\n updatedAt?: string | { $eq?: string; $gt?: string; $gte?: string; $lt?: string; $lte?: string };\n publishedAt?: string | null | { $eq?: string; $ne?: string; $null?: boolean };\n $and?: ${typeName}Filters[];\n $or?: ${typeName}Filters[];\n $not?: ${typeName}Filters;\n}\n\nexport interface ${typeName}Sort {\n field: keyof ${typeName};\n order: 'asc' | 'desc';\n}\n`;\n}\n\n/**\n * Generate type for a single type\n */\nfunction generateSingleType(single: SingleType, components: ComponentType[]): string {\n const typeName = toPascalCase(single.singularName);\n const attributes = generateAttributes(single.attributes, components);\n const { relations, components: componentDeps } = extractDependencies(single.attributes, typeName);\n const dependencyImports = generateDependencyImports(relations, componentDeps);\n\n // Build utils imports based on what's actually used\n const utilsImports: string[] = ['StrapiBaseEntity'];\n const attributesStr = JSON.stringify(single.attributes);\n if (attributesStr.includes('\"type\":\"media\"')) {\n utilsImports.push('StrapiMedia');\n }\n if (attributesStr.includes('\"type\":\"blocks\"')) {\n utilsImports.push('BlocksContent');\n }\n\n return `/**\n * ${single.displayName}\n * ${single.description || ''}\n * Generated by strapi2front\n */\n\nimport type { ${utilsImports.join(', ')} } from '../utils';\n${dependencyImports ? dependencyImports + '\\n' : ''}\nexport interface ${typeName} extends StrapiBaseEntity {\n${attributes}\n}\n`;\n}\n\n/**\n * Generate type for a component\n */\nfunction generateComponentType(component: ComponentType): string {\n const typeName = toPascalCase(component.name);\n const attributes = generateAttributes(component.attributes, []);\n const { relations, components: componentDeps } = extractDependencies(component.attributes, typeName);\n\n // For components, relations import from collections and other components import from same folder\n const imports: string[] = [];\n\n for (const relation of relations) {\n const relTypeName = toPascalCase(relation);\n const fileName = toKebabCase(relation);\n imports.push(`import type { ${relTypeName} } from '../collections/${fileName}';`);\n }\n\n for (const comp of componentDeps) {\n const compTypeName = toPascalCase(comp);\n const fileName = toKebabCase(comp);\n // Don't import self\n if (compTypeName !== typeName) {\n imports.push(`import type { ${compTypeName} } from './${fileName}';`);\n }\n }\n\n // Build utils imports based on what's actually used\n const utilsImports: string[] = [];\n const attributesStr = JSON.stringify(component.attributes);\n if (attributesStr.includes('\"type\":\"media\"')) {\n utilsImports.push('StrapiMedia');\n }\n if (attributesStr.includes('\"type\":\"blocks\"')) {\n utilsImports.push('BlocksContent');\n }\n\n const utilsImportLine = utilsImports.length > 0\n ? `import type { ${utilsImports.join(', ')} } from '../utils';\\n`\n : '';\n const dependencyImports = imports.length > 0 ? imports.join('\\n') + '\\n' : '';\n\n return `/**\n * ${component.displayName} component\n * Category: ${component.category}\n * ${component.description || ''}\n * Generated by strapi2front\n */\n\n${utilsImportLine}${dependencyImports}\nexport interface ${typeName} {\n id: number;\n${attributes}\n}\n`;\n}\n\n/**\n * Generate TypeScript properties from Strapi attributes\n */\nfunction generateAttributes(\n attributes: Record<string, Attribute>,\n components: ComponentType[]\n): string {\n const lines: string[] = [];\n\n for (const [name, attr] of Object.entries(attributes)) {\n const mappedType = mapAttributeToType(attr, components);\n const optional = attr.required ? '' : '?';\n const comment = getAttributeComment(attr);\n\n if (comment) {\n lines.push(` /** ${comment} */`);\n }\n lines.push(` ${name}${optional}: ${mappedType.type};`);\n }\n\n return lines.join('\\n');\n}\n","/**\n * JSDoc type generator\n * Generates .js files with JSDoc annotations for type safety without TypeScript\n */\n\nimport path from 'node:path';\nimport type { ParsedSchema, CollectionType, SingleType, ComponentType, Attribute } from '@strapi2front/core';\nimport type { StrapiVersion } from '../../shared/types.js';\nimport { writeFile, ensureDir } from '../../utils/file.js';\nimport { toPascalCase, toKebabCase } from '../../utils/naming.js';\nimport { mapAttributeToType, getAttributeComment, extractDependencies } from '../../shared/type-mapper.js';\n\nexport interface JSDocTypesOptions {\n outputDir: string;\n blocksRendererInstalled?: boolean;\n strapiVersion?: StrapiVersion;\n}\n\n/**\n * Generate JSDoc types from parsed schema\n */\nexport async function generateJSDocTypes(\n schema: ParsedSchema,\n options: JSDocTypesOptions\n): Promise<string[]> {\n const { outputDir } = options;\n const generatedFiles: string[] = [];\n\n // Ensure directories exist\n await ensureDir(path.join(outputDir, 'collections'));\n await ensureDir(path.join(outputDir, 'components'));\n\n // Generate utility types\n const utilsPath = path.join(outputDir, 'utils.js');\n const strapiVersion = options.strapiVersion ?? 'v5';\n await writeFile(utilsPath, generateUtilityTypes(strapiVersion));\n generatedFiles.push(utilsPath);\n\n // Generate collection types\n for (const collection of schema.collections) {\n const fileName = `${toKebabCase(collection.singularName)}.js`;\n const filePath = path.join(outputDir, 'collections', fileName);\n const content = generateCollectionType(collection, schema.components, strapiVersion);\n await writeFile(filePath, content);\n generatedFiles.push(filePath);\n }\n\n // Generate single types\n for (const single of schema.singles) {\n const fileName = `${toKebabCase(single.singularName)}.js`;\n const filePath = path.join(outputDir, 'collections', fileName);\n const content = generateSingleType(single, schema.components, strapiVersion);\n await writeFile(filePath, content);\n generatedFiles.push(filePath);\n }\n\n // Generate component types\n for (const component of schema.components) {\n const fileName = `${toKebabCase(component.name)}.js`;\n const filePath = path.join(outputDir, 'components', fileName);\n const content = generateComponentType(component, strapiVersion);\n await writeFile(filePath, content);\n generatedFiles.push(filePath);\n }\n\n return generatedFiles;\n}\n\n/**\n * Generate utility types with JSDoc\n */\nfunction generateUtilityTypes(strapiVersion: StrapiVersion): string {\n const isV4 = strapiVersion === \"v4\";\n\n const baseEntityFields = isV4\n ? ` * @property {number} id\n * @property {string} createdAt\n * @property {string} updatedAt\n * @property {string|null} publishedAt`\n : ` * @property {number} id\n * @property {string} documentId\n * @property {string} createdAt\n * @property {string} updatedAt\n * @property {string|null} publishedAt`;\n\n const mediaFields = isV4\n ? ` * @property {number} id`\n : ` * @property {number} id\n * @property {string} documentId`;\n\n return `/**\n * Strapi utility types (JSDoc)\n * Generated by strapi2front\n * Strapi version: ${strapiVersion}\n *\n * These types provide IntelliSense support in JavaScript projects.\n */\n\n/**\n * Strapi media format\n * @typedef {Object} StrapiMediaFormat\n * @property {string} name\n * @property {string} hash\n * @property {string} ext\n * @property {string} mime\n * @property {number} width\n * @property {number} height\n * @property {number} size\n * @property {string} url\n */\n\n/**\n * Strapi media object\n * @typedef {Object} StrapiMedia\n${mediaFields}\n * @property {string} name\n * @property {string|null} alternativeText\n * @property {string|null} caption\n * @property {number} width\n * @property {number} height\n * @property {{thumbnail?: StrapiMediaFormat, small?: StrapiMediaFormat, medium?: StrapiMediaFormat, large?: StrapiMediaFormat}|null} formats\n * @property {string} hash\n * @property {string} ext\n * @property {string} mime\n * @property {number} size\n * @property {string} url\n * @property {string|null} previewUrl\n * @property {string} provider\n * @property {string} createdAt\n * @property {string} updatedAt\n */\n\n/**\n * Strapi pagination\n * @typedef {Object} StrapiPagination\n * @property {number} page\n * @property {number} pageSize\n * @property {number} pageCount\n * @property {number} total\n */\n\n/**\n * Strapi response wrapper\n * @template T\n * @typedef {Object} StrapiResponse\n * @property {T} data\n * @property {{pagination?: StrapiPagination}} meta\n */\n\n/**\n * Strapi list response\n * @template T\n * @typedef {Object} StrapiListResponse\n * @property {T[]} data\n * @property {{pagination: StrapiPagination}} meta\n */\n\n/**\n * Base entity fields\n * @typedef {Object} StrapiBaseEntity\n${baseEntityFields}\n */\n\n/**\n * Blocks content type (rich text)\n * @typedef {unknown[]} BlocksContent\n */\n\n// Export empty object to make this a module\nexport {};\n`;\n}\n\n/**\n * Generate JSDoc type for a collection\n */\nfunction generateCollectionType(\n collection: CollectionType,\n components: ComponentType[],\n strapiVersion: StrapiVersion\n): string {\n const typeName = toPascalCase(collection.singularName);\n const isV4 = strapiVersion === \"v4\";\n const { relations, components: componentDeps } = extractDependencies(collection.attributes, typeName);\n\n // Generate imports\n const imports = generateJSDocImports(relations, componentDeps, 'collection');\n\n // Generate properties\n const properties = generateJSDocProperties(collection.attributes, components);\n\n // Base fields\n const baseFields = isV4\n ? ` * @property {number} id\n * @property {string} createdAt\n * @property {string} updatedAt\n * @property {string|null} publishedAt`\n : ` * @property {number} id\n * @property {string} documentId\n * @property {string} createdAt\n * @property {string} updatedAt\n * @property {string|null} publishedAt`;\n\n return `/**\n * ${collection.displayName}\n * ${collection.description || ''}\n * Generated by strapi2front\n * Strapi version: ${strapiVersion}\n */\n\n${imports}\n\n/**\n * ${collection.displayName}\n * @typedef {Object} ${typeName}\n${baseFields}\n${properties}\n */\n\n/**\n * ${typeName} filters for querying\n * @typedef {Object} ${typeName}Filters\n * @property {number|{$eq?: number, $ne?: number, $in?: number[], $notIn?: number[]}} [id]\n * @property {string|{$eq?: string, $ne?: string}} [documentId]\n * @property {string|{$eq?: string, $gt?: string, $gte?: string, $lt?: string, $lte?: string}} [createdAt]\n * @property {string|{$eq?: string, $gt?: string, $gte?: string, $lt?: string, $lte?: string}} [updatedAt]\n * @property {string|null|{$eq?: string, $ne?: string, $null?: boolean}} [publishedAt]\n * @property {${typeName}Filters[]} [$and]\n * @property {${typeName}Filters[]} [$or]\n * @property {${typeName}Filters} [$not]\n */\n\n// Export empty object to make this a module\nexport {};\n`;\n}\n\n/**\n * Generate JSDoc type for a single type\n */\nfunction generateSingleType(\n single: SingleType,\n components: ComponentType[],\n strapiVersion: StrapiVersion\n): string {\n const typeName = toPascalCase(single.singularName);\n const isV4 = strapiVersion === \"v4\";\n const { relations, components: componentDeps } = extractDependencies(single.attributes, typeName);\n\n // Generate imports\n const imports = generateJSDocImports(relations, componentDeps, 'collection');\n\n // Generate properties\n const properties = generateJSDocProperties(single.attributes, components);\n\n // Base fields\n const baseFields = isV4\n ? ` * @property {number} id\n * @property {string} createdAt\n * @property {string} updatedAt`\n : ` * @property {number} id\n * @property {string} documentId\n * @property {string} createdAt\n * @property {string} updatedAt`;\n\n return `/**\n * ${single.displayName}\n * ${single.description || ''}\n * Generated by strapi2front\n * Strapi version: ${strapiVersion}\n */\n\n${imports}\n\n/**\n * ${single.displayName}\n * @typedef {Object} ${typeName}\n${baseFields}\n${properties}\n */\n\n// Export empty object to make this a module\nexport {};\n`;\n}\n\n/**\n * Generate JSDoc type for a component\n */\nfunction generateComponentType(component: ComponentType, strapiVersion: StrapiVersion): string {\n const typeName = toPascalCase(component.name);\n const { relations, components: componentDeps } = extractDependencies(component.attributes, typeName);\n\n // Generate imports\n const imports = generateJSDocImports(relations, componentDeps, 'component');\n\n // Generate properties\n const properties = generateJSDocProperties(component.attributes, []);\n\n return `/**\n * ${component.displayName} component\n * Category: ${component.category}\n * ${component.description || ''}\n * Generated by strapi2front\n * Strapi version: ${strapiVersion}\n */\n\n${imports}\n\n/**\n * ${component.displayName}\n * @typedef {Object} ${typeName}\n * @property {number} id\n${properties}\n */\n\n// Export empty object to make this a module\nexport {};\n`;\n}\n\n/**\n * Generate JSDoc imports\n */\nfunction generateJSDocImports(\n relations: Set<string>,\n components: Set<string>,\n context: 'collection' | 'component'\n): string {\n const imports: string[] = [];\n\n // Import from utils\n imports.push(`/** @typedef {import('../utils').StrapiMedia} StrapiMedia */`);\n imports.push(`/** @typedef {import('../utils').BlocksContent} BlocksContent */`);\n\n // Import relations\n for (const relation of relations) {\n const typeName = toPascalCase(relation);\n const fileName = toKebabCase(relation);\n if (context === 'component') {\n imports.push(`/** @typedef {import('../collections/${fileName}').${typeName}} ${typeName} */`);\n } else {\n imports.push(`/** @typedef {import('./${fileName}').${typeName}} ${typeName} */`);\n }\n }\n\n // Import components\n for (const component of components) {\n const typeName = toPascalCase(component);\n const fileName = toKebabCase(component);\n if (context === 'component') {\n imports.push(`/** @typedef {import('./${fileName}').${typeName}} ${typeName} */`);\n } else {\n imports.push(`/** @typedef {import('../components/${fileName}').${typeName}} ${typeName} */`);\n }\n }\n\n return imports.join('\\n');\n}\n\n/**\n * Generate JSDoc properties from Strapi attributes\n */\nfunction generateJSDocProperties(\n attributes: Record<string, Attribute>,\n components: ComponentType[]\n): string {\n const lines: string[] = [];\n\n for (const [name, attr] of Object.entries(attributes)) {\n const mappedType = mapAttributeToType(attr, components);\n const jsDocType = convertToJSDocType(mappedType.type);\n const comment = getAttributeComment(attr);\n const commentPart = comment ? ` - ${comment}` : '';\n\n // In JSDoc, [name] indicates optional. Required fields don't use brackets.\n if (attr.required) {\n lines.push(` * @property {${jsDocType}} ${name}${commentPart}`);\n } else {\n lines.push(` * @property {${jsDocType}} [${name}]${commentPart}`);\n }\n }\n\n return lines.join('\\n');\n}\n\n/**\n * Convert TypeScript type to JSDoc type\n */\nfunction convertToJSDocType(tsType: string): string {\n // Handle union types with null\n if (tsType.includes(' | null')) {\n const baseType = tsType.replace(' | null', '');\n return `${baseType}|null`;\n }\n\n // Handle arrays\n if (tsType.endsWith('[]')) {\n const baseType = tsType.slice(0, -2);\n // Handle union arrays like (A | B)[]\n if (baseType.startsWith('(') && baseType.endsWith(')')) {\n return `Array<${baseType.slice(1, -1).replace(/ \\| /g, '|')}>`;\n }\n return `${baseType}[]`;\n }\n\n // Handle string literal unions (enums)\n if (tsType.includes(\"'\") && tsType.includes(' | ')) {\n return 'string';\n }\n\n return tsType;\n}\n","/**\n * Type generator\n * Supports TypeScript (.ts) and JSDoc (.js) output formats\n */\n\nimport type { ParsedSchema } from '@strapi2front/core';\nimport type { OutputFormat, StrapiVersion } from '../shared/types.js';\nimport { generateTypeScriptTypes } from '../output/typescript/types.js';\nimport { generateJSDocTypes } from '../output/jsdoc/types.js';\n\nexport interface TypeGeneratorOptions {\n outputDir: string;\n blocksRendererInstalled?: boolean;\n strapiVersion?: StrapiVersion;\n /**\n * Output format: 'typescript' for .ts files, 'jsdoc' for .js with JSDoc annotations\n * @default 'typescript'\n */\n outputFormat?: OutputFormat;\n}\n\n/**\n * Generate types from parsed schema\n * Supports both TypeScript and JSDoc output formats\n */\nexport async function generateTypes(\n schema: ParsedSchema,\n options: TypeGeneratorOptions\n): Promise<string[]> {\n const outputFormat = options.outputFormat ?? 'typescript';\n\n if (outputFormat === 'jsdoc') {\n return generateJSDocTypes(schema, {\n outputDir: options.outputDir,\n blocksRendererInstalled: options.blocksRendererInstalled,\n strapiVersion: options.strapiVersion,\n });\n }\n\n // Default: TypeScript\n return generateTypeScriptTypes(schema, {\n outputDir: options.outputDir,\n blocksRendererInstalled: options.blocksRendererInstalled,\n strapiVersion: options.strapiVersion,\n });\n}\n","/**\n * JSDoc service generator\n * Generates .js files with JSDoc annotations for services\n */\n\nimport path from 'node:path';\nimport type { ParsedSchema, CollectionType, SingleType } from '@strapi2front/core';\nimport type { StrapiVersion } from '../../shared/types.js';\nimport { writeFile, ensureDir } from '../../utils/file.js';\nimport { toPascalCase, toCamelCase, toKebabCase } from '../../utils/naming.js';\n\nexport interface JSDocServicesOptions {\n outputDir: string;\n typesImportPath: string;\n strapiVersion?: StrapiVersion;\n}\n\n/**\n * Generate JSDoc service files from parsed schema\n */\nexport async function generateJSDocServices(\n schema: ParsedSchema,\n options: JSDocServicesOptions\n): Promise<string[]> {\n const { outputDir, typesImportPath, strapiVersion = \"v5\" } = options;\n const generatedFiles: string[] = [];\n\n await ensureDir(outputDir);\n\n // Generate services for collections\n for (const collection of schema.collections) {\n const fileName = `${toKebabCase(collection.singularName)}.service.js`;\n const filePath = path.join(outputDir, fileName);\n const content = generateCollectionService(collection, typesImportPath, strapiVersion);\n await writeFile(filePath, content);\n generatedFiles.push(filePath);\n }\n\n // Generate services for single types\n for (const single of schema.singles) {\n const fileName = `${toKebabCase(single.singularName)}.service.js`;\n const filePath = path.join(outputDir, fileName);\n const content = generateSingleService(single, typesImportPath, strapiVersion);\n await writeFile(filePath, content);\n generatedFiles.push(filePath);\n }\n\n return generatedFiles;\n}\n\n/**\n * Generate service for a collection type\n */\nfunction generateCollectionService(\n collection: CollectionType,\n typesImportPath: string,\n strapiVersion: StrapiVersion\n): string {\n const typeName = toPascalCase(collection.singularName);\n const serviceName = toCamelCase(collection.singularName) + 'Service';\n const fileName = toKebabCase(collection.singularName);\n const endpoint = collection.pluralName;\n const isV4 = strapiVersion === \"v4\";\n\n const idParam = isV4 ? 'id' : 'documentId';\n const idType = isV4 ? 'number' : 'string';\n\n // Feature flags\n const hasSlug = 'slug' in collection.attributes;\n const { localized, draftAndPublish } = collection;\n\n // Build locale and status options\n const localeOption = localized ? '\\n * @property {string} [locale] - Locale code' : '';\n const statusOption = draftAndPublish ? \"\\n * @property {'draft'|'published'} [status] - Publication status\" : '';\n\n const findBySlugMethod = hasSlug ? `\n/**\n * Find one ${collection.singularName} by slug\n * @param {string} slug - The slug to search for\n * @param {FindOneOptions} [options={}] - Query options\n * @returns {Promise<${typeName}|null>}\n */\nasync findBySlug(slug, options = {}) {\n const { data } = await this.findMany({\n filters: { slug: { $eq: slug } },\n pagination: { pageSize: 1 },\n populate: options.populate,${localized ? '\\n locale: options.locale,' : ''}${draftAndPublish ? '\\n status: options.status,' : ''}\n });\n\n return data[0] || null;\n},\n` : '';\n\n return `/**\n * ${collection.displayName} Service\n * ${collection.description || ''}\n * Generated by strapi2front\n * Strapi version: ${strapiVersion}\n */\n\nimport { collection } from '../client.js';\n\n/** @typedef {import('${typesImportPath}/collections/${fileName}').${typeName}} ${typeName} */\n/** @typedef {import('${typesImportPath}/collections/${fileName}').${typeName}Filters} ${typeName}Filters */\n/** @typedef {import('${typesImportPath}/utils').StrapiPagination} StrapiPagination */\n${localized ? `/** @typedef {import('../locales').Locale} Locale */` : ''}\n\n/**\n * @typedef {Object} FindManyOptions\n * @property {${typeName}Filters} [filters] - Filter conditions\n * @property {{page?: number, pageSize?: number, start?: number, limit?: number}} [pagination] - Pagination options\n * @property {string|string[]} [sort] - Sort order\n * @property {string|string[]|Object} [populate] - Relations to populate${localeOption}${statusOption}\n */\n\n/**\n * @typedef {Object} FindOneOptions\n * @property {string|string[]|Object} [populate] - Relations to populate${localeOption}${statusOption}\n */\n\n/** @type {ReturnType<typeof collection<${typeName}>>} */\nconst ${toCamelCase(collection.singularName)}Collection = collection('${endpoint}');\n\nexport const ${serviceName} = {\n /**\n * Find multiple ${collection.pluralName}\n * @param {FindManyOptions} [options={}] - Query options\n * @returns {Promise<{data: ${typeName}[], pagination: StrapiPagination}>}\n */\n async findMany(options = {}) {\n const response = await ${toCamelCase(collection.singularName)}Collection.find({\n filters: options.filters,\n pagination: options.pagination,\n sort: options.sort,\n populate: options.populate,${localized ? '\\n locale: options.locale,' : ''}${draftAndPublish ? '\\n status: options.status,' : ''}\n });\n\n return {\n data: response.data,\n pagination: response.meta.pagination,\n };\n },\n\n /**\n * Find all ${collection.pluralName} (handles pagination automatically)\n * @param {Omit<FindManyOptions, 'pagination'>} [options={}] - Query options\n * @returns {Promise<${typeName}[]>}\n */\n async findAll(options = {}) {\n /** @type {${typeName}[]} */\n const allItems = [];\n let page = 1;\n let hasMore = true;\n\n while (hasMore) {\n const { data, pagination } = await this.findMany({\n ...options,\n pagination: { page, pageSize: 100 },\n });\n\n allItems.push(...data);\n hasMore = page < pagination.pageCount;\n page++;\n }\n\n return allItems;\n },\n\n /**\n * Find one ${collection.singularName} by ${idParam}\n * @param {${idType}} ${idParam} - The ${idParam} to find\n * @param {FindOneOptions} [options={}] - Query options\n * @returns {Promise<${typeName}|null>}\n */\n async findOne(${idParam}, options = {}) {\n try {\n const response = await ${toCamelCase(collection.singularName)}Collection.findOne(${idParam}, {\n populate: options.populate,${localized ? '\\n locale: options.locale,' : ''}${draftAndPublish ? '\\n status: options.status,' : ''}\n });\n\n return response.data;\n } catch (error) {\n if (error instanceof Error && error.message.includes('404')) {\n return null;\n }\n throw error;\n }\n },\n${findBySlugMethod}\n /**\n * Create a new ${collection.singularName}\n * @param {Partial<${typeName}>} data - The data to create\n * @returns {Promise<${typeName}>}\n */\n async create(data) {\n const response = await ${toCamelCase(collection.singularName)}Collection.create({ data });\n return response.data;\n },\n\n /**\n * Update a ${collection.singularName}\n * @param {${idType}} ${idParam} - The ${idParam} to update\n * @param {Partial<${typeName}>} data - The data to update\n * @returns {Promise<${typeName}>}\n */\n async update(${idParam}, data) {\n const response = await ${toCamelCase(collection.singularName)}Collection.update(${idParam}, { data });\n return response.data;\n },\n\n /**\n * Delete a ${collection.singularName}\n * @param {${idType}} ${idParam} - The ${idParam} to delete\n * @returns {Promise<void>}\n */\n async delete(${idParam}) {\n await ${toCamelCase(collection.singularName)}Collection.delete(${idParam});\n },\n\n /**\n * Count ${collection.pluralName}\n * @param {${typeName}Filters} [filters] - Filter conditions\n * @returns {Promise<number>}\n */\n async count(filters) {\n const { pagination } = await this.findMany({\n filters,\n pagination: { pageSize: 1 },\n });\n\n return pagination.total;\n },\n};\n`;\n}\n\n/**\n * Generate service for a single type\n */\nfunction generateSingleService(\n single: SingleType,\n typesImportPath: string,\n strapiVersion: StrapiVersion\n): string {\n const typeName = toPascalCase(single.singularName);\n const serviceName = toCamelCase(single.singularName) + 'Service';\n const fileName = toKebabCase(single.singularName);\n const endpoint = single.singularName;\n\n // Feature flags\n const { localized, draftAndPublish } = single;\n\n // Build locale and status options\n const localeOption = localized ? '\\n * @property {string} [locale] - Locale code' : '';\n const statusOption = draftAndPublish ? \"\\n * @property {'draft'|'published'} [status] - Publication status\" : '';\n\n return `/**\n * ${single.displayName} Service (Single Type)\n * ${single.description || ''}\n * Generated by strapi2front\n * Strapi version: ${strapiVersion}\n */\n\nimport { single } from '../client.js';\n\n/** @typedef {import('${typesImportPath}/collections/${fileName}').${typeName}} ${typeName} */\n${localized ? `/** @typedef {import('../locales').Locale} Locale */` : ''}\n\n/**\n * @typedef {Object} FindOptions\n * @property {string|string[]|Object} [populate] - Relations to populate${localeOption}${statusOption}\n */\n\n/** @type {ReturnType<typeof single<${typeName}>>} */\nconst ${toCamelCase(single.singularName)}Single = single('${endpoint}');\n\nexport const ${serviceName} = {\n /**\n * Get ${single.displayName}\n * @param {FindOptions} [options={}] - Query options\n * @returns {Promise<${typeName}|null>}\n */\n async find(options = {}) {\n try {\n const response = await ${toCamelCase(single.singularName)}Single.find({\n populate: options.populate,${localized ? '\\n locale: options.locale,' : ''}${draftAndPublish ? '\\n status: options.status,' : ''}\n });\n\n return response.data;\n } catch (error) {\n if (error instanceof Error && error.message.includes('404')) {\n return null;\n }\n throw error;\n }\n },\n\n /**\n * Update ${single.displayName}\n * @param {Partial<${typeName}>} data - The data to update\n * @returns {Promise<${typeName}>}\n */\n async update(data) {\n const response = await ${toCamelCase(single.singularName)}Single.update({ data });\n return response.data;\n },\n\n /**\n * Delete ${single.displayName}\n * @returns {Promise<void>}\n */\n async delete() {\n await ${toCamelCase(single.singularName)}Single.delete();\n },\n};\n`;\n}\n","/**\n * Service generator\n * Supports TypeScript (.ts) and JSDoc (.js) output formats\n */\n\nimport path from 'node:path';\nimport type { ParsedSchema, CollectionType, SingleType } from '@strapi2front/core';\nimport type { OutputFormat, StrapiVersion } from '../shared/types.js';\nimport { formatCode } from '../utils/formatter.js';\nimport { writeFile, ensureDir } from '../utils/file.js';\nimport { toPascalCase, toCamelCase, toKebabCase } from '../utils/naming.js';\nimport { generateJSDocServices } from '../output/jsdoc/services.js';\n\nexport interface ServiceGeneratorOptions {\n outputDir: string;\n typesImportPath: string;\n strapiVersion?: StrapiVersion;\n /**\n * Output format: 'typescript' for .ts files, 'jsdoc' for .js with JSDoc annotations\n * @default 'typescript'\n */\n outputFormat?: OutputFormat;\n}\n\n/**\n * Generate service files from parsed schema\n */\nexport async function generateServices(\n schema: ParsedSchema,\n options: ServiceGeneratorOptions\n): Promise<string[]> {\n const outputFormat = options.outputFormat ?? 'typescript';\n\n if (outputFormat === 'jsdoc') {\n return generateJSDocServices(schema, {\n outputDir: options.outputDir,\n typesImportPath: options.typesImportPath,\n strapiVersion: options.strapiVersion,\n });\n }\n\n // Default: TypeScript\n return generateTypeScriptServices(schema, options);\n}\n\n/**\n * Generate TypeScript service files\n */\nasync function generateTypeScriptServices(\n schema: ParsedSchema,\n options: ServiceGeneratorOptions\n): Promise<string[]> {\n const { outputDir, typesImportPath, strapiVersion = \"v5\" } = options;\n const generatedFiles: string[] = [];\n\n await ensureDir(outputDir);\n\n // Generate services for collections\n for (const collection of schema.collections) {\n const fileName = `${toKebabCase(collection.singularName)}.service.ts`;\n const filePath = path.join(outputDir, fileName);\n const content = generateCollectionService(collection, typesImportPath, strapiVersion);\n await writeFile(filePath, await formatCode(content));\n generatedFiles.push(filePath);\n }\n\n // Generate services for single types\n for (const single of schema.singles) {\n const fileName = `${toKebabCase(single.singularName)}.service.ts`;\n const filePath = path.join(outputDir, fileName);\n const content = generateSingleService(single, typesImportPath, strapiVersion);\n await writeFile(filePath, await formatCode(content));\n generatedFiles.push(filePath);\n }\n\n return generatedFiles;\n}\n\n/**\n * Generate service for a collection type\n */\nfunction generateCollectionService(collection: CollectionType, typesImportPath: string, strapiVersion: StrapiVersion): string {\n const typeName = toPascalCase(collection.singularName);\n const serviceName = toCamelCase(collection.singularName) + 'Service';\n const fileName = toKebabCase(collection.singularName);\n const endpoint = collection.pluralName;\n const isV4 = strapiVersion === \"v4\";\n\n // V4 uses `id: number`, V5 uses `documentId: string`\n const idParam = isV4 ? 'id: number' : 'documentId: string';\n const idName = isV4 ? 'id' : 'documentId';\n const omitFields = isV4\n ? \"'id' | 'createdAt' | 'updatedAt' | 'publishedAt'\"\n : \"'id' | 'documentId' | 'createdAt' | 'updatedAt' | 'publishedAt'\";\n\n // Feature flags\n const hasSlug = 'slug' in collection.attributes;\n const { localized, draftAndPublish } = collection;\n\n // Build imports\n const imports: string[] = [\n `import { collection } from '../client';`,\n `import type { ${typeName}, ${typeName}Filters } from '${typesImportPath}/collections/${fileName}';`,\n `import type { StrapiPagination } from '${typesImportPath}/utils';`,\n ];\n if (localized) {\n imports.push(`import type { Locale } from '../locales';`);\n }\n\n // Build FindManyOptions interface\n const findManyOptionsFields: string[] = [\n ` filters?: ${typeName}Filters;`,\n ` pagination?: {`,\n ` /** Page number (1-indexed) - use with pageSize */`,\n ` page?: number;`,\n ` /** Number of items per page (default: 25) - use with page */`,\n ` pageSize?: number;`,\n ` /** Offset to start from (0-indexed) - use with limit */`,\n ` start?: number;`,\n ` /** Maximum number of items to return - use with start */`,\n ` limit?: number;`,\n ` };`,\n ` sort?: string | string[];`,\n ` populate?: string | string[] | Record<string, unknown>;`,\n ];\n if (localized) {\n findManyOptionsFields.push(` locale?: Locale;`);\n }\n if (draftAndPublish) {\n findManyOptionsFields.push(` status?: 'draft' | 'published';`);\n }\n\n // Build FindOneOptions interface\n const findOneOptionsFields: string[] = [\n ` populate?: string | string[] | Record<string, unknown>;`,\n ];\n if (localized) {\n findOneOptionsFields.push(` locale?: Locale;`);\n }\n if (draftAndPublish) {\n findOneOptionsFields.push(` status?: 'draft' | 'published';`);\n }\n\n // Build find params\n const findParams: string[] = [\n ` filters: options.filters,`,\n ` pagination: options.pagination,`,\n ` sort: options.sort,`,\n ` populate: options.populate,`,\n ];\n if (localized) {\n findParams.push(` locale: options.locale,`);\n }\n if (draftAndPublish) {\n findParams.push(` status: options.status,`);\n }\n\n // Build findOne params\n const findOneParams: string[] = [\n ` populate: options.populate,`,\n ];\n if (localized) {\n findOneParams.push(` locale: options.locale,`);\n }\n if (draftAndPublish) {\n findOneParams.push(` status: options.status,`);\n }\n\n // Build findBySlug params\n const findBySlugParams: string[] = [\n ` populate: options.populate,`,\n ];\n if (localized) {\n findBySlugParams.push(` locale: options.locale,`);\n }\n if (draftAndPublish) {\n findBySlugParams.push(` status: options.status,`);\n }\n\n return `/**\n * ${collection.displayName} Service\n * ${collection.description || ''}\n * Generated by strapi2front\n * Strapi version: ${strapiVersion}\n */\n\n${imports.join('\\n')}\n\nexport interface FindManyOptions {\n${findManyOptionsFields.join('\\n')}\n}\n\nexport interface FindOneOptions {\n${findOneOptionsFields.join('\\n')}\n}\n\n// Create typed collection helper\nconst ${toCamelCase(collection.singularName)}Collection = collection<${typeName}>('${endpoint}');\n\nexport const ${serviceName} = {\n /**\n * Find multiple ${collection.pluralName}\n */\n async findMany(options: FindManyOptions = {}): Promise<{ data: ${typeName}[]; pagination: StrapiPagination }> {\n const response = await ${toCamelCase(collection.singularName)}Collection.find({\n${findParams.join('\\n')}\n });\n\n return {\n data: response.data,\n pagination: response.meta.pagination,\n };\n },\n\n /**\n * Find all ${collection.pluralName} (handles pagination automatically)\n */\n async findAll(options: Omit<FindManyOptions, 'pagination'> = {}): Promise<${typeName}[]> {\n const allItems: ${typeName}[] = [];\n let page = 1;\n let hasMore = true;\n\n while (hasMore) {\n const { data, pagination } = await this.findMany({\n ...options,\n pagination: { page, pageSize: 100 },\n });\n\n allItems.push(...data);\n hasMore = page < pagination.pageCount;\n page++;\n }\n\n return allItems;\n },\n\n /**\n * Find one ${collection.singularName} by ${idName}\n */\n async findOne(${idParam}, options: FindOneOptions = {}): Promise<${typeName} | null> {\n try {\n const response = await ${toCamelCase(collection.singularName)}Collection.findOne(${idName}, {\n${findOneParams.join('\\n')}\n });\n\n return response.data;\n } catch (error) {\n // Return null if not found\n if (error instanceof Error && error.message.includes('404')) {\n return null;\n }\n throw error;\n }\n },\n${hasSlug ? `\n /**\n * Find one ${collection.singularName} by slug\n */\n async findBySlug(slug: string, options: FindOneOptions = {}): Promise<${typeName} | null> {\n const { data } = await this.findMany({\n filters: { slug: { $eq: slug } } as ${typeName}Filters,\n pagination: { pageSize: 1 },\n${findBySlugParams.join('\\n')}\n });\n\n return data[0] || null;\n },\n` : ''}\n /**\n * Create a new ${collection.singularName}\n */\n async create(data: Partial<Omit<${typeName}, ${omitFields}>>): Promise<${typeName}> {\n const response = await ${toCamelCase(collection.singularName)}Collection.create({ data });\n return response.data;\n },\n\n /**\n * Update a ${collection.singularName}\n */\n async update(${idParam}, data: Partial<Omit<${typeName}, ${omitFields}>>): Promise<${typeName}> {\n const response = await ${toCamelCase(collection.singularName)}Collection.update(${idName}, { data });\n return response.data;\n },\n\n /**\n * Delete a ${collection.singularName}\n */\n async delete(${idParam}): Promise<void> {\n await ${toCamelCase(collection.singularName)}Collection.delete(${idName});\n },\n\n /**\n * Count ${collection.pluralName}\n */\n async count(filters?: ${typeName}Filters): Promise<number> {\n const { pagination } = await this.findMany({\n filters,\n pagination: { pageSize: 1 },\n });\n\n return pagination.total;\n },\n};\n`;\n}\n\n/**\n * Generate service for a single type\n */\nfunction generateSingleService(single: SingleType, typesImportPath: string, strapiVersion: StrapiVersion): string {\n const typeName = toPascalCase(single.singularName);\n const serviceName = toCamelCase(single.singularName) + 'Service';\n const fileName = toKebabCase(single.singularName);\n const endpoint = single.singularName;\n const isV4 = strapiVersion === \"v4\";\n\n // V4 doesn't have documentId\n const omitFields = isV4\n ? \"'id' | 'createdAt' | 'updatedAt'\"\n : \"'id' | 'documentId' | 'createdAt' | 'updatedAt'\";\n\n // Feature flags\n const { localized, draftAndPublish } = single;\n\n // Build imports\n const imports: string[] = [\n `import { single } from '../client';`,\n `import type { ${typeName} } from '${typesImportPath}/collections/${fileName}';`,\n ];\n if (localized) {\n imports.push(`import type { Locale } from '../locales';`);\n }\n\n // Build FindOptions interface\n const findOptionsFields: string[] = [\n ` populate?: string | string[] | Record<string, unknown>;`,\n ];\n if (localized) {\n findOptionsFields.push(` locale?: Locale;`);\n }\n if (draftAndPublish) {\n findOptionsFields.push(` status?: 'draft' | 'published';`);\n }\n\n // Build find params\n const findParams: string[] = [\n ` populate: options.populate,`,\n ];\n if (localized) {\n findParams.push(` locale: options.locale,`);\n }\n if (draftAndPublish) {\n findParams.push(` status: options.status,`);\n }\n\n return `/**\n * ${single.displayName} Service (Single Type)\n * ${single.description || ''}\n * Generated by strapi2front\n * Strapi version: ${strapiVersion}\n */\n\n${imports.join('\\n')}\n\nexport interface FindOptions {\n${findOptionsFields.join('\\n')}\n}\n\n// Create typed single helper\nconst ${toCamelCase(single.singularName)}Single = single<${typeName}>('${endpoint}');\n\nexport const ${serviceName} = {\n /**\n * Get ${single.displayName}\n */\n async find(options: FindOptions = {}): Promise<${typeName} | null> {\n try {\n const response = await ${toCamelCase(single.singularName)}Single.find({\n${findParams.join('\\n')}\n });\n\n return response.data;\n } catch (error) {\n if (error instanceof Error && error.message.includes('404')) {\n return null;\n }\n throw error;\n }\n },\n\n /**\n * Update ${single.displayName}\n */\n async update(data: Partial<Omit<${typeName}, ${omitFields}>>): Promise<${typeName}> {\n const response = await ${toCamelCase(single.singularName)}Single.update({ data });\n return response.data;\n },\n\n /**\n * Delete ${single.displayName}\n */\n async delete(): Promise<void> {\n await ${toCamelCase(single.singularName)}Single.delete();\n },\n};\n`;\n}\n","/**\n * Astro Actions generator\n * Generates type-safe Astro Actions for Strapi content types\n *\n * Requirements:\n * - Astro v4.0+ (Actions are only available in v4+)\n * - TypeScript enabled\n */\n\nimport path from 'node:path';\nimport type { ParsedSchema, CollectionType, SingleType } from '@strapi2front/core';\nimport type { StrapiVersion } from '../../shared/types.js';\nimport { formatCode } from '../../utils/formatter.js';\nimport { writeFile, ensureDir } from '../../utils/file.js';\nimport { toCamelCase, toKebabCase } from '../../utils/naming.js';\n\nexport interface AstroActionsOptions {\n outputDir: string;\n servicesImportPath: string;\n strapiVersion?: StrapiVersion;\n}\n\n/**\n * Check if Astro Actions are supported\n * Requires Astro v4.0 or higher\n */\nexport function isAstroActionsSupported(astroVersion: string | null): boolean {\n if (!astroVersion) return false;\n\n // Remove ^ or ~ prefix and get major version\n const match = astroVersion.replace(/^[\\^~]/, \"\").match(/^(\\d+)/);\n const majorVersion = match ? parseInt(match[1], 10) : null;\n\n return majorVersion !== null && majorVersion >= 4;\n}\n\n/**\n * Generate Astro Actions from parsed schema\n */\nexport async function generateAstroActions(\n schema: ParsedSchema,\n options: AstroActionsOptions\n): Promise<string[]> {\n const { outputDir, servicesImportPath, strapiVersion = \"v5\" } = options;\n const generatedFiles: string[] = [];\n\n await ensureDir(outputDir);\n\n // Generate actions for collections\n for (const collection of schema.collections) {\n const fileName = `${toKebabCase(collection.singularName)}.ts`;\n const filePath = path.join(outputDir, fileName);\n const content = generateCollectionActions(collection, servicesImportPath, strapiVersion);\n await writeFile(filePath, await formatCode(content));\n generatedFiles.push(filePath);\n }\n\n // Generate actions for single types\n for (const single of schema.singles) {\n const fileName = `${toKebabCase(single.singularName)}.ts`;\n const filePath = path.join(outputDir, fileName);\n const content = generateSingleActions(single, servicesImportPath);\n await writeFile(filePath, await formatCode(content));\n generatedFiles.push(filePath);\n }\n\n return generatedFiles;\n}\n\n/**\n * Generate actions for a collection type\n */\nfunction generateCollectionActions(\n collection: CollectionType,\n servicesImportPath: string,\n strapiVersion: StrapiVersion\n): string {\n const serviceName = toCamelCase(collection.singularName) + 'Service';\n const actionsName = toCamelCase(collection.singularName);\n const fileName = toKebabCase(collection.singularName);\n const isV4 = strapiVersion === \"v4\";\n\n // V4 uses `id: number`, V5 uses `documentId: string`\n const idInputSchema = isV4 ? 'z.number().int().positive()' : 'z.string().min(1)';\n const idParamName = isV4 ? 'id' : 'documentId';\n const idComment = isV4 ? 'id' : 'documentId';\n\n // Detect if collection has a slug field\n const hasSlug = 'slug' in collection.attributes;\n\n return `/**\n * ${collection.displayName} Actions\n * ${collection.description || ''}\n * Generated by strapi2front\n * Framework: Astro\n * Strapi version: ${strapiVersion}\n */\n\nimport { defineAction, ActionError } from 'astro:actions';\nimport { z } from 'astro:schema';\nimport { ${serviceName} } from '${servicesImportPath}/${fileName}.service';\n\n/**\n * Pagination input schema\n */\nconst paginationSchema = z.object({\n page: z.number().int().positive().optional().default(1),\n pageSize: z.number().int().positive().max(100).optional().default(25),\n}).optional();\n\n/**\n * ${collection.displayName} actions\n */\nexport const ${actionsName} = {\n /**\n * Get all ${collection.pluralName} with pagination\n */\n getAll: defineAction({\n input: z.object({\n pagination: paginationSchema,\n sort: z.union([z.string(), z.array(z.string())]).optional(),\n }).optional(),\n handler: async (input) => {\n try {\n const result = await ${serviceName}.findMany({\n pagination: input?.pagination,\n sort: input?.sort,\n });\n\n return result;\n } catch (error) {\n throw new ActionError({\n code: 'INTERNAL_SERVER_ERROR',\n message: error instanceof Error ? error.message : 'Failed to fetch ${collection.pluralName}',\n });\n }\n },\n }),\n\n /**\n * Get a single ${collection.singularName} by ${idComment}\n */\n getOne: defineAction({\n input: z.object({\n ${idParamName}: ${idInputSchema},\n populate: z.union([z.string(), z.array(z.string())]).optional(),\n }),\n handler: async ({ ${idParamName}, populate }) => {\n try {\n const result = await ${serviceName}.findOne(${idParamName}, { populate });\n\n if (!result) {\n throw new ActionError({\n code: 'NOT_FOUND',\n message: '${collection.displayName} not found',\n });\n }\n\n return result;\n } catch (error) {\n if (error instanceof ActionError) throw error;\n throw new ActionError({\n code: 'INTERNAL_SERVER_ERROR',\n message: error instanceof Error ? error.message : 'Failed to fetch ${collection.singularName}',\n });\n }\n },\n }),\n${hasSlug ? `\n /**\n * Get a single ${collection.singularName} by slug\n */\n getBySlug: defineAction({\n input: z.object({\n slug: z.string().min(1),\n populate: z.union([z.string(), z.array(z.string())]).optional(),\n }),\n handler: async ({ slug, populate }) => {\n try {\n const result = await ${serviceName}.findBySlug(slug, { populate });\n\n if (!result) {\n throw new ActionError({\n code: 'NOT_FOUND',\n message: '${collection.displayName} not found',\n });\n }\n\n return result;\n } catch (error) {\n if (error instanceof ActionError) throw error;\n throw new ActionError({\n code: 'INTERNAL_SERVER_ERROR',\n message: error instanceof Error ? error.message : 'Failed to fetch ${collection.singularName}',\n });\n }\n },\n }),\n` : ''}\n /**\n * Create a new ${collection.singularName}\n */\n create: defineAction({\n input: z.object({\n data: z.record(z.unknown()),\n }),\n handler: async ({ data }) => {\n try {\n const result = await ${serviceName}.create(data);\n return result;\n } catch (error) {\n throw new ActionError({\n code: 'INTERNAL_SERVER_ERROR',\n message: error instanceof Error ? error.message : 'Failed to create ${collection.singularName}',\n });\n }\n },\n }),\n\n /**\n * Update a ${collection.singularName}\n */\n update: defineAction({\n input: z.object({\n ${idParamName}: ${idInputSchema},\n data: z.record(z.unknown()),\n }),\n handler: async ({ ${idParamName}, data }) => {\n try {\n const result = await ${serviceName}.update(${idParamName}, data);\n return result;\n } catch (error) {\n throw new ActionError({\n code: 'INTERNAL_SERVER_ERROR',\n message: error instanceof Error ? error.message : 'Failed to update ${collection.singularName}',\n });\n }\n },\n }),\n\n /**\n * Delete a ${collection.singularName}\n */\n delete: defineAction({\n input: z.object({\n ${idParamName}: ${idInputSchema},\n }),\n handler: async ({ ${idParamName} }) => {\n try {\n await ${serviceName}.delete(${idParamName});\n return { success: true };\n } catch (error) {\n throw new ActionError({\n code: 'INTERNAL_SERVER_ERROR',\n message: error instanceof Error ? error.message : 'Failed to delete ${collection.singularName}',\n });\n }\n },\n }),\n\n /**\n * Count ${collection.pluralName}\n */\n count: defineAction({\n input: z.object({\n filters: z.record(z.unknown()).optional(),\n }).optional(),\n handler: async (input) => {\n try {\n const count = await ${serviceName}.count(input?.filters as any);\n return { count };\n } catch (error) {\n throw new ActionError({\n code: 'INTERNAL_SERVER_ERROR',\n message: error instanceof Error ? error.message : 'Failed to count ${collection.pluralName}',\n });\n }\n },\n }),\n};\n`;\n}\n\n/**\n * Generate actions for a single type\n */\nfunction generateSingleActions(\n single: SingleType,\n servicesImportPath: string\n): string {\n const serviceName = toCamelCase(single.singularName) + 'Service';\n const actionsName = toCamelCase(single.singularName);\n const fileName = toKebabCase(single.singularName);\n\n return `/**\n * ${single.displayName} Actions (Single Type)\n * ${single.description || ''}\n * Generated by strapi2front\n * Framework: Astro\n */\n\nimport { defineAction, ActionError } from 'astro:actions';\nimport { z } from 'astro:schema';\nimport { ${serviceName} } from '${servicesImportPath}/${fileName}.service';\n\n/**\n * ${single.displayName} actions\n */\nexport const ${actionsName} = {\n /**\n * Get ${single.displayName}\n */\n get: defineAction({\n input: z.object({\n populate: z.union([z.string(), z.array(z.string())]).optional(),\n }).optional(),\n handler: async (input) => {\n try {\n const result = await ${serviceName}.find({\n populate: input?.populate,\n });\n\n if (!result) {\n throw new ActionError({\n code: 'NOT_FOUND',\n message: '${single.displayName} not found',\n });\n }\n\n return result;\n } catch (error) {\n if (error instanceof ActionError) throw error;\n throw new ActionError({\n code: 'INTERNAL_SERVER_ERROR',\n message: error instanceof Error ? error.message : 'Failed to fetch ${single.singularName}',\n });\n }\n },\n }),\n\n /**\n * Update ${single.displayName}\n */\n update: defineAction({\n input: z.object({\n data: z.record(z.unknown()),\n }),\n handler: async ({ data }) => {\n try {\n const result = await ${serviceName}.update(data);\n return result;\n } catch (error) {\n throw new ActionError({\n code: 'INTERNAL_SERVER_ERROR',\n message: error instanceof Error ? error.message : 'Failed to update ${single.singularName}',\n });\n }\n },\n }),\n};\n`;\n}\n","/**\n * Actions generator\n * Re-exports from frameworks/astro for backwards compatibility\n *\n * For framework-specific generators, import directly from:\n * - '@strapi2front/generators/frameworks/astro'\n * - '@strapi2front/generators/frameworks/nextjs' (coming soon)\n * - '@strapi2front/generators/frameworks/nuxt' (coming soon)\n */\n\nimport type { ParsedSchema } from '@strapi2front/core';\nimport type { StrapiVersion } from '../shared/types.js';\nimport { generateAstroActions } from '../frameworks/astro/actions.js';\n\nexport interface ActionsGeneratorOptions {\n outputDir: string;\n servicesImportPath: string;\n strapiVersion?: StrapiVersion;\n}\n\n/**\n * Generate Astro Actions from parsed schema\n * @deprecated Use generateAstroActions from '@strapi2front/generators/frameworks/astro' instead\n */\nexport async function generateActions(\n schema: ParsedSchema,\n options: ActionsGeneratorOptions\n): Promise<string[]> {\n return generateAstroActions(schema, {\n outputDir: options.outputDir,\n servicesImportPath: options.servicesImportPath,\n strapiVersion: options.strapiVersion,\n });\n}\n","import path from 'node:path';\nimport { formatCode } from '../utils/formatter.js';\nimport { writeFile, ensureDir } from '../utils/file.js';\n\nexport interface ClientGeneratorOptions {\n outputDir: string;\n strapiVersion?: \"v4\" | \"v5\";\n apiPrefix?: string;\n}\n\n/**\n * Generate the Strapi client file\n */\nexport async function generateClient(\n options: ClientGeneratorOptions\n): Promise<string[]> {\n const { outputDir, strapiVersion = \"v5\", apiPrefix = \"/api\" } = options;\n const generatedFiles: string[] = [];\n\n await ensureDir(outputDir);\n\n const filePath = path.join(outputDir, 'client.ts');\n const content = generateClientFile(strapiVersion, apiPrefix);\n await writeFile(filePath, await formatCode(content));\n generatedFiles.push(filePath);\n\n return generatedFiles;\n}\n\n/**\n * Generate the client file content\n */\nfunction generateClientFile(strapiVersion: \"v4\" | \"v5\", apiPrefix: string): string {\n const isV4 = strapiVersion === \"v4\";\n\n if (isV4) {\n return generateV4ClientFile(apiPrefix);\n }\n return generateV5ClientFile(apiPrefix);\n}\n\n/**\n * Generate client for Strapi v5 (flat response structure)\n */\nfunction generateV5ClientFile(apiPrefix: string): string {\n // Normalize prefix for the generated code\n const normalizedPrefix = apiPrefix.startsWith('/') ? apiPrefix : '/' + apiPrefix;\n\n return `/**\n * Strapi Client (v5)\n * Generated by strapi2front\n */\n\nimport Strapi from 'strapi-sdk-js';\n\n// Initialize the Strapi client\nconst strapiUrl = import.meta.env.STRAPI_URL || process.env.STRAPI_URL || 'http://localhost:1337';\nconst strapiToken = import.meta.env.STRAPI_TOKEN || process.env.STRAPI_TOKEN;\nconst strapiApiPrefix = import.meta.env.STRAPI_API_PREFIX || process.env.STRAPI_API_PREFIX || '${normalizedPrefix}';\n\nexport const strapi = new Strapi({\n url: strapiUrl,\n prefix: strapiApiPrefix,\n axiosOptions: {\n headers: strapiToken ? {\n Authorization: \\`Bearer \\${strapiToken}\\`,\n } : {},\n },\n});\n\n// Pagination type\nexport interface StrapiPagination {\n page: number;\n pageSize: number;\n pageCount: number;\n total: number;\n}\n\n// Default pagination for fallback\nconst defaultPagination: StrapiPagination = {\n page: 1,\n pageSize: 25,\n pageCount: 1,\n total: 0,\n};\n\n// Response types\ninterface StrapiListResponse<T> {\n data: T[];\n meta: {\n pagination?: StrapiPagination;\n };\n}\n\ninterface StrapiSingleResponse<T> {\n data: T;\n meta?: Record<string, unknown>;\n}\n\n// Helper to get typed collection\nexport function collection<T>(pluralName: string) {\n return {\n async find(params?: Record<string, unknown>): Promise<{ data: T[]; meta: { pagination: StrapiPagination } }> {\n const response = await strapi.find(pluralName, params) as unknown as StrapiListResponse<T>;\n return {\n data: Array.isArray(response.data) ? response.data : [],\n meta: {\n pagination: response.meta?.pagination || defaultPagination,\n },\n };\n },\n async findOne(documentId: string, params?: Record<string, unknown>): Promise<{ data: T }> {\n const response = await strapi.findOne(pluralName, documentId, params) as unknown as StrapiSingleResponse<T>;\n return { data: response.data };\n },\n async create(data: { data: Partial<T> }): Promise<{ data: T }> {\n const response = await strapi.create(pluralName, data.data as Record<string, unknown>) as unknown as StrapiSingleResponse<T>;\n return { data: response.data };\n },\n async update(documentId: string, data: { data: Partial<T> }): Promise<{ data: T }> {\n const response = await strapi.update(pluralName, documentId, data.data as Record<string, unknown>) as unknown as StrapiSingleResponse<T>;\n return { data: response.data };\n },\n async delete(documentId: string): Promise<void> {\n await strapi.delete(pluralName, documentId);\n },\n };\n}\n\n// Helper to get typed single type\nexport function single<T>(singularName: string) {\n return {\n async find(params?: Record<string, unknown>): Promise<{ data: T }> {\n const response = await strapi.find(singularName, params) as unknown as StrapiSingleResponse<T>;\n return { data: response.data };\n },\n async update(data: { data: Partial<T> }): Promise<{ data: T }> {\n const response = await strapi.update(singularName, 1 as unknown as string, data.data as Record<string, unknown>) as unknown as StrapiSingleResponse<T>;\n return { data: response.data };\n },\n async delete(): Promise<void> {\n await strapi.delete(singularName, 1 as unknown as string);\n },\n };\n}\n`;\n}\n\n/**\n * Generate client for Strapi v4 (nested attributes structure)\n */\nfunction generateV4ClientFile(apiPrefix: string): string {\n // Normalize prefix for the generated code\n const normalizedPrefix = apiPrefix.startsWith('/') ? apiPrefix : '/' + apiPrefix;\n\n return `/**\n * Strapi Client (v4)\n * Generated by strapi2front\n */\n\nimport Strapi from 'strapi-sdk-js';\n\n// Initialize the Strapi client\nconst strapiUrl = import.meta.env.STRAPI_URL || process.env.STRAPI_URL || 'http://localhost:1337';\nconst strapiToken = import.meta.env.STRAPI_TOKEN || process.env.STRAPI_TOKEN;\nconst strapiApiPrefix = import.meta.env.STRAPI_API_PREFIX || process.env.STRAPI_API_PREFIX || '${normalizedPrefix}';\n\nexport const strapi = new Strapi({\n url: strapiUrl,\n prefix: strapiApiPrefix,\n axiosOptions: {\n headers: strapiToken ? {\n Authorization: \\`Bearer \\${strapiToken}\\`,\n } : {},\n },\n});\n\n// Pagination type\nexport interface StrapiPagination {\n page: number;\n pageSize: number;\n pageCount: number;\n total: number;\n}\n\n// Default pagination for fallback\nconst defaultPagination: StrapiPagination = {\n page: 1,\n pageSize: 25,\n pageCount: 1,\n total: 0,\n};\n\n// Strapi v4 raw response types (with nested attributes)\ninterface StrapiV4RawItem<T> {\n id: number;\n attributes: Omit<T, 'id'>;\n}\n\ninterface StrapiV4RawListResponse<T> {\n data: StrapiV4RawItem<T>[];\n meta: {\n pagination?: StrapiPagination;\n };\n}\n\ninterface StrapiV4RawSingleResponse<T> {\n data: StrapiV4RawItem<T>;\n meta?: Record<string, unknown>;\n}\n\n/**\n * Flatten a Strapi v4 response item (merges id with attributes)\n */\nfunction flattenItem<T>(item: StrapiV4RawItem<T>): T {\n return { id: item.id, ...item.attributes } as T;\n}\n\n/**\n * Recursively flatten nested relations in Strapi v4 response\n */\nfunction flattenRelations<T>(data: T): T {\n if (data === null || data === undefined) return data;\n if (Array.isArray(data)) {\n return data.map(item => flattenRelations(item)) as unknown as T;\n }\n if (typeof data === 'object') {\n const result: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(data as Record<string, unknown>)) {\n // Check if this is a Strapi v4 relation response { data: { id, attributes } }\n if (value && typeof value === 'object' && 'data' in value) {\n const relationData = (value as { data: unknown }).data;\n if (relationData === null) {\n result[key] = null;\n } else if (Array.isArray(relationData)) {\n // To-many relation\n result[key] = relationData.map((item: StrapiV4RawItem<unknown>) =>\n flattenRelations(flattenItem(item))\n );\n } else if (typeof relationData === 'object' && 'id' in relationData && 'attributes' in relationData) {\n // To-one relation\n result[key] = flattenRelations(flattenItem(relationData as StrapiV4RawItem<unknown>));\n } else {\n result[key] = flattenRelations(value);\n }\n } else {\n result[key] = flattenRelations(value);\n }\n }\n return result as T;\n }\n return data;\n}\n\n// Helper to get typed collection\nexport function collection<T>(pluralName: string) {\n return {\n async find(params?: Record<string, unknown>): Promise<{ data: T[]; meta: { pagination: StrapiPagination } }> {\n const response = await strapi.find(pluralName, params) as unknown as StrapiV4RawListResponse<T>;\n const flattenedData = Array.isArray(response.data)\n ? response.data.map(item => flattenRelations(flattenItem<T>(item)))\n : [];\n return {\n data: flattenedData,\n meta: {\n pagination: response.meta?.pagination || defaultPagination,\n },\n };\n },\n async findOne(id: number | string, params?: Record<string, unknown>): Promise<{ data: T }> {\n const response = await strapi.findOne(pluralName, String(id), params) as unknown as StrapiV4RawSingleResponse<T>;\n return { data: flattenRelations(flattenItem<T>(response.data)) };\n },\n async create(data: { data: Partial<T> }): Promise<{ data: T }> {\n const response = await strapi.create(pluralName, data.data as Record<string, unknown>) as unknown as StrapiV4RawSingleResponse<T>;\n return { data: flattenRelations(flattenItem<T>(response.data)) };\n },\n async update(id: number | string, data: { data: Partial<T> }): Promise<{ data: T }> {\n const response = await strapi.update(pluralName, String(id), data.data as Record<string, unknown>) as unknown as StrapiV4RawSingleResponse<T>;\n return { data: flattenRelations(flattenItem<T>(response.data)) };\n },\n async delete(id: number | string): Promise<void> {\n await strapi.delete(pluralName, String(id));\n },\n };\n}\n\n// Helper to get typed single type\nexport function single<T>(singularName: string) {\n return {\n async find(params?: Record<string, unknown>): Promise<{ data: T }> {\n const response = await strapi.find(singularName, params) as unknown as StrapiV4RawSingleResponse<T>;\n return { data: flattenRelations(flattenItem<T>(response.data)) };\n },\n async update(data: { data: Partial<T> }): Promise<{ data: T }> {\n const response = await strapi.update(singularName, 1 as unknown as string, data.data as Record<string, unknown>) as unknown as StrapiV4RawSingleResponse<T>;\n return { data: flattenRelations(flattenItem<T>(response.data)) };\n },\n async delete(): Promise<void> {\n await strapi.delete(singularName, 1 as unknown as string);\n },\n };\n}\n`;\n}\n","import path from 'node:path';\nimport type { StrapiLocale } from '@strapi2front/core';\nimport { formatCode } from '../utils/formatter.js';\nimport { writeFile, ensureDir } from '../utils/file.js';\n\nexport interface LocalesGeneratorOptions {\n outputDir: string;\n}\n\n/**\n * Generate locales file from Strapi i18n configuration\n */\nexport async function generateLocales(\n locales: StrapiLocale[],\n options: LocalesGeneratorOptions\n): Promise<string[]> {\n const { outputDir } = options;\n const generatedFiles: string[] = [];\n\n await ensureDir(outputDir);\n\n const filePath = path.join(outputDir, 'locales.ts');\n const content = generateLocalesFile(locales);\n await writeFile(filePath, await formatCode(content));\n generatedFiles.push(filePath);\n\n return generatedFiles;\n}\n\n/**\n * Generate the locales file content\n */\nfunction generateLocalesFile(locales: StrapiLocale[]): string {\n if (locales.length === 0) {\n return `/**\n * Strapi Locales\n * Generated by strapi2front\n *\n * Note: No locales found. i18n might not be enabled in Strapi.\n */\n\nexport const locales = [] as const;\n\nexport type Locale = string;\n\nexport const defaultLocale: Locale = 'en';\n\nexport const localeNames: Record<string, string> = {};\n`;\n }\n\n const defaultLocale = locales.find(l => l.isDefault)?.code || locales[0]?.code || 'en';\n const localeCodes = locales.map(l => `'${l.code}'`).join(' | ');\n const localeArray = locales.map(l => `'${l.code}'`).join(', ');\n const localeNames = locales.map(l => ` '${l.code}': '${l.name}'`).join(',\\n');\n\n return `/**\n * Strapi Locales\n * Generated by strapi2front\n */\n\n/**\n * Available locale codes\n */\nexport const locales = [${localeArray}] as const;\n\n/**\n * Locale type - union of all available locales\n */\nexport type Locale = ${localeCodes};\n\n/**\n * Default locale\n */\nexport const defaultLocale: Locale = '${defaultLocale}';\n\n/**\n * Locale display names\n */\nexport const localeNames: Record<Locale, string> = {\n${localeNames}\n};\n\n/**\n * Check if a string is a valid locale\n */\nexport function isValidLocale(code: string): code is Locale {\n return locales.includes(code as Locale);\n}\n\n/**\n * Get locale name by code\n */\nexport function getLocaleName(code: Locale): string {\n return localeNames[code] || code;\n}\n`;\n}\n","import path from 'node:path';\nimport type {\n ParsedSchema,\n CollectionType,\n SingleType,\n ComponentType,\n Attribute,\n StrapiLocale,\n} from '@strapi2front/core';\nimport { formatCode } from '../utils/formatter.js';\nimport { writeFile, ensureDir } from '../utils/file.js';\nimport { toPascalCase, toCamelCase, toKebabCase } from '../utils/naming.js';\n\nexport interface ByFeatureGeneratorOptions {\n outputDir: string;\n features: {\n types: boolean;\n services: boolean;\n actions: boolean;\n };\n blocksRendererInstalled?: boolean;\n strapiVersion?: \"v4\" | \"v5\";\n apiPrefix?: string;\n /**\n * Output format: 'typescript' for .ts files, 'jsdoc' for .js with JSDoc annotations\n * @default 'typescript'\n */\n outputFormat?: \"typescript\" | \"jsdoc\";\n}\n\n/**\n * Generate all files using 'by-feature' structure\n *\n * Output structure:\n * strapi/\n * collections/\n * article/\n * types.ts\n * service.ts\n * actions.ts\n * singles/\n * homepage/\n * types.ts\n * service.ts\n * components/\n * seo.ts\n * shared/\n * utils.ts\n * client.ts\n * locales.ts\n */\nexport async function generateByFeature(\n schema: ParsedSchema,\n locales: StrapiLocale[],\n options: ByFeatureGeneratorOptions\n): Promise<string[]> {\n const {\n outputDir,\n features,\n blocksRendererInstalled = false,\n strapiVersion = \"v5\",\n apiPrefix = \"/api\",\n outputFormat = \"typescript\"\n } = options;\n const generatedFiles: string[] = [];\n\n // File extension based on output format\n const ext = outputFormat === \"jsdoc\" ? \"js\" : \"ts\";\n\n // Ensure directories exist\n await ensureDir(path.join(outputDir, 'collections'));\n await ensureDir(path.join(outputDir, 'singles'));\n await ensureDir(path.join(outputDir, 'components'));\n await ensureDir(path.join(outputDir, 'shared'));\n\n // Generate shared files\n const sharedDir = path.join(outputDir, 'shared');\n\n // Utils\n const utilsPath = path.join(sharedDir, `utils.${ext}`);\n const utilsContent = outputFormat === \"jsdoc\"\n ? generateUtilityTypesJSDoc(blocksRendererInstalled, strapiVersion)\n : generateUtilityTypes(blocksRendererInstalled, strapiVersion);\n await writeFile(utilsPath, await formatCode(utilsContent));\n generatedFiles.push(utilsPath);\n\n // Client\n const clientPath = path.join(sharedDir, `client.${ext}`);\n const clientContent = outputFormat === \"jsdoc\"\n ? generateClientJSDoc(strapiVersion, apiPrefix)\n : generateClient(strapiVersion, apiPrefix);\n await writeFile(clientPath, await formatCode(clientContent));\n generatedFiles.push(clientPath);\n\n // Locales\n const localesPath = path.join(sharedDir, `locales.${ext}`);\n const localesContent = outputFormat === \"jsdoc\"\n ? generateLocalesFileJSDoc(locales)\n : generateLocalesFile(locales);\n await writeFile(localesPath, await formatCode(localesContent));\n generatedFiles.push(localesPath);\n\n // Generate collection files\n for (const collection of schema.collections) {\n const featureDir = path.join(outputDir, 'collections', toKebabCase(collection.singularName));\n await ensureDir(featureDir);\n\n if (features.types) {\n const typesPath = path.join(featureDir, `types.${ext}`);\n const content = outputFormat === \"jsdoc\"\n ? generateCollectionTypesJSDoc(collection, schema)\n : generateCollectionTypes(collection, schema);\n await writeFile(typesPath, await formatCode(content));\n generatedFiles.push(typesPath);\n }\n\n if (features.services) {\n const servicePath = path.join(featureDir, `service.${ext}`);\n const content = outputFormat === \"jsdoc\"\n ? generateCollectionServiceJSDoc(collection, strapiVersion)\n : generateCollectionService(collection, strapiVersion);\n await writeFile(servicePath, await formatCode(content));\n generatedFiles.push(servicePath);\n }\n\n if (features.actions) {\n const actionsPath = path.join(featureDir, `actions.${ext}`);\n await writeFile(actionsPath, await formatCode(generateCollectionActions(collection, strapiVersion)));\n generatedFiles.push(actionsPath);\n }\n }\n\n // Generate single type files\n for (const single of schema.singles) {\n const featureDir = path.join(outputDir, 'singles', toKebabCase(single.singularName));\n await ensureDir(featureDir);\n\n if (features.types) {\n const typesPath = path.join(featureDir, `types.${ext}`);\n const content = outputFormat === \"jsdoc\"\n ? generateSingleTypesJSDoc(single, schema)\n : generateSingleTypes(single, schema);\n await writeFile(typesPath, await formatCode(content));\n generatedFiles.push(typesPath);\n }\n\n if (features.services) {\n const servicePath = path.join(featureDir, `service.${ext}`);\n const content = outputFormat === \"jsdoc\"\n ? generateSingleServiceJSDoc(single, strapiVersion)\n : generateSingleService(single, strapiVersion);\n await writeFile(servicePath, await formatCode(content));\n generatedFiles.push(servicePath);\n }\n }\n\n // Generate component files\n for (const component of schema.components) {\n const componentPath = path.join(outputDir, 'components', `${toKebabCase(component.name)}.${ext}`);\n const content = outputFormat === \"jsdoc\"\n ? generateComponentTypesJSDoc(component, schema)\n : generateComponentTypes(component, schema);\n await writeFile(componentPath, await formatCode(content));\n generatedFiles.push(componentPath);\n }\n\n return generatedFiles;\n}\n\n// ============================================\n// Shared Files Generation\n// ============================================\n\nfunction generateUtilityTypes(blocksRendererInstalled: boolean, strapiVersion: \"v4\" | \"v5\"): string {\n const isV4 = strapiVersion === \"v4\";\n\n const blocksContentType = isV4\n ? `/**\n * Rich text content (Strapi v4)\n * Can be markdown string or custom JSON structure\n */\nexport type RichTextContent = string;`\n : blocksRendererInstalled\n ? `/**\n * Blocks content type (Strapi v5 rich text)\n * Re-exported from @strapi/blocks-react-renderer\n */\nexport type { BlocksContent } from '@strapi/blocks-react-renderer';`\n : `/**\n * Blocks content type (Strapi v5 rich text)\n *\n * For full type support and rendering, install:\n * npm install @strapi/blocks-react-renderer\n *\n * Then re-run: npx strapi2front sync\n */\nexport type BlocksContent = unknown[];`;\n\n const baseEntity = isV4\n ? `export interface StrapiBaseEntity {\n id: number;\n createdAt: string;\n updatedAt: string;\n publishedAt: string | null;\n}`\n : `export interface StrapiBaseEntity {\n id: number;\n documentId: string;\n createdAt: string;\n updatedAt: string;\n publishedAt: string | null;\n}`;\n\n const mediaType = isV4\n ? `export interface StrapiMedia {\n id: number;\n name: string;\n alternativeText: string | null;\n caption: string | null;\n width: number;\n height: number;\n formats: {\n thumbnail?: StrapiMediaFormat;\n small?: StrapiMediaFormat;\n medium?: StrapiMediaFormat;\n large?: StrapiMediaFormat;\n } | null;\n hash: string;\n ext: string;\n mime: string;\n size: number;\n url: string;\n previewUrl: string | null;\n provider: string;\n createdAt: string;\n updatedAt: string;\n}`\n : `export interface StrapiMedia {\n id: number;\n documentId: string;\n name: string;\n alternativeText: string | null;\n caption: string | null;\n width: number;\n height: number;\n formats: {\n thumbnail?: StrapiMediaFormat;\n small?: StrapiMediaFormat;\n medium?: StrapiMediaFormat;\n large?: StrapiMediaFormat;\n } | null;\n hash: string;\n ext: string;\n mime: string;\n size: number;\n url: string;\n previewUrl: string | null;\n provider: string;\n createdAt: string;\n updatedAt: string;\n}`;\n\n const v4RawResponseTypes = isV4 ? `\n\n/**\n * Strapi v4 raw API response (with nested attributes)\n */\nexport interface StrapiV4RawItem<T> {\n id: number;\n attributes: Omit<T, 'id'>;\n}\n\nexport interface StrapiV4RawResponse<T> {\n data: StrapiV4RawItem<T>;\n meta: Record<string, unknown>;\n}\n\nexport interface StrapiV4RawListResponse<T> {\n data: StrapiV4RawItem<T>[];\n meta: {\n pagination: StrapiPagination;\n };\n}\n\n/**\n * Flatten Strapi v4 response item\n */\nexport function flattenV4Response<T>(item: StrapiV4RawItem<T>): T {\n return { id: item.id, ...item.attributes } as T;\n}\n\n/**\n * Flatten Strapi v4 list response\n */\nexport function flattenV4ListResponse<T>(items: StrapiV4RawItem<T>[]): T[] {\n return items.map(item => flattenV4Response<T>(item));\n}` : '';\n\n return `/**\n * Strapi utility types\n * Generated by strapi2front\n * Strapi version: ${strapiVersion}\n */\n\n${mediaType}\n\nexport interface StrapiMediaFormat {\n name: string;\n hash: string;\n ext: string;\n mime: string;\n width: number;\n height: number;\n size: number;\n url: string;\n}\n\nexport interface StrapiPagination {\n page: number;\n pageSize: number;\n pageCount: number;\n total: number;\n}\n\nexport interface StrapiResponse<T> {\n data: T;\n meta: {\n pagination?: StrapiPagination;\n };\n}\n\nexport interface StrapiListResponse<T> {\n data: T[];\n meta: {\n pagination: StrapiPagination;\n };\n}\n\n${baseEntity}\n${v4RawResponseTypes}\n${blocksContentType}\n`;\n}\n\nfunction generateClient(strapiVersion: \"v4\" | \"v5\", apiPrefix: string = \"/api\"): string {\n const isV4 = strapiVersion === \"v4\";\n // Normalize prefix for the generated code\n const normalizedPrefix = apiPrefix.startsWith('/') ? apiPrefix : '/' + apiPrefix;\n\n if (isV4) {\n return `/**\n * Strapi Client (v4)\n * Generated by strapi2front\n */\n\nimport Strapi from 'strapi-sdk-js';\nimport type { StrapiPagination } from './utils';\n\n// Initialize the Strapi client\nconst strapiUrl = import.meta.env.STRAPI_URL || process.env.STRAPI_URL || 'http://localhost:1337';\nconst strapiToken = import.meta.env.STRAPI_TOKEN || process.env.STRAPI_TOKEN;\nconst strapiApiPrefix = import.meta.env.STRAPI_API_PREFIX || process.env.STRAPI_API_PREFIX || '${normalizedPrefix}';\n\nexport const strapi = new Strapi({\n url: strapiUrl,\n prefix: strapiApiPrefix,\n axiosOptions: {\n headers: strapiToken ? {\n Authorization: \\`Bearer \\${strapiToken}\\`,\n } : {},\n },\n});\n\n// Default pagination for fallback\nconst defaultPagination: StrapiPagination = {\n page: 1,\n pageSize: 25,\n pageCount: 1,\n total: 0,\n};\n\n// Strapi v4 raw response types (with nested attributes)\ninterface StrapiV4RawItem<T> {\n id: number;\n attributes: Omit<T, 'id'>;\n}\n\ninterface StrapiV4RawListResponse<T> {\n data: StrapiV4RawItem<T>[];\n meta: {\n pagination?: StrapiPagination;\n };\n}\n\ninterface StrapiV4RawSingleResponse<T> {\n data: StrapiV4RawItem<T>;\n meta?: Record<string, unknown>;\n}\n\n/**\n * Flatten a Strapi v4 response item (merges id with attributes)\n */\nfunction flattenItem<T>(item: StrapiV4RawItem<T>): T {\n return { id: item.id, ...item.attributes } as T;\n}\n\n/**\n * Recursively flatten nested relations in Strapi v4 response\n */\nfunction flattenRelations<T>(data: T): T {\n if (data === null || data === undefined) return data;\n if (Array.isArray(data)) {\n return data.map(item => flattenRelations(item)) as unknown as T;\n }\n if (typeof data === 'object') {\n const result: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(data as Record<string, unknown>)) {\n // Check if this is a Strapi v4 relation response { data: { id, attributes } }\n if (value && typeof value === 'object' && 'data' in value) {\n const relationData = (value as { data: unknown }).data;\n if (relationData === null) {\n result[key] = null;\n } else if (Array.isArray(relationData)) {\n // To-many relation\n result[key] = relationData.map((item: StrapiV4RawItem<unknown>) =>\n flattenRelations(flattenItem(item))\n );\n } else if (typeof relationData === 'object' && 'id' in relationData && 'attributes' in relationData) {\n // To-one relation\n result[key] = flattenRelations(flattenItem(relationData as StrapiV4RawItem<unknown>));\n } else {\n result[key] = flattenRelations(value);\n }\n } else {\n result[key] = flattenRelations(value);\n }\n }\n return result as T;\n }\n return data;\n}\n\n// Helper to get typed collection\nexport function collection<T>(pluralName: string) {\n return {\n async find(params?: Record<string, unknown>): Promise<{ data: T[]; meta: { pagination: StrapiPagination } }> {\n const response = await strapi.find(pluralName, params) as unknown as StrapiV4RawListResponse<T>;\n const flattenedData = Array.isArray(response.data)\n ? response.data.map(item => flattenRelations(flattenItem<T>(item)))\n : [];\n return {\n data: flattenedData,\n meta: {\n pagination: response.meta?.pagination || defaultPagination,\n },\n };\n },\n async findOne(id: number | string, params?: Record<string, unknown>): Promise<{ data: T }> {\n const response = await strapi.findOne(pluralName, String(id), params) as unknown as StrapiV4RawSingleResponse<T>;\n return { data: flattenRelations(flattenItem<T>(response.data)) };\n },\n async create(data: { data: Partial<T> }): Promise<{ data: T }> {\n const response = await strapi.create(pluralName, data.data as Record<string, unknown>) as unknown as StrapiV4RawSingleResponse<T>;\n return { data: flattenRelations(flattenItem<T>(response.data)) };\n },\n async update(id: number | string, data: { data: Partial<T> }): Promise<{ data: T }> {\n const response = await strapi.update(pluralName, String(id), data.data as Record<string, unknown>) as unknown as StrapiV4RawSingleResponse<T>;\n return { data: flattenRelations(flattenItem<T>(response.data)) };\n },\n async delete(id: number | string): Promise<void> {\n await strapi.delete(pluralName, String(id));\n },\n };\n}\n\n// Helper to get typed single type\nexport function single<T>(singularName: string) {\n return {\n async find(params?: Record<string, unknown>): Promise<{ data: T }> {\n const response = await strapi.find(singularName, params) as unknown as StrapiV4RawSingleResponse<T>;\n return { data: flattenRelations(flattenItem<T>(response.data)) };\n },\n async update(data: { data: Partial<T> }): Promise<{ data: T }> {\n const response = await strapi.update(singularName, 1 as unknown as string, data.data as Record<string, unknown>) as unknown as StrapiV4RawSingleResponse<T>;\n return { data: flattenRelations(flattenItem<T>(response.data)) };\n },\n async delete(): Promise<void> {\n await strapi.delete(singularName, 1 as unknown as string);\n },\n };\n}\n`;\n }\n\n return `/**\n * Strapi Client (v5)\n * Generated by strapi2front\n */\n\nimport Strapi from 'strapi-sdk-js';\nimport type { StrapiPagination } from './utils';\n\n// Initialize the Strapi client\nconst strapiUrl = import.meta.env.STRAPI_URL || process.env.STRAPI_URL || 'http://localhost:1337';\nconst strapiToken = import.meta.env.STRAPI_TOKEN || process.env.STRAPI_TOKEN;\nconst strapiApiPrefix = import.meta.env.STRAPI_API_PREFIX || process.env.STRAPI_API_PREFIX || '${normalizedPrefix}';\n\nexport const strapi = new Strapi({\n url: strapiUrl,\n prefix: strapiApiPrefix,\n axiosOptions: {\n headers: strapiToken ? {\n Authorization: \\`Bearer \\${strapiToken}\\`,\n } : {},\n },\n});\n\n// Default pagination for fallback\nconst defaultPagination: StrapiPagination = {\n page: 1,\n pageSize: 25,\n pageCount: 1,\n total: 0,\n};\n\n// Response types from strapi-sdk-js\ninterface StrapiListResponse<T> {\n data: T[];\n meta: {\n pagination?: StrapiPagination;\n };\n}\n\ninterface StrapiSingleResponse<T> {\n data: T;\n meta?: Record<string, unknown>;\n}\n\n// Helper to get typed collection\nexport function collection<T>(pluralName: string) {\n return {\n async find(params?: Record<string, unknown>): Promise<{ data: T[]; meta: { pagination: StrapiPagination } }> {\n const response = await strapi.find(pluralName, params) as unknown as StrapiListResponse<T>;\n return {\n data: Array.isArray(response.data) ? response.data : [],\n meta: {\n pagination: response.meta?.pagination || defaultPagination,\n },\n };\n },\n async findOne(documentId: string, params?: Record<string, unknown>): Promise<{ data: T }> {\n const response = await strapi.findOne(pluralName, documentId, params) as unknown as StrapiSingleResponse<T>;\n return { data: response.data };\n },\n async create(data: { data: Partial<T> }): Promise<{ data: T }> {\n const response = await strapi.create(pluralName, data.data as Record<string, unknown>) as unknown as StrapiSingleResponse<T>;\n return { data: response.data };\n },\n async update(documentId: string, data: { data: Partial<T> }): Promise<{ data: T }> {\n const response = await strapi.update(pluralName, documentId, data.data as Record<string, unknown>) as unknown as StrapiSingleResponse<T>;\n return { data: response.data };\n },\n async delete(documentId: string): Promise<void> {\n await strapi.delete(pluralName, documentId);\n },\n };\n}\n\n// Helper to get typed single type\nexport function single<T>(singularName: string) {\n return {\n async find(params?: Record<string, unknown>): Promise<{ data: T }> {\n const response = await strapi.find(singularName, params) as unknown as StrapiSingleResponse<T>;\n return { data: response.data };\n },\n async update(data: { data: Partial<T> }): Promise<{ data: T }> {\n const response = await strapi.update(singularName, 1 as unknown as string, data.data as Record<string, unknown>) as unknown as StrapiSingleResponse<T>;\n return { data: response.data };\n },\n async delete(): Promise<void> {\n await strapi.delete(singularName, 1 as unknown as string);\n },\n };\n}\n`;\n}\n\nfunction generateLocalesFile(locales: StrapiLocale[]): string {\n if (locales.length === 0) {\n return `/**\n * Strapi locales\n * Generated by strapi2front\n * Note: i18n is not enabled in Strapi\n */\n\nexport const locales = [] as const;\nexport type Locale = string;\nexport const defaultLocale: Locale = 'en';\nexport const localeNames: Record<string, string> = {};\n\nexport function isValidLocale(_code: string): _code is Locale {\n return true;\n}\n\nexport function getLocaleName(code: string): string {\n return code;\n}\n`;\n }\n\n const localeCodes = locales.map(l => l.code);\n const defaultLocale = locales.find(l => l.isDefault)?.code || locales[0]?.code || 'en';\n\n return `/**\n * Strapi locales\n * Generated by strapi2front\n */\n\nexport const locales = [${localeCodes.map(c => `'${c}'`).join(', ')}] as const;\n\nexport type Locale = typeof locales[number];\n\nexport const defaultLocale: Locale = '${defaultLocale}';\n\nexport const localeNames: Record<Locale, string> = {\n${locales.map(l => ` '${l.code}': '${l.name}'`).join(',\\n')}\n};\n\nexport function isValidLocale(code: string): code is Locale {\n return locales.includes(code as Locale);\n}\n\nexport function getLocaleName(code: Locale): string {\n return localeNames[code] || code;\n}\n`;\n}\n\n// ============================================\n// Collection Types Generation\n// ============================================\n\nfunction generateCollectionTypes(collection: CollectionType, schema: ParsedSchema): string {\n const typeName = toPascalCase(collection.singularName);\n const attributes = generateAttributes(collection.attributes);\n const imports = generateTypeImports(collection.attributes, schema, 'collection');\n\n return `/**\n * ${collection.displayName}\n * ${collection.description || ''}\n * Generated by strapi2front\n */\n\n${imports}\n\nexport interface ${typeName} extends StrapiBaseEntity {\n${attributes}\n}\n\nexport interface ${typeName}Filters {\n id?: number | { $eq?: number; $ne?: number; $in?: number[]; $notIn?: number[] };\n documentId?: string | { $eq?: string; $ne?: string };\n createdAt?: string | { $eq?: string; $gt?: string; $gte?: string; $lt?: string; $lte?: string };\n updatedAt?: string | { $eq?: string; $gt?: string; $gte?: string; $lt?: string; $lte?: string };\n publishedAt?: string | null | { $eq?: string; $ne?: string; $null?: boolean };\n $and?: ${typeName}Filters[];\n $or?: ${typeName}Filters[];\n $not?: ${typeName}Filters;\n}\n`;\n}\n\nfunction generateSingleTypes(single: SingleType, schema: ParsedSchema): string {\n const typeName = toPascalCase(single.singularName);\n const attributes = generateAttributes(single.attributes);\n const imports = generateTypeImports(single.attributes, schema, 'single');\n\n return `/**\n * ${single.displayName}\n * ${single.description || ''}\n * Generated by strapi2front\n */\n\n${imports}\n\nexport interface ${typeName} extends StrapiBaseEntity {\n${attributes}\n}\n`;\n}\n\nfunction generateComponentTypes(component: ComponentType, schema: ParsedSchema): string {\n const typeName = toPascalCase(component.name);\n const attributes = generateAttributes(component.attributes);\n const imports = generateTypeImports(component.attributes, schema, 'component');\n\n return `/**\n * ${component.displayName} component\n * Category: ${component.category}\n * ${component.description || ''}\n * Generated by strapi2front\n */\n\n${imports}\n\nexport interface ${typeName} {\n id: number;\n${attributes}\n}\n`;\n}\n\nfunction generateTypeImports(\n attributes: Record<string, Attribute>,\n schema: ParsedSchema,\n context: 'collection' | 'single' | 'component'\n): string {\n const utilsImports: string[] = [];\n const relationImports: Map<string, string> = new Map();\n const componentImports: Map<string, string> = new Map();\n\n // Check what utils we need\n const attributesStr = JSON.stringify(attributes);\n if (context !== 'component') {\n utilsImports.push('StrapiBaseEntity');\n }\n if (attributesStr.includes('\"type\":\"media\"')) {\n utilsImports.push('StrapiMedia');\n }\n if (attributesStr.includes('\"type\":\"blocks\"')) {\n utilsImports.push('BlocksContent');\n }\n\n // Extract relations and components\n // Components are in strapi/components/, collections/singles are in strapi/collections/xxx/ or strapi/singles/xxx/\n // From component: ../collections/xxx/types (one level up)\n // From collection/single: ../../collections/xxx/types (two levels up, since they're in a subfolder)\n const relativePrefix = context === 'component' ? '..' : '../..';\n\n for (const attr of Object.values(attributes)) {\n if (attr.type === 'relation' && 'target' in attr && attr.target) {\n const targetName = attr.target.split('.').pop() || '';\n if (targetName) {\n const typeName = toPascalCase(targetName);\n const fileName = toKebabCase(targetName);\n // Check if it's a collection or single\n const isCollection = schema.collections.some(c => c.singularName === targetName);\n const isSingle = schema.singles.some(s => s.singularName === targetName);\n if (isCollection) {\n relationImports.set(typeName, `${relativePrefix}/collections/${fileName}/types`);\n } else if (isSingle) {\n relationImports.set(typeName, `${relativePrefix}/singles/${fileName}/types`);\n }\n }\n }\n\n if (attr.type === 'component' && 'component' in attr && attr.component) {\n const componentName = attr.component.split('.').pop() || '';\n if (componentName) {\n const typeName = toPascalCase(componentName);\n const fileName = toKebabCase(componentName);\n if (context === 'component') {\n componentImports.set(typeName, `./${fileName}`);\n } else {\n componentImports.set(typeName, `../../components/${fileName}`);\n }\n }\n }\n\n if (attr.type === 'dynamiczone' && 'components' in attr && attr.components) {\n for (const comp of attr.components) {\n const componentName = comp.split('.').pop() || '';\n if (componentName) {\n const typeName = toPascalCase(componentName);\n const fileName = toKebabCase(componentName);\n if (context === 'component') {\n componentImports.set(typeName, `./${fileName}`);\n } else {\n componentImports.set(typeName, `../../components/${fileName}`);\n }\n }\n }\n }\n }\n\n const lines: string[] = [];\n\n // Utils import\n if (utilsImports.length > 0) {\n const utilsPath = context === 'component' ? '../shared/utils' : '../../shared/utils';\n lines.push(`import type { ${utilsImports.join(', ')} } from '${utilsPath}';`);\n }\n\n // Relation imports\n for (const [typeName, importPath] of relationImports) {\n lines.push(`import type { ${typeName} } from '${importPath}';`);\n }\n\n // Component imports\n for (const [typeName, importPath] of componentImports) {\n lines.push(`import type { ${typeName} } from '${importPath}';`);\n }\n\n return lines.join('\\n');\n}\n\nfunction generateAttributes(attributes: Record<string, Attribute>): string {\n const lines: string[] = [];\n\n for (const [name, attr] of Object.entries(attributes)) {\n const tsType = attributeToTsType(attr);\n const optional = attr.required ? '' : '?';\n lines.push(` ${name}${optional}: ${tsType};`);\n }\n\n return lines.join('\\n');\n}\n\nfunction attributeToTsType(attr: Attribute): string {\n switch (attr.type) {\n case 'string':\n case 'text':\n case 'richtext':\n case 'email':\n case 'password':\n case 'uid':\n return 'string';\n case 'blocks':\n return 'BlocksContent';\n case 'integer':\n case 'biginteger':\n case 'float':\n case 'decimal':\n return 'number';\n case 'boolean':\n return 'boolean';\n case 'date':\n case 'time':\n case 'datetime':\n case 'timestamp':\n return 'string';\n case 'json':\n return 'unknown';\n case 'enumeration':\n if ('enum' in attr && attr.enum) {\n return attr.enum.map(v => `'${v}'`).join(' | ');\n }\n return 'string';\n case 'media':\n if ('multiple' in attr && attr.multiple) {\n return 'StrapiMedia[]';\n }\n return 'StrapiMedia | null';\n case 'relation':\n if ('target' in attr && attr.target) {\n const targetName = toPascalCase(attr.target.split('.').pop() || 'unknown');\n const isMany = attr.relation === 'oneToMany' || attr.relation === 'manyToMany';\n return isMany ? `${targetName}[]` : `${targetName} | null`;\n }\n return 'unknown';\n case 'component':\n if ('component' in attr && attr.component) {\n const componentName = toPascalCase(attr.component.split('.').pop() || 'unknown');\n if ('repeatable' in attr && attr.repeatable) {\n return `${componentName}[]`;\n }\n return `${componentName} | null`;\n }\n return 'unknown';\n case 'dynamiczone':\n if ('components' in attr && attr.components) {\n const types = attr.components.map(c => toPascalCase(c.split('.').pop() || 'unknown'));\n return `(${types.join(' | ')})[]`;\n }\n return 'unknown[]';\n default:\n return 'unknown';\n }\n}\n\n// ============================================\n// Collection Service Generation\n// ============================================\n\nfunction generateCollectionService(collection: CollectionType, strapiVersion: \"v4\" | \"v5\"): string {\n const typeName = toPascalCase(collection.singularName);\n const serviceName = toCamelCase(collection.singularName) + 'Service';\n const endpoint = collection.pluralName;\n const hasSlug = 'slug' in collection.attributes;\n const { localized, draftAndPublish } = collection;\n const isV4 = strapiVersion === \"v4\";\n\n // V4 uses `id: number`, V5 uses `documentId: string`\n const idParam = isV4 ? 'id: number' : 'documentId: string';\n const idName = isV4 ? 'id' : 'documentId';\n const omitFields = isV4\n ? \"'id' | 'createdAt' | 'updatedAt' | 'publishedAt'\"\n : \"'id' | 'documentId' | 'createdAt' | 'updatedAt' | 'publishedAt'\";\n const omitFieldsUpdate = isV4\n ? \"'id' | 'createdAt' | 'updatedAt'\"\n : \"'id' | 'documentId' | 'createdAt' | 'updatedAt'\";\n\n // Build imports\n const imports = [\n `import { collection } from '../../shared/client';`,\n `import type { ${typeName}, ${typeName}Filters } from './types';`,\n `import type { StrapiPagination } from '../../shared/utils';`,\n ];\n if (localized) {\n imports.push(`import type { Locale } from '../../shared/locales';`);\n }\n\n // Build options interfaces\n const paginationFields = `\n /** Page number (1-indexed) - use with pageSize */\n page?: number;\n /** Number of items per page (default: 25) - use with page */\n pageSize?: number;\n /** Offset to start from (0-indexed) - use with limit */\n start?: number;\n /** Maximum number of items to return - use with start */\n limit?: number;`;\n\n let findManyOptionsFields = ` filters?: ${typeName}Filters;\n pagination?: {${paginationFields}\n };\n sort?: string | string[];\n populate?: string | string[] | Record<string, unknown>;`;\n\n let findOneOptionsFields = ` populate?: string | string[] | Record<string, unknown>;`;\n\n if (localized) {\n findManyOptionsFields += `\\n locale?: Locale;`;\n findOneOptionsFields += `\\n locale?: Locale;`;\n }\n if (draftAndPublish) {\n findManyOptionsFields += `\\n status?: 'draft' | 'published';`;\n findOneOptionsFields += `\\n status?: 'draft' | 'published';`;\n }\n\n // Build find params\n let findParams = ` filters: options.filters,\n pagination: options.pagination,\n sort: options.sort,\n populate: options.populate,`;\n let findOneParams = ` populate: options.populate,`;\n\n if (localized) {\n findParams += `\\n locale: options.locale,`;\n findOneParams += `\\n locale: options.locale,`;\n }\n if (draftAndPublish) {\n findParams += `\\n status: options.status,`;\n findOneParams += `\\n status: options.status,`;\n }\n\n return `/**\n * ${collection.displayName} Service\n * ${collection.description || ''}\n * Generated by strapi2front\n * Strapi version: ${strapiVersion}\n */\n\n${imports.join('\\n')}\n\nexport interface FindManyOptions {\n${findManyOptionsFields}\n}\n\nexport interface FindOneOptions {\n${findOneOptionsFields}\n}\n\n// Create typed collection helper\nconst ${toCamelCase(collection.singularName)}Collection = collection<${typeName}>('${endpoint}');\n\nexport const ${serviceName} = {\n async findMany(options: FindManyOptions = {}): Promise<{ data: ${typeName}[]; pagination: StrapiPagination }> {\n const response = await ${toCamelCase(collection.singularName)}Collection.find({\n${findParams}\n });\n\n return {\n data: response.data,\n pagination: response.meta.pagination,\n };\n },\n\n async findAll(options: Omit<FindManyOptions, 'pagination'> = {}): Promise<${typeName}[]> {\n const allItems: ${typeName}[] = [];\n let page = 1;\n let hasMore = true;\n\n while (hasMore) {\n const { data, pagination } = await this.findMany({\n ...options,\n pagination: { page, pageSize: 100 },\n });\n\n allItems.push(...data);\n hasMore = page < pagination.pageCount;\n page++;\n }\n\n return allItems;\n },\n\n async findOne(${idParam}, options: FindOneOptions = {}): Promise<${typeName} | null> {\n try {\n const response = await ${toCamelCase(collection.singularName)}Collection.findOne(${idName}, {\n${findOneParams}\n });\n\n return response.data;\n } catch (error) {\n if (error instanceof Error && error.message.includes('404')) {\n return null;\n }\n throw error;\n }\n },\n${hasSlug ? `\n async findBySlug(slug: string, options: FindOneOptions = {}): Promise<${typeName} | null> {\n const { data } = await this.findMany({\n filters: { slug: { $eq: slug } } as ${typeName}Filters,\n pagination: { pageSize: 1 },\n populate: options.populate,${localized ? '\\n locale: options.locale,' : ''}${draftAndPublish ? '\\n status: options.status,' : ''}\n });\n\n return data[0] || null;\n },\n` : ''}\n async create(data: Partial<Omit<${typeName}, ${omitFields}>>): Promise<${typeName}> {\n const response = await ${toCamelCase(collection.singularName)}Collection.create({ data });\n return response.data;\n },\n\n async update(${idParam}, data: Partial<Omit<${typeName}, ${omitFieldsUpdate}>>): Promise<${typeName}> {\n const response = await ${toCamelCase(collection.singularName)}Collection.update(${idName}, { data });\n return response.data;\n },\n\n async delete(${idParam}): Promise<void> {\n await ${toCamelCase(collection.singularName)}Collection.delete(${idName});\n },\n\n async count(filters?: ${typeName}Filters): Promise<number> {\n const { pagination } = await this.findMany({\n filters,\n pagination: { pageSize: 1 },\n });\n\n return pagination.total;\n },\n};\n`;\n}\n\n// ============================================\n// Single Service Generation\n// ============================================\n\nfunction generateSingleService(single: SingleType, strapiVersion: \"v4\" | \"v5\"): string {\n const typeName = toPascalCase(single.singularName);\n const serviceName = toCamelCase(single.singularName) + 'Service';\n const endpoint = single.singularName;\n const { localized, draftAndPublish } = single;\n const isV4 = strapiVersion === \"v4\";\n\n // V4 doesn't have documentId\n const omitFields = isV4\n ? \"'id' | 'createdAt' | 'updatedAt'\"\n : \"'id' | 'documentId' | 'createdAt' | 'updatedAt'\";\n\n // Build imports\n const imports = [\n `import { single } from '../../shared/client';`,\n `import type { ${typeName} } from './types';`,\n ];\n if (localized) {\n imports.push(`import type { Locale } from '../../shared/locales';`);\n }\n\n // Build options interface\n let findOptionsFields = ` populate?: string | string[] | Record<string, unknown>;`;\n if (localized) {\n findOptionsFields += `\\n locale?: Locale;`;\n }\n if (draftAndPublish) {\n findOptionsFields += `\\n status?: 'draft' | 'published';`;\n }\n\n // Build find params\n let findParams = ` populate: options.populate,`;\n if (localized) {\n findParams += `\\n locale: options.locale,`;\n }\n if (draftAndPublish) {\n findParams += `\\n status: options.status,`;\n }\n\n return `/**\n * ${single.displayName} Service (Single Type)\n * ${single.description || ''}\n * Generated by strapi2front\n * Strapi version: ${strapiVersion}\n */\n\n${imports.join('\\n')}\n\nexport interface FindOptions {\n${findOptionsFields}\n}\n\n// Create typed single helper\nconst ${toCamelCase(single.singularName)}Single = single<${typeName}>('${endpoint}');\n\nexport const ${serviceName} = {\n async find(options: FindOptions = {}): Promise<${typeName} | null> {\n try {\n const response = await ${toCamelCase(single.singularName)}Single.find({\n${findParams}\n });\n\n return response.data;\n } catch (error) {\n if (error instanceof Error && error.message.includes('404')) {\n return null;\n }\n throw error;\n }\n },\n\n async update(data: Partial<Omit<${typeName}, ${omitFields}>>): Promise<${typeName}> {\n const response = await ${toCamelCase(single.singularName)}Single.update({ data });\n return response.data;\n },\n\n async delete(): Promise<void> {\n await ${toCamelCase(single.singularName)}Single.delete();\n },\n};\n`;\n}\n\n// ============================================\n// Collection Actions Generation\n// ============================================\n\nfunction generateCollectionActions(collection: CollectionType, strapiVersion: \"v4\" | \"v5\"): string {\n const typeName = toPascalCase(collection.singularName);\n const serviceName = toCamelCase(collection.singularName) + 'Service';\n const actionPrefix = toCamelCase(collection.singularName);\n const isV4 = strapiVersion === \"v4\";\n\n // V4 uses `id: number`, V5 uses `documentId: string`\n const idInputSchema = isV4 ? 'z.number().int().positive()' : 'z.string()';\n const idParamName = isV4 ? 'id' : 'documentId';\n\n return `/**\n * ${collection.displayName} Astro Actions\n * ${collection.description || ''}\n * Generated by strapi2front\n * Strapi version: ${strapiVersion}\n */\n\nimport { defineAction } from 'astro:actions';\nimport { z } from 'astro:schema';\nimport { ${serviceName} } from './service';\nimport type { ${typeName} } from './types';\n\nexport const ${actionPrefix}Actions = {\n getMany: defineAction({\n input: z.object({\n page: z.number().optional(),\n pageSize: z.number().optional(),\n sort: z.string().optional(),\n }).optional(),\n handler: async (input) => {\n const { data, pagination } = await ${serviceName}.findMany({\n pagination: input ? { page: input.page, pageSize: input.pageSize } : undefined,\n sort: input?.sort,\n });\n return { data, pagination };\n },\n }),\n\n getOne: defineAction({\n input: z.object({\n ${idParamName}: ${idInputSchema},\n }),\n handler: async (input) => {\n const data = await ${serviceName}.findOne(input.${idParamName});\n return { data };\n },\n }),\n\n create: defineAction({\n input: z.object({\n data: z.record(z.unknown()),\n }),\n handler: async (input) => {\n const data = await ${serviceName}.create(input.data as Partial<${typeName}>);\n return { data };\n },\n }),\n\n update: defineAction({\n input: z.object({\n ${idParamName}: ${idInputSchema},\n data: z.record(z.unknown()),\n }),\n handler: async (input) => {\n const data = await ${serviceName}.update(input.${idParamName}, input.data as Partial<${typeName}>);\n return { data };\n },\n }),\n\n delete: defineAction({\n input: z.object({\n ${idParamName}: ${idInputSchema},\n }),\n handler: async (input) => {\n await ${serviceName}.delete(input.${idParamName});\n return { success: true };\n },\n }),\n};\n`;\n}\n\n// ============================================\n// JSDoc Generators\n// ============================================\n\nfunction generateUtilityTypesJSDoc(blocksRendererInstalled: boolean, strapiVersion: \"v4\" | \"v5\"): string {\n const isV4 = strapiVersion === \"v4\";\n\n const blocksContentType = isV4\n ? `/**\n * Rich text content (Strapi v4)\n * Can be markdown string or custom JSON structure\n * @typedef {string} RichTextContent\n */`\n : blocksRendererInstalled\n ? `// BlocksContent - import from '@strapi/blocks-react-renderer' for full type support`\n : `/**\n * Blocks content type (Strapi v5 rich text)\n *\n * For full type support and rendering, install:\n * npm install @strapi/blocks-react-renderer\n *\n * Then re-run: npx strapi2front sync\n * @typedef {Array<Object>} BlocksContent\n */`;\n\n const baseEntity = isV4\n ? `/**\n * @typedef {Object} StrapiBaseEntity\n * @property {number} id\n * @property {string} createdAt\n * @property {string} updatedAt\n * @property {string|null} publishedAt\n */`\n : `/**\n * @typedef {Object} StrapiBaseEntity\n * @property {number} id\n * @property {string} documentId\n * @property {string} createdAt\n * @property {string} updatedAt\n * @property {string|null} publishedAt\n */`;\n\n const mediaType = isV4\n ? `/**\n * @typedef {Object} StrapiMedia\n * @property {number} id\n * @property {string} name\n * @property {string|null} alternativeText\n * @property {string|null} caption\n * @property {number} width\n * @property {number} height\n * @property {Object|null} formats\n * @property {StrapiMediaFormat} [formats.thumbnail]\n * @property {StrapiMediaFormat} [formats.small]\n * @property {StrapiMediaFormat} [formats.medium]\n * @property {StrapiMediaFormat} [formats.large]\n * @property {string} hash\n * @property {string} ext\n * @property {string} mime\n * @property {number} size\n * @property {string} url\n * @property {string|null} previewUrl\n * @property {string} provider\n * @property {string} createdAt\n * @property {string} updatedAt\n */`\n : `/**\n * @typedef {Object} StrapiMedia\n * @property {number} id\n * @property {string} documentId\n * @property {string} name\n * @property {string|null} alternativeText\n * @property {string|null} caption\n * @property {number} width\n * @property {number} height\n * @property {Object|null} formats\n * @property {StrapiMediaFormat} [formats.thumbnail]\n * @property {StrapiMediaFormat} [formats.small]\n * @property {StrapiMediaFormat} [formats.medium]\n * @property {StrapiMediaFormat} [formats.large]\n * @property {string} hash\n * @property {string} ext\n * @property {string} mime\n * @property {number} size\n * @property {string} url\n * @property {string|null} previewUrl\n * @property {string} provider\n * @property {string} createdAt\n * @property {string} updatedAt\n */`;\n\n const v4RawResponseTypes = isV4 ? `\n\n/**\n * Strapi v4 raw API response item (with nested attributes)\n * @template T\n * @typedef {Object} StrapiV4RawItem\n * @property {number} id\n * @property {Omit<T, 'id'>} attributes\n */\n\n/**\n * Strapi v4 raw API response\n * @template T\n * @typedef {Object} StrapiV4RawResponse\n * @property {StrapiV4RawItem<T>} data\n * @property {Object} meta\n */\n\n/**\n * Strapi v4 raw list response\n * @template T\n * @typedef {Object} StrapiV4RawListResponse\n * @property {StrapiV4RawItem<T>[]} data\n * @property {Object} meta\n * @property {StrapiPagination} meta.pagination\n */\n\n/**\n * Flatten Strapi v4 response item\n * @template T\n * @param {StrapiV4RawItem<T>} item\n * @returns {T}\n */\nfunction flattenV4Response(item) {\n return { id: item.id, ...item.attributes };\n}\n\n/**\n * Flatten Strapi v4 list response\n * @template T\n * @param {StrapiV4RawItem<T>[]} items\n * @returns {T[]}\n */\nfunction flattenV4ListResponse(items) {\n return items.map(item => flattenV4Response(item));\n}\n\nmodule.exports = { flattenV4Response, flattenV4ListResponse };` : '';\n\n return `// @ts-check\n/**\n * Strapi utility types\n * Generated by strapi2front\n * Strapi version: ${strapiVersion}\n */\n\n${mediaType}\n\n/**\n * @typedef {Object} StrapiMediaFormat\n * @property {string} name\n * @property {string} hash\n * @property {string} ext\n * @property {string} mime\n * @property {number} width\n * @property {number} height\n * @property {number} size\n * @property {string} url\n */\n\n/**\n * @typedef {Object} StrapiPagination\n * @property {number} page\n * @property {number} pageSize\n * @property {number} pageCount\n * @property {number} total\n */\n\n/**\n * @template T\n * @typedef {Object} StrapiResponse\n * @property {T} data\n * @property {Object} meta\n * @property {StrapiPagination} [meta.pagination]\n */\n\n/**\n * @template T\n * @typedef {Object} StrapiListResponse\n * @property {T[]} data\n * @property {Object} meta\n * @property {StrapiPagination} meta.pagination\n */\n\n${baseEntity}\n${v4RawResponseTypes}\n${blocksContentType}\n\nmodule.exports = {};\n`;\n}\n\nfunction generateClientJSDoc(strapiVersion: \"v4\" | \"v5\", apiPrefix: string = \"/api\"): string {\n const isV4 = strapiVersion === \"v4\";\n const normalizedPrefix = apiPrefix.startsWith('/') ? apiPrefix : '/' + apiPrefix;\n\n if (isV4) {\n return `// @ts-check\n/**\n * Strapi Client (v4)\n * Generated by strapi2front\n */\n\nconst Strapi = require('strapi-sdk-js').default;\n\n// Initialize the Strapi client\nconst strapiUrl = process.env.STRAPI_URL || 'http://localhost:1337';\nconst strapiToken = process.env.STRAPI_TOKEN;\nconst strapiApiPrefix = process.env.STRAPI_API_PREFIX || '${normalizedPrefix}';\n\nconst strapi = new Strapi({\n url: strapiUrl,\n prefix: strapiApiPrefix,\n axiosOptions: {\n headers: strapiToken ? {\n Authorization: \\`Bearer \\${strapiToken}\\`,\n } : {},\n },\n});\n\n/** @type {import('./utils').StrapiPagination} */\nconst defaultPagination = {\n page: 1,\n pageSize: 25,\n pageCount: 1,\n total: 0,\n};\n\n/**\n * Flatten a Strapi v4 response item (merges id with attributes)\n * @template T\n * @param {{ id: number, attributes: Omit<T, 'id'> }} item\n * @returns {T}\n */\nfunction flattenItem(item) {\n /** @type {any} */\n const merged = { id: item.id, ...item.attributes };\n return merged;\n}\n\n/**\n * Recursively flatten nested relations in Strapi v4 response\n * @template T\n * @param {T} data\n * @returns {T}\n */\nfunction flattenRelations(data) {\n if (data === null || data === undefined) return data;\n if (Array.isArray(data)) {\n /** @type {any} */\n const mapped = data.map(item => flattenRelations(item));\n return mapped;\n }\n if (typeof data === 'object') {\n /** @type {Record<string, unknown>} */\n const result = {};\n for (const [key, value] of Object.entries(data)) {\n if (value && typeof value === 'object' && 'data' in value) {\n /** @type {any} */\n const wrapper = value;\n const relationData = wrapper.data;\n if (relationData === null) {\n result[key] = null;\n } else if (Array.isArray(relationData)) {\n result[key] = relationData.map((item) =>\n flattenRelations(flattenItem(item))\n );\n } else if (typeof relationData === 'object' && relationData !== null && 'id' in relationData && 'attributes' in relationData) {\n result[key] = flattenRelations(flattenItem(relationData));\n } else {\n result[key] = flattenRelations(value);\n }\n } else {\n result[key] = flattenRelations(value);\n }\n }\n /** @type {any} */\n const typed = result;\n return typed;\n }\n return data;\n}\n\n/**\n * Helper to get typed collection\n * @template T\n * @param {string} pluralName\n */\nfunction collection(pluralName) {\n return {\n /**\n * @param {Record<string, unknown>} [params]\n * @returns {Promise<{ data: T[], meta: { pagination: import('./utils').StrapiPagination } }>}\n */\n async find(params) {\n const response = await strapi.find(pluralName, params);\n /** @type {any} */\n const rawData = response.data;\n /** @type {T[]} */\n const data = Array.isArray(rawData)\n ? rawData.map(item => flattenRelations(flattenItem(item)))\n : [];\n /** @type {any} */\n const rawMeta = response.meta;\n /** @type {any} */\n const rawPag = rawMeta?.pagination;\n /** @type {import('./utils').StrapiPagination} */\n const pagination = {\n page: rawPag?.page ?? defaultPagination.page,\n pageSize: rawPag?.pageSize ?? defaultPagination.pageSize,\n pageCount: rawPag?.pageCount ?? defaultPagination.pageCount,\n total: rawPag?.total ?? defaultPagination.total,\n };\n return { data, meta: { pagination } };\n },\n /**\n * @param {number|string} id\n * @param {Record<string, unknown>} [params]\n * @returns {Promise<{ data: T }>}\n */\n async findOne(id, params) {\n const response = await strapi.findOne(pluralName, String(id), params);\n /** @type {any} */\n const rawData = response.data;\n /** @type {T} */\n const data = flattenRelations(flattenItem(rawData));\n return { data };\n },\n /**\n * @param {{ data: Partial<T> }} data\n * @returns {Promise<{ data: T }>}\n */\n async create(data) {\n const response = await strapi.create(pluralName, data.data);\n /** @type {any} */\n const rawData = response.data;\n /** @type {T} */\n const result = flattenRelations(flattenItem(rawData));\n return { data: result };\n },\n /**\n * @param {number|string} id\n * @param {{ data: Partial<T> }} data\n * @returns {Promise<{ data: T }>}\n */\n async update(id, data) {\n const response = await strapi.update(pluralName, String(id), data.data);\n /** @type {any} */\n const rawData = response.data;\n /** @type {T} */\n const result = flattenRelations(flattenItem(rawData));\n return { data: result };\n },\n /**\n * @param {number|string} id\n * @returns {Promise<void>}\n */\n async delete(id) {\n await strapi.delete(pluralName, String(id));\n },\n };\n}\n\n/**\n * Helper to get typed single type\n * @template T\n * @param {string} singularName\n */\nfunction single(singularName) {\n return {\n /**\n * @param {Record<string, unknown>} [params]\n * @returns {Promise<{ data: T }>}\n */\n async find(params) {\n const response = await strapi.find(singularName, params);\n /** @type {any} */\n const rawData = response.data;\n /** @type {T} */\n const data = flattenRelations(flattenItem(rawData));\n return { data };\n },\n /**\n * @param {{ data: Partial<T> }} data\n * @returns {Promise<{ data: T }>}\n */\n async update(data) {\n const response = await strapi.update(singularName, String(1), data.data);\n /** @type {any} */\n const rawData = response.data;\n /** @type {T} */\n const result = flattenRelations(flattenItem(rawData));\n return { data: result };\n },\n /**\n * @returns {Promise<void>}\n */\n async delete() {\n await strapi.delete(singularName, String(1));\n },\n };\n}\n\nmodule.exports = { strapi, collection, single };\n`;\n }\n\n return `// @ts-check\n/**\n * Strapi Client (v5)\n * Generated by strapi2front\n */\n\nconst Strapi = require('strapi-sdk-js').default;\n\n// Initialize the Strapi client\nconst strapiUrl = process.env.STRAPI_URL || 'http://localhost:1337';\nconst strapiToken = process.env.STRAPI_TOKEN;\nconst strapiApiPrefix = process.env.STRAPI_API_PREFIX || '${normalizedPrefix}';\n\nconst strapi = new Strapi({\n url: strapiUrl,\n prefix: strapiApiPrefix,\n axiosOptions: {\n headers: strapiToken ? {\n Authorization: \\`Bearer \\${strapiToken}\\`,\n } : {},\n },\n});\n\n/** @type {import('./utils').StrapiPagination} */\nconst defaultPagination = {\n page: 1,\n pageSize: 25,\n pageCount: 1,\n total: 0,\n};\n\n/**\n * Helper to get typed collection\n * @template T\n * @param {string} pluralName\n */\nfunction collection(pluralName) {\n return {\n /**\n * @param {Record<string, unknown>} [params]\n * @returns {Promise<{ data: T[], meta: { pagination: import('./utils').StrapiPagination } }>}\n */\n async find(params) {\n const response = await strapi.find(pluralName, params);\n /** @type {any} */\n const rawMeta = response.meta;\n /** @type {any} */\n const rawPag = rawMeta?.pagination;\n /** @type {import('./utils').StrapiPagination} */\n const pagination = {\n page: rawPag?.page ?? defaultPagination.page,\n pageSize: rawPag?.pageSize ?? defaultPagination.pageSize,\n pageCount: rawPag?.pageCount ?? defaultPagination.pageCount,\n total: rawPag?.total ?? defaultPagination.total,\n };\n /** @type {any} */\n const rawData = response.data;\n /** @type {T[]} */\n const data = Array.isArray(rawData) ? rawData : [];\n return { data, meta: { pagination } };\n },\n /**\n * @param {string} documentId\n * @param {Record<string, unknown>} [params]\n * @returns {Promise<{ data: T }>}\n */\n async findOne(documentId, params) {\n const response = await strapi.findOne(pluralName, documentId, params);\n /** @type {any} */\n const rawData = response.data;\n /** @type {T} */\n const data = rawData;\n return { data };\n },\n /**\n * @param {{ data: Partial<T> }} data\n * @returns {Promise<{ data: T }>}\n */\n async create(data) {\n const response = await strapi.create(pluralName, data.data);\n /** @type {any} */\n const rawData = response.data;\n /** @type {T} */\n const result = rawData;\n return { data: result };\n },\n /**\n * @param {string} documentId\n * @param {{ data: Partial<T> }} data\n * @returns {Promise<{ data: T }>}\n */\n async update(documentId, data) {\n const response = await strapi.update(pluralName, documentId, data.data);\n /** @type {any} */\n const rawData = response.data;\n /** @type {T} */\n const result = rawData;\n return { data: result };\n },\n /**\n * @param {string} documentId\n * @returns {Promise<void>}\n */\n async delete(documentId) {\n await strapi.delete(pluralName, documentId);\n },\n };\n}\n\n/**\n * Helper to get typed single type\n * @template T\n * @param {string} singularName\n */\nfunction single(singularName) {\n return {\n /**\n * @param {Record<string, unknown>} [params]\n * @returns {Promise<{ data: T }>}\n */\n async find(params) {\n const response = await strapi.find(singularName, params);\n /** @type {any} */\n const rawData = response.data;\n /** @type {T} */\n const data = rawData;\n return { data };\n },\n /**\n * @param {{ data: Partial<T> }} data\n * @returns {Promise<{ data: T }>}\n */\n async update(data) {\n const response = await strapi.update(singularName, String(1), data.data);\n /** @type {any} */\n const rawData = response.data;\n /** @type {T} */\n const result = rawData;\n return { data: result };\n },\n /**\n * @returns {Promise<void>}\n */\n async delete() {\n await strapi.delete(singularName, String(1));\n },\n };\n}\n\nmodule.exports = { strapi, collection, single };\n`;\n}\n\nfunction generateLocalesFileJSDoc(locales: StrapiLocale[]): string {\n if (locales.length === 0) {\n return `// @ts-check\n/**\n * Strapi locales\n * Generated by strapi2front\n * Note: i18n is not enabled in Strapi\n */\n\n/** @type {readonly string[]} */\nconst locales = [];\n\n/** @typedef {string} Locale */\n\n/** @type {string} */\nconst defaultLocale = 'en';\n\n/** @type {Record<string, string>} */\nconst localeNames = {};\n\n/**\n * @param {string} _code\n * @returns {boolean}\n */\nfunction isValidLocale(_code) {\n return true;\n}\n\n/**\n * @param {string} code\n * @returns {string}\n */\nfunction getLocaleName(code) {\n return code;\n}\n\nmodule.exports = { locales, defaultLocale, localeNames, isValidLocale, getLocaleName };\n`;\n }\n\n const localeCodes = locales.map(l => l.code);\n const defaultLocale = locales.find(l => l.isDefault)?.code || locales[0]?.code || 'en';\n\n return `// @ts-check\n/**\n * Strapi locales\n * Generated by strapi2front\n */\n\n/** @type {readonly [${localeCodes.map(c => `'${c}'`).join(', ')}]} */\nconst locales = [${localeCodes.map(c => `'${c}'`).join(', ')}];\n\n/** @typedef {${localeCodes.map(c => `'${c}'`).join(' | ')}} Locale */\n\n/** @type {Locale} */\nconst defaultLocale = '${defaultLocale}';\n\n/** @type {Record<Locale, string>} */\nconst localeNames = {\n${locales.map(l => ` '${l.code}': '${l.name}'`).join(',\\n')}\n};\n\n/**\n * @param {string} code\n * @returns {boolean}\n */\nfunction isValidLocale(code) {\n /** @type {readonly string[]} */\n const localeList = locales;\n return localeList.includes(code);\n}\n\n/**\n * @param {Locale} code\n * @returns {string}\n */\nfunction getLocaleName(code) {\n return localeNames[code] || code;\n}\n\nmodule.exports = { locales, defaultLocale, localeNames, isValidLocale, getLocaleName };\n`;\n}\n\n// ============================================\n// JSDoc Collection Types Generation\n// ============================================\n\nfunction generateCollectionTypesJSDoc(collection: CollectionType, schema: ParsedSchema): string {\n const typeName = toPascalCase(collection.singularName);\n const attributes = generateJSDocAttributes(collection.attributes, schema, 'collection');\n\n return `// @ts-check\n/**\n * ${collection.displayName}\n * ${collection.description || ''}\n * Generated by strapi2front\n */\n\n/**\n * @typedef {import('../../shared/utils').StrapiBaseEntity & ${typeName}Attributes} ${typeName}\n */\n\n/**\n * @typedef {Object} ${typeName}Attributes\n${attributes}\n */\n\n/**\n * @typedef {Object} ${typeName}Filters\n * @property {number|{$eq?: number, $ne?: number, $in?: number[], $notIn?: number[]}} [id]\n * @property {string|{$eq?: string, $ne?: string}} [documentId]\n * @property {string|{$eq?: string, $gt?: string, $gte?: string, $lt?: string, $lte?: string}} [createdAt]\n * @property {string|{$eq?: string, $gt?: string, $gte?: string, $lt?: string, $lte?: string}} [updatedAt]\n * @property {string|null|{$eq?: string, $ne?: string, $null?: boolean}} [publishedAt]\n * @property {${typeName}Filters[]} [$and]\n * @property {${typeName}Filters[]} [$or]\n * @property {${typeName}Filters} [$not]\n */\n\nmodule.exports = {};\n`;\n}\n\nfunction generateSingleTypesJSDoc(single: SingleType, schema: ParsedSchema): string {\n const typeName = toPascalCase(single.singularName);\n const attributes = generateJSDocAttributes(single.attributes, schema, 'single');\n\n return `// @ts-check\n/**\n * ${single.displayName}\n * ${single.description || ''}\n * Generated by strapi2front\n */\n\n/**\n * @typedef {import('../../shared/utils').StrapiBaseEntity & ${typeName}Attributes} ${typeName}\n */\n\n/**\n * @typedef {Object} ${typeName}Attributes\n${attributes}\n */\n\nmodule.exports = {};\n`;\n}\n\nfunction generateComponentTypesJSDoc(component: ComponentType, schema: ParsedSchema): string {\n const typeName = toPascalCase(component.name);\n const attributes = generateJSDocAttributes(component.attributes, schema, 'component');\n\n return `// @ts-check\n/**\n * ${component.displayName} component\n * Category: ${component.category}\n * ${component.description || ''}\n * Generated by strapi2front\n */\n\n/**\n * @typedef {Object} ${typeName}\n * @property {number} id\n${attributes}\n */\n\nmodule.exports = {};\n`;\n}\n\nfunction generateJSDocAttributes(\n attributes: Record<string, Attribute>,\n schema: ParsedSchema,\n context: 'collection' | 'single' | 'component'\n): string {\n const lines: string[] = [];\n const relativePrefix = context === 'component' ? '..' : '../..';\n\n for (const [name, attr] of Object.entries(attributes)) {\n const jsType = attributeToJSDocType(attr, schema, relativePrefix);\n const optional = attr.required ? '' : '[';\n const optionalEnd = attr.required ? '' : ']';\n lines.push(` * @property {${jsType}} ${optional}${name}${optionalEnd}`);\n }\n\n return lines.join('\\n');\n}\n\nfunction attributeToJSDocType(\n attr: Attribute,\n schema: ParsedSchema,\n relativePrefix: string\n): string {\n switch (attr.type) {\n case 'string':\n case 'text':\n case 'richtext':\n case 'email':\n case 'password':\n case 'uid':\n return 'string';\n case 'blocks':\n return 'Array<Object>';\n case 'integer':\n case 'biginteger':\n case 'float':\n case 'decimal':\n return 'number';\n case 'boolean':\n return 'boolean';\n case 'date':\n case 'time':\n case 'datetime':\n case 'timestamp':\n return 'string';\n case 'json':\n return 'Object';\n case 'enumeration':\n if ('enum' in attr && attr.enum) {\n return attr.enum.map(v => `'${v}'`).join('|');\n }\n return 'string';\n case 'media':\n if ('multiple' in attr && attr.multiple) {\n return `import(\"${relativePrefix}/shared/utils\").StrapiMedia[]`;\n }\n return `import(\"${relativePrefix}/shared/utils\").StrapiMedia|null`;\n case 'relation':\n if ('target' in attr && attr.target) {\n const targetName = attr.target.split('.').pop() || 'unknown';\n const typeName = toPascalCase(targetName);\n const fileName = toKebabCase(targetName);\n const isMany = attr.relation === 'oneToMany' || attr.relation === 'manyToMany';\n\n // Determine if target is a collection or single\n const isCollection = schema.collections.some(c => c.singularName === targetName);\n const isSingle = schema.singles.some(s => s.singularName === targetName);\n\n let importPath: string;\n if (isCollection) {\n importPath = `${relativePrefix}/collections/${fileName}/types`;\n } else if (isSingle) {\n importPath = `${relativePrefix}/singles/${fileName}/types`;\n } else {\n // Fallback - assume collection\n importPath = `${relativePrefix}/collections/${fileName}/types`;\n }\n\n const importType = `import(\"${importPath}\").${typeName}`;\n return isMany ? `${importType}[]` : `${importType}|null`;\n }\n return 'Object';\n case 'component':\n if ('component' in attr && attr.component) {\n const componentName = attr.component.split('.').pop() || 'unknown';\n const typeName = toPascalCase(componentName);\n const fileName = toKebabCase(componentName);\n const importPath = `${relativePrefix}/components/${fileName}`;\n const importType = `import(\"${importPath}\").${typeName}`;\n\n if ('repeatable' in attr && attr.repeatable) {\n return `${importType}[]`;\n }\n return `${importType}|null`;\n }\n return 'Object';\n case 'dynamiczone':\n if ('components' in attr && attr.components) {\n const types = attr.components.map(comp => {\n const componentName = comp.split('.').pop() || 'unknown';\n const typeName = toPascalCase(componentName);\n const fileName = toKebabCase(componentName);\n const importPath = `${relativePrefix}/components/${fileName}`;\n return `import(\"${importPath}\").${typeName}`;\n });\n return `(${types.join('|')})[]`;\n }\n return 'Object[]';\n default:\n return 'Object';\n }\n}\n\n// ============================================\n// JSDoc Collection Service Generation\n// ============================================\n\nfunction generateCollectionServiceJSDoc(collection: CollectionType, strapiVersion: \"v4\" | \"v5\"): string {\n const typeName = toPascalCase(collection.singularName);\n const serviceName = toCamelCase(collection.singularName) + 'Service';\n const endpoint = collection.pluralName;\n const hasSlug = 'slug' in collection.attributes;\n const { localized, draftAndPublish } = collection;\n const isV4 = strapiVersion === \"v4\";\n\n // V4 uses `id: number`, V5 uses `documentId: string`\n const idParam = isV4 ? 'id' : 'documentId';\n const idType = isV4 ? 'number' : 'string';\n\n return `// @ts-check\n/**\n * ${collection.displayName} Service\n * ${collection.description || ''}\n * Generated by strapi2front\n * Strapi version: ${strapiVersion}\n */\n\nconst { collection } = require('../../shared/client');\n\n/**\n * @typedef {Object} FindManyOptions\n * @property {import('./types').${typeName}Filters} [filters]\n * @property {Object} [pagination]\n * @property {number} [pagination.page]\n * @property {number} [pagination.pageSize]\n * @property {number} [pagination.start]\n * @property {number} [pagination.limit]\n * @property {string|string[]} [sort]\n * @property {string|string[]|Record<string, unknown>} [populate]${localized ? '\\n * @property {string} [locale]' : ''}${draftAndPublish ? \"\\n * @property {'draft'|'published'} [status]\" : ''}\n */\n\n/**\n * @typedef {Object} FindOneOptions\n * @property {string|string[]|Record<string, unknown>} [populate]${localized ? '\\n * @property {string} [locale]' : ''}${draftAndPublish ? \"\\n * @property {'draft'|'published'} [status]\" : ''}\n */\n\n/** @type {ReturnType<typeof collection<import('./types').${typeName}>>} */\nconst ${toCamelCase(collection.singularName)}Collection = collection('${endpoint}');\n\nconst ${serviceName} = {\n /**\n * @param {FindManyOptions} [options]\n * @returns {Promise<{ data: import('./types').${typeName}[], pagination: import('../../shared/utils').StrapiPagination }>}\n */\n async findMany(options = {}) {\n const response = await ${toCamelCase(collection.singularName)}Collection.find({\n filters: options.filters,\n pagination: options.pagination,\n sort: options.sort,\n populate: options.populate,${localized ? '\\n locale: options.locale,' : ''}${draftAndPublish ? '\\n status: options.status,' : ''}\n });\n\n return {\n data: response.data,\n pagination: response.meta.pagination,\n };\n },\n\n /**\n * @param {Omit<FindManyOptions, 'pagination'>} [options]\n * @returns {Promise<import('./types').${typeName}[]>}\n */\n async findAll(options = {}) {\n /** @type {import('./types').${typeName}[]} */\n const allItems = [];\n let page = 1;\n let hasMore = true;\n\n while (hasMore) {\n const { data, pagination } = await this.findMany({\n ...options,\n pagination: { page, pageSize: 100 },\n });\n\n allItems.push(...data);\n hasMore = page < pagination.pageCount;\n page++;\n }\n\n return allItems;\n },\n\n /**\n * @param {${idType}} ${idParam}\n * @param {FindOneOptions} [options]\n * @returns {Promise<import('./types').${typeName}|null>}\n */\n async findOne(${idParam}, options = {}) {\n try {\n const response = await ${toCamelCase(collection.singularName)}Collection.findOne(${idParam}, {\n populate: options.populate,${localized ? '\\n locale: options.locale,' : ''}${draftAndPublish ? '\\n status: options.status,' : ''}\n });\n\n return response.data;\n } catch (error) {\n if (error instanceof Error && error.message.includes('404')) {\n return null;\n }\n throw error;\n }\n },\n${hasSlug ? `\n /**\n * @param {string} slug\n * @param {FindOneOptions} [options]\n * @returns {Promise<import('./types').${typeName}|null>}\n */\n async findBySlug(slug, options = {}) {\n const { data } = await this.findMany({\n filters: /** @type {import('./types').${typeName}Filters} */ ({ slug: { $eq: slug } }),\n pagination: { pageSize: 1 },\n populate: options.populate,${localized ? '\\n locale: options.locale,' : ''}${draftAndPublish ? '\\n status: options.status,' : ''}\n });\n\n return data[0] || null;\n },\n` : ''}\n /**\n * @param {Partial<import('./types').${typeName}>} data\n * @returns {Promise<import('./types').${typeName}>}\n */\n async create(data) {\n const response = await ${toCamelCase(collection.singularName)}Collection.create({ data });\n return response.data;\n },\n\n /**\n * @param {${idType}} ${idParam}\n * @param {Partial<import('./types').${typeName}>} data\n * @returns {Promise<import('./types').${typeName}>}\n */\n async update(${idParam}, data) {\n const response = await ${toCamelCase(collection.singularName)}Collection.update(${idParam}, { data });\n return response.data;\n },\n\n /**\n * @param {${idType}} ${idParam}\n * @returns {Promise<void>}\n */\n async delete(${idParam}) {\n await ${toCamelCase(collection.singularName)}Collection.delete(${idParam});\n },\n\n /**\n * @param {import('./types').${typeName}Filters} [filters]\n * @returns {Promise<number>}\n */\n async count(filters) {\n const { pagination } = await this.findMany({\n filters,\n pagination: { pageSize: 1 },\n });\n\n return pagination.total;\n },\n};\n\nmodule.exports = { ${serviceName} };\n`;\n}\n\n// ============================================\n// JSDoc Single Service Generation\n// ============================================\n\nfunction generateSingleServiceJSDoc(single: SingleType, strapiVersion: \"v4\" | \"v5\"): string {\n const typeName = toPascalCase(single.singularName);\n const serviceName = toCamelCase(single.singularName) + 'Service';\n const endpoint = single.singularName;\n const { localized, draftAndPublish } = single;\n\n return `// @ts-check\n/**\n * ${single.displayName} Service (Single Type)\n * ${single.description || ''}\n * Generated by strapi2front\n * Strapi version: ${strapiVersion}\n */\n\nconst { single } = require('../../shared/client');\n\n/**\n * @typedef {Object} FindOptions\n * @property {string|string[]|Record<string, unknown>} [populate]${localized ? '\\n * @property {string} [locale]' : ''}${draftAndPublish ? \"\\n * @property {'draft'|'published'} [status]\" : ''}\n */\n\n/** @type {ReturnType<typeof single<import('./types').${typeName}>>} */\nconst ${toCamelCase(single.singularName)}Single = single('${endpoint}');\n\nconst ${serviceName} = {\n /**\n * @param {FindOptions} [options]\n * @returns {Promise<import('./types').${typeName}|null>}\n */\n async find(options = {}) {\n try {\n const response = await ${toCamelCase(single.singularName)}Single.find({\n populate: options.populate,${localized ? '\\n locale: options.locale,' : ''}${draftAndPublish ? '\\n status: options.status,' : ''}\n });\n\n return response.data;\n } catch (error) {\n if (error instanceof Error && error.message.includes('404')) {\n return null;\n }\n throw error;\n }\n },\n\n /**\n * @param {Partial<import('./types').${typeName}>} data\n * @returns {Promise<import('./types').${typeName}>}\n */\n async update(data) {\n const response = await ${toCamelCase(single.singularName)}Single.update({ data });\n return response.data;\n },\n\n /**\n * @returns {Promise<void>}\n */\n async delete() {\n await ${toCamelCase(single.singularName)}Single.delete();\n },\n};\n\nmodule.exports = { ${serviceName} };\n`;\n}\n","/**\n * Next.js Server Actions generator\n * Generates type-safe Server Actions for Strapi content types\n *\n * Requirements:\n * - Next.js 14+ (Server Actions)\n * - TypeScript enabled\n *\n * Status: COMING SOON\n */\n\nimport type { ParsedSchema } from '@strapi2front/core';\nimport type { StrapiVersion } from '../../shared/types.js';\n\nexport interface NextJsActionsOptions {\n outputDir: string;\n servicesImportPath: string;\n strapiVersion?: StrapiVersion;\n}\n\n/**\n * Generate Next.js Server Actions from parsed schema\n *\n * @throws Error - Not yet implemented\n */\nexport async function generateNextJsActions(\n _schema: ParsedSchema,\n _options: NextJsActionsOptions\n): Promise<string[]> {\n throw new Error(\n 'Next.js Server Actions generator is not yet implemented. ' +\n 'Coming soon! For now, you can use the generated services directly.'\n );\n}\n\n/**\n * Check if Next.js Server Actions are supported\n * Requires Next.js 14+ with App Router\n */\nexport function isNextJsActionsSupported(nextVersion: string | null): boolean {\n if (!nextVersion) return false;\n\n // Remove ^ or ~ prefix and get major version\n const match = nextVersion.replace(/^[\\^~]/, \"\").match(/^(\\d+)/);\n const majorVersion = match ? parseInt(match[1], 10) : null;\n\n return majorVersion !== null && majorVersion >= 14;\n}\n","/**\n * Nuxt Server Routes generator\n * Generates type-safe server routes for Strapi content types\n *\n * Requirements:\n * - Nuxt 3+\n * - TypeScript enabled\n *\n * Status: COMING SOON\n */\n\nimport type { ParsedSchema } from '@strapi2front/core';\nimport type { StrapiVersion } from '../../shared/types.js';\n\nexport interface NuxtServerRoutesOptions {\n outputDir: string;\n servicesImportPath: string;\n strapiVersion?: StrapiVersion;\n}\n\n/**\n * Generate Nuxt Server Routes from parsed schema\n *\n * @throws Error - Not yet implemented\n */\nexport async function generateNuxtServerRoutes(\n _schema: ParsedSchema,\n _options: NuxtServerRoutesOptions\n): Promise<string[]> {\n throw new Error(\n 'Nuxt Server Routes generator is not yet implemented. ' +\n 'Coming soon! For now, you can use the generated services directly.'\n );\n}\n\n/**\n * Check if Nuxt Server Routes are supported\n * Requires Nuxt 3+\n */\nexport function isNuxtServerRoutesSupported(nuxtVersion: string | null): boolean {\n if (!nuxtVersion) return false;\n\n // Remove ^ or ~ prefix and get major version\n const match = nuxtVersion.replace(/^[\\^~]/, \"\").match(/^(\\d+)/);\n const majorVersion = match ? parseInt(match[1], 10) : null;\n\n return majorVersion !== null && majorVersion >= 3;\n}\n","/**\n * Framework-specific generators\n *\n * Each framework has its own approach to server-side data fetching:\n * - Astro: Actions (v4+)\n * - Next.js: Server Actions (v14+) - Coming Soon\n * - Nuxt: Server Routes (v3+) - Coming Soon\n */\n\n// Astro\nexport { generateAstroActions, isAstroActionsSupported } from './astro/actions.js';\nexport type { AstroActionsOptions } from './astro/actions.js';\n\n// Next.js (Coming Soon)\nexport { generateNextJsActions, isNextJsActionsSupported } from './nextjs/actions.js';\nexport type { NextJsActionsOptions } from './nextjs/actions.js';\n\n// Nuxt (Coming Soon)\nexport { generateNuxtServerRoutes, isNuxtServerRoutesSupported } from './nuxt/server-routes.js';\nexport type { NuxtServerRoutesOptions } from './nuxt/server-routes.js';\n\n/**\n * Supported frameworks for action generation\n */\nexport type SupportedFramework = 'astro' | 'nextjs' | 'nuxt';\n\n/**\n * Framework support status\n */\nexport const frameworkSupport: Record<SupportedFramework, { status: 'stable' | 'coming-soon'; minVersion: string }> = {\n astro: { status: 'stable', minVersion: '4.0.0' },\n nextjs: { status: 'coming-soon', minVersion: '14.0.0' },\n nuxt: { status: 'coming-soon', minVersion: '3.0.0' },\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/utils/formatter.ts","../src/utils/file.ts","../src/utils/naming.ts","../src/shared/type-mapper.ts","../src/output/typescript/types.ts","../src/output/jsdoc/types.ts","../src/types/generator.ts","../src/output/jsdoc/services.ts","../src/services/generator.ts","../src/frameworks/astro/actions.ts","../src/actions/generator.ts","../src/client/generator.ts","../src/locales/generator.ts","../src/by-feature/generator.ts","../src/frameworks/nextjs/actions.ts","../src/frameworks/nuxt/server-routes.ts","../src/frameworks/index.ts"],"names":["path","generateUtilityTypes","generateCollectionType","generateSingleType","generateComponentType","generateCollectionService","generateSingleService","generateClient","generateLocalesFile","generateCollectionActions","generateAttributes"],"mappings":";;;;;AAKA,eAAsB,WAAW,IAAA,EAA+B;AAC9D,EAAA,IAAI;AACF,IAAA,OAAO,MAAe,gBAAO,IAAA,EAAM;AAAA,MACjC,MAAA,EAAQ,YAAA;AAAA,MACR,IAAA,EAAM,IAAA;AAAA,MACN,WAAA,EAAa,IAAA;AAAA,MACb,aAAA,EAAe,KAAA;AAAA,MACf,UAAA,EAAY,GAAA;AAAA,MACZ,QAAA,EAAU,CAAA;AAAA,MACV,OAAA,EAAS;AAAA,KACV,CAAA;AAAA,EACH,CAAA,CAAA,MAAQ;AAEN,IAAA,OAAO,IAAA;AAAA,EACT;AACF;AAKA,eAAsB,WAAW,IAAA,EAA+B;AAC9D,EAAA,IAAI;AACF,IAAA,OAAO,MAAe,gBAAO,IAAA,EAAM;AAAA,MACjC,MAAA,EAAQ,MAAA;AAAA,MACR,QAAA,EAAU;AAAA,KACX,CAAA;AAAA,EACH,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,IAAA;AAAA,EACT;AACF;AC5BA,eAAsB,UAAU,OAAA,EAAgC;AAC9D,EAAA,IAAI;AACF,IAAA,MAAM,GAAG,KAAA,CAAM,OAAA,EAAS,EAAE,SAAA,EAAW,MAAM,CAAA;AAAA,EAC7C,SAAS,KAAA,EAAO;AAEd,IAAA,IAAK,KAAA,CAAgC,SAAS,QAAA,EAAU;AACtD,MAAA,MAAM,KAAA;AAAA,IACR;AAAA,EACF;AACF;AAKA,eAAsB,SAAA,CAAU,UAAkB,OAAA,EAAgC;AAChF,EAAA,MAAM,GAAA,GAAMA,KAAA,CAAK,OAAA,CAAQ,QAAQ,CAAA;AACjC,EAAA,MAAM,UAAU,GAAG,CAAA;AACnB,EAAA,MAAM,EAAA,CAAG,SAAA,CAAU,QAAA,EAAU,OAAA,EAA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AA,CAAE,MAAM,QAAQ,CAAA;AAC9D,EAAA,MAAM,eAAe,KAAA,GAAQ,QAAA,CAAS,MAAM,CAAC,CAAA,EAAG,EAAE,CAAA,GAAI,IAAA;AAEtD,EAAA,OAAO,YAAA,KAAiB,QAAQ,YAAA,IAAgB,CAAA;AAClD;;;AClBO,IAAM,gBAAA,GAAyG;AAAA,EACpH,KAAA,EAAO,EAAE,MAAA,EAAQ,QAAA,EAAU,YAAY,OAAA,EAAQ;AAAA,EAC/C,MAAA,EAAQ,EAAE,MAAA,EAAQ,aAAA,EAAe,YAAY,QAAA,EAAS;AAAA,EACtD,IAAA,EAAM,EAAE,MAAA,EAAQ,aAAA,EAAe,YAAY,OAAA;AAC7C","file":"index.js","sourcesContent":["import * as prettier from 'prettier';\n\n/**\n * Format TypeScript code using Prettier\n */\nexport async function formatCode(code: string): Promise<string> {\n try {\n return await prettier.format(code, {\n parser: 'typescript',\n semi: true,\n singleQuote: true,\n trailingComma: 'es5',\n printWidth: 100,\n tabWidth: 2,\n useTabs: false,\n });\n } catch {\n // If formatting fails, return original code\n return code;\n }\n}\n\n/**\n * Format JSON code using Prettier\n */\nexport async function formatJson(code: string): Promise<string> {\n try {\n return await prettier.format(code, {\n parser: 'json',\n tabWidth: 2,\n });\n } catch {\n return code;\n }\n}\n","import fs from 'node:fs/promises';\nimport path from 'node:path';\n\n/**\n * Ensure a directory exists, creating it if necessary\n */\nexport async function ensureDir(dirPath: string): Promise<void> {\n try {\n await fs.mkdir(dirPath, { recursive: true });\n } catch (error) {\n // Ignore if directory already exists\n if ((error as NodeJS.ErrnoException).code !== 'EEXIST') {\n throw error;\n }\n }\n}\n\n/**\n * Write content to a file, creating parent directories if needed\n */\nexport async function writeFile(filePath: string, content: string): Promise<void> {\n const dir = path.dirname(filePath);\n await ensureDir(dir);\n await fs.writeFile(filePath, content, 'utf-8');\n}\n\n/**\n * Read a file's content\n */\nexport async function readFile(filePath: string): Promise<string> {\n return await fs.readFile(filePath, 'utf-8');\n}\n\n/**\n * Check if a file exists\n */\nexport async function fileExists(filePath: string): Promise<boolean> {\n try {\n await fs.access(filePath);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Delete a file if it exists\n */\nexport async function deleteFile(filePath: string): Promise<void> {\n try {\n await fs.unlink(filePath);\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== 'ENOENT') {\n throw error;\n }\n }\n}\n\n/**\n * List files in a directory matching a pattern\n */\nexport async function listFiles(dirPath: string, extension?: string): Promise<string[]> {\n try {\n const entries = await fs.readdir(dirPath, { withFileTypes: true });\n let files = entries\n .filter((entry) => entry.isFile())\n .map((entry) => path.join(dirPath, entry.name));\n\n if (extension) {\n files = files.filter((file) => file.endsWith(extension));\n }\n\n return files;\n } catch {\n return [];\n }\n}\n","/**\n * Convert string to PascalCase\n */\nexport function toPascalCase(str: string): string {\n return str\n .split(/[-_\\s]+/)\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join('');\n}\n\n/**\n * Convert string to camelCase\n */\nexport function toCamelCase(str: string): string {\n const pascal = toPascalCase(str);\n return pascal.charAt(0).toLowerCase() + pascal.slice(1);\n}\n\n/**\n * Convert string to kebab-case\n */\nexport function toKebabCase(str: string): string {\n return str\n .replace(/([a-z])([A-Z])/g, '$1-$2')\n .replace(/[\\s_]+/g, '-')\n .toLowerCase();\n}\n\n/**\n * Pluralize a word (simple version)\n */\nexport function pluralize(word: string): string {\n if (word.endsWith('s') || word.endsWith('x') || word.endsWith('ch') || word.endsWith('sh')) {\n return word + 'es';\n }\n if (word.endsWith('y') && !['a', 'e', 'i', 'o', 'u'].includes(word.charAt(word.length - 2))) {\n return word.slice(0, -1) + 'ies';\n }\n return word + 's';\n}\n","/**\n * Type mapping utilities\n * Shared logic for converting Strapi attributes to TypeScript/JSDoc types\n */\n\nimport type { Attribute, ComponentType } from '@strapi2front/core';\nimport { toPascalCase } from '../utils/naming.js';\n\n/**\n * Mapped type information\n */\nexport interface MappedType {\n /** The type string (e.g., \"string\", \"number\", \"Article\") */\n type: string;\n /** Whether this type needs an import */\n needsImport: boolean;\n /** Import details if needed */\n import?: {\n name: string;\n from: string;\n isRelation?: boolean;\n isComponent?: boolean;\n };\n}\n\n/**\n * Convert Strapi attribute to type string\n */\nexport function mapAttributeToType(attr: Attribute, _components: ComponentType[]): MappedType {\n switch (attr.type) {\n case 'string':\n case 'text':\n case 'richtext':\n case 'email':\n case 'password':\n case 'uid':\n return { type: 'string', needsImport: false };\n\n case 'blocks':\n return {\n type: 'BlocksContent',\n needsImport: true,\n import: { name: 'BlocksContent', from: 'utils' }\n };\n\n case 'integer':\n case 'biginteger':\n case 'float':\n case 'decimal':\n return { type: 'number', needsImport: false };\n\n case 'boolean':\n return { type: 'boolean', needsImport: false };\n\n case 'date':\n case 'time':\n case 'datetime':\n case 'timestamp':\n return { type: 'string', needsImport: false };\n\n case 'json':\n return { type: 'unknown', needsImport: false };\n\n case 'enumeration':\n if ('enum' in attr && attr.enum) {\n return {\n type: attr.enum.map((v) => `'${v}'`).join(' | '),\n needsImport: false\n };\n }\n return { type: 'string', needsImport: false };\n\n case 'media':\n if ('multiple' in attr && attr.multiple) {\n return {\n type: 'StrapiMedia[]',\n needsImport: true,\n import: { name: 'StrapiMedia', from: 'utils' }\n };\n }\n return {\n type: 'StrapiMedia | null',\n needsImport: true,\n import: { name: 'StrapiMedia', from: 'utils' }\n };\n\n case 'relation':\n if ('target' in attr && attr.target) {\n const targetName = attr.target.split('.').pop() || 'unknown';\n const typeName = toPascalCase(targetName);\n const isMany = attr.relation === 'oneToMany' || attr.relation === 'manyToMany';\n return {\n type: isMany ? `${typeName}[]` : `${typeName} | null`,\n needsImport: true,\n import: { name: typeName, from: targetName, isRelation: true }\n };\n }\n return { type: 'unknown', needsImport: false };\n\n case 'component':\n if ('component' in attr && attr.component) {\n const componentName = attr.component.split('.').pop() || 'unknown';\n const typeName = toPascalCase(componentName);\n if ('repeatable' in attr && attr.repeatable) {\n return {\n type: `${typeName}[]`,\n needsImport: true,\n import: { name: typeName, from: componentName, isComponent: true }\n };\n }\n return {\n type: `${typeName} | null`,\n needsImport: true,\n import: { name: typeName, from: componentName, isComponent: true }\n };\n }\n return { type: 'unknown', needsImport: false };\n\n case 'dynamiczone':\n if ('components' in attr && attr.components) {\n const types = attr.components.map((c) => {\n const name = c.split('.').pop() || 'unknown';\n return toPascalCase(name);\n });\n return {\n type: `(${types.join(' | ')})[]`,\n needsImport: true,\n // Dynamic zones need multiple imports, handled separately\n };\n }\n return { type: 'unknown[]', needsImport: false };\n\n default:\n return { type: 'unknown', needsImport: false };\n }\n}\n\n/**\n * Get JSDoc type annotation for an attribute\n */\nexport function getJSDocType(mappedType: MappedType): string {\n return mappedType.type;\n}\n\n/**\n * Get attribute comment/description\n */\nexport function getAttributeComment(attr: Attribute): string | null {\n const parts: string[] = [];\n\n if (attr.required) {\n parts.push('Required');\n }\n\n if ('minLength' in attr && attr.minLength !== undefined) {\n parts.push(`Min length: ${attr.minLength}`);\n }\n\n if ('maxLength' in attr && attr.maxLength !== undefined) {\n parts.push(`Max length: ${attr.maxLength}`);\n }\n\n if ('min' in attr && attr.min !== undefined) {\n parts.push(`Min: ${attr.min}`);\n }\n\n if ('max' in attr && attr.max !== undefined) {\n parts.push(`Max: ${attr.max}`);\n }\n\n return parts.length > 0 ? parts.join(', ') : null;\n}\n\n/**\n * Extract all dependencies (relations and components) from attributes\n */\nexport function extractDependencies(\n attributes: Record<string, Attribute>,\n selfName: string\n): { relations: Set<string>; components: Set<string> } {\n const relations = new Set<string>();\n const components = new Set<string>();\n\n for (const attr of Object.values(attributes)) {\n if (attr.type === 'relation' && 'target' in attr && attr.target) {\n const targetName = attr.target.split('.').pop() || '';\n const typeName = toPascalCase(targetName);\n // Don't import self\n if (typeName !== selfName && targetName) {\n relations.add(targetName);\n }\n }\n\n if (attr.type === 'component' && 'component' in attr && attr.component) {\n const componentName = attr.component.split('.').pop() || '';\n if (componentName) {\n components.add(componentName);\n }\n }\n\n if (attr.type === 'dynamiczone' && 'components' in attr && attr.components) {\n for (const comp of attr.components) {\n const componentName = comp.split('.').pop() || '';\n if (componentName) {\n components.add(componentName);\n }\n }\n }\n }\n\n return { relations, components };\n}\n","/**\n * TypeScript type generator\n * Generates .ts files with interfaces\n */\n\nimport path from 'node:path';\nimport type { ParsedSchema, CollectionType, SingleType, ComponentType, Attribute } from '@strapi2front/core';\nimport type { StrapiVersion } from '../../shared/types.js';\nimport { formatCode } from '../../utils/formatter.js';\nimport { writeFile, ensureDir } from '../../utils/file.js';\nimport { toPascalCase, toKebabCase } from '../../utils/naming.js';\nimport { mapAttributeToType, getAttributeComment, extractDependencies } from '../../shared/type-mapper.js';\n\nexport interface TypeScriptTypesOptions {\n outputDir: string;\n blocksRendererInstalled?: boolean;\n strapiVersion?: StrapiVersion;\n}\n\n/**\n * Generate TypeScript types from parsed schema\n */\nexport async function generateTypeScriptTypes(\n schema: ParsedSchema,\n options: TypeScriptTypesOptions\n): Promise<string[]> {\n const { outputDir } = options;\n const generatedFiles: string[] = [];\n\n // Ensure directories exist\n await ensureDir(path.join(outputDir, 'collections'));\n await ensureDir(path.join(outputDir, 'components'));\n\n // Generate utility types\n const utilsPath = path.join(outputDir, 'utils.ts');\n const strapiVersion = options.strapiVersion ?? 'v5';\n await writeFile(utilsPath, await formatCode(generateUtilityTypes(options.blocksRendererInstalled ?? false, strapiVersion)));\n generatedFiles.push(utilsPath);\n\n // Generate collection types\n for (const collection of schema.collections) {\n const fileName = `${toKebabCase(collection.singularName)}.ts`;\n const filePath = path.join(outputDir, 'collections', fileName);\n const content = generateCollectionType(collection, schema.components);\n await writeFile(filePath, await formatCode(content));\n generatedFiles.push(filePath);\n }\n\n // Generate single types\n for (const single of schema.singles) {\n const fileName = `${toKebabCase(single.singularName)}.ts`;\n const filePath = path.join(outputDir, 'collections', fileName);\n const content = generateSingleType(single, schema.components);\n await writeFile(filePath, await formatCode(content));\n generatedFiles.push(filePath);\n }\n\n // Generate component types\n for (const component of schema.components) {\n const fileName = `${toKebabCase(component.name)}.ts`;\n const filePath = path.join(outputDir, 'components', fileName);\n const content = generateComponentType(component);\n await writeFile(filePath, await formatCode(content));\n generatedFiles.push(filePath);\n }\n\n return generatedFiles;\n}\n\n/**\n * Generate utility types\n */\nfunction generateUtilityTypes(blocksRendererInstalled: boolean, strapiVersion: StrapiVersion): string {\n const isV4 = strapiVersion === \"v4\";\n\n const blocksContentType = isV4\n ? `/**\n * Rich text content (Strapi v4)\n * Can be markdown string or custom JSON structure\n */\nexport type RichTextContent = string;`\n : blocksRendererInstalled\n ? `/**\n * Blocks content type (Strapi v5 rich text)\n * Re-exported from @strapi/blocks-react-renderer\n */\nexport type { BlocksContent } from '@strapi/blocks-react-renderer';`\n : `/**\n * Blocks content type (Strapi v5 rich text)\n *\n * For full type support and rendering, install:\n * npm install @strapi/blocks-react-renderer\n *\n * Then re-run: npx strapi2front sync\n */\nexport type BlocksContent = unknown[];`;\n\n const baseEntity = isV4\n ? `/**\n * Base entity fields (Strapi v4)\n */\nexport interface StrapiBaseEntity {\n id: number;\n createdAt: string;\n updatedAt: string;\n publishedAt: string | null;\n}`\n : `/**\n * Base entity fields (Strapi v5)\n */\nexport interface StrapiBaseEntity {\n id: number;\n documentId: string;\n createdAt: string;\n updatedAt: string;\n publishedAt: string | null;\n}`;\n\n const mediaType = isV4\n ? `/**\n * Strapi media object (v4)\n */\nexport interface StrapiMedia {\n id: number;\n name: string;\n alternativeText: string | null;\n caption: string | null;\n width: number;\n height: number;\n formats: {\n thumbnail?: StrapiMediaFormat;\n small?: StrapiMediaFormat;\n medium?: StrapiMediaFormat;\n large?: StrapiMediaFormat;\n } | null;\n hash: string;\n ext: string;\n mime: string;\n size: number;\n url: string;\n previewUrl: string | null;\n provider: string;\n createdAt: string;\n updatedAt: string;\n}`\n : `/**\n * Strapi media object (v5)\n */\nexport interface StrapiMedia {\n id: number;\n documentId: string;\n name: string;\n alternativeText: string | null;\n caption: string | null;\n width: number;\n height: number;\n formats: {\n thumbnail?: StrapiMediaFormat;\n small?: StrapiMediaFormat;\n medium?: StrapiMediaFormat;\n large?: StrapiMediaFormat;\n } | null;\n hash: string;\n ext: string;\n mime: string;\n size: number;\n url: string;\n previewUrl: string | null;\n provider: string;\n createdAt: string;\n updatedAt: string;\n}`;\n\n const rawResponseTypes = isV4\n ? `\n/**\n * Strapi v4 raw API response (with nested attributes)\n */\nexport interface StrapiV4RawItem<T> {\n id: number;\n attributes: Omit<T, 'id'>;\n}\n\nexport interface StrapiV4RawResponse<T> {\n data: StrapiV4RawItem<T>;\n meta: Record<string, unknown>;\n}\n\nexport interface StrapiV4RawListResponse<T> {\n data: StrapiV4RawItem<T>[];\n meta: {\n pagination: StrapiPagination;\n };\n}\n\n/**\n * Flatten Strapi v4 response item\n */\nexport function flattenV4Response<T>(item: StrapiV4RawItem<T>): T {\n return { id: item.id, ...item.attributes } as T;\n}\n\n/**\n * Flatten Strapi v4 list response\n */\nexport function flattenV4ListResponse<T>(items: StrapiV4RawItem<T>[]): T[] {\n return items.map(item => flattenV4Response<T>(item));\n}`\n : '';\n\n return `/**\n * Strapi utility types\n * Generated by strapi2front\n * Strapi version: ${strapiVersion}\n */\n\n${mediaType}\n\nexport interface StrapiMediaFormat {\n name: string;\n hash: string;\n ext: string;\n mime: string;\n width: number;\n height: number;\n size: number;\n url: string;\n}\n\n/**\n * Strapi pagination\n */\nexport interface StrapiPagination {\n page: number;\n pageSize: number;\n pageCount: number;\n total: number;\n}\n\n/**\n * Strapi response wrapper\n */\nexport interface StrapiResponse<T> {\n data: T;\n meta: {\n pagination?: StrapiPagination;\n };\n}\n\n/**\n * Strapi list response\n */\nexport interface StrapiListResponse<T> {\n data: T[];\n meta: {\n pagination: StrapiPagination;\n };\n}\n\n${baseEntity}\n${rawResponseTypes}\n${blocksContentType}\n`;\n}\n\n/**\n * Generate import statements for dependencies\n */\nfunction generateDependencyImports(\n relations: Set<string>,\n components: Set<string>\n): string {\n const imports: string[] = [];\n\n // Import relations (other collections/singles)\n for (const relation of relations) {\n const typeName = toPascalCase(relation);\n const fileName = toKebabCase(relation);\n imports.push(`import type { ${typeName} } from './${fileName}';`);\n }\n\n // Import components\n for (const component of components) {\n const typeName = toPascalCase(component);\n const fileName = toKebabCase(component);\n imports.push(`import type { ${typeName} } from '../components/${fileName}';`);\n }\n\n return imports.join('\\n');\n}\n\n/**\n * Generate type for a collection\n */\nfunction generateCollectionType(collection: CollectionType, components: ComponentType[]): string {\n const typeName = toPascalCase(collection.singularName);\n const attributes = generateAttributes(collection.attributes, components);\n const { relations, components: componentDeps } = extractDependencies(collection.attributes, typeName);\n const dependencyImports = generateDependencyImports(relations, componentDeps);\n\n // Build utils imports based on what's actually used\n const utilsImports: string[] = ['StrapiBaseEntity'];\n const attributesStr = JSON.stringify(collection.attributes);\n if (attributesStr.includes('\"type\":\"media\"')) {\n utilsImports.push('StrapiMedia');\n }\n if (attributesStr.includes('\"type\":\"blocks\"')) {\n utilsImports.push('BlocksContent');\n }\n\n return `/**\n * ${collection.displayName}\n * ${collection.description || ''}\n * Generated by strapi2front\n */\n\nimport type { ${utilsImports.join(', ')} } from '../utils';\n${dependencyImports ? dependencyImports + '\\n' : ''}\nexport interface ${typeName} extends StrapiBaseEntity {\n${attributes}\n}\n\nexport interface ${typeName}Filters {\n id?: number | { $eq?: number; $ne?: number; $in?: number[]; $notIn?: number[] };\n documentId?: string | { $eq?: string; $ne?: string };\n createdAt?: string | { $eq?: string; $gt?: string; $gte?: string; $lt?: string; $lte?: string };\n updatedAt?: string | { $eq?: string; $gt?: string; $gte?: string; $lt?: string; $lte?: string };\n publishedAt?: string | null | { $eq?: string; $ne?: string; $null?: boolean };\n $and?: ${typeName}Filters[];\n $or?: ${typeName}Filters[];\n $not?: ${typeName}Filters;\n}\n\nexport interface ${typeName}Sort {\n field: keyof ${typeName};\n order: 'asc' | 'desc';\n}\n`;\n}\n\n/**\n * Generate type for a single type\n */\nfunction generateSingleType(single: SingleType, components: ComponentType[]): string {\n const typeName = toPascalCase(single.singularName);\n const attributes = generateAttributes(single.attributes, components);\n const { relations, components: componentDeps } = extractDependencies(single.attributes, typeName);\n const dependencyImports = generateDependencyImports(relations, componentDeps);\n\n // Build utils imports based on what's actually used\n const utilsImports: string[] = ['StrapiBaseEntity'];\n const attributesStr = JSON.stringify(single.attributes);\n if (attributesStr.includes('\"type\":\"media\"')) {\n utilsImports.push('StrapiMedia');\n }\n if (attributesStr.includes('\"type\":\"blocks\"')) {\n utilsImports.push('BlocksContent');\n }\n\n return `/**\n * ${single.displayName}\n * ${single.description || ''}\n * Generated by strapi2front\n */\n\nimport type { ${utilsImports.join(', ')} } from '../utils';\n${dependencyImports ? dependencyImports + '\\n' : ''}\nexport interface ${typeName} extends StrapiBaseEntity {\n${attributes}\n}\n`;\n}\n\n/**\n * Generate type for a component\n */\nfunction generateComponentType(component: ComponentType): string {\n const typeName = toPascalCase(component.name);\n const attributes = generateAttributes(component.attributes, []);\n const { relations, components: componentDeps } = extractDependencies(component.attributes, typeName);\n\n // For components, relations import from collections and other components import from same folder\n const imports: string[] = [];\n\n for (const relation of relations) {\n const relTypeName = toPascalCase(relation);\n const fileName = toKebabCase(relation);\n imports.push(`import type { ${relTypeName} } from '../collections/${fileName}';`);\n }\n\n for (const comp of componentDeps) {\n const compTypeName = toPascalCase(comp);\n const fileName = toKebabCase(comp);\n // Don't import self\n if (compTypeName !== typeName) {\n imports.push(`import type { ${compTypeName} } from './${fileName}';`);\n }\n }\n\n // Build utils imports based on what's actually used\n const utilsImports: string[] = [];\n const attributesStr = JSON.stringify(component.attributes);\n if (attributesStr.includes('\"type\":\"media\"')) {\n utilsImports.push('StrapiMedia');\n }\n if (attributesStr.includes('\"type\":\"blocks\"')) {\n utilsImports.push('BlocksContent');\n }\n\n const utilsImportLine = utilsImports.length > 0\n ? `import type { ${utilsImports.join(', ')} } from '../utils';\\n`\n : '';\n const dependencyImports = imports.length > 0 ? imports.join('\\n') + '\\n' : '';\n\n return `/**\n * ${component.displayName} component\n * Category: ${component.category}\n * ${component.description || ''}\n * Generated by strapi2front\n */\n\n${utilsImportLine}${dependencyImports}\nexport interface ${typeName} {\n id: number;\n${attributes}\n}\n`;\n}\n\n/**\n * Generate TypeScript properties from Strapi attributes\n */\nfunction generateAttributes(\n attributes: Record<string, Attribute>,\n components: ComponentType[]\n): string {\n const lines: string[] = [];\n\n for (const [name, attr] of Object.entries(attributes)) {\n const mappedType = mapAttributeToType(attr, components);\n const optional = attr.required ? '' : '?';\n const comment = getAttributeComment(attr);\n\n if (comment) {\n lines.push(` /** ${comment} */`);\n }\n lines.push(` ${name}${optional}: ${mappedType.type};`);\n }\n\n return lines.join('\\n');\n}\n","/**\n * JSDoc type generator\n * Generates .js files with JSDoc annotations for type safety without TypeScript\n */\n\nimport path from 'node:path';\nimport type { ParsedSchema, CollectionType, SingleType, ComponentType, Attribute } from '@strapi2front/core';\nimport type { StrapiVersion } from '../../shared/types.js';\nimport { writeFile, ensureDir } from '../../utils/file.js';\nimport { toPascalCase, toKebabCase } from '../../utils/naming.js';\nimport { mapAttributeToType, getAttributeComment, extractDependencies } from '../../shared/type-mapper.js';\n\nexport interface JSDocTypesOptions {\n outputDir: string;\n blocksRendererInstalled?: boolean;\n strapiVersion?: StrapiVersion;\n}\n\n/**\n * Generate JSDoc types from parsed schema\n */\nexport async function generateJSDocTypes(\n schema: ParsedSchema,\n options: JSDocTypesOptions\n): Promise<string[]> {\n const { outputDir } = options;\n const generatedFiles: string[] = [];\n\n // Ensure directories exist\n await ensureDir(path.join(outputDir, 'collections'));\n await ensureDir(path.join(outputDir, 'components'));\n\n // Generate utility types\n const utilsPath = path.join(outputDir, 'utils.js');\n const strapiVersion = options.strapiVersion ?? 'v5';\n await writeFile(utilsPath, generateUtilityTypes(strapiVersion));\n generatedFiles.push(utilsPath);\n\n // Generate collection types\n for (const collection of schema.collections) {\n const fileName = `${toKebabCase(collection.singularName)}.js`;\n const filePath = path.join(outputDir, 'collections', fileName);\n const content = generateCollectionType(collection, schema.components, strapiVersion);\n await writeFile(filePath, content);\n generatedFiles.push(filePath);\n }\n\n // Generate single types\n for (const single of schema.singles) {\n const fileName = `${toKebabCase(single.singularName)}.js`;\n const filePath = path.join(outputDir, 'collections', fileName);\n const content = generateSingleType(single, schema.components, strapiVersion);\n await writeFile(filePath, content);\n generatedFiles.push(filePath);\n }\n\n // Generate component types\n for (const component of schema.components) {\n const fileName = `${toKebabCase(component.name)}.js`;\n const filePath = path.join(outputDir, 'components', fileName);\n const content = generateComponentType(component, strapiVersion);\n await writeFile(filePath, content);\n generatedFiles.push(filePath);\n }\n\n return generatedFiles;\n}\n\n/**\n * Generate utility types with JSDoc\n */\nfunction generateUtilityTypes(strapiVersion: StrapiVersion): string {\n const isV4 = strapiVersion === \"v4\";\n\n const baseEntityFields = isV4\n ? ` * @property {number} id\n * @property {string} createdAt\n * @property {string} updatedAt\n * @property {string|null} publishedAt`\n : ` * @property {number} id\n * @property {string} documentId\n * @property {string} createdAt\n * @property {string} updatedAt\n * @property {string|null} publishedAt`;\n\n const mediaFields = isV4\n ? ` * @property {number} id`\n : ` * @property {number} id\n * @property {string} documentId`;\n\n return `/**\n * Strapi utility types (JSDoc)\n * Generated by strapi2front\n * Strapi version: ${strapiVersion}\n *\n * These types provide IntelliSense support in JavaScript projects.\n */\n\n/**\n * Strapi media format\n * @typedef {Object} StrapiMediaFormat\n * @property {string} name\n * @property {string} hash\n * @property {string} ext\n * @property {string} mime\n * @property {number} width\n * @property {number} height\n * @property {number} size\n * @property {string} url\n */\n\n/**\n * Strapi media object\n * @typedef {Object} StrapiMedia\n${mediaFields}\n * @property {string} name\n * @property {string|null} alternativeText\n * @property {string|null} caption\n * @property {number} width\n * @property {number} height\n * @property {{thumbnail?: StrapiMediaFormat, small?: StrapiMediaFormat, medium?: StrapiMediaFormat, large?: StrapiMediaFormat}|null} formats\n * @property {string} hash\n * @property {string} ext\n * @property {string} mime\n * @property {number} size\n * @property {string} url\n * @property {string|null} previewUrl\n * @property {string} provider\n * @property {string} createdAt\n * @property {string} updatedAt\n */\n\n/**\n * Strapi pagination\n * @typedef {Object} StrapiPagination\n * @property {number} page\n * @property {number} pageSize\n * @property {number} pageCount\n * @property {number} total\n */\n\n/**\n * Strapi response wrapper\n * @template T\n * @typedef {Object} StrapiResponse\n * @property {T} data\n * @property {{pagination?: StrapiPagination}} meta\n */\n\n/**\n * Strapi list response\n * @template T\n * @typedef {Object} StrapiListResponse\n * @property {T[]} data\n * @property {{pagination: StrapiPagination}} meta\n */\n\n/**\n * Base entity fields\n * @typedef {Object} StrapiBaseEntity\n${baseEntityFields}\n */\n\n/**\n * Blocks content type (rich text)\n * @typedef {unknown[]} BlocksContent\n */\n\n// Export empty object to make this a module\nexport {};\n`;\n}\n\n/**\n * Generate JSDoc type for a collection\n */\nfunction generateCollectionType(\n collection: CollectionType,\n components: ComponentType[],\n strapiVersion: StrapiVersion\n): string {\n const typeName = toPascalCase(collection.singularName);\n const isV4 = strapiVersion === \"v4\";\n const { relations, components: componentDeps } = extractDependencies(collection.attributes, typeName);\n\n // Generate imports\n const imports = generateJSDocImports(relations, componentDeps, 'collection');\n\n // Generate properties\n const properties = generateJSDocProperties(collection.attributes, components);\n\n // Base fields\n const baseFields = isV4\n ? ` * @property {number} id\n * @property {string} createdAt\n * @property {string} updatedAt\n * @property {string|null} publishedAt`\n : ` * @property {number} id\n * @property {string} documentId\n * @property {string} createdAt\n * @property {string} updatedAt\n * @property {string|null} publishedAt`;\n\n return `/**\n * ${collection.displayName}\n * ${collection.description || ''}\n * Generated by strapi2front\n * Strapi version: ${strapiVersion}\n */\n\n${imports}\n\n/**\n * ${collection.displayName}\n * @typedef {Object} ${typeName}\n${baseFields}\n${properties}\n */\n\n/**\n * ${typeName} filters for querying\n * @typedef {Object} ${typeName}Filters\n * @property {number|{$eq?: number, $ne?: number, $in?: number[], $notIn?: number[]}} [id]\n * @property {string|{$eq?: string, $ne?: string}} [documentId]\n * @property {string|{$eq?: string, $gt?: string, $gte?: string, $lt?: string, $lte?: string}} [createdAt]\n * @property {string|{$eq?: string, $gt?: string, $gte?: string, $lt?: string, $lte?: string}} [updatedAt]\n * @property {string|null|{$eq?: string, $ne?: string, $null?: boolean}} [publishedAt]\n * @property {${typeName}Filters[]} [$and]\n * @property {${typeName}Filters[]} [$or]\n * @property {${typeName}Filters} [$not]\n */\n\n// Export empty object to make this a module\nexport {};\n`;\n}\n\n/**\n * Generate JSDoc type for a single type\n */\nfunction generateSingleType(\n single: SingleType,\n components: ComponentType[],\n strapiVersion: StrapiVersion\n): string {\n const typeName = toPascalCase(single.singularName);\n const isV4 = strapiVersion === \"v4\";\n const { relations, components: componentDeps } = extractDependencies(single.attributes, typeName);\n\n // Generate imports\n const imports = generateJSDocImports(relations, componentDeps, 'collection');\n\n // Generate properties\n const properties = generateJSDocProperties(single.attributes, components);\n\n // Base fields\n const baseFields = isV4\n ? ` * @property {number} id\n * @property {string} createdAt\n * @property {string} updatedAt`\n : ` * @property {number} id\n * @property {string} documentId\n * @property {string} createdAt\n * @property {string} updatedAt`;\n\n return `/**\n * ${single.displayName}\n * ${single.description || ''}\n * Generated by strapi2front\n * Strapi version: ${strapiVersion}\n */\n\n${imports}\n\n/**\n * ${single.displayName}\n * @typedef {Object} ${typeName}\n${baseFields}\n${properties}\n */\n\n// Export empty object to make this a module\nexport {};\n`;\n}\n\n/**\n * Generate JSDoc type for a component\n */\nfunction generateComponentType(component: ComponentType, strapiVersion: StrapiVersion): string {\n const typeName = toPascalCase(component.name);\n const { relations, components: componentDeps } = extractDependencies(component.attributes, typeName);\n\n // Generate imports\n const imports = generateJSDocImports(relations, componentDeps, 'component');\n\n // Generate properties\n const properties = generateJSDocProperties(component.attributes, []);\n\n return `/**\n * ${component.displayName} component\n * Category: ${component.category}\n * ${component.description || ''}\n * Generated by strapi2front\n * Strapi version: ${strapiVersion}\n */\n\n${imports}\n\n/**\n * ${component.displayName}\n * @typedef {Object} ${typeName}\n * @property {number} id\n${properties}\n */\n\n// Export empty object to make this a module\nexport {};\n`;\n}\n\n/**\n * Generate JSDoc imports\n */\nfunction generateJSDocImports(\n relations: Set<string>,\n components: Set<string>,\n context: 'collection' | 'component'\n): string {\n const imports: string[] = [];\n\n // Import from utils\n imports.push(`/** @typedef {import('../utils').StrapiMedia} StrapiMedia */`);\n imports.push(`/** @typedef {import('../utils').BlocksContent} BlocksContent */`);\n\n // Import relations\n for (const relation of relations) {\n const typeName = toPascalCase(relation);\n const fileName = toKebabCase(relation);\n if (context === 'component') {\n imports.push(`/** @typedef {import('../collections/${fileName}').${typeName}} ${typeName} */`);\n } else {\n imports.push(`/** @typedef {import('./${fileName}').${typeName}} ${typeName} */`);\n }\n }\n\n // Import components\n for (const component of components) {\n const typeName = toPascalCase(component);\n const fileName = toKebabCase(component);\n if (context === 'component') {\n imports.push(`/** @typedef {import('./${fileName}').${typeName}} ${typeName} */`);\n } else {\n imports.push(`/** @typedef {import('../components/${fileName}').${typeName}} ${typeName} */`);\n }\n }\n\n return imports.join('\\n');\n}\n\n/**\n * Generate JSDoc properties from Strapi attributes\n */\nfunction generateJSDocProperties(\n attributes: Record<string, Attribute>,\n components: ComponentType[]\n): string {\n const lines: string[] = [];\n\n for (const [name, attr] of Object.entries(attributes)) {\n const mappedType = mapAttributeToType(attr, components);\n const jsDocType = convertToJSDocType(mappedType.type);\n const comment = getAttributeComment(attr);\n const commentPart = comment ? ` - ${comment}` : '';\n\n // In JSDoc, [name] indicates optional. Required fields don't use brackets.\n if (attr.required) {\n lines.push(` * @property {${jsDocType}} ${name}${commentPart}`);\n } else {\n lines.push(` * @property {${jsDocType}} [${name}]${commentPart}`);\n }\n }\n\n return lines.join('\\n');\n}\n\n/**\n * Convert TypeScript type to JSDoc type\n */\nfunction convertToJSDocType(tsType: string): string {\n // Handle union types with null\n if (tsType.includes(' | null')) {\n const baseType = tsType.replace(' | null', '');\n return `${baseType}|null`;\n }\n\n // Handle arrays\n if (tsType.endsWith('[]')) {\n const baseType = tsType.slice(0, -2);\n // Handle union arrays like (A | B)[]\n if (baseType.startsWith('(') && baseType.endsWith(')')) {\n return `Array<${baseType.slice(1, -1).replace(/ \\| /g, '|')}>`;\n }\n return `${baseType}[]`;\n }\n\n // Handle string literal unions (enums)\n if (tsType.includes(\"'\") && tsType.includes(' | ')) {\n return 'string';\n }\n\n return tsType;\n}\n","/**\n * Type generator\n * Supports TypeScript (.ts) and JSDoc (.js) output formats\n */\n\nimport type { ParsedSchema } from '@strapi2front/core';\nimport type { OutputFormat, StrapiVersion } from '../shared/types.js';\nimport { generateTypeScriptTypes } from '../output/typescript/types.js';\nimport { generateJSDocTypes } from '../output/jsdoc/types.js';\n\nexport interface TypeGeneratorOptions {\n outputDir: string;\n blocksRendererInstalled?: boolean;\n strapiVersion?: StrapiVersion;\n /**\n * Output format: 'typescript' for .ts files, 'jsdoc' for .js with JSDoc annotations\n * @default 'typescript'\n */\n outputFormat?: OutputFormat;\n}\n\n/**\n * Generate types from parsed schema\n * Supports both TypeScript and JSDoc output formats\n */\nexport async function generateTypes(\n schema: ParsedSchema,\n options: TypeGeneratorOptions\n): Promise<string[]> {\n const outputFormat = options.outputFormat ?? 'typescript';\n\n if (outputFormat === 'jsdoc') {\n return generateJSDocTypes(schema, {\n outputDir: options.outputDir,\n blocksRendererInstalled: options.blocksRendererInstalled,\n strapiVersion: options.strapiVersion,\n });\n }\n\n // Default: TypeScript\n return generateTypeScriptTypes(schema, {\n outputDir: options.outputDir,\n blocksRendererInstalled: options.blocksRendererInstalled,\n strapiVersion: options.strapiVersion,\n });\n}\n","/**\n * JSDoc service generator\n * Generates .js files with JSDoc annotations for services\n */\n\nimport path from 'node:path';\nimport type { ParsedSchema, CollectionType, SingleType } from '@strapi2front/core';\nimport type { StrapiVersion } from '../../shared/types.js';\nimport { writeFile, ensureDir } from '../../utils/file.js';\nimport { toPascalCase, toCamelCase, toKebabCase } from '../../utils/naming.js';\n\nexport interface JSDocServicesOptions {\n outputDir: string;\n typesImportPath: string;\n strapiVersion?: StrapiVersion;\n}\n\n/**\n * Generate JSDoc service files from parsed schema\n */\nexport async function generateJSDocServices(\n schema: ParsedSchema,\n options: JSDocServicesOptions\n): Promise<string[]> {\n const { outputDir, typesImportPath, strapiVersion = \"v5\" } = options;\n const generatedFiles: string[] = [];\n\n await ensureDir(outputDir);\n\n // Generate services for collections\n for (const collection of schema.collections) {\n const fileName = `${toKebabCase(collection.singularName)}.service.js`;\n const filePath = path.join(outputDir, fileName);\n const content = generateCollectionService(collection, typesImportPath, strapiVersion);\n await writeFile(filePath, content);\n generatedFiles.push(filePath);\n }\n\n // Generate services for single types\n for (const single of schema.singles) {\n const fileName = `${toKebabCase(single.singularName)}.service.js`;\n const filePath = path.join(outputDir, fileName);\n const content = generateSingleService(single, typesImportPath, strapiVersion);\n await writeFile(filePath, content);\n generatedFiles.push(filePath);\n }\n\n return generatedFiles;\n}\n\n/**\n * Generate service for a collection type\n */\nfunction generateCollectionService(\n collection: CollectionType,\n typesImportPath: string,\n strapiVersion: StrapiVersion\n): string {\n const typeName = toPascalCase(collection.singularName);\n const serviceName = toCamelCase(collection.singularName) + 'Service';\n const fileName = toKebabCase(collection.singularName);\n const endpoint = collection.pluralName;\n const isV4 = strapiVersion === \"v4\";\n\n const idParam = isV4 ? 'id' : 'documentId';\n const idType = isV4 ? 'number' : 'string';\n\n // Feature flags\n const hasSlug = 'slug' in collection.attributes;\n const { localized, draftAndPublish } = collection;\n\n // Build locale and status options\n const localeOption = localized ? '\\n * @property {string} [locale] - Locale code' : '';\n const statusOption = draftAndPublish ? \"\\n * @property {'draft'|'published'} [status] - Publication status\" : '';\n\n const findBySlugMethod = hasSlug ? `\n/**\n * Find one ${collection.singularName} by slug\n * @param {string} slug - The slug to search for\n * @param {FindOneOptions} [options={}] - Query options\n * @returns {Promise<${typeName}|null>}\n */\nasync findBySlug(slug, options = {}) {\n const { data } = await this.findMany({\n filters: { slug: { $eq: slug } },\n pagination: { pageSize: 1 },\n populate: options.populate,${localized ? '\\n locale: options.locale,' : ''}${draftAndPublish ? '\\n status: options.status,' : ''}\n });\n\n return data[0] || null;\n},\n` : '';\n\n return `/**\n * ${collection.displayName} Service\n * ${collection.description || ''}\n * Generated by strapi2front\n * Strapi version: ${strapiVersion}\n */\n\nimport { collection } from '../client.js';\n\n/** @typedef {import('${typesImportPath}/collections/${fileName}').${typeName}} ${typeName} */\n/** @typedef {import('${typesImportPath}/collections/${fileName}').${typeName}Filters} ${typeName}Filters */\n/** @typedef {import('${typesImportPath}/utils').StrapiPagination} StrapiPagination */\n${localized ? `/** @typedef {import('../locales').Locale} Locale */` : ''}\n\n/**\n * @typedef {Object} FindManyOptions\n * @property {${typeName}Filters} [filters] - Filter conditions\n * @property {{page?: number, pageSize?: number, start?: number, limit?: number}} [pagination] - Pagination options\n * @property {string|string[]} [sort] - Sort order\n * @property {string|string[]|Object} [populate] - Relations to populate${localeOption}${statusOption}\n */\n\n/**\n * @typedef {Object} FindOneOptions\n * @property {string|string[]|Object} [populate] - Relations to populate${localeOption}${statusOption}\n */\n\n/** @type {ReturnType<typeof collection<${typeName}>>} */\nconst ${toCamelCase(collection.singularName)}Collection = collection('${endpoint}');\n\nexport const ${serviceName} = {\n /**\n * Find multiple ${collection.pluralName}\n * @param {FindManyOptions} [options={}] - Query options\n * @returns {Promise<{data: ${typeName}[], pagination: StrapiPagination}>}\n */\n async findMany(options = {}) {\n const response = await ${toCamelCase(collection.singularName)}Collection.find({\n filters: options.filters,\n pagination: options.pagination,\n sort: options.sort,\n populate: options.populate,${localized ? '\\n locale: options.locale,' : ''}${draftAndPublish ? '\\n status: options.status,' : ''}\n });\n\n return {\n data: response.data,\n pagination: response.meta.pagination,\n };\n },\n\n /**\n * Find all ${collection.pluralName} (handles pagination automatically)\n * @param {Omit<FindManyOptions, 'pagination'>} [options={}] - Query options\n * @returns {Promise<${typeName}[]>}\n */\n async findAll(options = {}) {\n /** @type {${typeName}[]} */\n const allItems = [];\n let page = 1;\n let hasMore = true;\n\n while (hasMore) {\n const { data, pagination } = await this.findMany({\n ...options,\n pagination: { page, pageSize: 100 },\n });\n\n allItems.push(...data);\n hasMore = page < pagination.pageCount;\n page++;\n }\n\n return allItems;\n },\n\n /**\n * Find one ${collection.singularName} by ${idParam}\n * @param {${idType}} ${idParam} - The ${idParam} to find\n * @param {FindOneOptions} [options={}] - Query options\n * @returns {Promise<${typeName}|null>}\n */\n async findOne(${idParam}, options = {}) {\n try {\n const response = await ${toCamelCase(collection.singularName)}Collection.findOne(${idParam}, {\n populate: options.populate,${localized ? '\\n locale: options.locale,' : ''}${draftAndPublish ? '\\n status: options.status,' : ''}\n });\n\n return response.data;\n } catch (error) {\n if (error instanceof Error && error.message.includes('404')) {\n return null;\n }\n throw error;\n }\n },\n${findBySlugMethod}\n /**\n * Create a new ${collection.singularName}\n * @param {Partial<${typeName}>} data - The data to create\n * @returns {Promise<${typeName}>}\n */\n async create(data) {\n const response = await ${toCamelCase(collection.singularName)}Collection.create({ data });\n return response.data;\n },\n\n /**\n * Update a ${collection.singularName}\n * @param {${idType}} ${idParam} - The ${idParam} to update\n * @param {Partial<${typeName}>} data - The data to update\n * @returns {Promise<${typeName}>}\n */\n async update(${idParam}, data) {\n const response = await ${toCamelCase(collection.singularName)}Collection.update(${idParam}, { data });\n return response.data;\n },\n\n /**\n * Delete a ${collection.singularName}\n * @param {${idType}} ${idParam} - The ${idParam} to delete\n * @returns {Promise<void>}\n */\n async delete(${idParam}) {\n await ${toCamelCase(collection.singularName)}Collection.delete(${idParam});\n },\n\n /**\n * Count ${collection.pluralName}\n * @param {${typeName}Filters} [filters] - Filter conditions\n * @returns {Promise<number>}\n */\n async count(filters) {\n const { pagination } = await this.findMany({\n filters,\n pagination: { pageSize: 1 },\n });\n\n return pagination.total;\n },\n};\n`;\n}\n\n/**\n * Generate service for a single type\n */\nfunction generateSingleService(\n single: SingleType,\n typesImportPath: string,\n strapiVersion: StrapiVersion\n): string {\n const typeName = toPascalCase(single.singularName);\n const serviceName = toCamelCase(single.singularName) + 'Service';\n const fileName = toKebabCase(single.singularName);\n const endpoint = single.singularName;\n\n // Feature flags\n const { localized, draftAndPublish } = single;\n\n // Build locale and status options\n const localeOption = localized ? '\\n * @property {string} [locale] - Locale code' : '';\n const statusOption = draftAndPublish ? \"\\n * @property {'draft'|'published'} [status] - Publication status\" : '';\n\n return `/**\n * ${single.displayName} Service (Single Type)\n * ${single.description || ''}\n * Generated by strapi2front\n * Strapi version: ${strapiVersion}\n */\n\nimport { single } from '../client.js';\n\n/** @typedef {import('${typesImportPath}/collections/${fileName}').${typeName}} ${typeName} */\n${localized ? `/** @typedef {import('../locales').Locale} Locale */` : ''}\n\n/**\n * @typedef {Object} FindOptions\n * @property {string|string[]|Object} [populate] - Relations to populate${localeOption}${statusOption}\n */\n\n/** @type {ReturnType<typeof single<${typeName}>>} */\nconst ${toCamelCase(single.singularName)}Single = single('${endpoint}');\n\nexport const ${serviceName} = {\n /**\n * Get ${single.displayName}\n * @param {FindOptions} [options={}] - Query options\n * @returns {Promise<${typeName}|null>}\n */\n async find(options = {}) {\n try {\n const response = await ${toCamelCase(single.singularName)}Single.find({\n populate: options.populate,${localized ? '\\n locale: options.locale,' : ''}${draftAndPublish ? '\\n status: options.status,' : ''}\n });\n\n return response.data;\n } catch (error) {\n if (error instanceof Error && error.message.includes('404')) {\n return null;\n }\n throw error;\n }\n },\n\n /**\n * Update ${single.displayName}\n * @param {Partial<${typeName}>} data - The data to update\n * @returns {Promise<${typeName}>}\n */\n async update(data) {\n const response = await ${toCamelCase(single.singularName)}Single.update({ data });\n return response.data;\n },\n\n /**\n * Delete ${single.displayName}\n * @returns {Promise<void>}\n */\n async delete() {\n await ${toCamelCase(single.singularName)}Single.delete();\n },\n};\n`;\n}\n","/**\n * Service generator\n * Supports TypeScript (.ts) and JSDoc (.js) output formats\n */\n\nimport path from 'node:path';\nimport type { ParsedSchema, CollectionType, SingleType } from '@strapi2front/core';\nimport type { OutputFormat, StrapiVersion } from '../shared/types.js';\nimport { formatCode } from '../utils/formatter.js';\nimport { writeFile, ensureDir } from '../utils/file.js';\nimport { toPascalCase, toCamelCase, toKebabCase } from '../utils/naming.js';\nimport { generateJSDocServices } from '../output/jsdoc/services.js';\n\nexport interface ServiceGeneratorOptions {\n outputDir: string;\n typesImportPath: string;\n strapiVersion?: StrapiVersion;\n /**\n * Output format: 'typescript' for .ts files, 'jsdoc' for .js with JSDoc annotations\n * @default 'typescript'\n */\n outputFormat?: OutputFormat;\n}\n\n/**\n * Generate service files from parsed schema\n */\nexport async function generateServices(\n schema: ParsedSchema,\n options: ServiceGeneratorOptions\n): Promise<string[]> {\n const outputFormat = options.outputFormat ?? 'typescript';\n\n if (outputFormat === 'jsdoc') {\n return generateJSDocServices(schema, {\n outputDir: options.outputDir,\n typesImportPath: options.typesImportPath,\n strapiVersion: options.strapiVersion,\n });\n }\n\n // Default: TypeScript\n return generateTypeScriptServices(schema, options);\n}\n\n/**\n * Generate TypeScript service files\n */\nasync function generateTypeScriptServices(\n schema: ParsedSchema,\n options: ServiceGeneratorOptions\n): Promise<string[]> {\n const { outputDir, typesImportPath, strapiVersion = \"v5\" } = options;\n const generatedFiles: string[] = [];\n\n await ensureDir(outputDir);\n\n // Generate services for collections\n for (const collection of schema.collections) {\n const fileName = `${toKebabCase(collection.singularName)}.service.ts`;\n const filePath = path.join(outputDir, fileName);\n const content = generateCollectionService(collection, typesImportPath, strapiVersion);\n await writeFile(filePath, await formatCode(content));\n generatedFiles.push(filePath);\n }\n\n // Generate services for single types\n for (const single of schema.singles) {\n const fileName = `${toKebabCase(single.singularName)}.service.ts`;\n const filePath = path.join(outputDir, fileName);\n const content = generateSingleService(single, typesImportPath, strapiVersion);\n await writeFile(filePath, await formatCode(content));\n generatedFiles.push(filePath);\n }\n\n return generatedFiles;\n}\n\n/**\n * Generate service for a collection type\n */\nfunction generateCollectionService(collection: CollectionType, typesImportPath: string, strapiVersion: StrapiVersion): string {\n const typeName = toPascalCase(collection.singularName);\n const serviceName = toCamelCase(collection.singularName) + 'Service';\n const fileName = toKebabCase(collection.singularName);\n const endpoint = collection.pluralName;\n const isV4 = strapiVersion === \"v4\";\n\n // V4 uses `id: number`, V5 uses `documentId: string`\n const idParam = isV4 ? 'id: number' : 'documentId: string';\n const idName = isV4 ? 'id' : 'documentId';\n const omitFields = isV4\n ? \"'id' | 'createdAt' | 'updatedAt' | 'publishedAt'\"\n : \"'id' | 'documentId' | 'createdAt' | 'updatedAt' | 'publishedAt'\";\n\n // Feature flags\n const hasSlug = 'slug' in collection.attributes;\n const { localized, draftAndPublish } = collection;\n\n // Build imports\n const imports: string[] = [\n `import { collection } from '../client';`,\n `import type { ${typeName}, ${typeName}Filters } from '${typesImportPath}/collections/${fileName}';`,\n `import type { StrapiPagination } from '${typesImportPath}/utils';`,\n ];\n if (localized) {\n imports.push(`import type { Locale } from '../locales';`);\n }\n\n // Build FindManyOptions interface\n const findManyOptionsFields: string[] = [\n ` filters?: ${typeName}Filters;`,\n ` pagination?: {`,\n ` /** Page number (1-indexed) - use with pageSize */`,\n ` page?: number;`,\n ` /** Number of items per page (default: 25) - use with page */`,\n ` pageSize?: number;`,\n ` /** Offset to start from (0-indexed) - use with limit */`,\n ` start?: number;`,\n ` /** Maximum number of items to return - use with start */`,\n ` limit?: number;`,\n ` };`,\n ` sort?: string | string[];`,\n ` populate?: string | string[] | Record<string, unknown>;`,\n ];\n if (localized) {\n findManyOptionsFields.push(` locale?: Locale;`);\n }\n if (draftAndPublish) {\n findManyOptionsFields.push(` status?: 'draft' | 'published';`);\n }\n\n // Build FindOneOptions interface\n const findOneOptionsFields: string[] = [\n ` populate?: string | string[] | Record<string, unknown>;`,\n ];\n if (localized) {\n findOneOptionsFields.push(` locale?: Locale;`);\n }\n if (draftAndPublish) {\n findOneOptionsFields.push(` status?: 'draft' | 'published';`);\n }\n\n // Build find params\n const findParams: string[] = [\n ` filters: options.filters,`,\n ` pagination: options.pagination,`,\n ` sort: options.sort,`,\n ` populate: options.populate,`,\n ];\n if (localized) {\n findParams.push(` locale: options.locale,`);\n }\n if (draftAndPublish) {\n findParams.push(` status: options.status,`);\n }\n\n // Build findOne params\n const findOneParams: string[] = [\n ` populate: options.populate,`,\n ];\n if (localized) {\n findOneParams.push(` locale: options.locale,`);\n }\n if (draftAndPublish) {\n findOneParams.push(` status: options.status,`);\n }\n\n // Build findBySlug params\n const findBySlugParams: string[] = [\n ` populate: options.populate,`,\n ];\n if (localized) {\n findBySlugParams.push(` locale: options.locale,`);\n }\n if (draftAndPublish) {\n findBySlugParams.push(` status: options.status,`);\n }\n\n return `/**\n * ${collection.displayName} Service\n * ${collection.description || ''}\n * Generated by strapi2front\n * Strapi version: ${strapiVersion}\n */\n\n${imports.join('\\n')}\n\nexport interface FindManyOptions {\n${findManyOptionsFields.join('\\n')}\n}\n\nexport interface FindOneOptions {\n${findOneOptionsFields.join('\\n')}\n}\n\n// Create typed collection helper\nconst ${toCamelCase(collection.singularName)}Collection = collection<${typeName}>('${endpoint}');\n\nexport const ${serviceName} = {\n /**\n * Find multiple ${collection.pluralName}\n */\n async findMany(options: FindManyOptions = {}): Promise<{ data: ${typeName}[]; pagination: StrapiPagination }> {\n const response = await ${toCamelCase(collection.singularName)}Collection.find({\n${findParams.join('\\n')}\n });\n\n return {\n data: response.data,\n pagination: response.meta.pagination,\n };\n },\n\n /**\n * Find all ${collection.pluralName} (handles pagination automatically)\n */\n async findAll(options: Omit<FindManyOptions, 'pagination'> = {}): Promise<${typeName}[]> {\n const allItems: ${typeName}[] = [];\n let page = 1;\n let hasMore = true;\n\n while (hasMore) {\n const { data, pagination } = await this.findMany({\n ...options,\n pagination: { page, pageSize: 100 },\n });\n\n allItems.push(...data);\n hasMore = page < pagination.pageCount;\n page++;\n }\n\n return allItems;\n },\n\n /**\n * Find one ${collection.singularName} by ${idName}\n */\n async findOne(${idParam}, options: FindOneOptions = {}): Promise<${typeName} | null> {\n try {\n const response = await ${toCamelCase(collection.singularName)}Collection.findOne(${idName}, {\n${findOneParams.join('\\n')}\n });\n\n return response.data;\n } catch (error) {\n // Return null if not found\n if (error instanceof Error && error.message.includes('404')) {\n return null;\n }\n throw error;\n }\n },\n${hasSlug ? `\n /**\n * Find one ${collection.singularName} by slug\n */\n async findBySlug(slug: string, options: FindOneOptions = {}): Promise<${typeName} | null> {\n const { data } = await this.findMany({\n filters: { slug: { $eq: slug } } as ${typeName}Filters,\n pagination: { pageSize: 1 },\n${findBySlugParams.join('\\n')}\n });\n\n return data[0] || null;\n },\n` : ''}\n /**\n * Create a new ${collection.singularName}\n */\n async create(data: Partial<Omit<${typeName}, ${omitFields}>>): Promise<${typeName}> {\n const response = await ${toCamelCase(collection.singularName)}Collection.create({ data });\n return response.data;\n },\n\n /**\n * Update a ${collection.singularName}\n */\n async update(${idParam}, data: Partial<Omit<${typeName}, ${omitFields}>>): Promise<${typeName}> {\n const response = await ${toCamelCase(collection.singularName)}Collection.update(${idName}, { data });\n return response.data;\n },\n\n /**\n * Delete a ${collection.singularName}\n */\n async delete(${idParam}): Promise<void> {\n await ${toCamelCase(collection.singularName)}Collection.delete(${idName});\n },\n\n /**\n * Count ${collection.pluralName}\n */\n async count(filters?: ${typeName}Filters): Promise<number> {\n const { pagination } = await this.findMany({\n filters,\n pagination: { pageSize: 1 },\n });\n\n return pagination.total;\n },\n};\n`;\n}\n\n/**\n * Generate service for a single type\n */\nfunction generateSingleService(single: SingleType, typesImportPath: string, strapiVersion: StrapiVersion): string {\n const typeName = toPascalCase(single.singularName);\n const serviceName = toCamelCase(single.singularName) + 'Service';\n const fileName = toKebabCase(single.singularName);\n const endpoint = single.singularName;\n const isV4 = strapiVersion === \"v4\";\n\n // V4 doesn't have documentId\n const omitFields = isV4\n ? \"'id' | 'createdAt' | 'updatedAt'\"\n : \"'id' | 'documentId' | 'createdAt' | 'updatedAt'\";\n\n // Feature flags\n const { localized, draftAndPublish } = single;\n\n // Build imports\n const imports: string[] = [\n `import { single } from '../client';`,\n `import type { ${typeName} } from '${typesImportPath}/collections/${fileName}';`,\n ];\n if (localized) {\n imports.push(`import type { Locale } from '../locales';`);\n }\n\n // Build FindOptions interface\n const findOptionsFields: string[] = [\n ` populate?: string | string[] | Record<string, unknown>;`,\n ];\n if (localized) {\n findOptionsFields.push(` locale?: Locale;`);\n }\n if (draftAndPublish) {\n findOptionsFields.push(` status?: 'draft' | 'published';`);\n }\n\n // Build find params\n const findParams: string[] = [\n ` populate: options.populate,`,\n ];\n if (localized) {\n findParams.push(` locale: options.locale,`);\n }\n if (draftAndPublish) {\n findParams.push(` status: options.status,`);\n }\n\n return `/**\n * ${single.displayName} Service (Single Type)\n * ${single.description || ''}\n * Generated by strapi2front\n * Strapi version: ${strapiVersion}\n */\n\n${imports.join('\\n')}\n\nexport interface FindOptions {\n${findOptionsFields.join('\\n')}\n}\n\n// Create typed single helper\nconst ${toCamelCase(single.singularName)}Single = single<${typeName}>('${endpoint}');\n\nexport const ${serviceName} = {\n /**\n * Get ${single.displayName}\n */\n async find(options: FindOptions = {}): Promise<${typeName} | null> {\n try {\n const response = await ${toCamelCase(single.singularName)}Single.find({\n${findParams.join('\\n')}\n });\n\n return response.data;\n } catch (error) {\n if (error instanceof Error && error.message.includes('404')) {\n return null;\n }\n throw error;\n }\n },\n\n /**\n * Update ${single.displayName}\n */\n async update(data: Partial<Omit<${typeName}, ${omitFields}>>): Promise<${typeName}> {\n const response = await ${toCamelCase(single.singularName)}Single.update({ data });\n return response.data;\n },\n\n /**\n * Delete ${single.displayName}\n */\n async delete(): Promise<void> {\n await ${toCamelCase(single.singularName)}Single.delete();\n },\n};\n`;\n}\n","/**\n * Astro Actions generator\n * Generates type-safe Astro Actions for Strapi content types\n *\n * Requirements:\n * - Astro v4.0+ (Actions are only available in v4+)\n * - TypeScript enabled\n */\n\nimport path from 'node:path';\nimport type { ParsedSchema, CollectionType, SingleType } from '@strapi2front/core';\nimport type { StrapiVersion } from '../../shared/types.js';\nimport { formatCode } from '../../utils/formatter.js';\nimport { writeFile, ensureDir } from '../../utils/file.js';\nimport { toCamelCase, toKebabCase } from '../../utils/naming.js';\n\nexport interface AstroActionsOptions {\n outputDir: string;\n servicesImportPath: string;\n strapiVersion?: StrapiVersion;\n}\n\n/**\n * Check if Astro Actions are supported\n * Requires Astro v4.0 or higher\n */\nexport function isAstroActionsSupported(astroVersion: string | null): boolean {\n if (!astroVersion) return false;\n\n // Remove ^ or ~ prefix and get major version\n const match = astroVersion.replace(/^[\\^~]/, \"\").match(/^(\\d+)/);\n const majorVersion = match ? parseInt(match[1], 10) : null;\n\n return majorVersion !== null && majorVersion >= 4;\n}\n\n/**\n * Generate Astro Actions from parsed schema\n */\nexport async function generateAstroActions(\n schema: ParsedSchema,\n options: AstroActionsOptions\n): Promise<string[]> {\n const { outputDir, servicesImportPath, strapiVersion = \"v5\" } = options;\n const generatedFiles: string[] = [];\n\n await ensureDir(outputDir);\n\n // Generate actions for collections\n for (const collection of schema.collections) {\n const fileName = `${toKebabCase(collection.singularName)}.ts`;\n const filePath = path.join(outputDir, fileName);\n const content = generateCollectionActions(collection, servicesImportPath, strapiVersion);\n await writeFile(filePath, await formatCode(content));\n generatedFiles.push(filePath);\n }\n\n // Generate actions for single types\n for (const single of schema.singles) {\n const fileName = `${toKebabCase(single.singularName)}.ts`;\n const filePath = path.join(outputDir, fileName);\n const content = generateSingleActions(single, servicesImportPath);\n await writeFile(filePath, await formatCode(content));\n generatedFiles.push(filePath);\n }\n\n return generatedFiles;\n}\n\n/**\n * Generate actions for a collection type\n */\nfunction generateCollectionActions(\n collection: CollectionType,\n servicesImportPath: string,\n strapiVersion: StrapiVersion\n): string {\n const serviceName = toCamelCase(collection.singularName) + 'Service';\n const actionsName = toCamelCase(collection.singularName);\n const fileName = toKebabCase(collection.singularName);\n const isV4 = strapiVersion === \"v4\";\n\n // V4 uses `id: number`, V5 uses `documentId: string`\n const idInputSchema = isV4 ? 'z.number().int().positive()' : 'z.string().min(1)';\n const idParamName = isV4 ? 'id' : 'documentId';\n const idComment = isV4 ? 'id' : 'documentId';\n\n // Detect if collection has a slug field\n const hasSlug = 'slug' in collection.attributes;\n\n return `/**\n * ${collection.displayName} Actions\n * ${collection.description || ''}\n * Generated by strapi2front\n * Framework: Astro\n * Strapi version: ${strapiVersion}\n */\n\nimport { defineAction, ActionError } from 'astro:actions';\nimport { z } from 'astro:schema';\nimport { ${serviceName} } from '${servicesImportPath}/${fileName}.service';\n\n/**\n * Pagination input schema\n */\nconst paginationSchema = z.object({\n page: z.number().int().positive().optional().default(1),\n pageSize: z.number().int().positive().max(100).optional().default(25),\n}).optional();\n\n/**\n * ${collection.displayName} actions\n */\nexport const ${actionsName} = {\n /**\n * Get all ${collection.pluralName} with pagination\n */\n getAll: defineAction({\n input: z.object({\n pagination: paginationSchema,\n sort: z.union([z.string(), z.array(z.string())]).optional(),\n }).optional(),\n handler: async (input) => {\n try {\n const result = await ${serviceName}.findMany({\n pagination: input?.pagination,\n sort: input?.sort,\n });\n\n return result;\n } catch (error) {\n throw new ActionError({\n code: 'INTERNAL_SERVER_ERROR',\n message: error instanceof Error ? error.message : 'Failed to fetch ${collection.pluralName}',\n });\n }\n },\n }),\n\n /**\n * Get a single ${collection.singularName} by ${idComment}\n */\n getOne: defineAction({\n input: z.object({\n ${idParamName}: ${idInputSchema},\n populate: z.union([z.string(), z.array(z.string())]).optional(),\n }),\n handler: async ({ ${idParamName}, populate }) => {\n try {\n const result = await ${serviceName}.findOne(${idParamName}, { populate });\n\n if (!result) {\n throw new ActionError({\n code: 'NOT_FOUND',\n message: '${collection.displayName} not found',\n });\n }\n\n return result;\n } catch (error) {\n if (error instanceof ActionError) throw error;\n throw new ActionError({\n code: 'INTERNAL_SERVER_ERROR',\n message: error instanceof Error ? error.message : 'Failed to fetch ${collection.singularName}',\n });\n }\n },\n }),\n${hasSlug ? `\n /**\n * Get a single ${collection.singularName} by slug\n */\n getBySlug: defineAction({\n input: z.object({\n slug: z.string().min(1),\n populate: z.union([z.string(), z.array(z.string())]).optional(),\n }),\n handler: async ({ slug, populate }) => {\n try {\n const result = await ${serviceName}.findBySlug(slug, { populate });\n\n if (!result) {\n throw new ActionError({\n code: 'NOT_FOUND',\n message: '${collection.displayName} not found',\n });\n }\n\n return result;\n } catch (error) {\n if (error instanceof ActionError) throw error;\n throw new ActionError({\n code: 'INTERNAL_SERVER_ERROR',\n message: error instanceof Error ? error.message : 'Failed to fetch ${collection.singularName}',\n });\n }\n },\n }),\n` : ''}\n /**\n * Create a new ${collection.singularName}\n */\n create: defineAction({\n input: z.object({\n data: z.record(z.unknown()),\n }),\n handler: async ({ data }) => {\n try {\n const result = await ${serviceName}.create(data);\n return result;\n } catch (error) {\n throw new ActionError({\n code: 'INTERNAL_SERVER_ERROR',\n message: error instanceof Error ? error.message : 'Failed to create ${collection.singularName}',\n });\n }\n },\n }),\n\n /**\n * Update a ${collection.singularName}\n */\n update: defineAction({\n input: z.object({\n ${idParamName}: ${idInputSchema},\n data: z.record(z.unknown()),\n }),\n handler: async ({ ${idParamName}, data }) => {\n try {\n const result = await ${serviceName}.update(${idParamName}, data);\n return result;\n } catch (error) {\n throw new ActionError({\n code: 'INTERNAL_SERVER_ERROR',\n message: error instanceof Error ? error.message : 'Failed to update ${collection.singularName}',\n });\n }\n },\n }),\n\n /**\n * Delete a ${collection.singularName}\n */\n delete: defineAction({\n input: z.object({\n ${idParamName}: ${idInputSchema},\n }),\n handler: async ({ ${idParamName} }) => {\n try {\n await ${serviceName}.delete(${idParamName});\n return { success: true };\n } catch (error) {\n throw new ActionError({\n code: 'INTERNAL_SERVER_ERROR',\n message: error instanceof Error ? error.message : 'Failed to delete ${collection.singularName}',\n });\n }\n },\n }),\n\n /**\n * Count ${collection.pluralName}\n */\n count: defineAction({\n input: z.object({\n filters: z.record(z.unknown()).optional(),\n }).optional(),\n handler: async (input) => {\n try {\n const count = await ${serviceName}.count(input?.filters as any);\n return { count };\n } catch (error) {\n throw new ActionError({\n code: 'INTERNAL_SERVER_ERROR',\n message: error instanceof Error ? error.message : 'Failed to count ${collection.pluralName}',\n });\n }\n },\n }),\n};\n`;\n}\n\n/**\n * Generate actions for a single type\n */\nfunction generateSingleActions(\n single: SingleType,\n servicesImportPath: string\n): string {\n const serviceName = toCamelCase(single.singularName) + 'Service';\n const actionsName = toCamelCase(single.singularName);\n const fileName = toKebabCase(single.singularName);\n\n return `/**\n * ${single.displayName} Actions (Single Type)\n * ${single.description || ''}\n * Generated by strapi2front\n * Framework: Astro\n */\n\nimport { defineAction, ActionError } from 'astro:actions';\nimport { z } from 'astro:schema';\nimport { ${serviceName} } from '${servicesImportPath}/${fileName}.service';\n\n/**\n * ${single.displayName} actions\n */\nexport const ${actionsName} = {\n /**\n * Get ${single.displayName}\n */\n get: defineAction({\n input: z.object({\n populate: z.union([z.string(), z.array(z.string())]).optional(),\n }).optional(),\n handler: async (input) => {\n try {\n const result = await ${serviceName}.find({\n populate: input?.populate,\n });\n\n if (!result) {\n throw new ActionError({\n code: 'NOT_FOUND',\n message: '${single.displayName} not found',\n });\n }\n\n return result;\n } catch (error) {\n if (error instanceof ActionError) throw error;\n throw new ActionError({\n code: 'INTERNAL_SERVER_ERROR',\n message: error instanceof Error ? error.message : 'Failed to fetch ${single.singularName}',\n });\n }\n },\n }),\n\n /**\n * Update ${single.displayName}\n */\n update: defineAction({\n input: z.object({\n data: z.record(z.unknown()),\n }),\n handler: async ({ data }) => {\n try {\n const result = await ${serviceName}.update(data);\n return result;\n } catch (error) {\n throw new ActionError({\n code: 'INTERNAL_SERVER_ERROR',\n message: error instanceof Error ? error.message : 'Failed to update ${single.singularName}',\n });\n }\n },\n }),\n};\n`;\n}\n","/**\n * Actions generator\n * Re-exports from frameworks/astro for backwards compatibility\n *\n * For framework-specific generators, import directly from:\n * - '@strapi2front/generators/frameworks/astro'\n * - '@strapi2front/generators/frameworks/nextjs' (coming soon)\n * - '@strapi2front/generators/frameworks/nuxt' (coming soon)\n */\n\nimport type { ParsedSchema } from '@strapi2front/core';\nimport type { StrapiVersion } from '../shared/types.js';\nimport { generateAstroActions } from '../frameworks/astro/actions.js';\n\nexport interface ActionsGeneratorOptions {\n outputDir: string;\n servicesImportPath: string;\n strapiVersion?: StrapiVersion;\n}\n\n/**\n * Generate Astro Actions from parsed schema\n * @deprecated Use generateAstroActions from '@strapi2front/generators/frameworks/astro' instead\n */\nexport async function generateActions(\n schema: ParsedSchema,\n options: ActionsGeneratorOptions\n): Promise<string[]> {\n return generateAstroActions(schema, {\n outputDir: options.outputDir,\n servicesImportPath: options.servicesImportPath,\n strapiVersion: options.strapiVersion,\n });\n}\n","import path from 'node:path';\nimport { formatCode } from '../utils/formatter.js';\nimport { writeFile, ensureDir } from '../utils/file.js';\n\nexport interface ClientGeneratorOptions {\n outputDir: string;\n strapiVersion?: \"v4\" | \"v5\";\n apiPrefix?: string;\n}\n\n/**\n * Generate the Strapi client file\n */\nexport async function generateClient(\n options: ClientGeneratorOptions\n): Promise<string[]> {\n const { outputDir, strapiVersion = \"v5\", apiPrefix = \"/api\" } = options;\n const generatedFiles: string[] = [];\n\n await ensureDir(outputDir);\n\n const filePath = path.join(outputDir, 'client.ts');\n const content = generateClientFile(strapiVersion, apiPrefix);\n await writeFile(filePath, await formatCode(content));\n generatedFiles.push(filePath);\n\n return generatedFiles;\n}\n\n/**\n * Generate the client file content\n */\nfunction generateClientFile(strapiVersion: \"v4\" | \"v5\", apiPrefix: string): string {\n const isV4 = strapiVersion === \"v4\";\n\n if (isV4) {\n return generateV4ClientFile(apiPrefix);\n }\n return generateV5ClientFile(apiPrefix);\n}\n\n/**\n * Generate client for Strapi v5 (flat response structure)\n */\nfunction generateV5ClientFile(apiPrefix: string): string {\n // Normalize prefix for the generated code\n const normalizedPrefix = apiPrefix.startsWith('/') ? apiPrefix : '/' + apiPrefix;\n\n return `/**\n * Strapi Client (v5)\n * Generated by strapi2front\n */\n\nimport Strapi from 'strapi-sdk-js';\n\n// Initialize the Strapi client\nconst strapiUrl = import.meta.env.STRAPI_URL || process.env.STRAPI_URL || 'http://localhost:1337';\nconst strapiToken = import.meta.env.STRAPI_TOKEN || process.env.STRAPI_TOKEN;\nconst strapiApiPrefix = import.meta.env.STRAPI_API_PREFIX || process.env.STRAPI_API_PREFIX || '${normalizedPrefix}';\n\nexport const strapi = new Strapi({\n url: strapiUrl,\n prefix: strapiApiPrefix,\n axiosOptions: {\n headers: strapiToken ? {\n Authorization: \\`Bearer \\${strapiToken}\\`,\n } : {},\n },\n});\n\n// Pagination type\nexport interface StrapiPagination {\n page: number;\n pageSize: number;\n pageCount: number;\n total: number;\n}\n\n// Default pagination for fallback\nconst defaultPagination: StrapiPagination = {\n page: 1,\n pageSize: 25,\n pageCount: 1,\n total: 0,\n};\n\n// Response types\ninterface StrapiListResponse<T> {\n data: T[];\n meta: {\n pagination?: StrapiPagination;\n };\n}\n\ninterface StrapiSingleResponse<T> {\n data: T;\n meta?: Record<string, unknown>;\n}\n\n// Helper to get typed collection\nexport function collection<T>(pluralName: string) {\n return {\n async find(params?: Record<string, unknown>): Promise<{ data: T[]; meta: { pagination: StrapiPagination } }> {\n const response = await strapi.find(pluralName, params) as unknown as StrapiListResponse<T>;\n return {\n data: Array.isArray(response.data) ? response.data : [],\n meta: {\n pagination: response.meta?.pagination || defaultPagination,\n },\n };\n },\n async findOne(documentId: string, params?: Record<string, unknown>): Promise<{ data: T }> {\n const response = await strapi.findOne(pluralName, documentId, params) as unknown as StrapiSingleResponse<T>;\n return { data: response.data };\n },\n async create(data: { data: Partial<T> }): Promise<{ data: T }> {\n const response = await strapi.create(pluralName, data.data as Record<string, unknown>) as unknown as StrapiSingleResponse<T>;\n return { data: response.data };\n },\n async update(documentId: string, data: { data: Partial<T> }): Promise<{ data: T }> {\n const response = await strapi.update(pluralName, documentId, data.data as Record<string, unknown>) as unknown as StrapiSingleResponse<T>;\n return { data: response.data };\n },\n async delete(documentId: string): Promise<void> {\n await strapi.delete(pluralName, documentId);\n },\n };\n}\n\n// Helper to get typed single type\nexport function single<T>(singularName: string) {\n return {\n async find(params?: Record<string, unknown>): Promise<{ data: T }> {\n const response = await strapi.find(singularName, params) as unknown as StrapiSingleResponse<T>;\n return { data: response.data };\n },\n async update(data: { data: Partial<T> }): Promise<{ data: T }> {\n const response = await strapi.update(singularName, 1 as unknown as string, data.data as Record<string, unknown>) as unknown as StrapiSingleResponse<T>;\n return { data: response.data };\n },\n async delete(): Promise<void> {\n await strapi.delete(singularName, 1 as unknown as string);\n },\n };\n}\n`;\n}\n\n/**\n * Generate client for Strapi v4 (nested attributes structure)\n */\nfunction generateV4ClientFile(apiPrefix: string): string {\n // Normalize prefix for the generated code\n const normalizedPrefix = apiPrefix.startsWith('/') ? apiPrefix : '/' + apiPrefix;\n\n return `/**\n * Strapi Client (v4)\n * Generated by strapi2front\n */\n\nimport Strapi from 'strapi-sdk-js';\n\n// Initialize the Strapi client\nconst strapiUrl = import.meta.env.STRAPI_URL || process.env.STRAPI_URL || 'http://localhost:1337';\nconst strapiToken = import.meta.env.STRAPI_TOKEN || process.env.STRAPI_TOKEN;\nconst strapiApiPrefix = import.meta.env.STRAPI_API_PREFIX || process.env.STRAPI_API_PREFIX || '${normalizedPrefix}';\n\nexport const strapi = new Strapi({\n url: strapiUrl,\n prefix: strapiApiPrefix,\n axiosOptions: {\n headers: strapiToken ? {\n Authorization: \\`Bearer \\${strapiToken}\\`,\n } : {},\n },\n});\n\n// Pagination type\nexport interface StrapiPagination {\n page: number;\n pageSize: number;\n pageCount: number;\n total: number;\n}\n\n// Default pagination for fallback\nconst defaultPagination: StrapiPagination = {\n page: 1,\n pageSize: 25,\n pageCount: 1,\n total: 0,\n};\n\n// Strapi v4 raw response types (with nested attributes)\ninterface StrapiV4RawItem<T> {\n id: number;\n attributes: Omit<T, 'id'>;\n}\n\ninterface StrapiV4RawListResponse<T> {\n data: StrapiV4RawItem<T>[];\n meta: {\n pagination?: StrapiPagination;\n };\n}\n\ninterface StrapiV4RawSingleResponse<T> {\n data: StrapiV4RawItem<T>;\n meta?: Record<string, unknown>;\n}\n\n/**\n * Flatten a Strapi v4 response item (merges id with attributes)\n */\nfunction flattenItem<T>(item: StrapiV4RawItem<T>): T {\n return { id: item.id, ...item.attributes } as T;\n}\n\n/**\n * Recursively flatten nested relations in Strapi v4 response\n */\nfunction flattenRelations<T>(data: T): T {\n if (data === null || data === undefined) return data;\n if (Array.isArray(data)) {\n return data.map(item => flattenRelations(item)) as unknown as T;\n }\n if (typeof data === 'object') {\n const result: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(data as Record<string, unknown>)) {\n // Check if this is a Strapi v4 relation response { data: { id, attributes } }\n if (value && typeof value === 'object' && 'data' in value) {\n const relationData = (value as { data: unknown }).data;\n if (relationData === null) {\n result[key] = null;\n } else if (Array.isArray(relationData)) {\n // To-many relation\n result[key] = relationData.map((item: StrapiV4RawItem<unknown>) =>\n flattenRelations(flattenItem(item))\n );\n } else if (typeof relationData === 'object' && 'id' in relationData && 'attributes' in relationData) {\n // To-one relation\n result[key] = flattenRelations(flattenItem(relationData as StrapiV4RawItem<unknown>));\n } else {\n result[key] = flattenRelations(value);\n }\n } else {\n result[key] = flattenRelations(value);\n }\n }\n return result as T;\n }\n return data;\n}\n\n// Helper to get typed collection\nexport function collection<T>(pluralName: string) {\n return {\n async find(params?: Record<string, unknown>): Promise<{ data: T[]; meta: { pagination: StrapiPagination } }> {\n const response = await strapi.find(pluralName, params) as unknown as StrapiV4RawListResponse<T>;\n const flattenedData = Array.isArray(response.data)\n ? response.data.map(item => flattenRelations(flattenItem<T>(item)))\n : [];\n return {\n data: flattenedData,\n meta: {\n pagination: response.meta?.pagination || defaultPagination,\n },\n };\n },\n async findOne(id: number | string, params?: Record<string, unknown>): Promise<{ data: T }> {\n const response = await strapi.findOne(pluralName, String(id), params) as unknown as StrapiV4RawSingleResponse<T>;\n return { data: flattenRelations(flattenItem<T>(response.data)) };\n },\n async create(data: { data: Partial<T> }): Promise<{ data: T }> {\n const response = await strapi.create(pluralName, data.data as Record<string, unknown>) as unknown as StrapiV4RawSingleResponse<T>;\n return { data: flattenRelations(flattenItem<T>(response.data)) };\n },\n async update(id: number | string, data: { data: Partial<T> }): Promise<{ data: T }> {\n const response = await strapi.update(pluralName, String(id), data.data as Record<string, unknown>) as unknown as StrapiV4RawSingleResponse<T>;\n return { data: flattenRelations(flattenItem<T>(response.data)) };\n },\n async delete(id: number | string): Promise<void> {\n await strapi.delete(pluralName, String(id));\n },\n };\n}\n\n// Helper to get typed single type\nexport function single<T>(singularName: string) {\n return {\n async find(params?: Record<string, unknown>): Promise<{ data: T }> {\n const response = await strapi.find(singularName, params) as unknown as StrapiV4RawSingleResponse<T>;\n return { data: flattenRelations(flattenItem<T>(response.data)) };\n },\n async update(data: { data: Partial<T> }): Promise<{ data: T }> {\n const response = await strapi.update(singularName, 1 as unknown as string, data.data as Record<string, unknown>) as unknown as StrapiV4RawSingleResponse<T>;\n return { data: flattenRelations(flattenItem<T>(response.data)) };\n },\n async delete(): Promise<void> {\n await strapi.delete(singularName, 1 as unknown as string);\n },\n };\n}\n`;\n}\n","import path from 'node:path';\nimport type { StrapiLocale } from '@strapi2front/core';\nimport { formatCode } from '../utils/formatter.js';\nimport { writeFile, ensureDir } from '../utils/file.js';\n\nexport interface LocalesGeneratorOptions {\n outputDir: string;\n}\n\n/**\n * Generate locales file from Strapi i18n configuration\n */\nexport async function generateLocales(\n locales: StrapiLocale[],\n options: LocalesGeneratorOptions\n): Promise<string[]> {\n const { outputDir } = options;\n const generatedFiles: string[] = [];\n\n await ensureDir(outputDir);\n\n const filePath = path.join(outputDir, 'locales.ts');\n const content = generateLocalesFile(locales);\n await writeFile(filePath, await formatCode(content));\n generatedFiles.push(filePath);\n\n return generatedFiles;\n}\n\n/**\n * Generate the locales file content\n */\nfunction generateLocalesFile(locales: StrapiLocale[]): string {\n if (locales.length === 0) {\n return `/**\n * Strapi Locales\n * Generated by strapi2front\n *\n * Note: No locales found. i18n might not be enabled in Strapi.\n */\n\nexport const locales = [] as const;\n\nexport type Locale = string;\n\nexport const defaultLocale: Locale = 'en';\n\nexport const localeNames: Record<string, string> = {};\n`;\n }\n\n const defaultLocale = locales.find(l => l.isDefault)?.code || locales[0]?.code || 'en';\n const localeCodes = locales.map(l => `'${l.code}'`).join(' | ');\n const localeArray = locales.map(l => `'${l.code}'`).join(', ');\n const localeNames = locales.map(l => ` '${l.code}': '${l.name}'`).join(',\\n');\n\n return `/**\n * Strapi Locales\n * Generated by strapi2front\n */\n\n/**\n * Available locale codes\n */\nexport const locales = [${localeArray}] as const;\n\n/**\n * Locale type - union of all available locales\n */\nexport type Locale = ${localeCodes};\n\n/**\n * Default locale\n */\nexport const defaultLocale: Locale = '${defaultLocale}';\n\n/**\n * Locale display names\n */\nexport const localeNames: Record<Locale, string> = {\n${localeNames}\n};\n\n/**\n * Check if a string is a valid locale\n */\nexport function isValidLocale(code: string): code is Locale {\n return locales.includes(code as Locale);\n}\n\n/**\n * Get locale name by code\n */\nexport function getLocaleName(code: Locale): string {\n return localeNames[code] || code;\n}\n`;\n}\n","import path from 'node:path';\nimport type {\n ParsedSchema,\n CollectionType,\n SingleType,\n ComponentType,\n Attribute,\n StrapiLocale,\n} from '@strapi2front/core';\nimport { formatCode } from '../utils/formatter.js';\nimport { writeFile, ensureDir } from '../utils/file.js';\nimport { toPascalCase, toCamelCase, toKebabCase } from '../utils/naming.js';\n\nexport interface ByFeatureGeneratorOptions {\n outputDir: string;\n features: {\n types: boolean;\n services: boolean;\n actions: boolean;\n };\n blocksRendererInstalled?: boolean;\n strapiVersion?: \"v4\" | \"v5\";\n apiPrefix?: string;\n /**\n * Output format: 'typescript' for .ts files, 'jsdoc' for .js with JSDoc annotations\n * @default 'typescript'\n */\n outputFormat?: \"typescript\" | \"jsdoc\";\n}\n\n/**\n * Generate all files using 'by-feature' structure\n *\n * Output structure:\n * strapi/\n * collections/\n * article/\n * types.ts\n * service.ts\n * actions.ts\n * singles/\n * homepage/\n * types.ts\n * service.ts\n * components/\n * seo.ts\n * shared/\n * utils.ts\n * client.ts\n * locales.ts\n */\nexport async function generateByFeature(\n schema: ParsedSchema,\n locales: StrapiLocale[],\n options: ByFeatureGeneratorOptions\n): Promise<string[]> {\n const {\n outputDir,\n features,\n blocksRendererInstalled = false,\n strapiVersion = \"v5\",\n apiPrefix = \"/api\",\n outputFormat = \"typescript\"\n } = options;\n const generatedFiles: string[] = [];\n\n // File extension based on output format\n const ext = outputFormat === \"jsdoc\" ? \"js\" : \"ts\";\n\n // Ensure directories exist\n await ensureDir(path.join(outputDir, 'collections'));\n await ensureDir(path.join(outputDir, 'singles'));\n await ensureDir(path.join(outputDir, 'components'));\n await ensureDir(path.join(outputDir, 'shared'));\n\n // Generate shared files\n const sharedDir = path.join(outputDir, 'shared');\n\n // Utils\n const utilsPath = path.join(sharedDir, `utils.${ext}`);\n const utilsContent = outputFormat === \"jsdoc\"\n ? generateUtilityTypesJSDoc(blocksRendererInstalled, strapiVersion)\n : generateUtilityTypes(blocksRendererInstalled, strapiVersion);\n await writeFile(utilsPath, await formatCode(utilsContent));\n generatedFiles.push(utilsPath);\n\n // Client\n const clientPath = path.join(sharedDir, `client.${ext}`);\n const clientContent = outputFormat === \"jsdoc\"\n ? generateClientJSDoc(strapiVersion, apiPrefix)\n : generateClient(strapiVersion, apiPrefix);\n await writeFile(clientPath, await formatCode(clientContent));\n generatedFiles.push(clientPath);\n\n // Locales\n const localesPath = path.join(sharedDir, `locales.${ext}`);\n const localesContent = outputFormat === \"jsdoc\"\n ? generateLocalesFileJSDoc(locales)\n : generateLocalesFile(locales);\n await writeFile(localesPath, await formatCode(localesContent));\n generatedFiles.push(localesPath);\n\n // Generate collection files\n for (const collection of schema.collections) {\n const featureDir = path.join(outputDir, 'collections', toKebabCase(collection.singularName));\n await ensureDir(featureDir);\n\n if (features.types) {\n const typesPath = path.join(featureDir, `types.${ext}`);\n const content = outputFormat === \"jsdoc\"\n ? generateCollectionTypesJSDoc(collection, schema)\n : generateCollectionTypes(collection, schema);\n await writeFile(typesPath, await formatCode(content));\n generatedFiles.push(typesPath);\n }\n\n if (features.services) {\n const servicePath = path.join(featureDir, `service.${ext}`);\n const content = outputFormat === \"jsdoc\"\n ? generateCollectionServiceJSDoc(collection, strapiVersion)\n : generateCollectionService(collection, strapiVersion);\n await writeFile(servicePath, await formatCode(content));\n generatedFiles.push(servicePath);\n }\n\n if (features.actions) {\n const actionsPath = path.join(featureDir, `actions.${ext}`);\n await writeFile(actionsPath, await formatCode(generateCollectionActions(collection, strapiVersion)));\n generatedFiles.push(actionsPath);\n }\n }\n\n // Generate single type files\n for (const single of schema.singles) {\n const featureDir = path.join(outputDir, 'singles', toKebabCase(single.singularName));\n await ensureDir(featureDir);\n\n if (features.types) {\n const typesPath = path.join(featureDir, `types.${ext}`);\n const content = outputFormat === \"jsdoc\"\n ? generateSingleTypesJSDoc(single, schema)\n : generateSingleTypes(single, schema);\n await writeFile(typesPath, await formatCode(content));\n generatedFiles.push(typesPath);\n }\n\n if (features.services) {\n const servicePath = path.join(featureDir, `service.${ext}`);\n const content = outputFormat === \"jsdoc\"\n ? generateSingleServiceJSDoc(single, strapiVersion)\n : generateSingleService(single, strapiVersion);\n await writeFile(servicePath, await formatCode(content));\n generatedFiles.push(servicePath);\n }\n }\n\n // Generate component files\n for (const component of schema.components) {\n const componentPath = path.join(outputDir, 'components', `${toKebabCase(component.name)}.${ext}`);\n const content = outputFormat === \"jsdoc\"\n ? generateComponentTypesJSDoc(component, schema)\n : generateComponentTypes(component, schema);\n await writeFile(componentPath, await formatCode(content));\n generatedFiles.push(componentPath);\n }\n\n return generatedFiles;\n}\n\n// ============================================\n// Shared Files Generation\n// ============================================\n\nfunction generateUtilityTypes(blocksRendererInstalled: boolean, strapiVersion: \"v4\" | \"v5\"): string {\n const isV4 = strapiVersion === \"v4\";\n\n const blocksContentType = isV4\n ? `/**\n * Rich text content (Strapi v4)\n * Can be markdown string or custom JSON structure\n */\nexport type RichTextContent = string;`\n : blocksRendererInstalled\n ? `/**\n * Blocks content type (Strapi v5 rich text)\n * Re-exported from @strapi/blocks-react-renderer\n */\nexport type { BlocksContent } from '@strapi/blocks-react-renderer';`\n : `/**\n * Blocks content type (Strapi v5 rich text)\n *\n * For full type support and rendering, install:\n * npm install @strapi/blocks-react-renderer\n *\n * Then re-run: npx strapi2front sync\n */\nexport type BlocksContent = unknown[];`;\n\n const baseEntity = isV4\n ? `export interface StrapiBaseEntity {\n id: number;\n createdAt: string;\n updatedAt: string;\n publishedAt: string | null;\n}`\n : `export interface StrapiBaseEntity {\n id: number;\n documentId: string;\n createdAt: string;\n updatedAt: string;\n publishedAt: string | null;\n}`;\n\n const mediaType = isV4\n ? `export interface StrapiMedia {\n id: number;\n name: string;\n alternativeText: string | null;\n caption: string | null;\n width: number;\n height: number;\n formats: {\n thumbnail?: StrapiMediaFormat;\n small?: StrapiMediaFormat;\n medium?: StrapiMediaFormat;\n large?: StrapiMediaFormat;\n } | null;\n hash: string;\n ext: string;\n mime: string;\n size: number;\n url: string;\n previewUrl: string | null;\n provider: string;\n createdAt: string;\n updatedAt: string;\n}`\n : `export interface StrapiMedia {\n id: number;\n documentId: string;\n name: string;\n alternativeText: string | null;\n caption: string | null;\n width: number;\n height: number;\n formats: {\n thumbnail?: StrapiMediaFormat;\n small?: StrapiMediaFormat;\n medium?: StrapiMediaFormat;\n large?: StrapiMediaFormat;\n } | null;\n hash: string;\n ext: string;\n mime: string;\n size: number;\n url: string;\n previewUrl: string | null;\n provider: string;\n createdAt: string;\n updatedAt: string;\n}`;\n\n const v4RawResponseTypes = isV4 ? `\n\n/**\n * Strapi v4 raw API response (with nested attributes)\n */\nexport interface StrapiV4RawItem<T> {\n id: number;\n attributes: Omit<T, 'id'>;\n}\n\nexport interface StrapiV4RawResponse<T> {\n data: StrapiV4RawItem<T>;\n meta: Record<string, unknown>;\n}\n\nexport interface StrapiV4RawListResponse<T> {\n data: StrapiV4RawItem<T>[];\n meta: {\n pagination: StrapiPagination;\n };\n}\n\n/**\n * Flatten Strapi v4 response item\n */\nexport function flattenV4Response<T>(item: StrapiV4RawItem<T>): T {\n return { id: item.id, ...item.attributes } as T;\n}\n\n/**\n * Flatten Strapi v4 list response\n */\nexport function flattenV4ListResponse<T>(items: StrapiV4RawItem<T>[]): T[] {\n return items.map(item => flattenV4Response<T>(item));\n}` : '';\n\n return `/**\n * Strapi utility types\n * Generated by strapi2front\n * Strapi version: ${strapiVersion}\n */\n\n${mediaType}\n\nexport interface StrapiMediaFormat {\n name: string;\n hash: string;\n ext: string;\n mime: string;\n width: number;\n height: number;\n size: number;\n url: string;\n}\n\nexport interface StrapiPagination {\n page: number;\n pageSize: number;\n pageCount: number;\n total: number;\n}\n\nexport interface StrapiResponse<T> {\n data: T;\n meta: {\n pagination?: StrapiPagination;\n };\n}\n\nexport interface StrapiListResponse<T> {\n data: T[];\n meta: {\n pagination: StrapiPagination;\n };\n}\n\n${baseEntity}\n${v4RawResponseTypes}\n${blocksContentType}\n`;\n}\n\nfunction generateClient(strapiVersion: \"v4\" | \"v5\", apiPrefix: string = \"/api\"): string {\n const isV4 = strapiVersion === \"v4\";\n // Normalize prefix for the generated code\n const normalizedPrefix = apiPrefix.startsWith('/') ? apiPrefix : '/' + apiPrefix;\n\n if (isV4) {\n return `/**\n * Strapi Client (v4)\n * Generated by strapi2front\n */\n\nimport Strapi from 'strapi-sdk-js';\nimport type { StrapiPagination } from './utils';\n\n// Initialize the Strapi client\nconst strapiUrl = import.meta.env.STRAPI_URL || process.env.STRAPI_URL || 'http://localhost:1337';\nconst strapiToken = import.meta.env.STRAPI_TOKEN || process.env.STRAPI_TOKEN;\nconst strapiApiPrefix = import.meta.env.STRAPI_API_PREFIX || process.env.STRAPI_API_PREFIX || '${normalizedPrefix}';\n\nexport const strapi = new Strapi({\n url: strapiUrl,\n prefix: strapiApiPrefix,\n axiosOptions: {\n headers: strapiToken ? {\n Authorization: \\`Bearer \\${strapiToken}\\`,\n } : {},\n },\n});\n\n// Default pagination for fallback\nconst defaultPagination: StrapiPagination = {\n page: 1,\n pageSize: 25,\n pageCount: 1,\n total: 0,\n};\n\n// Strapi v4 raw response types (with nested attributes)\ninterface StrapiV4RawItem<T> {\n id: number;\n attributes: Omit<T, 'id'>;\n}\n\ninterface StrapiV4RawListResponse<T> {\n data: StrapiV4RawItem<T>[];\n meta: {\n pagination?: StrapiPagination;\n };\n}\n\ninterface StrapiV4RawSingleResponse<T> {\n data: StrapiV4RawItem<T>;\n meta?: Record<string, unknown>;\n}\n\n/**\n * Flatten a Strapi v4 response item (merges id with attributes)\n */\nfunction flattenItem<T>(item: StrapiV4RawItem<T>): T {\n return { id: item.id, ...item.attributes } as T;\n}\n\n/**\n * Recursively flatten nested relations in Strapi v4 response\n */\nfunction flattenRelations<T>(data: T): T {\n if (data === null || data === undefined) return data;\n if (Array.isArray(data)) {\n return data.map(item => flattenRelations(item)) as unknown as T;\n }\n if (typeof data === 'object') {\n const result: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(data as Record<string, unknown>)) {\n // Check if this is a Strapi v4 relation response { data: { id, attributes } }\n if (value && typeof value === 'object' && 'data' in value) {\n const relationData = (value as { data: unknown }).data;\n if (relationData === null) {\n result[key] = null;\n } else if (Array.isArray(relationData)) {\n // To-many relation\n result[key] = relationData.map((item: StrapiV4RawItem<unknown>) =>\n flattenRelations(flattenItem(item))\n );\n } else if (typeof relationData === 'object' && 'id' in relationData && 'attributes' in relationData) {\n // To-one relation\n result[key] = flattenRelations(flattenItem(relationData as StrapiV4RawItem<unknown>));\n } else {\n result[key] = flattenRelations(value);\n }\n } else {\n result[key] = flattenRelations(value);\n }\n }\n return result as T;\n }\n return data;\n}\n\n// Helper to get typed collection\nexport function collection<T>(pluralName: string) {\n return {\n async find(params?: Record<string, unknown>): Promise<{ data: T[]; meta: { pagination: StrapiPagination } }> {\n const response = await strapi.find(pluralName, params) as unknown as StrapiV4RawListResponse<T>;\n const flattenedData = Array.isArray(response.data)\n ? response.data.map(item => flattenRelations(flattenItem<T>(item)))\n : [];\n return {\n data: flattenedData,\n meta: {\n pagination: response.meta?.pagination || defaultPagination,\n },\n };\n },\n async findOne(id: number | string, params?: Record<string, unknown>): Promise<{ data: T }> {\n const response = await strapi.findOne(pluralName, String(id), params) as unknown as StrapiV4RawSingleResponse<T>;\n return { data: flattenRelations(flattenItem<T>(response.data)) };\n },\n async create(data: { data: Partial<T> }): Promise<{ data: T }> {\n const response = await strapi.create(pluralName, data.data as Record<string, unknown>) as unknown as StrapiV4RawSingleResponse<T>;\n return { data: flattenRelations(flattenItem<T>(response.data)) };\n },\n async update(id: number | string, data: { data: Partial<T> }): Promise<{ data: T }> {\n const response = await strapi.update(pluralName, String(id), data.data as Record<string, unknown>) as unknown as StrapiV4RawSingleResponse<T>;\n return { data: flattenRelations(flattenItem<T>(response.data)) };\n },\n async delete(id: number | string): Promise<void> {\n await strapi.delete(pluralName, String(id));\n },\n };\n}\n\n// Helper to get typed single type\nexport function single<T>(singularName: string) {\n return {\n async find(params?: Record<string, unknown>): Promise<{ data: T }> {\n const response = await strapi.find(singularName, params) as unknown as StrapiV4RawSingleResponse<T>;\n return { data: flattenRelations(flattenItem<T>(response.data)) };\n },\n async update(data: { data: Partial<T> }): Promise<{ data: T }> {\n const response = await strapi.update(singularName, 1 as unknown as string, data.data as Record<string, unknown>) as unknown as StrapiV4RawSingleResponse<T>;\n return { data: flattenRelations(flattenItem<T>(response.data)) };\n },\n async delete(): Promise<void> {\n await strapi.delete(singularName, 1 as unknown as string);\n },\n };\n}\n`;\n }\n\n return `/**\n * Strapi Client (v5)\n * Generated by strapi2front\n */\n\nimport Strapi from 'strapi-sdk-js';\nimport type { StrapiPagination } from './utils';\n\n// Initialize the Strapi client\nconst strapiUrl = import.meta.env.STRAPI_URL || process.env.STRAPI_URL || 'http://localhost:1337';\nconst strapiToken = import.meta.env.STRAPI_TOKEN || process.env.STRAPI_TOKEN;\nconst strapiApiPrefix = import.meta.env.STRAPI_API_PREFIX || process.env.STRAPI_API_PREFIX || '${normalizedPrefix}';\n\nexport const strapi = new Strapi({\n url: strapiUrl,\n prefix: strapiApiPrefix,\n axiosOptions: {\n headers: strapiToken ? {\n Authorization: \\`Bearer \\${strapiToken}\\`,\n } : {},\n },\n});\n\n// Default pagination for fallback\nconst defaultPagination: StrapiPagination = {\n page: 1,\n pageSize: 25,\n pageCount: 1,\n total: 0,\n};\n\n// Response types from strapi-sdk-js\ninterface StrapiListResponse<T> {\n data: T[];\n meta: {\n pagination?: StrapiPagination;\n };\n}\n\ninterface StrapiSingleResponse<T> {\n data: T;\n meta?: Record<string, unknown>;\n}\n\n// Helper to get typed collection\nexport function collection<T>(pluralName: string) {\n return {\n async find(params?: Record<string, unknown>): Promise<{ data: T[]; meta: { pagination: StrapiPagination } }> {\n const response = await strapi.find(pluralName, params) as unknown as StrapiListResponse<T>;\n return {\n data: Array.isArray(response.data) ? response.data : [],\n meta: {\n pagination: response.meta?.pagination || defaultPagination,\n },\n };\n },\n async findOne(documentId: string, params?: Record<string, unknown>): Promise<{ data: T }> {\n const response = await strapi.findOne(pluralName, documentId, params) as unknown as StrapiSingleResponse<T>;\n return { data: response.data };\n },\n async create(data: { data: Partial<T> }): Promise<{ data: T }> {\n const response = await strapi.create(pluralName, data.data as Record<string, unknown>) as unknown as StrapiSingleResponse<T>;\n return { data: response.data };\n },\n async update(documentId: string, data: { data: Partial<T> }): Promise<{ data: T }> {\n const response = await strapi.update(pluralName, documentId, data.data as Record<string, unknown>) as unknown as StrapiSingleResponse<T>;\n return { data: response.data };\n },\n async delete(documentId: string): Promise<void> {\n await strapi.delete(pluralName, documentId);\n },\n };\n}\n\n// Helper to get typed single type\nexport function single<T>(singularName: string) {\n return {\n async find(params?: Record<string, unknown>): Promise<{ data: T }> {\n const response = await strapi.find(singularName, params) as unknown as StrapiSingleResponse<T>;\n return { data: response.data };\n },\n async update(data: { data: Partial<T> }): Promise<{ data: T }> {\n const response = await strapi.update(singularName, 1 as unknown as string, data.data as Record<string, unknown>) as unknown as StrapiSingleResponse<T>;\n return { data: response.data };\n },\n async delete(): Promise<void> {\n await strapi.delete(singularName, 1 as unknown as string);\n },\n };\n}\n`;\n}\n\nfunction generateLocalesFile(locales: StrapiLocale[]): string {\n if (locales.length === 0) {\n return `/**\n * Strapi locales\n * Generated by strapi2front\n * Note: i18n is not enabled in Strapi\n */\n\nexport const locales = [] as const;\nexport type Locale = string;\nexport const defaultLocale: Locale = 'en';\nexport const localeNames: Record<string, string> = {};\n\nexport function isValidLocale(_code: string): _code is Locale {\n return true;\n}\n\nexport function getLocaleName(code: string): string {\n return code;\n}\n`;\n }\n\n const localeCodes = locales.map(l => l.code);\n const defaultLocale = locales.find(l => l.isDefault)?.code || locales[0]?.code || 'en';\n\n return `/**\n * Strapi locales\n * Generated by strapi2front\n */\n\nexport const locales = [${localeCodes.map(c => `'${c}'`).join(', ')}] as const;\n\nexport type Locale = typeof locales[number];\n\nexport const defaultLocale: Locale = '${defaultLocale}';\n\nexport const localeNames: Record<Locale, string> = {\n${locales.map(l => ` '${l.code}': '${l.name}'`).join(',\\n')}\n};\n\nexport function isValidLocale(code: string): code is Locale {\n return locales.includes(code as Locale);\n}\n\nexport function getLocaleName(code: Locale): string {\n return localeNames[code] || code;\n}\n`;\n}\n\n// ============================================\n// Collection Types Generation\n// ============================================\n\nfunction generateCollectionTypes(collection: CollectionType, schema: ParsedSchema): string {\n const typeName = toPascalCase(collection.singularName);\n const attributes = generateAttributes(collection.attributes);\n const imports = generateTypeImports(collection.attributes, schema, 'collection');\n\n return `/**\n * ${collection.displayName}\n * ${collection.description || ''}\n * Generated by strapi2front\n */\n\n${imports}\n\nexport interface ${typeName} extends StrapiBaseEntity {\n${attributes}\n}\n\nexport interface ${typeName}Filters {\n id?: number | { $eq?: number; $ne?: number; $in?: number[]; $notIn?: number[] };\n documentId?: string | { $eq?: string; $ne?: string };\n createdAt?: string | { $eq?: string; $gt?: string; $gte?: string; $lt?: string; $lte?: string };\n updatedAt?: string | { $eq?: string; $gt?: string; $gte?: string; $lt?: string; $lte?: string };\n publishedAt?: string | null | { $eq?: string; $ne?: string; $null?: boolean };\n $and?: ${typeName}Filters[];\n $or?: ${typeName}Filters[];\n $not?: ${typeName}Filters;\n}\n`;\n}\n\nfunction generateSingleTypes(single: SingleType, schema: ParsedSchema): string {\n const typeName = toPascalCase(single.singularName);\n const attributes = generateAttributes(single.attributes);\n const imports = generateTypeImports(single.attributes, schema, 'single');\n\n return `/**\n * ${single.displayName}\n * ${single.description || ''}\n * Generated by strapi2front\n */\n\n${imports}\n\nexport interface ${typeName} extends StrapiBaseEntity {\n${attributes}\n}\n`;\n}\n\nfunction generateComponentTypes(component: ComponentType, schema: ParsedSchema): string {\n const typeName = toPascalCase(component.name);\n const attributes = generateAttributes(component.attributes);\n const imports = generateTypeImports(component.attributes, schema, 'component');\n\n return `/**\n * ${component.displayName} component\n * Category: ${component.category}\n * ${component.description || ''}\n * Generated by strapi2front\n */\n\n${imports}\n\nexport interface ${typeName} {\n id: number;\n${attributes}\n}\n`;\n}\n\nfunction generateTypeImports(\n attributes: Record<string, Attribute>,\n schema: ParsedSchema,\n context: 'collection' | 'single' | 'component'\n): string {\n const utilsImports: string[] = [];\n const relationImports: Map<string, string> = new Map();\n const componentImports: Map<string, string> = new Map();\n\n // Check what utils we need\n const attributesStr = JSON.stringify(attributes);\n if (context !== 'component') {\n utilsImports.push('StrapiBaseEntity');\n }\n if (attributesStr.includes('\"type\":\"media\"')) {\n utilsImports.push('StrapiMedia');\n }\n if (attributesStr.includes('\"type\":\"blocks\"')) {\n utilsImports.push('BlocksContent');\n }\n\n // Extract relations and components\n // Components are in strapi/components/, collections/singles are in strapi/collections/xxx/ or strapi/singles/xxx/\n // From component: ../collections/xxx/types (one level up)\n // From collection/single: ../../collections/xxx/types (two levels up, since they're in a subfolder)\n const relativePrefix = context === 'component' ? '..' : '../..';\n\n for (const attr of Object.values(attributes)) {\n if (attr.type === 'relation' && 'target' in attr && attr.target) {\n const targetName = attr.target.split('.').pop() || '';\n if (targetName) {\n const typeName = toPascalCase(targetName);\n const fileName = toKebabCase(targetName);\n // Check if it's a collection or single\n const isCollection = schema.collections.some(c => c.singularName === targetName);\n const isSingle = schema.singles.some(s => s.singularName === targetName);\n if (isCollection) {\n relationImports.set(typeName, `${relativePrefix}/collections/${fileName}/types`);\n } else if (isSingle) {\n relationImports.set(typeName, `${relativePrefix}/singles/${fileName}/types`);\n }\n }\n }\n\n if (attr.type === 'component' && 'component' in attr && attr.component) {\n const componentName = attr.component.split('.').pop() || '';\n if (componentName) {\n const typeName = toPascalCase(componentName);\n const fileName = toKebabCase(componentName);\n if (context === 'component') {\n componentImports.set(typeName, `./${fileName}`);\n } else {\n componentImports.set(typeName, `../../components/${fileName}`);\n }\n }\n }\n\n if (attr.type === 'dynamiczone' && 'components' in attr && attr.components) {\n for (const comp of attr.components) {\n const componentName = comp.split('.').pop() || '';\n if (componentName) {\n const typeName = toPascalCase(componentName);\n const fileName = toKebabCase(componentName);\n if (context === 'component') {\n componentImports.set(typeName, `./${fileName}`);\n } else {\n componentImports.set(typeName, `../../components/${fileName}`);\n }\n }\n }\n }\n }\n\n const lines: string[] = [];\n\n // Utils import\n if (utilsImports.length > 0) {\n const utilsPath = context === 'component' ? '../shared/utils' : '../../shared/utils';\n lines.push(`import type { ${utilsImports.join(', ')} } from '${utilsPath}';`);\n }\n\n // Relation imports\n for (const [typeName, importPath] of relationImports) {\n lines.push(`import type { ${typeName} } from '${importPath}';`);\n }\n\n // Component imports\n for (const [typeName, importPath] of componentImports) {\n lines.push(`import type { ${typeName} } from '${importPath}';`);\n }\n\n return lines.join('\\n');\n}\n\nfunction generateAttributes(attributes: Record<string, Attribute>): string {\n const lines: string[] = [];\n\n for (const [name, attr] of Object.entries(attributes)) {\n const tsType = attributeToTsType(attr);\n const optional = attr.required ? '' : '?';\n lines.push(` ${name}${optional}: ${tsType};`);\n }\n\n return lines.join('\\n');\n}\n\nfunction attributeToTsType(attr: Attribute): string {\n switch (attr.type) {\n case 'string':\n case 'text':\n case 'richtext':\n case 'email':\n case 'password':\n case 'uid':\n return 'string';\n case 'blocks':\n return 'BlocksContent';\n case 'integer':\n case 'biginteger':\n case 'float':\n case 'decimal':\n return 'number';\n case 'boolean':\n return 'boolean';\n case 'date':\n case 'time':\n case 'datetime':\n case 'timestamp':\n return 'string';\n case 'json':\n return 'unknown';\n case 'enumeration':\n if ('enum' in attr && attr.enum) {\n return attr.enum.map(v => `'${v}'`).join(' | ');\n }\n return 'string';\n case 'media':\n if ('multiple' in attr && attr.multiple) {\n return 'StrapiMedia[]';\n }\n return 'StrapiMedia | null';\n case 'relation':\n if ('target' in attr && attr.target) {\n const targetName = toPascalCase(attr.target.split('.').pop() || 'unknown');\n const isMany = attr.relation === 'oneToMany' || attr.relation === 'manyToMany';\n return isMany ? `${targetName}[]` : `${targetName} | null`;\n }\n return 'unknown';\n case 'component':\n if ('component' in attr && attr.component) {\n const componentName = toPascalCase(attr.component.split('.').pop() || 'unknown');\n if ('repeatable' in attr && attr.repeatable) {\n return `${componentName}[]`;\n }\n return `${componentName} | null`;\n }\n return 'unknown';\n case 'dynamiczone':\n if ('components' in attr && attr.components) {\n const types = attr.components.map(c => toPascalCase(c.split('.').pop() || 'unknown'));\n return `(${types.join(' | ')})[]`;\n }\n return 'unknown[]';\n default:\n return 'unknown';\n }\n}\n\n// ============================================\n// Collection Service Generation\n// ============================================\n\nfunction generateCollectionService(collection: CollectionType, strapiVersion: \"v4\" | \"v5\"): string {\n const typeName = toPascalCase(collection.singularName);\n const serviceName = toCamelCase(collection.singularName) + 'Service';\n const endpoint = collection.pluralName;\n const hasSlug = 'slug' in collection.attributes;\n const { localized, draftAndPublish } = collection;\n const isV4 = strapiVersion === \"v4\";\n\n // V4 uses `id: number`, V5 uses `documentId: string`\n const idParam = isV4 ? 'id: number' : 'documentId: string';\n const idName = isV4 ? 'id' : 'documentId';\n const omitFields = isV4\n ? \"'id' | 'createdAt' | 'updatedAt' | 'publishedAt'\"\n : \"'id' | 'documentId' | 'createdAt' | 'updatedAt' | 'publishedAt'\";\n const omitFieldsUpdate = isV4\n ? \"'id' | 'createdAt' | 'updatedAt'\"\n : \"'id' | 'documentId' | 'createdAt' | 'updatedAt'\";\n\n // Build imports\n const imports = [\n `import { collection } from '../../shared/client';`,\n `import type { ${typeName}, ${typeName}Filters } from './types';`,\n `import type { StrapiPagination } from '../../shared/utils';`,\n ];\n if (localized) {\n imports.push(`import type { Locale } from '../../shared/locales';`);\n }\n\n // Build options interfaces\n const paginationFields = `\n /** Page number (1-indexed) - use with pageSize */\n page?: number;\n /** Number of items per page (default: 25) - use with page */\n pageSize?: number;\n /** Offset to start from (0-indexed) - use with limit */\n start?: number;\n /** Maximum number of items to return - use with start */\n limit?: number;`;\n\n let findManyOptionsFields = ` filters?: ${typeName}Filters;\n pagination?: {${paginationFields}\n };\n sort?: string | string[];\n populate?: string | string[] | Record<string, unknown>;`;\n\n let findOneOptionsFields = ` populate?: string | string[] | Record<string, unknown>;`;\n\n if (localized) {\n findManyOptionsFields += `\\n locale?: Locale;`;\n findOneOptionsFields += `\\n locale?: Locale;`;\n }\n if (draftAndPublish) {\n findManyOptionsFields += `\\n status?: 'draft' | 'published';`;\n findOneOptionsFields += `\\n status?: 'draft' | 'published';`;\n }\n\n // Build find params\n let findParams = ` filters: options.filters,\n pagination: options.pagination,\n sort: options.sort,\n populate: options.populate,`;\n let findOneParams = ` populate: options.populate,`;\n\n if (localized) {\n findParams += `\\n locale: options.locale,`;\n findOneParams += `\\n locale: options.locale,`;\n }\n if (draftAndPublish) {\n findParams += `\\n status: options.status,`;\n findOneParams += `\\n status: options.status,`;\n }\n\n return `/**\n * ${collection.displayName} Service\n * ${collection.description || ''}\n * Generated by strapi2front\n * Strapi version: ${strapiVersion}\n */\n\n${imports.join('\\n')}\n\nexport interface FindManyOptions {\n${findManyOptionsFields}\n}\n\nexport interface FindOneOptions {\n${findOneOptionsFields}\n}\n\n// Create typed collection helper\nconst ${toCamelCase(collection.singularName)}Collection = collection<${typeName}>('${endpoint}');\n\nexport const ${serviceName} = {\n async findMany(options: FindManyOptions = {}): Promise<{ data: ${typeName}[]; pagination: StrapiPagination }> {\n const response = await ${toCamelCase(collection.singularName)}Collection.find({\n${findParams}\n });\n\n return {\n data: response.data,\n pagination: response.meta.pagination,\n };\n },\n\n async findAll(options: Omit<FindManyOptions, 'pagination'> = {}): Promise<${typeName}[]> {\n const allItems: ${typeName}[] = [];\n let page = 1;\n let hasMore = true;\n\n while (hasMore) {\n const { data, pagination } = await this.findMany({\n ...options,\n pagination: { page, pageSize: 100 },\n });\n\n allItems.push(...data);\n hasMore = page < pagination.pageCount;\n page++;\n }\n\n return allItems;\n },\n\n async findOne(${idParam}, options: FindOneOptions = {}): Promise<${typeName} | null> {\n try {\n const response = await ${toCamelCase(collection.singularName)}Collection.findOne(${idName}, {\n${findOneParams}\n });\n\n return response.data;\n } catch (error) {\n if (error instanceof Error && error.message.includes('404')) {\n return null;\n }\n throw error;\n }\n },\n${hasSlug ? `\n async findBySlug(slug: string, options: FindOneOptions = {}): Promise<${typeName} | null> {\n const { data } = await this.findMany({\n filters: { slug: { $eq: slug } } as ${typeName}Filters,\n pagination: { pageSize: 1 },\n populate: options.populate,${localized ? '\\n locale: options.locale,' : ''}${draftAndPublish ? '\\n status: options.status,' : ''}\n });\n\n return data[0] || null;\n },\n` : ''}\n async create(data: Partial<Omit<${typeName}, ${omitFields}>>): Promise<${typeName}> {\n const response = await ${toCamelCase(collection.singularName)}Collection.create({ data });\n return response.data;\n },\n\n async update(${idParam}, data: Partial<Omit<${typeName}, ${omitFieldsUpdate}>>): Promise<${typeName}> {\n const response = await ${toCamelCase(collection.singularName)}Collection.update(${idName}, { data });\n return response.data;\n },\n\n async delete(${idParam}): Promise<void> {\n await ${toCamelCase(collection.singularName)}Collection.delete(${idName});\n },\n\n async count(filters?: ${typeName}Filters): Promise<number> {\n const { pagination } = await this.findMany({\n filters,\n pagination: { pageSize: 1 },\n });\n\n return pagination.total;\n },\n};\n`;\n}\n\n// ============================================\n// Single Service Generation\n// ============================================\n\nfunction generateSingleService(single: SingleType, strapiVersion: \"v4\" | \"v5\"): string {\n const typeName = toPascalCase(single.singularName);\n const serviceName = toCamelCase(single.singularName) + 'Service';\n const endpoint = single.singularName;\n const { localized, draftAndPublish } = single;\n const isV4 = strapiVersion === \"v4\";\n\n // V4 doesn't have documentId\n const omitFields = isV4\n ? \"'id' | 'createdAt' | 'updatedAt'\"\n : \"'id' | 'documentId' | 'createdAt' | 'updatedAt'\";\n\n // Build imports\n const imports = [\n `import { single } from '../../shared/client';`,\n `import type { ${typeName} } from './types';`,\n ];\n if (localized) {\n imports.push(`import type { Locale } from '../../shared/locales';`);\n }\n\n // Build options interface\n let findOptionsFields = ` populate?: string | string[] | Record<string, unknown>;`;\n if (localized) {\n findOptionsFields += `\\n locale?: Locale;`;\n }\n if (draftAndPublish) {\n findOptionsFields += `\\n status?: 'draft' | 'published';`;\n }\n\n // Build find params\n let findParams = ` populate: options.populate,`;\n if (localized) {\n findParams += `\\n locale: options.locale,`;\n }\n if (draftAndPublish) {\n findParams += `\\n status: options.status,`;\n }\n\n return `/**\n * ${single.displayName} Service (Single Type)\n * ${single.description || ''}\n * Generated by strapi2front\n * Strapi version: ${strapiVersion}\n */\n\n${imports.join('\\n')}\n\nexport interface FindOptions {\n${findOptionsFields}\n}\n\n// Create typed single helper\nconst ${toCamelCase(single.singularName)}Single = single<${typeName}>('${endpoint}');\n\nexport const ${serviceName} = {\n async find(options: FindOptions = {}): Promise<${typeName} | null> {\n try {\n const response = await ${toCamelCase(single.singularName)}Single.find({\n${findParams}\n });\n\n return response.data;\n } catch (error) {\n if (error instanceof Error && error.message.includes('404')) {\n return null;\n }\n throw error;\n }\n },\n\n async update(data: Partial<Omit<${typeName}, ${omitFields}>>): Promise<${typeName}> {\n const response = await ${toCamelCase(single.singularName)}Single.update({ data });\n return response.data;\n },\n\n async delete(): Promise<void> {\n await ${toCamelCase(single.singularName)}Single.delete();\n },\n};\n`;\n}\n\n// ============================================\n// Collection Actions Generation\n// ============================================\n\nfunction generateCollectionActions(collection: CollectionType, strapiVersion: \"v4\" | \"v5\"): string {\n const typeName = toPascalCase(collection.singularName);\n const serviceName = toCamelCase(collection.singularName) + 'Service';\n const actionPrefix = toCamelCase(collection.singularName);\n const isV4 = strapiVersion === \"v4\";\n\n // V4 uses `id: number`, V5 uses `documentId: string`\n const idInputSchema = isV4 ? 'z.number().int().positive()' : 'z.string()';\n const idParamName = isV4 ? 'id' : 'documentId';\n\n return `/**\n * ${collection.displayName} Astro Actions\n * ${collection.description || ''}\n * Generated by strapi2front\n * Strapi version: ${strapiVersion}\n */\n\nimport { defineAction } from 'astro:actions';\nimport { z } from 'astro:schema';\nimport { ${serviceName} } from './service';\nimport type { ${typeName} } from './types';\n\nexport const ${actionPrefix}Actions = {\n getMany: defineAction({\n input: z.object({\n page: z.number().optional(),\n pageSize: z.number().optional(),\n sort: z.string().optional(),\n }).optional(),\n handler: async (input) => {\n const { data, pagination } = await ${serviceName}.findMany({\n pagination: input ? { page: input.page, pageSize: input.pageSize } : undefined,\n sort: input?.sort,\n });\n return { data, pagination };\n },\n }),\n\n getOne: defineAction({\n input: z.object({\n ${idParamName}: ${idInputSchema},\n }),\n handler: async (input) => {\n const data = await ${serviceName}.findOne(input.${idParamName});\n return { data };\n },\n }),\n\n create: defineAction({\n input: z.object({\n data: z.record(z.unknown()),\n }),\n handler: async (input) => {\n const data = await ${serviceName}.create(input.data as Partial<${typeName}>);\n return { data };\n },\n }),\n\n update: defineAction({\n input: z.object({\n ${idParamName}: ${idInputSchema},\n data: z.record(z.unknown()),\n }),\n handler: async (input) => {\n const data = await ${serviceName}.update(input.${idParamName}, input.data as Partial<${typeName}>);\n return { data };\n },\n }),\n\n delete: defineAction({\n input: z.object({\n ${idParamName}: ${idInputSchema},\n }),\n handler: async (input) => {\n await ${serviceName}.delete(input.${idParamName});\n return { success: true };\n },\n }),\n};\n`;\n}\n\n// ============================================\n// JSDoc Generators\n// ============================================\n\nfunction generateUtilityTypesJSDoc(blocksRendererInstalled: boolean, strapiVersion: \"v4\" | \"v5\"): string {\n const isV4 = strapiVersion === \"v4\";\n\n const blocksContentType = isV4\n ? `/**\n * Rich text content (Strapi v4)\n * Can be markdown string or custom JSON structure\n * @typedef {string} RichTextContent\n */`\n : blocksRendererInstalled\n ? `// BlocksContent - import from '@strapi/blocks-react-renderer' for full type support`\n : `/**\n * Blocks content type (Strapi v5 rich text)\n *\n * For full type support and rendering, install:\n * npm install @strapi/blocks-react-renderer\n *\n * Then re-run: npx strapi2front sync\n * @typedef {Array<Object>} BlocksContent\n */`;\n\n const baseEntity = isV4\n ? `/**\n * @typedef {Object} StrapiBaseEntity\n * @property {number} id\n * @property {string} createdAt\n * @property {string} updatedAt\n * @property {string|null} publishedAt\n */`\n : `/**\n * @typedef {Object} StrapiBaseEntity\n * @property {number} id\n * @property {string} documentId\n * @property {string} createdAt\n * @property {string} updatedAt\n * @property {string|null} publishedAt\n */`;\n\n const mediaType = isV4\n ? `/**\n * @typedef {Object} StrapiMedia\n * @property {number} id\n * @property {string} name\n * @property {string|null} alternativeText\n * @property {string|null} caption\n * @property {number} width\n * @property {number} height\n * @property {Object|null} formats\n * @property {StrapiMediaFormat} [formats.thumbnail]\n * @property {StrapiMediaFormat} [formats.small]\n * @property {StrapiMediaFormat} [formats.medium]\n * @property {StrapiMediaFormat} [formats.large]\n * @property {string} hash\n * @property {string} ext\n * @property {string} mime\n * @property {number} size\n * @property {string} url\n * @property {string|null} previewUrl\n * @property {string} provider\n * @property {string} createdAt\n * @property {string} updatedAt\n */`\n : `/**\n * @typedef {Object} StrapiMedia\n * @property {number} id\n * @property {string} documentId\n * @property {string} name\n * @property {string|null} alternativeText\n * @property {string|null} caption\n * @property {number} width\n * @property {number} height\n * @property {Object|null} formats\n * @property {StrapiMediaFormat} [formats.thumbnail]\n * @property {StrapiMediaFormat} [formats.small]\n * @property {StrapiMediaFormat} [formats.medium]\n * @property {StrapiMediaFormat} [formats.large]\n * @property {string} hash\n * @property {string} ext\n * @property {string} mime\n * @property {number} size\n * @property {string} url\n * @property {string|null} previewUrl\n * @property {string} provider\n * @property {string} createdAt\n * @property {string} updatedAt\n */`;\n\n const v4RawResponseTypes = isV4 ? `\n\n/**\n * Strapi v4 raw API response item (with nested attributes)\n * @template T\n * @typedef {Object} StrapiV4RawItem\n * @property {number} id\n * @property {Omit<T, 'id'>} attributes\n */\n\n/**\n * Strapi v4 raw API response\n * @template T\n * @typedef {Object} StrapiV4RawResponse\n * @property {StrapiV4RawItem<T>} data\n * @property {Object} meta\n */\n\n/**\n * Strapi v4 raw list response\n * @template T\n * @typedef {Object} StrapiV4RawListResponse\n * @property {StrapiV4RawItem<T>[]} data\n * @property {Object} meta\n * @property {StrapiPagination} meta.pagination\n */\n\n/**\n * Flatten Strapi v4 response item\n * @template T\n * @param {StrapiV4RawItem<T>} item\n * @returns {T}\n */\nfunction flattenV4Response(item) {\n /** @type {any} */\n const merged = { id: item.id, ...item.attributes };\n return merged;\n}\n\n/**\n * Flatten Strapi v4 list response\n * @template T\n * @param {StrapiV4RawItem<T>[]} items\n * @returns {T[]}\n */\nfunction flattenV4ListResponse(items) {\n return items.map(item => flattenV4Response(item));\n}\n\nmodule.exports = { flattenV4Response, flattenV4ListResponse };` : '';\n\n return `// @ts-check\n/**\n * Strapi utility types\n * Generated by strapi2front\n * Strapi version: ${strapiVersion}\n */\n\n${mediaType}\n\n/**\n * @typedef {Object} StrapiMediaFormat\n * @property {string} name\n * @property {string} hash\n * @property {string} ext\n * @property {string} mime\n * @property {number} width\n * @property {number} height\n * @property {number} size\n * @property {string} url\n */\n\n/**\n * @typedef {Object} StrapiPagination\n * @property {number} page\n * @property {number} pageSize\n * @property {number} pageCount\n * @property {number} total\n */\n\n/**\n * @template T\n * @typedef {Object} StrapiResponse\n * @property {T} data\n * @property {Object} meta\n * @property {StrapiPagination} [meta.pagination]\n */\n\n/**\n * @template T\n * @typedef {Object} StrapiListResponse\n * @property {T[]} data\n * @property {Object} meta\n * @property {StrapiPagination} meta.pagination\n */\n\n${baseEntity}\n${v4RawResponseTypes}\n${blocksContentType}\n\nmodule.exports = {};\n`;\n}\n\nfunction generateClientJSDoc(strapiVersion: \"v4\" | \"v5\", apiPrefix: string = \"/api\"): string {\n const isV4 = strapiVersion === \"v4\";\n const normalizedPrefix = apiPrefix.startsWith('/') ? apiPrefix : '/' + apiPrefix;\n\n if (isV4) {\n return `// @ts-check\n/**\n * Strapi Client (v4)\n * Generated by strapi2front\n */\n\nconst Strapi = require('strapi-sdk-js').default;\n\n// Initialize the Strapi client\nconst strapiUrl = process.env.STRAPI_URL || 'http://localhost:1337';\nconst strapiToken = process.env.STRAPI_TOKEN;\nconst strapiApiPrefix = process.env.STRAPI_API_PREFIX || '${normalizedPrefix}';\n\nconst strapi = new Strapi({\n url: strapiUrl,\n prefix: strapiApiPrefix,\n axiosOptions: {\n headers: strapiToken ? {\n Authorization: \\`Bearer \\${strapiToken}\\`,\n } : {},\n },\n});\n\n/** @type {import('./utils').StrapiPagination} */\nconst defaultPagination = {\n page: 1,\n pageSize: 25,\n pageCount: 1,\n total: 0,\n};\n\n/**\n * Flatten a Strapi v4 response item (merges id with attributes)\n * @template T\n * @param {{ id: number, attributes: Omit<T, 'id'> }} item\n * @returns {T}\n */\nfunction flattenItem(item) {\n /** @type {any} */\n const merged = { id: item.id, ...item.attributes };\n return merged;\n}\n\n/**\n * Recursively flatten nested relations in Strapi v4 response\n * @template T\n * @param {T} data\n * @returns {T}\n */\nfunction flattenRelations(data) {\n if (data === null || data === undefined) return data;\n if (Array.isArray(data)) {\n /** @type {any} */\n const mapped = data.map(item => flattenRelations(item));\n return mapped;\n }\n if (typeof data === 'object') {\n /** @type {Record<string, unknown>} */\n const result = {};\n for (const [key, value] of Object.entries(data)) {\n if (value && typeof value === 'object' && 'data' in value) {\n /** @type {any} */\n const wrapper = value;\n const relationData = wrapper.data;\n if (relationData === null) {\n result[key] = null;\n } else if (Array.isArray(relationData)) {\n result[key] = relationData.map((item) =>\n flattenRelations(flattenItem(item))\n );\n } else if (typeof relationData === 'object' && relationData !== null && 'id' in relationData && 'attributes' in relationData) {\n result[key] = flattenRelations(flattenItem(relationData));\n } else {\n result[key] = flattenRelations(value);\n }\n } else {\n result[key] = flattenRelations(value);\n }\n }\n /** @type {any} */\n const typed = result;\n return typed;\n }\n return data;\n}\n\n/**\n * Helper to get typed collection\n * @template T\n * @param {string} pluralName\n */\nfunction collection(pluralName) {\n return {\n /**\n * @param {Record<string, unknown>} [params]\n * @returns {Promise<{ data: T[], meta: { pagination: import('./utils').StrapiPagination } }>}\n */\n async find(params) {\n const response = await strapi.find(pluralName, params);\n /** @type {any} */\n const rawData = response.data;\n /** @type {T[]} */\n const data = Array.isArray(rawData)\n ? rawData.map(item => flattenRelations(flattenItem(item)))\n : [];\n /** @type {any} */\n const rawMeta = response.meta;\n /** @type {any} */\n const rawPag = rawMeta?.pagination;\n /** @type {import('./utils').StrapiPagination} */\n const pagination = {\n page: rawPag?.page ?? defaultPagination.page,\n pageSize: rawPag?.pageSize ?? defaultPagination.pageSize,\n pageCount: rawPag?.pageCount ?? defaultPagination.pageCount,\n total: rawPag?.total ?? defaultPagination.total,\n };\n return { data, meta: { pagination } };\n },\n /**\n * @param {number|string} id\n * @param {Record<string, unknown>} [params]\n * @returns {Promise<{ data: T }>}\n */\n async findOne(id, params) {\n const response = await strapi.findOne(pluralName, String(id), params);\n /** @type {any} */\n const rawData = response.data;\n /** @type {T} */\n const data = flattenRelations(flattenItem(rawData));\n return { data };\n },\n /**\n * @param {{ data: Partial<T> }} data\n * @returns {Promise<{ data: T }>}\n */\n async create(data) {\n const response = await strapi.create(pluralName, data.data);\n /** @type {any} */\n const rawData = response.data;\n /** @type {T} */\n const result = flattenRelations(flattenItem(rawData));\n return { data: result };\n },\n /**\n * @param {number|string} id\n * @param {{ data: Partial<T> }} data\n * @returns {Promise<{ data: T }>}\n */\n async update(id, data) {\n const response = await strapi.update(pluralName, String(id), data.data);\n /** @type {any} */\n const rawData = response.data;\n /** @type {T} */\n const result = flattenRelations(flattenItem(rawData));\n return { data: result };\n },\n /**\n * @param {number|string} id\n * @returns {Promise<void>}\n */\n async delete(id) {\n await strapi.delete(pluralName, String(id));\n },\n };\n}\n\n/**\n * Helper to get typed single type\n * @template T\n * @param {string} singularName\n */\nfunction single(singularName) {\n return {\n /**\n * @param {Record<string, unknown>} [params]\n * @returns {Promise<{ data: T }>}\n */\n async find(params) {\n const response = await strapi.find(singularName, params);\n /** @type {any} */\n const rawData = response.data;\n /** @type {T} */\n const data = flattenRelations(flattenItem(rawData));\n return { data };\n },\n /**\n * @param {{ data: Partial<T> }} data\n * @returns {Promise<{ data: T }>}\n */\n async update(data) {\n const response = await strapi.update(singularName, String(1), data.data);\n /** @type {any} */\n const rawData = response.data;\n /** @type {T} */\n const result = flattenRelations(flattenItem(rawData));\n return { data: result };\n },\n /**\n * @returns {Promise<void>}\n */\n async delete() {\n await strapi.delete(singularName, String(1));\n },\n };\n}\n\nmodule.exports = { strapi, collection, single };\n`;\n }\n\n return `// @ts-check\n/**\n * Strapi Client (v5)\n * Generated by strapi2front\n */\n\nconst Strapi = require('strapi-sdk-js').default;\n\n// Initialize the Strapi client\nconst strapiUrl = process.env.STRAPI_URL || 'http://localhost:1337';\nconst strapiToken = process.env.STRAPI_TOKEN;\nconst strapiApiPrefix = process.env.STRAPI_API_PREFIX || '${normalizedPrefix}';\n\nconst strapi = new Strapi({\n url: strapiUrl,\n prefix: strapiApiPrefix,\n axiosOptions: {\n headers: strapiToken ? {\n Authorization: \\`Bearer \\${strapiToken}\\`,\n } : {},\n },\n});\n\n/** @type {import('./utils').StrapiPagination} */\nconst defaultPagination = {\n page: 1,\n pageSize: 25,\n pageCount: 1,\n total: 0,\n};\n\n/**\n * Helper to get typed collection\n * @template T\n * @param {string} pluralName\n */\nfunction collection(pluralName) {\n return {\n /**\n * @param {Record<string, unknown>} [params]\n * @returns {Promise<{ data: T[], meta: { pagination: import('./utils').StrapiPagination } }>}\n */\n async find(params) {\n const response = await strapi.find(pluralName, params);\n /** @type {any} */\n const rawMeta = response.meta;\n /** @type {any} */\n const rawPag = rawMeta?.pagination;\n /** @type {import('./utils').StrapiPagination} */\n const pagination = {\n page: rawPag?.page ?? defaultPagination.page,\n pageSize: rawPag?.pageSize ?? defaultPagination.pageSize,\n pageCount: rawPag?.pageCount ?? defaultPagination.pageCount,\n total: rawPag?.total ?? defaultPagination.total,\n };\n /** @type {any} */\n const rawData = response.data;\n /** @type {T[]} */\n const data = Array.isArray(rawData) ? rawData : [];\n return { data, meta: { pagination } };\n },\n /**\n * @param {string} documentId\n * @param {Record<string, unknown>} [params]\n * @returns {Promise<{ data: T }>}\n */\n async findOne(documentId, params) {\n const response = await strapi.findOne(pluralName, documentId, params);\n /** @type {any} */\n const rawData = response.data;\n /** @type {T} */\n const data = rawData;\n return { data };\n },\n /**\n * @param {{ data: Partial<T> }} data\n * @returns {Promise<{ data: T }>}\n */\n async create(data) {\n const response = await strapi.create(pluralName, data.data);\n /** @type {any} */\n const rawData = response.data;\n /** @type {T} */\n const result = rawData;\n return { data: result };\n },\n /**\n * @param {string} documentId\n * @param {{ data: Partial<T> }} data\n * @returns {Promise<{ data: T }>}\n */\n async update(documentId, data) {\n const response = await strapi.update(pluralName, documentId, data.data);\n /** @type {any} */\n const rawData = response.data;\n /** @type {T} */\n const result = rawData;\n return { data: result };\n },\n /**\n * @param {string} documentId\n * @returns {Promise<void>}\n */\n async delete(documentId) {\n await strapi.delete(pluralName, documentId);\n },\n };\n}\n\n/**\n * Helper to get typed single type\n * @template T\n * @param {string} singularName\n */\nfunction single(singularName) {\n return {\n /**\n * @param {Record<string, unknown>} [params]\n * @returns {Promise<{ data: T }>}\n */\n async find(params) {\n const response = await strapi.find(singularName, params);\n /** @type {any} */\n const rawData = response.data;\n /** @type {T} */\n const data = rawData;\n return { data };\n },\n /**\n * @param {{ data: Partial<T> }} data\n * @returns {Promise<{ data: T }>}\n */\n async update(data) {\n const response = await strapi.update(singularName, String(1), data.data);\n /** @type {any} */\n const rawData = response.data;\n /** @type {T} */\n const result = rawData;\n return { data: result };\n },\n /**\n * @returns {Promise<void>}\n */\n async delete() {\n await strapi.delete(singularName, String(1));\n },\n };\n}\n\nmodule.exports = { strapi, collection, single };\n`;\n}\n\nfunction generateLocalesFileJSDoc(locales: StrapiLocale[]): string {\n if (locales.length === 0) {\n return `// @ts-check\n/**\n * Strapi locales\n * Generated by strapi2front\n * Note: i18n is not enabled in Strapi\n */\n\n/** @type {readonly string[]} */\nconst locales = [];\n\n/** @typedef {string} Locale */\n\n/** @type {string} */\nconst defaultLocale = 'en';\n\n/** @type {Record<string, string>} */\nconst localeNames = {};\n\n/**\n * @param {string} _code\n * @returns {boolean}\n */\nfunction isValidLocale(_code) {\n return true;\n}\n\n/**\n * @param {string} code\n * @returns {string}\n */\nfunction getLocaleName(code) {\n return code;\n}\n\nmodule.exports = { locales, defaultLocale, localeNames, isValidLocale, getLocaleName };\n`;\n }\n\n const localeCodes = locales.map(l => l.code);\n const defaultLocale = locales.find(l => l.isDefault)?.code || locales[0]?.code || 'en';\n\n return `// @ts-check\n/**\n * Strapi locales\n * Generated by strapi2front\n */\n\n/** @type {readonly [${localeCodes.map(c => `'${c}'`).join(', ')}]} */\nconst locales = [${localeCodes.map(c => `'${c}'`).join(', ')}];\n\n/** @typedef {${localeCodes.map(c => `'${c}'`).join(' | ')}} Locale */\n\n/** @type {Locale} */\nconst defaultLocale = '${defaultLocale}';\n\n/** @type {Record<Locale, string>} */\nconst localeNames = {\n${locales.map(l => ` '${l.code}': '${l.name}'`).join(',\\n')}\n};\n\n/**\n * @param {string} code\n * @returns {boolean}\n */\nfunction isValidLocale(code) {\n /** @type {readonly string[]} */\n const localeList = locales;\n return localeList.includes(code);\n}\n\n/**\n * @param {Locale} code\n * @returns {string}\n */\nfunction getLocaleName(code) {\n return localeNames[code] || code;\n}\n\nmodule.exports = { locales, defaultLocale, localeNames, isValidLocale, getLocaleName };\n`;\n}\n\n// ============================================\n// JSDoc Collection Types Generation\n// ============================================\n\nfunction generateCollectionTypesJSDoc(collection: CollectionType, schema: ParsedSchema): string {\n const typeName = toPascalCase(collection.singularName);\n const attributes = generateJSDocAttributes(collection.attributes, schema, 'collection');\n\n return `// @ts-check\n/**\n * ${collection.displayName}\n * ${collection.description || ''}\n * Generated by strapi2front\n */\n\n/**\n * @typedef {import('../../shared/utils').StrapiBaseEntity & ${typeName}Attributes} ${typeName}\n */\n\n/**\n * @typedef {Object} ${typeName}Attributes\n${attributes}\n */\n\n/**\n * @typedef {Object} ${typeName}Filters\n * @property {number|{$eq?: number, $ne?: number, $in?: number[], $notIn?: number[]}} [id]\n * @property {string|{$eq?: string, $ne?: string}} [documentId]\n * @property {string|{$eq?: string, $gt?: string, $gte?: string, $lt?: string, $lte?: string}} [createdAt]\n * @property {string|{$eq?: string, $gt?: string, $gte?: string, $lt?: string, $lte?: string}} [updatedAt]\n * @property {string|null|{$eq?: string, $ne?: string, $null?: boolean}} [publishedAt]\n * @property {${typeName}Filters[]} [$and]\n * @property {${typeName}Filters[]} [$or]\n * @property {${typeName}Filters} [$not]\n */\n\nmodule.exports = {};\n`;\n}\n\nfunction generateSingleTypesJSDoc(single: SingleType, schema: ParsedSchema): string {\n const typeName = toPascalCase(single.singularName);\n const attributes = generateJSDocAttributes(single.attributes, schema, 'single');\n\n return `// @ts-check\n/**\n * ${single.displayName}\n * ${single.description || ''}\n * Generated by strapi2front\n */\n\n/**\n * @typedef {import('../../shared/utils').StrapiBaseEntity & ${typeName}Attributes} ${typeName}\n */\n\n/**\n * @typedef {Object} ${typeName}Attributes\n${attributes}\n */\n\nmodule.exports = {};\n`;\n}\n\nfunction generateComponentTypesJSDoc(component: ComponentType, schema: ParsedSchema): string {\n const typeName = toPascalCase(component.name);\n const attributes = generateJSDocAttributes(component.attributes, schema, 'component');\n\n return `// @ts-check\n/**\n * ${component.displayName} component\n * Category: ${component.category}\n * ${component.description || ''}\n * Generated by strapi2front\n */\n\n/**\n * @typedef {Object} ${typeName}\n * @property {number} id\n${attributes}\n */\n\nmodule.exports = {};\n`;\n}\n\nfunction generateJSDocAttributes(\n attributes: Record<string, Attribute>,\n schema: ParsedSchema,\n context: 'collection' | 'single' | 'component'\n): string {\n const lines: string[] = [];\n const relativePrefix = context === 'component' ? '..' : '../..';\n\n for (const [name, attr] of Object.entries(attributes)) {\n const jsType = attributeToJSDocType(attr, schema, relativePrefix);\n const optional = attr.required ? '' : '[';\n const optionalEnd = attr.required ? '' : ']';\n lines.push(` * @property {${jsType}} ${optional}${name}${optionalEnd}`);\n }\n\n return lines.join('\\n');\n}\n\nfunction attributeToJSDocType(\n attr: Attribute,\n schema: ParsedSchema,\n relativePrefix: string\n): string {\n switch (attr.type) {\n case 'string':\n case 'text':\n case 'richtext':\n case 'email':\n case 'password':\n case 'uid':\n return 'string';\n case 'blocks':\n return 'Array<Object>';\n case 'integer':\n case 'biginteger':\n case 'float':\n case 'decimal':\n return 'number';\n case 'boolean':\n return 'boolean';\n case 'date':\n case 'time':\n case 'datetime':\n case 'timestamp':\n return 'string';\n case 'json':\n return 'Object';\n case 'enumeration':\n if ('enum' in attr && attr.enum) {\n return attr.enum.map(v => `'${v}'`).join('|');\n }\n return 'string';\n case 'media':\n if ('multiple' in attr && attr.multiple) {\n return `import(\"${relativePrefix}/shared/utils\").StrapiMedia[]`;\n }\n return `import(\"${relativePrefix}/shared/utils\").StrapiMedia|null`;\n case 'relation':\n if ('target' in attr && attr.target) {\n const targetName = attr.target.split('.').pop() || 'unknown';\n const typeName = toPascalCase(targetName);\n const fileName = toKebabCase(targetName);\n const isMany = attr.relation === 'oneToMany' || attr.relation === 'manyToMany';\n\n // Determine if target is a collection or single\n const isCollection = schema.collections.some(c => c.singularName === targetName);\n const isSingle = schema.singles.some(s => s.singularName === targetName);\n\n let importPath: string;\n if (isCollection) {\n importPath = `${relativePrefix}/collections/${fileName}/types`;\n } else if (isSingle) {\n importPath = `${relativePrefix}/singles/${fileName}/types`;\n } else {\n // Fallback - assume collection\n importPath = `${relativePrefix}/collections/${fileName}/types`;\n }\n\n const importType = `import(\"${importPath}\").${typeName}`;\n return isMany ? `${importType}[]` : `${importType}|null`;\n }\n return 'Object';\n case 'component':\n if ('component' in attr && attr.component) {\n const componentName = attr.component.split('.').pop() || 'unknown';\n const typeName = toPascalCase(componentName);\n const fileName = toKebabCase(componentName);\n const importPath = `${relativePrefix}/components/${fileName}`;\n const importType = `import(\"${importPath}\").${typeName}`;\n\n if ('repeatable' in attr && attr.repeatable) {\n return `${importType}[]`;\n }\n return `${importType}|null`;\n }\n return 'Object';\n case 'dynamiczone':\n if ('components' in attr && attr.components) {\n const types = attr.components.map(comp => {\n const componentName = comp.split('.').pop() || 'unknown';\n const typeName = toPascalCase(componentName);\n const fileName = toKebabCase(componentName);\n const importPath = `${relativePrefix}/components/${fileName}`;\n return `import(\"${importPath}\").${typeName}`;\n });\n return `(${types.join('|')})[]`;\n }\n return 'Object[]';\n default:\n return 'Object';\n }\n}\n\n// ============================================\n// JSDoc Collection Service Generation\n// ============================================\n\nfunction generateCollectionServiceJSDoc(collection: CollectionType, strapiVersion: \"v4\" | \"v5\"): string {\n const typeName = toPascalCase(collection.singularName);\n const serviceName = toCamelCase(collection.singularName) + 'Service';\n const endpoint = collection.pluralName;\n const hasSlug = 'slug' in collection.attributes;\n const { localized, draftAndPublish } = collection;\n const isV4 = strapiVersion === \"v4\";\n\n // V4 uses `id: number`, V5 uses `documentId: string`\n const idParam = isV4 ? 'id' : 'documentId';\n const idType = isV4 ? 'number' : 'string';\n\n return `// @ts-check\n/**\n * ${collection.displayName} Service\n * ${collection.description || ''}\n * Generated by strapi2front\n * Strapi version: ${strapiVersion}\n */\n\nconst { collection } = require('../../shared/client');\n\n/**\n * @typedef {Object} FindManyOptions\n * @property {import('./types').${typeName}Filters} [filters]\n * @property {Object} [pagination]\n * @property {number} [pagination.page]\n * @property {number} [pagination.pageSize]\n * @property {number} [pagination.start]\n * @property {number} [pagination.limit]\n * @property {string|string[]} [sort]\n * @property {string|string[]|Record<string, unknown>} [populate]${localized ? '\\n * @property {string} [locale]' : ''}${draftAndPublish ? \"\\n * @property {'draft'|'published'} [status]\" : ''}\n */\n\n/**\n * @typedef {Object} FindOneOptions\n * @property {string|string[]|Record<string, unknown>} [populate]${localized ? '\\n * @property {string} [locale]' : ''}${draftAndPublish ? \"\\n * @property {'draft'|'published'} [status]\" : ''}\n */\n\n/** @type {ReturnType<typeof collection<import('./types').${typeName}>>} */\nconst ${toCamelCase(collection.singularName)}Collection = collection('${endpoint}');\n\nconst ${serviceName} = {\n /**\n * @param {FindManyOptions} [options]\n * @returns {Promise<{ data: import('./types').${typeName}[], pagination: import('../../shared/utils').StrapiPagination }>}\n */\n async findMany(options = {}) {\n const response = await ${toCamelCase(collection.singularName)}Collection.find({\n filters: options.filters,\n pagination: options.pagination,\n sort: options.sort,\n populate: options.populate,${localized ? '\\n locale: options.locale,' : ''}${draftAndPublish ? '\\n status: options.status,' : ''}\n });\n\n return {\n data: response.data,\n pagination: response.meta.pagination,\n };\n },\n\n /**\n * @param {Omit<FindManyOptions, 'pagination'>} [options]\n * @returns {Promise<import('./types').${typeName}[]>}\n */\n async findAll(options = {}) {\n /** @type {import('./types').${typeName}[]} */\n const allItems = [];\n let page = 1;\n let hasMore = true;\n\n while (hasMore) {\n const { data, pagination } = await this.findMany({\n ...options,\n pagination: { page, pageSize: 100 },\n });\n\n allItems.push(...data);\n hasMore = page < pagination.pageCount;\n page++;\n }\n\n return allItems;\n },\n\n /**\n * @param {${idType}} ${idParam}\n * @param {FindOneOptions} [options]\n * @returns {Promise<import('./types').${typeName}|null>}\n */\n async findOne(${idParam}, options = {}) {\n try {\n const response = await ${toCamelCase(collection.singularName)}Collection.findOne(${idParam}, {\n populate: options.populate,${localized ? '\\n locale: options.locale,' : ''}${draftAndPublish ? '\\n status: options.status,' : ''}\n });\n\n return response.data;\n } catch (error) {\n if (error instanceof Error && error.message.includes('404')) {\n return null;\n }\n throw error;\n }\n },\n${hasSlug ? `\n /**\n * @param {string} slug\n * @param {FindOneOptions} [options]\n * @returns {Promise<import('./types').${typeName}|null>}\n */\n async findBySlug(slug, options = {}) {\n const { data } = await this.findMany({\n filters: /** @type {import('./types').${typeName}Filters} */ ({ slug: { $eq: slug } }),\n pagination: { pageSize: 1 },\n populate: options.populate,${localized ? '\\n locale: options.locale,' : ''}${draftAndPublish ? '\\n status: options.status,' : ''}\n });\n\n return data[0] || null;\n },\n` : ''}\n /**\n * @param {Partial<import('./types').${typeName}>} data\n * @returns {Promise<import('./types').${typeName}>}\n */\n async create(data) {\n const response = await ${toCamelCase(collection.singularName)}Collection.create({ data });\n return response.data;\n },\n\n /**\n * @param {${idType}} ${idParam}\n * @param {Partial<import('./types').${typeName}>} data\n * @returns {Promise<import('./types').${typeName}>}\n */\n async update(${idParam}, data) {\n const response = await ${toCamelCase(collection.singularName)}Collection.update(${idParam}, { data });\n return response.data;\n },\n\n /**\n * @param {${idType}} ${idParam}\n * @returns {Promise<void>}\n */\n async delete(${idParam}) {\n await ${toCamelCase(collection.singularName)}Collection.delete(${idParam});\n },\n\n /**\n * @param {import('./types').${typeName}Filters} [filters]\n * @returns {Promise<number>}\n */\n async count(filters) {\n const { pagination } = await this.findMany({\n filters,\n pagination: { pageSize: 1 },\n });\n\n return pagination.total;\n },\n};\n\nmodule.exports = { ${serviceName} };\n`;\n}\n\n// ============================================\n// JSDoc Single Service Generation\n// ============================================\n\nfunction generateSingleServiceJSDoc(single: SingleType, strapiVersion: \"v4\" | \"v5\"): string {\n const typeName = toPascalCase(single.singularName);\n const serviceName = toCamelCase(single.singularName) + 'Service';\n const endpoint = single.singularName;\n const { localized, draftAndPublish } = single;\n\n return `// @ts-check\n/**\n * ${single.displayName} Service (Single Type)\n * ${single.description || ''}\n * Generated by strapi2front\n * Strapi version: ${strapiVersion}\n */\n\nconst { single } = require('../../shared/client');\n\n/**\n * @typedef {Object} FindOptions\n * @property {string|string[]|Record<string, unknown>} [populate]${localized ? '\\n * @property {string} [locale]' : ''}${draftAndPublish ? \"\\n * @property {'draft'|'published'} [status]\" : ''}\n */\n\n/** @type {ReturnType<typeof single<import('./types').${typeName}>>} */\nconst ${toCamelCase(single.singularName)}Single = single('${endpoint}');\n\nconst ${serviceName} = {\n /**\n * @param {FindOptions} [options]\n * @returns {Promise<import('./types').${typeName}|null>}\n */\n async find(options = {}) {\n try {\n const response = await ${toCamelCase(single.singularName)}Single.find({\n populate: options.populate,${localized ? '\\n locale: options.locale,' : ''}${draftAndPublish ? '\\n status: options.status,' : ''}\n });\n\n return response.data;\n } catch (error) {\n if (error instanceof Error && error.message.includes('404')) {\n return null;\n }\n throw error;\n }\n },\n\n /**\n * @param {Partial<import('./types').${typeName}>} data\n * @returns {Promise<import('./types').${typeName}>}\n */\n async update(data) {\n const response = await ${toCamelCase(single.singularName)}Single.update({ data });\n return response.data;\n },\n\n /**\n * @returns {Promise<void>}\n */\n async delete() {\n await ${toCamelCase(single.singularName)}Single.delete();\n },\n};\n\nmodule.exports = { ${serviceName} };\n`;\n}\n","/**\n * Next.js Server Actions generator\n * Generates type-safe Server Actions for Strapi content types\n *\n * Requirements:\n * - Next.js 14+ (Server Actions)\n * - TypeScript enabled\n *\n * Status: COMING SOON\n */\n\nimport type { ParsedSchema } from '@strapi2front/core';\nimport type { StrapiVersion } from '../../shared/types.js';\n\nexport interface NextJsActionsOptions {\n outputDir: string;\n servicesImportPath: string;\n strapiVersion?: StrapiVersion;\n}\n\n/**\n * Generate Next.js Server Actions from parsed schema\n *\n * @throws Error - Not yet implemented\n */\nexport async function generateNextJsActions(\n _schema: ParsedSchema,\n _options: NextJsActionsOptions\n): Promise<string[]> {\n throw new Error(\n 'Next.js Server Actions generator is not yet implemented. ' +\n 'Coming soon! For now, you can use the generated services directly.'\n );\n}\n\n/**\n * Check if Next.js Server Actions are supported\n * Requires Next.js 14+ with App Router\n */\nexport function isNextJsActionsSupported(nextVersion: string | null): boolean {\n if (!nextVersion) return false;\n\n // Remove ^ or ~ prefix and get major version\n const match = nextVersion.replace(/^[\\^~]/, \"\").match(/^(\\d+)/);\n const majorVersion = match ? parseInt(match[1], 10) : null;\n\n return majorVersion !== null && majorVersion >= 14;\n}\n","/**\n * Nuxt Server Routes generator\n * Generates type-safe server routes for Strapi content types\n *\n * Requirements:\n * - Nuxt 3+\n * - TypeScript enabled\n *\n * Status: COMING SOON\n */\n\nimport type { ParsedSchema } from '@strapi2front/core';\nimport type { StrapiVersion } from '../../shared/types.js';\n\nexport interface NuxtServerRoutesOptions {\n outputDir: string;\n servicesImportPath: string;\n strapiVersion?: StrapiVersion;\n}\n\n/**\n * Generate Nuxt Server Routes from parsed schema\n *\n * @throws Error - Not yet implemented\n */\nexport async function generateNuxtServerRoutes(\n _schema: ParsedSchema,\n _options: NuxtServerRoutesOptions\n): Promise<string[]> {\n throw new Error(\n 'Nuxt Server Routes generator is not yet implemented. ' +\n 'Coming soon! For now, you can use the generated services directly.'\n );\n}\n\n/**\n * Check if Nuxt Server Routes are supported\n * Requires Nuxt 3+\n */\nexport function isNuxtServerRoutesSupported(nuxtVersion: string | null): boolean {\n if (!nuxtVersion) return false;\n\n // Remove ^ or ~ prefix and get major version\n const match = nuxtVersion.replace(/^[\\^~]/, \"\").match(/^(\\d+)/);\n const majorVersion = match ? parseInt(match[1], 10) : null;\n\n return majorVersion !== null && majorVersion >= 3;\n}\n","/**\n * Framework-specific generators\n *\n * Each framework has its own approach to server-side data fetching:\n * - Astro: Actions (v4+)\n * - Next.js: Server Actions (v14+) - Coming Soon\n * - Nuxt: Server Routes (v3+) - Coming Soon\n */\n\n// Astro\nexport { generateAstroActions, isAstroActionsSupported } from './astro/actions.js';\nexport type { AstroActionsOptions } from './astro/actions.js';\n\n// Next.js (Coming Soon)\nexport { generateNextJsActions, isNextJsActionsSupported } from './nextjs/actions.js';\nexport type { NextJsActionsOptions } from './nextjs/actions.js';\n\n// Nuxt (Coming Soon)\nexport { generateNuxtServerRoutes, isNuxtServerRoutesSupported } from './nuxt/server-routes.js';\nexport type { NuxtServerRoutesOptions } from './nuxt/server-routes.js';\n\n/**\n * Supported frameworks for action generation\n */\nexport type SupportedFramework = 'astro' | 'nextjs' | 'nuxt';\n\n/**\n * Framework support status\n */\nexport const frameworkSupport: Record<SupportedFramework, { status: 'stable' | 'coming-soon'; minVersion: string }> = {\n astro: { status: 'stable', minVersion: '4.0.0' },\n nextjs: { status: 'coming-soon', minVersion: '14.0.0' },\n nuxt: { status: 'coming-soon', minVersion: '3.0.0' },\n};\n"]}
|