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Y,gBAE1F,UAEA,EAAI,WAAW,QAAQ,sBAAsB,2BAC7C,MAAM,WACN,kBAAkB,EAAe,cACvC,QAAQ,IAAI,OACf,EAnJD","file":"/npm/@paxada/axios-client-generator@1.0.56/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@paxada/axios-client-generator@1.0.56/dist/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","#!/usr/bin/env node\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.initializeProject = void 0;\nconst child_process_1 = require(\"child_process\");\nconst fs_extra_1 = require(\"fs-extra\");\nconst path_1 = require(\"path\");\nconst files_helpers_1 = require(\"./files.helpers\");\nrequire(\"./handlebars.helpers\");\nconst handlebars_helpers_1 = require(\"./handlebars.helpers\");\nconst helpers_1 = require(\"./helpers\");\nconst moduleAliases_helpers_1 = require(\"./moduleAliases.helpers\");\nconst projectParsing_1 = require(\"./projectParsing\");\nconst typescript_compiler_1 = require(\"./typescript_compiler\");\nconst addAliasesInTsConfig_1 = require(\"./addAliasesInTsConfig\");\nconst createExportsString_1 = require(\"./createExportsString\");\nconst getPeerDepsFromPaths_1 = require(\"./getPeerDepsFromPaths\");\nconst parseProject_1 = require(\"./parseProject\");\nconst getCommandArgs_1 = require(\"./getCommandArgs\");\nconst lodash_1 = require(\"lodash\");\nglobal.require = require;\nconst sleep = (time) => new Promise((r) => setTimeout(r, time));\nasync function runNpmRunPrettify(path) {\n    console.log('Executing... npm run prettify');\n    return (0, child_process_1.exec)(`cd ${path} && npm run prettify`);\n}\nasync function runNpmInstall(path) {\n    console.log('Executing... npm install');\n    return (0, child_process_1.exec)(`cd ${path} && npm i`);\n}\nconst initializeProject = async (path) => {\n    console.log('Initializing new client');\n    await (0, fs_extra_1.remove)(path);\n    await (0, fs_extra_1.copy)((0, path_1.join)(__dirname, 'templates/project'), path, { overwrite: true });\n    await runNpmInstall(path);\n};\nexports.initializeProject = initializeProject;\n(async () => {\n    const { extraExportPaths, folderName, packageName, configFile, includedRoutes, excludedRoutes, tsConfigPath, } = (0, getCommandArgs_1.getCommandArgs)();\n    const axiosClientConfig = await (0, helpers_1.getAxiosClientConfig)(process.cwd(), configFile);\n    console.log('Compiling api');\n    const { error } = await (0, typescript_compiler_1.compileTypescriptProject)(tsConfigPath || axiosClientConfig.tsConfigPath);\n    if (error)\n        throw new Error(error.message);\n    console.log('Registering aliases');\n    await (0, moduleAliases_helpers_1.registerModuleAliases)(process.cwd());\n    console.log('Parsing project');\n    const clientMetadata = await (0, parseProject_1.parseProject)({\n        folderName,\n        packageName,\n        excludedRoutes,\n        includedRoutes,\n        configFile,\n        extraExportPaths,\n    });\n    console.log('Writing ' + clientMetadata.clientFolder);\n    await (0, exports.initializeProject)(clientMetadata.clientFolder);\n    const clientImports = (0, helpers_1.buildClientImportString)(clientMetadata.routes.map((route) => ({\n        functionName: route.functionName,\n        indexFilePath: route.generated.indexFilePath,\n        projectSourcePath: clientMetadata.srcFolder,\n    })));\n    const clientExports = (0, helpers_1.buildClientExportsString)(clientMetadata.routes.map((route) => ({\n        projectSourcePath: clientMetadata.srcFolder,\n        interfaceFilePath: route?.interfaceFilePath,\n        typeFilePath: route.generated.typeFilePath,\n    })));\n    const extraExports = (0, createExportsString_1.createExportsString)(clientMetadata.extraExportPaths.map((path) => ({\n        basePath: clientMetadata.srcFolder,\n        targetPath: (0, path_1.join)(clientMetadata.projectFolder, path),\n    })));\n    const extraExportsDeps = await (0, getPeerDepsFromPaths_1.getDepsFromPaths)(clientMetadata.projectFolder, clientMetadata.extraExportPaths.map((path) => (0, path_1.join)(clientMetadata.projectFolder, path)));\n    const typeImports = (0, helpers_1.buildTypeImportString)(clientMetadata.routes.map((route) => ({\n        functionInterfaceName: route.functionInterfaceName,\n        projectSourcePath: clientMetadata.srcFolder,\n        typeFilePath: route.generated.typeFilePath,\n    })));\n    const entitiesInterfacesExports = (0, createExportsString_1.createExportsString)(clientMetadata.entityInterfacesPaths.map((path) => ({\n        basePath: clientMetadata.srcFolder,\n        targetPath: path,\n    })));\n    await (0, files_helpers_1.insert)(entitiesInterfacesExports)\n        .aboveLineContaining('[INSERT EXPORTS]')\n        .inFile(clientMetadata.files.index.absolutePath);\n    await (0, files_helpers_1.insert)(clientExports).aboveLineContaining('[INSERT EXPORTS]').inFile(clientMetadata.files.index.absolutePath);\n    await (0, files_helpers_1.insert)(extraExports).aboveLineContaining('[INSERT EXPORTS]').inFile(clientMetadata.files.index.absolutePath);\n    await (0, files_helpers_1.insert)(clientImports)\n        .aboveLineContaining('[INSERT IMPORTS]')\n        .inFile(clientMetadata.files.requests.absolutePath);\n    await (0, files_helpers_1.insert)(clientMetadata.clientObject)\n        .aboveLineContaining('[INSERT CLIENT]')\n        .inFile(clientMetadata.files.requests.absolutePath);\n    await (0, files_helpers_1.insert)(clientMetadata.clientTypings)\n        .aboveLineContaining('[INSERT CLIENT TYPINGS]')\n        .inFile(clientMetadata.files.clientTypes.absolutePath);\n    await (0, files_helpers_1.insert)(typeImports)\n        .aboveLineContaining('[INSERT CLIENT IMPORTS]')\n        .inFile(clientMetadata.files.clientTypes.absolutePath);\n    console.log('Add aliases tsconfig.json');\n    (0, addAliasesInTsConfig_1.addAliasesInTsConfig)({\n        projectFolderPath: clientMetadata.clientFolder,\n        srcPath: clientMetadata.srcFolder,\n    });\n    console.log('Creating package.json');\n    (0, handlebars_helpers_1.createFileFromHBS)({\n        templatePath: (0, path_1.join)(__dirname, 'templates', 'function', 'package.json.template.hbs'),\n        data: {\n            version: clientMetadata.packageVersion,\n            packageName: clientMetadata.packageName,\n            folderName: clientMetadata.folderName,\n            extraExportsDeps,\n        },\n        filePath: (0, path_1.join)(clientMetadata.clientFolder, 'package.json'),\n    });\n    console.log('Creating README.md');\n    (0, handlebars_helpers_1.createFileFromHBS)({\n        templatePath: (0, path_1.join)(__dirname, 'templates', 'function', 'README.md.template.hbs'),\n        data: {\n            packageName: clientMetadata.packageName,\n            folderName: clientMetadata.folderName,\n            folderNameCC: (0, lodash_1.camelCase)(clientMetadata.folderName),\n            folderNameUpperCC: (0, lodash_1.capitalize)((0, lodash_1.camelCase)(clientMetadata.folderName)),\n            documentation: clientMetadata.clientDocs,\n        },\n        filePath: (0, path_1.join)(clientMetadata.clientFolder, 'README.md'),\n    });\n    console.log('Creating mock');\n    (0, handlebars_helpers_1.createFileFromHBS)({\n        templatePath: (0, path_1.join)(__dirname, 'templates', 'function', 'mock.ts.template.hbs'),\n        data: {\n            mockedObject: clientMetadata.clientMock,\n        },\n        filePath: (0, path_1.join)(clientMetadata.srcFolder, 'mock.ts'),\n    });\n    console.log('Creating client methods');\n    clientMetadata.routes.forEach((route) => {\n        (0, handlebars_helpers_1.createFileFromHBS)({\n            templatePath: (0, path_1.join)(__dirname, 'templates', 'function', 'index.template.hbs'),\n            filePath: route.generated.indexFilePath,\n            data: {\n                routeSuccessInterface: (0, projectParsing_1.getRouteSuccessInterface)(route.interfaces?.responsesInterfaces),\n                routeInterfaceRelativePath: route.interfaceFilePath === undefined\n                    ? undefined\n                    : (0, helpers_1.buildRelativeImport)(route.generated.folderPath, route.interfaceFilePath),\n                clientTypeRelativePath: (0, helpers_1.buildRelativeImport)(route.generated.folderPath, clientMetadata.files.clientTypes.absolutePath),\n                requestTypeRelativePath: (0, helpers_1.buildRelativeImport)(route.generated.folderPath, clientMetadata.files.requestTypes.absolutePath),\n                functionInterfaceRelativePath: (0, helpers_1.buildRelativeImport)(route.generated.folderPath, route.generated.typeFilePath),\n                functionInterfaceName: route.functionInterfaceName,\n                functionName: route.functionName,\n                bodyInterface: route.interfaces?.bodyInterface,\n                queryInterface: route.interfaces?.queryInterface,\n                pathParamsInterface: route.interfaces?.pathInterface,\n                method: route.method.toLocaleLowerCase(),\n                hasBody: route.interfaces?.bodyInterface,\n                hasQuery: route.interfaces?.queryInterface,\n                hasPathParams: route.interfaces?.pathInterface,\n                routePath: (0, helpers_1.interpolateRoutePath)(route.path),\n                shouldHaveDefaultBody: ['put', 'post'].includes(route.method) && !route.interfaces?.bodyInterface,\n            },\n        });\n        (0, handlebars_helpers_1.createFileFromHBS)({\n            templatePath: (0, path_1.join)(__dirname, 'templates', 'function', 'types.template.hbs'),\n            filePath: route.generated.typeFilePath,\n            data: {\n                routeInterfaceRelativePath: route.interfaceFilePath === undefined\n                    ? undefined\n                    : (0, helpers_1.buildRelativeImport)(route.generated.folderPath, route.interfaceFilePath),\n                requestTypeRelativePath: (0, helpers_1.buildRelativeImport)(route.generated.folderPath, clientMetadata.files.requestTypes.absolutePath),\n                functionInterfaceName: route.functionInterfaceName,\n                routeSuccessInterface: route.interfaces === undefined ? undefined : (0, projectParsing_1.getRouteSuccessInterface)(route.interfaces.responsesInterfaces),\n                bodyInterface: route.interfaces?.bodyInterface,\n                queryInterface: route.interfaces?.queryInterface,\n                pathParamsInterface: route.interfaces?.pathInterface,\n                hasBody: route.interfaces?.bodyInterface,\n                hasQuery: route.interfaces?.queryInterface,\n                hasPathParams: route.interfaces?.pathInterface,\n                shouldHaveDefaultBody: ['put', 'post'].includes(route.method) && !route.interfaces?.bodyInterface,\n            },\n        });\n    });\n    await (0, fs_extra_1.remove)(typescript_compiler_1.compiledProjectPath);\n    await sleep(2000);\n    await runNpmRunPrettify(clientMetadata.clientFolder);\n    console.log('Done');\n})();\n"]}